]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* m4/depend.m4 (AM_DEPENDENCIES): Add a definition to conftest.h,
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sun, 25 Apr 1999 19:30:49 +0000 (19:30 +0000)
committerAlexandre Oliva <oliva@dcc.unicamp.br>
Sun, 25 Apr 1999 19:30:49 +0000 (19:30 +0000)
so as not to compile an empty source; some compilers fail on this.
Redirect stderr of depcc to /dev/null.  Test for -M with -o,
because some compilers will output the rules to the output file.
* depcomp (dashmstdout): Add --silent before --mode=compile, so
that we don't get libtool output mixed up with make rules.

ChangeLog
depcomp
m4/depend.m4

index 2effb5edc812d4c6397baaaabb716d690a1e4e83..63f5cb80d7ff6c2855ffac11cc738fd387bb4d4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 1999-04-25  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * m4/depend.m4 (AM_DEPENDENCIES): Add a definition to conftest.h,
+       so as not to compile an empty source; some compilers fail on this.
+       Redirect stderr of depcc to /dev/null.  Test for -M with -o,
+       because some compilers will output the rules to the output file.
+       * depcomp (dashmstdout): Add --silent before --mode=compile, so
+       that we don't get libtool output mixed up with make rules.
+
        * m4/init.m4 (AM_INIT_AUTOMAKE): Require AM_SET_DEPDIR.
        * depend2.am: Set tmpdepfile too, to speed up depcomp.  Always use 
        -o for libtool, otherwise it may try to deduce the object name
diff --git a/depcomp b/depcomp
index 78a0412fe32212411c459493dccdc3f44fb8a231..c27b5f36f3929b92a4bece516d3119ff691de9ca 100755 (executable)
--- a/depcomp
+++ b/depcomp
@@ -68,13 +68,30 @@ sgi)
   ;;
 
 dashmstdout)
-  "$@" -M > "$tmpdepfile" &
+  ( IFS=" "
+    case " $* " in
+    *" --mode=compile "*) # this is libtool, let us make it quiet
+      for arg
+      do # cycle over the arguments
+        case "$arg" in
+       "--mode=compile")
+         # insert --quiet before "--mode=compile"
+         set fnord "$@" --quiet
+         shift # fnord
+         ;;
+       esac
+       set fnord "$@" "$1"
+       shift # fnord
+       shift # "$1"
+      done
+      ;;
+    esac
+    "$@" -M | sed 's:^[^:]*\:[         ]*:'"$object"'\: :' > "$tmpdepfile") &
   proc=$!
   "$@"
   rm -f "$depfile" 
-  echo "$object : \\" > "$depfile"
   wait "$proc"
-  sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
   tr ' ' '
 ' < "$tmpdepfile" | \
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e 's/$/ :/' >> "$depfile"
index d9b2a87c8220d824a75bdbd878d1dc072e0d77a8..bb26635a0227fc5912049b1e7e43e6c0ca1b413f 100644 (file)
@@ -31,19 +31,22 @@ if test "$depgcc" = yes; then
    am_cv_[$1]_dependencies_compiler_type=gcc
 else
    echo '#include "conftest.h"' > conftest.c
-   echo > conftest.h
+   echo 'int i;' > conftest.h
 
    dnl SGI compiler has its own method for side-effect dependency
    dnl tracking.
    if test "$am_cv_[$1]_dependencies_compiler_type" = none; then
       rm -f conftest.P
-      if $depcc -c -MDupdate conftest.P conftest.c && test -f conftest.P; then
+      if $depcc -c -MDupdate conftest.P conftest.c 2>/dev/null &&
+        test -f conftest.P; then
         am_cv_[$1]_dependencies_compiler_type=sgi
       fi
    fi
 
    if test "$am_cv_[$1]_dependencies_compiler_type" = none; then
-      if test -n "`$depcc -M conftest.c`"; then
+      # -o /dev/null avoids selecting -M for a compiler that would
+      # output dependencies to the object file
+      if test -n "`$depcc -M conftest.c -o /dev/null 2>/dev/null`"; then
         am_cv_[$1]_dependencies_compiler_type=dashmstdout
       fi
    fi