diff options
| author | Steven Fackler <[email protected]> | 2014-12-16 19:08:44 -0500 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2014-12-16 19:08:44 -0500 |
| commit | 88b753d3feeab5de71c5fdc834c0cc2dc37ae42e (patch) | |
| tree | 23efb4af40d49c9d3a70245604fdce4121d7be50 | |
| parent | Release v0.2.5 (diff) | |
| parent | Use static linking on android, which simplifies deployment since loading appl... (diff) | |
| download | rust-openssl-88b753d3feeab5de71c5fdc834c0cc2dc37ae42e.tar.xz rust-openssl-88b753d3feeab5de71c5fdc834c0cc2dc37ae42e.zip | |
Merge pull request #119 from glennw/android-static-linking
Use static linking on android, which simplifies deployment since loading...
| -rw-r--r-- | openssl-sys/src/build.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/openssl-sys/src/build.rs b/openssl-sys/src/build.rs index 53c047b2..ca71f791 100644 --- a/openssl-sys/src/build.rs +++ b/openssl-sys/src/build.rs @@ -9,9 +9,14 @@ 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 is_android = target.find_str("android").is_some(); + + let mut flags = if is_android { + " -l crypto:static -l ssl:static" + } else { + " -l crypto -l ssl" + }.to_string(); let win_pos = target.find_str("windows") .or(target.find_str("win32")) @@ -23,7 +28,7 @@ fn main() { flags.push_str(" -l gdi32 -l wsock32"); } - if target.find_str("android").is_some() { + if is_android { 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."); |