瀏覽代碼

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
 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
 include ../../Makefile.modules