This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH, GCC] compatibility with M4 1.6
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: gcc-patches at gcc dot gnu dot org, binutils at sourceware dot org
- Date: Mon, 9 Jun 2008 21:08:44 +0200
- Subject: [PATCH, GCC] compatibility with M4 1.6
Autoconf 2.59 fails with future M4 >= 1.6, as the latter implements FIFO
semantics for m4wrap which is required by Posix, but the former expects
the LIFO semantics implemented by earlier M4. Autoconf 2.60 and newer
don't have this problem.
This patch (code from m4/NEWS) fixes the issue. Since, after
<http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00368.html> is applied,
for all configure scripts in GCC, override.m4 is read but its output
diverted to /dev/null, the whole tree is ready for M4 1.6, while at the
same time this patch causes no textual changes to any configure script.
Tested by running 'autoconf --force' for each configure script.
OK for trunk and sync to binutils (after above patch is applied)?
Thanks,
Ralf
config/ChangeLog:
2008-06-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* override.m4 (m4_wrap): Fix for Posix semantics of m4wrap.
--- a/config/override.m4
+++ b/config/override.m4
@@ -3,6 +3,7 @@ dnl Autoconf macros with backports of the 2.60+ fix.
dnl - AC_CONFIG_SUBDIRS whitespace mangling,
dnl - more lenient precious variable checks
dnl - better configure error message
+dnl - reliance on non-Posix m4wrap (M4 1.6 or newer implement FIFO)
dnl
dnl This file should be a no-op for the newest Autoconf version.
dnl Its bits can be removed once the complete tree has moved to a
@@ -224,3 +225,14 @@ AC_MSG_ERROR([$1
See `config.log' for more details.], [$2]); }])
])
])
+
+m4_version_prereq([2.60],, [
+dnl M4 1.6 and newer implement m4wrap using FIFO semantics, as required
+dnl by Posix; earlier versions used LIFO semantics. Unfortunately,
+dnl Autoconf versions before 2.60 require those LIFO semantics, so
+dnl make sure to give it to them.
+m4_define([m4_wrap], [m4_ifdef([_$0_text],
+ [m4_define([_$0_text], [$1]m4_defn([_$0_text]))],
+ [m4_define([_$0_text], [$1])m4_builtin([m4wrap],
+ [m4_default(m4_defn([_$0_text])m4_undefine([_$0_text]))])])])
+])