Index: fileutils-4.1/depcomp
diff -c fileutils-4.1/depcomp:1.1.1.1 fileutils-4.1/depcomp:1.4
*** fileutils-4.1/depcomp:1.1.1.1	Thu May 17 10:54:28 2001
--- fileutils-4.1/depcomp	Mon May 21 08:31:12 2001
***************
*** 128,146 ****
    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
      # 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"
    else
      # The sourcefile does not contain any dependencies, so just
      # store a dummy comment line, to avoid errors with the Makefile
--- 128,151 ----
    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
      # 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).  We also remove comment lines;
!     # the IRIX cc adds comments like `#:fec' to the end of the
!     # dependency line.
      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" \
!    | 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,159 ****
  
  aix)
    # The C for AIX Compiler uses -M and outputs the dependencies
!   # in a .u file.
!   tmpdepfile=`echo "$object" | sed 's/\(.*\)\..*$/\1.u/'`
    if test "$libtool" = yes; then
      "$@" -Wc,-M
    else
--- 157,168 ----
  
  aix)
    # The C for AIX Compiler uses -M and outputs the dependencies
!   # 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,188 ****
    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"
    else
      # The sourcefile does not contain any dependencies, so just
      # store a dummy comment line, to avoid errors with the Makefile
--- 177,187 ----
    fi
  
    if test -f "$tmpdepfile"; then
!     # 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"
    else
      # The sourcefile does not contain any dependencies, so just
      # store a dummy comment line, to avoid errors with the Makefile
***************
*** 191,196 ****
--- 190,224 ----
    fi
    rm -f "$tmpdepfile"
    ;;
+ 
+ tru64)
+    # The Tru64 AIX compiler uses -MD to generate dependencies as a side
+    # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+    # Subdirectories are respected.
+ 
+    tmpdepfile="$object.d"
+    if test "$libtool" = yes; then
+       "$@" -Wc,-MD
+    else
+       "$@" -MD
+    fi
+ 
+    stat=$?
+    if test $stat -eq 0; then :
+    else
+       rm -f "$tmpdepfile"
+       exit $stat
+    fi
+ 
+    if test -f "$tmpdepfile"; then
+       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+       # That's a space and a tab in the [].
+       sed -e 's,^.*\.[a-z]*:[ 	]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+    else
+       echo "#dummy" > "$depfile"
+    fi
+    rm -f "$tmpdepfile"
+    ;;
  
  #nosideeffect)
    # This comment above is used by automake to tell side-effect
