Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sorry, now we can use ucontext...
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index b633174..39bab45 100644 (file)
@@ -12,8 +12,8 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
         message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")
     ELSE(${ARCH_32_BITS})
         message(STATUS "System processor: amd64")
-        set(PROCESSOR_x86_64 true)
-        set(PROCESSOR_i686 false)
+        set(PROCESSOR_x86_64 1)
+        set(PROCESSOR_i686 0)
     ENDIF(${ARCH_32_BITS})          
     set(HAVE_RAWCTX 1)
     
@@ -271,12 +271,8 @@ ELSE(CMAKE_CROSSCOMPILING)
                        file(READ "${simgrid_BINARY_DIR}/conftestval" mcsc)
                        STRING(REPLACE "\n" "" mcsc "${mcsc}")
                        if(mcsc)
-                           if(APPLE AND NOT ucontext) # TODO for the moment ucontext don't work on MAC OSX
-                               set(mcsc "no") 
-                           else(APPLE AND NOT ucontext)
-                               set(mcsc "yes")
-                               set(HAVE_UCONTEXT_H 1)
-                               endif(APPLE AND NOT ucontext)
+                               set(mcsc "yes")
+                               set(HAVE_UCONTEXT_H 1)
                        else(mcsc)
                                set(mcsc "no")
                        endif(mcsc)
@@ -697,6 +693,16 @@ if(ADDR2LINE)
 set(ADDR2LINE "${ADDR2LINE}/addr2line")
 endif(ADDR2LINE)
 
+
+
+### Check if OSX can compile with ucontext (with gcc 4.[1-5] it is broken)
+if(APPLE)
+    if(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR)
+        message(STATUS "Ucontext can't be used with this version of gcc (must be greater than 4.5")
+        set(HAVE_UCONTEXT_H 0)
+    endif(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR)
+endif(APPLE)
+
 ### File to create
 
 configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in"                  "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE)