aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Thiery <heiko.thiery@gmail.com>2022-07-20 12:31:35 +0200
committerTom Rini <trini@konsulko.com>2022-08-04 15:32:20 -0400
commit124b21e7bd3d0ad5258c7cf84540301bff27012a (patch)
treecd9944c3deee8ba931455786c291287d0f8e51e3
parent31a7688cbe0ed5edf4108a1f7ef4653659610d4b (diff)
downloadu-boot-124b21e7bd3d0ad5258c7cf84540301bff27012a.zip
u-boot-124b21e7bd3d0ad5258c7cf84540301bff27012a.tar.gz
u-boot-124b21e7bd3d0ad5258c7cf84540301bff27012a.tar.bz2
tools: kwboot: use pkg-config to get -ltinfo
Instead of hardcoding -ltinfo as the flags needed to build kwboot, use pkg-config when available. We gracefully fallback on the previous behavior of hardcoding -ltinfo if pkg-config is not available or fails with an error. Reviewed-by: Pali Rohár <pali@kernel.org> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
-rw-r--r--tools/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/Makefile b/tools/Makefile
index aab06ae..005e736 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -198,7 +198,9 @@ hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl
HOSTCFLAGS_mkexynosspl.o := -pedantic
HOSTCFLAGS_kwboot.o += -pthread
-HOSTLDLIBS_kwboot += -pthread -ltinfo
+HOSTLDLIBS_kwboot += -pthread
+HOSTLDLIBS_kwboot += \
+ $(shell pkg-config --libs tinfo 2> /dev/null || echo "-ltinfo")
ifdtool-objs := $(LIBFDT_OBJS) ifdtool.o
hostprogs-$(CONFIG_X86) += ifdtool