From patchwork Thu Jan 1 20:54:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Forsman?= X-Patchwork-Id: 424915 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id ED8BC14010F for ; Fri, 2 Jan 2015 07:54:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3C86E876E5; Thu, 1 Jan 2015 20:54:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T3dagLZIce_P; Thu, 1 Jan 2015 20:54:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5286E82494; Thu, 1 Jan 2015 20:54:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 0850E1C296C for ; Thu, 1 Jan 2015 20:54:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0497C25BC2 for ; Thu, 1 Jan 2015 20:54:47 +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 MXwARWVts56V for ; Thu, 1 Jan 2015 20:54:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by silver.osuosl.org (Postfix) with ESMTPS id C3B6D252F2 for ; Thu, 1 Jan 2015 20:54:45 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id em10so26914955wid.5 for ; Thu, 01 Jan 2015 12:54:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=spGnvmiWwls9umY06ETdAVd73PItZcm9hMboknrTLPc=; b=rGk2eZ64YLexEmpeMwrJquBJwTuv4uRE88QvMlS4mlrZs1yy4GDUL2CDkrJ2qOLdsc SRyQZzMjL1gTkN7x+DOi4utq+R0uldmmtAgFEJzHJIz3N917tXXJqgNPI+kv0uwvXgxu aBNG2m7YPc6XywCtp1+LsnOdG6AlL5ijBizZYlwHYldff40apO+gdtYtuNVOELKHc9Z8 TT4ugxMqo/Sq8+2VKwerzPglGrtdjJioqwgWWqNQMQf1YxIJjq/q8jV6FYUt0A3WAEV7 lm3LrHqEm3hvxS9FFXzkOpJjLZAVIpgrWiHk9nAcYHubYXCx/D13dTPefNKWu1VRr9BS q62A== X-Received: by 10.180.207.211 with SMTP id ly19mr128486514wic.73.1420145684499; Thu, 01 Jan 2015 12:54:44 -0800 (PST) Received: from localhost (cm-84.208.241.218.getinternet.no. [84.208.241.218]) by mx.google.com with ESMTPSA id u1sm51876248wif.6.2015.01.01.12.54.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jan 2015 12:54:43 -0800 (PST) From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= To: buildroot@buildroot.org Date: Thu, 1 Jan 2015 21:54:37 +0100 Message-Id: <1420145678-11134-2-git-send-email-bjorn.forsman@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1420145678-11134-1-git-send-email-bjorn.forsman@gmail.com> References: <1420145678-11134-1-git-send-email-bjorn.forsman@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config 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" This makes "make menuconfig" also work on systems where ncurses is not installed in a standard location (such as on NixOS). This patch changes ccflags() so that it tries pkg-config first, and only if pkg-config fails does it go back to the fallback/manual checks. This is the same algorithm that ldflags() already uses. [This patch is already applied upstream (is part of linux v3.18): https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082b I'm adding this instead of doing a full upstream kconfig sync because there was a conflict in one of the Buildroot kconfig patches (against linux 3.18-rc1), which I was unable to resolve. Just drop this patch next time Buildroot kconfig is synced against upstream. ] Signed-off-by: Bjørn Forsman Tested-by: "Yann E. MORIN" Reviewed-by: "Yann E. MORIN" --- ...dialog-get-ncurses-CFLAGS-with-pkg-config.patch | 50 ++++++++++++++++++++++ support/kconfig/patches/series | 1 + 2 files changed, 51 insertions(+) create mode 100644 support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch diff --git a/support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch b/support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch new file mode 100644 index 0000000..65973a3 --- /dev/null +++ b/support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch @@ -0,0 +1,50 @@ +From be8af2d54a66911693eddc556e4f7a866670082b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= +Date: Sun, 14 Sep 2014 12:57:50 +0200 +Subject: [PATCH] kconfig/lxdialog: get ncurses CFLAGS with pkg-config +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This makes "make menuconfig" also work on systems where ncurses is not +installed in a standard location (such as on NixOS). + +This patch changes ccflags() so that it tries pkg-config first, and only +if pkg-config fails does it go back to the fallback/manual checks. This +is the same algorithm that ldflags() already uses. + +Signed-off-by: Bjørn Forsman +Signed-off-by: Michal Marek +--- +[This patch is already applied upstream (is part of linux v3.18): +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082b + +I'm adding this instead of doing a full upstream kconfig sync because +there was a conflict in one of the Buildroot kconfig patches (against +linux 3.18-rc1), which I was unable to resolve. Just drop this patch next time +Buildroot kconfig is synced against upstream. +] + + scripts/kconfig/lxdialog/check-lxdialog.sh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh +index 9d2a4c5..5075ebf 100755 +--- a/scripts/kconfig/lxdialog/check-lxdialog.sh ++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh +@@ -21,7 +21,11 @@ ldflags() + # Where is ncurses.h? + ccflags() + { +- if [ -f /usr/include/ncursesw/curses.h ]; then ++ if pkg-config --cflags ncursesw 2>/dev/null; then ++ echo '-DCURSES_LOC="" -DNCURSES_WIDECHAR=1' ++ elif pkg-config --cflags ncurses 2>/dev/null; then ++ echo '-DCURSES_LOC=""' ++ elif [ -f /usr/include/ncursesw/curses.h ]; then + echo '-I/usr/include/ncursesw -DCURSES_LOC=""' + echo ' -DNCURSES_WIDECHAR=1' + elif [ -f /usr/include/ncurses/ncurses.h ]; then +-- +2.1.3 + diff --git a/support/kconfig/patches/series b/support/kconfig/patches/series index 9154d83..e25375e 100644 --- a/support/kconfig/patches/series +++ b/support/kconfig/patches/series @@ -6,3 +6,4 @@ 14-support-out-of-tree-config.patch 15-fix-qconf-moc-rule.patch 16-fix-space-to-de-select-options.patch +17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch