summaryrefslogtreecommitdiffstats
path: root/util/kconfig/lxdialog
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2015-04-06 01:44:49 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-04-06 23:12:55 +0200
commit14f72bc2cc2aa89d9e4cd6efcae3fcc46ea9b59b (patch)
treefc1869878e576a9712e96081b31230d69d60d476 /util/kconfig/lxdialog
parentec5e5e0db2ac923a4f80d24ffa7582c3b821d971 (diff)
downloadcoreboot-14f72bc2cc2aa89d9e4cd6efcae3fcc46ea9b59b.tar.gz
coreboot-14f72bc2cc2aa89d9e4cd6efcae3fcc46ea9b59b.tar.bz2
coreboot-14f72bc2cc2aa89d9e4cd6efcae3fcc46ea9b59b.zip
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> Change-Id: Ie2372ca35546c1fc2d6cf603614683312ee4ea4c Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/9315 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'util/kconfig/lxdialog')
-rw-r--r--util/kconfig/lxdialog/check-lxdialog.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/kconfig/lxdialog/check-lxdialog.sh b/util/kconfig/lxdialog/check-lxdialog.sh
index 2b845e6dd82a..78939da0b2ee 100644
--- a/util/kconfig/lxdialog/check-lxdialog.sh
+++ b/util/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="<ncurses.h>" -DNCURSES_WIDECHAR=1'
+ elif pkg-config --cflags ncurses 2>/dev/null; then
+ echo '-DCURSES_LOC="<ncurses.h>"'
+ elif [ -f /usr/include/ncursesw/curses.h ]; then
echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
echo ' -DNCURSES_WIDECHAR=1'
elif [ -f /usr/include/ncurses/ncurses.h ]; then