]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Some fixes for static build
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 31 Mar 2017 11:49:34 +0000 (12:49 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 31 Mar 2017 12:29:45 +0000 (13:29 +0100)
CMakeLists.txt
src/CMakeLists.txt
src/client/CMakeLists.txt
src/rspamadm/CMakeLists.txt
test/CMakeLists.txt
utils/CMakeLists.txt

index 7e4a0258692fbf3ecf8c92563c2ef9758eb19540..b7790b693519f784c22a2f72554a0dcb6fc02d8f 100644 (file)
@@ -74,8 +74,9 @@ IF(NOT RAGEL_FOUND)
 ENDIF()
 
 IF ("${ARCH}" STREQUAL "x86_64")
-       IF (ENABLE_HYPERSCAN MATCHES "ON")
+       IF (ENABLE_HYPERSCAN MATCHES "ON" OR ENABLE_STATIC MATCHES "ON")
                ENABLE_LANGUAGE(CXX)
+               SET(USE_CXX_LINKER 1)
        ENDIF()
 ELSE()
        MESSAGE(STATUS "Hyperscan support is possible only for x86_64 architecture")
@@ -566,16 +567,19 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
                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/")
-               INCLUDE_DIRECTORIES("/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
-               LIST(APPEND CMAKE_REQUIRED_INCLUDES "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
-       ENDIF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+       #IF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+       #       INCLUDE_DIRECTORIES("/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+       #       LIST(APPEND CMAKE_REQUIRED_INCLUDES "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+       #ENDIF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
 
        LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt)
        LIST(APPEND CMAKE_REQUIRED_LIBRARIES dl)
        LIST(APPEND CMAKE_REQUIRED_LIBRARIES resolv)
        LIST(APPEND CMAKE_REQUIRED_LIBRARIES nsl)
        MESSAGE(STATUS "Configuring for Linux")
+       IF(ENABLE_STATIC MATCHES "ON")
+               LIST(APPEND CMAKE_REQUIRED_LIBRARIES z)
+       ENDIF()
        IF(EXISTS "/etc/debian_version")
                SET(LINUX_START_SCRIPT "rspamd_debian.in")
        ELSE(EXISTS "/etc/debian_version")
index 33bc454065af129732118c1d24507b972f0fd060..a318af59e84c6c6a628819b24fae5036e2f0e223 100644 (file)
@@ -192,6 +192,9 @@ ENDIF ()
 
 IF (ENABLE_HYPERSCAN MATCHES "ON")
        TARGET_LINK_LIBRARIES(rspamd hs)
+ENDIF()
+
+IF(USE_CXX_LINKER)
        SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE CXX)
 ENDIF()
 
index 51def34d7a731c269494cdd9a12cbe909f85de45..0a92019d8c750d793d317a9c0c19b3020a053708 100644 (file)
@@ -8,7 +8,7 @@ ADD_EXECUTABLE(rspamc ${RSPAMCSRC} ${LIBRSPAMDCLIENTSRC})
 SET_TARGET_PROPERTIES(rspamc PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/lib")
 TARGET_LINK_LIBRARIES(rspamc rspamd-server)
 TARGET_LINK_LIBRARIES(rspamc ${RSPAMD_REQUIRED_LIBRARIES})
-IF (ENABLE_HYPERSCAN MATCHES "ON")
+IF(USE_CXX_LINKER)
        SET_TARGET_PROPERTIES(rspamc PROPERTIES LINKER_LANGUAGE CXX)
 ENDIF()
 
index 91e14d749b35f897a15d661d17d343416b08abd0..752e23d8b6e33a5ebea6b00b613063eca9db6b5f 100644 (file)
@@ -49,7 +49,9 @@ IF (ENABLE_FANN MATCHES "ON")
 ENDIF ()
 IF (ENABLE_HYPERSCAN MATCHES "ON")
     TARGET_LINK_LIBRARIES(rspamadm hs)
-    SET_TARGET_PROPERTIES(rspamadm PROPERTIES LINKER_LANGUAGE CXX)
 ENDIF ()
+IF(USE_CXX_LINKER)
+    SET_TARGET_PROPERTIES(rspamadm PROPERTIES LINKER_LANGUAGE CXX)
+ENDIF()
 
 INSTALL(TARGETS rspamadm RUNTIME DESTINATION bin)
index d4feffcc0692711dadd259f856b65b08924cad49..c6e7108b7b8180a011e921913b5015488f51adb3 100644 (file)
@@ -37,6 +37,8 @@ IF(ENABLE_HIREDIS MATCHES "ON")
 ENDIF()
 IF (ENABLE_HYPERSCAN MATCHES "ON")
        TARGET_LINK_LIBRARIES(rspamd-test hs)
+ENDIF()
+IF(USE_CXX_LINKER)
        SET_TARGET_PROPERTIES(rspamd-test PROPERTIES LINKER_LANGUAGE CXX)
 ENDIF()
 TARGET_LINK_LIBRARIES(rspamd-test rspamd-actrie)
index 8bc0ff604ac27258a50dc45ecefbf4b93183d826..9d42c604edf55a2d4b45c2220e0e67ad0a672ea3 100644 (file)
@@ -7,7 +7,7 @@ SET(MIMESRC mime_tool.c)
 
 MACRO(ADD_UTIL NAME)
        ADD_EXECUTABLE("${NAME}" "${ARGN}")
-       IF (ENABLE_HYPERSCAN MATCHES "ON")
+       IF (USE_CXX_LINKER)
                SET_TARGET_PROPERTIES("${NAME}" PROPERTIES LINKER_LANGUAGE CXX)
        ELSE()
                SET_TARGET_PROPERTIES("${NAME}" PROPERTIES LINKER_LANGUAGE C)