Skip to content

Commit 269427f

Browse files
authored
Do not overwrite AR and RANLIB env vars if set (#62)
1 parent babdbf0 commit 269427f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,12 @@ impl Build {
218218
// as well.
219219
if path.ends_with("-gcc") && !target.contains("unknown-linux-musl") {
220220
let path = &path[..path.len() - 4];
221-
configure.env("RANLIB", format!("{}-ranlib", path));
222-
configure.env("AR", format!("{}-ar", path));
221+
if env::var_os("RANLIB").is_none() {
222+
configure.env("RANLIB", format!("{}-ranlib", path));
223+
}
224+
if env::var_os("AR").is_none() {
225+
configure.env("AR", format!("{}-ar", path));
226+
}
223227
}
224228

225229
// Make sure we pass extra flags like `-ffunction-sections` and

0 commit comments

Comments
 (0)