From b1c9518a78dd347b44333291b1c6a03aad062166 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Thu, 22 Feb 2018 21:49:11 +0100 Subject: [PATCH] [-] Make json-c a required library Already kind of was required, as it was required by Spotify, Chromecast and the web api --- INSTALL | 6 +++--- configure.ac | 22 +++++++++------------- scripts/freebsd_install_11.0.sh | 4 ++-- src/httpd_jsonapi.c | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/INSTALL b/INSTALL index bc42fd06..4be9e456 100644 --- a/INSTALL +++ b/INSTALL @@ -72,7 +72,7 @@ sudo yum install \ git automake autoconf gettext-devel gperf gawk libtool \ sqlite-devel libconfuse-devel libunistring-devel mxml-devel libevent-devel \ avahi-devel libgcrypt-devel zlib-devel alsa-lib-devel ffmpeg-devel \ - libplist-devel libsodium-devel + libplist-devel libsodium-devel json-c-devel Clone the forked-daapd repo: @@ -125,7 +125,7 @@ Afterwards, you can optionally install Oracle's newer version, and then sudo port install \ autoconf automake libtool pkgconfig git gperf libgcrypt \ - libunistring libconfuse ffmpeg libevent + libunistring libconfuse ffmpeg libevent json-c Download, configure, build and install the Mini-XML library: http://www.msweet.org/projects.php/Mini-XML @@ -144,7 +144,7 @@ Optional features require the following additional ports: Feature | Configure argument | Ports --------------------|------------------------|-------------------------------------------- - Chromecast | --enable-chromecast | json-c gnutls protobuf-c + Chromecast | --enable-chromecast | gnutls protobuf-c LastFM | --enable-lastfm | curl iTunes XML | --disable-itunes | libplist Device verification | --disable-verification | libplist libsodium diff --git a/configure.ac b/configure.ac index fd8c90f3..68bbb577 100644 --- a/configure.ac +++ b/configure.ac @@ -144,6 +144,15 @@ FORK_MODULES_CHECK([FORKED], [LIBEVENT], [libevent >= 2], [Define to 1 if you have libevent 2 (<2.1.4)])]) ]) +dnl json-c version checks +FORK_MODULES_CHECK([FORKED], [JSON_C], [json-c], + [json_tokener_parse], [json.h], + [dnl check for old version + PKG_CHECK_EXISTS([json-c >= 0.11], [], + [AC_DEFINE([HAVE_JSON_C_OLD], 1, + [Define to 1 if you have json-c < 0.11])]) + ]) + dnl antlr version checks FORK_FUNC_REQUIRE([FORKED], [ANTLR3 C runtime], [ANTLR3C], [antlr3c], [antlr3BaseRecognizerNew], [antlr3.h], @@ -286,19 +295,6 @@ FORK_ARG_WITH_CHECK([FORKED_OPTS], [libevent_pthreads support], [libevent_pthreads], [LIBEVENT_PTHREADS], [libevent_pthreads], [evthread_use_pthreads], [event2/thread.h]) -dnl Build with json-c -FORK_ARG_WITH_CHECK([FORKED_OPTS], [json-c support], [json], [JSON_C], - [json-c >= 0.11], [json_tokener_parse], [json.h], [], - [FORK_MODULES_CHECK([FORKED_OPTS], [JSON_C], [json], - [json_tokener_parse], [json.h], - [[with_json=yes] - AC_DEFINE([HAVE_JSON_C_OLD], 1, - [Define to 1 if you have json-c < 0.11])], - [AS_IF([[test "x$with_json" != "xcheck"]], - [AC_MSG_FAILURE([[--with-json was given, but test for json-c failed]])]) - [with_json=no]] - )]) - dnl Build with Avahi (or Bonjour if not) FORK_ARG_WITH_CHECK([FORKED_OPTS], [Avahi mDNS], [avahi], [AVAHI], [avahi-client >= 0.6.24], [avahi_client_new], [avahi-client/client.h]) diff --git a/scripts/freebsd_install_11.0.sh b/scripts/freebsd_install_11.0.sh index 072e44dd..1207f523 100644 --- a/scripts/freebsd_install_11.0.sh +++ b/scripts/freebsd_install_11.0.sh @@ -2,7 +2,7 @@ # Credit thorsteneckel who made the how-to that is the basis for this # script, see https://gist.github.com/thorsteneckel/c0610fb415c8d0486bce -echo "This script will install forked-daapd in FreeBSD 10.1. The script is not" +echo "This script will install forked-daapd in FreeBSD 11.0. The script is not" echo "very polished, so you might want to look through it before running it." read -p "Continue? [y/N] " yn if [ "$yn" != "y" ]; then @@ -11,7 +11,7 @@ fi DEPS="gmake autoconf automake libtool gettext gperf glib pkgconf wget git \ ffmpeg libconfuse libevent mxml libgcrypt libunistring libiconv \ - libplist libinotify avahi sqlite3 alsa-lib libsodium" + libplist libinotify avahi sqlite3 alsa-lib libsodium json-c" echo "The script can install the following dependency packages for you:" echo $DEPS read -p "Should the script install these packages? [y/N] " yn diff --git a/src/httpd_jsonapi.c b/src/httpd_jsonapi.c index b0e561be..67ceb2e5 100644 --- a/src/httpd_jsonapi.c +++ b/src/httpd_jsonapi.c @@ -29,7 +29,7 @@ #ifdef HAVE_CONFIG_H # include #endif -#include + #include #include #include