Browse code

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

Daniel-Constantin Mierla authored on 02/10/2013 14:43:12
Showing 1 changed files
... ...
@@ -6,9 +6,19 @@ include ../../Makefile.defs
6 6
 auto_gen=
7 7
 NAME=memcached.so
8 8
 
9
-DEFS+=-DKAMAILIO_MOD_INTERFACE
9
+ifeq ($(CROSS_COMPILE),)
10
+	BUILDER = $(shell which pkg-config)
11
+endif
12
+
13
+ifneq ($(BUILDER),)
14
+	DEFS += $(shell $(BUILDER) --cflags libmemcached)
15
+	LIBS += $(shell $(BUILDER) --libs libmemcached)
16
+else
17
+	DEFS +=-I$(LOCALBASE)/include -I$(SYSBASE)/include
18
+	LIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lmemcached
19
+endif
10 20
 
11
-DEFS +=-I$(LOCALBASE)/include -I$(SYSBASE)/include
12
-LIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lmemcached
21
+
22
+DEFS+=-DKAMAILIO_MOD_INTERFACE
13 23
 
14 24
 include ../../Makefile.modules