2
2
# depcomp - compile a program generating dependencies as side-effects
4
scriptversion=2005-07-09.11
4
scriptversion=2004-05-31.23
6
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
6
# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
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
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., 51 Franklin Street, Fifth Floor, Boston, MA
20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
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
287
287
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
289
289
if test "$libtool" = yes; then
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.
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
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
295
tmpdepfile1="$dir.libs/$base.lo.d"
296
tmpdepfile2="$dir$base.o.d"
297
tmpdepfile3="$dir.libs/$base.d"
309
tmpdepfile1=$dir$base.o.d
310
tmpdepfile2=$dir$base.d
311
tmpdepfile3=$dir$base.d
312
tmpdepfile4=$dir$base.d
300
tmpdepfile1="$dir$base.o.d"
301
tmpdepfile2="$dir$base.d"
302
tmpdepfile3="$dir$base.d"
317
307
if test $stat -eq 0; then :
319
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
309
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
323
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
325
test -f "$tmpdepfile" && break
313
if test -f "$tmpdepfile1"; then
314
tmpdepfile="$tmpdepfile1"
315
elif test -f "$tmpdepfile2"; then
316
tmpdepfile="$tmpdepfile2"
318
tmpdepfile="$tmpdepfile3"
327
320
if test -f "$tmpdepfile"; then
328
321
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
329
322
# That's a tab and a space in the [].