Răsfoiți Sursa

db_redis: added hiredis-cluster detection

Riccardo Villa 3 ani în urmă
părinte
comite
f15c768ce8
1 a modificat fișierele cu 14 adăugiri și 0 ștergeri
  1. 14 0
      src/modules/db_redis/Makefile

+ 14 - 0
src/modules/db_redis/Makefile

@@ -10,6 +10,12 @@ HIREDIS_BUILDER = $(shell \
 	if pkg-config --exists hiredis; then \
 		echo 'pkg-config hiredis'; \
 	fi)
+
+HIREDIS_CLUSTER_BUILDER = $(shell \
+	if pkg-config --exists hiredis_cluster; then \
+		echo 'pkg-config hiredis_cluster'; \
+	fi)
+
 endif
 
 ifeq ($(HIREDIS_BUILDER),)
@@ -33,6 +39,14 @@ endif
 DEFS+=$(HIREDISDEFS)
 LIBS=$(HIREDISLIBS)
 
+ifneq ($(HIREDIS_CLUSTER_BUILDER),)
+	HIREDISCLUSTERDEFS = $(shell $(HIREDIS_CLUSTER_BUILDER) --cflags)
+	HIREDISCLUSTERLIBS = $(shell $(HIREDIS_CLUSTER_BUILDER) --libs)
+	DEFS+=-DWITH_HIREDIS_CLUSTER
+	DEFS+=$(HIREDISCLUSTERDEFS)
+	LIBS+=$(HIREDISCLUSTERLIBS)
+endif
+
 SERLIBPATH=../../lib
 SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1