]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Fixed the cmake configuration with msys+mingw.
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 14 Sep 2009 14:22:46 +0000 (14:22 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 14 Sep 2009 14:22:46 +0000 (14:22 +0000)
CMakeLists.txt
log.c

index d2f95b8388f1c0d9fbdf52c13292bd9a95317a9c..96c4eee616831bbcd213de1af35963db90423d3c 100755 (executable)
@@ -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 d8ec5f7c765c93d125370465f05722a053ea504a..e4c0b311d95ffb4183cefdd087505f30d4a7f735 100644 (file)
--- 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);