]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sugar.m4 (m4_require): Modify the error
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 5 Jun 2006 08:18:33 +0000 (08:18 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 5 Jun 2006 08:18:33 +0000 (08:18 +0000)
message issued by AC_REQUIRE.
* tests/m4sugar.at: Check m4_require's error message.
* tests/base.at: Check AC_REQUIRE's error message.
* tests/local.at (AT_CHECK_M4): New macro, almost identical
to...
(AT_CHECK_AUTOM4TE): ... which is now a thin wrapper around
AT_CHECK_M4.
(AT_CHECK_AUTOCONF): Use AT_CHECK_M4; no longer support
`expout' as the last parameter.
* tests/tools.at: Adapt to the above change.

ChangeLog
lib/m4sugar/m4sugar.m4
tests/base.at
tests/local.at
tests/m4sugar.at
tests/tools.at

index 15f61567322ace945aa5dd00bc83fd222a58702e..4853e836374a80425c83297105e0dfe17e5a6dd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-06-05  Stepan Kasal  <kasal@ucw.cz>
+
+       * lib/m4sugar/m4sugar.m4 (m4_require): Modify the error
+       message issued by AC_REQUIRE.
+       * tests/m4sugar.at: Check m4_require's error message.
+       * tests/base.at: Check AC_REQUIRE's error message.
+       * tests/local.at (AT_CHECK_M4): New macro, almost identical
+       to...
+       (AT_CHECK_AUTOM4TE): ... which is now a thin wrapper around
+       AT_CHECK_M4.
+       (AT_CHECK_AUTOCONF): Use AT_CHECK_M4; no longer support
+       `expout' as the last parameter.
+       * tests/tools.at: Adapt to the above change.
+
 2006-06-04  Stepan Kasal  <kasal@ucw.cz>
 
        * doc/autoconf.texi (Limitations of Usual Tools): Correct
index c1f989e3622e4762524af7a26e4f44e868caeaa7..4e7d0d69dbb9d734fc0247db420d76a70cc0578d 100644 (file)
@@ -1249,7 +1249,8 @@ m4_define([m4_require],
 [m4_ifdef([_m4_expanding($1)],
         [m4_fatal([$0: circular dependency of $1])])dnl
 m4_ifndef([_m4_divert_dump],
-         [m4_fatal([$0($1): cannot be used outside of an m4_defun'd macro])])dnl
+         [m4_fatal([$0($1): cannot be used outside of an ]dnl
+m4_bmatch([$0], [^AC_], [[AC_DEFUN]], [[m4_defun]])['d macro])])dnl
 m4_provide_if([$1],
              [],
              [_m4_require_call([$1], [$2])])dnl
index 04fbf6085eaaab0b493b362a353162439fc25c42..18b7a15ad8b5f32d53e1f9c0fb55112d8107916e 100644 (file)
@@ -63,6 +63,24 @@ AT_CHECK_CONFIGURE
 AT_CLEANUP
 
 
+## --------------------------- ##
+## AC_REQUIRE: error message.  ##
+## --------------------------- ##
+
+# Check that the message mentions AC_DEFUN, not m4_defun.
+
+AT_SETUP([AC_REQUIRE: error message])
+AT_DATA([configure.ac],
+[[AC_REQUIRE([AC_PROG_CC])
+]])
+
+AT_CHECK_AUTOCONF([], [1], [],
+[[configure.ac:1: error: AC_REQUIRE(AC_PROG_CC): cannot be used outside of an AC_DEFUN'd macro
+configure.ac:1: the top level
+autom4te: m4 failed with exit status: 1
+]])
+AT_CLEANUP
+
 
 ## ----------------------------------------------- ##
 ## AC_REQUIRE and AC_DEFUN_ONCE: Require, expand.  ##
index c49e1f3692cfcdf9b85f1617c3ce80ccbc4a0263..e753ab187fb16d4d909965154c6cb2638bf0e686 100644 (file)
@@ -62,8 +62,8 @@ m4_define([AT_CHECK_PERL_SYNTAX],
 ## ------------------ ##
 
 
-# AT_CHECK_AUTOM4TE(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
-# -----------------------------------------------------------
+# AT_CHECK_M4(COMMAND, [EXIT-STATUS = 0], STDOUT, STDERR)
+# -------------------------------------------------------
 # If stderr is specified, normalize the observed stderr.  E.g. (GNU M4 1.5):
 #
 #  /usr/local/bin/m4: script.4s: 1: Cannot open foo: No such file or directory
@@ -87,18 +87,24 @@ m4_define([AT_CHECK_PERL_SYNTAX],
 #
 # and
 #     autom4te: [^ ]m4
+# or  autom4te: [^ ]m4.exe
 # to  autom4te: m4
-m4_define([AT_CHECK_AUTOM4TE],
-[AT_CHECK([autom4te $1], [$2], [$3], m4_ifval([$4], [stderr]))
+m4_define([AT_CHECK_M4],
+[AT_CHECK([$1], [$2], [$3], m4_ifval([$4], [stderr]))
 m4_ifval([$4],
 [AT_CHECK([[sed -e 's/^\([^:]*\): *\([0-9][0-9]*\): *[^:]*m4: /m4: \1: \2: /' \
                -e 's/^[^:]*m4: *\([^:]*\): *\([0-9][0-9]*\): /m4: \1: \2: /' \
                -e 's/^autom4te: [^ ]*m4 /autom4te: m4 /' \
-               -e 's/^autom4te: [^ ]*m4.exe /autom4te: m4 /' \
+               -e 's/^autom4te: [^ ]*m4\.exe /autom4te: m4 /' \
                -e 's/ (E[A-Z]*)$//' \
           stderr]], [0],[$4])])
 ])
 
+# AT_CHECK_AUTOM4TE(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
+# -----------------------------------------------------------
+m4_define([AT_CHECK_AUTOM4TE],
+[AT_CHECK_M4([autom4te $1], [$2], [$3], [$4])])
+
 
 
 ## ----------------- ##
@@ -203,7 +209,7 @@ AC_STATE_SAVE(after)
 # We always use "--force", to prevent problems with timestamps if the testsuite
 # were running too fast.
 m4_define([AT_CHECK_AUTOCONF],
-[AT_CHECK([autoconf --force $1], [$2], [$3], [$4])
+[AT_CHECK_M4([autoconf --force $1], [$2], [$3], [$4])
 if test -s configure; then
   AT_CHECK_SHELL_SYNTAX(configure)
 fi
index df6180d0187c9c1aa6a8ae1bfbce1c899a17ab89..843ae0664f7947ca9b5a3af7e925e8c700650b4b 100644 (file)
@@ -95,6 +95,25 @@ script.4s:7: the top level
 AT_CLEANUP
 
 
+## --------------------------- ##
+## m4_require: error message.  ##
+## --------------------------- ##
+
+AT_SETUP([m4@&t@_require: error message])
+
+AT_DATA_M4SUGAR([script.4s],
+[[m4_defun([foo], [FOO])
+m4_require([foo])
+]])
+
+AT_CHECK_M4SUGAR([], 1, [],
+[[script.4s:2: error: m4@&t@_require(foo): cannot be used outside of an m4_defun'd macro
+script.4s:2: the top level
+autom4te: m4 failed with exit status: 1
+]])
+AT_CLEANUP
+
+
 ## ----------------------------------- ##
 ## m4_require: circular dependencies.  ##
 ## ----------------------------------- ##
index c4a141be3af5007ed2cfb64b898ac517cde65240..c95e0e5c5dd84056feb7087188dd9ec8093075c0 100644 (file)
@@ -253,18 +253,16 @@ _AS_BAR
 [dnl]
 ]])
 
-AT_DATA_M4SH([experr],
-[[configure.ac:2: error: possibly undefined macro: m4_foo
-      If this token and others are legitimate, please use m4_pattern_allow.
+AT_CHECK_AUTOCONF([], 1, [],
+[[configure.ac:2: error: possibly undefined macro: m4@&t@_foo
+      If this token and others are legitimate, please use m4@&t@_pattern_allow.
       See the Autoconf documentation.
-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: dnl
+configure.ac:3: error: possibly undefined macro: _m4@&t@_bar
+configure.ac:4: error: possibly undefined macro: AS@&t@_FOO
+configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR
+configure.ac:6: error: possibly undefined macro: d@&t@nl
 ]])
 
-AT_CHECK_AUTOCONF([], 1, [], experr)
-
 AT_CLEANUP
 
 
@@ -294,18 +292,16 @@ BAS_DEFINE
 It would be very bad if Autoconf forgot to expand [AS_]INIT!
 ]])
 
-AT_DATA_M4SH([experr],
-[[configure.ac:1: error: possibly undefined macro: AS_INIT
-      If this token and others are legitimate, please use m4_pattern_allow.
+AT_CHECK_AUTOCONF([], 1, [],
+[[configure.ac:1: error: possibly undefined macro: AS@&t@_INIT
+      If this token and others are legitimate, please use m4@&t@_pattern_allow.
       See the Autoconf documentation.
-configure.ac:7: error: possibly undefined macro: AS_ALLOWED_NOT
+configure.ac:7: error: possibly undefined macro: AS@&t@_ALLOWED_NOT
 configure.ac:10: error: possibly undefined macro: FORBIDDEN
-configure.ac:14: error: possibly undefined macro: AS_THIS_IS_INVALID
-configure.ac:14: error: possibly undefined macro: _AS_THIS_IS_INVALID_TOO
+configure.ac:14: error: possibly undefined macro: AS@&t@_THIS_IS_INVALID
+configure.ac:14: error: possibly undefined macro: _AS@&t@_THIS_IS_INVALID_TOO
 ]])
 
-AT_CHECK_AUTOCONF([], 1, [], [experr])
-
 AT_CLEANUP