]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/depcomp (aix): Rewrite depmode in the spirit of the tru64
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 28 Mar 2007 23:08:06 +0000 (23:08 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 28 Mar 2007 23:08:06 +0000 (23:08 +0000)
one.  Fixes failure to catch dependencies with libtool and xlc
in case of enable_static=no (which is the default on AIX without
runtimelinking).
* tests/depcomp7.test: Run test once with --disable-shared and
once with --disable-static, to expose failure systematically.
* NEWS: Update.

ChangeLog
NEWS
lib/depcomp
tests/depcomp7.test

index aab25c1eb9b62ae12a2ea5006088642d5cb8465c..5dbfeb62ad99616d15d284f141354a9c6b51f54a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-03-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * lib/depcomp (aix): Rewrite depmode in the spirit of the tru64
+       one.  Fixes failure to catch dependencies with libtool and xlc
+       in case of enable_static=no (which is the default on AIX without
+       runtimelinking).
+       * tests/depcomp7.test: Run test once with --disable-shared and
+       once with --disable-static, to expose failure systematically.
+       * NEWS: Update.
+
 2007-03-29  Stepan Kasal  <kasal@ucw.cz>
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
diff --git a/NEWS b/NEWS
index 9237d009fa317fa4f51a7edca98623fe38243e1b..50b54919b09eb2353e6e48008ec8d9c7d8d41133 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,11 @@ New in 1.10a:
   - install-sh supports -C, which does not update the installed file
     (and its time stamps) if the contents did not change.
 
+Bugs fixed in 1.10a:
+
+* Long standing bugs:
+
+  - Fix aix dependency tracking for libtool objects.
 \f
 New in 1.10:
 
@@ -1250,7 +1255,7 @@ New in 0.20:
 -----
 
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-2004, 2005  Free Software Foundation, Inc.
+2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 
 This file is part of GNU Automake.
 
index ca5ea4e1ef9c125b1cb1fc7d51c93d8747637deb..e5f9736c7239301c765e2d7abefb9bb9b9237ac5 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2006-10-15.18
+scriptversion=2007-03-29.01
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
 # Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -215,34 +215,39 @@ aix)
   # current directory.  Also, the AIX compiler puts `$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
-  tmpdepfile="$stripped.u"
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
     "$@" -Wc,-M
   else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
     "$@" -M
   fi
   stat=$?
 
-  if test -f "$tmpdepfile"; then :
-  else
-    stripped=`echo "$stripped" | sed 's,^.*/,,'`
-    tmpdepfile="$stripped.u"
-  fi
-
   if test $stat -eq 0; then :
   else
-    rm -f "$tmpdepfile"
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
 
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
   if test -f "$tmpdepfile"; then
-    outname="$stripped.o"
     # Each line is of the form `foo.o: dependent.h'.
     # Do two passes, one to just change these to
     # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
-    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
index b2cb0d48d0d45fad88dc863d2c35527f36d502ef..56ec1a8d1c99984a1ea92c99b3541cda347aa29f 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -65,7 +65,7 @@ cat >sub/bar.c <<'END'
 int bar() { return 0; }
 END
 
-touch sub2/sub3/ba3.h
+echo 'extern int x;' > sub2/sub3/ba3.h
 
 cat >sub/bar.h <<'END'
 #include <stdio.h>
@@ -91,15 +91,23 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure --enable-dependency-tracking
-$MAKE 
-
-# check that dependency tracking works
-if grep 'depmode=none' Makefile; then :
-else
-  cd sub2
-  $sleep
-  echo 'choke me' > sub3/ba3.h
-  if $MAKE; then exit 1; fi
-fi
-:
+for staticshared in --disable-shared "" --disable-static; do
+  ./configure --enable-dependency-tracking $staticshared
+  $MAKE 
+
+  # check that dependency tracking works
+  if grep 'depmode=none' Makefile; then :
+  else
+    cd sub2
+    $sleep
+    echo 'choke me' > sub3/ba3.h
+    if $MAKE; then exit 1; fi
+    cd ..
+  fi
+
+  $MAKE distclean
+  test ! -f sub2/sub3/ba3.u
+  test ! -f sub2/sub3/ba3.d
+
+  echo 'extern int x;' > sub2/sub3/ba3.h
+done