diff options
author | John Millikin <john@john-millikin.com> | 2020-12-23 14:04:23 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2021-01-04 10:38:11 +0900 |
commit | c0f975af1745391749e4306aa8081b9a4d2cced8 (patch) | |
tree | 03185fbc6a00f5cf5103ca53c44fe37f33f98b72 /scripts/kconfig | |
parent | d39648eb67ac851c7918c794424c266a5d2635b9 (diff) | |
download | linux-stable-c0f975af1745391749e4306aa8081b9a4d2cced8.tar.gz linux-stable-c0f975af1745391749e4306aa8081b9a4d2cced8.tar.bz2 linux-stable-c0f975af1745391749e4306aa8081b9a4d2cced8.zip |
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>
Diffstat (limited to 'scripts/kconfig')
-rwxr-xr-x | scripts/kconfig/mconf-cfg.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh index aa68ec95620d..fcd4acd4e9cb 100755 --- a/scripts/kconfig/mconf-cfg.sh +++ b/scripts/kconfig/mconf-cfg.sh @@ -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 |