From: Tom Tromey Date: Thu, 17 May 2001 06:56:21 +0000 (+0000) Subject: Fix for PR automake/159: X-Git-Tag: Release-1-4f~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de9bc4717c9e6a4de99783ca853abc35da428c89;p=thirdparty%2Fautomake.git Fix for PR automake/159: * lib/depcomp (aix): Rewrote. (sgi): Likewise. --- diff --git a/ChangeLog b/ChangeLog index a82e86042..26efb4436 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2001-05-17 Tom Tromey + 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. diff --git a/lib/depcomp b/lib/depcomp index 71e0ec059..06ab994d8 100755 --- a/lib/depcomp +++ b/lib/depcomp @@ -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