comparison configure @ 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
622 622
623 ac_subst_vars='LTLIBOBJS 623 ac_subst_vars='LTLIBOBJS
624 LIBOBJS 624 LIBOBJS
625 QMAKE_CONFIG 625 QMAKE_CONFIG
626 HAVES 626 HAVES
627 CXXSTANDARD
627 CXXFLAGS_MINIMAL 628 CXXFLAGS_MINIMAL
628 CUT 629 CUT
629 SHA1SUM 630 SHA1SUM
630 MAKEDEPEND 631 MAKEDEPEND
631 XARGS 632 XARGS
4420 # allow ourselves to be overridden (later) by the former 4421 # allow ourselves to be overridden (later) by the former
4421 4422
4422 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS" 4423 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
4423 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS" 4424 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
4424 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS" 4425 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS"
4426 CXXSTANDARD=c++14
4425 4427
4426 if test "x$GCC" = "xyes"; then 4428 if test "x$GCC" = "xyes"; then
4427 CXXFLAGS_ANY="-fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe" 4429 CXXFLAGS_ANY="-fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe"
4428 CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -O2 -Werror" 4430 CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -O2 -Werror"
4429 CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O3 -ffast-math" 4431 CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O3 -ffast-math"
4430 CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0" 4432 CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0"
4431 LIBS_DEBUG="$LIBS -lubsan" 4433 LIBS_DEBUG="$LIBS"
4434 as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__--std=$CXXSTANDARD" | $as_tr_sh`
4435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts --std=$CXXSTANDARD" >&5
4436 $as_echo_n "checking whether C++ compiler accepts --std=$CXXSTANDARD... " >&6; }
4437 if eval \${$as_CACHEVAR+:} false; then :
4438 $as_echo_n "(cached) " >&6
4439 else
4440
4441 ax_check_save_flags=$CXXFLAGS
4442 CXXFLAGS="$CXXFLAGS --std=$CXXSTANDARD"
4443 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4444 /* end confdefs.h. */
4445
4446 int
4447 main ()
4448 {
4449
4450 ;
4451 return 0;
4452 }
4453 _ACEOF
4454 if ac_fn_cxx_try_compile "$LINENO"; then :
4455 eval "$as_CACHEVAR=yes"
4456 else
4457 eval "$as_CACHEVAR=no"
4458 fi
4459 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4460 CXXFLAGS=$ax_check_save_flags
4461 fi
4462 eval ac_res=\$$as_CACHEVAR
4463 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
4464 $as_echo "$ac_res" >&6; }
4465 if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
4466 :
4467 else
4468 { $as_echo "$as_me:${as_lineno-$LINENO}: Compiler does not appear to support $CXXSTANDARD, falling back to c++11" >&5
4469 $as_echo "$as_me: Compiler does not appear to support $CXXSTANDARD, falling back to c++11" >&6;}
4470 CXXSTANDARD=c++11
4471 fi
4472
4432 fi 4473 fi
4433 4474
4434 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE" 4475 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
4435 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE" 4476 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE"
4436 4477
7329 fi 7370 fi
7330 7371
7331 fi 7372 fi
7332 fi 7373 fi
7333 fi 7374 fi
7375
7334 7376
7335 7377
7336 7378
7337 7379
7338 7380