On 10/13/22 13:07, Daniel P. Berrangé wrote:
The only thing 'configure' seems to be doing with the 'bigendian'
env var it sets, is to construct a meson cross compiler spec
Yes, this is then available from host_machine.endian() in Meson. It was
used via
config_host_data.set('HOST_WORDS_BIGENDIAN',
host_machine.endian() == 'big')
until 6.2. Now there's no explicit use but I think it's better to keep
it correct just in case, and avoid future hard to debug issues[1].
so we do need a compile time test in configure, but I'd suggest
using G_BYTE_ORDER
It is imaginable that configure produces multiple cross-compilation
environments for meson, e.g. to compile qboot from sources. In that
case glib would not be available, so please do not introduce any uses of
glib in configure.
More in general, configure should not be doing any compile tests /
package detection specific to building the emulators. Meson 0.63 will
*finally* make it possible to get there.
That said, using __BYTE_ORDER__ is a good idea!
Paolo
[1] there is one build_machine.endian() which I think wants host_machine
instead, in fact, but it only affects the final summary.