Module: kamailio
Branch: master
Commit: 616689bf8b76d64e4b0eadd5a108fbcfa7e726a7
URL:
https://github.com/kamailio/kamailio/commit/616689bf8b76d64e4b0eadd5a108fbc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-09-26T14:51:58+02:00
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
---
Modified: src/modules/db_redis/Makefile
Modified: src/modules/db_redis/redis_connection.h
---
Diff:
https://github.com/kamailio/kamailio/commit/616689bf8b76d64e4b0eadd5a108fbc…
Patch:
https://github.com/kamailio/kamailio/commit/616689bf8b76d64e4b0eadd5a108fbc…
---
diff --git a/src/modules/db_redis/Makefile b/src/modules/db_redis/Makefile
index bf3b66e8fb..90770df35c 100644
--- a/src/modules/db_redis/Makefile
+++ b/src/modules/db_redis/Makefile
@@ -16,9 +16,13 @@ ifeq ($(HIREDIS_BUILDER),)
HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis
HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis
else
- HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) -I/usr/include/hiredis
+ HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
+ifeq (,$(findstring hiredis,$(HIREDISDEFS)))
+ DEFS+=-DWITH_HIREDIS_PATH
+endif
+
ifeq ($(HIREDISLIBS),-L -lhiredis)
HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) /opt/local/include
HIREDISLIBS = -L/opt/local/lib -lhiredis
diff --git a/src/modules/db_redis/redis_connection.h
b/src/modules/db_redis/redis_connection.h
index 11cadf5500..7b6a836b5e 100644
--- a/src/modules/db_redis/redis_connection.h
+++ b/src/modules/db_redis/redis_connection.h
@@ -23,7 +23,11 @@
#ifndef _REDIS_CONNECTION_H_
#define _REDIS_CONNECTION_H_
+#ifdef WITH_HIREDIS_PATH
+#include <hiredis/hiredis.h>
+#else
#include <hiredis.h>
+#endif
#include "db_redis_mod.h"