Commit 4d2d3b49 authored by Ondřej Surý's avatar Ondřej Surý

Cleanup the way we detect json-c library to use only pkg-config

parent d54f3f8b
......@@ -200,8 +200,10 @@ To support the HTTP statistics channel, the server must be linked with at
least one of the following: libxml2
[http://xmlsoft.org](http://xmlsoft.org) or json-c
[https://github.com/json-c](https://github.com/json-c). If these are
installed at a nonstandard location, specify the prefix using
`--with-libxml2=/prefix` or `--with-libjson=/prefix`.
installed at a nonstandard location, then:
* for libxml2, specify the prefix using `--with-libxml2=/prefix`,
* for json-c, adjust `PKG_CONFIG_PATH`.
To support compression on the HTTP statistics channel, the server must be
linked against libzlib. If this is installed in a nonstandard location,
......
......@@ -16,7 +16,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${NS_INCLUDES} ${BIND9_INCLUDES} ${DNS_INCLUDES} ${ISCCFG_INCLUDES} \
${ISC_INCLUDES} @OPENSSL_INCLUDES@
${ISC_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES = -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\"
CWARNINGS =
......@@ -34,8 +34,8 @@ ISCDEPLIBS = ../../lib/isc/libisc.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
NSDEPENDLIBS = ../../lib/ns/libns.@A@
LIBS = ${ISCLIBS} @LIBS@
NOSYMLIBS = ${ISCNOSYMLIBS} @LIBS@
LIBS = ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${ISCNOSYMLIBS} @JSON_C_LIBS@ @LIBS@
SUBDIRS =
......
......@@ -20,7 +20,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include ${ISC_INCLUDES} ${ISCCC_INCLUDES} \
${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES}
${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} @JSON_C_CFLAGS@
CDEFINES =
CWARNINGS =
......@@ -41,9 +41,9 @@ BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
RNDCLIBS = ${ISCCFGLIBS} ${ISCCCLIBS} ${BIND9LIBS} ${DNSLIBS} ${ISCLIBS} @LIBS@
RNDCDEPLIBS = ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${BIND9DEPLIBS} ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
LIBS = ${DNSLIBS} ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @LIBS@
NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @JSON_C_LIBS@ @LIBS@
CONFDEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
......
......@@ -16,7 +16,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} ${ISC_INCLUDES} \
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @OPENSSL_INCLUDES@
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES = -DVERSION=\"${VERSION}\" \
-DSYSCONFDIR=\"${sysconfdir}\"
......@@ -35,8 +35,8 @@ IRSDEPLIBS = ../../lib/irs/libirs.@A@
DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${ISCCFGDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @LIBS@
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCNOSYMLIBS} @LIBS@
LIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCNOSYMLIBS} @JSON_C_LIBS@ @LIBS@
SUBDIRS =
......
......@@ -19,7 +19,7 @@ READLINE_LIB = @READLINE_LIB@
CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} \
${BIND9_INCLUDES} ${ISC_INCLUDES} \
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ @OPENSSL_INCLUDES@
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES = -DVERSION=\"${VERSION}\"
CWARNINGS =
......@@ -41,10 +41,10 @@ DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${BIND9DEPLIBS} \
${ISCDEPLIBS} ${ISCCFGDEPLIBS}
LIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \
${ISCLIBS} @LIBIDN2_LIBS@ @LIBS@
${ISCLIBS} @LIBIDN2_LIBS@ @JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \
${ISCNOSYMLIBS} @LIBIDN2_LIBS@ @LIBS@
${ISCNOSYMLIBS} @LIBIDN2_LIBS@ @JSON_C_LIBS@ @LIBS@
SUBDIRS =
......
......@@ -15,7 +15,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES = -DVERSION=\"${VERSION}\"
CWARNINGS =
......@@ -29,9 +29,9 @@ ISCDEPLIBS = ../../lib/isc/libisc.@A@
DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
LIBS = ${DNSLIBS} ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @LIBS@
NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @JSON_C_LIBS@ @LIBS@
# Alphabetically
TARGETS = dnssec-cds@EXEEXT@ dnssec-dsfromkey@EXEEXT@ \
......
......@@ -46,7 +46,7 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \
${NS_INCLUDES} ${DNS_INCLUDES} \
${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \
${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \
${DBDRIVER_INCLUDES} @OPENSSL_INCLUDES@
${DBDRIVER_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES = @CONTRIB_DLZ@
......@@ -73,12 +73,12 @@ DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \
LIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \
${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} \
${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBCAP_LIBS@ \
@LIBS@
@JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \
${ISCCFGLIBS} ${ISCCCLIBS} ${ISCNOSYMLIBS} \
${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBCAP_LIBS@ \
@LIBS@
@JSON_C_LIBS@ @LIBS@
SUBDIRS = unix
......
......@@ -526,10 +526,10 @@ OPENSSL_VERSION_NUMBER >= 0x10100000L /* 1.1.0 or higher */
printf("linked to libxml2 version: %s\n",
xmlParserVersion);
#endif
#if defined(HAVE_JSON) && defined(JSON_C_VERSION)
printf("compiled with libjson-c version: %s\n",
#if defined(HAVE_JSON_C)
printf("compiled with json-c version: %s\n",
JSON_C_VERSION);
printf("linked to libjson-c version: %s\n",
printf("linked to json-c version: %s\n",
json_c_version());
#endif
#if defined(HAVE_ZLIB) && defined(ZLIB_VERSION)
......@@ -1092,13 +1092,13 @@ setup(void) {
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"linked to libxml2 version: %s", xmlParserVersion);
#endif
#if defined(HAVE_JSON) && defined(JSON_C_VERSION)
#if defined(HAVE_JSON_C)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"compiled with libjson-c version: %s", JSON_C_VERSION);
"compiled with json-c version: %s", JSON_C_VERSION);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"linked to libjson-c version: %s", json_c_version());
"linked to json-c version: %s", json_c_version());
#endif
#if defined(HAVE_ZLIB) && defined(ZLIB_VERSION)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
......
......@@ -74,7 +74,7 @@ stats_dumparg {
static isc_once_t once = ISC_ONCE_INIT;
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON)
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON_C)
#define EXTENDED_STATS
#else
#undef EXTENDED_STATS
......@@ -1070,7 +1070,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
json_object *job, *cat, *counter;
#endif
......@@ -1086,7 +1086,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
memset(values, 0, sizeof(values[0]) * ncounters);
isc_stats_dump(stats, generalstat_dump, &dumparg, options);
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
cat = job = (json_object *) arg;
if (ncounters > 0 && type == isc_statsformat_json) {
if (category != NULL) {
......@@ -1161,7 +1161,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
counter = json_object_new_int64(value);
if (counter == NULL)
return (ISC_R_NOMEMORY);
......@@ -1190,7 +1190,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
json_object *zoneobj, *obj;
#endif
......@@ -1224,7 +1224,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
zoneobj = (json_object *) dumparg->arg;
obj = json_object_new_int64(val);
if (obj == NULL)
......@@ -1256,7 +1256,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
json_object *zoneobj, *obj;
char buf[1024];
#endif
......@@ -1308,7 +1308,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
zoneobj = (json_object *) dumparg->arg;
snprintf(buf, sizeof(buf), "%s%s%s",
stale ? "#" : "", nxrrset ? "!" : "", typestr);
......@@ -1340,7 +1340,7 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
json_object *zoneobj, *obj;
#endif
......@@ -1366,7 +1366,7 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
zoneobj = (json_object *) dumparg->arg;
obj = json_object_new_int64(val);
if (obj == NULL)
......@@ -1397,7 +1397,7 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
json_object *zoneobj, *obj;
#endif
......@@ -1423,7 +1423,7 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
zoneobj = (json_object *) dumparg->arg;
obj = json_object_new_int64(val);
if (obj == NULL)
......@@ -2195,7 +2195,7 @@ render_xml_traffic(const char *url, isc_httpdurl_t *urlinfo,
#endif /* HAVE_LIBXML2 */
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
/*
* Which statistics to include when rendering to JSON
*/
......@@ -3098,7 +3098,7 @@ render_json_traffic(const char *url, isc_httpdurl_t *urlinfo,
freecb, freecb_args));
}
#endif /* HAVE_JSON */
#endif /* HAVE_JSON_C */
static isc_result_t
render_xsl(const char *url, isc_httpdurl_t *urlinfo,
......@@ -3314,7 +3314,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/traffic",
render_xml_traffic, server);
#endif
#ifdef HAVE_JSON
#ifdef HAVE_JSON_C
isc_httpdmgr_addurl(listener->httpdmgr, "/json",
render_json_all, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1",
......@@ -3449,12 +3449,12 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
"statistics-channels: XML library missing, "
"only JSON stats will be available");
#endif /* !HAVE_LIBXML2 */
#ifndef HAVE_JSON
#ifndef HAVE_JSON_C
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"statistics-channels: JSON library missing, "
"only XML stats will be available");
#endif /* !HAVE_JSON */
#endif /* !HAVE_JSON_C */
#endif /* EXTENDED_STATS */
for (element = cfg_list_first(statschannellist);
......
......@@ -15,7 +15,7 @@ top_srcdir = @top_srcdir@
CINCLUDES = -I${srcdir}/include -I${srcdir}/../include \
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \
${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@
${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES =
CWARNINGS =
......
......@@ -21,7 +21,7 @@ DST_GSSAPI_INC = @DST_GSSAPI_INC@
CINCLUDES = ${DNS_INCLUDES} ${BIND9_INCLUDES} ${ISC_INCLUDES} \
${ISCCFG_INCLUDES} ${IRS_INCLUDES} ${DST_GSSAPI_INC} \
@OPENSSL_INCLUDES@
@OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES = -DVERSION=\"${VERSION}\" @USE_GSSAPI@
CWARNINGS =
......@@ -43,10 +43,10 @@ DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${BIND9DEPLIBS} \
${ISCDEPLIBS} ${ISCCFGDEPLIBS}
LIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} \
${ISCCFGLIBS} ${ISCLIBS} @LIBS@
${ISCCFGLIBS} ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} \
${ISCCFGLIBS} ${ISCNOSYMLIBS} @LIBS@
${ISCCFGLIBS} ${ISCNOSYMLIBS} @JSON_C_LIBS@ @LIBS@
SUBDIRS =
......
......@@ -13,7 +13,7 @@ top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${ISC_INCLUDES}
CINCLUDES = ${ISC_INCLUDES} @JSON_C_CFLAGS@
CDEFINES =
......@@ -24,7 +24,7 @@ ISCDEPLIBS = ../../lib/isc/libisc.@A@
DEPLIBS = ${ISCDEPLIBS}
# if FORCE_STATIC_PROVIDER: LIBS += ${PROVIDER}
LIBS = ${ISCLIBS} @LIBS@
LIBS = ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
SUBDIRS = benchmarks
......
......@@ -15,7 +15,7 @@ top_srcdir = @top_srcdir@
CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \
${NS_INCLUDES} ${DNS_INCLUDES} \
${ISCCFG_INCLUDES} ${ISC_INCLUDES}
${ISCCFG_INCLUDES} ${ISC_INCLUDES} @JSON_C_CFLAGS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
......
......@@ -16,7 +16,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include ${ISC_INCLUDES} ${ISCCC_INCLUDES} \
${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES}
${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} @JSON_C_CFLAGS@
CDEFINES =
CWARNINGS =
......@@ -34,8 +34,8 @@ ISCDEPLIBS = ../../lib/isc/libisc.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
LIBS = ${ISCLIBS} @LIBS@
NOSYMLIBS = ${ISCNOSYMLIBS} @LIBS@
LIBS = ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${ISCNOSYMLIBS} @JSON_C_LIBS@ @LIBS@
RNDCDEPLIBS = ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${BIND9DEPLIBS} ${DNSDEPLIBS} ${ISCDEPLIBS}
......
......@@ -14,7 +14,7 @@ top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \
@OPENSSL_INCLUDES@
@OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES =
CWARNINGS =
......@@ -30,7 +30,7 @@ ISCDEPLIBS = ../../lib/isc/libisc.@A@
ISCDEPNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
LIBS = @LIBS@
LIBS = @JSON_C_LIBS@ @LIBS@
SUBDIRS = system @PKCS11_TOOLS@
TESTDIRS = system
......
......@@ -14,7 +14,7 @@ top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \
@OPENSSL_INCLUDES@ @DST_GSSAPI_INC@
@OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ @JSON_C_CFLAGS@
CDEFINES = @USE_GSSAPI@
......@@ -32,7 +32,7 @@ ISCDEPLIBS = ../../../lib/isc/libisc.@A@
ISCDEPNOSYMLIBS = ../../../lib/isc/libisc-nosymtbl.@A@
ISCCFGDEPLIBS = ../../../lib/isccfg/libisccfg.@A@
LIBS = @LIBS@
LIBS = @JSON_C_LIBS@ @LIBS@
SUBDIRS =
......
......@@ -112,6 +112,7 @@ PYTHON=@PYTHON@
# Determine if we support various optional features.
#
HAVEXMLSTATS=@XMLSTATS@
HAVEJSONSTATS=@JSONSTATS@
JSON_C_LIBS="@JSON_C_LIBS@"
HAVEJSONSTATS=${JSON_C_LIBS:+1}
ZLIB=@ZLIB@
NZD=@NZD_TOOLS@
......@@ -13,7 +13,7 @@ top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES =
CWARNINGS =
......
......@@ -15,7 +15,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES =
CWARNINGS =
......@@ -28,7 +28,7 @@ ISCDEPLIBS = ../../../../lib/isc/libisc.@A@
DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
LIBS = ${DNSLIBS} ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
TARGETS = pipequeries@EXEEXT@
......
......@@ -15,7 +15,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES =
CWARNINGS =
......@@ -28,7 +28,7 @@ ISCDEPLIBS = ../../../../lib/isc/libisc.@A@
DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
LIBS = ${DNSLIBS} ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
TARGETS = bigkey@EXEEXT@
......
......@@ -15,7 +15,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES =
CWARNINGS =
......@@ -28,7 +28,7 @@ ISCDEPLIBS = ../../../../lib/isc/libisc.@A@
DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
LIBS = ${DNSLIBS} ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
TARGETS = keycreate@EXEEXT@ keydelete@EXEEXT@
......
......@@ -16,7 +16,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \
${BIND9_INCLUDES} @OPENSSL_INCLUDES@
${BIND9_INCLUDES} @OPENSSL_INCLUDES@ @JSON_C_CFLAGS@
CDEFINES = -DVERSION=\"${VERSION}\"
CWARNINGS =
......@@ -32,8 +32,8 @@ BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
LIBS = ${ISCLIBS} @LIBS@
NOSYMLIBS = ${ISCNOSYMLIBS} @LIBS@
LIBS = ${ISCLIBS} @JSON_C_LIBS@ @LIBS@
NOSYMLIBS = ${ISCNOSYMLIBS} @JSON_C_LIBS@ @LIBS@
SUBDIRS =
......
......@@ -222,10 +222,7 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if libjson was found */
#undef HAVE_JSON
/* Define if json-c was found */
/* Use json-c library */
#undef HAVE_JSON_C
/* Define to 1 if you have the <kerberosv5/krb5.h> header file. */
......
......@@ -726,7 +726,8 @@ MKDEPPROG
MKDEPCFLAGS
MKDEPCC
ZLIB
JSONSTATS
JSON_C_LIBS
JSON_C_CFLAGS
XMLSTATS
NZDTARGETS
NZDSRCS
......@@ -908,6 +909,7 @@ with_gssapi
with_lmdb
with_libxml2
with_libjson
with_json_c
with_zlib
with_purify
with_gperftools_profiler
......@@ -958,6 +960,8 @@ PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
OPENSSL_CFLAGS
OPENSSL_LIBS
JSON_C_CFLAGS
JSON_C_LIBS
LIBIDN2_CFLAGS
LIBIDN2_LIBS
CMOCKA_CFLAGS
......@@ -1642,7 +1646,9 @@ Optional Packages:
[default=auto]
--with-lmdb=PATH build with LMDB library [yes|no|path]
--with-libxml2=PATH build with libxml2 library [yes|no|path]
--with-libjson=PATH build with libjson0 library [yes|no|path]
--with-libjson deprecated, use --with-json-c
--with-json-c build with json-c library [yes|no|detect] (default
is detect)
--with-zlib=PATH build with zlib for HTTP compression [default=yes]
--with-purify=PATH use Rational purify
--with-gperftools-profiler
......@@ -1696,6 +1702,9 @@ Some influential environment variables:
C compiler flags for OPENSSL, overriding pkg-config
OPENSSL_LIBS
linker flags for OPENSSL, overriding pkg-config
JSON_C_CFLAGS
C compiler flags for JSON_C, overriding pkg-config
JSON_C_LIBS linker flags for JSON_C, overriding pkg-config
LIBIDN2_CFLAGS
C compiler flags for LIBIDN2, overriding pkg-config
LIBIDN2_LIBS
......@@ -16948,151 +16957,210 @@ fi
#
# was --with-libjson specified?
# DEPRECATED
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for json library" >&5
$as_echo_n "checking for json library... " >&6; }
# Check whether --with-libjson was given.
if test "${with_libjson+set}" = set; then :
withval=$with_libjson; use_libjson="$withval"
withval=$with_libjson; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libjson is DEPRECATED and will be removed in a future release, use --with-json-c instead" >&5
$as_echo "$as_me: WARNING: --with-libjson is DEPRECATED and will be removed in a future release, use --with-json-c instead" >&2;}
else
use_libjson="auto"
with_libjson="detect"
fi
have_libjson=""
have_libjson_c=""
case "$use_libjson" in
no)
libjson_libs=""
;;
auto|yes)
for d in /usr /usr/local /opt/local
do
if test -f "${d}/include/json/json.h"
then
if test ${d} != /usr
then
libjson_cflags="-I ${d}/include"
LIBS="$LIBS -L${d}/lib"
fi
have_libjson="yes"
elif test -f "${d}/include/json-c/json.h"
then
if test ${d} != /usr
then
libjson_cflags="-I ${d}/include"
LIBS="$LIBS -L${d}/lib"
fi
have_libjson="yes"
have_libjson_c="yes"
fi
done
;;
*)
if test -f "${use_libjson}/include/json/json.h"
then
libjson_cflags="-I${use_libjson}/include"
LIBS="$LIBS -L${use_libjson}/lib"
have_libjson="yes"
elif test -f "${use_libjson}/include/json-c/json.h"
then
libjson_cflags="-I${use_libjson}/include"
LIBS="$LIBS -L${use_libjson}/lib"
have_libjson="yes"
have_libjson_c="yes"
else
as_fn_error $? "$use_libjson/include/json{,-c}/json.h not found." "$LINENO" 5
fi
;;
esac
#
# was --with-json-c specified?
#
if test "X${have_libjson}" != "X"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing json_object_new_int64" >&5