summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-01-05 17:27:33 -0700
committerCommit Bot <commit-bot@chromium.org>2022-01-10 23:19:15 +0000
commit22076b1036354be65ac694e3ed0657b6f344f9d1 (patch)
tree829233e302b4e3edf3b3ee76c2fca3b9c7e351d0
parentc91e3152722eaa827ea5b86aaf8da8558f74c29b (diff)
downloadvboot-22076b1036354be65ac694e3ed0657b6f344f9d1.tar.gz
futility: Link with libcrosid
Use pkg-config to link with libcrosid when it's available. Note that when futility is compiled from the coreboot tree, libcrosid won't be available, at least at the moment, so expose -DUSE_CROSID to the C code so we know when we have it available. BUG=b:213251232 BRANCH=none TEST=emerge-volteer -j vboot_reference "lddtree /build/volteer/usr/bin/futility" lists libcrosid Cq-Depend: chromium:3367251 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I8e69c5ce4570ac9df72440d0a34b6b03b5a36e77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3368703 Reviewed-by: Raul Rangel <rrangel@chromium.org>
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 75ea8e4f..4f0dee41 100644
--- a/Makefile
+++ b/Makefile
@@ -275,6 +275,12 @@ ifneq ($(filter-out 0,${HAVE_LIBZIP}),)
LIBZIP_LIBS := $(shell ${PKG_CONFIG} --libs libzip)
endif
+HAVE_CROSID := $(shell ${PKG_CONFIG} --exists crosid && echo 1)
+ifeq ($(HAVE_CROSID),1)
+ CFLAGS += -DHAVE_CROSID $(shell ${PKG_CONFIG} --cflags crosid)
+ CROSID_LIBS := $(shell ${PKG_CONFIG} --libs crosid)
+endif
+
# Determine QEMU architecture needed, if any
ifeq (${ARCH},${HOST_ARCH})
# Same architecture; no need for QEMU
@@ -1029,7 +1035,7 @@ signing_install: $(if ${SDK_BUILD},\
futil: ${FUTIL_BIN}
# FUTIL_LIBS is shared by FUTIL_BIN and TEST_FUTIL_BINS.
-FUTIL_LIBS = ${CRYPTO_LIBS} ${LIBZIP_LIBS} ${FLASHROM_LIBS}
+FUTIL_LIBS = ${CROSID_LIBS} ${CRYPTO_LIBS} ${LIBZIP_LIBS} ${FLASHROM_LIBS}
${FUTIL_BIN}: LDLIBS += ${FUTIL_LIBS}
${FUTIL_BIN}: ${FUTIL_OBJS} ${UTILLIB} ${FWLIB}