configure, meson: convert liburing detection to meson

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2021-06-03 11:31:35 +02:00
parent e36e8c70f6
commit 53c22b68e3
3 changed files with 11 additions and 28 deletions

28
configure vendored
View File

@ -315,7 +315,7 @@ xen="$default_feature"
xen_ctrl_version="$default_feature"
xen_pci_passthrough="auto"
linux_aio="$default_feature"
linux_io_uring="$default_feature"
linux_io_uring="auto"
cap_ng="auto"
attr="auto"
xfs="$default_feature"
@ -1205,9 +1205,9 @@ for opt do
;;
--enable-linux-aio) linux_aio="yes"
;;
--disable-linux-io-uring) linux_io_uring="no"
--disable-linux-io-uring) linux_io_uring="disabled"
;;
--enable-linux-io-uring) linux_io_uring="yes"
--enable-linux-io-uring) linux_io_uring="enabled"
;;
--disable-attr) attr="disabled"
;;
@ -3334,21 +3334,6 @@ EOF
linux_aio=no
fi
fi
##########################################
# linux-io-uring probe
if test "$linux_io_uring" != "no" ; then
if $pkg_config liburing; then
linux_io_uring_cflags=$($pkg_config --cflags liburing)
linux_io_uring_libs=$($pkg_config --libs liburing)
linux_io_uring=yes
else
if test "$linux_io_uring" = "yes" ; then
feature_not_found "linux io_uring" "Install liburing devel"
fi
linux_io_uring=no
fi
fi
##########################################
# TPM emulation is only on POSIX
@ -5421,11 +5406,6 @@ fi
if test "$linux_aio" = "yes" ; then
echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
fi
if test "$linux_io_uring" = "yes" ; then
echo "CONFIG_LINUX_IO_URING=y" >> $config_host_mak
echo "LINUX_IO_URING_CFLAGS=$linux_io_uring_cflags" >> $config_host_mak
echo "LINUX_IO_URING_LIBS=$linux_io_uring_libs" >> $config_host_mak
fi
if test "$vhost_scsi" = "yes" ; then
echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
fi
@ -6071,7 +6051,7 @@ if test "$skip_meson" = no; then
-Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \
-Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
-Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \
-Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem \
-Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem -Dlinux_io_uring=$linux_io_uring \
-Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \
-Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \
-Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \

View File

@ -327,10 +327,11 @@ if have_system or have_tools
endif
libaio = cc.find_library('aio', required: false)
zlib = dependency('zlib', required: true, kwargs: static_kwargs)
linux_io_uring = not_found
if 'CONFIG_LINUX_IO_URING' in config_host
linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(),
link_args: config_host['LINUX_IO_URING_LIBS'].split())
if not get_option('linux_io_uring').auto() or have_block
linux_io_uring = dependency('liburing', required: get_option('linux_io_uring'),
method: 'pkg-config', kwargs: static_kwargs)
endif
libxml2 = not_found
if 'CONFIG_LIBXML2' in config_host
@ -2785,7 +2786,7 @@ summary_info += {'brlapi support': brlapi.found()}
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 io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
summary_info += {'Linux io_uring support': linux_io_uring.found()}
summary_info += {'ATTR/XATTR support': libattr.found()}
summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}

View File

@ -92,6 +92,8 @@ option('libudev', type : 'feature', value : 'auto',
description: 'Use libudev to enumerate host devices')
option('libusb', type : 'feature', value : 'auto',
description: 'libusb support for USB passthrough')
option('linux_io_uring', type : 'feature', value : 'auto',
description: 'Linux io_uring support')
option('lzfse', type : 'feature', value : 'auto',
description: 'lzfse support for DMG images')
option('lzo', type : 'feature', value : 'auto',