From: Akim Demaille Date: Fri, 19 Jan 2001 14:35:06 +0000 (+0000) Subject: Catch only used patterns. X-Git-Tag: autoconf-2.50~240 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=960155df17750ac8a40fb61aedcbd591669148c0;p=thirdparty%2Fautoconf.git 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. --- diff --git a/ChangeLog b/ChangeLog index 53e397655..6f9577baf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-01-19 Akim Demaille + + 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 Optimizing AC_LANG was broken. Test and fix. diff --git a/acgeneral.m4 b/acgeneral.m4 index 96fd8ac4f..c3bd26989 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -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 diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 96fd8ac4f..c3bd26989 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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 diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 8d89f7c24..99a8e9fa6 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/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_]) +]) diff --git a/m4sh.m4 b/m4sh.m4 index 8d89f7c24..99a8e9fa6 100644 --- 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_]) +]) diff --git a/tests/tools.at b/tests/tools.at index fcfb1b37d..2702f659b 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -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