Skip to content

Commit c0f975a

Browse files
jmillikinmasahir0y
authored andcommitted
kconfig: Support building mconf with vendor sysroot ncurses
Changes the final fallback path in the ncurses locator for mconf to support host compilers with a non-default sysroot. This is similar to the hardcoded search for ncurses under '/usr/include', but can support compilers that keep their default header and library directories elsewhere. For nconfig, do nothing because the only vendor compiler I'm aware of with this layout (Apple Clang) ships an ncurses version that's too old for nconfig anyway. Signed-off-by: John Millikin <john@john-millikin.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent d39648e commit c0f975a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/kconfig/mconf-cfg.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ if [ -f /usr/include/ncurses/ncurses.h ]; then
3333
exit 0
3434
fi
3535

36-
if [ -f /usr/include/ncurses.h ]; then
36+
# As a final fallback before giving up, check if $HOSTCC knows of a default
37+
# ncurses installation (e.g. from a vendor-specific sysroot).
38+
if echo '#include <ncurses.h>' | "${HOSTCC}" -E - >/dev/null 2>&1; then
3739
echo cflags=\"-D_GNU_SOURCE\"
3840
echo libs=\"-lncurses\"
3941
exit 0

0 commit comments

Comments
 (0)