Skip to content

Commit

Permalink
kconfig: Support building mconf with vendor sysroot ncurses
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Millikin authored and Masahiro Yamada committed Jan 4, 2021
1 parent d39648e commit c0f975a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/kconfig/mconf-cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ if [ -f /usr/include/ncurses/ncurses.h ]; then
exit 0
fi

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

0 comments on commit c0f975a

Please sign in to comment.