skip AC_DEFUN lines
authorTom Tromey <tromey@redhat.com>
Tue, 10 Dec 1996 07:58:18 +0000 (07:58 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 10 Dec 1996 07:58:18 +0000 (07:58 +0000)
ChangeLog
automake.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/defun2.test [new file with mode: 0755]

index 8ad8338..fc6dd5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@ Tue Dec 10 00:41:17 1996  Tom Tromey  <tromey@cygnus.com>
 
        * automake.in (AC_SUBST_PATTERN): Check for alphanumeric variable
        names only.  Test subst.test.
+       (scan_one_configure_file): Skip AC_DEFUN lines.  Test
+       defun2.test.
 
 Mon Dec  9 08:18:42 1996  Tom Tromey  <tromey@cygnus.com>
 
index ccdc9b6..4ea1879 100755 (executable)
@@ -3169,6 +3169,11 @@ sub scan_one_configure_file
        s/\bdnl\b.*$//;
        s/\#.*$//;
 
+       # Skip macro definitions.  Otherwise we might be confused into
+       # thinking that a macro that was only defined was actually
+       # used.
+       next if /AC_DEFUN/;
+
        # Populate libobjs array.
        if (/AC_FUNC_ALLOCA/)
        {
index 064dbfe..a2dbfc6 100644 (file)
@@ -1,5 +1,6 @@
 Tue Dec 10 00:43:14 1996  Tom Tromey  <tromey@cygnus.com>
 
+       * defun2.test: New file.
        * subst.test: New file.
 
 Sun Dec  8 12:25:22 1996  Tom Tromey  <tromey@cygnus.com>
index aaa6c91..b1a59f3 100644 (file)
@@ -20,7 +20,7 @@ comment2.test vpath.test symlink.test discover.test acinclude.test req.test \
 acsilent.test distdir.test lex2.test libobj4.test libobj5.test version.test \
 ranlib.test confvar.test confvar2.test stdlib.test cxxo.test colon2.test \
 colon3.test remake.test output.test output2.test remake2.test output3.test \
-output4.test colneq2.test subst.test
+output4.test colneq2.test subst.test defun2.test
 
 EXTRA_DIST = defs $(TESTS)
 
index b0c1e21..39c3828 100644 (file)
@@ -62,7 +62,7 @@ comment2.test vpath.test symlink.test discover.test acinclude.test req.test \
 acsilent.test distdir.test lex2.test libobj4.test libobj5.test version.test \
 ranlib.test confvar.test confvar2.test stdlib.test cxxo.test colon2.test \
 colon3.test remake.test output.test output2.test remake2.test output3.test \
-output4.test colneq2.test subst.test
+output4.test colneq2.test subst.test defun2.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/tests/defun2.test b/tests/defun2.test
new file mode 100755 (executable)
index 0000000..d6869c5
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+# Make sure we don't mistake a macro definition for an invocation.
+# From Jim Meyering.
+
+. $srcdir/defs || exit 1
+
+cat >> configure.in << 'END'
+dnl if buggy this will require getloadavg.c
+AC_PROG_CC
+AC_DEFUN([AC_FUNC_GETLOADAVG],
+dnl need this to avoid LIBOBJS used but not defined.
+AC_FUNC_MEMCMP
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_LDADD = @LIBOBJS@
+END
+
+: > memcmp.c
+
+$AUTOMAKE