Explorar o código

ims_auth: fix cross-compilation

Ovidiu Sas %!s(int64=12) %!d(string=hai) anos
pai
achega
5799a797c7
Modificáronse 1 ficheiros con 12 adicións e 7 borrados
  1. 12 7
      modules/ims_auth/Makefile

+ 12 - 7
modules/ims_auth/Makefile

@@ -8,17 +8,22 @@
 include ../../Makefile.defs
 auto_gen=
 NAME=ims_auth.so
-LIBS=
 
-DEFS+=-DOPENSER_MOD_INTERFACE
-
-DEFS += -I/usr/include/libxml2
-LIBS += -L$(LOCALBASE)/lib -lxml2
+ifeq ($(CROSS_COMPILE),)
+XML2CFG=$(shell which xml2-config)
+endif
 
-ifneq ($(OS),darwin)
-	LIBS += -lrt
+ifneq ($(XML2CFG),)
+	DEFS += $(shell $(XML2CFG) --cflags )
+	LIBS += $(shell $(XML2CFG) --libs)
+else
+	DEFS+=-I$(LOCALBASE)/include/libxml2 \
+		-I$(LOCALBASE)/include
+	LIBS+=-L$(LOCALBASE)/lib -lxml2
 endif
 
+DEFS+=-DOPENSER_MOD_INTERFACE
+
 SERLIBPATH=../../lib
 SER_LIBS+=$(SERLIBPATH)/kcore/kcore
 SER_LIBS+=$(SERLIBPATH)/ims/kamailio_ims