[PATCH, GCC] assorted autoconf updates
Ralf Wildenhues
Ralf.Wildenhues@gmx.de
Sat Jun 7 08:16:00 GMT 2008
* Ralf Wildenhues wrote:
> Analogous post for binutils coming up.
Log entries and diff for binutils.
I have built binutils with this but done no further testing of any form.
OK to apply?
Thanks,
Ralf
config/ChangeLog:
2008-06-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* override.m4: Use m4_version_prereq throughout.
(_AC_ARG_VAR_VALIDATE, AC_MSG_FAILURE): Backport from git
Autoconf: output pwd along with fatal errors, so the right
config.log file is hinted at more prominently.
(_GCC_AUTOCONF_VERSION, _GCC_AUTOCONF_VERSION_CHECK): New
macros, require use of Autoconf 2.59 throughout the tree.
binutils/ChangeLog:
2008-06-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
opcodes/ChangeLog:
2008-06-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
bfd/ChangeLog:
2008-06-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
ChangeLog:
2008-06-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
gas/ChangeLog:
2008-06-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
gprof/ChangeLog:
2008-06-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
ld/ChangeLog:
2008-06-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* config.in: Regenerate.
* configure: Regenerate.
Index: config/override.m4
===================================================================
RCS file: /cvs/src/src/config/override.m4,v
retrieving revision 1.2
diff -u -r1.2 override.m4
--- config/override.m4 23 Apr 2008 10:24:41 -0000 1.2
+++ config/override.m4 4 Jun 2008 16:19:02 -0000
@@ -2,10 +2,11 @@
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
-dnl This file should be a no-op for Autoconf versions != 2.59.
-dnl It can be removed once the complete tree has moved to a
-dnl newer Autoconf version.
+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
+dnl new enough Autoconf version.
dnl m4_PACKAGE_VERSION is an undocumented Autoconf macro.
dnl We use it because this fix is intended for 2.59 only.
@@ -22,7 +23,27 @@
AC_DEFUN([AC_PREREQ], [frob])
m4_copy([_AC_PREREQ], [AC_PREREQ])
-ifelse(m4_PACKAGE_VERSION, [2.59], [
+
+dnl Ensure exactly this Autoconf version is used
+m4_define([_GCC_AUTOCONF_VERSION], [2.59])
+
+dnl Test for the exact version when AC_INIT is expanded.
+dnl This allows to update the tree in steps (for testing)
+dnl by putting
+dnl m4_define([_GCC_AUTOCONF_VERSION], [X.Y])
+dnl in configure.ac before AC_INIT,
+dnl without rewriting this file.
+dnl Or for updating the whole tree at once with the definition above.
+AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK],
+[m4_if(m4_defn([_GCC_AUTOCONF_VERSION]),
+ m4_defn([m4_PACKAGE_VERSION]), [],
+ [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
+])
+m4_define([AC_INIT], m4_defn([AC_INIT])[
+_GCC_AUTOCONF_VERSION_CHECK
+])
+
+m4_version_prereq([2.60],, [
# _AC_OUTPUT_SUBDIRS
# ------------------
@@ -128,12 +149,13 @@
])# _AC_OUTPUT_SUBDIRS
])
-ifelse(m4_PACKAGE_VERSION, [2.62],, [
+m4_version_prereq([2.62],, [
# _AC_ARG_VAR_VALIDATE
# --------------------
# The code is the same as autoconf 2.59, but with a more lenient check
-# on precious variables that has been added in autoconf 2.62.
+# on precious variables and an output of pwd that have been added in
+# autoconf 2.62.
m4_define([_AC_ARG_VAR_VALIDATE],
[# Check that the precious variables saved in the cache have kept the same
# value.
@@ -184,8 +206,21 @@
fi
done
if $ac_cache_corrupted; then
+ AS_MESSAGE([error: in `$ac_pwd':], 2)
AS_MESSAGE([error: changes in the environment can compromise the build], 2)
AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over])
fi
])# _AC_ARG_VAR_VALIDATE
-])])
+])
+
+m4_version_prereq([2.62],, [
+
+# AC_MSG_FAILURE(ERROR, [EXIT-STATUS = 1])
+# ----------------------------------------
+# This is the same code as in 2.59 and 2.61, except it also outputs pwd.
+m4_define([AC_MSG_FAILURE],
+[{ AS_MESSAGE([error: in `$ac_pwd':], 2)
+AC_MSG_ERROR([$1
+See `config.log' for more details.], [$2]); }])
+])
+])
More information about the Gcc-patches
mailing list