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]

Autoconf macros fixes


Hello gcc-patches and binutils,

in order to get going on the Autoconf/Automake update, there are some
cleanups to do in the current sources.  The patches below contain
changes to autoconf macros that are inconsequential for the 2.59/1.9.6
combo (i.e., cause no changes to the generated files at all), but avoid
warnings, errors or subtle bugs with the new tools.

The changes in brief are:

- use Autoconf's AC_USE_SYSTEM_EXTENSIONS with 2.62 or newer.  This is
because GCC's copy of the macro matches that from Autoconf 2.62, but
2.64 has changed semantics that interact with other macros.

- fix underquotation in tls.m4, no-executables.m4,

- fix underquotation in readline/examples/rlfe/configure.in.  This patch
is for src only, obviously.

- Provide and use m4_copy_force, m4_rename_force.  This is because
m4_copy and m4_rename were undocumented in Autoconf 2.59, are documented
in 2.64, but have slightly different semantics: they ensure they don't
overwrite an existing macro.  Since 2.64 also provides *_force variants
of these macros, we just use them instead, and provide replacements for
them for 2.59 now.

OK to push to GCC and src?

I've tested this patch by building both trees with it, maintainer mode
enabled.  There were changes to generated files but only because some
earlier, unrelated patches harmlessly forgot to regenerate all files.
I'd like to keep that separate.

Thank you,
Ralf

config/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Do not expand
	for Autoconf 2.62 or newer.
	* tls.m4 (GCC_CHECK_TLS): Fix m4 quotation.
	* no-executables.m4 (_AC_COMPILER_EXEEXT): Fix m4 quotation.
	* override.m4 (m4_copy_force, m4_rename_force): Provide
	macros if not defined.
	(AC_PREREQ): Use m4_copy_force.

boehm-gc/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libada/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libffi/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libgfortran/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libgomp/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libjava/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libmudflap/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libobjc/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libssp/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

zlib/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

readline/examples/rlfe/ChangeLog:
2009-07-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.in: Correctly quote AC_PROGRAM_SOURCE definition.

diff --git a/config/extensions.m4 b/config/extensions.m4
index 8ae4a67..eb59f27 100644
--- a/config/extensions.m4
+++ b/config/extensions.m4
@@ -1,7 +1,7 @@
-# serial 5  -*- Autoconf -*-
+# serial 6  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -12,6 +12,8 @@
 # enough in this area it's likely we'll need to redefine
 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
 
+m4_version_prereq([2.62],, [
+
 # AC_USE_SYSTEM_EXTENSIONS
 # ------------------------
 # Enable extensions on systems that normally disable them,
@@ -74,3 +76,4 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   AC_DEFINE([_TANDEM_SOURCE])
 ])# AC_USE_SYSTEM_EXTENSIONS
 
+])
diff --git a/config/tls.m4 b/config/tls.m4
index 099bdc2..ef7e6d0 100644
--- a/config/tls.m4
+++ b/config/tls.m4
@@ -11,8 +11,8 @@ AC_DEFUN([GCC_CHECK_TLS], [
       chktls_save_LDFLAGS="$LDFLAGS"
       LDFLAGS="-static $LDFLAGS"
       AC_LINK_IFELSE([int main() { return 0; }],
-	AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
-		      [gcc_cv_have_tls=yes], [gcc_cv_have_tls=no],[]),
+	[AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
+		       [gcc_cv_have_tls=yes], [gcc_cv_have_tls=no],[])],
 	[gcc_cv_have_tls=yes])
       LDFLAGS="$chktls_save_LDFLAGS"
       if test $gcc_cv_have_tls = yes; then
diff --git a/config/no-executables.m4 b/config/no-executables.m4
index c4d0b70..9061624 100644
--- a/config/no-executables.m4
+++ b/config/no-executables.m4
@@ -25,7 +25,7 @@ AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
 AC_BEFORE([$0], [AC_LINK_IFELSE])
 
 m4_define([_AC_COMPILER_EXEEXT],
-AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
+[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
 # FIXME: Cleanup?
 AS_IF([AC_TRY_EVAL(ac_link)], [gcc_no_link=no], [gcc_no_link=yes])
 if test x$gcc_no_link = xyes; then
@@ -35,7 +35,7 @@ if test x$gcc_no_link = xyes; then
   cross_compiling=yes
   EXEEXT=
 else
-  m4_defn([_AC_COMPILER_EXEEXT])dnl
+  ]m4_defn([_AC_COMPILER_EXEEXT])dnl
 fi
 )
 
diff --git a/boehm-gc/configure.ac b/boehm-gc/configure.ac
index 2206f76..52ab0b5 100644
--- a/boehm-gc/configure.ac
+++ b/boehm-gc/configure.ac
@@ -49,7 +49,7 @@ m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
 AC_PROG_CXX
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 AM_PROG_CC_C_O
 
diff --git a/config/override.m4 b/config/override.m4
index 9bb1496..bf112db 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -12,6 +12,16 @@ dnl
 dnl The _GCC_AUTOCONF_VERSION_TEST ensures that exactly the desired
 dnl Autoconf version is used.  It should be kept for consistency.
 
+dnl Provide m4_copy_force and m4_rename_force for old Autoconf versions.
+
+m4_ifndef([m4_copy_force],
+[m4_define([m4_copy_force],
+[m4_ifdef([$2], [m4_undefine([$2])])m4_copy($@)])])
+
+m4_ifndef([m4_rename_force],
+[m4_define([m4_rename_force],
+[m4_ifdef([$2], [m4_undefine([$2])])m4_rename($@)])])
+
 dnl m4_PACKAGE_VERSION is an undocumented Autoconf macro.
 dnl We use it because this fix is intended for 2.59 only.
 dnl A feature test for the broken AC_CONFIG_SUBDIRS instead
@@ -25,7 +35,7 @@ ifdef([m4_PACKAGE_VERSION],
 [dnl AC_DEFUN a commonly used macro so this file is picked up.
 m4_copy([AC_PREREQ], [_AC_PREREQ])
 AC_DEFUN([AC_PREREQ], [frob])
-m4_copy([_AC_PREREQ], [AC_PREREQ])
+m4_copy_force([_AC_PREREQ], [AC_PREREQ])
 
 
 dnl Ensure exactly this Autoconf version is used
diff --git a/libada/configure.ac b/libada/configure.ac
index 12de547..ef9e613 100644
--- a/libada/configure.ac
+++ b/libada/configure.ac
@@ -92,7 +92,7 @@ AC_SUBST(toolexeclibdir)
 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 AC_SUBST(CFLAGS)
 
diff --git a/libffi/configure.ac b/libffi/configure.ac
index 2ab5902..ab693bb 100644
--- a/libffi/configure.ac
+++ b/libffi/configure.ac
@@ -22,7 +22,7 @@ AM_INIT_AUTOMAKE
 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 AC_SUBST(CFLAGS)
 
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 50cc0c5..c68d13c 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -119,7 +119,7 @@ AC_SUBST(toolexeclibdir)
 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
 if test "x$GCC" = "xyes"; then
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index db8e281..9a026a2 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -103,7 +103,7 @@ AC_SUBST(toolexeclibdir)
 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 AC_SUBST(CFLAGS)
 
diff --git a/libjava/configure.ac b/libjava/configure.ac
index e4fe13f..1593208 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -159,7 +159,7 @@ CXXFLAGS="$CXXFLAGS -fno-builtin"
 AC_PROG_CC
 AC_PROG_CXX
 CXXFLAGS="$save_CXXFLAGS"
-m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
 AC_SUBST(LDFLAGS)
diff --git a/libmudflap/configure.ac b/libmudflap/configure.ac
index e60dcf4..064abea 100644
--- a/libmudflap/configure.ac
+++ b/libmudflap/configure.ac
@@ -41,7 +41,7 @@ AC_LANG_C
 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 AC_SUBST(CFLAGS)
 
diff --git a/libobjc/configure.ac b/libobjc/configure.ac
index dd7751e..036e34c 100644
--- a/libobjc/configure.ac
+++ b/libobjc/configure.ac
@@ -153,7 +153,7 @@ GCC_NO_EXECUTABLES
 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 # extra LD Flags which are required for targets
 case "${host}" in
diff --git a/libssp/configure.ac b/libssp/configure.ac
index f3a66ec..ff6f2de 100644
--- a/libssp/configure.ac
+++ b/libssp/configure.ac
@@ -41,7 +41,7 @@ AC_LANG_C
 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 AC_SUBST(CFLAGS)
 
diff --git a/zlib/configure.ac b/zlib/configure.ac
index c85f4d5..febe9e3 100644
--- a/zlib/configure.ac
+++ b/zlib/configure.ac
@@ -54,7 +54,7 @@ GCC_NO_EXECUTABLES
 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 AC_SUBST(CFLAGS)
 


diff --git a/readline/examples/rlfe/configure.in b/readline/examples/rlfe/configure.in
index ad68541..a3d35e8 100644
--- a/readline/examples/rlfe/configure.in
+++ b/readline/examples/rlfe/configure.in
@@ -8,7 +8,7 @@ AC_SUBST(VERSION)
 dnl
 dnl Define some useful macros
 dnl
-AC_DEFUN(AC_PROGRAM_SOURCE,
+AC_DEFUN([AC_PROGRAM_SOURCE],
 [AC_REQUIRE([AC_PROG_CPP])AC_PROVIDE([$0])cat > conftest.c <<EOF
 #include "confdefs.h"
 [$1]


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