diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bootstrap.cc | 17 | ||||
-rw-r--r-- | src/configure.cc | 2 | ||||
-rw-r--r-- | src/ctor.h | 2 |
3 files changed, 8 insertions, 13 deletions
diff --git a/src/bootstrap.cc b/src/bootstrap.cc index aa50561..0179f7b 100644 --- a/src/bootstrap.cc +++ b/src/bootstrap.cc @@ -41,41 +41,36 @@ bool ctor::configuration::has(const std::string& key) const return false; } -const std::string& ctor::configuration::get(const std::string& key, const std::string& default_value) const +std::string ctor::configuration::get(const std::string& key, const std::string& default_value) const { auto cxx_env = std::getenv("CXX"); if(key == ctor::cfg::build_cxx && cxx_env) { - static std::string s = cxx_env; - return s; + return cxx_env; } auto cc_env = std::getenv("CC"); if(key == ctor::cfg::build_cc && cc_env) { - static std::string s = cc_env; - return s; + return cc_env; } auto ld_env = std::getenv("LD"); if(key == ctor::cfg::build_ld && ld_env) { - static std::string s = ld_env; - return s; + return ld_env; } auto ar_env = std::getenv("AR"); if(key == ctor::cfg::build_ar && ar_env) { - static std::string s = ar_env; - return s; + return ar_env; } auto builddir_env = std::getenv("BUILDDIR"); if(key == ctor::cfg::builddir && builddir_env) { - static std::string s = builddir_env; - return s; + return builddir_env; } return default_value; diff --git a/src/configure.cc b/src/configure.cc index 553e368..7a68f03 100644 --- a/src/configure.cc +++ b/src/configure.cc @@ -69,7 +69,7 @@ bool ctor::configuration::has(const std::string& key) const return tools.find(key) != tools.end(); } -const std::string& ctor::configuration::get(const std::string& key, const std::string& default_value) const +std::string ctor::configuration::get(const std::string& key, const std::string& default_value) const { if(key == ctor::cfg::ctor_includedir && ctor::includedir) { @@ -283,7 +283,7 @@ constexpr auto ctor_libdir = "ctor-libdir"; struct configuration { bool has(const std::string& key) const; - const std::string& get(const std::string& key, const std::string& default_value = {}) const; + std::string get(const std::string& key, const std::string& default_value = {}) const; ctor::toolchain host_toolchain{ctor::toolchain::none}; ctor::arch host_arch{ctor::arch::unknown}; |