From e18033c024a77b23b418858d0f942f53d872ae66 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Sat, 25 Jul 2009 17:17:41 -0600 Subject: [PATCH] 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. Signed-off-by: Eric Blake --- ChangeLog | 14 ++++++++++++++ NEWS | 5 +++++ README | 2 +- README-hacking | 2 +- doc/autoconf.texi | 4 ++-- m4/m4.m4 | 18 ++++++++++-------- tests/m4sugar.at | 11 ++++++----- tests/tools.at | 11 +++++++---- 8 files changed, 46 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ecd0d82..81499131 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-07-25 Eric Blake + + 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 Clarify autom4te debugging tips. diff --git a/NEWS b/NEWS index 3830fc0b..8bf819e5 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,11 @@ GNU Autoconf NEWS - User visible changes. * 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. diff --git a/README b/README index 1e35ff78..4b048a9d 100644 --- a/README +++ b/README @@ -11,7 +11,7 @@ operating system features that the package can use, in the form of M4 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 diff --git a/README-hacking b/README-hacking index 6eb8c444..c9570861 100644 --- a/README-hacking +++ b/README-hacking @@ -17,7 +17,7 @@ tools we depend upon, including: - Autoconf 2.60+ - Automake 1.10+ - Help2man 1.29+ -- M4 1.4.5+ +- M4 1.4.6+ - Perl 5.005_03+ - Texinfo 4.8+ diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 39286fd4..347e0f2c 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -728,7 +728,7 @@ for more information. 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 @@ -23234,7 +23234,7 @@ __file__ __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 diff --git a/m4/m4.m4 b/m4/m4.m4 index d637e926..096fb287 100644 --- a/m4/m4.m4 +++ b/m4/m4.m4 @@ -1,4 +1,4 @@ -# m4.m4 serial 8 +# m4.m4 serial 9 # Copyright (C) 2000, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. @@ -10,13 +10,14 @@ # 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 @@ -24,15 +25,16 @@ ac_had_posixly_correct=${POSIXLY_CORRECT:+yes} 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(,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(,mac,bug)' + ac_snippet=${ac_snippet}pat'subst(a,\(b\)\|\(a\),\1)d'nl test -z "`$ac_path_M4 -F conftest.m4f &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], diff --git a/tests/m4sugar.at b/tests/m4sugar.at index 04f06b9a..2e89cc53 100644 --- a/tests/m4sugar.at +++ b/tests/m4sugar.at @@ -581,13 +581,14 @@ AT_CHECK_M4SUGAR_TEXT([[dnl 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 @@ -599,11 +600,11 @@ 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 diff --git a/tests/tools.at b/tests/tools.at index e54ed699..cba570eb 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -228,14 +228,17 @@ AT_CLEANUP 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 -- 2.11.4.GIT