diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-11 17:08:58 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-11 17:08:58 +0100 |
commit | ecc9191f1742707d2d8c6e90d54738ab31435d22 (patch) | |
tree | 94cdf2717608b95fd8e147dff3cd890819bf711a /CMakeLists.txt | |
parent | 2b79a6ac22863d65e466d85797b0efac7bbffff0 (diff) | |
download | rspamd-ecc9191f1742707d2d8c6e90d54738ab31435d22.tar.gz rspamd-ecc9191f1742707d2d8c6e90d54738ab31435d22.zip |
Libutil is useless everywhere but FreeBSD.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 90 |
1 files changed, 43 insertions, 47 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e2c98d9e..b6948dd45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) |