]> source.dussan.org Git - rspamd.git/commitdiff
Fix static build.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 2 Nov 2011 16:53:18 +0000 (19:53 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 2 Nov 2011 16:53:18 +0000 (19:53 +0300)
CMakeLists.txt
src/client/CMakeLists.txt

index ed0cc130cbaf20e658d3af16f1a6a232ca44fd89..702775fe79c4d2d83d0446520eff904c5ec36fa6 100644 (file)
@@ -42,7 +42,6 @@ INCLUDE(CheckCCompilerFlag)
 INCLUDE(FindPerl)
 
 # Initial set
-SET(CMAKE_REQUIRED_LIBRARIES m)
 
 IF(CMAKE_INSTALL_PREFIX)
     SET(PREFIX ${CMAKE_INSTALL_PREFIX})
@@ -489,7 +488,7 @@ ENDIF(ENABLE_PROFILING MATCHES "ON")
 
 IF(ENABLE_STATIC MATCHES "ON")
        SET(BUILD_STATIC 1)
-       SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
+       SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -pthread")
        MESSAGE(STATUS "Static build of rspamd, no custom plugins support")
 ENDIF(ENABLE_STATIC MATCHES "ON")
 
@@ -816,12 +815,6 @@ SET_TARGET_PROPERTIES(rspamd PROPERTIES VERSION ${RSPAMD_VERSION})
 
 TARGET_LINK_LIBRARIES(rspamd rspamdserver)
 
-IF(ENABLE_LUAJIT MATCHES "ON")
-    TARGET_LINK_LIBRARIES(rspamd "${LUAJIT_LIBRARY}")
-ELSE(ENABLE_LUAJIT MATCHES "ON")
-    TARGET_LINK_LIBRARIES(rspamd "${LUA_LIBRARY}")
-ENDIF(ENABLE_LUAJIT MATCHES "ON")
-
 IF(LIBJUDY_LIBRARY)
        TARGET_LINK_LIBRARIES(rspamd Judy)
 ENDIF(LIBJUDY_LIBRARY)
@@ -846,8 +839,15 @@ ELSE(GMIME24)
 ENDIF(GMIME24)
 IF(ENABLE_STATIC MATCHES "ON")
        TARGET_LINK_LIBRARIES(rspamd ${PCRE_LIBRARIES})
+       TARGET_LINK_LIBRARIES(rspamd ffi)
 ENDIF(ENABLE_STATIC MATCHES "ON")
 
+IF(ENABLE_LUAJIT MATCHES "ON")
+       TARGET_LINK_LIBRARIES(rspamd "${LUAJIT_LIBRARY}")
+ELSE(ENABLE_LUAJIT MATCHES "ON")
+       TARGET_LINK_LIBRARIES(rspamd "${LUA_LIBRARY}")
+ENDIF(ENABLE_LUAJIT MATCHES "ON")
+
 IF(ENABLE_GPERF_TOOLS MATCHES "ON")
        TARGET_LINK_LIBRARIES(rspamd profiler)
 ENDIF(ENABLE_GPERF_TOOLS MATCHES "ON")
@@ -855,6 +855,7 @@ ENDIF(ENABLE_GPERF_TOOLS MATCHES "ON")
 IF(GLIB_COMPAT)
        TARGET_LINK_LIBRARIES(rspamd glibadditions)
 ENDIF(GLIB_COMPAT)
+TARGET_LINK_LIBRARIES(rspamd m)
 
 ##################### INSTALLATION ##########################################
 
index 37ca91043f00dd376dc5f8e5cc5dc4807e813b89..a486f24d2fb7e8a042a557cbe0f338d61651bc63 100644 (file)
@@ -4,14 +4,18 @@ SET(RSPAMCSRC                   rspamc.c)
 ADD_EXECUTABLE(rspamc ${RSPAMCSRC})
 SET_TARGET_PROPERTIES(rspamc PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/lib")
 TARGET_LINK_LIBRARIES(rspamc rspamdserver)
-TARGET_LINK_LIBRARIES(rspamc rspamdclient)
+IF(ENABLE_STATIC MATCHES "ON")
+       TARGET_LINK_LIBRARIES(rspamc rspamdclient_static)
+ELSE(ENABLE_STATIC MATCHES "ON")
+       TARGET_LINK_LIBRARIES(rspamc rspamdclient)
+ENDIF(ENABLE_STATIC MATCHES "ON")
 TARGET_LINK_LIBRARIES(rspamc pcre)
-TARGET_LINK_LIBRARIES(rspamc ${CMAKE_REQUIRED_LIBRARIES})
-TARGET_LINK_LIBRARIES(rspamc ${GLIB2_LIBRARIES})
-SET_TARGET_PROPERTIES(rspamc PROPERTIES VERSION ${RSPAMD_VERSION})
-
 IF(GLIB_COMPAT)
        TARGET_LINK_LIBRARIES(rspamc glibadditions)
 ENDIF(GLIB_COMPAT)
+TARGET_LINK_LIBRARIES(rspamc ${GLIB2_LIBRARIES})
+TARGET_LINK_LIBRARIES(rspamc ${CMAKE_REQUIRED_LIBRARIES})
+TARGET_LINK_LIBRARIES(rspamc m)
+SET_TARGET_PROPERTIES(rspamc PROPERTIES VERSION ${RSPAMD_VERSION})
 
 INSTALL(TARGETS rspamc RUNTIME DESTINATION bin)