[sr-dev] git:master:a04755ad: jansson: test if pkg-config knows about jansson library

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 1 14:16:21 CEST 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-09-01T14:15:51+02:00

jansson: test if pkg-config knows about jansson library

---

Modified: modules/jansson/Makefile

---

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

---

diff --git a/modules/jansson/Makefile b/modules/jansson/Makefile
index 2d033a4..7680f71 100644
--- a/modules/jansson/Makefile
+++ b/modules/jansson/Makefile
@@ -1,21 +1,28 @@
 #
 # jansson module makefile
 #
-# 
+#
 # WARNING: do not run this directly, it should be run by the master Makefile
 
 include ../../Makefile.defs
 auto_gen=
 NAME=jansson.so
 
-BUILDER = $(shell which pkg-config)
-ifeq ($(BUILDER),)
-	DEFS+=-I$(LOCALBASE)/include \
-	LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -ljansson
+ifeq ($(CROSS_COMPILE),)
+JNS_BUILDER=$(shell \
+	if pkg-config --exists jansson; then \
+		echo 'pkg-config jansson'; \
+	fi)
+endif
+
+ifneq ($(JNS_BUILDER),)
+	DEFS += $(shell $(JNS_BUILDER) --cflags)
+	LIBS += $(shell $(JNS_BUILDER) --libs)
 else
-	DEFS+= $(shell pkg-config --cflags jansson)
-	LIBS+= $(shell pkg-config --libs jansson)
+	DEFS+=-I$(LOCALBASE)/include
+	LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -ljansson
 endif
+
 DEFS+=-DOPENSER_MOD_INTERFACE
 
 SERLIBPATH=../../lib




More information about the sr-dev mailing list