]> source.dussan.org Git - rspamd.git/commitdiff
Find nftw definition
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 11 Dec 2015 16:30:37 +0000 (16:30 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 11 Dec 2015 16:30:37 +0000 (16:30 +0000)
CMakeLists.txt

index f0e5e3e6847d8d39fdfa5ade50ff762b69a86709..c349b1f82e031d73fad85efbcce818a2aeafd490 100644 (file)
@@ -479,14 +479,14 @@ SET(POE_LOOP "Loop::IO_Poll")
 SET(TAR "tar")
 
 # Platform specific configuration
-IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE -DFREEBSD")
+IF(CMAKE_SYSTEM_NAME MATCHES "^.*BSD$")
+       ADD_DEFINITIONS(-DFREEBSD -D_BSD_SOURCE)
        CONFIGURE_FILE(freebsd/rspamd.sh.in freebsd/rspamd @ONLY)
 
        IF(ENABLE_REDIRECTOR MATCHES "ON")
                CONFIGURE_FILE(freebsd/redirector.sh.in freebsd/redirector @ONLY)
        ENDIF(ENABLE_REDIRECTOR MATCHES "ON")
-       MESSAGE(STATUS "Configuring for FreeBSD")
+       MESSAGE(STATUS "Configuring for BSD system")
        # Find util library
        ProcessPackage(LIBUTIL LIBRARY util INCLUDE libutil.h
                ROOT ${LIBUTIL_ROOT_DIR} OPTIONAL)
@@ -499,7 +499,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
        ENDIF()
        SET(POE_LOOP "Loop::Kqueue")
        SET(TAR "gtar")
-ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+ENDIF()
 
 IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE -DDARWIN")
@@ -513,9 +513,9 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
 
 IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -DLINUX")
+       ADD_DEFINITIONS(-D_GNU_SOURCE -DLINUX -D_XOPEN_SOURCE=600)
        IF(BUILD_CPU_MODE STREQUAL "32")
-               SET(CMAKE_C_FLAGS  "-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE ${CMAKE_C_FLAGS}")
+               ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
        ENDIF(BUILD_CPU_MODE STREQUAL "32")
        # Workaround with architecture specific includes
        IF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
@@ -729,6 +729,8 @@ ENDIF(NOT CMAKE_C_OPT_FLAGS)
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_OPT_FLAGS} ${CMAKE_C_FLAGS} ${CMAKE_C_WARN_FLAGS}")
 
+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+
 # Check platform specific includes
 CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
 CHECK_INCLUDE_FILES(sys/time.h  HAVE_SYS_TIME_H)
@@ -845,6 +847,7 @@ CHECK_SYMBOL_EXISTS(setbit sys/param.h PARAM_H_HAS_BITSET)
 CHECK_SYMBOL_EXISTS(getaddrinfo "sys/types.h;sys/socket.h;netdb.h" HAVE_GETADDRINFO)
 CHECK_SYMBOL_EXISTS(sched_yield "sched.h" HAVE_SCHED_YIELD)
 CHECK_SYMBOL_EXISTS(__get_cpuid "cpuid.h" HAVE_GET_CPUID)
+CHECK_SYMBOL_EXISTS(nftw "sys/types.h;ftw.h" HAVE_NFTW)
 CHECK_SYMBOL_EXISTS(PCRE_CONFIG_JIT "pcre.h" HAVE_PCRE_JIT)
 CHECK_SYMBOL_EXISTS(SOCK_SEQPACKET "sys/types.h;sys/socket.h" HAVE_SOCK_SEQPACKET)
 CHECK_SYMBOL_EXISTS(I_SETSIG "sys/types.h;sys/ioctl.h" HAVE_SETSIG)
@@ -1023,8 +1026,6 @@ IF(GLIB_COMPAT)
        INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/contrib/lgpl")
 ENDIF(GLIB_COMPAT)
 
-ADD_DEFINITIONS(-DHAVE_CONFIG_H)
-
 LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
 LIST(APPEND RSPAMD_REQUIRED_LIBRARIES ucl)
 LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rdns)