[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/8] configure: move X11 detection to Meson
From: |
Paolo Bonzini |
Subject: |
[PATCH 4/8] configure: move X11 detection to Meson |
Date: |
Thu, 7 Jan 2021 15:00:35 +0100 |
For now move the logic verbatim. GTK+ actually has a hard requirement
on X11 if gtk+x11 is present, but we will sort that out later.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 14 ++------------
meson.build | 9 +++++----
ui/meson.build | 4 ++--
3 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index c6d09b225e..e9d76c2c13 100755
--- a/configure
+++ b/configure
@@ -2759,14 +2759,6 @@ EOF
fi
fi
-##########################################
-# X11 probe
-if $pkg_config --exists "x11"; then
- have_x11=yes
- x11_cflags=$($pkg_config --cflags x11)
- x11_libs=$($pkg_config --libs x11)
-fi
-
##########################################
# GTK probe
@@ -5681,10 +5673,8 @@ fi
if test "$module_upgrades" = "yes"; then
echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
fi
-if test "$have_x11" = "yes" && test "$need_x11" = "yes"; then
- echo "CONFIG_X11=y" >> $config_host_mak
- echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak
- echo "X11_LIBS=$x11_libs" >> $config_host_mak
+if test "$need_x11" = "yes"; then
+ echo "CONFIG_NEED_X11=y" >> $config_host_mak
fi
if test "$pipe2" = "yes" ; then
echo "CONFIG_PIPE2=y" >> $config_host_mak
diff --git a/meson.build b/meson.build
index a729a30d2f..fdd4312c71 100644
--- a/meson.build
+++ b/meson.build
@@ -783,9 +783,9 @@ if 'CONFIG_VTE' in config_host
link_args: config_host['VTE_LIBS'].split())
endif
x11 = not_found
-if 'CONFIG_X11' in config_host
- x11 = declare_dependency(compile_args: config_host['X11_CFLAGS'].split(),
- link_args: config_host['X11_LIBS'].split())
+if config_host.has_key('CONFIG_NEED_X11')
+ x11 = dependency('x11', method: 'pkg-config', required: false,
+ static: enable_static)
endif
vnc = not_found
png = not_found
@@ -1081,6 +1081,7 @@ config_host_data.set('CONFIG_STATX', has_statx)
config_host_data.set('CONFIG_ZSTD', zstd.found())
config_host_data.set('CONFIG_FUSE', fuse.found())
config_host_data.set('CONFIG_FUSE_LSEEK', fuse_lseek.found())
+config_host_data.set('CONFIG_X11', x11.found())
config_host_data.set('CONFIG_CFI', get_option('cfi'))
config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version()))
config_host_data.set('QEMU_VERSION_MAJOR',
meson.project_version().split('.')[0])
@@ -1167,7 +1168,7 @@ host_kconfig = \
('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \
('CONFIG_IVSHMEM' in config_host ? ['CONFIG_IVSHMEM=y'] : []) + \
('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \
- ('CONFIG_X11' in config_host ? ['CONFIG_X11=y'] : []) + \
+ (x11.found() ? ['CONFIG_X11=y'] : []) + \
('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \
('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=y'] : []) + \
('CONFIG_VHOST_KERNEL' in config_host ? ['CONFIG_VHOST_KERNEL=y'] : []) + \
diff --git a/ui/meson.build b/ui/meson.build
index d805448c4e..afbdd78e97 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -62,7 +62,7 @@ if config_host.has_key('CONFIG_GTK')
gtk_ss = ss.source_set()
gtk_ss.add(gtk, vte, pixman, files('gtk.c'))
- gtk_ss.add(when: [x11, 'CONFIG_X11'], if_true: files('x_keymap.c'))
+ gtk_ss.add(when: x11, if_true: files('x_keymap.c'))
gtk_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('gtk-egl.c',
'gtk-gl-area.c'))
ui_modules += {'gtk' : gtk_ss}
endif
@@ -77,7 +77,7 @@ if sdl.found()
'sdl2.c',
))
sdl_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('sdl2-gl.c'))
- sdl_ss.add(when: [x11, 'CONFIG_X11'], if_true: files('x_keymap.c'))
+ sdl_ss.add(when: x11, if_true: files('x_keymap.c'))
ui_modules += {'sdl' : sdl_ss}
endif
--
2.29.2
[PATCH 3/8] gtk: remove CONFIG_GTK_GL, Paolo Bonzini, 2021/01/07
[PATCH 2/8] cocoa: do not enable coreaudio automatically, Paolo Bonzini, 2021/01/07
[PATCH 5/8] configure: move GTK+ detection to Meson, Paolo Bonzini, 2021/01/07
[PATCH 4/8] configure: move X11 detection to Meson,
Paolo Bonzini <=
[PATCH 8/8] configure: automatically parse command line for meson -D options, Paolo Bonzini, 2021/01/07
- Re: [PATCH 8/8] configure: automatically parse command line for meson -D options, Daniel P . Berrangé, 2021/01/13
- Re: [PATCH 8/8] configure: automatically parse command line for meson -D options, Paolo Bonzini, 2021/01/13
- Re: [PATCH 8/8] configure: automatically parse command line for meson -D options, Paolo Bonzini, 2021/01/13
- Re: [PATCH 8/8] configure: automatically parse command line for meson -D options, Yonggang Luo, 2021/01/22
- Re: [PATCH 8/8] configure: automatically parse command line for meson -D options, Paolo Bonzini, 2021/01/22
- Re: [PATCH 8/8] configure: automatically parse command line for meson -D options, Yonggang Luo, 2021/01/22
- Re: [PATCH 8/8] configure: automatically parse command line for meson -D options, Paolo Bonzini, 2021/01/23
[PATCH 7/8] configure: quote command line arguments in config.status, Paolo Bonzini, 2021/01/07