From 1e979a3c60f7e79ee8aa3aef8f9d4bb354b17bc1 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 3 Apr 2013 00:41:02 +0000 Subject: * config/open-axiom.m4 (OPENAXIOM_REQUIRE_CXX11): New. * configure.ac: Use it. --- config/open-axiom.m4 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/open-axiom.m4 b/config/open-axiom.m4 index 90f3e8cd..842e3682 100644 --- a/config/open-axiom.m4 +++ b/config/open-axiom.m4 @@ -216,6 +216,19 @@ case $host in esac ]) +dnl ----------------------------- +dnl -- OPENAXIOM_REQUIRE_CXX11 -- +dnl ----------------------------- +AC_DEFUN([OPENAXIOM_REQUIRE_CXX11],[ +oa_saved_cxxflags=$CXXFLAGS +CXXFLAGS="-std=c++11" +AC_MSG_CHECKING([whether $CXX supports $CXXFLAGS]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [CXXFLAGS="$CXXFLAGS $oa_saved_cxxflags"], + [AC_MSG_ERROR([OpenAxiom requires a C++11 compiler])]) +]) + dnl ------------------------------ dnl -- OPENAXIOM_HOST_COMPILERS -- dnl ------------------------------ @@ -229,7 +242,7 @@ OPENAXIOM_CHECK_DELAYED_FFI ## Are we using compilers from GNU? oa_gnu_compiler=no AC_PROG_CC -AC_PROG_CXX +AC_PROG_CXX([g++ clang++ icpc icc CC xlC c++]) if test x$GCC = xyes || test x$GXX = xyes; then oa_gnu_compiler=yes fi -- cgit v1.2.3