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
 
Browse code

db_redis: Makefile comment updated to reference main Makefile

Daniel-Constantin Mierla authored on 02/11/2020 10:16:35
Showing 1 changed files
... ...
@@ -1,5 +1,5 @@
1 1
 #
2
-# WARNING: do not run this directly, it should be run by the master Makefile
2
+# WARNING: do not run this directly, it should be run by the main Makefile
3 3
 
4 4
 include ../../Makefile.defs
5 5
 auto_gen=
Browse code

db_redis: fix compilation on precise

Victor Seva authored on 28/09/2018 12:22:08
Showing 1 changed files
... ...
@@ -13,7 +13,7 @@ HIREDIS_BUILDER = $(shell \
13 13
 endif
14 14
 
15 15
 ifeq ($(HIREDIS_BUILDER),)
16
-	HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis
16
+	HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis -I/usr/include/hiredis
17 17
 	HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis
18 18
 else
19 19
 	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
Browse code

db_redis: updated to the new mod interface

Victor Seva authored on 28/09/2018 09:10:45
Showing 1 changed files
... ...
@@ -33,8 +33,6 @@ endif
33 33
 DEFS+=$(HIREDISDEFS)
34 34
 LIBS=$(HIREDISLIBS)
35 35
 
36
-DEFS+=-DKAMAILIO_MOD_INTERFACE
37
-
38 36
 SERLIBPATH=../../lib
39 37
 SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1
40 38
 
Browse code

db_redis: detect if pkg config for hiredis gives lib name in path

- try to cope with inconsistency of output for pkg-config --cflags in
older and newer debian/ubuntu distros

Daniel-Constantin Mierla authored on 26/09/2018 12:51:58
Showing 1 changed files
... ...
@@ -16,9 +16,13 @@ ifeq ($(HIREDIS_BUILDER),)
16 16
 	HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis
17 17
 	HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis
18 18
 else
19
-	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) -I/usr/include/hiredis
19
+	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
20 20
 	HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
21 21
 
22
+ifeq (,$(findstring hiredis,$(HIREDISDEFS)))
23
+	DEFS+=-DWITH_HIREDIS_PATH
24
+endif
25
+
22 26
 ifeq ($(HIREDISLIBS),-L -lhiredis)
23 27
 		HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) /opt/local/include
24 28
 		HIREDISLIBS = -L/opt/local/lib -lhiredis
Browse code

db_redis: Makefile - added -I/usr/include/hiredis for old distro

Daniel-Constantin Mierla authored on 25/09/2018 08:09:15
Showing 1 changed files
... ...
@@ -16,7 +16,7 @@ ifeq ($(HIREDIS_BUILDER),)
16 16
 	HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis
17 17
 	HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis
18 18
 else
19
-	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
19
+	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) -I/usr/include/hiredis
20 20
 	HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
21 21
 
22 22
 ifeq ($(HIREDISLIBS),-L -lhiredis)
Browse code

db_redis: updated include paths for pkg-config usage

Daniel-Constantin Mierla authored on 24/09/2018 17:59:23
Showing 1 changed files
... ...
@@ -13,7 +13,7 @@ HIREDIS_BUILDER = $(shell \
13 13
 endif
14 14
 
15 15
 ifeq ($(HIREDIS_BUILDER),)
16
-	HIREDISDEFS=-I$(LOCALBASE)/include
16
+	HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis
17 17
 	HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis
18 18
 else
19 19
 	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
Browse code

db_redis: Install redis schema along with module

Andreas Granig authored on 14/02/2018 14:36:13
Showing 1 changed files
... ...
@@ -35,3 +35,8 @@ SERLIBPATH=../../lib
35 35
 SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1
36 36
 
37 37
 include ../../Makefile.modules
38
+
39
+install-redis-scripts: $(bin_prefix)/$(bin_dir)
40
+	REDISON=yes $(MAKE) -C ../../../utils/kamctl/ install-modules
41
+
42
+install-scripts: install-redis-scripts
Browse code

db_redis: update to hiredis.h include path and deal with broken pkg-config spec

- fix for broken output of pkg-config for hiredis
- same for ndb_redis from 4a40dd39cec713c569dc3480c905d808026aad39

Daniel-Constantin Mierla authored on 14/02/2018 10:25:30
Showing 1 changed files
... ...
@@ -18,6 +18,12 @@ ifeq ($(HIREDIS_BUILDER),)
18 18
 else
19 19
 	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
20 20
 	HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
21
+
22
+ifeq ($(HIREDISLIBS),-L -lhiredis)
23
+		HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) /opt/local/include
24
+		HIREDISLIBS = -L/opt/local/lib -lhiredis
25
+endif
26
+
21 27
 endif
22 28
 
23 29
 DEFS+=$(HIREDISDEFS)
Browse code

db_redis: Implement db_redis generic db driver

This module implements a generic db driver for kamailio. It
requires a "schema" and "key" definition of "tables" and corresponding
keys for redis in the kamailio config file, otherwise it's supposed to
work with every module.

Implemented methods are query (w/o order-by), insert, update, delete.

Tested with usrloc and acc.

Andreas Granig authored on 07/02/2018 12:52:56
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,31 @@
1
+#
2
+# WARNING: do not run this directly, it should be run by the master Makefile
3
+
4
+include ../../Makefile.defs
5
+auto_gen=
6
+NAME=db_redis.so
7
+
8
+ifeq ($(CROSS_COMPILE),)
9
+HIREDIS_BUILDER = $(shell \
10
+	if pkg-config --exists hiredis; then \
11
+		echo 'pkg-config hiredis'; \
12
+	fi)
13
+endif
14
+
15
+ifeq ($(HIREDIS_BUILDER),)
16
+	HIREDISDEFS=-I$(LOCALBASE)/include
17
+	HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis
18
+else
19
+	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
20
+	HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
21
+endif
22
+
23
+DEFS+=$(HIREDISDEFS)
24
+LIBS=$(HIREDISLIBS)
25
+
26
+DEFS+=-DKAMAILIO_MOD_INTERFACE
27
+
28
+SERLIBPATH=../../lib
29
+SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1
30
+
31
+include ../../Makefile.modules