All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 13/24] configure, meson: move remaining HAVE_* compiler tests to Meson
Date: Thu,  7 Oct 2021 15:08:18 +0200	[thread overview]
Message-ID: <20211007130829.632254-8-pbonzini@redhat.com> (raw)
In-Reply-To: <20211007130630.632028-1-pbonzini@redhat.com>

Remove some special cases by moving them to Meson.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure   | 37 -------------------------------------
 meson.build | 22 ++++++++++++++++++++--
 2 files changed, 20 insertions(+), 39 deletions(-)

diff --git a/configure b/configure
index 499c84859d..52f89b05d6 100755
--- a/configure
+++ b/configure
@@ -2401,18 +2401,6 @@ else
   l2tpv3=no
 fi
 
-cat > $TMPC <<EOF
-#include <sys/mman.h>
-int main(int argc, char *argv[]) {
-    return mlockall(MCL_FUTURE);
-}
-EOF
-if compile_prog "" "" ; then
-  have_mlockall=yes
-else
-  have_mlockall=no
-fi
-
 #########################################
 # vhost interdependencies and host support
 
@@ -3840,21 +3828,6 @@ if test "$fortify_source" != "no"; then
   fi
 fi
 
-##########################################
-# check if struct fsxattr is available via linux/fs.h
-
-have_fsxattr=no
-cat > $TMPC << EOF
-#include <linux/fs.h>
-struct fsxattr foo;
-int main(void) {
-  return 0;
-}
-EOF
-if compile_prog "" "" ; then
-    have_fsxattr=yes
-fi
-
 ##########################################
 # check for usable membarrier system call
 if test "$membarrier" = "yes"; then
@@ -4356,13 +4329,6 @@ if test "$gdbus_codegen" != "" ; then
 fi
 echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
 
-# Work around a system header bug with some kernel/XFS header
-# versions where they both try to define 'struct fsxattr':
-# xfs headers will not try to redefine structs from linux headers
-# if this macro is set.
-if test "$have_fsxattr" = "yes" ; then
-    echo "HAVE_FSXATTR=y" >> $config_host_mak
-fi
 if test "$xen" = "enabled" ; then
   echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
   echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
@@ -4567,9 +4533,6 @@ fi
 if test "$parallels" = "yes" ; then
   echo "CONFIG_PARALLELS=y" >> $config_host_mak
 fi
-if test "$have_mlockall" = "yes" ; then
-  echo "HAVE_MLOCKALL=y" >> $config_host_mak
-fi
 
 if test "$plugins" = "yes" ; then
     echo "CONFIG_PLUGIN=y" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 2962c24eb5..935a20c198 100644
--- a/meson.build
+++ b/meson.build
@@ -1604,6 +1604,23 @@ config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
     return 0;
   }'''))
 
+config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + '''
+  #include <sys/mman.h>
+  int main(int argc, char *argv[]) {
+    return mlockall(MCL_FUTURE);
+  }'''))
+
+# Work around a system header bug with some kernel/XFS header
+# versions where they both try to define 'struct fsxattr':
+# xfs headers will not try to redefine structs from linux headers
+# if this macro is set.
+config_host_data.set('HAVE_FSXATTR', cc.links('''
+  #include <linux/fs.h>'
+  struct fsxattr foo;
+  int main(void) {
+    return 0;
+  }'''))
+
 # Some versions of Mac OS X incorrectly define SIZE_MAX
 config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
     #include <stdint.h>
@@ -1612,7 +1629,8 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
         return printf("%zu", SIZE_MAX);
     }''', args: ['-Werror']))
 
-ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
+ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target
+    'HAVE_GDB_BIN']
 arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
 strings = ['CONFIG_IASL']
 foreach k, v: config_host
@@ -1627,7 +1645,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_')
+  elif k.startswith('CONFIG_')
     config_host_data.set(k, v == 'y' ? 1 : v)
   endif
 endforeach
-- 
2.31.1




  parent reply	other threads:[~2021-10-07 13:23 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 13:06 [PATCH 00/24] configure->meson queue for 6.2 Paolo Bonzini
2021-10-07 13:06 ` [PATCH 01/24] configure: remove --oss-lib Paolo Bonzini
2021-10-07 17:32   ` Thomas Huth
2021-10-07 20:42   ` Marc-André Lureau
2021-10-08  9:19     ` Paolo Bonzini
2021-10-07 13:06 ` [PATCH 02/24] audio: remove CONFIG_AUDIO_WIN_INT Paolo Bonzini
2021-10-07 20:42   ` Marc-André Lureau
2021-10-07 13:06 ` [PATCH 03/24] configure, meson: move audio driver detection to Meson Paolo Bonzini
2021-10-07 20:42   ` Marc-André Lureau
2021-10-07 13:06 ` [PATCH 04/24] meson: define symbols for all available audio drivers Paolo Bonzini
2021-10-07 13:06 ` [PATCH 05/24] configure: add command line options for " Paolo Bonzini
2021-10-07 20:42   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 06/24] kconfig: split CONFIG_SPARSE_MEM from fuzzing Paolo Bonzini
2021-10-07 13:48   ` Philippe Mathieu-Daudé
2021-10-07 20:42   ` Marc-André Lureau
2021-10-08  3:08   ` Alexander Bulekov
2021-10-07 13:08 ` [PATCH 07/24] configure, meson: move fuzzing configuration to Meson Paolo Bonzini
2021-10-08  3:10   ` Alexander Bulekov
2021-10-07 13:08 ` [PATCH 08/24] trace: simple: pass trace_file unmodified to config-host.h Paolo Bonzini
2021-10-07 20:42   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 09/24] trace: move configuration from configure to Meson Paolo Bonzini
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 10/24] configure, meson: move CONFIG_HOST_DSOSUF " Paolo Bonzini
2021-10-07 13:44   ` Philippe Mathieu-Daudé
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 11/24] configure, meson: get HOST_WORDS_BIGENDIAN via the machine object Paolo Bonzini
2021-10-07 13:45   ` Philippe Mathieu-Daudé
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 12/24] configure, meson: remove CONFIG_GCOV from config-host.mak Paolo Bonzini
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` Paolo Bonzini [this message]
2021-10-07 20:41   ` [PATCH 13/24] configure, meson: move remaining HAVE_* compiler tests to Meson Marc-André Lureau
2021-10-07 13:08 ` [PATCH 14/24] configure, meson: move pthread_setname_np checks " Paolo Bonzini
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 15/24] configure, meson: move libaio check to meson.build Paolo Bonzini
2021-10-07 19:24   ` Richard Henderson
2021-10-08  8:30     ` Paolo Bonzini
2021-10-08  8:47       ` Marc-André Lureau
2021-10-08  9:15         ` Paolo Bonzini
2021-10-07 13:08 ` [PATCH 16/24] configure, meson: move vde detection to meson Paolo Bonzini
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 17/24] configure, meson: move netmap " Paolo Bonzini
2021-10-07 17:55   ` Thomas Huth
2021-10-07 13:08 ` [PATCH 18/24] configure, meson: move Spice configure handling " Paolo Bonzini
2021-10-07 13:08 ` [PATCH 19/24] configure: remove obsolete Solaris ar check Paolo Bonzini
2021-10-07 18:19   ` Thomas Huth
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 20/24] configure, meson: move more compiler checks to Meson Paolo Bonzini
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 21/24] configure: remove deprecated --{enable, disable}-git-update Paolo Bonzini
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 22/24] configure: accept "internal" for --enable-capstone/slirp/fdt Paolo Bonzini
2021-10-07 20:41   ` Marc-André Lureau
2021-10-07 13:08 ` [PATCH 23/24] configure: prepare for auto-generated option parsing Paolo Bonzini
2021-10-07 16:53   ` Thomas Huth
2021-10-08  8:42     ` Paolo Bonzini
2021-10-07 13:08 ` [PATCH 24/24] configure: automatically parse command line for meson -D options Paolo Bonzini
2021-10-07 20:41   ` Marc-André Lureau
2021-10-08  8:43     ` Paolo Bonzini
2021-10-08  8:46       ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211007130829.632254-8-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.