|
@@ -8,15 +8,26 @@ include ../../Makefile.defs
|
|
|
auto_gen=
|
|
|
NAME=jsonrpc-c.so
|
|
|
LIBS=-lm
|
|
|
+JLIB=json
|
|
|
|
|
|
BUILDER = $(shell which pkg-config)
|
|
|
ifeq ($(BUILDER),)
|
|
|
- DEFS+=-I/usr/include/json -I$(LOCALBASE)/include/json \
|
|
|
+ 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.so)
|
|
|
+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 -levent -ljson
|
|
|
+ LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -levent -l$(JLIB)
|
|
|
else
|
|
|
- DEFS+= $(shell pkg-config --cflags json)
|
|
|
- LIBS+= $(shell pkg-config --libs json)
|
|
|
+ DEFS+= $(shell pkg-config --cflags $(JLIB))
|
|
|
+ LIBS+= $(shell pkg-config --libs $(JLIB))
|
|
|
DEFS+= $(shell pkg-config --cflags libevent)
|
|
|
LIBS+= $(shell pkg-config --libs libevent)
|
|
|
endif
|