Module: sip-router
Branch: master
Commit: 60971500232b9fdcee1f399ef91a539c9974d9ac
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6097150…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Apr 4 12:16:01 2012 +0200
presence*: use xml2-config if available to detect libxml2 paths
---
modules_k/presence/Makefile | 17 ++++++++++++++---
modules_k/presence_dialoginfo/Makefile | 19 ++++++++++++++++---
modules_k/presence_xml/Makefile | 17 ++++++++++++++---
3 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/modules_k/presence/Makefile b/modules_k/presence/Makefile
index a5b5b43..6c01af3 100644
--- a/modules_k/presence/Makefile
+++ b/modules_k/presence/Makefile
@@ -6,9 +6,20 @@ auto_gen=
NAME=presence.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
diff --git a/modules_k/presence_dialoginfo/Makefile
b/modules_k/presence_dialoginfo/Makefile
index cf07373..06927a8 100644
--- a/modules_k/presence_dialoginfo/Makefile
+++ b/modules_k/presence_dialoginfo/Makefile
@@ -4,9 +4,22 @@
include ../../Makefile.defs
auto_gen=
NAME=presence_dialoginfo.so
-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
- -I$(LOCALBASE)/include
-LIBS+=-L$(LOCALBASE)/lib -lxml2
+LIBS=
+
+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
diff --git a/modules_k/presence_xml/Makefile b/modules_k/presence_xml/Makefile
index c675c4c..adbfb45 100644
--- a/modules_k/presence_xml/Makefile
+++ b/modules_k/presence_xml/Makefile
@@ -6,9 +6,20 @@ auto_gen=
NAME=presence_xml.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