diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-13 16:42:03 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-13 16:42:03 +0300 |
commit | 22396e2aa40cef8434bda2f6c244741323020fbe (patch) | |
tree | c202aff028a98fe5839b531b566a20e075490c3d | |
parent | 835efda3d565d8541a31cc8116fb9c77d71cd0d8 (diff) | |
download | rspamd-22396e2aa40cef8434bda2f6c244741323020fbe.tar.gz rspamd-22396e2aa40cef8434bda2f6c244741323020fbe.zip |
Fix build with system-wide libhiredis.
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | config.h.in | 2 | ||||
-rw-r--r-- | src/lua/lua_redis.c | 8 |
3 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cca151f26..6bf8884a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,6 +344,9 @@ ENDIF(HIREDIS_INCLUDE_DIRS) IF(HIREDIS_LIBRARY_DIRS) LINK_DIRECTORIES("${HIREDIS_LIBRARY_DIRS}") ENDIF(HIREDIS_LIBRARY_DIRS) +IF(HIREDIS_FOUND) + SET(WITH_SYSTEM_HIREDIS 1) +ENDIF(HIREDIS_FOUND) # Try to link with gmime24 IF(NOT GMIME2_FOUND OR FORCE_GMIME24) diff --git a/config.h.in b/config.h.in index 1a781a171..999340f07 100644 --- a/config.h.in +++ b/config.h.in @@ -163,6 +163,8 @@ #cmakedefine WITH_GPERF_TOOLS 1 +#cmakedefine WITH_SYSTEM_HIREDIS 1 + #cmakedefine HAVE_ASM_PAUSE 1 #cmakedefine BUILD_STATIC 1 diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c index e4f1f996c..5b845108e 100644 --- a/src/lua/lua_redis.c +++ b/src/lua/lua_redis.c @@ -23,9 +23,17 @@ #include "lua_common.h" #include "dns.h" + +#ifndef WITH_SYSTEM_HIREDIS #include "hiredis.h" #include "async.h" #include "adapters/libevent.h" +#else +#include <hiredis/hiredis.h> +#include <hiredis/async.h> +#include <hiredis/adapters/libevent.h> +#endif + /** * Redis access API for lua from task object |