aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-02 19:53:18 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-02 19:53:18 +0300
commite372eb2d479d2c9455099cd4a60ca173eb9b6971 (patch)
tree443981fb531821c5864cc795b000b263e95ae305
parent92db94f91b7c4b39859b4af251dd333ebbfbf748 (diff)
downloadrspamd-e372eb2d479d2c9455099cd4a60ca173eb9b6971.tar.gz
rspamd-e372eb2d479d2c9455099cd4a60ca173eb9b6971.zip
Fix static build.
-rw-r--r--CMakeLists.txt17
-rw-r--r--src/client/CMakeLists.txt14
2 files changed, 18 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed0cc130c..702775fe7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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 ##########################################
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index 37ca91043..a486f24d2 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -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)