3 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
4 # written in clear, in which case automake, when reading aclocal.m4,
5 # will think it sees a *use*, and therefore will trigger all it's
6 # C support machinery. Also note that it means that autoscan, seeing
7 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
9 # AM_DEPENDENCIES(NAME)
10 # ---------------------
11 # See how the compiler implements dependency checking.
12 # NAME is "CC", "CXX" or "OBJC".
13 # We try a few techniques and use that to set a single cache variable.
14 AC_DEFUN([AM_DEPENDENCIES],
15 [AC_REQUIRE([AM_SET_DEPDIR])dnl
16 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
18 [AC_REQUIRE([AC_PROG_][CC])dnl
19 AC_REQUIRE([AC_PROG_][CPP])
22 [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
23 AC_REQUIRE([AC_PROG_][CXXCPP])
26 [$1], OBJC, [am_cv_OBJC_dependencies_compiler_type=gcc],
27 [AC_REQUIRE([AC_PROG_][$1])dnl
31 AC_CACHE_CHECK([dependency style of $depcc],
32 [am_cv_$1_dependencies_compiler_type],
33 [if test -z "$AMDEP"; then
34 echo '#include "conftest.h"' > conftest.c
35 echo 'int i;' > conftest.h
37 am_cv_$1_dependencies_compiler_type=none
38 for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "$am_depcomp"`; do
41 # after this tag, mechanisms are not by side-effect, so they'll
42 # only be used when explicitly requested
43 if test "x$enable_dependency_tracking" = xyes; then
51 # We check with `-c' and `-o' for the sake of the "dashmstdout"
52 # mode. It turns out that the SunPro C++ compiler does not properly
53 # handle `-M -o', and we need to detect this.
54 if depmode="$depmode" \
55 source=conftest.c object=conftest.o \
56 depfile=conftest.Po tmpdepfile=conftest.TPo \
57 $SHELL $am_depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
58 grep conftest.h conftest.Po > /dev/null 2>&1; then
59 am_cv_$1_dependencies_compiler_type="$depmode"
66 am_cv_$1_dependencies_compiler_type=none
69 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
76 # Choose a directory name for dependency files.
77 # This macro is AC_REQUIREd in AM_DEPENDENCIES
78 AC_DEFUN([AM_SET_DEPDIR],
79 [if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
81 # We redirect because .deps might already exist and be populated.
82 # In this situation we don't want to see an error.
83 rmdir .deps > /dev/null 2>&1
93 AC_DEFUN([AM_DEP_TRACK],
94 [AC_ARG_ENABLE(dependency-tracking,
95 [ --disable-dependency-tracking Speeds up one-time builds
96 --enable-dependency-tracking Do not reject slow dependency extractors])
97 if test "x$enable_dependency_tracking" = xno; then
100 am_depcomp="$ac_aux_dir/depcomp"
101 if test ! -f "$am_depcomp"; then
108 if test -z "$AMDEP"; then
113 pushdef([subst], defn([AC_SUBST]))
114 subst(AMDEPBACKSLASH)