Module: kamailio
Branch: master
Commit: 57bcad1b336e7aae5c0933a83ac4ab16f6893896
URL:
https://github.com/kamailio/kamailio/commit/57bcad1b336e7aae5c0933a83ac4ab1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-03-26T08:44:16+01:00
ndb_redis: use pkg-config for compile flags
---
Modified: modules/ndb_redis/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/57bcad1b336e7aae5c0933a83ac4ab1…
Patch:
https://github.com/kamailio/kamailio/commit/57bcad1b336e7aae5c0933a83ac4ab1…
---
diff --git a/modules/ndb_redis/Makefile b/modules/ndb_redis/Makefile
index 6e2d86b..524647d 100644
--- a/modules/ndb_redis/Makefile
+++ b/modules/ndb_redis/Makefile
@@ -5,8 +5,25 @@ include ../../Makefile.defs
auto_gen=
NAME=ndb_redis.so
-DEFS += -I/usr/local/include
-LIBS = -lhiredis
+ifeq ($(CROSS_COMPILE),)
+HIREDIS_BUILDER = $(shell \
+ if pkg-config --exists libcre; then \
+ echo 'pkg-config hiredis'; \
+ else \
+ which pcre-config; \
+ fi)
+endif
+
+ifeq ($(HIREDIS_BUILDER),)
+ HIREDISDEFS=-I$(LOCALBASE)/include
+ HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis
+else
+ HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
+ HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
+endif
+
+DEFS+=$(HIREDISDEFS)
+LIBS=$(HIREDISLIBS)
DEFS+=-DKAMAILIO_MOD_INTERFACE