summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-12-21 08:45:41 -0800
committerPatrick Ohly <patrick.ohly@intel.com>2018-01-03 10:39:50 +0100
commit52a34570373fc3d03e69456c2d4f460265bf9a22 (patch)
treeecc4da3dcece463acd5fbc1e36f1210f53020def
parent7e4bdb5b07098ab81f2d013ef276c58480e8eb77 (diff)
C++: try to use C++14, rely on C++11
This makes it possible to use C++11 features. Choosing C++14 when available gives us advance warning when something might break under C++14. Test builds on a system with only C++11 and another with C++14 are needed to ensure that both really works. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--configure.ac8
1 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 30d08dd5..4b4da576 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,14 @@ dnl check for programs.
AC_PROG_CXX
AC_PROG_MAKE_SET
+dnl Use the most recent C++ standard that is supported by the code.
+dnl We can fall back to older versions, but not below C++11.
+dnl Akonadi/Qt don't work with C++17 yet, so we can't enable that.
+AX_CXX_COMPILE_STDCXX_14(noext, optional)
+if test "$HAVE_CXX14" -ne 1; then
+ AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
+fi
+
# Boost headers: boost/foreach.hpp is needed (1.33/Debian Etch
# doesn't have it, 1.34/Ubuntu 8.10 Hardy does). 1.35 is available
# as Debian Etch backport.