]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sugar.m4 (m4_init): Also forbid `_m4_*' tokens.
authorAkim Demaille <akim@epita.fr>
Fri, 3 Aug 2001 09:09:45 +0000 (09:09 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 3 Aug 2001 09:09:45 +0000 (09:09 +0000)
(m4_divert_pop): Dump the whole diversion stack when a diversion
mismatch happens.
* bin/autom4te.in (&handle_output): Remember of the first
occurrence of a possibly undefined macro, not the last.
Complain about the possibly undefined macros in the same order as
the appear in the output.
* lib/autoconf/Makefile.am (autoconf.m4f): List its dependencies.
* tests/tools.at (autoconf: forbidden tokens, basic)
(autoconf: forbidden tokens, exceptions): No longer sort
autoconf's stderr, as it is now deterministic.
Check that `dnl' is caught.

ChangeLog
bin/autom4te.in
lib/autoconf/Makefile.am
lib/autoconf/Makefile.in
lib/m4sugar/m4sugar.m4
man/autom4te.1
tests/tools.at

index 2a3b92c8495bece87f3630a5442ce36073c864bd..2abf990d0b96c24e0a85ffcae3337b864bcd552b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2001-08-03  Akim Demaille  <akim@epita.fr>
+
+       * lib/m4sugar/m4sugar.m4 (m4_init): Also forbid `_m4_*' tokens.
+       (m4_divert_pop): Dump the whole diversion stack when a diversion
+       mismatch happens.
+       * bin/autom4te.in (&handle_output): Remember of the first
+       occurrence of a possibly undefined macro, not the last.
+       Complain about the possibly undefined macros in the same order as
+       the appear in the output.
+       * lib/autoconf/Makefile.am (autoconf.m4f): List its dependencies.
+       * tests/tools.at (autoconf: forbidden tokens, basic)
+       (autoconf: forbidden tokens, exceptions): No longer sort
+       autoconf's stderr, as it is now deterministic.
+       Check that `dnl' is caught.
+
+2001-08-03  Akim Demaille  <akim@epita.fr>
+
+       * lib/m4sugar/m4sugar.m4 (m4_init): Also forbid `_m4_*' tokens.
+       (m4_divert_pop): Dump the whole diversion stack when a diversion
+       mismatch happens.
+       * bin/autom4te.in (&handle_output): Remember of the first
+       occurrence of a possibly undefined macro, not the last.
+       Complain about the possibly undefined macros in the same order as
+       the appear in the output.
+       * lib/autoconf/Makefile.am (autoconf.m4f): List its dependencies.
+       * tests/tools.at (autoconf: forbidden tokens, basic)
+       (autoconf: forbidden tokens, exceptions): No longer sort
+       autoconf's stderr, as it is now deterministic.
+       Check that `dnl' is caught.
+
 2001-08-01  Akim Demaille  <akim@epita.fr>
 
        * configure.ac: Bump to 2.52c.
index 891bfd7703aeeedb2b015dc9d47b25f039c29fe5..22eaf30ec1549412f1573a5614c146d4f83a6d52 100644 (file)
@@ -532,7 +532,7 @@ sub handle_output ($)
       foreach (split (/\W+/))
        {
          $prohibited{$_} = $oline
-           if /$forbidden/ && !/$allowed/;
+           if /$forbidden/ && !/$allowed/ && ! exists $prohibited{$_};
        }
     }
 
@@ -566,7 +566,7 @@ sub handle_output ($)
        }
     }
   warn "$output:$prohibited{$_}: error: possibly undefined macro: $_\n"
-    foreach (keys %prohibited);
+    foreach (sort { $prohibited{$a} <=> $prohibited{$b} } keys %prohibited);
 }
 
 
index 4e220c71426f6c235e44d9290cad0312c5dc2b85..21a83fb821b93b666a235d7abc977b17739916af 100644 (file)
@@ -69,7 +69,21 @@ M4_INCLUDES =  --include $(srcdir) \
          rm -f freeze.log; \
        fi
 
-autoconf.m4f: $(m4sources)
+# Some day we should explain to Automake how to use autom4te to compute
+# the dependencies...
+srclibdir = $(top_srcdir)/lib
+autoconf.m4f: $(srclibdir)/m4sugar/m4sugar.m4  \
+              $(srclibdir)/m4sugar/m4sh.m4     \
+              $(srclibdir)/autoconf/autoconf.m4        \
+              $(srclibdir)/autoconf/general.m4 \
+              $(srclibdir)/autoconf/oldnames.m4        \
+              $(srclibdir)/autoconf/specific.m4        \
+              $(srclibdir)/autoconf/lang.m4 \
+              $(srclibdir)/autoconf/c.m4 \
+              $(srclibdir)/autoconf/fortran.m4 \
+              $(srclibdir)/autoconf/functions.m4 \
+              $(srclibdir)/autoconf/headers.m4 \
+              $(srclibdir)/autoconf/types.m4
 
 # Files that should be removed, but which Automake does not know.
 CLEANFILES = autoconf.m4f
index e572097afd0743ce793ee7c4c09ef478bfe92af9..246bd6d7a93180e94fc9904fd802eb94550965eb 100644 (file)
@@ -79,6 +79,10 @@ SUFFIXES = .m4 .m4f
 M4_INCLUDES = --include $(srcdir)                --include $(top_builddir)/lib                --include $(top_srcdir)/lib
 
 
+# Some day we should explain to Automake how to use autom4te to compute
+# the dependencies...
+srclibdir = $(top_srcdir)/lib
+
 # Files that should be removed, but which Automake does not know.
 CLEANFILES = autoconf.m4f
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -277,8 +281,18 @@ $(srcdir)/version.m4: $(srcdir)/version.in $(top_srcdir)/configure.ac
        else \
          rm -f freeze.log; \
        fi
-
-autoconf.m4f: $(m4sources)
+autoconf.m4f: $(srclibdir)/m4sugar/m4sugar.m4  \
+              $(srclibdir)/m4sugar/m4sh.m4     \
+              $(srclibdir)/autoconf/autoconf.m4        \
+              $(srclibdir)/autoconf/general.m4 \
+              $(srclibdir)/autoconf/oldnames.m4        \
+              $(srclibdir)/autoconf/specific.m4        \
+              $(srclibdir)/autoconf/lang.m4 \
+              $(srclibdir)/autoconf/c.m4 \
+              $(srclibdir)/autoconf/fortran.m4 \
+              $(srclibdir)/autoconf/functions.m4 \
+              $(srclibdir)/autoconf/headers.m4 \
+              $(srclibdir)/autoconf/types.m4
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index e25d7da34585b60c7fcec3c131a91df7ad3c8d9f..2f5504c5395eb8e9a5d3f8fbb52d5d27d21de3d8 100644 (file)
@@ -728,7 +728,8 @@ m4_builtin([divert], _m4_divert(_m4_divert_diversion))dnl
 m4_define([m4_divert_pop],
 [m4_ifval([$1],
      [m4_if(_m4_divert([$1]), m4_divnum, [],
-            [m4_fatal([$0($1): unexpected current diversion: ]m4_divnum)])])dnl
+            [m4_fatal([$0($1): diversion mismatch: ]
+m4_defn([m4_divert_stack]))])])dnl
 m4_popdef([_m4_divert_diversion])dnl
 dnl m4_ifndef([_m4_divert_diversion],
 dnl           [m4_fatal([too many m4_divert_pop])])dnl
@@ -1724,14 +1725,14 @@ m4_define([m4_init],
 m4_ifndef([m4_tmpdir],
           [m4_define([m4_tmpdir], [/tmp])])
 
-# M4sugar reserves `m4_[A-Za-z0-9_]*'.  We'd need \b and +,
-# but they are not portable.
-m4_pattern_forbid([^m4_])
+# All the M4sugar macros start with `m4_', except `dnl' kept as is
+# for sake of simplicity.
+m4_pattern_forbid([^_?m4_])
 m4_pattern_forbid([^dnl$])
 
 # Check the divert push/pop perfect balance.
 m4_wrap([m4_ifdef([_m4_divert_diversion],
-         [m4_fatal([$0: unbalanced m4_divert_push:]
+                  [m4_fatal([$0: unbalanced m4_divert_push:]
 m4_defn([m4_divert_stack]))])[]])
 
 m4_divert_push([KILL])
index 4c63403ad323c700fdad17aadb83b5ff33def732..9fd590ff81a36a373d844b379b39bc85dd6a5647 100644 (file)
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.24.
-.TH AUTOM4TE "1" "August 2001" "GNU Autoconf 2.52b" FSF
+.TH AUTOM4TE "1" "August 2001" "GNU Autoconf 2.52c" FSF
 .SH NAME
 autom4te \- Generate files and scripts thanks to M4
 .SH SYNOPSIS
index 275ec9bb7556cde47b7254549ba70e3fe1bc0009..8fc62af4babdd5dccf7363c0ba9a0f66dd603792 100644 (file)
@@ -208,7 +208,7 @@ AT_CLEANUP
 AT_SETUP([autoconf: forbidden tokens, basic])
 
 AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()dnl
+[[AC_PLAIN_SCRIPT()
 AC_FOO
 _AC_BAR
 m4_foo
@@ -217,21 +217,21 @@ BAC_FOO
 B_AC_FOO
 AS_FOO
 _AS_BAR
+[dnl]
 ]])
 
-AT_CHECK_AUTOCONF([], 1, [], [stderr])
-# The output of autoconf is not deterministic here because it
-# uses `for (ind in array)'.  So be sure to have a unique representation.
-AT_CHECK([sort stderr], 0,
+AT_CHECK_AUTOCONF([], 1, [],
 [[configure.ac:2: error: possibly undefined macro: AC_FOO
 configure.ac:3: error: possibly undefined macro: _AC_BAR
 configure.ac:4: error: possibly undefined macro: m4_foo
+configure.ac:5: error: possibly undefined macro: _m4_bar
 configure.ac:7: error: possibly undefined macro: B_AC_FOO
 configure.ac:8: error: possibly undefined macro: AS_FOO
 configure.ac:9: error: possibly undefined macro: _AS_BAR
+configure.ac:10: error: possibly undefined macro: dnl
 ]])
 
-AT_CLEANUP(configure)
+AT_CLEANUP
 
 
 # autoconf: forbidden tokens, exceptions
@@ -260,20 +260,17 @@ BAC_DEFINE
 It would be very bad if Autoconf forgot to expand [AC_]OUTPUT!
 ]])
 
-AT_CHECK_AUTOCONF([], 1, [], [stderr])
-# The output of autoconf is not deterministic here because it
-# uses `for (ind in array)'.  So be sure to have a unique representation.
-AT_CHECK([sort stderr], 0,
-[[configure.ac:10: error: possibly undefined macro: FORBIDDEN
+AT_CHECK_AUTOCONF([], 1, [],
+[[configure.ac:7: error: possibly undefined macro: NOT_AC_ALLOWED
+configure.ac:7: error: possibly undefined macro: AC_ALLOWED_NOT
+configure.ac:10: error: possibly undefined macro: FORBIDDEN
 configure.ac:14: error: possibly undefined macro: AC_THIS_IS_INVALID
 configure.ac:14: error: possibly undefined macro: _AC_THIS_IS_INVALID_TOO
 configure.ac:15: error: possibly undefined macro: ALTHOUGH_AC_THIS_IS
-configure.ac:7: error: possibly undefined macro: AC_ALLOWED_NOT
-configure.ac:7: error: possibly undefined macro: NOT_AC_ALLOWED
 configure:18: error: possibly undefined macro: AC_OUTPUT
 ]])
 
-AT_CLEANUP(configure err)
+AT_CLEANUP