Browse Source

xcap_server: use xml2-config to get include and libs compile flags

Daniel-Constantin Mierla 14 years ago
parent
commit
3e502e2ac3
1 changed files with 14 additions and 3 deletions
  1. 14 3
      modules_k/xcap_server/Makefile

+ 14 - 3
modules_k/xcap_server/Makefile

@@ -10,9 +10,20 @@ auto_gen=
 NAME=xcap_server.so
 LIBS=
 
-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
-      -I$(LOCALBASE)/include
-LIBS+=-L$(LOCALBASE)/lib -lxml2
+XML2CFG=$(shell which xml2-config)
+
+ifneq ($(XML2CFG),)
+
+	DEFS += $(shell $(XML2CFG) --cflags)
+	LIBS += $(shell $(XML2CFG) --libs)
+
+else
+
+	DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
+		-I$(LOCALBASE)/include
+	LIBS+=-L$(LOCALBASE)/lib -lxml2
+
+endif
 
 DEFS+=-DOPENSER_MOD_INTERFACE