Module: sip-router
Branch: master
Commit: 9909e05d46d0cdd22227b3b8c1b1d60253a135e2
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9909e05d46d0cdd22227b3b8c1b1d60253a135e2

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date:   Wed Oct  2 16:43:12 2013 +0200

memcached: use pkg-config if available for flags and libs in Makefile

---

 modules/memcached/Makefile |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/modules/memcached/Makefile b/modules/memcached/Makefile
index dcd68d3..916b6c0 100644
--- a/modules/memcached/Makefile
+++ b/modules/memcached/Makefile
@@ -6,9 +6,19 @@ include ../../Makefile.defs
 auto_gen=
 NAME=memcached.so
 
-DEFS+=-DKAMAILIO_MOD_INTERFACE
+ifeq ($(CROSS_COMPILE),)
+       BUILDER = $(shell which pkg-config)
+endif
+
+ifneq ($(BUILDER),)
+       DEFS += $(shell $(BUILDER) --cflags libmemcached)
+       LIBS += $(shell $(BUILDER) --libs libmemcached)
+else
+       DEFS +=-I$(LOCALBASE)/include -I$(SYSBASE)/include
+       LIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lmemcached
+endif
 
-DEFS +=-I$(LOCALBASE)/include -I$(SYSBASE)/include
-LIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lmemcached
+
+DEFS+=-DKAMAILIO_MOD_INTERFACE
 
 include ../../Makefile.modules


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to