]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a specific configury check to test compilability of the
authorFlorian Krohm <florian@eich-krohm.de>
Tue, 8 Oct 2013 13:04:00 +0000 (13:04 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Tue, 8 Oct 2013 13:04:00 +0000 (13:04 +0000)
<thread> C++ header file by the selected compiler.
Suggested by Bart Van Assche.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13628

configure.ac
drd/tests/Makefile.am

index 42f2ac5ce64ee1b78c423ed756b5aa95613949bd..1970ace7bd31228d6a9f7376583d26118e7894e7 100644 (file)
@@ -1381,6 +1381,30 @@ AC_MSG_RESULT([no])
 ])
 
 
+# Check whether compiler can process #include <thread> without errors
+# clang 3.3 cannot process <thread> from e.g.
+# gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
+
+AC_MSG_CHECKING([that C++ compiler can include <thread> header file])
+AC_LANG(C++)
+safe_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-std=c++0x
+
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+#include <thread> 
+])],
+[
+ac_cxx_can_include_thread_header=yes
+AC_MSG_RESULT([yes])
+], [
+ac_cxx_can_include_thread_header=no
+AC_MSG_RESULT([no])
+])
+CXXFLAGS=$safe_CXXFLAGS
+AC_LANG(C)
+
+AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes)
+
 #----------------------------------------------------------------------------
 # Checking for supported compiler flags.
 #----------------------------------------------------------------------------
index dabbe52ec061840a7b7dce9d01388640f042eeea..fd38e3493ced9d199197ac1d9f19ed9cf53a302f 100644 (file)
@@ -367,7 +367,7 @@ endif
 
 # clang 3.3 will generate errors about libstdc++ headers from 
 # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
-if ! COMPILER_IS_CLANG
+if CXX_CAN_INCLUDE_THREAD_HEADER
 if HAVE_SHARED_POINTER_ANNOTATION
 check_PROGRAMS += \
   std_thread