changeset 26714:9a302a68d48c

build: force a c++ standard to be specified Newer compilers may switch to newer standards by default. For example, gcc6 uses std=gnu++14 by default.
author Cory Fields <cory-nospam-@coryfields.com>
date Wed, 22 Feb 2017 13:33:22 -0500
parents 299bb45fc7ea
children a78df86993b9
files build-aux/m4/ax_cxx_compile_stdcxx.m4 configure.ac
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/build-aux/m4/ax_cxx_compile_stdcxx.m4	Tue Feb 21 17:08:25 2017 +0100
+++ b/build-aux/m4/ax_cxx_compile_stdcxx.m4	Wed Feb 22 13:33:22 2017 -0500
@@ -57,8 +57,14 @@
         [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
         [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
         [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
+  m4_if([$4], [], [ax_cxx_compile_cxx$1_try_default=true],
+        [$4], [default], [ax_cxx_compile_cxx$1_try_default=true],
+        [$4], [nodefault], [ax_cxx_compile_cxx$1_try_default=false],
+        [m4_fatal([invalid fourth argument `$4' to AX_CXX_COMPILE_STDCXX])])
   AC_LANG_PUSH([C++])dnl
   ac_success=no
+
+  m4_if([$4], [nodefault], [], [dnl
   AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
   ax_cv_cxx_compile_cxx$1,
   [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
@@ -66,7 +72,7 @@
     [ax_cv_cxx_compile_cxx$1=no])])
   if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
     ac_success=yes
-  fi
+  fi])
 
   m4_if([$2], [noext], [], [dnl
   if test x$ac_success = xno; then
--- a/configure.ac	Tue Feb 21 17:08:25 2017 +0100
+++ b/configure.ac	Wed Feb 22 13:33:22 2017 -0500
@@ -55,7 +55,7 @@
   ;;
 esac
 dnl Require C++11 compiler (no GNU extensions)
-AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
+AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault])
 dnl Check if -latomic is required for <std::atomic>
 CHECK_ATOMIC