summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini2022-04-20 17:33:44 +0200
committerPaolo Bonzini2022-04-28 08:52:22 +0200
commit7544060ef30590e3e43e145288c990aeb07c5cc5 (patch)
treeaaca60f5fd800dab2e8473888506e3d5d56c8034 /meson.build
parentmeson, configure: move usbfs test to meson (diff)
downloadqemu-7544060ef30590e3e43e145288c990aeb07c5cc5.tar.gz
qemu-7544060ef30590e3e43e145288c990aeb07c5cc5.tar.xz
qemu-7544060ef30590e3e43e145288c990aeb07c5cc5.zip
meson, configure: move libgio test to meson
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build32
1 files changed, 27 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index c99b28a5ef..9f2a12e1cf 100644
--- a/meson.build
+++ b/meson.build
@@ -448,11 +448,32 @@ glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
meson.override_dependency('glib-2.0', glib)
gio = not_found
-if 'CONFIG_GIO' in config_host
- gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
- link_args: config_host['GIO_LIBS'].split(),
- version: config_host['GLIB_VERSION'])
+gdbus_codegen = not_found
+if not get_option('gio').auto() or have_system
+ gio = dependency('gio-2.0', required: get_option('gio'),
+ method: 'pkg-config', kwargs: static_kwargs)
+ if gio.found() and not cc.links('''
+ #include <gio/gio.h>
+ int main(void)
+ {
+ g_dbus_proxy_new_sync(0, 0, 0, 0, 0, 0, 0, 0);
+ return 0;
+ }''', dependencies: [glib, gio])
+ if get_option('gio').enabled()
+ error('The installed libgio is broken for static linking')
+ endif
+ gio = not_found
+ endif
+ if gio.found()
+ gdbus_codegen = find_program(gio.get_variable('gdbus_codegen'),
+ required: get_option('gio'))
+ gio_unix = dependency('gio-unix-2.0', required: get_option('gio'),
+ method: 'pkg-config', kwargs: static_kwargs)
+ gio = declare_dependency(dependencies: [gio, gio_unix],
+ version: gio.version())
+ endif
endif
+
lttng = not_found
if 'ust' in get_option('trace_backends')
lttng = dependency('lttng-ust', required: true, version: '>= 2.1',
@@ -1480,7 +1501,7 @@ dbus_display = get_option('dbus_display') \
error_message: '-display dbus requires glib>=2.64') \
.require(enable_modules,
error_message: '-display dbus requires --enable-modules') \
- .require(config_host.has_key('GDBUS_CODEGEN'),
+ .require(gdbus_codegen.found(),
error_message: '-display dbus requires gdbus-codegen') \
.allowed()
@@ -1542,6 +1563,7 @@ config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
config_host_data.set('CONFIG_CURL', curl.found())
config_host_data.set('CONFIG_CURSES', curses.found())
config_host_data.set('CONFIG_GBM', gbm.found())
+config_host_data.set('CONFIG_GIO', gio.found())
config_host_data.set('CONFIG_GLUSTERFS', glusterfs.found())
if glusterfs.found()
config_host_data.set('CONFIG_GLUSTERFS_XLATOR_OPT', glusterfs.version().version_compare('>=4'))