summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2020-06-29 21:10:44 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-07-01 18:12:05 +0000
commit8edfddcb54cf28a9c5deb4d97d131a47e77cda07 (patch)
tree7018e793fb65f0012c7beadd27026419b52a6ff3
parentc6dd4435d272681657a623c9f05d86b504ec276f (diff)
downloadcoreboot-8edfddcb54cf28a9c5deb4d97d131a47e77cda07.tar.xz
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>
-rw-r--r--util/futility/Makefile.inc11
1 files changed, 9 insertions, 2 deletions
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