aboutsummaryrefslogtreecommitdiff
path: root/openssl/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/build.rs')
-rw-r--r--openssl/build.rs42
1 files changed, 19 insertions, 23 deletions
diff --git a/openssl/build.rs b/openssl/build.rs
index b07c1b3e..7a0c60dc 100644
--- a/openssl/build.rs
+++ b/openssl/build.rs
@@ -1,28 +1,24 @@
-#[cfg(feature = "c_helpers")]
-mod imp {
- extern crate gcc;
+use std::env;
- use std::env;
- use std::path::PathBuf;
-
- pub fn main() {
- let mut config = gcc::Config::new();
-
- if let Some(paths) = env::var_os("DEP_OPENSSL_INCLUDE") {
- for path in env::split_paths(&paths) {
- config.include(PathBuf::from(path));
- }
+fn main() {
+ match env::var("DEP_OPENSSL_VERSION") {
+ Ok(ref v) if v == "101" => {
+ println!("cargo:rustc-cfg=ossl101");
+ println!("cargo:rustc-cfg=ossl10x");
}
-
- config.file("src/c_helpers.c").compile("libc_helpers.a");
+ Ok(ref v) if v == "102" => {
+ println!("cargo:rustc-cfg=ossl102");
+ println!("cargo:rustc-cfg=ossl10x");
+ }
+ Ok(ref v) if v == "110" => {
+ println!("cargo:rustc-cfg=ossl110");
+ }
+ _ => panic!("Unable to detect OpenSSL version"),
}
-}
-
-#[cfg(not(feature = "c_helpers"))]
-mod imp {
- pub fn main() {}
-}
-fn main() {
- imp::main()
+ if let Ok(vars) = env::var("DEP_OPENSSL_CONF") {
+ for var in vars.split(",") {
+ println!("cargo:rustc-cfg=osslconf=\"{}\"", var);
+ }
+ }
}