|
|
|
@ -4,7 +4,7 @@ use std::os; |
|
|
|
|
use std::io::{mod, fs, Command}; |
|
|
|
|
use std::io::process::InheritFd; |
|
|
|
|
|
|
|
|
|
//TODO windows + osx support
|
|
|
|
|
//TODO windows support
|
|
|
|
|
|
|
|
|
|
fn main() { |
|
|
|
|
// Next, fall back and try to use pkg-config if its available.
|
|
|
|
@ -18,12 +18,7 @@ fn main() { |
|
|
|
|
|
|
|
|
|
let _ = fs::mkdir(&dst.join("build"), io::USER_DIR); |
|
|
|
|
|
|
|
|
|
let mut config_opts = Vec::new(); |
|
|
|
|
config_opts.push("--enable-static=yes".to_string()); |
|
|
|
|
config_opts.push(format!("--prefix={}", dst.display())); |
|
|
|
|
config_opts.push("--disable-manual".to_string()); |
|
|
|
|
|
|
|
|
|
println!("cwd: {}", src.as_str()); |
|
|
|
|
println!("cwd: {}", src.join("rocksdb").as_str()); |
|
|
|
|
run(Command::new(make()) |
|
|
|
|
.arg("shared_lib") |
|
|
|
|
.arg(format!("-j{}", os::getenv("NUM_JOBS").unwrap())) |
|
|
|
@ -33,7 +28,12 @@ fn main() { |
|
|
|
|
// for windows.
|
|
|
|
|
fs::mkdir_recursive(&dst.join("lib/pkgconfig"), io::USER_DIR).unwrap(); |
|
|
|
|
|
|
|
|
|
fs::rename(&src.join("rocksdb/librocksdb.so"), &dst.join("lib/librocksdb.so")).unwrap(); |
|
|
|
|
let target = os::getenv("TARGET").unwrap(); |
|
|
|
|
if target.contains("apple") { |
|
|
|
|
fs::rename(&src.join("rocksdb/librocksdb.dylib"), &dst.join("lib/librocksdb.dylib")).unwrap(); |
|
|
|
|
} else { |
|
|
|
|
fs::rename(&src.join("rocksdb/librocksdb.so"), &dst.join("lib/librocksdb.so")).unwrap(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
println!("cargo:rustc-flags=-L {}/lib -l rocksdb:dylib", dst.display()); |
|
|
|
|
println!("cargo:root={}", dst.display()); |
|
|
|
|