Adds a new 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@xxxxxxxxxxxxxxxxx> --- scripts/kconfig/mconf-cfg.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh index aa68ec95620d..d38f44976418 100755 --- a/scripts/kconfig/mconf-cfg.sh +++ b/scripts/kconfig/mconf-cfg.sh @@ -39,6 +39,15 @@ if [ -f /usr/include/ncurses.h ]; then exit 0 fi +# As a final fallback before giving up, check if $HOSTCC knows of a default +# ncurses installation (e.g. from a vendor-specific sysroot). +echo '#include <ncurses.h>' | "${HOSTCC}" -E - >/dev/null 2>&1 +if [ $? -eq 0 ]; then + echo cflags=\"-D_GNU_SOURCE\" + echo libs=\"-lncurses\" + exit 0 +fi + echo >&2 "*" echo >&2 "* Unable to find the ncurses package." echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev" -- 2.24.3 (Apple Git-128)