From ac1bc429ea9b7b59f57c5e14917fec2f78459b84 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 31 May 1999 23:43:32 +0000 Subject: [PATCH] * m4/depend.m4 (AM_DEPENDENCIES): Add check for `makedepend'. Fix `dashmstdout' to ignore non-dependency-generating uses of the -M flag. * depcomp (makedepend): New dependency-generating method. --- ChangeLog | 7 +++++++ depcomp | 36 ++++++++++++++++++++++++++++++++++++ m4/depend.m4 | 18 ++++++++++++++++-- 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b851dace6..0fc8cbd1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-06-01 Miles Bader + + * m4/depend.m4 (AM_DEPENDENCIES): Add check for `makedepend'. + Fix `dashmstdout' to ignore non-dependency-generating uses of the + -M flag. + * depcomp (makedepend): New dependency-generating method. + 1999-06-01 Alexandre Oliva * missing: If given `--run' as first argument, try to run the diff --git a/depcomp b/depcomp index 951a984ca..8e57e32fe 100755 --- a/depcomp +++ b/depcomp @@ -122,6 +122,42 @@ dashmstdout) rm -f "$tmpdepfile" ;; +makedepend) + # X makedepend + ( + shift + cleared=no + for arg in "$@"; do + case $cleared in no) + set ""; shift + cleared=yes + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tail +3 "$tmpdepfile" | tr ' ' ' +' | \ + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, diff --git a/m4/depend.m4 b/m4/depend.m4 index f69ee5bdf..70c489397 100644 --- a/m4/depend.m4 +++ b/m4/depend.m4 @@ -45,12 +45,26 @@ else 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 - if test -n "`$depcc -M conftest.c -o /dev/null 2>/dev/null`"; then + # 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 + 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 + 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 -- 2.47.2