fix for dependent lib openssl

master
Niko PLP 2 years ago
parent f154b3d03f
commit 43152750aa
  1. 2
      librocksdb-sys/Cargo.toml
  2. 55
      librocksdb-sys/build.rs
  3. 2
      librocksdb-sys/src/lib.rs

@ -32,7 +32,7 @@ zstd-sys = { version = "2.0", features = ["zdict_builder"], optional = true }
libz-sys = { version = "1.1", default-features = false, optional = true } libz-sys = { version = "1.1", default-features = false, optional = true }
bzip2-sys = { version = "0.1", default-features = false, optional = true } bzip2-sys = { version = "0.1", default-features = false, optional = true }
[target.'cfg(not(any(target_os = "linux",target_os = "darwin",target_os = "openbsd")))'.dependencies.openssl] [target.'cfg(not(any(target_os = "linux",target_os = "darwin")))'.dependencies.openssl]
version = "0.10" version = "0.10"
features = ["vendored"] features = ["vendored"]

@ -144,32 +144,32 @@ fn build_rocksdb() {
// config.flag("-march=haswell"); // config.flag("-march=haswell");
// the flag has been moved to the darwin. openbsd, freebsd and linux cases below // the flag has been moved to the darwin. openbsd, freebsd and linux cases below
} }
if !target.contains("openbsd") {
if !target.contains("darwin") && !target.contains("linux") { if !target.contains("darwin") && !target.contains("linux") {
config.include("rocksdb/plugin/openssl/include"); config.include("rocksdb/plugin/openssl/include");
lib_sources.push("plugin/openssl/openssl_provider.cc"); lib_sources.push("plugin/openssl/openssl_provider.cc");
let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); // let dir = env::var("CARGO_MANIFEST_DIR").unwrap();
println!( // println!(
"cargo:rustc-link-search=dependency={}", // "cargo:rustc-link-search=dependency={}",
Path::new(&dir) // Path::new(&dir)
//.join("rocksdb/plugin/ippcp/library/macos/lib") // //.join("rocksdb/plugin/ippcp/library/macos/lib")
.display() // .display()
); // );
println!("cargo:rustc-link-lib=static=crypto"); // println!("cargo:rustc-link-lib=static=crypto");
} else { } else {
// on macos and linux we use the IPPCP plugin of rocksdb for the crypto (the lib is precompiled) // on macos and linux we use the IPPCP plugin of rocksdb for the crypto (the lib is precompiled)
config.include("rocksdb/plugin/ippcp/library/include"); config.include("rocksdb/plugin/ippcp/library/include");
lib_sources.push("plugin/ippcp/ippcp_provider.cc"); lib_sources.push("plugin/ippcp/ippcp_provider.cc");
let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); let dir = env::var("CARGO_MANIFEST_DIR").unwrap();
println!( println!(
"cargo:rustc-link-search=native={}", "cargo:rustc-link-search=native={}",
Path::new(&dir) Path::new(&dir)
.join("rocksdb/plugin/ippcp/library/macos/lib") .join("rocksdb/plugin/ippcp/library/macos/lib")
.display() .display()
); );
println!("cargo:rustc-link-lib=static=ippcp"); println!("cargo:rustc-link-lib=static=ippcp");
}
} }
if target.contains("apple-ios") { if target.contains("apple-ios") {
config.define("OS_MACOSX", None); config.define("OS_MACOSX", None);
config.define("IOS_CROSS_COMPILE", None); config.define("IOS_CROSS_COMPILE", None);
@ -230,10 +230,9 @@ fn build_rocksdb() {
println!("cargo:rustc-link-arg=-pthread"); println!("cargo:rustc-link-arg=-pthread");
config.flag("-fno-builtin-memcmp"); config.flag("-fno-builtin-memcmp");
config.define("_REENTRANT", None); config.define("_REENTRANT", None);
config.include("/usr/include"); // config.include("rocksdb/plugin/openssl/include");
lib_sources.push("plugin/openssl/openssl_provider.cc"); // lib_sources.push("plugin/openssl/openssl_provider.cc");
// let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); // let dir = env::var("CARGO_MANIFEST_DIR").unwrap();
println!("cargo:rustc-link-arg=-lcrypto");
// println!("cargo:rustc-link-lib=static=crypto"); // println!("cargo:rustc-link-lib=static=crypto");
} else if target.contains("windows") { } else if target.contains("windows") {
link("rpcrt4", false); link("rpcrt4", false);

@ -24,7 +24,7 @@ extern crate bzip2_sys;
extern crate libz_sys; extern crate libz_sys;
#[cfg(feature = "lz4")] #[cfg(feature = "lz4")]
extern crate lz4_sys; extern crate lz4_sys;
#[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "openbsd")))] #[cfg(not(any(target_os = "linux", target_os = "macos")))]
extern crate openssl; extern crate openssl;
#[cfg(feature = "zstd")] #[cfg(feature = "zstd")]
extern crate zstd_sys; extern crate zstd_sys;

Loading…
Cancel
Save