Re: [PATCH] kconfig: Support building mconf with vendor sysroot ncurses.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 14, 2020 at 6:30 PM John Millikin <jmillikin@xxxxxxxxx> wrote:
>
> 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
> +


I think this is a nicer check
than the hard-coded /usr/include/ncurses.h.


Could you replace the last one in the current code?

if [ -f /usr/include/ncurses.h ]; 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)



-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux