summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2013-04-30 01:15:04 -0700
committerTim Harder <radhermit@gmail.com>2013-04-30 01:15:04 -0700
commit273474986c16f98aa5ffde0393a68b2637d7531c (patch)
treeb3080e7bc162f99ef86ffd245799d77f4ce9dd45
parentb46bbfe2824a21e6dd832df22937355a627b1ccc (diff)
downloaddwb-273474986c16f98aa5ffde0393a68b2637d7531c.zip
Fix compile with >=json-c-0.11
-rw-r--r--config.mk12
-rw-r--r--src/util/Makefile2
2 files changed, 12 insertions, 2 deletions
diff --git a/config.mk b/config.mk
index ee37bb26..0dee4cc0 100644
--- a/config.mk
+++ b/config.mk
@@ -103,8 +103,18 @@ else
$(error Cannot find $(GNUTLS))
endif
+# >=json-c-0.11 renamed its library, pc file, and include dir
+# first check for >=0.11, if it doesn't exist check for <0.11
+ifeq ($(shell pkg-config --exists json-c && echo 1), 1)
+JSONC=json-c
+else
ifeq ($(shell pkg-config --exists json && echo 1), 1)
-LIBS+=$(GNUTLS)
+JSONC=json
+endif
+endif
+
+ifdef JSONC
+LIBS+=$(JSONC)
else
$(error Cannot find json-c)
endif
diff --git a/src/util/Makefile b/src/util/Makefile
index 6bc16dbe..05a4b0cf 100644
--- a/src/util/Makefile
+++ b/src/util/Makefile
@@ -14,7 +14,7 @@ HSTS_PRELOAD=$(BASE_DIR)/$(SRCDIR)/hsts_preload.h
TRANSPORT_SECURITY_JSON=transport_security_state_static.json
TRANSPORT_SECURITY_CERTS=transport_security_state_static.certs
-LIBS=glib-2.0 gnutls json
+LIBS=glib-2.0 gnutls $(JSONC)
CFLAGS+=$(shell pkg-config --cflags $(LIBS))
LDFLAGS=$(shell pkg-config --libs $(LIBS))