From patchwork Sun Sep 25 14:11:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 674616 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3shpvT1PYgz9s9Y for ; Mon, 26 Sep 2016 00:12:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=embedded.rocks header.i=@embedded.rocks header.b=fEgxgIUO; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 401B78AF33; Sun, 25 Sep 2016 14:12:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3FqVHuPtgU1T; Sun, 25 Sep 2016 14:12:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id B7DED8AE41; Sun, 25 Sep 2016 14:12:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 7AF211C2BF8 for ; Sun, 25 Sep 2016 14:12:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 75EBD31461 for ; Sun, 25 Sep 2016 14:12:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3ZuqjiqkJ4xU for ; Sun, 25 Sep 2016 14:12:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by silver.osuosl.org (Postfix) with ESMTPS id DF5EA30141 for ; Sun, 25 Sep 2016 14:12:11 +0000 (UTC) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3shpv70XWZz1016 for ; Sun, 25 Sep 2016 16:11:58 +0200 (CEST) Authentication-Results: mail.embedded.rocks (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=embedded.rocks DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded.rocks; h=content-transfer-encoding:content-type:content-type :mime-version:x-mailer:message-id:date:date:subject:subject:from :from:received:received; s=default; t=1474812717; x=1475417518; bh=y6pEC0hY9FlOAGgk60sxBF80jUrQf9jEwNuYLGXc4NE=; b=fEgxgIUO4Pap PN2FzZft/9sZBv5n05OBYKg20lXz2yldhsjRcTjXDOKlEPYa9h8Q567Cxu3VDlvw QI5Yf8tw9+dOT8FplSFGMZ0rWJb3vJAubeMMD5Yu9ohclNO5QcokGElLltij55gk jMT5uDsksJSmjQh7Os5uHP9+vy12OAdg2nhMXsPX8hHYR2sNBYvwB03JC+3sPVFe NZIj31mjxJt+e51LhvoSeRXkLtjEudfhXCjW8pCZI+d9wGRI95q15mTb+w4JQKQ4 tOFijE1q9hp/nqVESYNfhkZLvOJP11JMb3i5jErV8f64+PT54NJTjGkOS2/U4eMD YTOerUgUkA== Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id RrVZlRGbjeaU; Sun, 25 Sep 2016 16:11:57 +0200 (CEST) Received: from nzxt.fritz.box (x4d0cd166.dyn.telefonica.de [77.12.209.102]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Sun, 25 Sep 2016 16:11:57 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Sun, 25 Sep 2016 16:11:52 +0200 Message-Id: <20160925141152.13952-1-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.10.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] package/upmpdcli: add patch to fix error not detecting jsoncpp X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: http://autobuild.buildroot.net/results/205463c9ea8651911972c2835e28ded1912c811a http://autobuild.buildroot.net/results/5e9279ee60c11a3dacacf6d78f87f8d1b92968f5 http://autobuild.buildroot.net/results/97043f8defd5a59ae39b4c7f095a10d15c7fe632 http://autobuild.buildroot.net/results/e775126d5939093289b1a833dd6323ac293322ed .. and many more. libmpdclient, libmicrohttpd and jsoncpp provide a .pc file. Use pkg-config for detecting the libraries and for providing the necessary details for compiling and linking. The current build system of upmpdcli does not use PKG_CHECK_MODULES, but AC_LINK_IFELSE to detect jsoncpp. After bumping jsoncpp version from 1.7.2 to 1.7.5 the detection fails, because the test program does not compile anymore: """ In file included from /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/autolink.h:9:0, from /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/json.h:9, from test.c:1: /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/config.h:155:9: error: 'int64_t' does not name a type typedef int64_t Int64; ^ /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/config.h:156:9: error: 'uint64_t' does not name a type typedef uint64_t UInt64; ^ /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/config.h:158:9: error: 'Int64' does not name a type typedef Int64 LargestInt; ^ /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/config.h:159:9: error: 'UInt64' does not name a type typedef UInt64 LargestUInt; ^ In file included from /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/json.h:10:0, from test.c:1: /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/value.h:184:11: error: 'UInt64' in namespace 'Json' does not name a type typedef Json::UInt64 UInt64; [..] """ Instead of fixing the test program use PKG_CHECK_MODULES to check for jsoncpp. While we're on it, add it for libmpdclient and libmicrohttpd, too. Upstream-status: https://github.com/medoc92/upmpdcli/pull/52 Signed-off-by: Jörg Krause --- v2: - fix typo in patch --- ...ig-for-jsoncpp-libmpdclient-libmicrohttpd.patch | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 package/upmpdcli/0004-Use-pkg-config-for-jsoncpp-libmpdclient-libmicrohttpd.patch diff --git a/package/upmpdcli/0004-Use-pkg-config-for-jsoncpp-libmpdclient-libmicrohttpd.patch b/package/upmpdcli/0004-Use-pkg-config-for-jsoncpp-libmpdclient-libmicrohttpd.patch new file mode 100644 index 0000000..a1f194a --- /dev/null +++ b/package/upmpdcli/0004-Use-pkg-config-for-jsoncpp-libmpdclient-libmicrohttpd.patch @@ -0,0 +1,105 @@ +From 5091e1afd9d0a69bdf10d12d4a66f7147e8185a3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Fri, 23 Sep 2016 21:37:36 +0200 +Subject: [PATCH] Use pkg-config for jsoncpp, libmpdclient and libmicrohttpd +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +libmpdclient, libmicrohttpd and jsoncpp provide a .pc file. Use +pkg-config for detecting the libraries and for providing the necessary +details for compiling and linking. + +The current build system of upmpdcli does not use PKG_CHECK_MODULES, but +AC_LINK_IFELSE to detect jsoncpp. After bumping jsoncpp version from 1.7.2 to +1.7.5 the detection fails, because the test program does not compile: + +''' +In file included from /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/autolink.h:9:0, + from /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/json.h:9, + from test.c:1: +/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/config.h:155:9: error: 'int64_t' does not name a type + typedef int64_t Int64; + ^ +/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/config.h:156:9: error: 'uint64_t' does not name a type + typedef uint64_t UInt64; + ^ +/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/config.h:158:9: error: 'Int64' does not name a type + typedef Int64 LargestInt; + ^ +/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/config.h:159:9: error: 'UInt64' does not name a type + typedef UInt64 LargestUInt; + ^ +In file included from /usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/json.h:10:0, + from test.c:1: +/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/json/value.h:184:11: error: 'UInt64' in namespace 'Json' does not name a type + typedef Json::UInt64 UInt64; + +[..] +''' + +Instead of fixing the test program use PKG_CHECK_MODULES to check for +jsoncpp. While we're on it, add it for libmpdclient and libmicrohttpd, too. + +Upstream-status: https://github.com/medoc92/upmpdcli/pull/52 + +Signed-off-by: Jörg Krause +--- + Makefile.am | 3 ++- + configure.ac | 24 +++++++----------------- + 2 files changed, 9 insertions(+), 18 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 5c83aa1..6f6e018 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,5 +1,6 @@ + AM_CPPFLAGS = -DDEBUG -g -Wall \ +- $(upnpp_CFLAGS) \ ++ $(upnpp_CFLAGS) $(libmpdclient_CFLAGS) $(libmicrohttpd_CFLAGS) \ ++ $(jsoncpp_CFLAGS) \ + -I$(top_srcdir)/src \ + -DDATADIR=\"${pkgdatadir}\" -DCONFIGDIR=\"${sysconfdir}\" + +diff --git a/configure.ac b/configure.ac +index a165b5d..0ef0f3b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -36,27 +36,17 @@ dnl AC_CHECK_LIB([curl], [curl_easy_init], [],AC_MSG_ERROR([libcurl not found])) + dnl AC_CHECK_LIB([expat], [XML_ParserCreate], [],AC_MSG_ERROR([libexpat not found])) + + PKG_CHECK_MODULES([upnpp], [libupnpp], [], [AC_MSG_ERROR([libupnpp])]) +-AC_CHECK_LIB([mpdclient], [mpd_connection_new], [], +- AC_MSG_ERROR([libmpdclient not found])) +-SCCTL_LIBS="$LIBS $upnpp_LIBS" ++PKG_CHECK_MODULES([libmpdclient], [libmpdclient], [], ++ [AC_MSG_ERROR([libmpdclient not found])]) ++SCCTL_LIBS="$LIBS $upnpp_LIBS $libmpdclient_LIBS" + +-AC_CHECK_LIB([microhttpd], [MHD_queue_response], [], []) +- +-AC_LANG_PUSH([C++]) ++PKG_CHECK_MODULES([libmicrohttpd], [libmicrohttpd], [], ++ [AC_MSG_ERROR([libmicrohttpd not found])]) + + AC_CHECK_HEADERS(json/json.h jsoncpp/json/json.h) +-LIBS="$LIBS -ljsoncpp" +-AC_LINK_IFELSE([AC_LANG_PROGRAM( +- [[#ifdef HAVE_JSONCPP_JSON_JSON_H +- #include +- #else +- #include +- #endif]], [Json::Features dummy])], +- [HAVE_JSONCPP=1], +- [AC_MSG_ERROR([libjsoncpp not found.])]) +-AC_LANG_POP ++PKG_CHECK_MODULES([jsoncpp], [jsoncpp], [], [AC_MSG_ERROR([jsoncpp not found])]) + +-UPMPDCLI_LIBS="$LIBS $upnpp_LIBS" ++UPMPDCLI_LIBS="$LIBS $upnpp_LIBS $libmpdclient_LIBS $libmicrohttpd_LIBS $jsoncpp_LIBS" + echo "UPMPDCLI_LIBS=$UPMPDCLI_LIBS" + + LIBS="" +-- +2.10.0 +