This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, GCC] assorted autoconf updates


* Paolo Bonzini wrote on Tue, Jun 10, 2008 at 12:26:05AM CEST:
> Ralf Wildenhues wrote:
>> This patch does several small configure changes in one go, in order to
>> avoid going insane with all the "Regenerate." ChangeLog entries.
>
> The patch is okay, but can you please bug the newlib guys about  
> upgrading to 2.62?

Will address, but let's sort out the stuff mentioned below first.

> Since they are already using 2.61, it's okay that they do not use  
> override.m4 which would give an error (my patch to use it was ignored on  
> the newlib mailing list); but they should upgrade to 2.62 in order to  
> fix PR35457.

Hmm.  I didn't know they were using an updated Autoconf already.  I kind
of like the override.m4 approach, and think that it can be useful even
when GCC and binutils have moved.  So maybe we can make it useful for
them, too.  We could move this definition

  m4_define([_GCC_AUTOCONF_VERSION], [2.59])

to a separate file which they can override for themselves.
Or use something like

  m4_ifndef([_GCC_AUTOCONF_VERSION],
    [m4_define([_GCC_AUTOCONF_VERSION], [2.59])])

so they can have a way to globally override by introducing another .m4
file.  I've put the latter in the updated patch below.  What do you
think?  (I will address newlib depending on this.)


Unfortunately, I found a couple more issues with my patch.  First, the
configure errors were using $ac_pwd which was introduced in Autoconf
2.60 only; sorry about that.  Also, of course the upstream introduction
of them will be available in 2.63 only.  This updated patch fixes these
issues, and I've tested the error messages now.

Still OK to apply?  All the other ChangeLog entries are still identical.

FWIW, there are a couple of patches pending on this one,
both <http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00509.html>,
and also Kai is waiting for this one to go in, in order to define
AC_TYPE_INTPTR_T in override.m4.

Thanks,
Ralf

config/ChangeLog:
2008-06-15  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.

Index: config/override.m4
===================================================================
--- config/override.m4	(Revision 136808)
+++ config/override.m4	(Arbeitskopie)
@@ -2,10 +2,14 @@
 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 The override bits of this file should be a no-op for the newest
+dnl Autoconf version, which means they can be removed once the complete
+dnl tree has moved to a new enough Autoconf version.
+dnl
+dnl The _GCC_AUTOCONF_VERSION_TEST ensures that exactly the desired
+dnl Autoconf version is used.  It should be kept for consistency.
 
 dnl m4_PACKAGE_VERSION is an undocumented Autoconf macro.
 dnl We use it because this fix is intended for 2.59 only.
@@ -22,8 +26,35 @@
 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],, [
+dnl We use $ac_pwd in some of the overrides below; ensure its definition
+m4_divert_push([PARSE_ARGS])dnl
+ac_pwd=`pwd`
+m4_divert_pop([PARSE_ARGS])dnl
+])
+
+m4_version_prereq([2.60],, [
+
 # _AC_OUTPUT_SUBDIRS
 # ------------------
 # This is a subroutine of AC_OUTPUT, but it does not go into
@@ -128,12 +159,13 @@
 ])# _AC_OUTPUT_SUBDIRS
 ])
 
-ifelse(m4_PACKAGE_VERSION, [2.62],, [
+m4_version_prereq([2.63],, [
 
 # _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.63.
 m4_define([_AC_ARG_VAR_VALIDATE],
 [# Check that the precious variables saved in the cache have kept the same
 # value.
@@ -184,8 +216,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.63],, [
+
+# 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]); }])
+])
+])


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]