summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-05-16 18:36:15 +0200
committerTom Rini <trini@konsulko.com>2015-05-28 08:18:19 -0400
commit4839836a124ea04e5867edf3db3bfb02cfa8d760 (patch)
tree2016528ad4455d55d2bd12a9a6f9a0c404289028 /tools
parentaf22ac660a5b007938acce4e83d79dd2a0a0b0d8 (diff)
downloadblackbird-obmc-uboot-4839836a124ea04e5867edf3db3bfb02cfa8d760.tar.gz
blackbird-obmc-uboot-4839836a124ea04e5867edf3db3bfb02cfa8d760.zip
tools: use pkg-config when available to get SSL flags
Instead of hardcoding -lssl -lcrypto as the flags needed to build mkimage with FIT signature enabled, use pkg-config when available. This allows to properly support cases where static linking is used, which requires linking with -lz, since OpenSSL uses zlib internally. We gracefully fallback on the previous behavior of hardcoding -lssl -lcrypto if pkg-config is not available or fails with an error. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 4bbb15336e..8ff9c2e108 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -122,7 +122,8 @@ endif
# MXSImage needs LibSSL
ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_FIT_SIGNATURE),)
-HOSTLOADLIBES_mkimage += -lssl -lcrypto
+HOSTLOADLIBES_mkimage += \
+ $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto")
endif
HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage)
OpenPOWER on IntegriCloud