Browse code

presence*: use xml2-config if available to detect libxml2 paths

Daniel-Constantin Mierla authored on 04/04/2012 10:16:01
Showing 3 changed files
... ...
@@ -6,9 +6,20 @@ auto_gen=
6 6
 NAME=presence.so
7 7
 LIBS=
8 8
 
9
-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
10
-      -I$(LOCALBASE)/include
11
-LIBS+=-L$(LOCALBASE)/lib -lxml2
9
+XML2CFG=$(shell which xml2-config)
10
+
11
+ifneq ($(XML2CFG),)
12
+
13
+	DEFS += $(shell $(XML2CFG) --cflags )
14
+	LIBS += $(shell $(XML2CFG) --libs)
15
+
16
+else
17
+
18
+	DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
19
+		-I$(LOCALBASE)/include
20
+	LIBS+=-L$(LOCALBASE)/lib -lxml2
21
+
22
+endif
12 23
 
13 24
 DEFS+=-DOPENSER_MOD_INTERFACE
14 25
 
... ...
@@ -4,9 +4,22 @@
4 4
 include ../../Makefile.defs
5 5
 auto_gen=
6 6
 NAME=presence_dialoginfo.so
7
-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
8
-      -I$(LOCALBASE)/include
9
-LIBS+=-L$(LOCALBASE)/lib -lxml2
7
+LIBS=
8
+
9
+XML2CFG=$(shell which xml2-config)
10
+
11
+ifneq ($(XML2CFG),)
12
+
13
+	DEFS += $(shell $(XML2CFG) --cflags )
14
+	LIBS += $(shell $(XML2CFG) --libs)
15
+
16
+else
17
+
18
+	DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
19
+		-I$(LOCALBASE)/include
20
+	LIBS+=-L$(LOCALBASE)/lib -lxml2
21
+
22
+endif
10 23
 
11 24
 DEFS+=-DOPENSER_MOD_INTERFACE
12 25
 
... ...
@@ -6,9 +6,20 @@ auto_gen=
6 6
 NAME=presence_xml.so
7 7
 LIBS=
8 8
 
9
-DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
10
-      -I$(LOCALBASE)/include
11
-LIBS+=-L$(LOCALBASE)/lib -lxml2
9
+XML2CFG=$(shell which xml2-config)
10
+
11
+ifneq ($(XML2CFG),)
12
+
13
+	DEFS += $(shell $(XML2CFG) --cflags )
14
+	LIBS += $(shell $(XML2CFG) --libs)
15
+
16
+else
17
+
18
+	DEFS+=-I/usr/include/libxml2 -I$(LOCALBASE)/include/libxml2 \
19
+		-I$(LOCALBASE)/include
20
+	LIBS+=-L$(LOCALBASE)/lib -lxml2
21
+
22
+endif
12 23
 
13 24
 DEFS+=-DOPENSER_MOD_INTERFACE
14 25