From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH 2/4] Move the l2tpv3 test from configure to meson.build
Date: Thu, 28 Oct 2021 20:59:08 +0200 [thread overview]
Message-ID: <20211028185910.1729744-3-thuth@redhat.com> (raw)
In-Reply-To: <20211028185910.1729744-1-thuth@redhat.com>
And while we're at it, also provide a proper entry for this feature
in meson_options.txt, so that people who don't need it have a knob
to disable this feature.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
configure | 17 -----------------
meson.build | 8 ++++++++
meson_options.txt | 2 ++
net/meson.build | 4 +++-
scripts/meson-buildoptions.sh | 3 +++
5 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index 8fe03b6230..170b1b237a 100755
--- a/configure
+++ b/configure
@@ -1907,20 +1907,6 @@ if test -z "$want_tools"; then
fi
fi
-##########################################
-# L2TPV3 probe
-
-cat > $TMPC <<EOF
-#include <sys/socket.h>
-#include <linux/ip.h>
-int main(void) { return sizeof(struct mmsghdr); }
-EOF
-if compile_prog "" "" ; then
- l2tpv3=yes
-else
- l2tpv3=no
-fi
-
#########################################
# vhost interdependencies and host support
@@ -3544,9 +3530,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 "$l2tpv3" = "yes" ; then
- echo "CONFIG_L2TPV3=y" >> $config_host_mak
-fi
if test "$gprof" = "yes" ; then
echo "CONFIG_GPROF=y" >> $config_host_mak
fi
diff --git a/meson.build b/meson.build
index 2c5b53cbe2..5bb6b901b0 100644
--- a/meson.build
+++ b/meson.build
@@ -1678,6 +1678,13 @@ config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + '''
return mlockall(MCL_FUTURE);
}'''))
+have_l2tpv3 = false
+if not get_option('l2tpv3').disabled() and have_system
+ have_l2tpv3 = (cc.has_header_symbol('sys/socket.h', 'struct mmsghdr')
+ and cc.has_header('linux/ip.h'))
+endif
+config_host_data.set('CONFIG_L2TPV3', have_l2tpv3)
+
have_netmap = false
if not get_option('netmap').disabled() and have_system
have_netmap = cc.compiles('''
@@ -3394,6 +3401,7 @@ summary_info += {'JACK support': jack}
summary_info += {'brlapi support': brlapi}
summary_info += {'vde support': vde}
summary_info += {'netmap support': have_netmap}
+summary_info += {'l2tpv3 support': have_l2tpv3}
summary_info += {'Linux AIO support': libaio}
summary_info += {'Linux io_uring support': linux_io_uring}
summary_info += {'ATTR/XATTR support': libattr}
diff --git a/meson_options.txt b/meson_options.txt
index 4ab4570125..e740dce2a5 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -141,6 +141,8 @@ option('u2f', type : 'feature', value : 'auto',
description: 'U2F emulation support')
option('usb_redir', type : 'feature', value : 'auto',
description: 'libusbredir support')
+option('l2tpv3', type : 'feature', value : 'auto',
+ description: 'l2tpv3 network backend support')
option('netmap', type : 'feature', value : 'auto',
description: 'netmap network backend support')
option('vde', type : 'feature', value : 'auto',
diff --git a/net/meson.build b/net/meson.build
index 94383e7460..847bc2ac85 100644
--- a/net/meson.build
+++ b/net/meson.build
@@ -18,7 +18,9 @@ softmmu_ss.add(files(
softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('filter-replay.c'))
-softmmu_ss.add(when: 'CONFIG_L2TPV3', if_true: files('l2tpv3.c'))
+if have_l2tpv3
+ softmmu_ss.add(files('l2tpv3.c'))
+endif
softmmu_ss.add(when: slirp, if_true: files('slirp.c'))
softmmu_ss.add(when: vde, if_true: files('vde.c'))
if have_netmap
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index c795a13020..55b8a78560 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -49,6 +49,7 @@ meson_options_help() {
printf "%s\n" ' iconv Font glyph conversion support'
printf "%s\n" ' jack JACK sound support'
printf "%s\n" ' kvm KVM acceleration support'
+ printf "%s\n" ' l2tpv3 l2tpv3 network backend support'
printf "%s\n" ' libdaxctl libdaxctl support'
printf "%s\n" ' libiscsi libiscsi userspace initiator'
printf "%s\n" ' libnfs libnfs block device driver'
@@ -166,6 +167,8 @@ _meson_option_parse() {
--disable-jack) printf "%s" -Djack=disabled ;;
--enable-kvm) printf "%s" -Dkvm=enabled ;;
--disable-kvm) printf "%s" -Dkvm=disabled ;;
+ --enable-l2tpv3) printf "%s" -Dl2tpv3=enabled ;;
+ --disable-l2tpv3) printf "%s" -Dl2tpv3=disabled ;;
--enable-libdaxctl) printf "%s" -Dlibdaxctl=enabled ;;
--disable-libdaxctl) printf "%s" -Dlibdaxctl=disabled ;;
--enable-libiscsi) printf "%s" -Dlibiscsi=enabled ;;
--
2.27.0
next prev parent reply other threads:[~2021-10-28 19:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-28 18:59 [PATCH 0/4] configure and meson.build improvements Thomas Huth
2021-10-28 18:59 ` [PATCH 1/4] configure: Remove the check for the __thread keyword Thomas Huth
2021-10-29 16:48 ` Richard Henderson
2021-11-02 11:37 ` Paolo Bonzini
2021-10-28 18:59 ` Thomas Huth [this message]
2021-11-02 11:36 ` [PATCH 2/4] Move the l2tpv3 test from configure to meson.build Paolo Bonzini
2021-10-28 18:59 ` [PATCH 3/4] Move CONFIG_XFS handling " Thomas Huth
2021-11-02 11:34 ` Paolo Bonzini
2021-11-02 11:38 ` Thomas Huth
2021-11-02 11:50 ` Paolo Bonzini
2021-12-10 7:53 ` Thomas Huth
2021-12-10 8:39 ` Paolo Bonzini
2021-12-10 8:46 ` Thomas Huth
2021-12-10 10:10 ` Paolo Bonzini
2021-12-14 9:15 ` Thomas Huth
2021-10-28 18:59 ` [PATCH 4/4] Move the libssh setup from configure " Thomas Huth
2021-10-29 6:09 ` Thomas Huth
2021-11-02 11:36 ` Paolo Bonzini
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=20211028185910.1729744-3-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=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 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).