From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, pbonzini@redhat.com,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
mst@redhat.com
Subject: [PATCH] libvhost-user: add a link-static option
Date: Sat, 12 Dec 2020 13:08:34 +0400 [thread overview]
Message-ID: <20201212090834.1126274-1-marcandre.lureau@redhat.com> (raw)
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Fix linking vhost-user binaries with with ./configure -static.
Fixes: 0df750e9d3a5fea5e1 ("libvhost-user: make it a meson subproject")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
configure | 1 +
subprojects/libvhost-user/meson.build | 3 ++-
subprojects/libvhost-user/meson_options.txt | 5 +++++
3 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 subprojects/libvhost-user/meson_options.txt
diff --git a/configure b/configure
index 18c26e0389..465f7bb150 100755
--- a/configure
+++ b/configure
@@ -7014,6 +7014,7 @@ NINJA=$ninja $meson setup \
-Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
-Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
-Dvhost_user_blk_server=$vhost_user_blk_server \
+ -Dlibvhost-user:link-static=$(if test "$static" = yes; then echo true; else echo false; fi) \
$cross_arg \
"$PWD" "$source_path"
diff --git a/subprojects/libvhost-user/meson.build b/subprojects/libvhost-user/meson.build
index c5d85c11d7..5a9cc8675e 100644
--- a/subprojects/libvhost-user/meson.build
+++ b/subprojects/libvhost-user/meson.build
@@ -2,7 +2,8 @@ project('libvhost-user', 'c',
license: 'GPL-2.0-or-later',
default_options: ['c_std=gnu99'])
-glib = dependency('glib-2.0')
+link_static = get_option('link-static')
+glib = dependency('glib-2.0', static: link_static)
inc = include_directories('../../include', '../../linux-headers')
vhost_user = static_library('vhost-user',
diff --git a/subprojects/libvhost-user/meson_options.txt b/subprojects/libvhost-user/meson_options.txt
new file mode 100644
index 0000000000..03fe088e36
--- /dev/null
+++ b/subprojects/libvhost-user/meson_options.txt
@@ -0,0 +1,5 @@
+option('link-static',
+ type: 'boolean',
+ value: false,
+)
+
--
2.29.0
next reply other threads:[~2020-12-12 9:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-12 9:08 marcandre.lureau [this message]
2020-12-14 16:22 ` [PATCH] libvhost-user: add a link-static option Paolo Bonzini
2020-12-14 17:07 ` Marc-André Lureau
2020-12-14 20:48 ` Marc-André Lureau
2020-12-14 21:07 ` 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=20201212090834.1126274-1-marcandre.lureau@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).