From 7f29948208d648413adb5e1e87492b047d9348e9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 21 Oct 1997 06:51:57 +0000 Subject: [PATCH] aclocal fix --- ChangeLog | 4 ++++ TODO | 2 -- aclocal.in | 13 ++++++++++--- tests/ChangeLog | 4 ++++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/ammissing.test | 10 ++++++++++ 7 files changed, 30 insertions(+), 7 deletions(-) create mode 100755 tests/ammissing.test diff --git a/ChangeLog b/ChangeLog index 68bddc68..618cc49e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ Tue Oct 21 00:39:44 1997 Tom Tromey + * aclocal.in (scan_m4_files): If macro recognized, &search will + return 1. + (scan_configure): If AM_ macro not found, give error. + * m4/sanity.m4: If `ls' completely fails, die. From Jim Meyering. diff --git a/TODO b/TODO index c235f398..5a47ebfc 100644 --- a/TODO +++ b/TODO @@ -80,8 +80,6 @@ * *all* installed scripts should support --version, --help -* have aclocal diagnose unrecognized AM_ macros - For now I guess I'll just have automake give an error if it encounters non-C source in a libtool library specification. diff --git a/aclocal.in b/aclocal.in index 5b114156..e14a8a33 100644 --- a/aclocal.in +++ b/aclocal.in @@ -207,8 +207,13 @@ sub scan_configure } # Search for things we know about. The "search" sub is - # constructed dynamically, above. - &search; + # constructed dynamically by scan_m4_files. + if (! &search && /(AM_[A-Z_]+)/) + { + # Macro not found, but AM_ prefix found. + warn "aclocal: configure.in: $.: macro \`$1' not found in library\n"; + $exit_status = 1; + } } close (CONFIGURE); @@ -273,8 +278,10 @@ sub scan_m4_files { # EXPR is a regexp matching the name of the macro. ($expr = $key) =~ s/(\W)/\\$1/g; - $search .= "&add_macro ('" . $key . "') if /" . $expr . "/;\n"; + $search .= ("if (/" . $expr "/) { & add_macro (" . $key + . "); return 1; }\n"); } + $search .= "return 0;\n"; eval 'sub search { ' . $search . '};'; die "internal error: $@\n search is $search " if $@; } diff --git a/tests/ChangeLog b/tests/ChangeLog index 65293134..e6987659 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 21 00:46:24 1997 Tom Tromey + + * ammissing.test: New file. + Sun Sep 28 17:19:52 1997 Tom Tromey * cxxnoc.test: Changed to reflect MKDEP change. diff --git a/tests/Makefile.am b/tests/Makefile.am index fde90213..5689d609 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,7 +26,7 @@ remake2.test output3.test output4.test colneq2.test subst.test \ defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test \ cxxlibobj.test seenc.test cygwin32.test lisp.test stamph.test \ ldadd.test version2.test conf2.test cond.test cond2.test xsource.test \ -libobj6.test depend3.test output5.test +libobj6.test depend3.test output5.test ammissing.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index a619269f..e9edbee6 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -87,7 +87,7 @@ remake2.test output3.test output4.test colneq2.test subst.test \ defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test \ cxxlibobj.test seenc.test cygwin32.test lisp.test stamph.test \ ldadd.test version2.test conf2.test cond.test cond2.test xsource.test \ -libobj6.test depend3.test output5.test +libobj6.test depend3.test output5.test ammissing.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/tests/ammissing.test b/tests/ammissing.test new file mode 100755 index 00000000..054204ad --- /dev/null +++ b/tests/ammissing.test @@ -0,0 +1,10 @@ +#! /bin/sh + +# Test to see if aclocal correctly reports missing AM_ macro. + +. $srcdir/defs || exit 1 + +echo AM_ZARDOZ >> configure.in + +$ACLOCAL && exit 1 +exit 0 -- 2.43.5