From 107924873bd31014bbe67899961e2970ac2334f3 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 23 Jan 2025 22:13:22 +0100 Subject: Use locate on env supplied tools. --- src/bootstrap.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/bootstrap.cc') diff --git a/src/bootstrap.cc b/src/bootstrap.cc index 0179f7b..42706c1 100644 --- a/src/bootstrap.cc +++ b/src/bootstrap.cc @@ -43,28 +43,33 @@ bool ctor::configuration::has(const std::string& key) const std::string ctor::configuration::get(const std::string& key, const std::string& default_value) const { + static auto paths = get_paths(); auto cxx_env = std::getenv("CXX"); if(key == ctor::cfg::build_cxx && cxx_env) { - return cxx_env; + static auto cxx_prog = locate(cxx_env, paths); + return cxx_prog; } auto cc_env = std::getenv("CC"); if(key == ctor::cfg::build_cc && cc_env) { - return cc_env; + static auto cc_prog = locate(cc_env, paths); + return cc_prog; } auto ld_env = std::getenv("LD"); if(key == ctor::cfg::build_ld && ld_env) { - return ld_env; + static auto ld_prog = locate(ld_env, paths); + return ld_prog; } auto ar_env = std::getenv("AR"); if(key == ctor::cfg::build_ar && ar_env) { - return ar_env; + static auto ar_prog = locate(ar_env, paths); + return ar_prog; } auto builddir_env = std::getenv("BUILDDIR"); -- cgit v1.2.3