another attempt at compiling rocksdb on openbsd and linking to OS libcrypto

master
Niko PLP 1 year ago
parent e220f4f9e6
commit 79d7017cd4
  1. 2
      librocksdb-sys/Cargo.toml
  2. 17
      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")))'.dependencies.openssl] [target.'cfg(not(any(target_os = "linux",target_os = "darwin",target_os = "openbsd")))'.dependencies.openssl]
version = "0.10" version = "0.10"
features = ["vendored"] features = ["vendored"]

@ -157,8 +157,7 @@ fn build_rocksdb() {
.display() .display()
); );
println!("cargo:rustc-link-lib=static=ippcp"); println!("cargo:rustc-link-lib=static=ippcp");
} else { } else if !target.contains("openbsd") {
//if !target.contains("openbsd") {
if let Some(include) = std::env::var_os("DEP_OPENSSL_INCLUDE") { if let Some(include) = std::env::var_os("DEP_OPENSSL_INCLUDE") {
config.include(include); config.include(include);
} else { } else {
@ -235,12 +234,20 @@ fn build_rocksdb() {
config.define("ROCKSDB_PLATFORM_POSIX", None); config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None); config.define("ROCKSDB_LIB_IO_POSIX", None);
println!("cargo:rustc-link-arg=-pthread"); println!("cargo:rustc-link-arg=-pthread");
println!("cargo:rustc-link-arg=-lz");
println!("cargo:rustc-link-arg=-lexecinfo");
config.flag("-fno-builtin-memcmp"); config.flag("-fno-builtin-memcmp");
config.flag_if_supported("-faligned-new");
config.flag("-Wshorten-64-to-32");
config.define("ZLIB", None);
config.define("ROCKSDB_BACKTRACE", None);
config.define("HAVE_UINT128_EXTENSION", None);
config.define("DHAVE_ALIGNED_NEW", None);
config.define("_REENTRANT", None); config.define("_REENTRANT", None);
//pkg_config::Config::new().probe("openssl").unwrap(); //pkg_config::Config::new().probe("openssl").unwrap();
//// 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");
//config.flag("-lcrypto"); config.flag("-lcrypto");
// let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); // let dir = env::var("CARGO_MANIFEST_DIR").unwrap();
// println!("cargo:rustc-link-lib=static=crypto"); // println!("cargo:rustc-link-lib=static=crypto");
} else if target.contains("windows") { } else if target.contains("windows") {

@ -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")))] #[cfg(not(any(target_os = "linux", target_os = "macos",target_os="openbsd")))]
extern crate openssl; extern crate openssl;
#[cfg(feature = "zstd")] #[cfg(feature = "zstd")]
extern crate zstd_sys; extern crate zstd_sys;

Loading…
Cancel
Save