You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
741 B
30 lines
741 B
#![feature(env, path)]
|
|
|
|
extern crate "pkg-config" as pkg_config;
|
|
extern crate gcc;
|
|
|
|
use std::default::Default;
|
|
use std::os;
|
|
use std::env;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
|
|
let mut lmdb: PathBuf = PathBuf::new(&env::var("CARGO_MANIFEST_DIR").unwrap());
|
|
lmdb.push("mdb");
|
|
lmdb.push("libraries");
|
|
lmdb.push("liblmdb");
|
|
|
|
let mut mdb: PathBuf = lmdb.clone();
|
|
let mut midl: PathBuf = lmdb.clone();
|
|
|
|
mdb.push("mdb.c");
|
|
midl.push("midl.c");
|
|
|
|
if !pkg_config::find_library("liblmdb").is_ok() {
|
|
gcc::compile_library("liblmdb.a",
|
|
&Default::default(),
|
|
&[(*mdb).to_str().unwrap(),
|
|
(*midl).to_str().unwrap()]);
|
|
}
|
|
}
|
|
|