]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/general.m4 (_m4_divert(BODY)): Move to...
authorAkim Demaille <akim@epita.fr>
Mon, 8 Oct 2001 08:20:59 +0000 (08:20 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 8 Oct 2001 08:20:59 +0000 (08:20 +0000)
* lib/m4sugar/m4sh.m4: here.
(AS_INIT): Push the BODY diversion, set the #! /bin/sh line.
* lib/autoconf/general.m4 (AC_PLAIN_SCRIPT) : Remove.
(AT_INIT): Replace AC_PLAIN_SCRIPT with AS_INIT invocation,
include handle the m4_pattern_*, no longer push the
BODY diversion nor set the /bin/sh line, AS_INIT does it.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* tests/base.at: Adjust the tests to use AS_INIT.
* tests/tools.at (AT_DATA_FORBIDDEN): New.
(autoconf: forbidden tokens): Adjust to work on M4sh instead of
Autoconf.

ChangeLog
lib/autoconf/general.m4
lib/autotest/general.m4
lib/m4sugar/m4sh.m4
tests/Makefile.in
tests/base.at
tests/m4sh.at
tests/tools.at

index 4818a2ce5e0de8843e5cda20db3e7007d8b7a08e..115a25ba76ddc18df66f821a07740382e359de7f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2001-10-08  Akim Demaille  <akim@epita.fr>
+
+       * lib/autoconf/general.m4 (_m4_divert(BODY)): Move to...
+       * lib/m4sugar/m4sh.m4: here.
+       (AS_INIT): Push the BODY diversion, set the #! /bin/sh line.
+       * lib/autoconf/general.m4 (AC_PLAIN_SCRIPT) : Remove.
+       (AT_INIT): Replace AC_PLAIN_SCRIPT with AS_INIT invocation,
+       include handle the m4_pattern_*, no longer push the
+       BODY diversion nor set the /bin/sh line, AS_INIT does it.
+       * lib/autotest/general.m4 (AT_INIT): Likewise.
+       * tests/base.at: Adjust the tests to use AS_INIT.
+       * tests/tools.at (AT_DATA_FORBIDDEN): New.
+       (autoconf: forbidden tokens): Adjust to work on M4sh instead of
+       Autoconf.
+
 2001-10-07  Paul Eggert  <eggert@twinsun.com>
 
        * doc/autoconf.texi (config.status Invocation):
index b7b07375a8a85adbb2c12c7ef253ee56ca97dd8f..c574a0db5afe81c942e5ce7634ff6a5087a8cb52 100644 (file)
 # of little macros, but it then takes twice longer to run `autoconf'!
 #
 # From M4sugar:
-# -1. KILL
+#    -1. KILL
+# 10000. GROW
 #
 # From M4sh:
-#  0. BINSH
-#  1. HEADER-REVISION
-#  2. HEADER-COMMENT
-#  3. HEADER-COPYRIGHT
-#  4. M4SH-INIT
-
+#    0. BINSH
+#    1. HEADER-REVISION
+#    2. HEADER-COMMENT
+#    3. HEADER-COPYRIGHT
+#    4. M4SH-INIT
+# 1000. BODY
 m4_define([_m4_divert(DEFAULTS)],        10)
 m4_define([_m4_divert(PARSE_ARGS)],      20)
 
@@ -147,8 +148,6 @@ m4_define([_m4_divert(VERSION_END)],    203)
 
 m4_define([_m4_divert(INIT_PREPARE)],   300)
 
-m4_define([_m4_divert(BODY)],           400)
-
 
 
 # AC_DIVERT_PUSH(DIVERSION-NAME)
@@ -1263,26 +1262,6 @@ AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
 ])
 
 
-# AC_PLAIN_SCRIPT
-# ---------------
-# Simulate AC_INIT, i.e., pretend this is the beginning of the `configure'
-# generation.  This is used by some tests, and lets `autoconf' be used to
-# generate other scripts than `configure'.
-m4_define([AC_PLAIN_SCRIPT],
-[AS_INIT
-
-# Forbidden tokens and exceptions.
-m4_pattern_forbid([^_?A[CHUM]_])
-m4_pattern_forbid([_AC_])
-# Actually reserved by M4sh.
-m4_pattern_allow([^AS_FLAGS$])
-
-m4_divert_push([BODY])dnl
-m4_wrap([m4_divert_pop([BODY])[]])dnl
-])
-
-
-
 # AC_INIT([PACKAGE, VERSION, [BUG-REPORT])
 # ----------------------------------------
 # Include the user macro files, prepare the diversions, and output the
@@ -1290,9 +1269,13 @@ m4_wrap([m4_divert_pop([BODY])[]])dnl
 # Note that the order is important: first initialize, then set the
 # AC_CONFIG_SRCDIR.
 m4_define([AC_INIT],
-[AC_PLAIN_SCRIPT
+[# Forbidden tokens and exceptions.
+m4_pattern_forbid([^_?A[CHUM]_])
+m4_pattern_forbid([_AC_])
+# Actually reserved by M4sh.
+m4_pattern_allow([^AS_FLAGS$])
+AS_INIT
 m4_ifval([$2], [_AC_INIT_PACKAGE($@)])
-m4_divert_text([BINSH], [@%:@! /bin/sh])
 _AC_INIT_DEFAULTS
 _AC_INIT_PARSE_ARGS
 _AC_INIT_SRCDIR
index 46862842317daad59a7ee455c703f8536a3d2acf..55eeff5e2ca48100c146ed34b782d53b744b0f23 100644 (file)
@@ -88,15 +88,14 @@ m4_define([AT_LINE],
 # -------------------------
 # Begin test suite.
 m4_define([AT_INIT],
-[AS_INIT
-m4_pattern_forbid([^_?AT_])
+[m4_pattern_forbid([^_?AT_])
 m4_pattern_forbid([PACKAGE_(BUGREPORT|STRING)$])
 m4_define([AT_TESTSUITE_NAME],
           m4_defn([PACKAGE_STRING])[ test suite]m4_ifval([$1], [: $1]))
 m4_define([AT_ordinal], 0)
 m4_define([AT_banner_ordinal], 0)
 m4_define([AT_data_files], [stdout expout at-* stderr experr])
-m4_divert_text([BINSH], [@%:@! /bin/sh])
+AS_INIT
 m4_divert_push([DEFAULT])dnl
 
 AS_SHELL_SANITIZE
index 2f46444320bccfed2e33981cbc89c8f0f01c627f..ae89affc07fb32971295a896f3a19066ffd7059c 100644 (file)
@@ -66,7 +66,9 @@ changequote()changequote([, ])include(m4sugar/m4sugar.m4)#  -*- Autoconf -*-
 #   Copyright notice(s)
 # - M4SH-INIT
 #   M4sh's initializations
-
+#
+# - BODY
+#   The body of the script.
 
 
 # _m4_divert(DIVERSION-NAME)
@@ -80,6 +82,7 @@ m4_define([_m4_divert(HEADER-REVISION)],   1)
 m4_define([_m4_divert(HEADER-COMMENT)],    2)
 m4_define([_m4_divert(HEADER-COPYRIGHT)],  3)
 m4_define([_m4_divert(M4SH-INIT)],         4)
+m4_define([_m4_divert(BODY)],           1000)
 
 # Aaarg.  Yet it starts with compatibility issues...  Libtool wants to
 # use NOTICE to insert its own LIBTOOL-INIT stuff.  People should ask
@@ -924,4 +927,11 @@ m4_define([AS_INIT],
 
 # Forbidden tokens and exceptions.
 m4_pattern_forbid([^_?AS_])
+
+# Bangshe.
+m4_divert_text([BINSH], [@%:@! /bin/sh])
+
+# Let's go!
+m4_wrap([m4_divert_pop([BODY])[]])
+m4_divert_push([BODY])[]dnl
 ])
index 14a43550ef3bd7c81ca405760c9b243baebe09c6..b889a3a743d0ae5001a7bee0cbcfb0ad5c15c87d 100644 (file)
@@ -275,7 +275,8 @@ atlocal: $(srcdir)/atlocal.in $(top_builddir)/config.status
        cd $(top_builddir) && ./config.status tests/$@
 
 clean-local:
-       $(SHELL) $(TESTSUITE) --clean
+       test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
+       rm -f *.tmp
        rm -rf autom4te.cache
 
 check-local: atconfig atlocal $(TESTSUITE)
index e79cc32f4295def4e89331fd6b7aebcd24194e3b..30df14f8a63db529b190fa546cc3b055db6b5fac 100644 (file)
@@ -49,7 +49,7 @@ AC_DEFUN([TEST3],
 [REQUIRE_AND_CHECK([TEST2a])
 test3=set])
 
-AC_PLAIN_SCRIPT()#! /bin/sh
+AS@&t@_INIT
 
 TEST1
 test -z "$test1" &&
@@ -81,7 +81,7 @@ AC_DEFUN([MULTI_TEST],
 AC_DEFUN_ONCE([SINGLE_TEST],
 [single_test=".$single_test"])
 
-AC_PLAIN_SCRIPT()#! /bin/sh
+AS@&t@_INIT
 
 TEST
 TEST
@@ -125,7 +125,7 @@ AC_DEFUN([MULTI_TEST],
 AC_DEFUN_ONCE([SINGLE_TEST],
 [single_test=".$single_test"])
 
-AC_PLAIN_SCRIPT()#! /bin/sh
+AS@&t@_INIT
 
 MULTI_TEST
 MULTI_TEST
@@ -164,7 +164,7 @@ AT_DATA([configure.ac],
 AC_DEFUN([INNER_TEST],
 [inner_test=".$inner_test"])
 
-AC_PLAIN_SCRIPT()#! /bin/sh
+AS@&t@_INIT
 
 AC_PROVIDE([INNER_TEST])
 TEST
index 39bf90d243def39dcb8ea9f54c460a58d6caa912..aa873dd7d8520d80cc8bc395174bd95c60d8ba28 100644 (file)
@@ -98,7 +98,7 @@ m4_pattern_allow([^AS_DIRNAME(_SED)?$])
 AT_SETUP([[AS_DIRNAME & AS_DIRNAME_SED]])
 
 AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()#! /bin/sh
+[[AS@&t@_INIT
 
 _AS@&t@_EXPR_PREPARE
 
@@ -153,7 +153,7 @@ m4_pattern_allow([^AS_BASENAME(_SED)?$])
 AT_SETUP([[AS_BASENAME & AS_BASENAME_SED]])
 
 AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()#! /bin/sh
+[[AS@&t@_INIT
 
 _AS@&t@_EXPR_PREPARE
 
@@ -213,7 +213,7 @@ m4_pattern_allow([^AS_MKDIR_P$])
 AT_SETUP([[AS_MKDIR_P]])
 
 AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()#! /bin/sh
+[[AS@&t@_INIT
 
 pwd=`pwd`
 set -e
@@ -246,7 +246,7 @@ AT_CLEANUP(configure 1 a)
 AT_SETUP([Negated classes in globbing])
 
 AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()#! /bin/sh
+[[AS@&t@_INIT
 
 case 'with!two!bangs' in
   *[[!a-z]]*) ;;
index 5a812d801dc16aa5dff846230a29dc1ccc0c853d..aff4e48e2e6efe21b8ab6786cb51de68b923fa7c 100644 (file)
@@ -232,40 +232,39 @@ AT_CLEANUP
 
 
 
-
 ## ---------------------------- ##
 ## autoconf: forbidden tokens.  ##
 ## ---------------------------- ##
 
+# AT_DATA_FORBIDDEN(FILENAME, CONTENTS)
+# -------------------------------------
+# Escape the invalid tokens with @&t@.
+m4_define([AT_DATA_FORBIDDEN],
+[AT_DATA([$1], [m4_patsubst([$2], [\(m4\|AS\)_], [\1@&t@_])])])
+
 # autoconf: forbidden tokens, basic
 # ---------------------------------
 AT_SETUP([autoconf: forbidden tokens, basic])
 
-m4_pattern_allow([^(m4_foo|_m4_bar|AS_FOO|_AS_BAR)$])
-AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT()
-AC_FOO
-_AC_BAR
+AT_DATA_FORBIDDEN([configure.ac],
+[[AS_INIT
 m4_foo
 _m4_bar
-BAC_FOO
-B_AC_FOO
 AS_FOO
 _AS_BAR
 [d@&t@nl]
 ]])
 
-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: d@&t@nl
+AT_DATA_FORBIDDEN([experr],
+[[configure.ac:2: error: possibly undefined macro: m4_foo
+configure.ac:3: error: possibly undefined macro: _m4_bar
+configure.ac:4: error: possibly undefined macro: AS_FOO
+configure.ac:5: error: possibly undefined macro: _AS_BAR
+configure.ac:6: error: possibly undefined macro: d@&t@nl
 ]])
 
+AT_CHECK_AUTOCONF([], 1, [], experr)
+
 AT_CLEANUP
 
 
@@ -273,38 +272,38 @@ AT_CLEANUP
 # --------------------------------------
 AT_SETUP([autoconf: forbidden tokens, exceptions])
 
-AT_DATA([configure.ac],
-[[AC_PLAIN_SCRIPT
+AT_DATA_FORBIDDEN([configure.ac],
+[[AS_INIT
 
 # This is allowed in spite of the name.
 # It is on purpose that we check the case where there are several
 # tokens on the same line.
-m4@&t@_pattern_allow([^AC_ALLOWED$])
-NOT_AC_ALLOWED AC_ALLOWED AC_ALLOWED_NOT
+m4_pattern_allow([^AS_ALLOWED$])
+NOT_AS_ALLOWED AS_ALLOWED AS_ALLOWED_NOT
 
 # Test forbidding.
-m4@&t@_pattern_forbid([^FORBIDDEN$])
+m4_pattern_forbid([^FORBIDDEN$])
 NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
 
 # Test Autoconf's patterns.
-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
-# AC_THIS_IS_A_COMMENT so just shut up.
-It would be very bad if Autoconf forgot to expand [AC_]OUTPUT!
+AS_THIS_IS_INVALID and _AS_THIS_IS_INVALID_TOO
+BUT_AZ_THIS_IS_NOT ALTHOUGH_AS_THIS_IS
+# This is legal, although there is `AS_DEFINE' in there.
+BAS_DEFINE
+# AS_THIS_IS_A_COMMENT so just shut up.
+It would be very bad if Autoconf forgot to expand [AS_]INIT!
 ]])
 
-AT_CHECK_AUTOCONF([], 1, [],
-[[configure.ac:7: error: possibly undefined macro: NOT_AC_ALLOWED
-configure.ac:7: error: possibly undefined macro: AC_ALLOWED_NOT
+AT_DATA_FORBIDDEN([experr],
+[[configure.ac:1: error: possibly undefined macro: AS_INIT
+configure.ac:7: error: possibly undefined macro: AS_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:18: error: possibly undefined macro: AC_OUTPUT
+configure.ac:14: error: possibly undefined macro: AS_THIS_IS_INVALID
+configure.ac:14: error: possibly undefined macro: _AS_THIS_IS_INVALID_TOO
 ]])
 
+AT_CHECK_AUTOCONF([], 1, [], [experr])
+
 AT_CLEANUP