~ubuntu-branches/ubuntu/utopic/grub/utopic

« back to all changes in this revision

Viewing changes to depcomp

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2005-11-30 18:00:45 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051130180045-q90uxa58hf9pdrrp
Tags: 0.97-1ubuntu1
* Resynchronise with Debian.
* Drop Nathaniel McCallum's nonaltoptions patch, done differently in
  Debian (as defoptions); added migration code to deal with old Ubuntu
  menu.lst files.
* Drop Matthew Garrett's stage 2 drive fallback patch, since upstream has
  implemented a different solution which appears to address essentially
  the same problem.
* Generated debian/control once from debian/control.in using
  type-handling, but continue to avoid the build-dependency on
  type-handling; the generated debian/control is in the source package.
* Disable fix_amd64_compile.diff for now; it causes configure to fail with
  "GRUB requires a working absolute objcopy; upgrade your binutils".

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
# depcomp - compile a program generating dependencies as side-effects
3
3
 
4
 
scriptversion=2003-11-08.23
 
4
scriptversion=2004-05-31.23
5
5
 
6
 
# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
 
6
# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
7
7
 
8
8
# This program is free software; you can redistribute it and/or modify
9
9
# it under the terms of the GNU General Public License as published by
43
43
  depmode     Dependency tracking mode.
44
44
  source      Source file read by `PROGRAMS ARGS'.
45
45
  object      Object file output by `PROGRAMS ARGS'.
 
46
  DEPDIR      directory where to store dependencies.
46
47
  depfile     Dependency file to output.
47
48
  tmpdepfile  Temporary file to use when outputing dependencies.
48
49
  libtool     Whether libtool is used (yes/no).
61
62
  echo "depcomp: Variables source, object and depmode must be set" 1>&2
62
63
  exit 1
63
64
fi
64
 
# `libtool' can also be set to `yes' or `no'.
65
 
 
66
 
if test -z "$depfile"; then
67
 
   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
68
 
   dir=`echo "$object" | sed 's,/.*$,/,'`
69
 
   if test "$dir" = "$object"; then
70
 
      dir=
71
 
   fi
72
 
   # FIXME: should be _deps on DOS.
73
 
   depfile="$dir.deps/$base"
74
 
fi
75
 
 
 
65
 
 
66
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
 
67
depfile=${depfile-`echo "$object" |
 
68
  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
76
69
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
77
70
 
78
71
rm -f "$tmpdepfile"
294
287
   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
295
288
 
296
289
   if test "$libtool" = yes; then
 
290
      # Dependencies are output in .lo.d with libtool 1.4.
 
291
      # With libtool 1.5 they are output both in $dir.libs/$base.o.d
 
292
      # and in $dir.libs/$base.o.d and $dir$base.o.d.  We process the
 
293
      # latter, because the former will be cleaned when $dir.libs is
 
294
      # erased.
297
295
      tmpdepfile1="$dir.libs/$base.lo.d"
298
 
      tmpdepfile2="$dir.libs/$base.d"
 
296
      tmpdepfile2="$dir$base.o.d"
 
297
      tmpdepfile3="$dir.libs/$base.d"
299
298
      "$@" -Wc,-MD
300
299
   else
301
300
      tmpdepfile1="$dir$base.o.d"
302
301
      tmpdepfile2="$dir$base.d"
 
302
      tmpdepfile3="$dir$base.d"
303
303
      "$@" -MD
304
304
   fi
305
305
 
306
306
   stat=$?
307
307
   if test $stat -eq 0; then :
308
308
   else
309
 
      rm -f "$tmpdepfile1" "$tmpdepfile2"
 
309
      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
310
310
      exit $stat
311
311
   fi
312
312
 
313
313
   if test -f "$tmpdepfile1"; then
314
314
      tmpdepfile="$tmpdepfile1"
315
 
   else
 
315
   elif test -f "$tmpdepfile2"; then
316
316
      tmpdepfile="$tmpdepfile2"
 
317
   else
 
318
      tmpdepfile="$tmpdepfile3"
317
319
   fi
318
320
   if test -f "$tmpdepfile"; then
319
321
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"