~ubuntu-branches/ubuntu/karmic/photoprint/karmic

« back to all changes in this revision

Viewing changes to scripts/depcomp

  • Committer: Bazaar Package Importer
  • Author(s): Milan Zamazal
  • Date: 2007-05-01 16:32:13 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070501163213-ni1933khtg9fdvn5
Tags: 0.3.5-2
Move to unstable.

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=2004-05-31.23
 
4
scriptversion=2005-07-09.11
5
5
 
6
 
# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
 
6
# Copyright (C) 1999, 2000, 2003, 2004, 2005 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
17
17
 
18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program; if not, write to the Free Software
20
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21
 
# 02111-1307, USA.
 
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
21
# 02110-1301, USA.
22
22
 
23
23
# As a special exception to the GNU General Public License, if you
24
24
# distribute this file as part of a program that contains a
50
50
 
51
51
Report bugs to <bug-automake@gnu.org>.
52
52
EOF
53
 
    exit 0
 
53
    exit $?
54
54
    ;;
55
55
  -v | --v*)
56
56
    echo "depcomp $scriptversion"
57
 
    exit 0
 
57
    exit $?
58
58
    ;;
59
59
esac
60
60
 
287
287
   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
288
288
 
289
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.
295
 
      tmpdepfile1="$dir.libs/$base.lo.d"
296
 
      tmpdepfile2="$dir$base.o.d"
297
 
      tmpdepfile3="$dir.libs/$base.d"
 
290
      # With Tru64 cc, shared objects can also be used to make a
 
291
      # static library.  This mecanism is used in libtool 1.4 series to
 
292
      # handle both shared and static libraries in a single compilation.
 
293
      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
 
294
      #
 
295
      # With libtool 1.5 this exception was removed, and libtool now
 
296
      # generates 2 separate objects for the 2 libraries.  These two
 
297
      # compilations output dependencies in in $dir.libs/$base.o.d and
 
298
      # in $dir$base.o.d.  We have to check for both files, because
 
299
      # one of the two compilations can be disabled.  We should prefer
 
300
      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
 
301
      # automatically cleaned when .libs/ is deleted, while ignoring
 
302
      # the former would cause a distcleancheck panic.
 
303
      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
 
304
      tmpdepfile2=$dir$base.o.d          # libtool 1.5
 
305
      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
 
306
      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
298
307
      "$@" -Wc,-MD
299
308
   else
300
 
      tmpdepfile1="$dir$base.o.d"
301
 
      tmpdepfile2="$dir$base.d"
302
 
      tmpdepfile3="$dir$base.d"
 
309
      tmpdepfile1=$dir$base.o.d
 
310
      tmpdepfile2=$dir$base.d
 
311
      tmpdepfile3=$dir$base.d
 
312
      tmpdepfile4=$dir$base.d
303
313
      "$@" -MD
304
314
   fi
305
315
 
306
316
   stat=$?
307
317
   if test $stat -eq 0; then :
308
318
   else
309
 
      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
 
319
      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
310
320
      exit $stat
311
321
   fi
312
322
 
313
 
   if test -f "$tmpdepfile1"; then
314
 
      tmpdepfile="$tmpdepfile1"
315
 
   elif test -f "$tmpdepfile2"; then
316
 
      tmpdepfile="$tmpdepfile2"
317
 
   else
318
 
      tmpdepfile="$tmpdepfile3"
319
 
   fi
 
323
   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
 
324
   do
 
325
     test -f "$tmpdepfile" && break
 
326
   done
320
327
   if test -f "$tmpdepfile"; then
321
328
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
322
329
      # That's a tab and a space in the [].
460
467
  done
461
468
 
462
469
  "$@" -E |
463
 
    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
 
470
    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
 
471
       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
464
472
    sed '$ s: \\$::' > "$tmpdepfile"
465
473
  rm -f "$depfile"
466
474
  echo "$object : \\" > "$depfile"