]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Catch only used patterns.
authorAkim Demaille <akim@epita.fr>
Fri, 19 Jan 2001 14:35:06 +0000 (14:35 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 19 Jan 2001 14:35:06 +0000 (14:35 +0000)
Reported by the whole Autoconf community.
* m4sh.m4 (AS_INIT): New.
* acgeneral.m4 (AC_PLAIN_SCRIPT): Use it.
Forbid only AC, AU, AH and AM.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4
lib/m4sugar/m4sh.m4
m4sh.m4
tests/tools.at

index 53e3976557e631fea7f9f0b239583e7b14c3118f..6f9577bafde3c918fdc4b1624b097cfd39ed8501 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-01-19  Akim Demaille  <akim@epita.fr>
+
+       Catch only used patterns.
+       Reported by the whole Autoconf community.
+
+       * m4sh.m4 (AS_INIT): New.
+       * acgeneral.m4 (AC_PLAIN_SCRIPT): Use it.
+       Forbid only AC, AU, AH and AM.
+
 2001-01-19  Akim Demaille  <akim@epita.fr>
 
        Optimizing AC_LANG was broken.  Test and fix.
index 96fd8ac4fbc5ebfb3ae00a6776ec6a5da2024f1d..c3bd269894faa34461ef08c27b17b33ffe660539 100644 (file)
@@ -1509,13 +1509,13 @@ AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
 # generation.  This is used by some tests, and let `autoconf' be used to
 # generate other scripts than `configure'.
 m4_define([AC_PLAIN_SCRIPT],
-[m4_init
+[AS_INIT
 
 # Forbidden tokens and exceptions.
-m4_pattern_forbid([^A]m4_dquote(m4_defn([m4_cr_LETTERS]))[_])
+m4_pattern_forbid([^_?A[CHUM]_])
 m4_pattern_forbid([_AC_])
-m4_pattern_allow([^AF_(INET|UNIX)$])
-m4_pattern_allow([^A[RS]_FLAGS$])
+# Actually reserved by M4sh.
+m4_pattern_allow([^AS_FLAGS$])
 
 m4_divert_push([BODY])dnl
 m4_wrap([m4_divert_pop([BODY])[]])dnl
index 96fd8ac4fbc5ebfb3ae00a6776ec6a5da2024f1d..c3bd269894faa34461ef08c27b17b33ffe660539 100644 (file)
@@ -1509,13 +1509,13 @@ AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
 # generation.  This is used by some tests, and let `autoconf' be used to
 # generate other scripts than `configure'.
 m4_define([AC_PLAIN_SCRIPT],
-[m4_init
+[AS_INIT
 
 # Forbidden tokens and exceptions.
-m4_pattern_forbid([^A]m4_dquote(m4_defn([m4_cr_LETTERS]))[_])
+m4_pattern_forbid([^_?A[CHUM]_])
 m4_pattern_forbid([_AC_])
-m4_pattern_allow([^AF_(INET|UNIX)$])
-m4_pattern_allow([^A[RS]_FLAGS$])
+# Actually reserved by M4sh.
+m4_pattern_allow([^AS_FLAGS$])
 
 m4_divert_push([BODY])dnl
 m4_wrap([m4_divert_pop([BODY])[]])dnl
index 8d89f7c24da4a3ca7507904beb6f680ada77175c..99a8e9fa648c9061d3643c8887ffecb53ff5e805 100644 (file)
@@ -422,3 +422,19 @@ PATH = $PATH
 
 _ASUNAME
 }])
+
+
+
+## ----------------- ##
+## Setting M4sh up.  ##
+## ----------------- ##
+
+
+# AS_INIT
+# -------
+m4_define([AS_INIT],
+[m4_init
+
+# Forbidden tokens and exceptions.
+m4_pattern_forbid([^_?AS_])
+])
diff --git a/m4sh.m4 b/m4sh.m4
index 8d89f7c24da4a3ca7507904beb6f680ada77175c..99a8e9fa648c9061d3643c8887ffecb53ff5e805 100644 (file)
--- a/m4sh.m4
+++ b/m4sh.m4
@@ -422,3 +422,19 @@ PATH = $PATH
 
 _ASUNAME
 }])
+
+
+
+## ----------------- ##
+## Setting M4sh up.  ##
+## ----------------- ##
+
+
+# AS_INIT
+# -------
+m4_define([AS_INIT],
+[m4_init
+
+# Forbidden tokens and exceptions.
+m4_pattern_forbid([^_?AS_])
+])
index fcfb1b37d02749e1263b3be143be9fc6ed74eac1..2702f659b77dfd1d09ca3116057f80b2d5bba321 100644 (file)
@@ -219,6 +219,7 @@ configure.ac:3: error: undefined macro: _AC_BAR
 configure.ac:4: error: undefined macro: m4_foo
 configure.ac:7: error: undefined macro: B_AC_FOO
 configure.ac:8: error: undefined macro: AS_FOO
+configure.ac:9: error: undefined macro: _AS_BAR
 ]])
 
 AT_CLEANUP(configure err)
@@ -242,7 +243,7 @@ m4_pattern_forbid([^FORBIDDEN$])
 NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
 
 # Test Autoconf's patterns.
-AC_THIS_IS_INVALID and AZ_THIS_IS_INVALID_TOO
+AC_THIS_IS_INVALID and _AC_THIS_IS_INVALID_TOO
 BUT_AZ_THIS_IS_NOT ALTHOUGH_AC_THIS_IS
 # This is legal, although there is `AC_DEFINE' in there.
 BAC_DEFINE
@@ -256,7 +257,7 @@ AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir 2>err], 1)
 AT_CHECK([sort <err], 0,
 [[configure.ac:10: error: undefined macro: FORBIDDEN
 configure.ac:14: error: undefined macro: AC_THIS_IS_INVALID
-configure.ac:14: error: undefined macro: AZ_THIS_IS_INVALID_TOO
+configure.ac:14: error: undefined macro: _AC_THIS_IS_INVALID_TOO
 configure.ac:15: error: undefined macro: ALTHOUGH_AC_THIS_IS
 configure.ac:7: error: undefined macro: AC_ALLOWED_NOT
 configure.ac:7: error: undefined macro: NOT_AC_ALLOWED