aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-06-05 19:22:57 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-06-05 19:22:57 +0400
commit20c329815f2855d7c1356c3bbe26bddca20ac281 (patch)
tree9eede9a52174f7ab6dc4911cd7f86afffb37156f /src
parent35cb2b6e2f17a518d0c940985e6e19b41fdedf19 (diff)
downloadrspamd-20c329815f2855d7c1356c3bbe26bddca20ac281.tar.gz
rspamd-20c329815f2855d7c1356c3bbe26bddca20ac281.zip
Fix static build.
As there are too many changes from 0.4.7 mark this version as 0.5.0.
Diffstat (limited to 'src')
-rw-r--r--src/cdb/CMakeLists.txt2
-rw-r--r--src/client/CMakeLists.txt8
-rw-r--r--src/json/CMakeLists.txt2
-rw-r--r--src/logger.h10
-rw-r--r--src/lua/CMakeLists.txt2
-rw-r--r--src/printf.c17
-rw-r--r--src/printf.h1
7 files changed, 28 insertions, 14 deletions
diff --git a/src/cdb/CMakeLists.txt b/src/cdb/CMakeLists.txt
index ab7b8b57a..122ac4540 100644
--- a/src/cdb/CMakeLists.txt
+++ b/src/cdb/CMakeLists.txt
@@ -3,7 +3,7 @@ SET(CDBSRC cdb_init.c
cdb_find.c
cdb_make.c)
-ADD_LIBRARY(rspamd-cdb SHARED ${CDBSRC})
+ADD_LIBRARY(rspamd-cdb ${LINK_TYPE} ${CDBSRC})
SET_TARGET_PROPERTIES(rspamd-cdb PROPERTIES COMPILE_FLAGS "-DRSPAMD_LIB")
INSTALL(TARGETS rspamd-cdb
LIBRARY DESTINATION ${LIBDIR}
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index fe02d5e1b..0950fb49d 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -3,12 +3,8 @@ SET(RSPAMCSRC rspamc.c)
ADD_EXECUTABLE(rspamc ${RSPAMCSRC})
SET_TARGET_PROPERTIES(rspamc PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/lib")
-TARGET_LINK_LIBRARIES(rspamc rspamd-util)
-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 rspamd-server)
+TARGET_LINK_LIBRARIES(rspamc rspamdclient)
TARGET_LINK_LIBRARIES(rspamc pcre)
IF(GLIB_COMPAT)
TARGET_LINK_LIBRARIES(rspamc glibadditions)
diff --git a/src/json/CMakeLists.txt b/src/json/CMakeLists.txt
index ad8059269..fb3d88785 100644
--- a/src/json/CMakeLists.txt
+++ b/src/json/CMakeLists.txt
@@ -6,7 +6,7 @@ SET(JSONSRC dump.c
utf.c
value.c)
-ADD_LIBRARY(rspamd-json SHARED ${JSONSRC})
+ADD_LIBRARY(rspamd-json ${LINK_TYPE} ${JSONSRC})
SET_TARGET_PROPERTIES(rspamd-json PROPERTIES COMPILE_FLAGS "-DRSPAMD_LIB")
INSTALL(TARGETS rspamd-json
LIBRARY DESTINATION ${LIBDIR}
diff --git a/src/logger.h b/src/logger.h
index ec7a23af5..81dd9c1c4 100644
--- a/src/logger.h
+++ b/src/logger.h
@@ -90,11 +90,11 @@ void rspamd_log_nodebug (rspamd_logger_t *logger);
# define debug_task(...) rspamd_conditional_debug(rspamd_main->logger, task->from_addr.s_addr, __FUNCTION__, __VA_ARGS__)
#endif
#else
-#define msg_err(...) rspamd_fprintf(stderr, __VA_ARGS__)
-#define msg_warn(...) rspamd_fprintf(stderr, __VA_ARGS__)
-#define msg_info(...) rspamd_fprintf(stderr, __VA_ARGS__)
-#define msg_debug(...) rspamd_fprintf(stderr, __VA_ARGS__)
-#define debug_task(...) rspamd_fprintf(stderr, __VA_ARGS__)
+#define msg_err(...) rspamd_log_fprintf(stderr, __VA_ARGS__)
+#define msg_warn(...) rspamd_log_fprintf(stderr, __VA_ARGS__)
+#define msg_info(...) rspamd_log_fprintf(stderr, __VA_ARGS__)
+#define msg_debug(...) rspamd_log_fprintf(stderr, __VA_ARGS__)
+#define debug_task(...) rspamd_log_fprintf(stderr, __VA_ARGS__)
#endif
#endif
diff --git a/src/lua/CMakeLists.txt b/src/lua/CMakeLists.txt
index bdba01c27..a37731973 100644
--- a/src/lua/CMakeLists.txt
+++ b/src/lua/CMakeLists.txt
@@ -12,7 +12,7 @@ SET(LUASRC lua_common.c
lua_redis.c
lua_upstream.c)
-ADD_LIBRARY(rspamd-lua SHARED ${LUASRC})
+ADD_LIBRARY(rspamd-lua ${LINK_TYPE} ${LUASRC})
TARGET_LINK_LIBRARIES(rspamd-lua ${LUALIB})
SET_TARGET_PROPERTIES(rspamd-lua PROPERTIES COMPILE_FLAGS "-DRSPAMD_LIB")
INSTALL(TARGETS rspamd-lua
diff --git a/src/printf.c b/src/printf.c
index 3ab5be3df..07cf4367c 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -186,6 +186,23 @@ rspamd_fprintf (FILE *f, const gchar *fmt, ...)
}
gint
+rspamd_log_fprintf (FILE *f, const gchar *fmt, ...)
+{
+ va_list args;
+ gchar buf[BUFSIZ];
+ gint r;
+
+ va_start (args, fmt);
+ rspamd_vsnprintf (buf, sizeof (buf), fmt, args);
+ va_end (args);
+
+ r = fprintf (f, "%s\n", buf);
+ fflush (f);
+
+ return r;
+}
+
+gint
rspamd_sprintf (gchar *buf, const gchar *fmt, ...)
{
gchar *p;
diff --git a/src/printf.h b/src/printf.h
index 436ec3059..ff0422d17 100644
--- a/src/printf.h
+++ b/src/printf.h
@@ -56,6 +56,7 @@
*/
gint rspamd_sprintf (gchar *buf, const gchar *fmt, ...);
gint rspamd_fprintf (FILE *f, const gchar *fmt, ...);
+gint rspamd_log_fprintf (FILE *f, const gchar *fmt, ...);
gint rspamd_snprintf (gchar *buf, glong max, const gchar *fmt, ...);
gchar *rspamd_vsnprintf (gchar *buf, glong max, const gchar *fmt, va_list args);