X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/57ab5de3e3860d2375538052ac4dd8112c58a111..ab58f88f92ff03857b6cea328043a63619dc2ba7:/buildtools/Cmake/CompleteInFiles.cmake diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index 84fe86f374..c1e9ab30ea 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -41,6 +41,7 @@ CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) 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_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP) @@ -67,11 +68,16 @@ SET(HAVE_RUBY 0) set(HAVE_LUA 0) SET(HAVE_JAVA 0) SET(HAVE_TRACING 0) +SET(HAVE_LATENCY_BOUND_TRACKING 0) if(enable_tracing) SET(HAVE_TRACING 1) endif(enable_tracing) +if(enable_latency_bound_tracking) + SET(HAVE_LATENCY_BOUND_TRACKING 1) +endif(enable_latency_bound_tracking) + if(enable_model-checking AND HAVE_MMAP) SET(HAVE_MC 1) SET(MMALLOC_WANT_OVERIDE_LEGACY 1) @@ -180,14 +186,32 @@ mark_as_advanced(HAVE_CGRAPH_H) if(HAVE_CGRAPH_LIB AND HAVE_CGRAPH_H) string(REGEX REPLACE "/libcgraph.*" "" lib_cgraph ${HAVE_CGRAPH_LIB}) string(REPLACE "/cgraph.h" "" file_cgraph_h ${HAVE_CGRAPH_H}) - string(REGEX MATCH "-I${file_cgraph_h} " operation "${CMAKE_C_FLAGS}") if(NOT operation) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${file_cgraph_h} ") endif(NOT operation) + string(REGEX MATCH "-L${lib_cgraph} " operation "${CMAKE_C_FLAGS}") + if(NOT operation) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${lib_cgraph} ") + endif(NOT operation) endif(HAVE_CGRAPH_LIB AND HAVE_CGRAPH_H) +#-------------------------------------------------------------------------------------------------- +### Initialize of pcre +find_library(PATH_PCRE_LIB pcre "/usr/lib/") + +if(PATH_PCRE_LIB) + string(REGEX REPLACE "/libpcre.*[.]so$" "" PATHLIBPCRE "${PATH_PCRE_LIB}") + string(REGEX MATCH "-L${PATHLIBPCRE} " operation "${CMAKE_C_FLAGS}") + if(NOT operation) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${PATHLIBPCRE} ") + endif(NOT operation) + set(HAVE_PCRE_LIB 1) +else(PATH_PCRE_LIB) + message(FATAL_ERROR "You must have libpcre installed (please install the libpcre3-dev package or equivalent)") +endif(PATH_PCRE_LIB) + #-------------------------------------------------------------------------------------------------- ### Initialize of CONTEXT THREADS @@ -535,8 +559,8 @@ set(diff_va "va_copy((d),(s))" "__builtin_va_copy((d),(s))" "do { (d) = (s)\; } while (0)" "do { *(d) = *(s)\; } while (0)" -"memcpy((void *)&(d), (void *)&(s)), sizeof((s))" -"memcpy((void *)(d), (void *)(s)), sizeof(*(s))" +"memcpy((void *)&(d), (void *)&(s), sizeof(s))" +"memcpy((void *)(d), (void *)(s), sizeof(*(s)))" ) foreach(fct ${diff_va}) @@ -606,15 +630,15 @@ foreach(fct ${diff_va}) set(__VA_COPY_USE_ASP "do { *(d) = *(s); } while (0)") endif(${fctbis} STREQUAL "do { *(d) = *(s) } while (0)") - if(${fctbis} STREQUAL "memcpy((void *)&(d), (void *)&(s)), sizeof((s))") + if(${fctbis} STREQUAL "memcpy((void *)&(d), (void *)&(s), sizeof(s))") set(ac_cv_va_copy "CPS") - set(__VA_COPY_USE_CPS "memcpy((void *)&(d), (void *)&(s)), sizeof((s))") - endif(${fctbis} STREQUAL "memcpy((void *)&(d), (void *)&(s)), sizeof((s))") + set(__VA_COPY_USE_CPS "memcpy((void *)&(d), (void *)&(s), sizeof(s))") + endif(${fctbis} STREQUAL "memcpy((void *)&(d), (void *)&(s), sizeof(s))") - if(${fctbis} STREQUAL "memcpy((void *)(d), (void *)(s)), sizeof(*(s))") + if(${fctbis} STREQUAL "memcpy((void *)(d), (void *)(s), sizeof(*(s)))") set(ac_cv_va_copy "CPP") - set(__VA_COPY_USE_CPP "memcpy((void *)(d), (void *)(s)), sizeof(*(s))") - endif(${fctbis} STREQUAL "memcpy((void *)(d), (void *)(s)), sizeof(*(s))") + set(__VA_COPY_USE_CPP "memcpy((void *)(d), (void *)(s), sizeof(*(s)))") + endif(${fctbis} STREQUAL "memcpy((void *)(d), (void *)(s), sizeof(*(s)))") if(NOT STATUS_OK) set(__VA_COPY_USE "__VA_COPY_USE_${ac_cv_va_copy}(d, s)") @@ -626,11 +650,10 @@ foreach(fct ${diff_va}) endforeach(fct ${diff_va}) #-------------------------------------------------------------------------------------------------- -### Try execut getline command -try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR +### check for getline +try_compile(COMPILE_RESULT_VAR ${PROJECT_DIRECTORY} ${PROJECT_DIRECTORY}/buildtools/Cmake/test_prog/prog_getline.c - OUTPUT_VARIABLE GETLINE_OUTPUT ) if(NOT COMPILE_RESULT_VAR)