diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-21 16:31:54 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-21 22:15:33 +0100 |
commit | a38c6682e4fb1f45aa1f37d10c2480aa517ea3bc (patch) | |
tree | d767d3f18eab231fdd0cff8fdd0c602869c42848 /src/bootstrap.cc | |
parent | e4ccfe780f52cdb6c0764074effcd60235d33762 (diff) |
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.
Diffstat (limited to 'src/bootstrap.cc')
-rw-r--r-- | src/bootstrap.cc | 18 |
1 files changed, 15 insertions, 3 deletions
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; |