Skip to content

Commit

Permalink
Makefile.json: change json library based on include
Browse files Browse the repository at this point in the history
if we are going to include json-c header, than we shall use the json-c
library, instead of json

(cherry picked from commit 0d981b8)
  • Loading branch information
razvancrainea committed Oct 2, 2019
1 parent e4ee178 commit 7d3344f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/json/Makefile.json
Expand Up @@ -7,26 +7,28 @@
ifeq ($(JSONPATH),)
ifneq ("$(wildcard /usr/include/json-c/json.h)","")
DEFS += -I/usr/include/json-c
JSONLIB = json-c
else
DEFS += -I/usr/include/json
JSONLIB = json
endif
else
DEFS += -I$(JSONPATH)
endif

ifeq ($(CROSS_COMPILE),)
JSON_BUILDER = $(shell \
if pkg-config --exists json; then \
if pkg-config --exists json 2> /dev/null; then \
echo 'pkg-config json'; \
elif pkg-config --exists json-c; then\
elif pkg-config --exists json-c 2> /dev/null; then\
echo 'pkg-config json-c'; \
fi)

endif

ifeq ($(JSON_BUILDER),)
DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include
LIBS += -L$(LOCALBASE)/lib -ljson
LIBS += -L$(LOCALBASE)/lib -l$(JSONLIB)
else
JSON_PKG_VER = $(shell $(JSON_BUILDER) --modversion)
JSON_PKG_MAJOR = $(shell \
Expand Down

0 comments on commit 7d3344f

Please sign in to comment.