support/misc: Adding Vagrant file for provisioning
[buildroot-gz.git] / support / kconfig / patches / 17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch
blob1eb48ef974cb0bf1be0cd7e95cb3cfd652f19cff
1 From be8af2d54a66911693eddc556e4f7a866670082b Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
3 Date: Sun, 14 Sep 2014 12:57:50 +0200
4 Subject: [PATCH] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 This makes "make menuconfig" also work on systems where ncurses is not
10 installed in a standard location (such as on NixOS).
12 This patch changes ccflags() so that it tries pkg-config first, and only
13 if pkg-config fails does it go back to the fallback/manual checks. This
14 is the same algorithm that ldflags() already uses.
16 Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
17 Signed-off-by: Michal Marek <mmarek@suse.cz>
18 ---
19 [This patch is already applied upstream (is part of linux v3.18):
20 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082b
22 I'm adding this instead of doing a full upstream kconfig sync because
23 there was a conflict in one of the Buildroot kconfig patches (against
24 linux 3.18-rc1), which I was unable to resolve. Just drop this patch next time
25 Buildroot kconfig is synced against upstream.
28 scripts/kconfig/lxdialog/check-lxdialog.sh | 6 +++++-
29 1 file changed, 5 insertions(+), 1 deletion(-)
31 diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
32 index 9d2a4c5..5075ebf 100755
33 --- a/lxdialog/check-lxdialog.sh
34 +++ b/lxdialog/check-lxdialog.sh
35 @@ -21,7 +21,11 @@ ldflags()
36 # Where is ncurses.h?
37 ccflags()
39 - if [ -f /usr/include/ncursesw/curses.h ]; then
40 + if pkg-config --cflags ncursesw 2>/dev/null; then
41 + echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
42 + elif pkg-config --cflags ncurses 2>/dev/null; then
43 + echo '-DCURSES_LOC="<ncurses.h>"'
44 + elif [ -f /usr/include/ncursesw/curses.h ]; then
45 echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
46 echo ' -DNCURSES_WIDECHAR=1'
47 elif [ -f /usr/include/ncurses/ncurses.h ]; then
48 --
49 2.1.3