Ver código fonte

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

Daniel-Constantin Mierla 14 anos atrás
pai
commit
3e502e2ac3
1 arquivos alterados com 14 adições e 3 exclusões
  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
 NAME=xcap_server.so
 LIBS=
 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
 DEFS+=-DOPENSER_MOD_INTERFACE