Re-resending this patch.

2000-06-04  Morten Eriksen  <[EMAIL PROTECTED]>

        * depcomp: fixed bug in sgi dependency tracking mode with
        sourcecode files which does not contain any dependencies to other
        source files.

Regards,
Morten




Hi,

this patch was never applied, so I'm resending it. Let me know if it
is unacceptable for some reason.

Regards,
Morten




Hi,

I discovered and fixed another problem with the sgi-style dependency
tracking: the "-MDupdate" option to SGI MIPSpro C++ compilers won't
output a file if the sourcecode file to compile does not contain any
dependencies (a situation which is not as uncommon as it may
sound).

With the current Automake depcomp code, this will then lead to a
mangled .Plo file, which again leads to a corrupted Makefile due to
the "include basename.Plo" scheme.

This patch will check if a "$tmpdepfile" was actually written for each
source file, and if not; just write a dummy Makefile comment to the
"$depfile".

Regards,
Morten Eriksen


Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.872
diff -u -r1.872 ChangeLog
--- ChangeLog   2000/06/02 23:27:02     1.872
+++ ChangeLog   2000/06/04 17:27:09
@@ -1,3 +1,9 @@
+2000-06-04  Morten Eriksen  <[EMAIL PROTECTED]>
+
+        * depcomp: fixed bug in sgi dependency tracking mode with
+        sourcecode files which does not contain any dependencies to other
+        source files.
+
 2000-06-02  Morten Eriksen  <[EMAIL PROTECTED]>
 
         * depcomp: workaround for problem with SGI IRIX sed (it can only



Index: depcomp
===================================================================
RCS file: /cvs/automake/automake/depcomp,v
retrieving revision 1.7
diff -u -r1.7 depcomp
--- depcomp     2000/06/02 23:27:02     1.7
+++ depcomp     2000/06/04 17:27:23
@@ -122,20 +122,29 @@
     exit $stat
   fi
   rm -f "$depfile" 
-  echo "$object : \\" > "$depfile"
 
-  # Clip off the initial element (the dependent). Don't try to be
-  # clever and remove the tr invocations, as IRIX sed won't handle
-  # lines with more than 8192 characters.
-  tr ' ' '
+  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 ' ' '
+    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"
+      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
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
   rm -f "$tmpdepfile"
   ;;
 




Reply via email to