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.
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
;;
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"
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