1 project('qemu', ['c'], meson_version: '>=0.55.0',
2 default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11',
4 version: run_command('head', meson.source_root() / 'VERSION').stdout().strip())
6 not_found = dependency('', required: false)
7 if meson.version().version_compare('>=0.56.0')
8 keyval = import('keyval')
10 keyval = import('unstable-keyval')
12 ss = import('sourceset')
14 sh = find_program('sh')
15 cc = meson.get_compiler('c')
16 config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
17 enable_modules = 'CONFIG_MODULES' in config_host
18 enable_static = 'CONFIG_STATIC' in config_host
19 build_docs = 'BUILD_DOCS' in config_host
21 if get_option('qemu_suffix').startswith('/')
22 error('qemu_suffix cannot start with a /')
25 qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
26 qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
27 config_host_data = configuration_data()
30 target_dirs = config_host['TARGET_DIRS'].split()
33 foreach target : target_dirs
34 have_user = have_user or target.endswith('-user')
35 have_system = have_system or target.endswith('-softmmu')
37 have_tools = 'CONFIG_TOOLS' in config_host
38 have_block = have_system or have_tools
40 python = import('python').find_installation()
42 supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
43 supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
44 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
46 cpu = host_machine.cpu_family()
47 targetos = host_machine.system()
49 configure_file(input: files('scripts/ninjatool.py'),
51 configuration: config_host)
53 if cpu in ['x86', 'x86_64']
54 kvm_targets = ['i386-softmmu', 'x86_64-softmmu']
56 kvm_targets = ['aarch64-softmmu']
58 kvm_targets = ['s390x-softmmu']
59 elif cpu in ['ppc', 'ppc64']
60 kvm_targets = ['ppc-softmmu', 'ppc64-softmmu']
65 accelerator_targets = { 'CONFIG_KVM': kvm_targets }
66 if cpu in ['x86', 'x86_64']
67 accelerator_targets += {
68 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'],
69 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'],
70 'CONFIG_HVF': ['x86_64-softmmu'],
71 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
79 # Specify linker-script with add_project_link_arguments so that it is not placed
80 # within a linker --start-group/--end-group pair
81 if 'CONFIG_FUZZ' in config_host
82 add_project_link_arguments(['-Wl,-T,',
83 (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
84 native: false, language: ['c', 'cpp', 'objc'])
87 add_project_arguments(config_host['QEMU_CFLAGS'].split(),
88 native: false, language: ['c', 'objc'])
89 add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
90 native: false, language: 'cpp')
91 add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
92 native: false, language: ['c', 'cpp', 'objc'])
93 add_project_arguments(config_host['QEMU_INCLUDES'].split(),
94 language: ['c', 'cpp', 'objc'])
97 link_language = meson.get_external_property('link_language', 'cpp')
98 if link_language == 'cpp'
99 add_languages('cpp', required: true, native: false)
101 if host_machine.system() == 'darwin'
102 add_languages('objc', required: false, native: false)
105 if 'SPARSE_CFLAGS' in config_host
107 command: [find_program('scripts/check_sparse.py'),
108 config_host['SPARSE_CFLAGS'].split(),
109 'compile_commands.json'])
112 ###########################################
113 # Target-specific checks and dependencies #
114 ###########################################
116 if targetos != 'linux' and get_option('mpath').enabled()
117 error('Multipath is supported only on Linux')
120 m = cc.find_library('m', required: false)
121 util = cc.find_library('util', required: false)
129 if targetos == 'windows'
130 socket = cc.find_library('ws2_32')
131 winmm = cc.find_library('winmm')
133 win = import('windows')
134 version_res = win.compile_resources('version.rc',
135 depend_files: files('pc-bios/qemu-nsis.ico'),
136 include_directories: include_directories('.'))
137 elif targetos == 'darwin'
138 coref = dependency('appleframeworks', modules: 'CoreFoundation')
139 iokit = dependency('appleframeworks', modules: 'IOKit')
140 cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
141 elif targetos == 'sunos'
142 socket = [cc.find_library('socket'),
143 cc.find_library('nsl'),
144 cc.find_library('resolv')]
145 elif targetos == 'haiku'
146 socket = [cc.find_library('posix_error_mapper'),
147 cc.find_library('network'),
148 cc.find_library('bsd')]
152 if not get_option('kvm').disabled() and targetos == 'linux'
153 accelerators += 'CONFIG_KVM'
155 if not get_option('xen').disabled() and 'CONFIG_XEN_BACKEND' in config_host
156 accelerators += 'CONFIG_XEN'
157 have_xen_pci_passthrough = not get_option('xen_pci_passthrough').disabled() and targetos == 'linux'
159 have_xen_pci_passthrough = false
161 if not get_option('whpx').disabled() and targetos == 'windows'
162 if get_option('whpx').enabled() and cpu != 'x86_64'
163 error('WHPX requires 64-bit host')
164 elif cc.has_header('WinHvPlatform.h', required: get_option('whpx')) and \
165 cc.has_header('WinHvEmulation.h', required: get_option('whpx'))
166 accelerators += 'CONFIG_WHPX'
169 if not get_option('hvf').disabled()
170 hvf = dependency('appleframeworks', modules: 'Hypervisor',
171 required: get_option('hvf'))
173 accelerators += 'CONFIG_HVF'
176 if not get_option('hax').disabled()
177 if get_option('hax').enabled() or targetos in ['windows', 'darwin', 'netbsd']
178 accelerators += 'CONFIG_HAX'
181 if not get_option('tcg').disabled()
182 if cpu not in supported_cpus
183 if 'CONFIG_TCG_INTERPRETER' in config_host
184 warning('Unsupported CPU @0@, will use TCG with TCI (experimental)'.format(cpu))
186 error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
189 accelerators += 'CONFIG_TCG'
190 config_host += { 'CONFIG_TCG': 'y' }
193 if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled()
194 error('KVM not available on this platform')
196 if 'CONFIG_HVF' not in accelerators and get_option('hvf').enabled()
197 error('HVF not available on this platform')
199 if 'CONFIG_WHPX' not in accelerators and get_option('whpx').enabled()
200 error('WHPX not available on this platform')
202 if not have_xen_pci_passthrough and get_option('xen_pci_passthrough').enabled()
203 if 'CONFIG_XEN' in accelerators
204 error('Xen PCI passthrough not available on this platform')
206 error('Xen PCI passthrough requested but Xen not enabled')
209 if not cocoa.found() and get_option('cocoa').enabled()
210 error('Cocoa not available on this platform')
217 # The path to glib.h is added to all compilation commands. This was
218 # grandfathered in from the QEMU Makefiles.
219 add_project_arguments(config_host['GLIB_CFLAGS'].split(),
220 native: false, language: ['c', 'cpp', 'objc'])
221 glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
223 if 'CONFIG_GIO' in config_host
224 gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
225 link_args: config_host['GIO_LIBS'].split())
228 if 'CONFIG_TRACE_UST' in config_host
229 lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split())
232 if 'CONFIG_TRACE_UST' in config_host
233 urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split())
236 if 'CONFIG_GCRYPT' in config_host
237 gcrypt = declare_dependency(compile_args: config_host['GCRYPT_CFLAGS'].split(),
238 link_args: config_host['GCRYPT_LIBS'].split())
241 if 'CONFIG_NETTLE' in config_host
242 nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(),
243 link_args: config_host['NETTLE_LIBS'].split())
246 if 'CONFIG_GNUTLS' in config_host
247 gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
248 link_args: config_host['GNUTLS_LIBS'].split())
251 if have_system or have_tools
252 pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
253 method: 'pkg-config', static: enable_static)
256 if 'CONFIG_AUTH_PAM' in config_host
257 pam = cc.find_library('pam')
259 libaio = cc.find_library('aio', required: false)
260 zlib = dependency('zlib', required: true, static: enable_static)
261 linux_io_uring = not_found
262 if 'CONFIG_LINUX_IO_URING' in config_host
263 linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(),
264 link_args: config_host['LINUX_IO_URING_LIBS'].split())
267 if 'CONFIG_LIBXML2' in config_host
268 libxml2 = declare_dependency(compile_args: config_host['LIBXML2_CFLAGS'].split(),
269 link_args: config_host['LIBXML2_LIBS'].split())
272 if 'CONFIG_LIBNFS' in config_host
273 libnfs = declare_dependency(link_args: config_host['LIBNFS_LIBS'].split())
276 if 'CONFIG_ATTR' in config_host
277 libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split())
280 if 'CONFIG_SECCOMP' in config_host
281 seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(),
282 link_args: config_host['SECCOMP_LIBS'].split())
284 libcap_ng = not_found
285 if 'CONFIG_LIBCAP_NG' in config_host
286 libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split())
288 if get_option('xkbcommon').auto() and not have_system and not have_tools
289 xkbcommon = not_found
291 xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
292 method: 'pkg-config', static: enable_static)
295 if config_host.has_key('CONFIG_SLIRP')
296 slirp = declare_dependency(compile_args: config_host['SLIRP_CFLAGS'].split(),
297 link_args: config_host['SLIRP_LIBS'].split())
300 if config_host.has_key('CONFIG_VDE')
301 vde = declare_dependency(link_args: config_host['VDE_LIBS'].split())
304 if 'CONFIG_LIBPULSE' in config_host
305 pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(),
306 link_args: config_host['PULSE_LIBS'].split())
309 if 'CONFIG_ALSA' in config_host
310 alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(),
311 link_args: config_host['ALSA_LIBS'].split())
314 if 'CONFIG_LIBJACK' in config_host
315 jack = declare_dependency(link_args: config_host['JACK_LIBS'].split())
318 if 'CONFIG_SPICE' in config_host
319 spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(),
320 link_args: config_host['SPICE_LIBS'].split())
322 rt = cc.find_library('rt', required: false)
324 if 'CONFIG_PLUGIN' in config_host
325 libdl = cc.find_library('dl', required: true)
328 if 'CONFIG_LIBISCSI' in config_host
329 libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(),
330 link_args: config_host['LIBISCSI_LIBS'].split())
333 if 'CONFIG_ZSTD' in config_host
334 zstd = declare_dependency(compile_args: config_host['ZSTD_CFLAGS'].split(),
335 link_args: config_host['ZSTD_LIBS'].split())
338 if 'CONFIG_GBM' in config_host
339 gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
340 link_args: config_host['GBM_LIBS'].split())
343 if 'CONFIG_VIRGL' in config_host
344 virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(),
345 link_args: config_host['VIRGL_LIBS'].split())
348 if 'CONFIG_CURL' in config_host
349 curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(),
350 link_args: config_host['CURL_LIBS'].split())
353 if targetos == 'linux' and (have_system or have_tools)
354 libudev = dependency('libudev',
355 required: get_option('mpath').enabled(),
356 static: enable_static)
359 mpathpersist = not_found
360 mpathpersist_new_api = false
361 if targetos == 'linux' and have_tools and not get_option('mpath').disabled()
362 mpath_test_source_new = '''
364 #include <mpath_persist.h>
365 unsigned mpath_mx_alloc_len = 1024;
367 static struct config *multipath_conf;
368 extern struct udev *udev;
369 extern struct config *get_multipath_config(void);
370 extern void put_multipath_config(struct config *conf);
372 struct config *get_multipath_config(void) { return multipath_conf; }
373 void put_multipath_config(struct config *conf) { }
376 multipath_conf = mpath_lib_init();
379 mpath_test_source_old = '''
381 #include <mpath_persist.h>
382 unsigned mpath_mx_alloc_len = 1024;
385 struct udev *udev = udev_new();
386 mpath_lib_init(udev);
389 mpathlibs = [libudev]
391 mpathlibs += cc.find_library('devmapper',
392 required: get_option('mpath'),
393 static: enable_static)
395 mpathlibs += cc.find_library('multipath',
396 required: get_option('mpath'),
397 static: enable_static)
398 mpathlibs += cc.find_library('mpathpersist',
399 required: get_option('mpath'),
400 static: enable_static)
401 foreach lib: mpathlibs
407 if mpathlibs.length() > 0
408 if cc.links(mpath_test_source_new, dependencies: mpathlibs)
409 mpathpersist = declare_dependency(dependencies: mpathlibs)
410 mpathpersist_new_api = true
411 elif cc.links(mpath_test_source_old, dependencies: mpathlibs)
412 mpathpersist = declare_dependency(dependencies: mpathlibs)
414 if get_option('mpath').enabled()
415 error('Cannot detect libmpathpersist API')
417 warning('Cannot detect libmpathpersist API, disabling')
424 if 'CONFIG_BRLAPI' in config_host
425 brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
430 sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static)
431 sdl_image = not_found
434 # work around 2.0.8 bug
435 sdl = declare_dependency(compile_args: '-Wno-undef',
437 sdl_image = dependency('SDL2_image', required: get_option('sdl_image'),
438 method: 'pkg-config', static: enable_static)
440 if get_option('sdl_image').enabled()
441 error('sdl-image required, but SDL was @0@'.format(
442 get_option('sdl').disabled() ? 'disabled' : 'not found'))
444 sdl_image = not_found
448 if 'CONFIG_RBD' in config_host
449 rbd = declare_dependency(link_args: config_host['RBD_LIBS'].split())
451 glusterfs = not_found
452 if 'CONFIG_GLUSTERFS' in config_host
453 glusterfs = declare_dependency(compile_args: config_host['GLUSTERFS_CFLAGS'].split(),
454 link_args: config_host['GLUSTERFS_LIBS'].split())
457 if 'CONFIG_LIBSSH' in config_host
458 libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
459 link_args: config_host['LIBSSH_LIBS'].split())
462 if 'CONFIG_BZIP2' in config_host
463 libbzip2 = declare_dependency(link_args: config_host['BZIP2_LIBS'].split())
466 if 'CONFIG_LZFSE' in config_host
467 liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split())
470 if 'CONFIG_AUDIO_OSS' in config_host
471 oss = declare_dependency(link_args: config_host['OSS_LIBS'].split())
474 if 'CONFIG_AUDIO_DSOUND' in config_host
475 dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split())
477 coreaudio = not_found
478 if 'CONFIG_AUDIO_COREAUDIO' in config_host
479 coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split())
482 if 'CONFIG_OPENGL' in config_host
483 opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
484 link_args: config_host['OPENGL_LIBS'].split())
487 if 'CONFIG_GTK' in config_host
488 gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(),
489 link_args: config_host['GTK_LIBS'].split())
492 if 'CONFIG_VTE' in config_host
493 vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(),
494 link_args: config_host['VTE_LIBS'].split())
497 if 'CONFIG_X11' in config_host
498 x11 = declare_dependency(compile_args: config_host['X11_CFLAGS'].split(),
499 link_args: config_host['X11_LIBS'].split())
502 if 'CONFIG_CURSES' in config_host
503 curses = declare_dependency(compile_args: config_host['CURSES_CFLAGS'].split(),
504 link_args: config_host['CURSES_LIBS'].split())
507 if 'CONFIG_ICONV' in config_host
508 iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(),
509 link_args: config_host['ICONV_LIBS'].split())
515 if get_option('vnc').enabled()
516 vnc = declare_dependency() # dummy dependency
517 png = dependency('libpng', required: get_option('vnc_png'),
518 method: 'pkg-config', static: enable_static)
519 jpeg = cc.find_library('jpeg', has_headers: ['jpeglib.h'],
520 required: get_option('vnc_jpeg'),
521 static: enable_static)
522 sasl = cc.find_library('sasl2', has_headers: ['sasl/sasl.h'],
523 required: get_option('vnc_sasl'),
524 static: enable_static)
526 sasl = declare_dependency(dependencies: sasl,
527 compile_args: '-DSTRUCT_IOVEC_DEFINED')
531 if 'CONFIG_FDT' in config_host
532 fdt = declare_dependency(compile_args: config_host['FDT_CFLAGS'].split(),
533 link_args: config_host['FDT_LIBS'].split())
536 if 'CONFIG_SNAPPY' in config_host
537 snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split())
540 if 'CONFIG_LZO' in config_host
541 lzo = declare_dependency(link_args: config_host['LZO_LIBS'].split())
544 if 'CONFIG_RDMA' in config_host
545 rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
548 if 'CONFIG_NUMA' in config_host
549 numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split())
552 if 'CONFIG_XEN_BACKEND' in config_host
553 xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
554 link_args: config_host['XEN_LIBS'].split())
557 if 'CONFIG_SMARTCARD' in config_host
558 cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(),
559 link_args: config_host['SMARTCARD_LIBS'].split())
563 u2f = dependency('u2f-emu', required: get_option('u2f'),
564 method: 'pkg-config',
565 static: enable_static)
568 if 'CONFIG_USB_REDIR' in config_host
569 usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(),
570 link_args: config_host['USB_REDIR_LIBS'].split())
573 if 'CONFIG_USB_LIBUSB' in config_host
574 libusb = declare_dependency(compile_args: config_host['LIBUSB_CFLAGS'].split(),
575 link_args: config_host['LIBUSB_LIBS'].split())
578 if 'CONFIG_CAPSTONE' in config_host
579 capstone = declare_dependency(compile_args: config_host['CAPSTONE_CFLAGS'].split(),
580 link_args: config_host['CAPSTONE_LIBS'].split())
583 if 'CONFIG_LIBPMEM' in config_host
584 libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(),
585 link_args: config_host['LIBPMEM_LIBS'].split())
587 libdaxctl = not_found
588 if 'CONFIG_LIBDAXCTL' in config_host
589 libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split())
592 if 'CONFIG_TASN1' in config_host
593 tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(),
594 link_args: config_host['TASN1_LIBS'].split())
596 keyutils = dependency('libkeyutils', required: false,
597 method: 'pkg-config', static: enable_static)
599 has_gettid = cc.has_function('gettid')
604 if get_option('malloc') == 'system'
606 not get_option('malloc_trim').disabled() and \
607 cc.links('''#include <malloc.h>
608 int main(void) { malloc_trim(0); return 0; }''')
610 has_malloc_trim = false
611 malloc = cc.find_library(get_option('malloc'), required: true)
613 if not has_malloc_trim and get_option('malloc_trim').enabled()
614 if get_option('malloc') == 'system'
615 error('malloc_trim not available on this platform.')
617 error('malloc_trim not available with non-libc memory allocator')
621 # Create config-host.h
623 config_host_data.set('CONFIG_COCOA', cocoa.found())
624 config_host_data.set('CONFIG_LIBUDEV', libudev.found())
625 config_host_data.set('CONFIG_MPATH', mpathpersist.found())
626 config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
627 config_host_data.set('CONFIG_SDL', sdl.found())
628 config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
629 config_host_data.set('CONFIG_VNC', vnc.found())
630 config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
631 config_host_data.set('CONFIG_VNC_PNG', png.found())
632 config_host_data.set('CONFIG_VNC_SASL', sasl.found())
633 config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found())
634 config_host_data.set('CONFIG_KEYUTILS', keyutils.found())
635 config_host_data.set('CONFIG_GETTID', has_gettid)
636 config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim)
637 config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version()))
638 config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0])
639 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
640 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
642 arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
643 strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'bindir', 'prefix', 'qemu_confdir', 'qemu_datadir',
644 'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir',
645 'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath', 'sysconfdir']
646 foreach k, v: config_host
647 if arrays.contains(k)
649 v = '"' + '", "'.join(v.split()) + '", '
651 config_host_data.set(k, v)
653 config_host_data.set('HOST_' + v.to_upper(), 1)
654 elif strings.contains(k)
655 if not k.startswith('CONFIG_')
656 k = 'CONFIG_' + k.to_upper()
658 config_host_data.set_quoted(k, v)
659 elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_')
660 config_host_data.set(k, v == 'y' ? 1 : v)
663 genh += configure_file(output: 'config-host.h', configuration: config_host_data)
665 minikconf = find_program('scripts/minikconf.py')
667 config_all_devices = {}
668 config_all_disas = {}
669 config_devices_mak_list = []
670 config_devices_h = {}
672 config_target_mak = {}
675 'alpha' : ['CONFIG_ALPHA_DIS'],
676 'arm' : ['CONFIG_ARM_DIS'],
677 'avr' : ['CONFIG_AVR_DIS'],
678 'cris' : ['CONFIG_CRIS_DIS'],
679 'hppa' : ['CONFIG_HPPA_DIS'],
680 'i386' : ['CONFIG_I386_DIS'],
681 'x86_64' : ['CONFIG_I386_DIS'],
682 'x32' : ['CONFIG_I386_DIS'],
683 'lm32' : ['CONFIG_LM32_DIS'],
684 'm68k' : ['CONFIG_M68K_DIS'],
685 'microblaze' : ['CONFIG_MICROBLAZE_DIS'],
686 'mips' : ['CONFIG_MIPS_DIS'],
687 'moxie' : ['CONFIG_MOXIE_DIS'],
688 'nios2' : ['CONFIG_NIOS2_DIS'],
689 'or1k' : ['CONFIG_OPENRISC_DIS'],
690 'ppc' : ['CONFIG_PPC_DIS'],
691 'riscv' : ['CONFIG_RISCV_DIS'],
692 'rx' : ['CONFIG_RX_DIS'],
693 's390' : ['CONFIG_S390_DIS'],
694 'sh4' : ['CONFIG_SH4_DIS'],
695 'sparc' : ['CONFIG_SPARC_DIS'],
696 'xtensa' : ['CONFIG_XTENSA_DIS'],
698 if link_language == 'cpp'
700 'aarch64' : [ 'CONFIG_ARM_A64_DIS'],
701 'arm' : [ 'CONFIG_ARM_DIS', 'CONFIG_ARM_A64_DIS'],
702 'mips' : [ 'CONFIG_MIPS_DIS', 'CONFIG_NANOMIPS_DIS'],
706 kconfig_external_symbols = [
716 'CONFIG_VHOST_KERNEL',
721 ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS']
723 foreach target : target_dirs
724 config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak')
727 foreach sym: accelerators
728 if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, [])
729 config_target += { sym: 'y' }
730 config_all += { sym: 'y' }
731 if sym == 'CONFIG_XEN' and have_xen_pci_passthrough
732 config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' }
739 foreach k, v: disassemblers
740 if config_host['ARCH'].startswith(k) or config_target['TARGET_BASE_ARCH'].startswith(k)
742 config_target += { sym: 'y' }
743 config_all_disas += { sym: 'y' }
748 config_target_data = configuration_data()
749 foreach k, v: config_target
750 if not k.startswith('TARGET_') and not k.startswith('CONFIG_')
752 elif ignored.contains(k)
754 elif k == 'TARGET_BASE_ARCH'
755 config_target_data.set('TARGET_' + v.to_upper(), 1)
756 elif k == 'TARGET_NAME'
757 config_target_data.set_quoted(k, v)
759 config_target_data.set(k, 1)
761 config_target_data.set(k, v)
764 config_target_h += {target: configure_file(output: target + '-config-target.h',
765 configuration: config_target_data)}
767 if target.endswith('-softmmu')
769 foreach sym : kconfig_external_symbols
770 if sym in config_target or sym in config_host
771 base_kconfig += '@0@=y'.format(sym)
775 config_devices_mak = target + '-config-devices.mak'
776 config_devices_mak = configure_file(
777 input: ['default-configs/devices' / target + '.mak', 'Kconfig'],
778 output: config_devices_mak,
779 depfile: config_devices_mak + '.d',
781 command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'],
782 config_devices_mak, '@DEPFILE@', '@INPUT@',
785 config_devices_data = configuration_data()
786 config_devices = keyval.load(config_devices_mak)
787 foreach k, v: config_devices
788 config_devices_data.set(k, 1)
790 config_devices_mak_list += config_devices_mak
791 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
792 configuration: config_devices_data)}
793 config_target += config_devices
794 config_all_devices += config_devices
796 config_target_mak += {target: config_target}
799 # This configuration is used to build files that are shared by
800 # multiple binaries, and then extracted out of the "common"
801 # static_library target.
803 # We do not use all_sources()/all_dependencies(), because it would
804 # build literally all source files, including devices only used by
805 # targets that are not built for this compilation. The CONFIG_ALL
806 # pseudo symbol replaces it.
808 config_all += config_all_devices
809 config_all += config_host
810 config_all += config_all_disas
812 'CONFIG_XEN': config_host.has_key('CONFIG_XEN_BACKEND'),
813 'CONFIG_SOFTMMU': have_system,
814 'CONFIG_USER_ONLY': have_user,
820 hxtool = find_program('scripts/hxtool')
821 shaderinclude = find_program('scripts/shaderinclude.pl')
822 qapi_gen = find_program('scripts/qapi-gen.py')
823 qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
824 meson.source_root() / 'scripts/qapi/commands.py',
825 meson.source_root() / 'scripts/qapi/common.py',
826 meson.source_root() / 'scripts/qapi/error.py',
827 meson.source_root() / 'scripts/qapi/events.py',
828 meson.source_root() / 'scripts/qapi/expr.py',
829 meson.source_root() / 'scripts/qapi/gen.py',
830 meson.source_root() / 'scripts/qapi/introspect.py',
831 meson.source_root() / 'scripts/qapi/parser.py',
832 meson.source_root() / 'scripts/qapi/schema.py',
833 meson.source_root() / 'scripts/qapi/source.py',
834 meson.source_root() / 'scripts/qapi/types.py',
835 meson.source_root() / 'scripts/qapi/visit.py',
836 meson.source_root() / 'scripts/qapi/common.py',
837 meson.source_root() / 'scripts/qapi-gen.py'
841 python, files('scripts/tracetool.py'),
842 '--backend=' + config_host['TRACE_BACKENDS']
845 qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
846 meson.current_source_dir(),
847 config_host['PKGVERSION'], meson.project_version()]
848 qemu_version = custom_target('qemu-version.h',
849 output: 'qemu-version.h',
850 command: qemu_version_cmd,
852 build_by_default: true,
853 build_always_stale: true)
858 ['qemu-options.hx', 'qemu-options.def'],
859 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
863 ['hmp-commands.hx', 'hmp-commands.h'],
864 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
867 foreach d : hx_headers
868 hxdep += custom_target(d[1],
872 build_by_default: true, # to be removed when added to a target
873 command: [hxtool, '-h', '@INPUT0@'])
877 SPHINX_ARGS = [config_host['SPHINX_BUILD'],
878 '-Dversion=' + meson.project_version(),
879 '-Drelease=' + config_host['PKGVERSION']]
881 if get_option('werror')
882 SPHINX_ARGS += [ '-W' ]
885 sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py',
886 meson.source_root() / 'docs/sphinx/hxtool.py',
887 meson.source_root() / 'docs/sphinx/kerneldoc.py',
888 meson.source_root() / 'docs/sphinx/kernellog.py',
889 meson.source_root() / 'docs/sphinx/qapidoc.py',
890 meson.source_root() / 'docs/sphinx/qmp_lexer.py',
893 # Collect sourcesets.
895 util_ss = ss.source_set()
896 stub_ss = ss.source_set()
897 trace_ss = ss.source_set()
898 block_ss = ss.source_set()
899 blockdev_ss = ss.source_set()
900 qmp_ss = ss.source_set()
901 common_ss = ss.source_set()
902 softmmu_ss = ss.source_set()
903 user_ss = ss.source_set()
904 bsd_user_ss = ss.source_set()
905 linux_user_ss = ss.source_set()
906 specific_ss = ss.source_set()
907 specific_fuzz_ss = ss.source_set()
912 target_softmmu_arch = {}
918 # TODO: add each directory to the subdirs from its own meson.build, once
920 trace_events_subdirs = [
927 trace_events_subdirs += [ 'linux-user' ]
930 trace_events_subdirs += [
939 trace_events_subdirs += [
950 'hw/block/dataplane',
995 trace_events_subdirs += [
1022 libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO')
1023 modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
1026 # Build targets from sourcesets
1028 stub_ss = stub_ss.apply(config_all, strict: false)
1030 util_ss.add_all(trace_ss)
1031 util_ss = util_ss.apply(config_all, strict: false)
1032 libqemuutil = static_library('qemuutil',
1033 sources: util_ss.sources() + stub_ss.sources() + genh,
1034 dependencies: [util_ss.dependencies(), m, glib, socket, malloc])
1035 qemuutil = declare_dependency(link_with: libqemuutil,
1036 sources: genh + version_res)
1038 decodetree = generator(find_program('scripts/decodetree.py'),
1039 output: 'decode-@BASENAME@.c.inc',
1040 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
1046 subdir('libdecnumber')
1057 block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
1063 blockdev_ss.add(files(
1069 # os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
1070 # os-win32.c does not
1071 blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
1072 softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
1074 softmmu_ss.add_all(blockdev_ss)
1075 softmmu_ss.add(files(
1081 softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
1082 softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), seccomp])
1083 softmmu_ss.add(when: ['CONFIG_FDT', fdt], if_true: [files('device_tree.c')])
1085 common_ss.add(files('cpus-common.c'))
1089 specific_ss.add(files('disas.c', 'exec.c', 'gdbstub.c'), capstone, libpmem, libdaxctl)
1090 specific_ss.add(files('exec-vary.c'))
1091 specific_ss.add(when: 'CONFIG_TCG', if_true: files(
1095 'tcg/tcg-op-gvec.c',
1100 specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.c', 'tcg/tci.c'))
1112 subdir('linux-user')
1114 bsd_user_ss.add(files('gdbstub.c'))
1115 specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
1117 linux_user_ss.add(files('gdbstub.c', 'thunk.c'))
1118 specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
1120 # needed for fuzzing binaries
1121 subdir('tests/qtest/libqos')
1122 subdir('tests/qtest/fuzz')
1126 foreach d, list : modules
1127 foreach m, module_ss : list
1128 if enable_modules and targetos != 'windows'
1129 module_ss = module_ss.apply(config_all, strict: false)
1130 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
1131 dependencies: [modulecommon, module_ss.dependencies()], pic: true)
1139 block_ss.add_all(module_ss)
1141 softmmu_ss.add_all(module_ss)
1147 nm = find_program('nm')
1148 undefsym = find_program('scripts/undefsym.py')
1149 block_syms = custom_target('block.syms', output: 'block.syms',
1150 input: [libqemuutil, block_mods],
1152 command: [undefsym, nm, '@INPUT@'])
1153 qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
1154 input: [libqemuutil, softmmu_mods],
1156 command: [undefsym, nm, '@INPUT@'])
1158 block_ss = block_ss.apply(config_host, strict: false)
1159 libblock = static_library('block', block_ss.sources() + genh,
1160 dependencies: block_ss.dependencies(),
1161 link_depends: block_syms,
1163 build_by_default: false)
1165 block = declare_dependency(link_whole: [libblock],
1166 link_args: '@block.syms',
1167 dependencies: [crypto, io])
1169 qmp_ss = qmp_ss.apply(config_host, strict: false)
1170 libqmp = static_library('qmp', qmp_ss.sources() + genh,
1171 dependencies: qmp_ss.dependencies(),
1173 build_by_default: false)
1175 qmp = declare_dependency(link_whole: [libqmp])
1177 foreach m : block_mods + softmmu_mods
1178 shared_module(m.name(),
1182 install_dir: config_host['qemu_moddir'])
1185 softmmu_ss.add(authz, block, chardev, crypto, io, qmp)
1186 common_ss.add(qom, qemuutil)
1188 common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss])
1189 common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
1191 common_all = common_ss.apply(config_all, strict: false)
1192 common_all = static_library('common',
1193 build_by_default: false,
1194 sources: common_all.sources() + genh,
1195 dependencies: common_all.dependencies(),
1198 feature_to_c = find_program('scripts/feature_to_c.sh')
1201 foreach target : target_dirs
1202 config_target = config_target_mak[target]
1203 target_name = config_target['TARGET_NAME']
1204 arch = config_target['TARGET_BASE_ARCH']
1205 arch_srcs = [config_target_h[target]]
1207 c_args = ['-DNEED_CPU_H',
1208 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
1209 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
1212 config_target += config_host
1213 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
1214 if targetos == 'linux'
1215 target_inc += include_directories('linux-headers', is_system: true)
1217 if target.endswith('-softmmu')
1218 qemu_target_name = 'qemu-system-' + target_name
1219 target_type='system'
1220 t = target_softmmu_arch[arch].apply(config_target, strict: false)
1221 arch_srcs += t.sources()
1222 arch_deps += t.dependencies()
1224 hw_dir = target_name == 'sparc64' ? 'sparc64' : arch
1225 hw = hw_arch[hw_dir].apply(config_target, strict: false)
1226 arch_srcs += hw.sources()
1227 arch_deps += hw.dependencies()
1229 arch_srcs += config_devices_h[target]
1230 link_args += ['@block.syms', '@qemu.syms']
1232 abi = config_target['TARGET_ABI_DIR']
1234 qemu_target_name = 'qemu-' + target_name
1235 if 'CONFIG_LINUX_USER' in config_target
1236 base_dir = 'linux-user'
1237 target_inc += include_directories('linux-user/host/' / config_host['ARCH'])
1239 base_dir = 'bsd-user'
1241 target_inc += include_directories(
1245 if 'CONFIG_LINUX_USER' in config_target
1246 dir = base_dir / abi
1247 arch_srcs += files(dir / 'signal.c', dir / 'cpu_loop.c')
1248 if config_target.has_key('TARGET_SYSTBL_ABI')
1250 syscall_nr_generators[abi].process(base_dir / abi / config_target['TARGET_SYSTBL'],
1251 extra_args : config_target['TARGET_SYSTBL_ABI'])
1256 if 'TARGET_XML_FILES' in config_target
1257 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
1258 output: target + '-gdbstub-xml.c',
1259 input: files(config_target['TARGET_XML_FILES'].split()),
1260 command: [feature_to_c, '@INPUT@'],
1262 arch_srcs += gdbstub_xml
1265 t = target_arch[arch].apply(config_target, strict: false)
1266 arch_srcs += t.sources()
1267 arch_deps += t.dependencies()
1269 target_common = common_ss.apply(config_target, strict: false)
1270 objects = common_all.extract_objects(target_common.sources())
1271 deps = target_common.dependencies()
1273 target_specific = specific_ss.apply(config_target, strict: false)
1274 arch_srcs += target_specific.sources()
1275 arch_deps += target_specific.dependencies()
1277 lib = static_library('qemu-' + target,
1278 sources: arch_srcs + genh,
1279 dependencies: arch_deps,
1281 include_directories: target_inc,
1283 build_by_default: false,
1286 if target.endswith('-softmmu')
1288 'name': 'qemu-system-' + target_name,
1290 'sources': files('softmmu/main.c'),
1293 if targetos == 'windows' and (sdl.found() or gtk.found())
1295 'name': 'qemu-system-' + target_name + 'w',
1297 'sources': files('softmmu/main.c'),
1301 if config_host.has_key('CONFIG_FUZZ')
1302 specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false)
1304 'name': 'qemu-fuzz-' + target_name,
1306 'sources': specific_fuzz.sources(),
1307 'dependencies': specific_fuzz.dependencies(),
1312 'name': 'qemu-' + target_name,
1319 emulators += {exe['name']:
1320 executable(exe['name'], exe['sources'],
1323 dependencies: arch_deps + deps + exe['dependencies'],
1324 objects: lib.extract_all_objects(recursive: true),
1325 link_language: link_language,
1326 link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []),
1327 link_args: link_args,
1328 gui_app: exe['gui'])
1331 if 'CONFIG_TRACE_SYSTEMTAP' in config_host
1333 {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe['name'], 'install': false},
1334 {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe['name'], 'install': true},
1335 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
1336 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
1338 custom_target(exe['name'] + stp['ext'],
1339 input: trace_events_all,
1340 output: exe['name'] + stp['ext'],
1342 install: stp['install'],
1343 install_dir: qemu_datadir / '../systemtap/tapset',
1345 tracetool, '--group=all', '--format=' + stp['fmt'],
1346 '--binary=' + stp['bin'],
1347 '--target-name=' + target_name,
1348 '--target-type=' + target_type,
1349 '--probe-prefix=qemu.' + target_type + '.' + target_name,
1357 # Other build targets
1359 if 'CONFIG_PLUGIN' in config_host
1360 install_headers('include/qemu/qemu-plugin.h')
1363 if 'CONFIG_GUEST_AGENT' in config_host
1367 # Don't build qemu-keymap if xkbcommon is not explicitly enabled
1368 # when we don't build tools or system
1369 if xkbcommon.found()
1370 # used for the update-keymaps target, so include rules even if !have_tools
1371 qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
1372 dependencies: [qemuutil, xkbcommon], install: have_tools)
1376 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
1377 dependencies: [authz, block, crypto, io, qom, qemuutil], install: true)
1378 qemu_io = executable('qemu-io', files('qemu-io.c'),
1379 dependencies: [block, qemuutil], install: true)
1380 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
1381 dependencies: [block, qemuutil], install: true)
1383 subdir('storage-daemon')
1384 subdir('contrib/rdmacm-mux')
1385 subdir('contrib/elf2dmp')
1387 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
1388 dependencies: qemuutil,
1391 if 'CONFIG_VHOST_USER' in config_host
1392 subdir('contrib/libvhost-user')
1393 subdir('contrib/vhost-user-blk')
1394 subdir('contrib/vhost-user-gpu')
1395 subdir('contrib/vhost-user-input')
1396 subdir('contrib/vhost-user-scsi')
1399 if targetos == 'linux'
1400 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
1401 dependencies: [qemuutil, libcap_ng],
1403 install_dir: get_option('libexecdir'))
1405 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
1406 dependencies: [authz, crypto, io, qom, qemuutil,
1407 libcap_ng, mpathpersist],
1411 if 'CONFIG_IVSHMEM' in config_host
1412 subdir('contrib/ivshmem-client')
1413 subdir('contrib/ivshmem-server')
1422 if 'CONFIG_GTK' in config_host
1426 if host_machine.system() == 'windows'
1428 find_program('scripts/nsis.py'),
1430 get_option('prefix'),
1431 meson.current_source_dir(),
1432 host_machine.cpu_family(),
1434 '-DDISPLAYVERSION=' + meson.project_version(),
1437 nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
1439 if 'CONFIG_GTK' in config_host
1440 nsis_cmd += '-DCONFIG_GTK=y'
1443 nsis = custom_target('nsis',
1444 output: 'qemu-setup-' + meson.project_version() + '.exe',
1445 input: files('qemu.nsi'),
1446 build_always_stale: true,
1447 command: nsis_cmd + ['@INPUT@'])
1448 alias_target('installer', nsis)
1452 summary_info += {'Install prefix': config_host['prefix']}
1453 summary_info += {'BIOS directory': config_host['qemu_datadir']}
1454 summary_info += {'firmware path': config_host['qemu_firmwarepath']}
1455 summary_info += {'binary directory': config_host['bindir']}
1456 summary_info += {'library directory': config_host['libdir']}
1457 summary_info += {'module directory': config_host['qemu_moddir']}
1458 summary_info += {'libexec directory': config_host['libexecdir']}
1459 summary_info += {'include directory': config_host['includedir']}
1460 summary_info += {'config directory': config_host['sysconfdir']}
1461 if targetos != 'windows'
1462 summary_info += {'local state directory': config_host['qemu_localstatedir']}
1463 summary_info += {'Manual directory': get_option('mandir')}
1465 summary_info += {'local state directory': 'queried at runtime'}
1467 summary_info += {'Doc directory': get_option('docdir')}
1468 summary_info += {'Build directory': meson.current_build_dir()}
1469 summary_info += {'Source path': meson.current_source_dir()}
1470 summary_info += {'GIT binary': config_host['GIT']}
1471 summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
1472 summary_info += {'C compiler': meson.get_compiler('c').cmd_array()[0]}
1473 summary_info += {'Host C compiler': meson.get_compiler('c', native: true).cmd_array()[0]}
1474 if link_language == 'cpp'
1475 summary_info += {'C++ compiler': meson.get_compiler('cpp').cmd_array()[0]}
1477 summary_info += {'C++ compiler': false}
1479 if targetos == 'darwin'
1480 summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
1482 summary_info += {'ARFLAGS': config_host['ARFLAGS']}
1483 summary_info += {'CFLAGS': config_host['CFLAGS']}
1484 summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
1485 summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
1486 summary_info += {'make': config_host['MAKE']}
1487 summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
1488 summary_info += {'sphinx-build': config_host['SPHINX_BUILD']}
1489 summary_info += {'genisoimage': config_host['GENISOIMAGE']}
1490 # TODO: add back version
1491 summary_info += {'slirp support': config_host.has_key('CONFIG_SLIRP')}
1492 if config_host.has_key('CONFIG_SLIRP')
1493 summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']}
1495 summary_info += {'module support': config_host.has_key('CONFIG_MODULES')}
1496 if config_host.has_key('CONFIG_MODULES')
1497 summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')}
1499 summary_info += {'host CPU': cpu}
1500 summary_info += {'host endianness': build_machine.endian()}
1501 summary_info += {'target list': config_host['TARGET_DIRS']}
1502 summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')}
1503 summary_info += {'sparse enabled': meson.get_compiler('c').cmd_array().contains('cgcc')}
1504 summary_info += {'strip binaries': get_option('strip')}
1505 summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
1506 summary_info += {'static build': config_host.has_key('CONFIG_STATIC')}
1507 if targetos == 'darwin'
1508 summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
1510 # TODO: add back version
1511 summary_info += {'SDL support': sdl.found()}
1512 summary_info += {'SDL image support': sdl_image.found()}
1513 # TODO: add back version
1514 summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
1515 summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')}
1516 summary_info += {'pixman': pixman.found()}
1517 # TODO: add back version
1518 summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
1519 summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
1520 summary_info += {'GNUTLS support': config_host.has_key('CONFIG_GNUTLS')}
1521 # TODO: add back version
1522 summary_info += {'libgcrypt': config_host.has_key('CONFIG_GCRYPT')}
1523 if config_host.has_key('CONFIG_GCRYPT')
1524 summary_info += {' hmac': config_host.has_key('CONFIG_GCRYPT_HMAC')}
1525 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1527 # TODO: add back version
1528 summary_info += {'nettle': config_host.has_key('CONFIG_NETTLE')}
1529 if config_host.has_key('CONFIG_NETTLE')
1530 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1532 summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')}
1533 summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')}
1534 summary_info += {'iconv support': config_host.has_key('CONFIG_ICONV')}
1535 summary_info += {'curses support': config_host.has_key('CONFIG_CURSES')}
1536 # TODO: add back version
1537 summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')}
1538 summary_info += {'curl support': config_host.has_key('CONFIG_CURL')}
1539 summary_info += {'mingw32 support': targetos == 'windows'}
1540 summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']}
1541 summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
1542 summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
1543 summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')}
1544 summary_info += {'Multipath support': mpathpersist.found()}
1545 summary_info += {'VNC support': vnc.found()}
1547 summary_info += {'VNC SASL support': sasl.found()}
1548 summary_info += {'VNC JPEG support': jpeg.found()}
1549 summary_info += {'VNC PNG support': png.found()}
1551 summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')}
1552 if config_host.has_key('CONFIG_XEN_BACKEND')
1553 summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
1555 summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')}
1556 summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')}
1557 summary_info += {'PIE': get_option('b_pie')}
1558 summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
1559 summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
1560 summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
1561 summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
1562 summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')}
1563 summary_info += {'Install blobs': config_host.has_key('INSTALL_BLOBS')}
1564 summary_info += {'KVM support': config_all.has_key('CONFIG_KVM')}
1565 summary_info += {'HAX support': config_all.has_key('CONFIG_HAX')}
1566 summary_info += {'HVF support': config_all.has_key('CONFIG_HVF')}
1567 summary_info += {'WHPX support': config_all.has_key('CONFIG_WHPX')}
1568 summary_info += {'TCG support': config_all.has_key('CONFIG_TCG')}
1569 if config_all.has_key('CONFIG_TCG')
1570 summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
1571 summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')}
1573 summary_info += {'malloc trim support': has_malloc_trim}
1574 summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
1575 summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}
1576 summary_info += {'fdt support': config_host.has_key('CONFIG_FDT')}
1577 summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')}
1578 summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')}
1579 summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')}
1580 summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')}
1581 summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}
1582 summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')}
1583 summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')}
1584 summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
1585 summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
1586 summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
1587 summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
1588 summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')}
1589 summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
1590 summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
1591 summary_info += {'Trace backends': config_host['TRACE_BACKENDS']}
1592 if config_host['TRACE_BACKENDS'].split().contains('simple')
1593 summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
1595 # TODO: add back protocol and server version
1596 summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
1597 summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')}
1598 summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')}
1599 summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
1600 summary_info += {'U2F support': u2f.found()}
1601 summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')}
1602 summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')}
1603 summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
1604 summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')}
1605 summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')}
1606 summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')}
1607 summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
1608 if targetos == 'windows'
1609 if 'WIN_SDK' in config_host
1610 summary_info += {'Windows SDK': config_host['WIN_SDK']}
1612 summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')}
1613 summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
1614 summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI')}
1616 summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')}
1617 summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
1618 summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'}
1619 summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
1620 summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')}
1621 summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')}
1622 summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')}
1623 summary_info += {'gcov': get_option('b_coverage')}
1624 summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')}
1625 summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')}
1626 summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
1627 summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
1628 summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')}
1629 summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')}
1630 summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')}
1631 summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')}
1632 summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')}
1633 summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
1634 summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}
1635 summary_info += {'memory allocator': get_option('malloc')}
1636 summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
1637 summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
1638 summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
1639 summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')}
1640 summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')}
1641 summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')}
1642 summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')}
1643 summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')}
1644 summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')}
1645 summary_info += {'qed support': config_host.has_key('CONFIG_QED')}
1646 summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
1647 summary_info += {'sheepdog support': config_host.has_key('CONFIG_SHEEPDOG')}
1648 summary_info += {'capstone': config_host.has_key('CONFIG_CAPSTONE')}
1649 summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')}
1650 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
1651 summary_info += {'libudev': libudev.found()}
1652 summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'}
1653 summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')}
1654 summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')}
1655 if config_host.has_key('HAVE_GDB_BIN')
1656 summary_info += {'gdb': config_host['HAVE_GDB_BIN']}
1658 summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')}
1659 summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')}
1660 summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')}
1661 summary(summary_info, bool_yn: true)
1663 if not supported_cpus.contains(cpu)
1665 warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
1667 message('CPU host architecture ' + cpu + ' support is not currently maintained.')
1668 message('The QEMU project intends to remove support for this host CPU in')
1669 message('a future release if nobody volunteers to maintain it and to')
1670 message('provide a build host for our continuous integration setup.')
1671 message('configure has succeeded and you can continue to build, but')
1672 message('if you care about QEMU on this platform you should contact')
1673 message('us upstream at qemu-devel@nongnu.org.')
1676 if not supported_oses.contains(targetos)
1678 warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!')
1680 message('Host OS ' + targetos + 'support is not currently maintained.')
1681 message('The QEMU project intends to remove support for this host OS in')
1682 message('a future release if nobody volunteers to maintain it and to')
1683 message('provide a build host for our continuous integration setup.')
1684 message('configure has succeeded and you can continue to build, but')
1685 message('if you care about QEMU on this platform you should contact')
1686 message('us upstream at qemu-devel@nongnu.org.')