2015-11-19 15:34:20 +00:00
|
|
|
extern crate gcc;
|
2015-11-30 16:27:50 +00:00
|
|
|
extern crate pkg_config;
|
2015-11-19 15:34:20 +00:00
|
|
|
|
2016-04-11 07:10:29 +00:00
|
|
|
use std::process::Command;
|
|
|
|
use std::path::Path;
|
|
|
|
|
2015-11-19 15:34:20 +00:00
|
|
|
fn main() {
|
2016-04-11 07:10:29 +00:00
|
|
|
if ! Path::new("libsodium/src/libsodium/.libs/libsodium.a").exists() {
|
|
|
|
Command::new("sh").arg("autogen.sh").current_dir("libsodium").status().unwrap();
|
|
|
|
Command::new("sh").arg("configure").current_dir("libsodium").status().unwrap();
|
|
|
|
Command::new("make").current_dir("libsodium").status().unwrap();
|
|
|
|
}
|
2015-11-21 16:06:57 +00:00
|
|
|
gcc::Config::new().file("src/c/tuntap.c").include("src").compile("libtuntap.a");
|
2016-04-11 07:10:29 +00:00
|
|
|
println!("cargo:rustc-link-search={}", "libsodium/src/libsodium/.libs");
|
2015-11-21 16:06:57 +00:00
|
|
|
}
|