+2009-07-25 Eric Blake <ebb9@byu.net>
+
+ Require m4 1.4.6, and fix testsuite to support this version.
+ * m4/m4.m4 (AC_PROG_GNU_M4): Reject m4 1.4.5, now that we use
+ regexp it can't handle.
+ * NEWS: Mention minimum version bump.
+ * README: Likewise.
+ * README-hacking: Likewise.
+ * doc/autoconf.texi (Introduction, Why GNU M4): Likewise.
+ * tests/tools.at (autom4te --trace and whitespace): Update test so
+ still work with older m4 line numbers.
+ * tests/m4sugar.at (m4@&t@_require: nested): Likewise.
+ Reported by Ralf Wildenhues.
+
2009-07-25 Bruno Haible <bruno@clisp.org>
Clarify autom4te debugging tips.
* Major changes in Autoconf 2.64 (2009-??-??) [stable]
Released by Eric Blake, based on git versions 2.63b.*.
+** Autoconf now requires GNU M4 1.4.6 or later. Earlier versions of M4
+ have a bug in regular expression handling that interferes with some
+ of the speedups provided since Autoconf 2.63. GNU M4 1.4.13 or
+ later is recommended.
+
** AS_IF and AS_CASE have been taught to avoid syntax errors even when
given arguments that expand to just whitespace.
macro calls.
Producing configuration scripts using Autoconf requires GNU M4 and
-Perl. You should install GNU M4 (version 1.4.5 or later is required;
+Perl. You should install GNU M4 (version 1.4.6 or later is required;
1.4.13 or later is recommended) and Perl (5.005_03 or later) before
configuring Autoconf, so that Autoconf's configure script can find
them. The configuration scripts produced by Autoconf are
- Autoconf 2.60+ <http://www.gnu.org/software/autoconf/>
- Automake 1.10+ <http://www.gnu.org/software/automake/>
- Help2man 1.29+ <http://www.gnu.org/software/help2man/>
-- M4 1.4.5+ <http://www.gnu.org/software/m4/>
+- M4 1.4.6+ <http://www.gnu.org/software/m4/>
- Perl 5.005_03+ <http://www.cpan.org/>
- Texinfo 4.8+ <http://www.gnu.org/software/texinfo/>
Autoconf imposes some restrictions on the names of macros used with
@code{#if} in C programs (@pxref{Preprocessor Symbol Index}).
-Autoconf requires @acronym{GNU} M4 version 1.4.5 or later in order to
+Autoconf requires @acronym{GNU} M4 version 1.4.6 or later in order to
generate the scripts. It uses features that some versions of M4,
including @acronym{GNU} M4 1.3, do not have. Autoconf works better
with @acronym{GNU} M4 version 1.4.13 or later, though this is not
__line__
@end example
-Autoconf requires version 1.4.5 or later of @acronym{GNU} M4.
+Autoconf requires version 1.4.6 or later of @acronym{GNU} M4.
Since only software maintainers need to use Autoconf, and since @acronym{GNU}
M4 is simple to configure and install, it seems reasonable to require
-# m4.m4 serial 8
+# m4.m4 serial 9
# Copyright (C) 2000, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# AC_PROG_GNU_M4
# --------------
-# Check for GNU M4, at least 1.4.5 (all earlier versions had a bug in
-# trace support:
-# http://lists.gnu.org/archive/html/bug-gnu-utils/2006-11/msg00096.html)
+# Check for GNU M4, at least 1.4.6 (all earlier versions had bugs in
+# trace support and regexp support):
+# http://lists.gnu.org/archive/html/bug-gnu-utils/2006-11/msg00096.html
+# http://lists.gnu.org/archive/html/bug-autoconf/2009-07/msg00023.html
# Also, check whether --error-output (through 1.4.x) or --debugfile (2.0)
# is supported, and AC_SUBST M4_DEBUGFILE accordingly.
AC_DEFUN([AC_PROG_GNU_M4],
- [AC_ARG_VAR([M4], [Location of GNU M4 1.4.5 or later. Defaults to the first
+ [AC_ARG_VAR([M4], [Location of GNU M4 1.4.6 or later. Defaults to the first
program of `m4', `gm4', or `gnum4' on PATH that meets Autoconf needs.])
AC_CACHE_CHECK([for GNU M4 that supports accurate traces], [ac_cv_path_M4],
[rm -f conftest.m4f
AS_UNSET([POSIXLY_CORRECT])
AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4 gnum4],
[dnl Creative quoting here to avoid raw dnl and ifdef in configure.
- # Root out GNU M4 1.4.4, as well as non-GNU m4 that ignore -t, -F.
- ac_snippet=change'quote(<,>)in''dir(<if''def>,mac,bug)d'nl
+ # Root out GNU M4 1.4.5, as well as non-GNU m4 that ignore -t, -F.
+ ac_snippet=change'quote(<,>)in''dir(<if''def>,mac,bug)'
+ ac_snippet=${ac_snippet}pat'subst(a,\(b\)\|\(a\),\1)d'nl
test -z "`$ac_path_M4 -F conftest.m4f </dev/null 2>&1`" \
&& test -z "`echo $ac_snippet | $ac_path_M4 --trace=mac 2>&1`" \
&& test -f conftest.m4f \
&& ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:
rm -f conftest.m4f],
[AC_MSG_ERROR([no acceptable m4 could be found in \$PATH.
-GNU M4 1.4.5 or later is required; 1.4.13 is recommended])])])
+GNU M4 1.4.6 or later is required; 1.4.13 is recommended])])])
M4=$ac_cv_path_M4
AC_CACHE_CHECK([whether $ac_cv_path_M4 accepts --gnu],
[ac_cv_prog_gnu_m4_gnu],
m4_defun([a], [[a]])dnl
m4_defun([b], [[b]m4_require([a])])dnl
m4_defun([c], [[c]m4_require([b])])dnl
-m4_defun([outer],
+dnl the extra macro layer works around line number differences in older m4
+m4_define([foo], [m4_defun([outer],
[pre
a
c
a
c
-post])dnl
+post])])foo[]dnl
outer
]],
[[a
c
post
]],
-[[script.4s:14: warning: m4@&t@_require: `a' was expanded before it was required
+[[script.4s:15: warning: m4@&t@_require: `a' was expanded before it was required
script.4s:5: b is expanded from...
script.4s:6: c is expanded from...
-script.4s:7: outer is expanded from...
-script.4s:14: the top level
+script.4s:14: outer is expanded from...
+script.4s:15: the top level
]])
dnl Direct invocation, expand-before-require but no nested require. As this
AT_SETUP([autom4te --trace and whitespace])
-AT_DATA([file.m4],
-[[m4@&t@_echo([ a
+dnl line numbering differs between m4 1.4.6 and 1.4.13 if we don't
+dnl go through a single line wrapper
+AT_DATA_M4SUGAR([file.m4],
+[[m4_define([foo], [m4_echo([ a
b c ], [\
d\
-])
+])])
+foo
]])
AT_CHECK_AUTOM4TE([--language=m4sugar -t 'm4@&t@_echo' file.m4], [0],
-[[file.m4:1:m4@&t@_echo: a b c :d
+[[file.m4:5:m4@&t@_echo: a b c :d
]])
AT_CLEANUP