Building the host tools on macOS stops at kwboot:

  ld: library 'tinfo' not found

macOS has no libtinfo. The terminfo functions that kwboot uses are in
the system libncurses, and the ncurses from Homebrew installs no
tinfo.pc for pkg-config to find. Link kwboot with -lncurses on macOS.

The darwin block above checks HOSTOS, which is no longer set since
commit 5f520875bdf0 ("kbuild: Bump the build system to 5.1"), so check
uname directly.

Tested with "make turris_omnia_defconfig tools" on macOS 27.0.1 and
Apple clang 21. kwboot links against /usr/lib/libncurses.5.4.dylib and
boots a Turris Omnia over UART.

Fixes: e8d26e827635 ("tools: kwboot: Add support for backspace key in mini 
terminal")
Signed-off-by: Josef Schlehofer <[email protected]>
---
 tools/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/Makefile b/tools/Makefile
index fc0aa52455a..a23e8af12ca 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -221,8 +221,13 @@ HOSTCFLAGS_mkexynosspl.o := -pedantic
 
 HOSTCFLAGS_kwboot.o += -pthread
 HOSTLDLIBS_kwboot += -pthread
+# macOS has no libtinfo, its libncurses provides the terminfo functions
+ifeq ($(shell uname -s),Darwin)
+HOSTLDLIBS_kwboot += -lncurses
+else
 HOSTLDLIBS_kwboot += \
        $(shell pkg-config --libs tinfo 2> /dev/null || echo "-ltinfo")
+endif
 
 ifdtool-objs := $(LIBFDT_OBJS) ifdtool.o
 hostprogs-always-$(CONFIG_X86) += ifdtool
-- 
2.54.0 (Apple Git-157)

Reply via email to