meson 0.54 now honors _FOR_BUILD env vars, and we don't have to set CC
and friends to the host system vars. Setting PKG_CONFIG_FOR_BUILD is
needed since otherwise it would pickup our cross wrapper
This is necessary so that crossbuilds to unsupported architectures
are not actually attempted. There is a default archs set which
covers all architectures supported by the official compiler,
and setting it in the template can be used to restrict it more.
Also, add missing GOARCHs. These are irrelevant to whether we
can currently build for that arch or not. Just keep it around
as a list of potential archs to support. These are taken from
gccgo, and in case support for anything is added in the official
compiler, they should match.
From commit cf6e6f14d3, (wrappers/uname: report correct machine type
on ethereal, 2020-02-10).
Some template use `env -i` to reset environment variable for building
host's binary file, thus the wrapped `uname -m` reports empty strings.
Fix it by falling back to the value reported by `/usr/bin/uname -m`.
We don't expect people cross-compile from i686-ethereal-chroot on top
of x86_64 machine, it was expected to use for travis to native compile
i686 only.
At least since 0.53, the meson buildsystem checks whether the
"date" command's file is outdated and if it is, it'll trigger
regeneration of the build files.
Since the wrappers are reinstalled from scratch on every build step,
this would result in meson being re-run on each of those steps.
Which resulted in broken builds in some projects (e.g. efl) since
our meson build-style by default uses LTO and that requires the AR
environment variable being exported in a specific way, which was
only being done for the do_configure step but not build/install,
which resulted in meson being run with one env for configure and
another env for build, which broke everything.