This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and link unicorn from source. (#16)
Patch submitted by m4b.
- Loading branch information
Showing
5 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "unicorn"] | ||
path = unicorn | ||
url = https://github.com/unicorn-engine/unicorn | ||
branch = master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
extern crate gcc; | ||
|
||
use std::path::{Path}; | ||
use std::process::Command; | ||
use std::env; | ||
|
||
fn main() { | ||
if !Path::new("unicorn/.git").exists() { | ||
let _ = Command::new("git").args(&["submodule", "update", "--init", "--depth", "5"]) | ||
.status(); | ||
} | ||
let out_dir = env::var("OUT_DIR").unwrap(); | ||
let _ = Command::new("./make.sh").current_dir("unicorn").status(); | ||
let capstone = "libunicorn.a"; | ||
let _ = Command::new("cp").current_dir("unicorn").arg(&capstone).arg(&out_dir).status(); | ||
println!("cargo:rustc-link-search=native={}", out_dir); | ||
println!("cargo:rustc-link-lib=static=unicorn"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters