diff options
| author | Chris Cole <[email protected]> | 2014-11-29 19:47:09 -0500 |
|---|---|---|
| committer | Chris Cole <[email protected]> | 2014-11-29 19:47:09 -0500 |
| commit | 5f76f1cb62c70af4bbf064ea5c27c69544f04cea (patch) | |
| tree | 6c90d43f6bfdf1b2b83094c1bfc559bfbdecf554 /openssl-sys/src/build.rs | |
| parent | Added mod_mul. (diff) | |
| parent | Make SslStream Cloneable (diff) | |
| download | rust-openssl-5f76f1cb62c70af4bbf064ea5c27c69544f04cea.tar.xz rust-openssl-5f76f1cb62c70af4bbf064ea5c27c69544f04cea.zip | |
Merge remote-tracking branch 'upstream/master'
Conflicts:
src/bn/mod.rs
Diffstat (limited to 'openssl-sys/src/build.rs')
| -rw-r--r-- | openssl-sys/src/build.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/openssl-sys/src/build.rs b/openssl-sys/src/build.rs new file mode 100644 index 00000000..f32ced0e --- /dev/null +++ b/openssl-sys/src/build.rs @@ -0,0 +1,22 @@ +extern crate "pkg-config" as pkg_config; + +use std::os; + +fn main() { + if pkg_config::find_library("openssl").is_err() { + let mut flags = " -l crypto -l ssl".to_string(); + + let target = os::getenv("TARGET").unwrap(); + + let win_pos = target.find_str("windows") + .or(target.find_str("win32")) + .or(target.find_str("win64")); + + // It's fun, but it looks like win32 and win64 both + // have all the libs with 32 sufix + if win_pos.is_some() { + flags.push_str(" -l gdi32 -l wsock32"); + } + println!("cargo:rustc-flags={}", flags); + } +} |