]> source.dussan.org Git - rspamd.git/commitdiff
Fix build with system-wide libhiredis.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 13 Dec 2011 13:42:03 +0000 (16:42 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 13 Dec 2011 13:42:03 +0000 (16:42 +0300)
CMakeLists.txt
config.h.in
src/lua/lua_redis.c

index cca151f26e2bbd5845b60359b6be33d9e3a35e19..6bf8884a80c30915515f2deb982d366af50e6c66 100644 (file)
@@ -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)
index 1a781a17193527b96ec8b95b3e23bee308f3cc42..999340f075c534c67ffd1710312fb7265a292c0a 100644 (file)
 
 #cmakedefine WITH_GPERF_TOOLS    1
 
+#cmakedefine WITH_SYSTEM_HIREDIS 1
+
 #cmakedefine HAVE_ASM_PAUSE      1
 
 #cmakedefine BUILD_STATIC        1
index e4f1f996c07f04d137f6f90860045ad0686c2aa0..5b845108e0057e20df1e8dd0fe013e6bd7d6712f 100644 (file)
 
 #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