diff options
| author | Richard Diamond <[email protected]> | 2014-12-05 23:38:15 -0600 |
|---|---|---|
| committer | Richard Diamond <[email protected]> | 2014-12-09 00:04:06 -0600 |
| commit | 0dff5268de2e072d162ad492304e15d079d2d4f8 (patch) | |
| tree | 3cd8b618a1550d6da5905deb6f834ed21522fb08 | |
| parent | Release v0.2.2 (diff) | |
| download | rust-openssl-0dff5268de2e072d162ad492304e15d079d2d4f8.tar.xz rust-openssl-0dff5268de2e072d162ad492304e15d079d2d4f8.zip | |
Add a feature to openssl-sys to cause it to build a local copy of libressl for
use instead of whatever pkg-config says (which in the case of crosses, is almost
certainly incorrect). This is for PNaCl.
| -rw-r--r-- | openssl-sys/Cargo.toml | 9 | ||||
| -rw-r--r-- | openssl-sys/src/build.rs | 5 | ||||
| -rw-r--r-- | openssl-sys/src/lib.rs | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/openssl-sys/Cargo.toml b/openssl-sys/Cargo.toml index 6753681c..c434be49 100644 --- a/openssl-sys/Cargo.toml +++ b/openssl-sys/Cargo.toml @@ -18,3 +18,12 @@ aes_xts = [] [build-dependencies] pkg-config = "0.1" + +[target.le32-unknown-nacl.dependencies] +libressl-pnacl-sys = "2.1.0" +[target.x86_64-unknown-nacl.dependencies] +libressl-pnacl-sys = "2.1.0" +[target.i686-unknown-nacl.dependencies] +libressl-pnacl-sys = "2.1.0" +[target.arm-unknown-nacl.dependencies] +libressl-pnacl-sys = "2.1.0" diff --git a/openssl-sys/src/build.rs b/openssl-sys/src/build.rs index f32ced0e..0ee0dd2c 100644 --- a/openssl-sys/src/build.rs +++ b/openssl-sys/src/build.rs @@ -3,6 +3,11 @@ extern crate "pkg-config" as pkg_config; use std::os; fn main() { + // Without hackory, pkg-config will only look for host libraries. + // So, abandon ship if we're cross compiling. + if os::getenv("HOST") != os::getenv("TARGET") { return; } + + if pkg_config::find_library("openssl").is_err() { let mut flags = " -l crypto -l ssl".to_string(); diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 2b0c9292..0644a674 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -4,6 +4,9 @@ extern crate libc; extern crate rustrt; +#[cfg(feature = "libressl-pnacl-sys")] +extern crate "libressl-pnacl-sys" as _for_linkage; + use libc::{c_void, c_int, c_char, c_ulong, c_long, c_uint, c_uchar, size_t}; use std::mem; use std::ptr; |