qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PULL 17/26] configure, meson: move vde detection to meson
Date: Thu, 14 Oct 2021 18:29:29 +0200	[thread overview]
Message-ID: <20211014162938.430211-18-pbonzini@redhat.com> (raw)
In-Reply-To: <20211014162938.430211-1-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 670d82847f..0c077f3f5e 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"
   ;;
@@ -2903,30 +2903,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
@@ -4199,10 +4175,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
@@ -4752,6 +4724,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 0ecb220af1..0e948a8024 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()
+    error('could not link libvdeplug')
+  else
+    warning('could not link libvdeplug, disabling')
+  endif
 endif
 
 pulse = not_found
@@ -1441,6 +1460,7 @@ config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
 config_host_data.set('CONFIG_SECCOMP', seccomp.found())
 config_host_data.set('CONFIG_SNAPPY', snappy.found())
 config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
+config_host_data.set('CONFIG_VDE', vde.found())
 config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
 config_host_data.set('CONFIG_VNC', vnc.found())
 config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
@@ -3290,7 +3310,7 @@ if targetos == 'linux'
 endif
 summary_info += {'JACK support':      jack}
 summary_info += {'brlapi support':    brlapi}
-summary_info += {'vde support':       config_host.has_key('CONFIG_VDE')}
+summary_info += {'vde support':       vde}
 summary_info += {'netmap support':    config_host.has_key('CONFIG_NETMAP')}
 summary_info += {'Linux AIO support': libaio}
 summary_info += {'Linux io_uring support': linux_io_uring}
diff --git a/meson_options.txt b/meson_options.txt
index 904e15d54c..7d0fa1c7f4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -129,6 +129,8 @@ option('u2f', type : 'feature', value : 'auto',
        description: 'U2F emulation support')
 option('usb_redir', type : 'feature', value : 'auto',
        description: 'libusbredir support')
+option('vde', type : 'feature', value : 'auto',
+       description: 'vde network backend support')
 option('virglrenderer', type : 'feature', value : 'auto',
        description: 'virgl rendering support')
 option('vnc', type : 'feature', value : 'auto',
diff --git a/net/meson.build b/net/meson.build
index 1076b0a7ab..491144a697 100644
--- a/net/meson.build
+++ b/net/meson.build
@@ -20,7 +20,7 @@ softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('filter-replay.c'))
 
 softmmu_ss.add(when: 'CONFIG_L2TPV3', if_true: files('l2tpv3.c'))
 softmmu_ss.add(when: slirp, if_true: files('slirp.c'))
-softmmu_ss.add(when: ['CONFIG_VDE', vde], if_true: files('vde.c'))
+softmmu_ss.add(when: vde, if_true: files('vde.c'))
 softmmu_ss.add(when: 'CONFIG_NETMAP', if_true: files('netmap.c'))
 vhost_user_ss = ss.source_set()
 vhost_user_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c'))
-- 
2.31.1




  parent reply	other threads:[~2021-10-14 16:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 16:29 [PULL 00/26] Meson changes for 2021-10-14 Paolo Bonzini
2021-10-14 16:29 ` [PULL 01/26] configure: remove --oss-lib Paolo Bonzini
2021-10-14 16:29 ` [PULL 02/26] audio: remove CONFIG_AUDIO_WIN_INT Paolo Bonzini
2021-10-14 16:29 ` [PULL 03/26] configure, meson: move audio driver detection to Meson Paolo Bonzini
2021-11-01 14:32   ` Peter Maydell
2021-10-14 16:29 ` [PULL 04/26] meson: define symbols for all available audio drivers Paolo Bonzini
2021-10-14 16:29 ` [PULL 05/26] configure: add command line options for " Paolo Bonzini
2021-10-14 16:29 ` [PULL 06/26] kconfig: split CONFIG_SPARSE_MEM from fuzzing Paolo Bonzini
2021-10-14 16:29 ` [PULL 07/26] configure, meson: move fuzzing configuration to Meson Paolo Bonzini
2021-10-14 16:29 ` [PULL 08/26] trace: simple: pass trace_file unmodified to config-host.h Paolo Bonzini
2021-10-14 16:29 ` [PULL 09/26] trace: move configuration from configure to Meson Paolo Bonzini
2021-10-14 16:29 ` [PULL 10/26] configure, meson: move CONFIG_HOST_DSOSUF " Paolo Bonzini
2021-10-14 16:29 ` [PULL 11/26] configure, meson: get HOST_WORDS_BIGENDIAN via the machine object Paolo Bonzini
2021-10-14 16:29 ` [PULL 12/26] configure, meson: remove CONFIG_GCOV from config-host.mak Paolo Bonzini
2021-10-14 16:29 ` [PULL 13/26] meson: HAVE_GDB_BIN is not used by C code Paolo Bonzini
2021-10-14 16:29 ` [PULL 14/26] configure, meson: move remaining HAVE_* compiler tests to Meson Paolo Bonzini
2021-10-14 16:29 ` [PULL 15/26] configure, meson: move pthread_setname_np checks " Paolo Bonzini
2021-11-15 17:15   ` Daniel P. Berrangé
2021-11-15 17:25     ` Peter Maydell
2021-10-14 16:29 ` [PULL 16/26] configure, meson: move libaio check to meson.build Paolo Bonzini
2021-10-14 16:29 ` Paolo Bonzini [this message]
2021-10-14 16:29 ` [PULL 18/26] configure, meson: move netmap detection to meson Paolo Bonzini
2021-10-14 16:29 ` [PULL 19/26] configure, meson: move Spice configure handling " Paolo Bonzini
2021-10-14 16:29 ` [PULL 20/26] configure: remove obsolete Solaris ar check Paolo Bonzini
2021-10-14 16:29 ` [PULL 21/26] configure, meson: move more compiler checks to Meson Paolo Bonzini
2021-11-15 16:36   ` Peter Maydell
2021-11-15 16:42     ` Peter Maydell
2021-11-16  9:29       ` Paolo Bonzini
2021-11-16 13:13       ` Peter Maydell
2021-11-15 16:55     ` Peter Maydell
2021-10-14 16:29 ` [PULL 22/26] configure: remove deprecated --{enable, disable}-git-update Paolo Bonzini
2021-10-14 16:29 ` [PULL 23/26] configure: accept "internal" for --enable-capstone/slirp/fdt Paolo Bonzini
2021-10-14 16:29 ` [PULL 24/26] configure: prepare for auto-generated option parsing Paolo Bonzini
2021-10-14 16:29 ` [PULL 25/26] meson-buildoptions: include list of tracing backends Paolo Bonzini
2021-10-14 16:29 ` [PULL 26/26] configure: automatically parse command line for meson -D options Paolo Bonzini
2021-10-14 19:15 ` [PULL 00/26] Meson changes for 2021-10-14 Richard Henderson

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=20211014162938.430211-18-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --subject='Re: [PULL 17/26] configure, meson: move vde detection to meson' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).