浏览代码

ims_registrar_pcscf: fic cross-compilation

Ovidiu Sas 12 年之前
父节点
当前提交
2c70b76e12
共有 1 个文件被更改,包括 12 次插入6 次删除
  1. 12 6
      modules/ims_registrar_pcscf/Makefile

+ 12 - 6
modules/ims_registrar_pcscf/Makefile

@@ -8,16 +8,22 @@
 include ../../Makefile.defs
 auto_gen=
 NAME=ims_registrar_pcscf.so
-LIBS=
 
-DEFS+=-DOPENSER_MOD_INTERFACE -I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2
-
-LIBS += -L$(LOCALBASE)/lib
+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