From: Vsevolod Stakhov Date: Tue, 13 Dec 2011 13:42:03 +0000 (+0300) Subject: Fix build with system-wide libhiredis. X-Git-Tag: 0.4.6~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=22396e2aa40cef8434bda2f6c244741323020fbe;p=rspamd.git Fix build with system-wide libhiredis. --- 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 +#include +#include +#endif + /** * Redis access API for lua from task object