Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace usleep for nanosleep
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index 7c1511c..bf896dd 100644 (file)
@@ -68,7 +68,11 @@ include(TestBigEndian)
 TEST_BIG_ENDIAN(BIGENDIAN)
 
 include(FindGraphviz)
-include(FindPCRE)
+if(WIN32)
+include(FindPcreWin)
+else(WIN32)
+include(FindPCRE)  
+endif(WIN32)
 
 set(HAVE_GTNETS 0)
 if(enable_gtnets)      
@@ -113,6 +117,8 @@ CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
 CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
 CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H)
 CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H)
+CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
+CHECK_INCLUDE_FILE("sys/sysctl.h" HAVE_SYS_SYSCTL_H)
 CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H)
 CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
 CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
@@ -125,7 +131,7 @@ 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)
+CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
 CHECK_FUNCTION_EXISTS(getdtablesize HAVE_GETDTABLESIZE)
 CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
 CHECK_FUNCTION_EXISTS(readv HAVE_READV)
@@ -143,7 +149,7 @@ CHECK_FUNCTION_EXISTS(mergesort HAVE_MERGESORT)
 execute_process(
 COMMAND "${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_thread_storage.c"
 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-OUTPUT_VARIABLE HAVE_thread_storage_run
+RESULT_VARIABLE HAVE_thread_storage_run
 )
 
 if(HAVE_thread_storage_run)
@@ -167,10 +173,12 @@ endif(WIN32)
 
 set(CONTEXT_UCONTEXT 0)
 SET(CONTEXT_THREADS 0)
-SET(HAVE_TRACING 0)
+SET(HAVE_TRACING 1)
 
 if(enable_tracing)
        SET(HAVE_TRACING 1)
+else(enable_tracing)   
+       SET(HAVE_TRACING 0)
 endif(enable_tracing)
 
 if(enable_jedule)
@@ -191,10 +199,10 @@ endif(enable_latency_bound_tracking)
 
 if(enable_model-checking AND HAVE_MMAP)
        SET(HAVE_MC 1)
-       SET(MMALLOC_WANT_OVERIDE_LEGACY 1)
+       SET(MMALLOC_WANT_OVERRIDE_LEGACY 1)
 else(enable_model-checking AND HAVE_MMAP)
        SET(HAVE_MC 0)
-       SET(MMALLOC_WANT_OVERIDE_LEGACY 0)
+       SET(MMALLOC_WANT_OVERRIDE_LEGACY 0)
 endif(enable_model-checking AND HAVE_MMAP)
 
 #--------------------------------------------------------------------------------------------------
@@ -325,7 +333,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
 endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
 
 if(WIN32)
-       set(mcsc_flags "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
+    if(ARCH_32_BITS)
+    set(mcsc_flags "-D_XBT_WIN32 -D_I_X86_ -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
+    else(ARCH_32_BITS)
+    set(mcsc_flags "-D_XBT_WIN32 -D_AMD64_ -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
+    endif(ARCH_32_BITS)
 endif(WIN32)
 
 IF(CMAKE_CROSSCOMPILING)
@@ -334,14 +346,18 @@ IF(CMAKE_CROSSCOMPILING)
                set(IS_WINDOWS 1)       
        ENDIF(WIN32)
 ELSE(CMAKE_CROSSCOMPILING)
+    file(REMOVE "${CMAKE_BINARY_DIR}/testprog*")
+    file(REMOVE ${CMAKE_BINARY_DIR}/conftestval)
     exec_program(
                  "${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c ${mcsc_flags} -o testprog"
                  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/
                  OUTPUT_VARIABLE COMPILE_mcsc_VAR)
 
-    file(REMOVE ${CMAKE_BINARY_DIR}/conftestval)
     if(NOT COMPILE_mcsc_VAR)
+        message(STATUS "prog_AC_CHECK_MCSC.c is compilable")
         exec_program("${CMAKE_BINARY_DIR}/testprog" OUTPUT_VARIABLE var_compil)
+    else(NOT COMPILE_mcsc_VAR)
+        message(STATUS "prog_AC_CHECK_MCSC.c is not compilable")
     endif(NOT COMPILE_mcsc_VAR)
     file(REMOVE "${CMAKE_BINARY_DIR}/testprog*")
     
@@ -394,7 +410,7 @@ endif(pthread)
 
 
 ###############
-## SVN version check
+## GIT version check
 ##
 if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/ AND NOT WIN32)
 exec_program("git remote | head -n 1" OUTPUT_VARIABLE remote RETURN_VALUE ret)
@@ -431,8 +447,8 @@ else(BIGENDIAN)
   set(GRAS_BIGENDIAN 0)
 endif(BIGENDIAN)
 
-# The syntax of this magic string is given in src/gras/DataDesc/ddt_convert.c
-# It kinda matches the values that the gras_arch_desc_t structure can take
+# The syntax of this magic string is given in src/xbt/datadesc/ddt_convert.c
+# It kinda matches the values that the xbt_arch_desc_t structure can take
 
 # Basically, the syntax is one char l or B for endianness (little or Big)
 #   then there is a bunch of blocks separated by _.  
@@ -451,7 +467,7 @@ endif(BIGENDIAN)
 #    formalism to another. Only the GRAS_ARCH is transfered in the
 #    stream, and it it of cruxial importance to keep these detection
 #    information here synchronized with the data hardcoded in the
-#    source in src/gras/DataDesc/ddt_convert.c 
+#    source in src/xbt/datadesc/ddt_convert.c 
 
 # If you add something here (like a previously unknown architecture),
 #    please add it to the source code too. 
@@ -560,7 +576,7 @@ if(HAVE_MAKECONTEXT OR WIN32)
        
     if(WIN32)
         if(ARCH_32_BITS)
-           set(makecontext_CPPFLAGS "-DTEST_makecontext")
+           set(makecontext_CPPFLAGS "-DTEST_makecontext -D_I_X86_")
            else(ARCH_32_BITS)
            set(makecontext_CPPFLAGS "-DTEST_makecontext -D_AMD64_")
            endif(ARCH_32_BITS)
@@ -819,7 +835,7 @@ endif(APPLE)
 configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in"                  "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE)
 
 SET( CMAKEDEFINE "#cmakedefine" )
-configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/gras_config.h.in"     "${CMAKE_BINARY_DIR}/src/gras_config.h" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/gras_config.h.in"         "${CMAKE_BINARY_DIR}/src/gras_config.h" @ONLY IMMEDIATE)
 configure_file("${CMAKE_BINARY_DIR}/src/gras_config.h"                         "${CMAKE_BINARY_DIR}/src/gras_config.h" @ONLY IMMEDIATE)
 configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in"           "${CMAKE_BINARY_DIR}/include/simgrid_config.h" @ONLY IMMEDIATE)
 
@@ -865,7 +881,7 @@ ${CMAKE_BINARY_DIR}/bin/smpiff
 ${CMAKE_BINARY_DIR}/bin/smpirun
 ${CMAKE_BINARY_DIR}/bin/colorize
 ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
-${CMAKE_BINARY_DIR}/examples/smpi/smpi_traced.trace
+${CMAKE_BINARY_DIR}/examples/smpi/tracing/smpi_traced.trace
 ${CMAKE_BINARY_DIR}/src/supernovae_sg.c
 ${CMAKE_BINARY_DIR}/src/supernovae_gras.c
 ${CMAKE_BINARY_DIR}/src/supernovae_smpi.c
@@ -896,4 +912,4 @@ IF(${ARCH_32_BITS})
 ELSE(${ARCH_32_BITS})
     set(WIN_ARCH "64")
 ENDIF(${ARCH_32_BITS})
-configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/simgrid.nsi.in"       "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/simgrid.nsi.in"   "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE)