]> source.dussan.org Git - rspamd.git/commitdiff
Libutil is useless everywhere but FreeBSD.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 11 May 2015 16:08:58 +0000 (17:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 11 May 2015 16:08:58 +0000 (17:08 +0100)
CMakeLists.txt

index 0e2c98d9eccc46331eafe46d89215d20f5d1016e..b6948dd4514852423f0a2b81c4ba5cf2addff601 100644 (file)
@@ -363,7 +363,29 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
                CONFIGURE_FILE(freebsd/redirector.sh.in freebsd/redirector @ONLY)
        ENDIF(ENABLE_REDIRECTOR MATCHES "ON")
        MESSAGE(STATUS "Configuring for FreeBSD")
+       # Find util library
+
+       FIND_LIBRARY(LIBUTIL_LIBRARY NAMES util 
+                                       HINTS "${RSPAMD_SEARCH_PATH}"
+                                               PATH_SUFFIXES lib64 lib
+                         PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
+                        DOC "Path where the libutil library can be found")
+       IF(LIBUTIL_LIBRARY)
+               FIND_FILE(_LIBUTIL_H 
+                                       HINTS "${RSPAMD_SEARCH_PATH}" 
+                                       NAMES libutil.h PATH ${RSPAMD_DEFAULT_INCLUDE_PATHS}
+                                       PATH_SUFFIXES include
+                                       DOC "Path to libutil header")
+               IF(_LIBUTIL_H)
+                       SET(HAVE_LIBUTIL_H 1)
+                       INCLUDE_DIRECTORIES(${_LIBUTIL_H})
+                       LIST(APPEND CMAKE_REQUIRED_INCLUDES ${_LIBUTIL_H})
+                       SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} -L${LIBUTIL_LIBRARY};-lutil")
+                       LIST(APPEND RSPAMD_REQUIRED_LIBRARIES util)
+                       CHECK_FUNCTION_EXISTS(pidfile_open HAVE_PIDFILE)
+                       CHECK_FUNCTION_EXISTS(pidfile_fileno HAVE_PIDFILE_FILENO)
+               ENDIF(_LIBUTIL_H)
+       ENDIF(LIBUTIL_LIBRARY)
 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
 
 IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@@ -527,52 +549,6 @@ IF(ENABLE_GPERF_TOOLS MATCHES "ON")
        SET(WITH_GPERF_TOOLS 1)
 ENDIF(ENABLE_GPERF_TOOLS MATCHES "ON")
 
-# Find util library
-
-FIND_LIBRARY(LIBUTIL_LIBRARY NAMES util 
-                               HINTS "${RSPAMD_SEARCH_PATH}"
-                                       PATH_SUFFIXES lib64 lib
-                  PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
-                 DOC "Path where the libutil library can be found")
-IF(LIBUTIL_LIBRARY)
-       FIND_FILE(_LIBUTIL_H 
-                               HINTS "${RSPAMD_SEARCH_PATH}" 
-                               NAMES libutil.h PATH ${RSPAMD_DEFAULT_INCLUDE_PATHS}
-                               PATH_SUFFIXES include
-                               DOC "Path to libutil header")
-       IF(_LIBUTIL_H)
-               SET(HAVE_LIBUTIL_H 1)
-               INCLUDE_DIRECTORIES(${_LIBUTIL_H})
-               LIST(APPEND CMAKE_REQUIRED_INCLUDES ${_LIBUTIL_H})
-               SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} -L${LIBUTIL_LIBRARY};-lutil")
-               LIST(APPEND RSPAMD_REQUIRED_LIBRARIES util)
-               CHECK_FUNCTION_EXISTS(pidfile_open HAVE_PIDFILE)
-               CHECK_FUNCTION_EXISTS(pidfile_fileno HAVE_PIDFILE_FILENO)
-       ENDIF(_LIBUTIL_H)
-ENDIF(LIBUTIL_LIBRARY)
-
-# Find libfetch (for FreeBSD)
-
-IF(ENABLE_URL_INCLUDE MATCHES "ON")
-    FIND_LIBRARY(LIBFETCH_LIBRARY HINTS "${RSPAMD_SEARCH_PATH}"
-                               NAMES fetch PATHS       PATH_SUFFIXES lib64 lib
-                    PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
-                    DOC "Path where the libfetch library can be found")
-    IF(LIBFETCH_LIBRARY)
-       FIND_FILE(HAVE_FETCH_H HINTS "${RSPAMD_SEARCH_PATH}"
-               NAMES fetch.h 
-               PATH_SUFFIXES include
-               PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS}
-                               DOC "Path to libfetch header")
-    ELSE(LIBFETCH_LIBRARY)
-       # Try to find libcurl
-       ProcessPackage(CURL libcurl)
-       IF(NOT CURL_FOUND)
-               MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration")
-       ENDIF(NOT CURL_FOUND)
-    ENDIF(LIBFETCH_LIBRARY)
-ENDIF(ENABLE_URL_INCLUDE MATCHES "ON")
-
 # Static build
 
 IF(ENABLE_STATIC MATCHES "ON")
@@ -895,6 +871,26 @@ IF(NOT HAVE_COMPATIBLE_QUEUE_H)
        INCLUDE_DIRECTORIES(compat)
 ENDIF(NOT HAVE_COMPATIBLE_QUEUE_H)
 
+IF(ENABLE_URL_INCLUDE MATCHES "ON")
+    FIND_LIBRARY(LIBFETCH_LIBRARY HINTS "${RSPAMD_SEARCH_PATH}"
+                               NAMES fetch PATHS       PATH_SUFFIXES lib64 lib
+                    PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
+                    DOC "Path where the libfetch library can be found")
+    IF(LIBFETCH_LIBRARY)
+       FIND_FILE(HAVE_FETCH_H HINTS "${RSPAMD_SEARCH_PATH}"
+               NAMES fetch.h 
+               PATH_SUFFIXES include
+               PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS}
+                               DOC "Path to libfetch header")
+    ELSE(LIBFETCH_LIBRARY)
+       # Try to find libcurl
+       ProcessPackage(CURL libcurl)
+       IF(NOT CURL_FOUND)
+               MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration")
+       ENDIF(NOT CURL_FOUND)
+    ENDIF(LIBFETCH_LIBRARY)
+ENDIF(ENABLE_URL_INCLUDE MATCHES "ON")
+
 IF(NOT DESTDIR)
     SET(DESTDIR $ENV{DESTDIR})
 ENDIF(NOT DESTDIR)