diff options
author | James Peach <jpeach@samba.org> | 2007-04-22 03:17:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:34 -0500 |
commit | 821bf2bd7278da4e71fcdcfc03348a712cd0fc90 (patch) | |
tree | c1478a5a9dea7e473b0c00ec7b53543be963b045 /source3/m4/make.m4 | |
parent | d27d6e822ecd90ebddf59121c2051b693b6b0f90 (diff) | |
download | samba-821bf2bd7278da4e71fcdcfc03348a712cd0fc90.tar.gz samba-821bf2bd7278da4e71fcdcfc03348a712cd0fc90.tar.bz2 samba-821bf2bd7278da4e71fcdcfc03348a712cd0fc90.zip |
r22441: Add automatic dependency tracking. The dependency generation is
toolchain independent, but since there's no portable method for
doing makefile includes, we can actually use the dependencies with
GNU make. It's easy to add this for other makes, but I don't have
any to test.
This also moves as much m4 as possible into the m4 directory where
no-one has to look at it. AFAICT, there's no way to hide depcomp
in there too, which is unfortunate.
(This used to be commit aa14900f8291a017aa7fab2bbb9a6c79b12889b2)
Diffstat (limited to 'source3/m4/make.m4')
-rw-r--r-- | source3/m4/make.m4 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/source3/m4/make.m4 b/source3/m4/make.m4 new file mode 100644 index 0000000000..0969d9a795 --- /dev/null +++ b/source3/m4/make.m4 @@ -0,0 +1,51 @@ +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) |