From: Tom Tromey Date: Mon, 5 Feb 2001 06:59:02 +0000 (+0000) Subject: * m4/Makefile.am (m4data_DATA): Added make.m4. X-Git-Tag: Release-1-4d~43 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=2b8a29870b51e31acce280e572000566ac61cab1;p=automake.git * m4/Makefile.am (m4data_DATA): Added make.m4. * automake.in (handle_dependencies): Use @AM_INCLUDE@ to include dependency files. * m4/depend.m4 (AM_DEPNDENCIES): Require AM_MAKE_INCLUDE. Copy depcomp to subdir. * m4/make.m4: New file. --- diff --git a/ChangeLog b/ChangeLog index b5e3c25b..a51d045b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-02-04 Tom Tromey + + * m4/Makefile.am (m4data_DATA): Added make.m4. + * automake.in (handle_dependencies): Use @AM_INCLUDE@ to include + dependency files. + * m4/depend.m4 (AM_DEPNDENCIES): Require AM_MAKE_INCLUDE. + Copy depcomp to subdir. + * m4/make.m4: New file. + 2001-02-04 Pavel Roskin * automake.in (handle_dist_worker): Remove a line that is now diff --git a/automake.in b/automake.in index 4c613cf2..9f9f63f6 100755 --- a/automake.in +++ b/automake.in @@ -3049,7 +3049,7 @@ sub handle_dependencies $output_rules .= "\n"; foreach $iter (@deplist) { - $output_rules .= "\@AMDEP\@" . 'include ' . $iter . "\n"; + $output_rules .= "\@AMDEP\@\@AM_INCLUDE\@ " . $iter . "\n"; } $output_rules .= &file_contents ('depend'); diff --git a/m4/Makefile.am b/m4/Makefile.am index 8f57d903..88d06f38 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -5,8 +5,8 @@ MAINT_CHARSET = latin1 m4datadir = $(datadir)/aclocal m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \ -error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \ -minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 \ -python.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4 +error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \ +maintainer.m4 minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 \ +ptrdiff.m4 python.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4 EXTRA_DIST = $(m4data_DATA) diff --git a/m4/Makefile.in b/m4/Makefile.in index 6e6c8b40..bad2e3d8 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -48,6 +48,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_FLAG = +INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : @@ -74,9 +75,9 @@ MAINT_CHARSET = latin1 m4datadir = $(datadir)/aclocal m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \ -error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \ -minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 \ -python.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4 +error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \ +maintainer.m4 minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 \ +ptrdiff.m4 python.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4 EXTRA_DIST = $(m4data_DATA) @@ -99,7 +100,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= CONFIG_COMMANDS= $(SHELL) ./config.status install-m4dataDATA: $(m4data_DATA) diff --git a/m4/depend.m4 b/m4/depend.m4 index 8f63a3d6..59c95d65 100644 --- a/m4/depend.m4 +++ b/m4/depend.m4 @@ -28,6 +28,8 @@ depcpp="$CXXCPP"], depcc="$$1" depcpp=""]) +AC_REQUIRE([AM_MAKE_INCLUDE]) + AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP"; then @@ -37,10 +39,13 @@ AC_CACHE_CHECK([dependency style of $depcc], # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir confdir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" confdir cd confdir am_cv_$1_dependencies_compiler_type=none - for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "$am_depcomp"`; do + for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "./depcomp"`; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. @@ -65,7 +70,7 @@ AC_CACHE_CHECK([dependency style of $depcc], if depmode="$depmode" \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ - $SHELL $am_depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type="$depmode" break diff --git a/m4/make.m4 b/m4/make.m4 new file mode 100644 index 00000000..2307f0f2 --- /dev/null +++ b/m4/make.m4 @@ -0,0 +1,24 @@ +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +# BSD make uses .include +cat > confinc << 'END' +doit: + @echo done +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='#' +for am_inc in include .include; do + echo "$am_inc confinc" > confmf + if test "`$am_make -f confmf 2> /dev/null`" = "done"; then + AM_INCLUDE=$am_inc + break + fi +done +AC_SUBST(AM_INCLUDE) +AC_MSG_RESULT($AM_INCLUDE) +rm -f confinc confmf +])