From 0593f60ad66a4aea840ea8925ebcb0a3207797b1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 13 Jan 2022 00:11:43 +0200 Subject: [PATCH 51/51] Meson: Check endianness See osdn #43448 Signed-off-by: Marko Lindqvist --- gen_headers/meson_fc_config.h.in | 3 +++ meson.build | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/gen_headers/meson_fc_config.h.in b/gen_headers/meson_fc_config.h.in index 152905012b..c7af6b2a50 100644 --- a/gen_headers/meson_fc_config.h.in +++ b/gen_headers/meson_fc_config.h.in @@ -39,6 +39,9 @@ #define _GNU_SOURCE #endif +/* Processor stores words with the most significant byte first */ +#mesondefine WORDS_BIGENDIAN + /* Database backend available */ #define HAVE_FCDB 1 diff --git a/meson.build b/meson.build index 03ecc88a85..965258f160 100644 --- a/meson.build +++ b/meson.build @@ -39,6 +39,10 @@ priv_conf_data.set('SYSCONFDIR', priv_conf_data.set('IS_DEVEL_VERSION', 1) +if host_machine.endian() == 'big' + priv_conf_data.set('WORDS_BIGENDIAN', 1) +endif + if get_option('debug') priv_conf_data.set('FREECIV_DEBUG', 1) pub_conf_data.set('FREECIV_DEBUG', 1) -- 2.34.1