mirror of https://github.com/dswd/vpncloud.git
Building and using local libsodium library automatically
This commit is contained in:
parent
ada79c0836
commit
8d4f1ef345
|
@ -3,3 +3,4 @@ vpncloud-oldnodes
|
|||
._*
|
||||
.~*
|
||||
deb/vpncloud/vpncloud*
|
||||
Stats.ods
|
||||
|
|
|
@ -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
|
||||
|
|
12
build.rs
12
build.rs
|
@ -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();
|
||||
gcc::Config::new().file("src/c/tuntap.c").include("src").compile("libtuntap.a");
|
||||
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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue