From 8edfddcb54cf28a9c5deb4d97d131a47e77cda07 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 29 Jun 2020 21:10:44 +0200 Subject: util/futility: Check for pkg-config and libcrypto When building a configuration that requires futility (e.g. Chrome OS builds), pkg-config and libcrypto are required. Since vboot's build system isn't the most helpful about it, test ourselves and fail out with some actionable message. Tested: - configs that don't need futility don't test for pkg-config, so it's not required for them. - failing pkg-config test leads to the message - working pkg-config test leads to a successful build Fixes https://ticket.coreboot.org/issues/242 Change-Id: I103ce5115284352e0a3a7fdcf8b427f56ce15ba7 Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/c/coreboot/+/42881 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- util/futility/Makefile.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/futility/Makefile.inc b/util/futility/Makefile.inc index ee4ad051e2..ed185ce0d5 100644 --- a/util/futility/Makefile.inc +++ b/util/futility/Makefile.inc @@ -2,15 +2,22 @@ additional-dirs += $(objutil)/futility VBOOT_FUTILITY = $(VBOOT_HOST_BUILD)/futility/futility -$(VBOOT_FUTILITY): +HOSTPKGCONFIG ?= pkg-config + +$(VBOOT_FUTILITY): check-openssl-presence @printf " MAKE $(subst $(objutil)/,,$(@))\n" unset CFLAGS LDFLAGS; $(MAKE) -C $(VBOOT_SOURCE) \ BUILD=$(VBOOT_HOST_BUILD) \ CC="$(HOSTCC)" \ - $(if $(HOSTPKGCONFIG), PKG_CONFIG="$(HOSTPKGCONFIG)") \ + PKG_CONFIG="$(HOSTPKGCONFIG)" \ V=$(V) \ $@ +.PHONY: check-openssl-presence +check-openssl-presence: + $(HOSTPKGCONFIG) --exists libcrypto || \ + (echo "Error: Ensure that pkg-config and openssl's libcrypto, including header files, are installed."; exit 1) + $(objutil)/futility/futility: $(VBOOT_FUTILITY) mkdir -p $(dir $@) cp $< $@.tmp -- cgit v1.2.3