summaryrefslogtreecommitdiff
path: root/src/bootstrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap.cc')
-rw-r--r--src/bootstrap.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/bootstrap.cc b/src/bootstrap.cc
index 55bd3e0..45ecad4 100644
--- a/src/bootstrap.cc
+++ b/src/bootstrap.cc
@@ -42,33 +42,38 @@ 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::build_cxx && std::getenv("CXX"))
+ auto cxx_env = std::getenv("CXX");
+ if(key == ctor::cfg::build_cxx && cxx_env)
{
- static std::string s = std::getenv("CXX");
+ static std::string s = cxx_env;
return s;
}
- if(key == ctor::cfg::build_cc && std::getenv("CC"))
+ auto cc_env = std::getenv("CC");
+ if(key == ctor::cfg::build_cc && cc_env)
{
- static std::string s = std::getenv("CC");
+ static std::string s = cc_env;
return s;
}
- if(key == ctor::cfg::build_ld && std::getenv("LD"))
+ auto ld_env = std::getenv("LD");
+ if(key == ctor::cfg::build_ld && ld_env)
{
- static std::string s = std::getenv("LD");
+ static std::string s = ld_env;
return s;
}
- if(key == ctor::cfg::build_ar && std::getenv("AR"))
+ auto ar_env = std::getenv("AR");
+ if(key == ctor::cfg::build_ar && ar_env)
{
- static std::string s = std::getenv("AR");
+ static std::string s = ar_env;
return s;
}
- if(key == ctor::cfg::builddir && std::getenv("BUILDDIR"))
+ auto builddir_env = std::getenv("BUILDDIR");
+ if(key == ctor::cfg::builddir && builddir_env)
{
- static std::string s = std::getenv("BUILDDIR");
+ static std::string s = builddir_env;
return s;
}