Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211007130829.632254-11-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 35 ++++-------------------------------
meson.build | 26 +++++++++++++++++++++++---
meson_options.txt | 2 ++
net/meson.build | 2 +-
4 files changed, 30 insertions(+), 35 deletions(-)
diff --git a/configure b/configure
index 86bc4b52d7..a2b1d54be8 100755
--- a/configure
+++ b/configure
@@ -301,7 +301,7 @@ libudev="auto"
mpath="auto"
vnc="auto"
sparse="auto"
-vde="$default_feature"
+vde="auto"
vnc_sasl="auto"
vnc_jpeg="auto"
vnc_png="auto"
@@ -1022,9 +1022,9 @@ for opt do
;;
--enable-slirp=system) slirp="system"
;;
- --disable-vde) vde="no"
+ --disable-vde) vde="disabled"
;;
- --enable-vde) vde="yes"
+ --enable-vde) vde="enabled"
;;
--disable-netmap) netmap="no"
;;
@@ -2901,30 +2901,6 @@ EOF
fi
fi
-##########################################
-# vde libraries probe
-if test "$vde" != "no" ; then
- vde_libs="-lvdeplug"
- cat > $TMPC << EOF
-#include <libvdeplug.h>
-int main(void)
-{
- struct vde_open_args a = {0, 0, 0};
- char s[] = "";
- vde_open(s, s, &a);
- return 0;
-}
-EOF
- if compile_prog "" "$vde_libs" ; then
- vde=yes
- else
- if test "$vde" = "yes" ; then
- feature_not_found "vde" "Install vde (Virtual Distributed Ethernet)
devel"
- fi
- vde=no
- fi
-fi
-
##########################################
# netmap support probe
# Apart from looking for netmap headers, we make sure that the host API
version
@@ -4197,10 +4173,6 @@ if test "$slirp_smbd" = "yes" ; then
echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak
echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
fi
-if test "$vde" = "yes" ; then
- echo "CONFIG_VDE=y" >> $config_host_mak
- echo "VDE_LIBS=$vde_libs" >> $config_host_mak
-fi
if test "$netmap" = "yes" ; then
echo "CONFIG_NETMAP=y" >> $config_host_mak
fi
@@ -4750,6 +4722,7 @@ if test "$skip_meson" = no; then
-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
-Dlinux_aio=$linux_aio \
+ -Dvde=$vde \
$cross_arg \
"$PWD" "$source_path"
diff --git a/meson.build b/meson.build
index 5f16b17c97..e98efd3480 100644
--- a/meson.build
+++ b/meson.build
@@ -500,9 +500,28 @@ else
xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
method: 'pkg-config', kwargs: static_kwargs)
endif
+
vde = not_found
-if config_host.has_key('CONFIG_VDE')
- vde = declare_dependency(link_args: config_host['VDE_LIBS'].split())
+if not get_option('vde').auto() or have_system or have_tools
+ vde = cc.find_library('vdeplug', has_headers: ['libvdeplug.h'],
+ required: get_option('vde'),
+ kwargs: static_kwargs)
+endif
+if vde.found() and not cc.links('''
+ #include <libvdeplug.h>
+ int main(void)
+ {
+ struct vde_open_args a = {0, 0, 0};
+ char s[] = "";
+ vde_open(s, s, &a);
+ return 0;
+ }''', dependencies: vde)
+ vde = not_found
+ if get_option('cap_ng').enabled()