summaryrefslogtreecommitdiff
path: root/libssh2-sys/build.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-11-07 15:22:08 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-11-07 15:23:06 -0800
commitb389fe2bf3967f6f0216d0fc14fae585a07c769a (patch)
tree73421122be74aebf1e86076574209232eba25014 /libssh2-sys/build.rs
parentbb669a336489ab22b51858eff0e0971053859cb8 (diff)
downloadssh2-rs-b389fe2bf3967f6f0216d0fc14fae585a07c769a.zip
Munge windows to do the right thing
Diffstat (limited to 'libssh2-sys/build.rs')
-rw-r--r--libssh2-sys/build.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs
index f624e4b..fff510a 100644
--- a/libssh2-sys/build.rs
+++ b/libssh2-sys/build.rs
@@ -42,10 +42,18 @@ fn main() {
fs::mkdir(&dst.join("build"), io::USER_DIR).unwrap();
let root = src.join("libssh2-1.4.4-20140901");
- run(Command::new(root.join("configure"))
+ // Can't run ./configure directly on msys2 b/c we're handing in
+ // Windows-style paths (those starting with C:\), but it chokes on those.
+ // For that reason we build up a shell script with paths converted to
+ // posix versions hopefully...
+ run(Command::new("sh")
.env("CFLAGS", cflags)
- .args(config_opts.as_slice())
- .cwd(&dst.join("build")));
+ .cwd(&dst.join("build"))
+ .arg("-c")
+ .arg(format!("{} {}", root.join("configure").display(),
+ config_opts.connect(" "))
+ .replace("C:\\", "/c/")
+ .replace("\\", "/")));
run(Command::new(make())
.arg(format!("-j{}", os::getenv("NUM_JOBS").unwrap()))
.cwd(&dst.join("build/src")));