[sr-dev] git:master:64d37971: xmlops: Makefile - try to use pkg-config if xml2-config is not found

Daniel-Constantin Mierla miconda at gmail.com
Wed Feb 12 20:57:22 CET 2020


Module: kamailio
Branch: master
Commit: 64d37971d2d3fbd87176fe71ae19adca7f47a6ea
URL: https://github.com/kamailio/kamailio/commit/64d37971d2d3fbd87176fe71ae19adca7f47a6ea

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-02-12T20:56:05+01:00

xmlops: Makefile - try to use pkg-config if xml2-config is not found

- GH #2199

---

Modified: src/modules/xmlops/Makefile

---

Diff:  https://github.com/kamailio/kamailio/commit/64d37971d2d3fbd87176fe71ae19adca7f47a6ea.diff
Patch: https://github.com/kamailio/kamailio/commit/64d37971d2d3fbd87176fe71ae19adca7f47a6ea.patch

---

diff --git a/src/modules/xmlops/Makefile b/src/modules/xmlops/Makefile
index d31550301b..1ac9539202 100644
--- a/src/modules/xmlops/Makefile
+++ b/src/modules/xmlops/Makefile
@@ -9,20 +9,22 @@ NAME=xmlops.so
 LIBS=
 
 ifeq ($(CROSS_COMPILE),)
-XML2CFG=$(shell which xml2-config)
+PKGCFGTOOL=$(shell which xml2-config)
+ifeq ($(PKGCFGTOOL),)
+PKGCFGTOOL=$(shell \
+	if pkg-config --exists libxml-2.0; then \
+		echo 'pkg-config libxml-2.0'; \
+	fi)
+endif
 endif
 
-ifneq ($(XML2CFG),)
-
-	DEFS += $(shell $(XML2CFG) --cflags )
-	LIBS += $(shell $(XML2CFG) --libs)
-
+ifneq ($(PKGCFGTOOL),)
+	DEFS += $(shell $(PKGCFGTOOL) --cflags )
+	LIBS += $(shell $(PKGCFGTOOL) --libs)
 else
-
 	DEFS+=-I$(LOCALBASE)/include/libxml2 \
 		-I$(LOCALBASE)/include
 	LIBS+=-L$(LOCALBASE)/lib -lxml2
-
 endif
 
 include ../../Makefile.modules




More information about the sr-dev mailing list