From patchwork Thu Feb 26 15:52:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Holland X-Patchwork-Id: 443976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C454F14008F for ; Fri, 27 Feb 2015 02:55:25 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id AEB4C28C675; Thu, 26 Feb 2015 16:54:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id BC93A28C671 for ; Thu, 26 Feb 2015 16:54:12 +0100 (CET) X-policyd-weight: using cached result; rate: -7.6 Received: from ducie-dc1.codethink.co.uk (ducie-dc1.codethink.co.uk [185.25.241.215]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 26 Feb 2015 16:54:12 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id 49304460991 for ; Thu, 26 Feb 2015 15:54:22 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p4OctcYVvoiL; Thu, 26 Feb 2015 15:54:19 +0000 (GMT) Received: from william.dyn.ducie.codethink.co.uk (william.dyn.ducie.codethink.co.uk [10.24.1.110]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPSA id E3F2A4606C1; Thu, 26 Feb 2015 15:54:18 +0000 (GMT) From: William Holland To: openwrt-devel@lists.openwrt.org Date: Thu, 26 Feb 2015 15:52:41 +0000 Message-Id: <1424965962-16298-2-git-send-email-william.holland@codethink.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1424965962-16298-1-git-send-email-william.holland@codethink.co.uk> References: <1424965962-16298-1-git-send-email-william.holland@codethink.co.uk> Subject: [OpenWrt-Devel] [PATCH 1/2] fix building with json-c.0.12 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" --- CMakeLists.txt | 7 +++++++ plug/hotplug.c | 6 +++++- service/validate.c | 6 +++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5414677..058d774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,13 @@ SET(SOURCES procd.c signal.c watchdog.c state.c inittab.c rcS.c ubus.c system.c service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c plug/coldplug.c plug/hotplug.c utils/utils.c) +INCLUDE(FindPkgConfig) +PKG_CHECK_MODULES(JSONC json-c) +IF(JSONC_FOUND) + ADD_DEFINITIONS(-DJSONC) + INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS}) +ENDIF() + find_library(json NAMES json-c json) SET(LIBS ubox ubus ${json} blobmsg_json json_script) diff --git a/plug/hotplug.c b/plug/hotplug.c index 061833a..3bf6253 100644 --- a/plug/hotplug.c +++ b/plug/hotplug.c @@ -22,7 +22,11 @@ #include #include #include -#include +#ifdef JSONC + #include +#else + #include +#endif #include #include diff --git a/service/validate.c b/service/validate.c index a33a48e..0e45493 100644 --- a/service/validate.c +++ b/service/validate.c @@ -13,7 +13,11 @@ #include #include -#include +#ifdef JSONC + #include +#else + #include +#endif #include "../procd.h"