Skip to content

Commit

Permalink
pua_json: better detection of paths for json-c library
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Feb 8, 2018
1 parent 75c4ca0 commit f6346e9
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/modules/pua_json/Makefile
Expand Up @@ -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

Expand Down

0 comments on commit f6346e9

Please sign in to comment.