]> source.dussan.org Git - rspamd.git/commitdiff
Fix test build and shlibs depends.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Sat, 15 Dec 2012 10:41:15 +0000 (14:41 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Sat, 15 Dec 2012 10:41:15 +0000 (14:41 +0400)
CMakeLists.txt
lib/CMakeLists.txt
src/cfg_utils.c
src/lua/CMakeLists.txt
src/main.c

index e476b4461f4d11c82b93cf618bb7536184a95cb7..5f41f56bfa3be9a377adf370afbf2742845d4b44 100644 (file)
@@ -937,13 +937,6 @@ SET(RSPAMDSRC      src/modules.c
                                src/smtp_proxy.c
                                src/worker.c)
 
-SET(TOKENIZERSSRC  src/tokenizers/tokenizers.c
-                               src/tokenizers/osb.c)
-
-SET(CLASSIFIERSSRC src/classifiers/classifiers.c
-                src/classifiers/bayes.c
-                               src/classifiers/winnow.c)
-
 SET(PLUGINSSRC src/plugins/surbl.c
                                src/plugins/regexp.c
                                src/plugins/chartable.c
@@ -990,8 +983,7 @@ CONFIGURE_FILE(conf/rspamd-basic.xml.in conf/rspamd.xml.sample @ONLY)
 
 ######################### LINK SECTION ###############################
 
-ADD_EXECUTABLE(rspamd ${RSPAMDSRC} ${CONTRIBSRC} ${TOKENIZERSSRC} 
-                                         ${CLASSIFIERSSRC} ${PLUGINSSRC})
+ADD_EXECUTABLE(rspamd ${RSPAMDSRC} ${CONTRIBSRC} ${PLUGINSSRC})
 SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE C)
 SET_TARGET_PROPERTIES(rspamd PROPERTIES COMPILE_FLAGS "-DRSPAMD_MAIN")
 IF(NOT DEBIAN_BUILD)
index 9c1c36ea25d60d8e48327664d85af8abda5e6b3b..4f0ede5b800162f92c20ffa2211f911aaa06fd1c 100644 (file)
@@ -57,6 +57,13 @@ SET(LIBRSPAMDMIMESRC
                                ../src/smtp_utils.c
                                ../src/smtp_proto.c
                                ../src/worker_util.c)
+                               
+SET(TOKENIZERSSRC  ../src/tokenizers/tokenizers.c
+                               ../src/tokenizers/osb.c)
+
+SET(CLASSIFIERSSRC ../src/classifiers/classifiers.c
+                ../src/classifiers/bayes.c
+                               ../src/classifiers/winnow.c)
 # Add targets
 
 # Rspamdutil
@@ -134,7 +141,7 @@ IF(WITH_SQLITE)
        LIST(APPEND LIBRSPAMDSERVERSRC ../src/kvstorage_sqlite.c)
 ENDIF(WITH_SQLITE)
                                
-ADD_LIBRARY(rspamd-server ${LINK_TYPE} ${LIBRSPAMDSERVERSRC})
+ADD_LIBRARY(rspamd-server ${LINK_TYPE} ${LIBRSPAMDSERVERSRC} ${TOKENIZERSSRC} ${CLASSIFIERSSRC})
 IF(NOT DEBIAN_BUILD)
 SET_TARGET_PROPERTIES(rspamd-server PROPERTIES VERSION ${RSPAMD_VERSION})
 ENDIF(NOT DEBIAN_BUILD)
index 37f28c8223d49627bc8118aef6340194bfa0058e..ae0971d6a5977e49871645d7fd9d811d5bf34987 100644 (file)
@@ -578,56 +578,6 @@ substitute_all_variables (gpointer key, gpointer value, gpointer data)
        (void)substitute_variable (cfg, (gchar *)key, (gchar *)value, 1);
 }
 
-static void
-parse_filters_str (struct config_file *cfg, const gchar *str)
-{
-       gchar                         **strvec, **p;
-       struct filter                  *cur;
-       module_t                                          **pmodule;
-
-       if (str == NULL) {
-               return;
-       }
-
-       strvec = g_strsplit_set (str, ",", 0);
-       if (strvec == NULL) {
-               return;
-       }
-
-       p = strvec;
-       while (*p) {
-               cur = NULL;
-               /* Search modules from known C modules */
-               pmodule = &modules[0];
-               while (*pmodule) {
-                       g_strstrip (*p);
-                       if ((*pmodule)->name != NULL && g_ascii_strcasecmp ((*pmodule)->name, *p) == 0) {
-                               cur = memory_pool_alloc (cfg->cfg_pool, sizeof (struct filter));
-                               cur->type = C_FILTER;
-                               msg_debug ("found C filter %s", *p);
-                               cur->func_name = memory_pool_strdup (cfg->cfg_pool, *p);
-                               cur->module = (*pmodule);
-                               cfg->filters = g_list_prepend (cfg->filters, cur);
-
-                               break;
-                       }
-                       pmodule ++;
-               }
-               if (cur != NULL) {
-                       /* Go to next iteration */
-                       p++;
-                       continue;
-               }
-               cur = memory_pool_alloc (cfg->cfg_pool, sizeof (struct filter));
-               cur->type = PERL_FILTER;
-               cur->func_name = memory_pool_strdup (cfg->cfg_pool, *p);
-               cfg->filters = g_list_prepend (cfg->filters, cur);
-               p++;
-       }
-
-       g_strfreev (strvec);
-}
-
 /*
  * Place pointers to cfg_file structure to hash cfg_params
  */
@@ -697,7 +647,6 @@ post_load_config (struct config_file *cfg)
 
        g_hash_table_foreach (cfg->variables, substitute_all_variables, cfg);
        g_hash_table_foreach (cfg->modules_opts, substitute_module_variables, cfg);
-       parse_filters_str (cfg, cfg->filters_str);
        fill_cfg_params (cfg);
 
 #ifdef HAVE_CLOCK_GETTIME
index 10609f782f1b4a1d814bbf28cfbb7a278d5023e4..8d05c65e5b3a86af008edbd0d570ea38bd509e91 100644 (file)
@@ -19,6 +19,7 @@ SET(LUASRC                      lua_common.c
 ADD_LIBRARY(rspamd-lua ${LINK_TYPE} ${LUASRC})
 SET_TARGET_PROPERTIES(rspamd-lua PROPERTIES VERSION ${RSPAMD_VERSION})
 TARGET_LINK_LIBRARIES(rspamd-lua rspamd-util)
+TARGET_LINK_LIBRARIES(rspamd-lua hiredis)
 IF(ENABLE_LUAJIT MATCHES "ON")
        TARGET_LINK_LIBRARIES(rspamd-lua "${LUAJIT_LIBRARY}")
 ELSE(ENABLE_LUAJIT MATCHES "ON")
index d28672e83b0cd83af4e6433a12638bd2f08fbe3d..f85fe7ade11e5d462cc3f93a9f52059530033882 100644 (file)
@@ -300,6 +300,56 @@ config_logger (struct rspamd_main *rspamd, GQuark type, gboolean is_fatal)
        }
 }
 
+static void
+parse_filters_str (struct config_file *cfg, const gchar *str)
+{
+       gchar                         **strvec, **p;
+       struct filter                  *cur;
+       module_t                                          **pmodule;
+
+       if (str == NULL) {
+               return;
+       }
+
+       strvec = g_strsplit_set (str, ",", 0);
+       if (strvec == NULL) {
+               return;
+       }
+
+       p = strvec;
+       while (*p) {
+               cur = NULL;
+               /* Search modules from known C modules */
+               pmodule = &modules[0];
+               while (*pmodule) {
+                       g_strstrip (*p);
+                       if ((*pmodule)->name != NULL && g_ascii_strcasecmp ((*pmodule)->name, *p) == 0) {
+                               cur = memory_pool_alloc (cfg->cfg_pool, sizeof (struct filter));
+                               cur->type = C_FILTER;
+                               msg_debug ("found C filter %s", *p);
+                               cur->func_name = memory_pool_strdup (cfg->cfg_pool, *p);
+                               cur->module = (*pmodule);
+                               cfg->filters = g_list_prepend (cfg->filters, cur);
+
+                               break;
+                       }
+                       pmodule ++;
+               }
+               if (cur != NULL) {
+                       /* Go to next iteration */
+                       p++;
+                       continue;
+               }
+               cur = memory_pool_alloc (cfg->cfg_pool, sizeof (struct filter));
+               cur->type = PERL_FILTER;
+               cur->func_name = memory_pool_strdup (cfg->cfg_pool, *p);
+               cfg->filters = g_list_prepend (cfg->filters, cur);
+               p++;
+       }
+
+       g_strfreev (strvec);
+}
+
 static void
 reread_config (struct rspamd_main *rspamd)
 {
@@ -728,6 +778,7 @@ load_rspamd_config (struct config_file *cfg, gboolean init_modules)
 
        /* Do post-load actions */
        post_load_config (cfg);
+       parse_filters_str (cfg, cfg->filters_str);
        
        if (init_modules) {
                /* Init C modules */