Martin Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/56677 )
Change subject: util/kconfig: detect ncurses on FreeBSD ......................................................................
util/kconfig: detect ncurses on FreeBSD
Even though pkg-config might be installed, it might or will not return true in the checks whether 'PKG' or 'PKG2' is installed.
Extend the script to look in another location for ncurses.h
Signed-off-by: Idwer Vollering vidwer@gmail.com Change-Id: I4344ba2116c0b8618357db4248d993509cbb666e Reviewed-on: https://review.coreboot.org/c/coreboot/+/56677 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Martin Roth martinroth@google.com --- M util/kconfig/mconf-cfg.sh A util/kconfig/patches/0013-util-kconfig-detect-ncurses-on-FreeBSD.patch M util/kconfig/patches/series 3 files changed, 38 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Martin Roth: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/util/kconfig/mconf-cfg.sh b/util/kconfig/mconf-cfg.sh index b520e40..2047e62 100755 --- a/util/kconfig/mconf-cfg.sh +++ b/util/kconfig/mconf-cfg.sh @@ -33,6 +33,12 @@ exit 0 fi
+# We'll want to be able to build on (Free)BSD: +if [ -f /usr/include/ncurses.h ]; then + echo libs="-lncurses" + 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). if echo '#include <ncurses.h>' | ${HOSTCC} -E - >/dev/null 2>&1; then diff --git a/util/kconfig/patches/0013-util-kconfig-detect-ncurses-on-FreeBSD.patch b/util/kconfig/patches/0013-util-kconfig-detect-ncurses-on-FreeBSD.patch new file mode 100644 index 0000000..8442349 --- /dev/null +++ b/util/kconfig/patches/0013-util-kconfig-detect-ncurses-on-FreeBSD.patch @@ -0,0 +1,31 @@ +From 8512ae9b9bd83f6051f63b0673903283788a2d12 Mon Sep 17 00:00:00 2001 +From: Idwer Vollering vidwer@gmail.com +Date: Wed, 28 Jul 2021 20:15:29 +0200 +Subject: [PATCH] util/kconfig: detect ncurses on FreeBSD + +Signed-off-by: Idwer Vollering vidwer@gmail.com +Change-Id: I4344ba2116c0b8618357db4248d993509cbb666e +--- + util/kconfig/mconf-cfg.sh | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/util/kconfig/mconf-cfg.sh b/util/kconfig/mconf-cfg.sh +index b520e407a8..2047e626b4 100755 +--- a/util/kconfig/mconf-cfg.sh ++++ b/util/kconfig/mconf-cfg.sh +@@ -33,6 +33,12 @@ if [ -f /usr/include/ncurses/ncurses.h ]; then + exit 0 + fi + ++# We'll want to be able to build on (Free)BSD: ++if [ -f /usr/include/ncurses.h ]; then ++ echo libs="-lncurses" ++ 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). + if echo '#include <ncurses.h>' | ${HOSTCC} -E - >/dev/null 2>&1; then +-- +2.31.1 + diff --git a/util/kconfig/patches/series b/util/kconfig/patches/series index 8497f16..dfc614e 100644 --- a/util/kconfig/patches/series +++ b/util/kconfig/patches/series @@ -10,3 +10,4 @@ 0010-reenable-source-in-choice.patch 0011-remove-include-config-hardcodes.patch 0012-safer-tmpfiles.patch +0013-util-kconfig-detect-ncurses-on-FreeBSD.patch