+1999-06-01 Miles Bader <miles@ccs.mt.nec.co.jp>
+
+ * 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 <oliva@dcc.unicamp.br>
* missing: If given `--run' as first argument, try to run the
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,
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