diff options
| author | Steven Fackler <[email protected]> | 2015-05-17 14:28:27 -0400 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-05-17 14:28:27 -0400 |
| commit | 3727c4cefbec73b3039c8bd50edf3b065ac2a84a (patch) | |
| tree | ce7287fc9f4b3fd760e89761f741d13ae465346b | |
| parent | Fix SslString Debug impl and drop lifetime (diff) | |
| parent | Remove MSYSTEM environment variable check (diff) | |
| download | rust-openssl-3727c4cefbec73b3039c8bd50edf3b065ac2a84a.tar.xz rust-openssl-3727c4cefbec73b3039c8bd50edf3b065ac2a84a.zip | |
Merge pull request #211 from bozaro/redefine_libs
Add ability to redefine library list via OPENSSL_LIBS environment variable
| -rw-r--r-- | openssl-sys/build.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/openssl-sys/build.rs b/openssl-sys/build.rs index aadaa361..51d78ffc 100644 --- a/openssl-sys/build.rs +++ b/openssl-sys/build.rs @@ -20,10 +20,14 @@ fn main() { } } - let (libcrypto, libssl) = if target.contains("windows") { - ("eay32", "ssl32") - } else { - ("crypto", "ssl") + let libs_env = env::var("OPENSSL_LIBS").ok(); + let libs = match libs_env { + Some(ref v) => v.split(":").collect(), + None => if target.contains("windows") { + vec!("eay32", "ssl32") + } else { + vec!("crypto", "ssl") + } }; let mode = if env::var_os("OPENSSL_STATIC").is_some() { @@ -36,7 +40,8 @@ fn main() { println!("cargo:rustc-flags=-L native={}", lib_dir); } - println!("cargo:rustc-flags=-l {0}={1} -l {0}={2}", mode, libcrypto, libssl); + let libs_arg = libs.iter().fold(String::new(), |args, lib| args + &format!(" -l {0}={1}", mode, lib)); + println!("cargo:rustc-flags={0}", libs_arg); let mut include_dirs = vec![]; |