aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/envconfig.py
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-03-19 18:05:31 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2020-03-23 17:51:36 +0200
commit097dfc085e6a1bb3c670880134a52dcfca504be7 (patch)
tree28fee5185ded91d44542b70fe3f62bb72e29020a /mesonbuild/envconfig.py
parent3a4388e51dee5e7e58f1e5ad4e60fb73b4aacf08 (diff)
downloadmeson-097dfc085e6a1bb3c670880134a52dcfca504be7.zip
meson-097dfc085e6a1bb3c670880134a52dcfca504be7.tar.gz
meson-097dfc085e6a1bb3c670880134a52dcfca504be7.tar.bz2
Naturally use env vars a bit more to match Autoconf
PR #6363 made it so our interpretation of env vars no longer clashed with Autoconf's: if both Meson and Autoconf would read and env var, both would do the same things with the value they read. However, there were still cases that autoconf would read an env var when meson wouldn't: - Autoconf would use `CC` in cross builds too - Autoconf would use `CC_FOR_BUILD` in native builds too. There's no reason Meson can't also do this--if native cross files overwrite rather than replace env vars, cross files can also overwrite rather than replace env vars. Because variables like `CC` are so ubiquitous, and because ignoring them in cross builds just makes those builds liable to break (and things more complicated in general), we bring Meson's behavior in line with Autoconf's.
Diffstat (limited to 'mesonbuild/envconfig.py')
-rw-r--r--mesonbuild/envconfig.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
index ac13a71..e0d07c5 100644
--- a/mesonbuild/envconfig.py
+++ b/mesonbuild/envconfig.py
@@ -119,9 +119,9 @@ def get_env_var_pair(for_machine: MachineChoice,
# compiling we fall back on the unprefixed host version. This
# allows native builds to never need to worry about the 'BUILD_*'
# ones.
- ([var_name + '_FOR_BUILD'] if is_cross else [var_name]),
+ [var_name + '_FOR_BUILD'] + ([] if is_cross else [var_name]),
# Always just the unprefixed host verions
- ([] if is_cross else [var_name]),
+ [var_name],
)[for_machine]
for var in candidates:
value = os.environ.get(var)