Module: kamailio Branch: master Commit: f6346e93d27ee1eb6f06ec1c9e7247440f433ab9 URL: https://github.com/kamailio/kamailio/commit/f6346e93d27ee1eb6f06ec1c9e724744...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2018-02-08T19:19:29+01:00
pua_json: better detection of paths for json-c library
---
Modified: src/modules/pua_json/Makefile
---
Diff: https://github.com/kamailio/kamailio/commit/f6346e93d27ee1eb6f06ec1c9e724744... Patch: https://github.com/kamailio/kamailio/commit/f6346e93d27ee1eb6f06ec1c9e724744...
---
diff --git a/src/modules/pua_json/Makefile b/src/modules/pua_json/Makefile index cfbd69d6b5..a496b62584 100644 --- a/src/modules/pua_json/Makefile +++ b/src/modules/pua_json/Makefile @@ -8,9 +8,28 @@ include ../../Makefile.defs
auto_gen= NAME=pua_json.so +LIBS= +JLIB=json
-LIBS=-ljson-c -DEFS+=-I$(LOCALBASE)/include -I/usr/local/include $(shell pkg-config --cflags json-c) +BUILDER = $(shell which pkg-config) +ifeq ($(BUILDER),) + JSONC=$(shell ls $(SYSBASE)/include/lib/libjson*.so $(LOCALBASE)/lib/libjson*.so 2>/dev/null | grep json-c) +else + JSONC=$(shell pkg-config --libs json-c 2>/dev/null | grep json-c) +endif + +ifneq ($(JSONC),) + JLIB=json-c +endif + +ifeq ($(BUILDER),) + DEFS+=-I/usr/include/$(JLIB) -I$(LOCALBASE)/include/$(JLIB) \ + -I$(LOCALBASE)/include + LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -l$(JLIB) +else + DEFS+= $(shell pkg-config --cflags $(JLIB)) + LIBS+= $(shell pkg-config --libs $(JLIB)) +endif
DEFS+=-DKAMAILIO_MOD_INTERFACE