Pārlūkot izejas kodu

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

Daniel-Constantin Mierla 12 gadi atpakaļ
vecāks
revīzija
9909e05d46
1 mainītis faili ar 13 papildinājumiem un 3 dzēšanām
  1. 13 3
      modules/memcached/Makefile

+ 13 - 3
modules/memcached/Makefile

@@ -6,9 +6,19 @@ include ../../Makefile.defs
 auto_gen=
 auto_gen=
 NAME=memcached.so
 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
 include ../../Makefile.modules