Module: sip-router
Branch: master
Commit: 10ae1cb915a20680c36e141229aab1bc9fe85fc3
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=10ae1cb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Apr 29 12:01:24 2011 +0200
xmlops: use xml2-config to detect compile flags and libs
---
modules/xmlops/Makefile | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/modules/xmlops/Makefile b/modules/xmlops/Makefile
index ed49669..99b5d55 100644
--- a/modules/xmlops/Makefile
+++ b/modules/xmlops/Makefile
@@ -1,4 +1,3 @@
-# $Id$
#
# XML operations
#
@@ -10,9 +9,20 @@ auto_gen=
NAME=xmlops.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