From 14f72bc2cc2aa89d9e4cd6efcae3fcc46ea9b59b Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 6 Apr 2015 01:44:49 +0200 Subject: 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 Change-Id: Ie2372ca35546c1fc2d6cf603614683312ee4ea4c Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/9315 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Marc Jones --- util/kconfig/lxdialog/check-lxdialog.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/kconfig/lxdialog/check-lxdialog.sh b/util/kconfig/lxdialog/check-lxdialog.sh index 2b845e6dd8..78939da0b2 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="" -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 -- cgit v1.2.3