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

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/meson.build |  2 +-
 configure         | 31 ++++---------------------------
 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++
 stubs/meson.build |  4 +++-
 5 files changed, 18 insertions(+), 31 deletions(-)

diff --git a/block/meson.build b/block/meson.build
index 66ee11e62c..deb73ca389 100644
--- a/block/meson.build
+++ b/block/meson.build
@@ -65,7 +65,7 @@ block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit
 block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
 block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
 block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
-block_ss.add(when: ['CONFIG_LINUX_AIO', libaio], if_true: files('linux-aio.c'))
+block_ss.add(when: libaio, if_true: files('linux-aio.c'))
 block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
 
 block_modules = {}
diff --git a/configure b/configure
index a1e142d5f8..86bc4b52d7 100755
--- a/configure
+++ b/configure
@@ -315,7 +315,7 @@ pa="auto"
 xen=${default_feature:+disabled}
 xen_ctrl_version="$default_feature"
 xen_pci_passthrough="auto"
-linux_aio="$default_feature"
+linux_aio="auto"
 linux_io_uring="auto"
 cap_ng="auto"
 attr="auto"
@@ -1196,9 +1196,9 @@ for opt do
   ;;
   --enable-fdt=system) fdt="system"
   ;;
-  --disable-linux-aio) linux_aio="no"
+  --disable-linux-aio) linux_aio="disabled"
   ;;
-  --enable-linux-aio) linux_aio="yes"
+  --enable-linux-aio) linux_aio="enabled"
   ;;
   --disable-linux-io-uring) linux_io_uring="disabled"
   ;;
@@ -3161,26 +3161,6 @@ if test "$libssh" != "no" ; then
   fi
 fi
 
-##########################################
-# linux-aio probe
-
-if test "$linux_aio" != "no" ; then
-  cat > $TMPC <<EOF
-#include <libaio.h>
-#include <sys/eventfd.h>
-#include <stddef.h>
-int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; }
-EOF
-  if compile_prog "" "-laio" ; then
-    linux_aio=yes
-  else
-    if test "$linux_aio" = "yes" ; then
-      feature_not_found "linux AIO" "Install libaio devel"
-    fi
-    linux_aio=no
-  fi
-fi
-
 ##########################################
 # TPM emulation is only on POSIX
 
@@ -4270,9 +4250,6 @@ if test "$xen" = "enabled" ; then
   echo "XEN_CFLAGS=$xen_cflags" >> $config_host_mak
   echo "XEN_LIBS=$xen_libs" >> $config_host_mak
 fi
-if test "$linux_aio" = "yes" ; then
-  echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
-fi
 if test "$vhost_scsi" = "yes" ; then
   echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
 fi
@@ -4772,7 +4749,7 @@ if test "$skip_meson" = no; then
         $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \
         -Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \
         -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \
-        -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file \
+        -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \
         $cross_arg \
         "$PWD" "$source_path"
 
diff --git a/meson.build b/meson.build
index 54b2afdb96..0be11e5e08 100644
--- a/meson.build
+++ b/meson.build
@@ -402,9 +402,14 @@ if have_system or have_tools
   pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
                       method: 'pkg-config', kwargs: static_kwargs)
 endif
-libaio = cc.find_library('aio', required: false)
 zlib = dependency('zlib', required: true, kwargs: static_kwargs)
 
+libaio = not_found
+if not get_option('linux_aio').auto() or have_block
+  libaio = cc.find_library('aio', has_headers: ['libaio.h'],
+                           required: get_option('linux_aio'),
+                           kwargs: static_kwargs)
+endif
 linux_io_uring = not_found
 if not get_option('linux_io_uring').auto() or have_block
   linux_io_uring = dependency('liburing', required: get_option('linux_io_uring'),
@@ -1429,6 +1434,7 @@ config_host_data.set('CONFIG_EBPF', libbpf.found())
 config_host_data.set('CONFIG_LIBDAXCTL', libdaxctl.found())
 config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
 config_host_data.set('CONFIG_LIBNFS', libnfs.found())
+config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
 config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
 config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
 config_host_data.set('CONFIG_RBD', rbd.found())
@@ -3291,7 +3297,7 @@ summary_info += {'JACK support':      jack}
 summary_info += {'brlapi support':    brlapi}
 summary_info += {'vde support':       config_host.has_key('CONFIG_VDE')}
 summary_info += {'netmap support':    config_host.has_key('CONFIG_NETMAP')}
-summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
+summary_info += {'Linux AIO support': libaio}
 summary_info += {'Linux io_uring support': linux_io_uring}
 summary_info += {'ATTR/XATTR support': libattr}
 summary_info += {'RDMA support':      config_host.has_key('CONFIG_RDMA')}
diff --git a/meson_options.txt b/meson_options.txt
index 8f9c3b5b17..904e15d54c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -103,6 +103,8 @@ option('libusb', type : 'feature', value : 'auto',
        description: 'libusb support for USB passthrough')
 option('libxml2', type : 'feature', value : 'auto',
        description: 'libxml2 support for Parallels image format')
+option('linux_aio', type : 'feature', value : 'auto',
+       description: 'Linux AIO support')
 option('linux_io_uring', type : 'feature', value : 'auto',
        description: 'Linux io_uring support')
 option('lzfse', type : 'feature', value : 'auto',
diff --git a/stubs/meson.build b/stubs/meson.build
index beee31ec73..c8568cf588 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -20,7 +20,9 @@ endif
 stub_ss.add(files('iothread-lock.c'))
 stub_ss.add(files('isa-bus.c'))
 stub_ss.add(files('is-daemonized.c'))
-stub_ss.add(when: 'CONFIG_LINUX_AIO', if_true: files('linux-aio.c'))
+if libaio.found()
+  stub_ss.add(if_true: files('linux-aio.c'))
+endif
 stub_ss.add(files('migr-blocker.c'))
 stub_ss.add(files('module-opts.c'))
 stub_ss.add(files('monitor.c'))
-- 
2.31.1




  parent reply	other threads:[~2021-10-07 13:13 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 ` [PATCH 13/24] configure, meson: move remaining HAVE_* compiler tests to Meson Paolo Bonzini
2021-10-07 20:41   ` 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 ` Paolo Bonzini [this message]
2021-10-07 19:24   ` [PATCH 15/24] configure, meson: move libaio check to meson.build 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-10-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.