From bbff2b69459a370afd6c74b6b0d3bb080ff22b89 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 14 Mar 2016 13:30:47 +0200 Subject: Add support for guessing ar/ranlib signatures --- build2/cxx/guess.cxx | 9 +-------- build2/cxx/link.cxx | 7 ++++++- build2/cxx/module.cxx | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'build2/cxx') diff --git a/build2/cxx/guess.cxx b/build2/cxx/guess.cxx index 90bf693..d2f828d 100644 --- a/build2/cxx/guess.cxx +++ b/build2/cxx/guess.cxx @@ -9,7 +9,6 @@ #include using namespace std; -using namespace butl; namespace build2 { @@ -97,7 +96,6 @@ namespace build2 static guess_result guess (const path& cxx, const string& pre) - try { tracer trace ("cxx::guess"); @@ -196,7 +194,7 @@ namespace build2 // Suppress all the compiler errors because we may be trying an // unsupported option. // - r = run (cxx, "-v", f, false, &cs); + r = run (cxx, "-v", f, false, false, &cs); if (!r.empty ()) r.checksum = cs.string (); @@ -277,11 +275,6 @@ namespace build2 return r; } - catch (const process_error& e) - { - error << "unable to execute " << cxx << ": " << e.what (); - throw failed (); - } static compiler_info guess_gcc (const path& cxx, diff --git a/build2/cxx/link.cxx b/build2/cxx/link.cxx index 0002797..f9fa69d 100644 --- a/build2/cxx/link.cxx +++ b/build2/cxx/link.cxx @@ -827,8 +827,10 @@ namespace build2 if (lt == type::a) { // If the user asked for ranlib, don't try to do its function with -s. + // Some ar implementations (e.g., the LLVM one) doesn't support + // leading '-'. // - args.push_back (ranlib ? "-rc" : "-rcs"); + args.push_back (ranlib ? "rc" : "rcs"); } else { @@ -1048,6 +1050,9 @@ namespace build2 const char* args[] = { as (*ranlib).c_str (), relt.string ().c_str (), nullptr}; + if (verb >= 2) + print_process (args); + try { process pr (args); diff --git a/build2/cxx/module.cxx b/build2/cxx/module.cxx index 8e83a9b..32f811a 100644 --- a/build2/cxx/module.cxx +++ b/build2/cxx/module.cxx @@ -194,7 +194,7 @@ namespace build2 << " build " << ci.version.build << "\n" << " signature " << ci.signature << "\n" << " checksum " << ci.checksum << "\n" - << " target " << ci.target << ""; + << " target " << ci.target; } r.assign ("cxx.id", string_type) = ci.id.string (); -- cgit v1.1