]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix for PR automake/159:
authorTom Tromey <tromey@redhat.com>
Thu, 17 May 2001 06:56:21 +0000 (06:56 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 17 May 2001 06:56:21 +0000 (06:56 +0000)
* lib/depcomp (aix): Rewrote.
(sgi): Likewise.

ChangeLog
lib/depcomp

index a82e860422173c0927aef85935084a991f424258..26efb443665e900654f329193dd00f9e158a0466 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2001-05-17  Tom Tromey  <tromey@redhat.com>
 
+       Fix for PR automake/159:
+       * lib/depcomp (aix): Rewrote.
+       (sgi): Likewise.
+
        Fix for PR automake/174:
        * tests/Makefile.am (XFAIL_TESTS): Removed comment3.test.
        * automake.in (read_am_file): Warn if `#' is at start of rule.
index 71e0ec059044f367623589c9b27ad19fc695cdbd..06ab994d88e2486f9a1030fe3533f40190a69077 100755 (executable)
@@ -128,19 +128,24 @@ sgi)
   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
     echo "$object : \\" > "$depfile"
 
-    # Clip off the initial element (the dependent). Don't try to be
+    # Clip off the initial element (the dependent).  Don't try to be
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
-    # IRIX 6.2 sed, 8192 in IRIX 6.5).
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
     tr ' ' '
-' < "$tmpdepfile" | sed 's/^.*\.o://' | tr '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
 ' ' ' >> $depfile
+    echo >> $depfile
 
+    # The second pass generates a dummy entry for each header file.
     tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-      sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -152,8 +157,12 @@ sgi)
 
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
-  # in a .u file.
-  tmpdepfile=`echo "$object" | sed 's/\(.*\)\..*$/\1.u/'`
+  # in a .u file.  This file always lives in the current directory.
+  # Also, the AIX compiler puts `$object:' at the start of each line;
+  # $object doesn't have directory information.
+  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  outname="$stripped.o"
   if test "$libtool" = yes; then
     "$@" -Wc,-M
   else
@@ -168,21 +177,11 @@ aix)
   fi
 
   if test -f "$tmpdepfile"; then
-    echo "$object : \\" > "$depfile"
-
-    # Clip off the initial element (the dependent). Don't try to be
-    # clever and replace this with sed code, as IRIX sed won't handle
-    # lines with more than a fixed number of characters (4096 in
-    # IRIX 6.2 sed, 8192 in IRIX 6.5).
-    tr ' ' '
-' < "$tmpdepfile" | sed 's/^[^\.]*\.o://' | tr '
-' ' ' >> $depfile
-
-    tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-      sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    # 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 \1," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile