فهرست منبع

cdp: fix cross-compilation

Ovidiu Sas 12 سال پیش
والد
کامیت
8321d1fadb
1فایلهای تغییر یافته به همراه12 افزوده شده و 2 حذف شده
  1. 12 2
      modules/cdp/Makefile

+ 12 - 2
modules/cdp/Makefile

@@ -4,9 +4,19 @@ NAME=cdp.so
 
 DEFS+=-DSER_MOD_INTERFACE
 
+ifeq ($(CROSS_COMPILE),)
+XML2CFG=$(shell which xml2-config)
+endif
 
-DEFS += -I/usr/include/libxml2 
-LIBS += -L$(LOCALBASE)/lib -lxml2 -lrt
+ifneq ($(XML2CFG),)
+	DEFS += $(shell $(XML2CFG) --cflags )
+	LIBS += $(shell $(XML2CFG) --libs)
+	LIBS += -lrt
+else
+	INCLUDES +=-I$(LOCALBASE)/include/libxml2 \
+		-I$(LOCALBASE)/include
+	LIBS += -L$(LOCALBASE)/lib -lxml2 -lrt
+endif
 
 include ../../Makefile.modules