From dfa93e18baaa888d28dd2abbbda6e3787fdef82d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 6 Oct 1996 19:24:31 +0000 Subject: [PATCH] Some aclocal bug fixes --- ChangeLog | 8 ++++++++ NEWS | 2 +- TODO | 1 + aclocal.in | 27 ++++++++++++++++----------- tests/ChangeLog | 6 ++++++ tests/Makefile.am | 3 ++- tests/Makefile.in | 3 ++- tests/acinclude.test | 12 ++++++++++++ tests/acsilent.test | 19 +++++++++++++++++++ tests/req.test | 20 ++++++++++++++++++++ 10 files changed, 87 insertions(+), 14 deletions(-) create mode 100755 tests/acinclude.test create mode 100755 tests/acsilent.test create mode 100755 tests/req.test diff --git a/ChangeLog b/ChangeLog index d12a24a5..c17de192 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,14 @@ Sun Oct 6 00:43:01 1996 Tom Tromey + * aclocal.in (add_file): Search contents of included files. Test + req.test. + (scan_m4_files): Don't skip acinclude.m4 when constructing + search. Test acsilent.test. + (scan_m4_files): Scan acinclude.m4. + * aclocal.in (add_file): Removed debugging print. + (scan_configure): Set $file_contents when scanning acinclude.m4. + Test acinclude.test. * configure.in: Upped to 1.1g. diff --git a/NEWS b/NEWS index bcdca278..3e93980d 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -New in 1.1f: +New in 1.1g: * Bug fixes * Better DejaGNU support * Added no-installinfo option diff --git a/TODO b/TODO index 21fd66e2..824d1cff 100644 --- a/TODO +++ b/TODO @@ -3,6 +3,7 @@ Priorities for release: * `acinstall' * echo in installs? * `missing' program +* copyrights on m4 files, aclocal output Further: - texinfo/info changes diff --git a/aclocal.in b/aclocal.in index 16911b4b..e0c32dca 100644 --- a/aclocal.in +++ b/aclocal.in @@ -173,13 +173,9 @@ sub scan_configure open (CONFIGURE, "configure.in") || die "aclocal: couldn't open \`configure.in': $!\n"; - # Add acinclude.m4 first. That way it can override installed - # macros. + # Make sure we include acinclude.m4 if it exists. if (-f 'acinclude.m4') { - # Do it this way so that any AC_REQUIRE in acinclude.m4 will - # take effect. - &scan_file ('acinclude.m4'); &add_file ('acinclude.m4'); } @@ -229,6 +225,12 @@ sub scan_m4_files { local ($m4dir) = @_; + # First, scan acinclude.m4 if it exists. + if (-f 'acinclude.m4') + { + $file_contents{'acinclude.m4'} = &scan_file ('acinclude.m4'); + } + opendir (DIR, $m4dir) || die "aclocal: couldn't open directory \`$m4dir': $!\n"; local ($file, $fullfile, $expr); @@ -251,10 +253,6 @@ sub scan_m4_files local ($search, $expr, $key); foreach $key (keys %map) { - # acinclude.m4 doesn't matter for the search, since it is - # unconditionally included. - next if $map{$key} eq 'acinclude.m4'; - # EXPR is a regexp matching the name of the macro. ($expr = $key) =~ s/(\W)/\\$1/g; $search .= "&add_macro ('" . $key . "') if /" . $expr . "/;\n"; @@ -280,6 +278,7 @@ sub add_macro return; } + print STDERR "saw macro $macro\n" if $verbosity; $macro_seen{$macro} = 1; &add_file ($map{$macro}); } @@ -295,9 +294,15 @@ sub add_file $output .= $file_contents{$file} . "\n"; local (@rlist); - while ($file_contents{$file} =~ /$ac_require_rx/g) + foreach (split ("\n", $file_contents{$file})) { - push (@rlist, $1); + if (/$ac_require_rx/g) + { + push (@rlist, $1); + } + + # This function constructed dynamically. + &search; } local ($macro); diff --git a/tests/ChangeLog b/tests/ChangeLog index 2aafaff1..359ba029 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +Sun Oct 6 11:00:44 1996 Tom Tromey + + * acsilent.test: New file. + * req.test: New file. + * acinclude.test: New file. + Sat Oct 5 11:31:38 1996 Tom Tromey * discover.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index 92801b27..e1de16e0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,6 +16,7 @@ exsource.test canon4.test dup.test defun.test cxxlink.test cxxnoc.test \ order.test libobj2.test interp.test alllib.test block.test libobj3.test \ gnits.test interp2.test colneq.test implicit.test spell.test spell2.test \ confsub.test primary.test primary2.test depend2.test spell3.test \ -comment2.test vpath.test symlink.test discover.test +comment2.test vpath.test symlink.test discover.test acinclude.test req.test \ +acsilent.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index 7fd0ca05..a1686c7d 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -54,7 +54,8 @@ exsource.test canon4.test dup.test defun.test cxxlink.test cxxnoc.test \ order.test libobj2.test interp.test alllib.test block.test libobj3.test \ gnits.test interp2.test colneq.test implicit.test spell.test spell2.test \ confsub.test primary.test primary2.test depend2.test spell3.test \ -comment2.test vpath.test symlink.test discover.test +comment2.test vpath.test symlink.test discover.test acinclude.test req.test \ +acsilent.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(top_srcdir)/mkinstalldirs diff --git a/tests/acinclude.test b/tests/acinclude.test new file mode 100755 index 00000000..59133a2f --- /dev/null +++ b/tests/acinclude.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test to make sure acinclude is actually included. +# Report from Jim Meyering. + +. $srcdir/defs || exit 1 + +echo moo > acinclude.m4 + +$ACLOCAL || exit 1 + +grep moo aclocal.m4 diff --git a/tests/acsilent.test b/tests/acsilent.test new file mode 100755 index 00000000..a3ae6eed --- /dev/null +++ b/tests/acsilent.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test to make sure there are no spurious acinclude warnings. + +. $srcdir/defs || exit 1 + +echo AM_INIT_GUILE_MODULE > configure.in + +cat > acinclude.m4 << 'END' +AC_DEFUN([AM_INIT_GUILE_MODULE],[ +. $srcdir/../GUILE-VERSION +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AC_CONFIG_AUX_DIR(..) +module=[$1] +AC_SUBST(module)]) +END + +$ACLOCAL > output 2>&1 || exit 1 +test -z "`cat output`" diff --git a/tests/req.test b/tests/req.test new file mode 100755 index 00000000..f2372f1d --- /dev/null +++ b/tests/req.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to make sure macro used in m4 file is included. + +. $srcdir/defs || exit 1 + +echo AM_INIT_GUILE_MODULE > configure.in + +cat > acinclude.m4 << 'END' +AC_DEFUN([AM_INIT_GUILE_MODULE],[ +. $srcdir/../GUILE-VERSION +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AC_CONFIG_AUX_DIR(..) +module=[$1] +AC_SUBST(module)]) +END + +$ACLOCAL || exit 1 + +grep 'DEFUN.*INIT_AUTOMAKE' aclocal.m4 -- 2.43.5