[vlc-commits] contrib: cargo: use cargo/vendored-openssl if needed
Thomas Guillem
git at videolan.org
Thu Sep 10 12:43:22 CEST 2020
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Sep 7 17:29:44 2020 +0200| [b166739741b604f1cde049c76cd3b91ac7207461] | committer: Thomas Guillem
contrib: cargo: use cargo/vendored-openssl if needed
Co-Authored-By: Kartik Ohri <kartikohri13 at gmail.com>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b166739741b604f1cde049c76cd3b91ac7207461
---
contrib/src/cargo/rules.mak | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/contrib/src/cargo/rules.mak b/contrib/src/cargo/rules.mak
index f634ae60eb..3de18a46a6 100644
--- a/contrib/src/cargo/rules.mak
+++ b/contrib/src/cargo/rules.mak
@@ -15,6 +15,16 @@ rustup: rustup-$(RUSTUP_VERSION).tar.gz .sum-cargo
$(UNPACK)
$(MOVE)
+# Test if we can use the host libssl library
+ifeq ($(shell unset PKG_CONFIG_LIBDIR PKG_CONFIG_PATH; \
+ pkg-config "openssl >= 1.0.1" 2>/dev/null || \
+ pkg-config "libssl >= 2.5" 2>/dev/null || echo FAIL),)
+CARGOC_FEATURES=
+else
+# Otherwise, let cargo build and statically link its own openssl
+CARGOC_FEATURES=--features=cargo/vendored-openssl
+endif
+
# When needed (when we have a Rust dependency not using cargo-c), the cargo-c
# installation should go in a different package
.cargo: rustup
@@ -24,5 +34,5 @@ rustup: rustup-$(RUSTUP_VERSION).tar.gz .sum-cargo
$(RUSTUP) default stable
$(RUSTUP) target add $(RUST_TARGET)
unset PKG_CONFIG_LIBDIR PKG_CONFIG_PATH CFLAGS CPPFLAGS LDFLAGS; \
- $(CARGO) install cargo-c
+ $(CARGO) install $(CARGOC_FEATURES) cargo-c
touch $@
More information about the vlc-commits
mailing list