diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-05-01 18:56:07 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-05-01 18:56:07 +0300 |
commit | 46ce7a9d4ba3eb10f310657242524053a96e5ed9 (patch) | |
tree | 8797ab81fb97ea3e1f51b20a6846f1036877796e /mesonbuild/interpreter.py | |
parent | 2e2df70dd041a632f4fa7460066c2cc222877210 (diff) | |
parent | 2bdaa1f0c181511fab143eccf68c77fcc60c46e2 (diff) | |
download | meson-46ce7a9d4ba3eb10f310657242524053a96e5ed9.zip meson-46ce7a9d4ba3eb10f310657242524053a96e5ed9.tar.gz meson-46ce7a9d4ba3eb10f310657242524053a96e5ed9.tar.bz2 |
Merge pull request #516 from centricular/cross-compile_32bit-x86_on_64bit-x86_exe-wrapper
Special-case the 32-bit executable on 64-bit x86 case while cross-compiling
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index d6a3a3e..e51692e 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -322,24 +322,14 @@ class BuildMachine(InterpreterObject): 'endian' : self.endian_method, }) - # Python is inconsistent in its platform module. - # It returns different values for the same cpu. - # For x86 it might return 'x86', 'i686' or somesuch. - # Do some canonicalization. def cpu_family_method(self, args, kwargs): - trial = platform.machine().lower() - if trial.startswith('i') and trial.endswith('86'): - return 'x86' - if trial.startswith('arm'): - return 'arm' - # Add fixes here as bugs are reported. - return trial + return environment.detect_cpu_family() def cpu_method(self, args, kwargs): - return platform.machine().lower() + return environment.detect_cpu() def system_method(self, args, kwargs): - return platform.system().lower() + return environment.detect_system() def endian_method(self, args, kwargs): return sys.byteorder @@ -883,9 +873,16 @@ class MesonMain(InterpreterObject): return self.interpreter.environment.build_dir def has_exe_wrapper_method(self, args, kwargs): - if self.is_cross_build_method(None, None) and 'binaries' in self.build.environment.cross_info.config: - return 'exe_wrap' in self.build.environment.cross_info.config['binaries'] - return True # This is semantically confusing. + if self.is_cross_build_method(None, None) and \ + 'binaries' in self.build.environment.cross_info.config and \ + self.build.environment.cross_info.need_exe_wrapper(): + exe_wrap = self.build.environment.cross_info.config['binaries'].get('exe_wrap', None) + if exe_wrap is None: + return False + # We return True when exe_wrap is defined, when it's not needed, and + # when we're compiling natively. The last two are semantically confusing. + # Need to revisit this. + return True def is_cross_build_method(self, args, kwargs): return self.build.environment.is_cross_build() |