Ver código fonte

ims_ipsec_pcscf: Makefile - use pkg-config to get compile flags for libmnl

- GH #1710
Daniel-Constantin Mierla 6 anos atrás
pai
commit
af7db21e40
1 arquivos alterados com 15 adições e 0 exclusões
  1. 15 0
      src/modules/ims_ipsec_pcscf/Makefile

+ 15 - 0
src/modules/ims_ipsec_pcscf/Makefile

@@ -8,10 +8,25 @@ include ../../Makefile.defs
 auto_gen=
 auto_gen=
 NAME=ims_ipsec_pcscf.so
 NAME=ims_ipsec_pcscf.so
 
 
+ifeq ($(CROSS_COMPILE),)
+	BUILDER = $(shell which pkg-config)
+ifneq ($(BUILDER),)
+	PKGLIBMNL = $(shell $(BUILDER) --exists libmnl > /dev/null 2>&1 ; echo $$? )
+ifneq ($(PKGLIBMNL),0)
+	BUILDER =
+endif
+endif
+endif
+
+ifneq ($(BUILDER),)
+	DEFS += $(shell $(BUILDER) --cflags libmnl)
+	LIBS += $(shell $(BUILDER) --libs libmnl)
+else
 ifneq ($(OS),darwin)
 ifneq ($(OS),darwin)
 	LIBS += -lpthread
 	LIBS += -lpthread
 	LIBS += -lmnl
 	LIBS += -lmnl
 endif
 endif
+endif
 
 
 SERLIBPATH=../../lib
 SERLIBPATH=../../lib
 SER_LIBS+=$(SERLIBPATH)/ims/kamailio_ims
 SER_LIBS+=$(SERLIBPATH)/ims/kamailio_ims