Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Test if having futex.h.
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index be1ac6a..c15c13b 100644 (file)
@@ -6,6 +6,7 @@ ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Modules
 message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
 
 include(CheckFunctionExists)
+include(CheckTypeSize)
 include(CheckIncludeFile)
 include(CheckIncludeFiles)
 include(CheckLibraryExists)
@@ -13,7 +14,9 @@ include(TestBigEndian)
 TEST_BIG_ENDIAN(BIGENDIAN)
 
 include(FindGraphviz)
+if(enable_pcre)
 include(FindPCRE)
+endif(enable_pcre)
 if(enable_gtnets)      
        include(FindGTnets)
 endif(enable_gtnets)
@@ -59,6 +62,8 @@ CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
 CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
 CHECK_INCLUDE_FILE("ucontext.h" HAVE_UCONTEXT_H)
 CHECK_INCLUDE_FILE("stdio.h" HAVE_STDIO_H)
+CHECK_INCLUDE_FILE("linux/futex.h" HAVE_FUTEX_H)
+
 
 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
 CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP)
@@ -109,6 +114,12 @@ else(enable_model-checking AND HAVE_MMAP)
        SET(MMALLOC_WANT_OVERIDE_LEGACY 0)
 endif(enable_model-checking AND HAVE_MMAP)
 
+#--------------------------------------------------------------------------------------------------
+### Check for some architecture dependent values
+CHECK_TYPE_SIZE(int SIZEOF_INT)
+CHECK_TYPE_SIZE(void* SIZEOF_VOIDP)
+
+
 #--------------------------------------------------------------------------------------------------
 ### Initialize of CONTEXT THREADS
 
@@ -203,20 +214,15 @@ if(mcsc MATCHES "no" AND pthread)
        endif(HAVE_WINDOWS_H)
 endif(mcsc MATCHES "no" AND pthread)
 
-if(with_context MATCHES "ucontext" AND mcsc MATCHES "no")
-       message(FATAL_ERROR "-Dwith-context=ucontext specified but ucontext unusable.")
-endif(with_context MATCHES "ucontext" AND mcsc MATCHES "no")
-
 #Only windows
 
-if(with_context MATCHES "windows")
+if(WIN32)
        if(NOT HAVE_WINDOWS_H)
                message(FATAL_ERROR "no appropriate backend found windows")
        endif(NOT HAVE_WINDOWS_H)
-endif(with_context MATCHES "windows")
+endif(WIN32)
 
 if(windows_context MATCHES "yes")
-       set(with_context "windows")
        message(STATUS "Context change to windows")
 endif(windows_context MATCHES "yes")