From: Pietro Monteiro <[email protected]>
Fix for https://savannah.gnu.org/support/?111400
>From upstream commit f81112068475c15d9acd42c7a3716b98134d6e14
Include config/override.m4 on configure.ac of directories that didn't
inlcude it before so they get the fix and also can't be regenerated
with the wrong version of autoconf.
c++tools/ChangeLog:
* configure: Regenerate.
* configure.ac: Include config/override.m4.
config/ChangeLog:
* override.m4: Add _AC_PROG_CC_STDC_EDITION_TRY from upstream patch.
ChangeLog:
* configure: Regenerate.
* libgo/configure: Regenerate.
fixincludes/ChangeLog:
* configure: Regenerate.
gcc/ChangeLog:
* configure: Regenerate.
gcc/m2/ChangeLog:
* configure: Regenerate.
* configure.ac: Include config/override.m4.
gnattools/ChangeLog:
* configure: Regenerate.
gotools/ChangeLog:
* configure: Regenerate.
libada/ChangeLog:
* configure: Regenerate.
libatomic/ChangeLog:
* configure: Regenerate.
libbacktrace/ChangeLog:
* configure: Regenerate.
libcc1/ChangeLog:
* configure: Regenerate.
libcody/ChangeLog:
* configure: Regenerate.
* configure.ac: Include config/override.m4.
libcpp/ChangeLog:
* configure: Regenerate.
libdecnumber/ChangeLog:
* configure: Regenerate.
* configure.ac: Include config/override.m4.
libffi/ChangeLog:
* configure: Regenerate.
libga68/ChangeLog:
* configure: Regenerate.
libgcc/ChangeLog:
* configure: Regenerate.
libgcobol/ChangeLog:
* configure: Regenerate.
libgfortran/ChangeLog:
* configure: Regenerate.
libgm2/ChangeLog:
* configure: Regenerate.
libgomp/ChangeLog:
* configure: Regenerate.
libgrust/ChangeLog:
* configure: Regenerate.
libiberty/ChangeLog:
* configure: Regenerate.
libitm/ChangeLog:
* configure: Regenerate.
libobjc/ChangeLog:
* configure: Regenerate.
libphobos/ChangeLog:
* configure: Regenerate.
libquadmath/ChangeLog:
* configure: Regenerate.
libsanitizer/ChangeLog:
* configure: Regenerate.
libssp/ChangeLog:
* configure: Regenerate.
libstdc++-v3/ChangeLog:
* configure: Regenerate.
libvtv/ChangeLog:
* configure: Regenerate.
lto-plugin/ChangeLog:
* configure: Regenerate.
zlib/ChangeLog:
* configure: Regenerate.
Signed-off-by: Pietro Monteiro <[email protected]>
---
c++tools/configure.ac | 4 ++--
config/override.m4 | 35 +++++++++++++++++++++++++++++++++++
gcc/m2/configure.ac | 1 +
libcody/configure.ac | 1 +
libdecnumber/configure.ac | 1 +
5 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/c++tools/configure.ac b/c++tools/configure.ac
index 84060f97695f6..20525805a4a01 100644
--- a/c++tools/configure.ac
+++ b/c++tools/configure.ac
@@ -21,8 +21,8 @@
# shows how the protocol introduced by wg21.link/p1184 may be used.
# By default g++ uses an in-process mapper.
-sinclude(../config/acx.m4)
-
+m4_include([../config/override.m4])
+m4_include([../config/acx.m4])
AC_INIT(c++tools)
AC_CONFIG_SRCDIR([server.cc])
diff --git a/config/override.m4 b/config/override.m4
index 021bb7ff632c8..f53b5d5dc1482 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -53,6 +53,41 @@ m4_if(m4_index([..wi.d.], [.d.]), [-1],
[m4_fatal(m4_do([m4 with buggy strstr detected. Please install
GNU M4 1.4.16 or newer and set the M4 environment variable]))])
+dnl Patch for https://savannah.gnu.org/support/?111400
+dnl From upstream commit f81112068475c15d9acd42c7a3716b98134d6e14
+m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.73], [
+# _AC_PROG_CC_STDC_EDITION_TRY(EDITION)
+# -------------------------------------
+# Subroutine of _AC_PROG_CC_STDC_EDITION. Not to be called directly.
+#
+m4_define([_AC_PROG_CC_STDC_EDITION_TRY],
+[AC_LANG_ASSERT([C])]dnl
+[AC_REQUIRE([_AC_C_C$1_TEST_PROGRAM])]dnl
+[AS_IF([test x$ac_prog_cc_stdc = xno],
+[AC_MSG_CHECKING([for $CC option to enable C$1 features])
+AC_CACHE_VAL([ac_cv_prog_cc_c$1],
+[ac_cv_prog_cc_c$1=no
+ac_save_CC=$CC
+AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][ac_c_conftest_c$1_program])
+for ac_arg in '' m4_normalize(m4_defn([_AC_C_C$1_OPTIONS]))
+do
+ CC="$ac_save_CC $ac_arg"
+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_c$1=$ac_arg])
+ test "x$ac_cv_prog_cc_c$1" != "xno" && break
+ AS_CASE([" $ac_save_CC $CFLAGS"], [[*[[:space:]]-std[:=]*]], [break])
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC])
+AS_IF([test "x$ac_cv_prog_cc_c$1" = xno],
+ [AC_MSG_RESULT([unsupported])],
+ [AS_IF([test "x$ac_cv_prog_cc_c$1" = x],
+ [AC_MSG_RESULT([none needed])],
+ [AC_MSG_RESULT([$ac_cv_prog_cc_c$1])
+ CC="$CC $ac_cv_prog_cc_c$1"])
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c$1
+ ac_prog_cc_stdc=c$1])])
+]) # _AC_PROG_CC_STDC_EDITION_TRY
+])
dnl Fix 2.64 cross compile detection for AVR and RTEMS
dnl by not trying to compile fopen.
diff --git a/gcc/m2/configure.ac b/gcc/m2/configure.ac
index 5ff0335f000a9..02e1df09c468e 100644
--- a/gcc/m2/configure.ac
+++ b/gcc/m2/configure.ac
@@ -17,6 +17,7 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
+m4_include([../../config/override.m4])
AC_INIT(m2, [ ])
# Determine the host, build, and target systems
diff --git a/libcody/configure.ac b/libcody/configure.ac
index 14e8dd4a22607..3c3b940766f1a 100644
--- a/libcody/configure.ac
+++ b/libcody/configure.ac
@@ -2,6 +2,7 @@
# Copyright (C) 2020 Nathan Sidwell, [email protected]
# License: Apache v2.0
+m4_include([../config/override.m4])
AC_INIT([codylib],[0.0],[github.com/urnathan/libcody])
AC_CONFIG_SRCDIR(cody.hh)
m4_include(config.m4)
diff --git a/libdecnumber/configure.ac b/libdecnumber/configure.ac
index 7ebd4d23621df..e71c9a9746d34 100644
--- a/libdecnumber/configure.ac
+++ b/libdecnumber/configure.ac
@@ -19,6 +19,7 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
+m4_include([../config/override.m4])
AC_INIT(libdecnumber, [ ], https://gcc.gnu.org/bugs/, libdecnumber)
AC_CONFIG_SRCDIR(decNumber.h)
AC_CONFIG_MACRO_DIR(../config)
--
2.56.0