aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openssl-sys/build.rs25
1 files changed, 14 insertions, 11 deletions
diff --git a/openssl-sys/build.rs b/openssl-sys/build.rs
index 37048f03..a3b9981e 100644
--- a/openssl-sys/build.rs
+++ b/openssl-sys/build.rs
@@ -25,25 +25,28 @@ fn main() {
return;
}
- // pkg-config doesn't know of OpenSSL on FreeBSD 10.1 and OpenBSD uses LibreSSL
- if target.contains("bsd") {
- println!("cargo:rustc-flags=-l crypto -l ssl");
- // going to assume the base system includes a new version of openssl
- build_old_openssl_shim(false);
- return;
- }
-
if pkg_config::Config::new().atleast_version("1.0.0").find("openssl").is_ok() {
build_old_openssl_shim(false);
return;
}
- if pkg_config::find_library("openssl").is_ok() {
- build_old_openssl_shim(true);
+ let err = match pkg_config::find_library("openssl") {
+ Ok(()) => {
+ build_old_openssl_shim(true);
+ return;
+ }
+ Err(err) => err,
+ };
+
+ // pkg-config doesn't know of OpenSSL on FreeBSD 10.1 and OpenBSD uses LibreSSL
+ if target.contains("bsd") {
+ println!("cargo:rustc-flags=-l crypto -l ssl");
+ // going to assume the base system includes a new version of openssl
+ build_old_openssl_shim(false);
return;
}
- panic!("Unable to find openssl libraries");
+ panic!("unable to find openssl: {}", err);
}
fn build_old_openssl_shim(is_old: bool) {