diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2014-09-14 06:57:50 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2014-09-23 09:47:48 -0400 |
commit | be8af2d54a66911693eddc556e4f7a866670082b (patch) | |
tree | 7e0e5c346f4096c4e924e4ee8d9526a2921793dc /scripts/kconfig/lxdialog | |
parent | 7285996aa0006d671bb01f0d35991d254b2b2b01 (diff) |
kconfig/lxdialog: get ncurses CFLAGS with pkg-config
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 <bjorn.forsman@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig/lxdialog')
-rwxr-xr-x | scripts/kconfig/lxdialog/check-lxdialog.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index 9d2a4c585ee1..5075ebf2d3b9 100755 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh | |||
@@ -21,7 +21,11 @@ ldflags() | |||
21 | # Where is ncurses.h? | 21 | # Where is ncurses.h? |
22 | ccflags() | 22 | ccflags() |
23 | { | 23 | { |
24 | if [ -f /usr/include/ncursesw/curses.h ]; then | 24 | if pkg-config --cflags ncursesw 2>/dev/null; then |
25 | echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1' | ||
26 | elif pkg-config --cflags ncurses 2>/dev/null; then | ||
27 | echo '-DCURSES_LOC="<ncurses.h>"' | ||
28 | elif [ -f /usr/include/ncursesw/curses.h ]; then | ||
25 | echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"' | 29 | echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"' |
26 | echo ' -DNCURSES_WIDECHAR=1' | 30 | echo ' -DNCURSES_WIDECHAR=1' |
27 | elif [ -f /usr/include/ncurses/ncurses.h ]; then | 31 | elif [ -f /usr/include/ncurses/ncurses.h ]; then |