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>
+
+ 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.
# 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
# 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
_ASUNAME
}])
+
+
+
+## ----------------- ##
+## Setting M4sh up. ##
+## ----------------- ##
+
+
+# AS_INIT
+# -------
+m4_define([AS_INIT],
+[m4_init
+
+# Forbidden tokens and exceptions.
+m4_pattern_forbid([^_?AS_])
+])
_ASUNAME
}])
+
+
+
+## ----------------- ##
+## Setting M4sh up. ##
+## ----------------- ##
+
+
+# AS_INIT
+# -------
+m4_define([AS_INIT],
+[m4_init
+
+# Forbidden tokens and exceptions.
+m4_pattern_forbid([^_?AS_])
+])
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)
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
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