From 82db54c82279bfd91a9ab703444488d2ba6aa03c Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 3 Dec 2014 12:33:34 -0800 Subject: Allow passing in Android paths --- openssl-sys/src/build.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/build.rs b/openssl-sys/src/build.rs index f32ced0e..df284c0f 100644 --- a/openssl-sys/src/build.rs +++ b/openssl-sys/src/build.rs @@ -17,6 +17,16 @@ fn main() { if win_pos.is_some() { flags.push_str(" -l gdi32 -l wsock32"); } + + // Android doesn't have libcrypto/libssl, + // the toplevel Rust program should compile it themselves + if target.find_str("android").is_some() { + os::getenv("OPENSSL_PATH").expect("Android does not provide openssl libraries, please \ + build them yourselves (instructions in the README) \ + and provide their location through $OPENSSL_PATH."); + flags.push_str(" -L ${OPENSSL_PATH}"); + } + println!("cargo:rustc-flags={}", flags); } } -- cgit v1.2.3 From 31d188e3130f7d522f929ba51d6408795651f72f Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 5 Dec 2014 06:43:18 -0800 Subject: Directly substitute $OPENSSL_PATH --- openssl-sys/src/build.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/build.rs b/openssl-sys/src/build.rs index df284c0f..707a8e65 100644 --- a/openssl-sys/src/build.rs +++ b/openssl-sys/src/build.rs @@ -18,13 +18,11 @@ fn main() { flags.push_str(" -l gdi32 -l wsock32"); } - // Android doesn't have libcrypto/libssl, - // the toplevel Rust program should compile it themselves if target.find_str("android").is_some() { - os::getenv("OPENSSL_PATH").expect("Android does not provide openssl libraries, please \ - build them yourselves (instructions in the README) \ - and provide their location through $OPENSSL_PATH."); - flags.push_str(" -L ${OPENSSL_PATH}"); + let path = os::getenv("OPENSSL_PATH").expect("Android does not provide openssl libraries, please \ + build them yourselves (instructions in the README) \ + and provide their location through $OPENSSL_PATH."); + flags.push_str(format!(" -L {}", path).as_slice()); } println!("cargo:rustc-flags={}", flags); -- cgit v1.2.3 From 0dff5268de2e072d162ad492304e15d079d2d4f8 Mon Sep 17 00:00:00 2001 From: Richard Diamond Date: Fri, 5 Dec 2014 23:38:15 -0600 Subject: 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. --- openssl-sys/src/build.rs | 5 +++++ openssl-sys/src/lib.rs | 3 +++ 2 files changed, 8 insertions(+) (limited to 'openssl-sys/src') 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; -- cgit v1.2.3 From 10e8a8f8e3b45c7a89f89b16c74aa3fa5477fa22 Mon Sep 17 00:00:00 2001 From: Richard Diamond Date: Tue, 9 Dec 2014 23:00:05 -0600 Subject: Now that pkg-config 0.1.1 has been published, delegate to bailout detection to pkg-config. Also bump version minors for publishing. :) --- openssl-sys/src/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/build.rs b/openssl-sys/src/build.rs index 0ee0dd2c..ab42b159 100644 --- a/openssl-sys/src/build.rs +++ b/openssl-sys/src/build.rs @@ -5,7 +5,7 @@ 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::target_supported() { return; } if pkg_config::find_library("openssl").is_err() { -- cgit v1.2.3 From 6d2f8d67f2423ba6a337359ecf0188bd52227dce Mon Sep 17 00:00:00 2001 From: Ummon Date: Wed, 10 Dec 2014 22:25:32 +0100 Subject: Add the openssl function prototype 'HMAC_CTX_cleanup'. --- openssl-sys/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 0644a674..1faf749e 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -361,6 +361,7 @@ extern "C" { pub fn HMAC_Init_ex(ctx: *mut HMAC_CTX, key: *const u8, keylen: c_int, md: *const EVP_MD, imple: *const ENGINE); pub fn HMAC_Final(ctx: *mut HMAC_CTX, output: *mut u8, len: *mut c_uint); pub fn HMAC_Update(ctx: *mut HMAC_CTX, input: *const u8, len: c_uint); + pub fn HMAC_CTX_cleanup(ctx: *mut HMAC_CTX); pub fn PEM_read_bio_X509(bio: *mut BIO, out: *mut *mut X509, callback: Option, -- cgit v1.2.3