external_project.py: fix --host value

Currently in cross-compilation mode the --host is set to x86-linux-linux,
which results in an error.
Change the code so that for x86 and x86_64 the second part is 'pc',
and 'unknown' for the rest.
Use cpu model instead of cpu family for the first part, as suggested
by @dcbaker
As the result, we get: i386-pc-linux on my setup.

Fixes #12608
pull/12616/head
Stas Sergeev 12 months ago committed by Xavier Claessens
parent 5de09cbe88
commit be04234c85
  1. 5
      mesonbuild/modules/external_project.py

@ -136,8 +136,9 @@ class ExternalProject(NewExtensionModule):
configure_cmd += self._format_options(self.configure_options, d)
if self.env.is_cross_build():
host = '{}-{}-{}'.format(self.host_machine.cpu_family,
self.build_machine.system,
host = '{}-{}-{}'.format(self.host_machine.cpu,
'pc' if self.host_machine.cpu_family in {"x86", "x86_64"}
else 'unknown',
self.host_machine.system)
d = [('HOST', None, host)]
configure_cmd += self._format_options(self.cross_configure_options, d)

Loading…
Cancel
Save