aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Examples/test-suite/common.mk5
-rw-r--r--Makefile.in3
-rw-r--r--configure.ac29
3 files changed, 25 insertions, 12 deletions
diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk
index be6b4736a..caa583471 100644
--- a/Examples/test-suite/common.mk
+++ b/Examples/test-suite/common.mk
@@ -94,10 +94,8 @@ CPP_TEST_BROKEN += \
C_TEST_BROKEN += \
tag_no_clash_with_variable
-
# C++ test cases. (Can be run individually using: make testcase.cpptest)
CPP_TEST_CASES += \
- $(CPP11_TEST_CASES) \
abstract_access \
abstract_inherit \
abstract_inherit_ok \
@@ -541,6 +539,9 @@ ifndef SKIP_CPP_STD_CASES
CPP_TEST_CASES += ${CPP_STD_TEST_CASES}
endif
+ifneq (,$(HAVE_CXX11_COMPILER))
+CPP_TEST_CASES += $(CPP11_TEST_CASES)
+endif
# C test cases. (Can be run individually using: make testcase.ctest)
C_TEST_CASES += \
diff --git a/Makefile.in b/Makefile.in
index c6259916b..377086231 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -22,6 +22,7 @@ TARGET = $(TARGET_NOEXE)@EXEEXT@
SOURCE = Source
CCACHE = CCache
DOCS = Doc/Manual
+HAVE_CXX11_COMPILER = @HAVE_CXX11_COMPILER@
swig: libfiles source ccache
@@ -240,7 +241,7 @@ check-%-test-suite:
echo warning: cannot $(ACTION) $* test-suite "(no dir $$dir)";\
else \
echo $(ACTION)ing $* test-suite; \
- (cd $$dir && $(MAKE) -k -s $(ACTION)) \
+ (cd $$dir && $(MAKE) -k -s $(ACTION) HAVE_CXX11_COMPILER=$(HAVE_CXX11_COMPILER)) \
|| passed=false; \
fi; \
test $$passed = true
diff --git a/configure.ac b/configure.ac
index 7015fb468..fa985bfd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -330,15 +330,26 @@ esac
AC_MSG_RESULT($PLATCFLAGS)
# Add switch if necessary to enable C++11 support - just for tests
-AC_LANG_PUSH([C++])
-CXXFLAGS_SAVED=$CXXFLAGS
-AX_CXX_COMPILE_STDCXX_11([noext], [nostop])
-CXXFLAGS=$CXXFLAGS_SAVED
-AC_LANG_POP([C++])
-if test x"$CXX11FLAGS" = x; then
- PLATCXXFLAGS="$PLATCFLAGS"
-else
- PLATCXXFLAGS="$CXX11FLAGS $PLATCFLAGS"
+AC_ARG_ENABLE([cpp11-testing], AS_HELP_STRING([--enable-cpp11-testing], [enable C++11 testing if supported by compiler (default disabled)]), [enable_cpp11_testing=$enableval], [enable_cpp11_testing=no])
+AC_MSG_CHECKING([whether to enable C++11 testing])
+AC_MSG_RESULT([$enable_cpp11_testing])
+
+PLATCXXFLAGS="$PLATCFLAGS"
+if test x"$enable_cpp11_testing" = xyes; then
+ AC_LANG_PUSH([C++])
+ CXXFLAGS_SAVED=$CXXFLAGS
+ AX_CXX_COMPILE_STDCXX_11([noext], [nostop])
+ CXXFLAGS=$CXXFLAGS_SAVED
+ AC_LANG_POP([C++])
+ if test x"$CXX11FLAGS" != x; then
+ PLATCXXFLAGS="$CXX11FLAGS $PLATCXXFLAGS"
+ fi
+ AC_MSG_CHECKING([for C++11 enabled compiler])
+ if test x"$HAVE_CXX11_COMPILER" = x; then
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_RESULT([$HAVE_CXX11_COMPILER])
+ fi
fi
# Set info about shared libraries.