Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42881 )
Change subject: util/futility: Check for pkg-config and libcrypto ......................................................................
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 pgeorgi@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/42881 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M util/futility/Makefile.inc 1 file changed, 9 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/util/futility/Makefile.inc b/util/futility/Makefile.inc index ee4ad05..ed185ce 100644 --- a/util/futility/Makefile.inc +++ b/util/futility/Makefile.inc @@ -2,15 +2,22 @@
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