Skip to content

Commit

Permalink
Revert "Correctly infer ranlib/ar from cross-gcc (#163)"
Browse files Browse the repository at this point in the history
This reverts commit 31ef083.
  • Loading branch information
alexcrichton committed Oct 26, 2022
1 parent 31ef083 commit cbbb491
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,15 @@ impl Build {
configure.env_remove("CROSS_COMPILE");

// Infer ar/ranlib tools from cross compilers if the it looks like
// we're doing something like `foo-gcc` route that to `foo-gcc-ranlib`
// we're doing something like `foo-gcc` route that to `foo-ranlib`
// as well.
if path.ends_with("-gcc") && !target.contains("unknown-linux-musl") {
let suffix = &path[path.len() - 4..];
let path = &path[..path.len() - suffix.len()];
let path = &path[..path.len() - 4];
if env::var_os("RANLIB").is_none() {
configure.env("RANLIB", format!("{}{}-ranlib", path, suffix));
configure.env("RANLIB", format!("{}-ranlib", path));
}
if env::var_os("AR").is_none() {
configure.env("AR", format!("{}{}-ar", path, suffix));
configure.env("AR", format!("{}-ar", path));
}
}

Expand Down

0 comments on commit cbbb491

Please sign in to comment.