Browse code

db_redis: added hiredis-cluster detection

Riccardo Villa authored on 05/01/2022 11:04:37 • Daniel-Constantin Mierla committed on 20/01/2022 11:30:22
Showing 1 changed files
... ...
@@ -10,6 +10,12 @@ HIREDIS_BUILDER = $(shell \
10 10
 	if pkg-config --exists hiredis; then \
11 11
 		echo 'pkg-config hiredis'; \
12 12
 	fi)
13
+
14
+HIREDIS_CLUSTER_BUILDER = $(shell \
15
+	if pkg-config --exists hiredis_cluster; then \
16
+		echo 'pkg-config hiredis_cluster'; \
17
+	fi)
18
+
13 19
 endif
14 20
 
15 21
 ifeq ($(HIREDIS_BUILDER),)
... ...
@@ -33,6 +39,14 @@ endif
33 39
 DEFS+=$(HIREDISDEFS)
34 40
 LIBS=$(HIREDISLIBS)
35 41
 
42
+ifneq ($(HIREDIS_CLUSTER_BUILDER),)
43
+	HIREDISCLUSTERDEFS = $(shell $(HIREDIS_CLUSTER_BUILDER) --cflags)
44
+	HIREDISCLUSTERLIBS = $(shell $(HIREDIS_CLUSTER_BUILDER) --libs)
45
+	DEFS+=-DWITH_HIREDIS_CLUSTER
46
+	DEFS+=$(HIREDISCLUSTERDEFS)
47
+	LIBS+=$(HIREDISCLUSTERLIBS)
48
+endif
49
+
36 50
 SERLIBPATH=../../lib
37 51
 SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1
38 52