]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* depcomp: Support -xM for dependency generation, for Sun CC.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Tue, 1 Jun 1999 00:33:59 +0000 (00:33 +0000)
committerAlexandre Oliva <oliva@dcc.unicamp.br>
Tue, 1 Jun 1999 00:33:59 +0000 (00:33 +0000)
Reported by Alex Hornby <alex@anvil.co.uk>
* m4/depend.m4: Extract the list of supported dependency-tracking
mechanisms from the depcomp script and use it to test each one.
* THANKS: Added Alex Hornby.

ChangeLog
THANKS
depcomp
m4/depend.m4

index aa67067f6281beb01d6040e97e13dd9ad99983d1..216c14c0f30d870d5eedb0531678f346f07e9254 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 1999-06-01  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * depcomp: Support -xM for dependency generation, for Sun CC.
+       Reported by Alex Hornby <alex@anvil.co.uk>
+       * m4/depend.m4: Extract the list of supported dependency-tracking
+       mechanisms from the depcomp script and use it to test each one.
+       * THANKS: Added Alex Hornby.
+
        * depend2.am: Move $(depcomp) to the line of $(...DEPMODE), so as
        to leave $(...COMPILE) in a line by itself.
 
diff --git a/THANKS b/THANKS
index 1725d8bd069b2c6515afdbcdd1b7bb7876317f6e..0760becb25401e2b8aef9a3232e9f9a3b8b91ef2 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -3,8 +3,8 @@ It would not be what it is today without the invaluable help of these
 people:
 
 Akim Demaille          demaille@inf.enst.fr
+Alex Hornby            alex@anvil.co.uk
 Alexander V. Lukyanov  lav@yars.free.net
-Alexandre Oliva                oliva@dcc.unicamp.br
 Andreas Schwab         schwab@lamothe.informatik.uni-dortmund.de
 Andrew Cagney          cagney@tpgi.com.au
 Andris Pavenis         pavenis@lanet.lv
diff --git a/depcomp b/depcomp
index 8e57e32fecb7af545dff813955d482b38e0a6221..cc761d71e43b70f95e87e00a5f2f20b9eca98026 100755 (executable)
--- a/depcomp
+++ b/depcomp
@@ -26,10 +26,6 @@ if test -z "$depmode" || test -z "$source" || test -z "$object"; then
 fi
 
 depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
-# depdir=`echo "$depfile" | sed 's,/*[^/]*$,,'`
-# test -d "$depdir" || { echo "mkdir \"$depdir\"" && mkdir "$depdir"; } ||
-# test -d "$depdir" || exit 1
-
 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
 rm -f "$tmpdepfile"
@@ -85,6 +81,10 @@ sgi)
   rm -f "$tmpdepfile"
   ;;
 
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
 dashmstdout)
   # Important note: in order to support this mode, a compiler *must*
   # always write the proprocessed file to stdout, regardless of -o,
@@ -122,6 +122,43 @@ dashmstdout)
   rm -f "$tmpdepfile"
   ;;
 
+dashXmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  ( 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 "$@" "$arg"
+       shift # fnord
+       shift # "$arg"
+      done
+      ;;
+    esac
+    "$@" -xM | sed 's:^[^:]*\:[        ]*:'"$object"'\: :' > "$tmpdepfile"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile" 
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
 makedepend)
   # X makedepend
   (
index 70c489397095e003eb03d7572fb103b8842f2308..23cdadccdcaff9a0b2fc6850ba845097b69c62ee 100644 (file)
@@ -12,72 +12,41 @@ ifelse([$1],CC,[
 AC_REQUIRE([AC_PROG_CC])
 AC_REQUIRE([AC_PROG_CPP])
 depcc="$CC"
-depcpp="$CPP"
-depgcc="$GCC"],[$1],CXX,[
+depcpp="$CPP"],[$1],CXX,[
 AC_REQUIRE([AC_PROG_CXX])
 AC_REQUIRE([AC_PROG_CXXCPP])
 depcc="$CXX"
-depcpp="$CXXCPP"
-depgcc="$GXX"],[$1],OBJC,[
+depcpp="$CXXCPP"],[$1],OBJC,[
 am_cv_OBJC_dependencies_compiler_type=gcc],[
 AC_REQUIRE([AC_PROG_][$1])
 depcc="$[$1]"
-depcpp=""
-depgcc="no"])
+depcpp=""])
 AC_MSG_CHECKING([dependency style of $depcc])
 AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
-am_cv_[$1]_dependencies_compiler_type=none
-if test "$depgcc" = yes; then
-   am_cv_[$1]_dependencies_compiler_type=gcc
-else
-   echo '#include "conftest.h"' > conftest.c
-   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 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
-      # -o /dev/null avoids selecting -M for a compiler that would
-      # output dependencies to the object file.
-      # The grep tries to ignore compilers that actually output
-      # something other than dependency information when given the -M
-      # argument (in particular, linker map information).
-      rm -f conftest.P
-      if $depcc -M conftest.c -o /dev/null >conftest.P 2>/dev/null &&
-        grep "conftest.h" conftest.P > /dev/null; then
-        am_cv_[$1]_dependencies_compiler_type=dashmstdout
-      fi
-   fi
+am_depcomp=${am_depcomp-"$ac_aux_dir/depcomp"}
+if test -f "$am_depcomp"; then
+  echo '#include "conftest.h"' > conftest.c
+  echo 'int i;' > conftest.h
 
-   if test "$am_cv_[$1]_dependencies_compiler_type" = none; then
-      rm -f conftest.P
-      touch conftest.P
-      if ${MAKEDEPEND-makedepend} -o.o -fconftest.P conftest.c 2>/dev/null &&
-       grep "conftest.h" conftest.P > /dev/null; then
-        am_cv_[$1]_dependencies_compiler_type=makedepend
-      fi
-   fi
+  am_cv_[$1]_dependencies_compiler_type=none
+  for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
+    case "$depmode" in
+    nosideeffect) continue ;;
+    none) break ;;
+    esac
+    if depmode="$depmode" \
+       source=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL $am_depcomp $depcc -c conftest.c 2>/dev/null &&
+       grep conftest.h conftest.Po > /dev/null 2>&1; then
+      am_cv_[$1]_dependencies_compiler_type="$depmode"
+      break
+    fi
+  done
 
-   if test "$am_cv_[$1]_dependencies_compiler_type" = none; then
-      # -o /dev/null avoids selecting -E for a compiler that would
-      # output dependencies to the object file
-      if test -n "`$depcc -E conftest.c -o /dev/null 2>/dev/null`"; then
-        am_cv_[$1]_dependencies_compiler_type=cpp
-      fi
-   fi
-
-   dnl As a last resort, see if we can run CPP and extract line
-   dnl information from the output.
-   dnl FIXME
-
-   rm -f conftest.*
+  rm -f conftest.*
+else
+  am_cv_[$1]_dependencies_compiler_type=none
 fi
 ])
 AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)