From 1b3b24c2a6de2f8b4a0ce687e8f62d3eb1ee2b53 Mon Sep 17 00:00:00 2001
From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Date: Thu, 30 Jul 2009 19:41:13 +0000
Subject: [PATCH] extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Do not expand for
 Autoconf 2.62 or newer.

config/
	* 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/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libada/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libffi/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libgfortran/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libgomp/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libjava/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libmudflap/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libobjc/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libssp/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

zlib/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libstdc++-v3/
	* acinclude.m4 (GLIBCXX_CONFIGURE): Use m4_rename_force.

From-SVN: r150269
---
 boehm-gc/ChangeLog        |  4 ++++
 boehm-gc/configure.ac     |  2 +-
 config/ChangeLog          | 10 ++++++++++
 config/extensions.m4      |  7 +++++--
 config/no-executables.m4  |  4 ++--
 config/override.m4        | 12 +++++++++++-
 config/tls.m4             |  4 ++--
 libada/ChangeLog          |  4 ++++
 libada/configure.ac       |  2 +-
 libffi/ChangeLog          |  4 ++++
 libffi/configure.ac       |  2 +-
 libgfortran/ChangeLog     |  4 ++++
 libgfortran/configure.ac  |  2 +-
 libgomp/ChangeLog         |  4 ++++
 libgomp/configure.ac      |  2 +-
 libjava/ChangeLog         |  4 ++++
 libjava/configure.ac      |  2 +-
 libmudflap/ChangeLog      |  4 ++++
 libmudflap/configure.ac   |  2 +-
 libobjc/ChangeLog         |  4 ++++
 libobjc/configure.ac      |  2 +-
 libssp/ChangeLog          |  4 ++++
 libssp/configure.ac       |  2 +-
 libstdc++-v3/ChangeLog    |  4 ++++
 libstdc++-v3/acinclude.m4 |  2 +-
 zlib/ChangeLog.gcj        |  4 ++++
 zlib/configure.ac         |  2 +-
 27 files changed, 85 insertions(+), 18 deletions(-)

diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index fa53669ca2a9..0e37031371ea 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-07-17  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
 	PR boehm-gc/40785
diff --git a/boehm-gc/configure.ac b/boehm-gc/configure.ac
index 2206f76eaa2a..52ab0b5fa47b 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/ChangeLog b/config/ChangeLog
index 6bd7bbf54164..51d62d787b34 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,13 @@
+2009-07-30  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.
+
 2009-07-17  Joseph Myers  <joseph@codesourcery.com>
 
 	PR other/40784
diff --git a/config/extensions.m4 b/config/extensions.m4
index 8ae4a675e2bf..eb59f272119d 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/no-executables.m4 b/config/no-executables.m4
index c4d0b70c3755..90616245ef92 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/config/override.m4 b/config/override.m4
index 9bb149620c4b..bf112db99a89 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/config/tls.m4 b/config/tls.m4
index 099bdc257a8e..ef7e6d0b555b 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/libada/ChangeLog b/libada/ChangeLog
index fc48aa148ddb..2be7dff176f2 100644
--- a/libada/ChangeLog
+++ b/libada/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-07-13  Eric Botcazou  <ebotcazou@adacore.com>
 
 	* configure.ac: Include multi.m4 and do not call AC_CANONICAL_SYSTEM.
diff --git a/libada/configure.ac b/libada/configure.ac
index 12de5479e005..ef9e6132c43e 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/ChangeLog b/libffi/ChangeLog
index 9af1e445e727..2fc3b1a74870 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-07-24  Dave Korn  <dave.korn.cygwin@gmail.com>
 
 	PR libffi/40807
diff --git a/libffi/configure.ac b/libffi/configure.ac
index 2ab5902746e4..ab693bb5c36d 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/ChangeLog b/libgfortran/ChangeLog
index aec14276fbeb..433be33f1a83 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-07-27  Tobias Burnus  <burnus@net-b.de>
 
 	PR fortran/40863
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index b1e5d1e2c358..1fadd2e5091d 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/ChangeLog b/libgomp/ChangeLog
index 5ef1785e2139..e10c45589a4e 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-07-16  Joseph Myers  <joseph@codesourcery.com>
 
 	* configure: Regenerate.
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index db8e2811a304..9a026a20f876 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/ChangeLog b/libjava/ChangeLog
index 02fc607e328d..a4784e51ffbb 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-07-28  David Daney  <ddaney@caviumnetworks.com>
 
 	* gnu/gcj/util/natGCInfo.cc (nomem_handler): Use oomDumpName as
diff --git a/libjava/configure.ac b/libjava/configure.ac
index 3074a0c0fd48..1ab5bec75d61 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/ChangeLog b/libmudflap/ChangeLog
index edb0958cd40c..2312b20fc42d 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-07-16  Joseph Myers  <joseph@codesourcery.com>
 
 	* configure: Regenerate.
diff --git a/libmudflap/configure.ac b/libmudflap/configure.ac
index 8ce99a10270d..c7d69d549c37 100644
--- a/libmudflap/configure.ac
+++ b/libmudflap/configure.ac
@@ -39,7 +39,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/ChangeLog b/libobjc/ChangeLog
index 88f8b8d64af4..fa6022b2b32a 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-04-09  Nick Clifton  <nickc@redhat.com>
 
 	* sendmsg.c: Change copyright header to refer to version 3 of
diff --git a/libobjc/configure.ac b/libobjc/configure.ac
index dd7751eb3cc2..036e34c96073 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/ChangeLog b/libssp/ChangeLog
index d8d3c7410c0b..89d23ae6bf32 100644
--- a/libssp/ChangeLog
+++ b/libssp/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-04-13  Ozkan Sezer  <sezeroz@gmail.com>
 
 	PR target/39062
diff --git a/libssp/configure.ac b/libssp/configure.ac
index f3a66ec975a4..ff6f2de97996 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/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 395160108dfa..dc78dbd9611e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* acinclude.m4 (GLIBCXX_CONFIGURE): Use m4_rename_force.
+
 2009-07-30  Paolo Carlini  <paolo.carlini@oracle.com>
 
 	PR libstdc++/40915
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index d7895f5ec7f3..b0b6241de5ff 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -104,7 +104,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
   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)
 
diff --git a/zlib/ChangeLog.gcj b/zlib/ChangeLog.gcj
index eee68cdf60b9..2570352b14b3 100644
--- a/zlib/ChangeLog.gcj
+++ b/zlib/ChangeLog.gcj
@@ -1,3 +1,7 @@
+2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
+
 2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	* configure: Regenerate.
diff --git a/zlib/configure.ac b/zlib/configure.ac
index c85f4d50c813..febe9e39b764 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)
 
-- 
GitLab