Kaynağa Gözat

utils: fix cross-compilation

Ovidiu Sas 12 yıl önce
ebeveyn
işleme
c4b91489ac
1 değiştirilmiş dosya ile 11 ekleme ve 2 silme
  1. 11 2
      modules/utils/Makefile

+ 11 - 2
modules/utils/Makefile

@@ -9,9 +9,18 @@ auto_gen=
 NAME=utils.so
 LIBS=
 
-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
+ifeq ($(CROSS_COMPILE),)
+XML2CFG=$(shell which xml2-config)
+endif
+
+ifneq ($(XML2CFG),)
+	DEFS += $(shell $(XML2CFG) --cflags )
+	LIBS += $(shell $(XML2CFG) --libs)
+else
+	DEFS+=-I$(LOCALBASE)/include/libxml2 \
       -I$(LOCALBASE)/include
-LIBS+=-L$(LOCALBASE)/lib -lcurl -lxml2
+	LIBS+=-L$(LOCALBASE)/lib -lcurl -lxml2
+endif
 
 DEFS+=-DKAMAILIO_MOD_INTERFACE