summaryrefslogtreecommitdiff
path: root/src/configure.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/configure.cc')
-rw-r--r--src/configure.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/configure.cc b/src/configure.cc
index b2639cb..68ce7eb 100644
--- a/src/configure.cc
+++ b/src/configure.cc
@@ -426,6 +426,12 @@ int regenerateCache(ctor::settings& settings,
auto paths = get_paths();
+ auto path_env = env.find("PATH");
+ if(path_env != env.end())
+ {
+ paths = get_paths(path_env->second);
+ }
+
// Host detection
auto host_cc = locate(cc_prog, paths, host_arch_prefix);
if(host_cc.empty())
@@ -695,6 +701,12 @@ int configure(const ctor::settings& global_settings, int argc, char* argv[])
env["LD"] = ld_env;
}
+ auto path_env = getenv("PATH");
+ if(path_env)
+ {
+ env["PATH"] = path_env;
+ }
+
auto ret = regenerateCache(settings, argv[0], args, env);
if(ret != 0)
{