Building and using local libsodium library automatically

pull/9/head
Dennis Schwerdel 2016-04-11 09:10:29 +02:00
parent ada79c0836
commit 8d4f1ef345
3 changed files with 14 additions and 1 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ vpncloud-oldnodes
._*
.~*
deb/vpncloud/vpncloud*
Stats.ods

View File

@ -2,6 +2,10 @@
This project follows [semantic versioning](http://semver.org).
### Unreleased
- [changed] Building and using local libsodium library automatically
### v0.5.0 (2016-04-05)
- [added] Added license and copyright information

View File

@ -1,7 +1,15 @@
extern crate gcc;
extern crate pkg_config;
use std::process::Command;
use std::path::Path;
fn main() {
pkg_config::find_library("libsodium").unwrap();
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();
}
gcc::Config::new().file("src/c/tuntap.c").include("src").compile("libtuntap.a");
println!("cargo:rustc-link-search={}", "libsodium/src/libsodium/.libs");
}