comparison configure.ac @ 1976:810a0b8f5472 c++14

Requiring c++14 is not going to work for Travis (because we want to support a Qt version too old to know about the c++14 config flag) or for our AppImage build (because we want to run on distros to old to support the relevant gcc ABI). So instead we try to confine the C++ standard selection to one place (config/noconfig) and revert to c++11 if the compiler is too old to know about c++14. All of the actual SV code remains c++11, and we assume we build against an older version of capnproto when we want to perform a c++11 build.
author Chris Cannam
date Fri, 31 Aug 2018 13:41:27 +0100
parents 714f8dad57bc
children 5ffcb4e10e1b
comparison
equal deleted inserted replaced
1975:18fb91db5311 1976:810a0b8f5472
49 # allow ourselves to be overridden (later) by the former 49 # allow ourselves to be overridden (later) by the former
50 50
51 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS" 51 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
52 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS" 52 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
53 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS" 53 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS"
54 CXXSTANDARD=c++14
54 55
55 if test "x$GCC" = "xyes"; then 56 if test "x$GCC" = "xyes"; then
56 CXXFLAGS_ANY="-fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe" 57 CXXFLAGS_ANY="-fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe"
57 CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -O2 -Werror" 58 CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -O2 -Werror"
58 CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O3 -ffast-math" 59 CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O3 -ffast-math"
59 CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0" 60 CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0"
60 LIBS_DEBUG="$LIBS -lubsan" 61 LIBS_DEBUG="$LIBS"
62 AX_CHECK_COMPILE_FLAG(--std=$CXXSTANDARD, [], [AC_MSG_NOTICE([Compiler does not appear to support $CXXSTANDARD, falling back to c++11])
63 CXXSTANDARD=c++11])
61 fi 64 fi
62 65
63 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE" 66 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
64 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE" 67 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE"
65 68
126 AC_SUBST(CUT) 129 AC_SUBST(CUT)
127 130
128 AC_SUBST(CFLAGS) 131 AC_SUBST(CFLAGS)
129 AC_SUBST(CXXFLAGS) 132 AC_SUBST(CXXFLAGS)
130 AC_SUBST(CXXFLAGS_MINIMAL) 133 AC_SUBST(CXXFLAGS_MINIMAL)
134 AC_SUBST(CXXSTANDARD)
131 AC_SUBST(LDFLAGS) 135 AC_SUBST(LDFLAGS)
132 AC_SUBST(HAVES) 136 AC_SUBST(HAVES)
133 AC_SUBST(LIBS) 137 AC_SUBST(LIBS)
134 138
135 AC_SUBST(CC) 139 AC_SUBST(CC)