From 097dfc085e6a1bb3c670880134a52dcfca504be7 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 19 Mar 2020 18:05:31 -0400 Subject: 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. --- run_unittests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index d1c10f5..4ae1728 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -6338,11 +6338,10 @@ c = ['{0}'] testdir = os.path.join(self.unit_test_dir, '61 identity cross') env = { 'CC_FOR_BUILD': '"' + os.path.join(testdir, 'build_wrapper.py') + '"', + 'CC': '"' + os.path.join(testdir, 'host_wrapper.py') + '"', } crossfile = tempfile.NamedTemporaryFile(mode='w') - crossfile.write('''[binaries] -c = ['{0}'] -'''.format(os.path.join(testdir, 'host_wrapper.py'))) + crossfile.write('') crossfile.flush() self.meson_cross_file = crossfile.name # TODO should someday be explicit about build platform only here -- cgit v1.1