Skip to content

Commit fdc5658

Browse files
ehussalexcrichton
authored andcommitted
Fix RANLIB and ARFLAGS (alexcrichton#185)
1 parent 50efcde commit fdc5658

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/lib.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ impl Build {
348348

349349
let ar = cc.get_archiver();
350350
configure.env("AR", ar.get_program());
351-
if ar.get_args().count() == 0 {
351+
if ar.get_args().count() != 0 {
352352
// On some platforms (like emscripten on windows), the ar to use may not be a
353353
// single binary, but instead a multi-argument command like `cmd /c emar.bar`.
354354
// We can't convey that through `AR` alone, and so also need to set ARFLAGS.
@@ -358,14 +358,10 @@ impl Build {
358358
);
359359
}
360360
let ranlib = cc.get_ranlib();
361-
configure.env("RANLIB", ranlib.get_program());
362-
if ranlib.get_args().count() == 0 {
363-
// Same thing as for AR -- we may need to set RANLIBFLAGS
364-
configure.env(
365-
"RANLIBFLAGS",
366-
ranlib.get_args().collect::<Vec<_>>().join(OsStr::new(" ")),
367-
);
368-
}
361+
// OpenSSL does not support RANLIBFLAGS. Jam the flags in RANLIB.
362+
let mut args = vec![ranlib.get_program()];
363+
args.extend(ranlib.get_args());
364+
configure.env("RANLIB", args.join(OsStr::new(" ")));
369365

370366
// Make sure we pass extra flags like `-ffunction-sections` and
371367
// other things like ARM codegen flags.

0 commit comments

Comments
 (0)