Module: sip-router
Branch: master
Commit: 58bfbd3259587b29b7b509a360aa889924dec8de
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=58bfbd3…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: Sat Dec 1 23:18:47 2012 -0500
cpl-c: fix cross-compilation
---
modules_k/cpl-c/Makefile | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/modules_k/cpl-c/Makefile b/modules_k/cpl-c/Makefile
index 004e7b3..374a9fe 100644
--- a/modules_k/cpl-c/Makefile
+++ b/modules_k/cpl-c/Makefile
@@ -6,10 +6,18 @@ include ../../Makefile.defs
auto_gen=
NAME=cpl-c.so
-DEFS +=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
- -I$(LOCALBASE)/include # iconv.h
+ifeq ($(CROSS_COMPILE),)
+XML2CFG=$(shell which xml2-config)
+endif
-LIBS= -L$(LOCALBASE)/lib -lxml2
+ifneq ($(XML2CFG),)
+ DEFS += $(shell $(XML2CFG) --cflags )
+ LIBS += $(shell $(XML2CFG) --libs)
+else
+ DEFS +=-I$(LOCALBASE)/include/libxml2 \
+ -I$(LOCALBASE)/include # iconv.h
+ LIBS += -L$(LOCALBASE)/lib -lxml2
+endif
DEFS+=-DKAMAILIO_MOD_INTERFACE