OSX support

master
Tyler Neely 10 years ago
parent ffa6daf263
commit 0b25aa219d
  1. 15
      README.md
  2. 16
      rocksdb-sys/build.rs

@ -6,22 +6,21 @@ rust-rocksdb
* status (uncompleted tasks are not ranked by priority):
- [x] basic open/put/get/close
- [x] linux support
- [x] rocksdb itself retrieved and compiled via cargo
- [ ] OSX support
- [ ] windows support
- [x] rocksdb compiled via cargo
- [x] OSX support
- [ ] column family operations
- [ ] LRU cache
- [ ] destroy/repair
- [ ] batch
- [ ] iterator
- [ ] create/release snapshot
- [ ] range
- [ ] compaction filter, style
- [ ] rustic merge operator
- [ ] compaction filter, style
- [ ] comparator
- [ ] slicetransform
- [ ] LRU cache
- [ ] windows support
- [ ] logger
- [ ] column family operations
- [ ] destroy/repair
- [ ] windows support
### running
- Cargo.toml

@ -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());

Loading…
Cancel
Save