summaryrefslogtreecommitdiff
path: root/src/configure.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2023-01-20 14:45:45 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2023-01-20 14:45:45 +0100
commiteb00bd14df2072acf9f80912153476ea6e657b07 (patch)
treeafdbf7b2bbc5d4d52d0b0e672d618bfab96642ff /src/configure.cc
parenta5585150f0ff8d27ddd22792f521f1374a3eedd8 (diff)
Store PATH in env in configuration.cc for use in future reconfigure calls.
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)
{