diff configure.ac @ 1978:d3bd593a610c

Merge from branch c++14
author Chris Cannam
date Fri, 31 Aug 2018 15:14:27 +0100
parents 810a0b8f5472
children 5ffcb4e10e1b
line wrap: on
line diff
--- a/configure.ac	Tue Aug 14 09:43:28 2018 +0100
+++ b/configure.ac	Fri Aug 31 15:14:27 2018 +0100
@@ -51,13 +51,16 @@
 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS"
+CXXSTANDARD=c++14
 
 if test "x$GCC" = "xyes"; then
-   	CXXFLAGS_ANY="-std=c++11 -fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe"
+   	CXXFLAGS_ANY="-fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe"
         CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -O2 -Werror"
    	CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O3 -ffast-math"
    	CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0"
-        LIBS_DEBUG="$LIBS -lubsan"
+        LIBS_DEBUG="$LIBS"
+        AX_CHECK_COMPILE_FLAG(--std=$CXXSTANDARD, [], [AC_MSG_NOTICE([Compiler does not appear to support $CXXSTANDARD, falling back to c++11])
+        CXXSTANDARD=c++11])
 fi
 
 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
@@ -128,6 +131,7 @@
 AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
 AC_SUBST(CXXFLAGS_MINIMAL)
+AC_SUBST(CXXSTANDARD)
 AC_SUBST(LDFLAGS)
 AC_SUBST(HAVES)
 AC_SUBST(LIBS)