From: Frédéric Marchal Date: Mon, 14 Sep 2009 14:22:46 +0000 (+0000) Subject: Fixed the cmake configuration with msys+mingw. X-Git-Tag: v2_2_6~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e112fa1fb6697379d9f5046884a871ef9c185056;p=thirdparty%2Fsarg.git Fixed the cmake configuration with msys+mingw. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d2f95b8..96c4eee 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,7 +217,7 @@ ELSE(HAVE_RLIM_T) ENDIF(HAVE_RLIM_T) # Windows need lib wsock32 -IF(CMAKE_SYSTEM_NAME EQUAL "Windows") +IF(CMAKE_SYSTEM_NAME STREQUAL "Windows") CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H) CHECK_INCLUDE_FILE(winsock.h HAVE_WINSOCK_H) FIND_LIBRARY(WSOCK_LIB NAMES wsock32 PATHS /usr/lib /usr/local/lib DOC "The winsock library") @@ -226,23 +226,23 @@ IF(CMAKE_SYSTEM_NAME EQUAL "Windows") #set_target_properties(sarg PROPERTIES LINK_FLAGS "${LINK_FLAGS} -lwsock32") TARGET_LINK_LIBRARIES(sarg wsock32) ENDIF(WSOCK_LIB) -ENDIF(CMAKE_SYSTEM_NAME EQUAL "Windows") +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Windows") CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP) -IF(!HAVE_MKSTEMP) +IF(NOT HAVE_MKSTEMP) # MingW provide mkstemps in libiberty but doesn't declare it in any header file FIND_LIBRARY(IBERTY_LIB NAMES iberty PATHS /mingw/lib DOC "The library of mingw containing mkstemps") IF(IBERTY_LIB) TARGET_LINK_LIBRARIES(sarg iberty) ENDIF(IBERTY_LIB) -ENDIF(!HAVE_MKSTEMP) +ENDIF(NOT HAVE_MKSTEMP) # System particularities -IF(CMAKE_SYSTEM_NAME EQUAL "solaris") +IF(CMAKE_SYSTEM_NAME STREQUAL "solaris") TARGET_LINK_LIBRARIES(sarg socket nsl) #SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_DEFINITIONS="-DSOLARIS ${COMPILE_DEFINITIONS}") ADD_DEFINITIONS(-DSOLARIS) -ENDIF(CMAKE_SYSTEM_NAME EQUAL "solaris") +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "solaris") # Save the configuration for the project CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/include/config.h.in" "${CMAKE_BINARY_DIR}/config.h" @ONLY) diff --git a/log.c b/log.c index d8ec5f7..e4c0b31 100644 --- a/log.c +++ b/log.c @@ -117,7 +117,6 @@ int main(int argc,char *argv[]) struct tm *t; off_t recs1=0; unsigned long recs2=0; - struct rlimit rl; int OutputNonZero = REPORT_EVERY_X_LINES ; int download_flag; char download_url[MAXLEN]; @@ -641,7 +640,9 @@ int main(int argc,char *argv[]) if(debug) debuga("sarg %s: %s",text[73],VERSION); +#ifdef HAVE_RLIM_T if (Ulimit[0] != '\0') { + struct rlimit rl; long l1, l2; int rc=0; @@ -671,6 +672,7 @@ int main(int argc,char *argv[]) if(debug) debuga("Maximum file descriptor: cur=%ld max=%ld, changed to cur="RLIM_STRING" max="RLIM_STRING,l1,l2,rl.rlim_cur,rl.rlim_max); } +#endif read_usertab(UserTabFile);