diff options
| author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2014-09-14 12:57:50 +0200 |
|---|---|---|
| committer | Mike Frysinger <vapier@gentoo.org> | 2016-04-03 23:59:15 -0400 |
| commit | d63d77a7f03eaa49729619a14aa9a12a0e9f95ad (patch) | |
| tree | 5c74acaadf14b06ff4248c7fe0f351af579e6c35 /scripts | |
| parent | 935fe68236f21bf641b316fea1867754e754911b (diff) | |
| download | busybox-w32-d63d77a7f03eaa49729619a14aa9a12a0e9f95ad.tar.gz busybox-w32-d63d77a7f03eaa49729619a14aa9a12a0e9f95ad.tar.bz2 busybox-w32-d63d77a7f03eaa49729619a14aa9a12a0e9f95ad.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>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'scripts')
| -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 9d2a4c585..5075ebf2d 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 |
