changeset 211:b4e9b1f5a2c7

Bug 3514: Support GCC 4.4.7 for RHEL 6/7 Reviewed-by: yasuenag
author KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
date Mon, 05 Feb 2018 11:48:07 +0900
parents 4824a01e3000
children a0dbe8fd5369
files ChangeLog configure configure.ac
diffstat 3 files changed, 53 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 24 21:20:23 2017 +0900
+++ b/ChangeLog	Mon Feb 05 11:48:07 2018 +0900
@@ -1,3 +1,7 @@
+2017-02-05  KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
+
+	* Bug 3514: Support GCC 4.4.7 for RHEL 6/7
+
 2017-07-24  Yasumasa Suenaga <yasuenag@gmail.com>
 
 	* Bug 3429: [REGRESSION] Cannot build HeapStats Agent on RHEL
--- a/configure	Mon Jul 24 21:20:23 2017 +0900
+++ b/configure	Mon Feb 05 11:48:07 2018 +0900
@@ -6390,10 +6390,7 @@
 fi
 rm -f confcache
 
-# Check C++11 regex
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::regex" >&5
-$as_echo_n "checking for std::regex... " >&6; }
-
+# Check C++11 support
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6402,7 +6399,40 @@
 
 ORIG_CXXFLAGS=$CXXFLAGS
 CXXFLAGS+=" -std=c++11"
-
+CPP11=1
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking C++11 support" >&5
+$as_echo_n "checking C++11 support... " >&6; }
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+   CPP11=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test $CPP11 -eq 1; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: c++11" >&5
+$as_echo "c++11" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: c++0x" >&5
+$as_echo "c++0x" >&6; }
+  CXXFLAGS="$ORIG_CXXFLAGS -std=c++0x"
+fi
+
+# Check C++11 regex
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::regex" >&5
+$as_echo_n "checking for std::regex... " >&6; }
 
 
 if test "$cross_compiling" = yes; then :
@@ -6441,7 +6471,6 @@
 $as_echo "no" >&6; }
     $as_echo "#define USE_PCRE 1" >>confdefs.h
 
-    CXXFLAGS=$ORIG_CXXFLAGS
     for ac_header in pcre.h
 do :
   ac_fn_cxx_check_header_mongrel "$LINENO" "pcre.h" "ac_cv_header_pcre_h" "$ac_includes_default"
--- a/configure.ac	Mon Jul 24 21:20:23 2017 +0900
+++ b/configure.ac	Mon Feb 05 11:48:07 2018 +0900
@@ -74,12 +74,23 @@
 AC_CHECK_HEADERS([sys/auxv.h], [], [])  # Supplemental headers
 AC_CACHE_SAVE
 
-# Check C++11 regex
-AC_MSG_CHECKING([for std::regex])
-
+# Check C++11 support
 AC_LANG_PUSH([C++])
 ORIG_CXXFLAGS=$CXXFLAGS
 CXXFLAGS+=" -std=c++11"
+CPP11=1
+
+AC_MSG_CHECKING([C++11 support])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [], [ CPP11=0 ])
+if test $CPP11 -eq 1; then
+  AC_MSG_RESULT([c++11])
+else
+  AC_MSG_RESULT([c++0x])
+  CXXFLAGS="$ORIG_CXXFLAGS -std=c++0x"
+fi
+
+# Check C++11 regex
+AC_MSG_CHECKING([for std::regex])
 
 AC_RUN_IFELSE(
   [AC_LANG_PROGRAM(
@@ -95,7 +106,6 @@
   ], [
     AC_MSG_RESULT([no])
     AC_DEFINE(USE_PCRE,1)
-    CXXFLAGS=$ORIG_CXXFLAGS
     AC_CHECK_HEADERS([pcre.h], [], [AC_MSG_ERROR([PCRE not found.])])
     AC_CHECK_LIB([pcre], [main], [], [AC_MSG_ERROR([PCRE not found.])])
   ]