aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-01-12 23:22:53 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-01-12 23:22:53 +0000
commit6b63d126121a9535784003924fcb67f574a6afc0 (patch)
tree23984a363132840e611487f11a1a68655c019ada /meson.build
parentf8e1d8852e393b3fd524fb005e38590063d99bc0 (diff)
parentc117e5b11a21598205f1701a15965e825959d59f (diff)
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
* UI configury cleanups and Meson conversion * scripts/gdb improvements * WHPX cleanups and fixes * cirrus win32 CI improvements * meson gnutls workaround # gpg: Signature made Tue 12 Jan 2021 16:05:19 GMT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini-gitlab/tags/for-upstream: target/i386: Use X86Seg enum for segment registers configure: quote command line arguments in config.status configure: move Cocoa incompatibility checks to Meson configure: move GTK+ detection to Meson configure: move X11 detection to Meson gtk: remove CONFIG_GTK_GL cocoa: do not enable coreaudio automatically virtio-scsi: trace events meson: Propagate gnutls dependency Docs/RCU: Correct sample code of qatomic_rcu_set scripts/gdb: implement 'qemu bt' scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame meson: fix Cocoa option in summary whpx: move whpx_lapic_state from header to c file maintainers: Add me as Windows Hosted Continuous Integration maintainer cirrus/msys2: Cache msys2 mingw in a better way. cirrus/msys2: Exit powershell with $LastExitCode whpx: move internal definitions to whpx-internal.h whpx: rename whp-dispatch to whpx-internal.h meson: do not use CONFIG_VIRTFS Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build57
1 files changed, 37 insertions, 20 deletions
diff --git a/meson.build b/meson.build
index 0ce993a404..3d889857a0 100644
--- a/meson.build
+++ b/meson.build
@@ -169,7 +169,6 @@ version_res = []
coref = []
iokit = []
emulator_link_args = []
-cocoa = not_found
hvf = not_found
if targetos == 'windows'
socket = cc.find_library('ws2_32')
@@ -182,7 +181,6 @@ if targetos == 'windows'
elif targetos == 'darwin'
coref = dependency('appleframeworks', modules: 'CoreFoundation')
iokit = dependency('appleframeworks', modules: 'IOKit')
- cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
elif targetos == 'sunos'
socket = [cc.find_library('socket'),
cc.find_library('nsl'),
@@ -256,9 +254,6 @@ if not have_xen_pci_passthrough and get_option('xen_pci_passthrough').enabled()
error('Xen PCI passthrough requested but Xen not enabled')
endif
endif
-if not cocoa.found() and get_option('cocoa').enabled()
- error('Cocoa not available on this platform')
-endif
################
# Dependencies #
@@ -362,6 +357,14 @@ if not get_option('attr').disabled()
endif
endif
+cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
+if cocoa.found() and get_option('sdl').enabled()
+ error('Cocoa and SDL cannot be enabled at the same time')
+endif
+if cocoa.found() and get_option('gtk').enabled()
+ error('Cocoa and GTK+ cannot be enabled at the same time')
+endif
+
seccomp = not_found
if not get_option('seccomp').auto() or have_system or have_tools
seccomp = dependency('libseccomp', version: '>=2.3.0',
@@ -647,7 +650,7 @@ if not get_option('brlapi').auto() or have_system
endif
sdl = not_found
-if have_system
+if not get_option('sdl').auto() or (have_system and not cocoa.found())
sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static)
sdl_image = not_found
endif
@@ -776,20 +779,32 @@ if 'CONFIG_OPENGL' in config_host
opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
link_args: config_host['OPENGL_LIBS'].split())
endif
+
gtk = not_found
-if 'CONFIG_GTK' in config_host
- gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(),
- link_args: config_host['GTK_LIBS'].split())
+gtkx11 = not_found
+if not get_option('gtk').auto() or (have_system and not cocoa.found())
+ gtk = dependency('gtk+-3.0', version: '>=3.22.0',
+ method: 'pkg-config',
+ required: get_option('gtk'),
+ static: enable_static)
+ if gtk.found()
+ gtkx11 = dependency('gtk+-x11-3.0', version: '>=3.22.0',
+ method: 'pkg-config',
+ required: false,
+ static: enable_static)
+ gtk = declare_dependency(dependencies: [gtk, gtkx11])
+ endif
endif
+
vte = not_found
if 'CONFIG_VTE' in config_host
vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(),
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 gtkx11.found() or 'lm32-softmmu' in target_dirs
+ x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found(),
+ static: enable_static)
endif
vnc = not_found
png = not_found
@@ -1062,6 +1077,7 @@ if glusterfs.found()
config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftruncate_has_stat)
config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat)
endif
+config_host_data.set('CONFIG_GTK', gtk.found())
config_host_data.set('CONFIG_LIBATTR', have_old_libattr)
config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found())
config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
@@ -1085,6 +1101,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])
@@ -1171,7 +1188,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'] : []) + \
@@ -1815,7 +1832,7 @@ blockdev_ss.add(files(
'blockdev-nbd.c',
'iothread.c',
'job-qmp.c',
-))
+), gnutls)
# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
# os-win32.c does not
@@ -1971,6 +1988,7 @@ qmp = declare_dependency(link_whole: [libqmp])
libchardev = static_library('chardev', chardev_ss.sources() + genh,
name_suffix: 'fa',
+ dependencies: [gnutls],
build_by_default: false)
chardev = declare_dependency(link_whole: libchardev)
@@ -2189,7 +2207,7 @@ if have_tools
qemu_io = executable('qemu-io', files('qemu-io.c'),
dependencies: [block, qemuutil], install: true)
qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
- dependencies: [blockdev, qemuutil], install: true)
+ dependencies: [blockdev, qemuutil, gnutls], install: true)
subdir('storage-daemon')
subdir('contrib/rdmacm-mux')
@@ -2229,7 +2247,7 @@ subdir('tools')
subdir('pc-bios')
subdir('docs')
subdir('tests')
-if 'CONFIG_GTK' in config_host
+if gtk.found()
subdir('po')
endif
@@ -2246,7 +2264,7 @@ if host_machine.system() == 'windows'
if build_docs
nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
endif
- if 'CONFIG_GTK' in config_host
+ if gtk.found()
nsis_cmd += '-DCONFIG_GTK=y'
endif
@@ -2331,14 +2349,13 @@ summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
summary_info += {'static build': config_host.has_key('CONFIG_STATIC')}
if targetos == 'darwin'
- summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
+ summary_info += {'Cocoa support': cocoa.found()}
endif
# TODO: add back version
summary_info += {'SDL support': sdl.found()}
summary_info += {'SDL image support': sdl_image.found()}
# TODO: add back version
-summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
-summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')}
+summary_info += {'GTK support': gtk.found()}
summary_info += {'pixman': pixman.found()}
# TODO: add back version
summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}