2
0
Эх сурвалжийг харах

lib/ims: fix cross compilation

Ovidiu Sas 12 жил өмнө
parent
commit
11cedccfbc
1 өөрчлөгдсөн 13 нэмэгдсэн , 3 устгасан
  1. 13 3
      lib/ims/Makefile

+ 13 - 3
lib/ims/Makefile

@@ -9,9 +9,19 @@ MAJOR_VER=0
 MINOR_VER=1
 BUGFIX_VER=0
 DEFS+=-DSER
-libxml2_includes=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
-					-I$(LOCALBASE)/include
-libxml2_libs=-L$(LOCALBASE)/lib -lxml2
+
+ifeq ($(CROSS_COMPILE),)
+XML2CFG=$(shell which xml2-config)
+endif
+
+ifneq ($(XML2CFG),)
+	libxml2_includes = $(shell $(XML2CFG) --cflags)
+	libxml2_libs = $(shell $(XML2CFG) --libs)
+else
+	libxml2_includes = -I$(LOCALBASE)/include/libxml2 -I$(LOCALBASE)/include
+	libxml2_libs = -L$(LOCALBASE)/lib -lxml2
+endif
+
 INCLUDES= -I$(CURDIR)/.. -I$(CURDIR)/../.. $(libxml2_includes) 
 LIBS=$(libxml2_libs)
 #SERLIBPATH=..