aboutsummaryrefslogtreecommitdiff
path: root/build2/bin
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-10-19 10:44:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-10-19 10:44:52 +0200
commit83459829f24624e3cee20a7199af5c69e9678b69 (patch)
tree81774d67dac0829c39a351cfbfe8e7be808bb94d /build2/bin
parent9f9a7c8b7ab245fd20706ff9f6e834899b86b4e6 (diff)
Suggest override variable (config.x) when tool is not found
Diffstat (limited to 'build2/bin')
-rw-r--r--build2/bin/guess.cxx47
1 files changed, 41 insertions, 6 deletions
diff --git a/build2/bin/guess.cxx b/build2/bin/guess.cxx
index a142e59..78a1940 100644
--- a/build2/bin/guess.cxx
+++ b/build2/bin/guess.cxx
@@ -42,12 +42,29 @@ namespace build2
{
tracer trace ("bin::guess_ar");
+ process_path arp, rlp;
guess_result arr, rlr;
- process_path arp (run_search (ar, true, fallback));
- process_path rlp (rl != nullptr
- ? run_search (*rl, true, fallback)
- : process_path ());
+ {
+ auto df = make_diag_frame (
+ [](const diag_record& dr)
+ {
+ dr << info << "use config.bin.ar to override";
+ });
+
+ arp = run_search (ar, true, fallback);
+ }
+
+ if (rl != nullptr)
+ {
+ auto df = make_diag_frame (
+ [](const diag_record& dr)
+ {
+ dr << info << "use config.bin.ranlib to override";
+ });
+
+ rlp = run_search (*rl, true, fallback);
+ }
// Binutils, LLVM, and FreeBSD ar/ranlib all recognize the --version
// option. While Microsoft's lib.exe doesn't support --version, it only
@@ -244,7 +261,16 @@ namespace build2
guess_result r;
- process_path pp (run_search (ld, true, fallback));
+ process_path pp;
+ {
+ auto df = make_diag_frame (
+ [](const diag_record& dr)
+ {
+ dr << info << "use config.bin.ld to override";
+ });
+
+ pp = run_search (ld, true, fallback);
+ }
// Binutils ld recognizes the --version option. Microsoft's link.exe
// doesn't support --version (nor any other way to get the version
@@ -363,7 +389,16 @@ namespace build2
guess_result r;
- process_path pp (run_search (rc, true, fallback));
+ process_path pp;
+ {
+ auto df = make_diag_frame (
+ [](const diag_record& dr)
+ {
+ dr << info << "use config.bin.rc to override";
+ });
+
+ pp = run_search (rc, true, fallback);
+ }
// Binutils windres recognizes the --version option.
//