aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2014-12-03 12:57:49 -0800
committerSteven Fackler <[email protected]>2014-12-03 12:57:49 -0800
commitb91a267082d3066bb369d3aa5b572d48b9ed8ded (patch)
treec7e79a4b158258247b2cf9ee015ea19741ff4f2c
parentFix doc test and stop doc upload (diff)
parentAllow passing in Android paths (diff)
downloadrust-openssl-b91a267082d3066bb369d3aa5b572d48b9ed8ded.tar.xz
rust-openssl-b91a267082d3066bb369d3aa5b572d48b9ed8ded.zip
Merge pull request #109 from Manishearth/android
Allow passing in Android paths
-rw-r--r--README.md5
-rw-r--r--openssl-sys/src/build.rs10
2 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index acb9b636..427f6e47 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,11 @@ For some reason, the OpenSSL distribution for Windows is structured differently,
1. Run `sudo apt-get install libssl-dev`.
2. Run `cargo build`.
+###Android
+1. Follow the steps [here](wiki.openssl.org/index.php/Android) to build OpenSSL for android
+2. Provide the path to the libssl and libcrypto binaries via `$OPENSSL_PATH`
+3. Build the package with `cargo build`
+
###Windows
1. Grab the latest Win32 OpenSSL installer [here][1]. At the time of this writing, it's v1.0.1i. If you're using 64-bit Rust (coming to Windows soon), then you should get the Win64 installer instead.
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);
}
}