From cdd5198aa2b1062ae0aa61a7396a7535a4f80ace Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 21 Jan 2023 16:31:54 +0100 Subject: Make sure libctor itself is built in the 'build' system and not 'host' system. Only detect tooling for the system/tools actually required in the tasks. --- src/bootstrap.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/bootstrap.cc') diff --git a/src/bootstrap.cc b/src/bootstrap.cc index bb2d45f..55bd3e0 100644 --- a/src/bootstrap.cc +++ b/src/bootstrap.cc @@ -28,7 +28,7 @@ const ctor::configuration& ctor::get_configuration() static bool initialised{false}; if(!initialised) { - cfg.host_toolchain = getToolChain(cfg.get(ctor::cfg::host_cxx, "/usr/bin/g++")); + cfg.build_toolchain = getToolChain(cfg.get(ctor::cfg::build_cxx, "/usr/bin/g++")); initialised = true; } @@ -42,13 +42,25 @@ bool ctor::configuration::has(const std::string& key) const const std::string& ctor::configuration::get(const std::string& key, const std::string& default_value) const { - if(key == ctor::cfg::host_cxx && std::getenv("CXX")) + if(key == ctor::cfg::build_cxx && std::getenv("CXX")) { static std::string s = std::getenv("CXX"); return s; } - if(key == ctor::cfg::host_ar && std::getenv("AR")) + if(key == ctor::cfg::build_cc && std::getenv("CC")) + { + static std::string s = std::getenv("CC"); + return s; + } + + if(key == ctor::cfg::build_ld && std::getenv("LD")) + { + static std::string s = std::getenv("LD"); + return s; + } + + if(key == ctor::cfg::build_ar && std::getenv("AR")) { static std::string s = std::getenv("AR"); return s; -- cgit v1.2.3