[PATCH 11/24] configure, meson: get HOST_WORDS_BIGENDIAN via the machine object

Paolo Bonzini posted 24 patches 4 years, 4 months ago
Maintainers: "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Jason Wang <jasowang@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>, Cleber Rosa <crosa@redhat.com>, Thomas Huth <thuth@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Kevin Wolf <kwolf@redhat.com>, Qiuhao Li <Qiuhao.Li@outlook.com>
There is a newer version of this series
[PATCH 11/24] configure, meson: get HOST_WORDS_BIGENDIAN via the machine object
Posted by Paolo Bonzini 4 years, 4 months ago
No need to pass it in config-host.mak.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure   | 4 ----
 meson.build | 3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index f91b8e1f0d..35e25bb960 100755
--- a/configure
+++ b/configure
@@ -347,7 +347,6 @@ tsan="no"
 fortify_source="$default_feature"
 strip_opt="yes"
 tcg_interpreter="false"
-bigendian="no"
 mingw32="no"
 gcov="no"
 EXESUF=""
@@ -4262,9 +4261,6 @@ fi
 if test "$strip_opt" = "yes" ; then
   echo "STRIP=${strip}" >> $config_host_mak
 fi
-if test "$bigendian" = "yes" ; then
-  echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
-fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
   if test "$guest_agent_with_vss" = "yes" ; then
diff --git a/meson.build b/meson.build
index 6842402a60..9bb443387a 100644
--- a/meson.build
+++ b/meson.build
@@ -1465,6 +1465,7 @@ config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]
 
 config_host_data.set_quoted('CONFIG_HOST_DSOSUF', host_dsosuf)
 config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device)
+config_host_data.set('HOST_WORDS_BIGENDIAN', host_machine.endian() == 'big')
 
 # has_header
 config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h'))
@@ -1625,7 +1626,7 @@ foreach k, v: config_host
     config_host_data.set('HOST_' + v.to_upper(), 1)
   elif strings.contains(k)
     config_host_data.set_quoted(k, v)
-  elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_')
+  elif k.startswith('CONFIG_') or k.startswith('HAVE_')
     config_host_data.set(k, v == 'y' ? 1 : v)
   endif
 endforeach
-- 
2.31.1



Re: [PATCH 11/24] configure, meson: get HOST_WORDS_BIGENDIAN via the machine object
Posted by Philippe Mathieu-Daudé 4 years, 4 months ago
On 10/7/21 15:08, Paolo Bonzini wrote:
> No need to pass it in config-host.mak.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  configure   | 4 ----
>  meson.build | 3 ++-
>  2 files changed, 2 insertions(+), 5 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


Re: [PATCH 11/24] configure, meson: get HOST_WORDS_BIGENDIAN via the machine object
Posted by Marc-André Lureau 4 years, 4 months ago
On Thu, Oct 7, 2021 at 5:14 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> No need to pass it in config-host.mak.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>

Or we could eventually use G_BYTE_ORDER, I guess.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

---
>  configure   | 4 ----
>  meson.build | 3 ++-
>  2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/configure b/configure
> index f91b8e1f0d..35e25bb960 100755
> --- a/configure
> +++ b/configure
> @@ -347,7 +347,6 @@ tsan="no"
>  fortify_source="$default_feature"
>  strip_opt="yes"
>  tcg_interpreter="false"
> -bigendian="no"
>  mingw32="no"
>  gcov="no"
>  EXESUF=""
> @@ -4262,9 +4261,6 @@ fi
>  if test "$strip_opt" = "yes" ; then
>    echo "STRIP=${strip}" >> $config_host_mak
>  fi
> -if test "$bigendian" = "yes" ; then
> -  echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
> -fi
>  if test "$mingw32" = "yes" ; then
>    echo "CONFIG_WIN32=y" >> $config_host_mak
>    if test "$guest_agent_with_vss" = "yes" ; then
> diff --git a/meson.build b/meson.build
> index 6842402a60..9bb443387a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1465,6 +1465,7 @@ config_host_data.set('QEMU_VERSION_MICRO',
> meson.project_version().split('.')[2]
>
>  config_host_data.set_quoted('CONFIG_HOST_DSOSUF', host_dsosuf)
>  config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device)
> +config_host_data.set('HOST_WORDS_BIGENDIAN', host_machine.endian() ==
> 'big')
>
>  # has_header
>  config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h'))
> @@ -1625,7 +1626,7 @@ foreach k, v: config_host
>      config_host_data.set('HOST_' + v.to_upper(), 1)
>    elif strings.contains(k)
>      config_host_data.set_quoted(k, v)
> -  elif k.startswith('CONFIG_') or k.startswith('HAVE_') or
> k.startswith('HOST_')
> +  elif k.startswith('CONFIG_') or k.startswith('HAVE_')
>      config_host_data.set(k, v == 'y' ? 1 : v)
>    endif
>  endforeach
> --
> 2.31.1
>
>
>
>

-- 
Marc-André Lureau