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')
15 sh = find_program('sh')
16 cc = meson.get_compiler('c')
17 config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
18 enable_modules = 'CONFIG_MODULES' in config_host
19 enable_static = 'CONFIG_STATIC' in config_host
20 build_docs = 'BUILD_DOCS' in config_host
22 if get_option('qemu_suffix').startswith('/')
23 error('qemu_suffix cannot start with a /')
26 qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
27 qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
28 config_host_data = configuration_data()
31 target_dirs = config_host['TARGET_DIRS'].split()
34 foreach target : target_dirs
35 have_user = have_user or target.endswith('-user')
36 have_system = have_system or target.endswith('-softmmu')
38 have_tools = 'CONFIG_TOOLS' in config_host
39 have_block = have_system or have_tools
41 python = import('python').find_installation()
43 supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
44 supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
45 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
47 cpu = host_machine.cpu_family()
48 targetos = host_machine.system()
50 configure_file(input: files('scripts/ninjatool.py'),
52 configuration: config_host)
58 # Specify linker-script with add_project_link_arguments so that it is not placed
59 # within a linker --start-group/--end-group pair
60 if 'CONFIG_FUZZ' in config_host
61 add_project_link_arguments(['-Wl,-T,',
62 (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
63 native: false, language: ['c', 'cpp', 'objc'])
66 add_project_arguments(config_host['QEMU_CFLAGS'].split(),
67 native: false, language: ['c', 'objc'])
68 add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
69 native: false, language: 'cpp')
70 add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
71 native: false, language: ['c', 'cpp', 'objc'])
72 add_project_arguments(config_host['QEMU_INCLUDES'].split(),
73 language: ['c', 'cpp', 'objc'])
76 link_language = meson.get_external_property('link_language', 'cpp')
77 if link_language == 'cpp'
78 add_languages('cpp', required: true, native: false)
80 if host_machine.system() == 'darwin'
81 add_languages('objc', required: false, native: false)
84 if 'SPARSE_CFLAGS' in config_host
86 command: [find_program('scripts/check_sparse.py'),
87 config_host['SPARSE_CFLAGS'].split(),
88 'compile_commands.json'])
91 ###########################################
92 # Target-specific checks and dependencies #
93 ###########################################
95 if targetos != 'linux' and get_option('mpath').enabled()
96 error('Multipath is supported only on Linux')
99 m = cc.find_library('m', required: false)
100 util = cc.find_library('util', required: false)
108 if targetos == 'windows'
109 socket = cc.find_library('ws2_32')
110 winmm = cc.find_library('winmm')
112 win = import('windows')
113 version_res = win.compile_resources('version.rc',
114 depend_files: files('pc-bios/qemu-nsis.ico'),
115 include_directories: include_directories('.'))
116 elif targetos == 'darwin'
117 coref = dependency('appleframeworks', modules: 'CoreFoundation')
118 iokit = dependency('appleframeworks', modules: 'IOKit')
119 cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
120 hvf = dependency('appleframeworks', modules: 'Hypervisor')
121 elif targetos == 'sunos'
122 socket = [cc.find_library('socket'),
123 cc.find_library('nsl'),
124 cc.find_library('resolv')]
125 elif targetos == 'haiku'
126 socket = [cc.find_library('posix_error_mapper'),
127 cc.find_library('network'),
128 cc.find_library('bsd')]
131 if not cocoa.found() and get_option('cocoa').enabled()
132 error('Cocoa not available on this platform')
139 # The path to glib.h is added to all compilation commands. This was
140 # grandfathered in from the QEMU Makefiles.
141 add_project_arguments(config_host['GLIB_CFLAGS'].split(),
142 native: false, language: ['c', 'cpp', 'objc'])
143 glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
145 if 'CONFIG_GIO' in config_host
146 gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
147 link_args: config_host['GIO_LIBS'].split())
150 if 'CONFIG_TRACE_UST' in config_host
151 lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split())
154 if 'CONFIG_TRACE_UST' in config_host
155 urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split())
158 if 'CONFIG_GCRYPT' in config_host
159 gcrypt = declare_dependency(compile_args: config_host['GCRYPT_CFLAGS'].split(),
160 link_args: config_host['GCRYPT_LIBS'].split())
163 if 'CONFIG_NETTLE' in config_host
164 nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(),
165 link_args: config_host['NETTLE_LIBS'].split())
168 if 'CONFIG_GNUTLS' in config_host
169 gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
170 link_args: config_host['GNUTLS_LIBS'].split())
173 if have_system or have_tools
174 pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
175 method: 'pkg-config', static: enable_static)
178 if 'CONFIG_AUTH_PAM' in config_host
179 pam = cc.find_library('pam')
181 libaio = cc.find_library('aio', required: false)
182 zlib = dependency('zlib', required: true, static: enable_static)
183 linux_io_uring = not_found
184 if 'CONFIG_LINUX_IO_URING' in config_host
185 linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(),
186 link_args: config_host['LINUX_IO_URING_LIBS'].split())
189 if 'CONFIG_LIBXML2' in config_host
190 libxml2 = declare_dependency(compile_args: config_host['LIBXML2_CFLAGS'].split(),
191 link_args: config_host['LIBXML2_LIBS'].split())
194 if 'CONFIG_LIBNFS' in config_host
195 libnfs = declare_dependency(link_args: config_host['LIBNFS_LIBS'].split())
198 if 'CONFIG_ATTR' in config_host
199 libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split())
202 if 'CONFIG_SECCOMP' in config_host
203 seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(),
204 link_args: config_host['SECCOMP_LIBS'].split())
206 libcap_ng = not_found
207 if 'CONFIG_LIBCAP_NG' in config_host
208 libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split())
210 if get_option('xkbcommon').auto() and not have_system and not have_tools
211 xkbcommon = not_found
213 xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
214 method: 'pkg-config', static: enable_static)
217 if config_host.has_key('CONFIG_SLIRP')
218 slirp = declare_dependency(compile_args: config_host['SLIRP_CFLAGS'].split(),
219 link_args: config_host['SLIRP_LIBS'].split())
222 if config_host.has_key('CONFIG_VDE')
223 vde = declare_dependency(link_args: config_host['VDE_LIBS'].split())
226 if 'CONFIG_LIBPULSE' in config_host
227 pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(),
228 link_args: config_host['PULSE_LIBS'].split())
231 if 'CONFIG_ALSA' in config_host
232 alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(),
233 link_args: config_host['ALSA_LIBS'].split())
236 if 'CONFIG_LIBJACK' in config_host
237 jack = declare_dependency(link_args: config_host['JACK_LIBS'].split())
240 if 'CONFIG_SPICE' in config_host
241 spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(),
242 link_args: config_host['SPICE_LIBS'].split())
244 rt = cc.find_library('rt', required: false)
246 if 'CONFIG_PLUGIN' in config_host
247 libdl = cc.find_library('dl', required: true)
250 if 'CONFIG_LIBISCSI' in config_host
251 libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(),
252 link_args: config_host['LIBISCSI_LIBS'].split())
255 if 'CONFIG_ZSTD' in config_host
256 zstd = declare_dependency(compile_args: config_host['ZSTD_CFLAGS'].split(),
257 link_args: config_host['ZSTD_LIBS'].split())
260 if 'CONFIG_GBM' in config_host
261 gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
262 link_args: config_host['GBM_LIBS'].split())
265 if 'CONFIG_VIRGL' in config_host
266 virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(),
267 link_args: config_host['VIRGL_LIBS'].split())
270 if 'CONFIG_CURL' in config_host
271 curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(),
272 link_args: config_host['CURL_LIBS'].split())
275 if targetos == 'linux' and (have_system or have_tools)
276 libudev = dependency('libudev',
277 required: get_option('mpath').enabled(),
278 static: enable_static)
281 mpathpersist = not_found
282 mpathpersist_new_api = false
283 if targetos == 'linux' and have_tools and not get_option('mpath').disabled()
284 mpath_test_source_new = '''
286 #include <mpath_persist.h>
287 unsigned mpath_mx_alloc_len = 1024;
289 static struct config *multipath_conf;
290 extern struct udev *udev;
291 extern struct config *get_multipath_config(void);
292 extern void put_multipath_config(struct config *conf);
294 struct config *get_multipath_config(void) { return multipath_conf; }
295 void put_multipath_config(struct config *conf) { }
298 multipath_conf = mpath_lib_init();
301 mpath_test_source_old = '''
303 #include <mpath_persist.h>
304 unsigned mpath_mx_alloc_len = 1024;
307 struct udev *udev = udev_new();
308 mpath_lib_init(udev);
311 mpathlibs = [libudev]
313 mpathlibs += cc.find_library('devmapper',
314 required: get_option('mpath'),
315 static: enable_static)
317 mpathlibs += cc.find_library('multipath',
318 required: get_option('mpath'),
319 static: enable_static)
320 mpathlibs += cc.find_library('mpathpersist',
321 required: get_option('mpath'),
322 static: enable_static)
323 foreach lib: mpathlibs
329 if mpathlibs.length() > 0
330 if cc.links(mpath_test_source_new, dependencies: mpathlibs)
331 mpathpersist = declare_dependency(dependencies: mpathlibs)
332 mpathpersist_new_api = true
333 elif cc.links(mpath_test_source_old, dependencies: mpathlibs)
334 mpathpersist = declare_dependency(dependencies: mpathlibs)
336 if get_option('mpath').enabled()
337 error('Cannot detect libmpathpersist API')
339 warning('Cannot detect libmpathpersist API, disabling')
346 if 'CONFIG_BRLAPI' in config_host
347 brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
352 sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static)
353 sdl_image = not_found
356 # work around 2.0.8 bug
357 sdl = declare_dependency(compile_args: '-Wno-undef',
359 sdl_image = dependency('SDL2_image', required: get_option('sdl_image'),
360 method: 'pkg-config', static: enable_static)
362 if get_option('sdl_image').enabled()
363 error('sdl-image required, but SDL was @0@'.format(
364 get_option('sdl').disabled() ? 'disabled' : 'not found'))
366 sdl_image = not_found
370 if 'CONFIG_RBD' in config_host
371 rbd = declare_dependency(link_args: config_host['RBD_LIBS'].split())
373 glusterfs = not_found
374 if 'CONFIG_GLUSTERFS' in config_host
375 glusterfs = declare_dependency(compile_args: config_host['GLUSTERFS_CFLAGS'].split(),
376 link_args: config_host['GLUSTERFS_LIBS'].split())
379 if 'CONFIG_LIBSSH' in config_host
380 libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
381 link_args: config_host['LIBSSH_LIBS'].split())
384 if 'CONFIG_BZIP2' in config_host
385 libbzip2 = declare_dependency(link_args: config_host['BZIP2_LIBS'].split())
388 if 'CONFIG_LZFSE' in config_host
389 liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split())
392 if 'CONFIG_AUDIO_OSS' in config_host
393 oss = declare_dependency(link_args: config_host['OSS_LIBS'].split())
396 if 'CONFIG_AUDIO_DSOUND' in config_host
397 dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split())
399 coreaudio = not_found
400 if 'CONFIG_AUDIO_COREAUDIO' in config_host
401 coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split())
404 if 'CONFIG_OPENGL' in config_host
405 opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
406 link_args: config_host['OPENGL_LIBS'].split())
409 if 'CONFIG_GTK' in config_host
410 gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(),
411 link_args: config_host['GTK_LIBS'].split())
414 if 'CONFIG_VTE' in config_host
415 vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(),
416 link_args: config_host['VTE_LIBS'].split())
419 if 'CONFIG_X11' in config_host
420 x11 = declare_dependency(compile_args: config_host['X11_CFLAGS'].split(),
421 link_args: config_host['X11_LIBS'].split())
424 if 'CONFIG_CURSES' in config_host
425 curses = declare_dependency(compile_args: config_host['CURSES_CFLAGS'].split(),
426 link_args: config_host['CURSES_LIBS'].split())
429 if 'CONFIG_ICONV' in config_host
430 iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(),
431 link_args: config_host['ICONV_LIBS'].split())
437 if get_option('vnc').enabled()
438 vnc = declare_dependency() # dummy dependency
439 png = dependency('libpng', required: get_option('vnc_png'),
440 method: 'pkg-config', static: enable_static)
441 jpeg = cc.find_library('jpeg', has_headers: ['jpeglib.h'],
442 required: get_option('vnc_jpeg'),
443 static: enable_static)
444 sasl = cc.find_library('sasl2', has_headers: ['sasl/sasl.h'],
445 required: get_option('vnc_sasl'),
446 static: enable_static)
448 sasl = declare_dependency(dependencies: sasl,
449 compile_args: '-DSTRUCT_IOVEC_DEFINED')
453 if 'CONFIG_FDT' in config_host
454 fdt = declare_dependency(compile_args: config_host['FDT_CFLAGS'].split(),
455 link_args: config_host['FDT_LIBS'].split())
458 if 'CONFIG_SNAPPY' in config_host
459 snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split())
462 if 'CONFIG_LZO' in config_host
463 lzo = declare_dependency(link_args: config_host['LZO_LIBS'].split())
466 if 'CONFIG_RDMA' in config_host
467 rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
470 if 'CONFIG_NUMA' in config_host
471 numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split())
474 if 'CONFIG_XEN_BACKEND' in config_host
475 xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
476 link_args: config_host['XEN_LIBS'].split())
479 if 'CONFIG_SMARTCARD' in config_host
480 cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(),
481 link_args: config_host['SMARTCARD_LIBS'].split())
485 u2f = dependency('u2f-emu', required: get_option('u2f'),
486 method: 'pkg-config',
487 static: enable_static)
490 if 'CONFIG_USB_REDIR' in config_host
491 usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(),
492 link_args: config_host['USB_REDIR_LIBS'].split())
495 if 'CONFIG_USB_LIBUSB' in config_host
496 libusb = declare_dependency(compile_args: config_host['LIBUSB_CFLAGS'].split(),
497 link_args: config_host['LIBUSB_LIBS'].split())
500 if 'CONFIG_LIBPMEM' in config_host
501 libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(),
502 link_args: config_host['LIBPMEM_LIBS'].split())
504 libdaxctl = not_found
505 if 'CONFIG_LIBDAXCTL' in config_host
506 libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split())
509 if 'CONFIG_TASN1' in config_host
510 tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(),
511 link_args: config_host['TASN1_LIBS'].split())
513 keyutils = dependency('libkeyutils', required: false,
514 method: 'pkg-config', static: enable_static)
516 has_gettid = cc.has_function('gettid')
521 if get_option('malloc') == 'system'
523 not get_option('malloc_trim').disabled() and \
524 cc.links('''#include <malloc.h>
525 int main(void) { malloc_trim(0); return 0; }''')
527 has_malloc_trim = false
528 malloc = cc.find_library(get_option('malloc'), required: true)
530 if not has_malloc_trim and get_option('malloc_trim').enabled()
531 if get_option('malloc') == 'system'
532 error('malloc_trim not available on this platform.')
534 error('malloc_trim not available with non-libc memory allocator')
538 # Create config-host.h
540 config_host_data.set('CONFIG_COCOA', cocoa.found())
541 config_host_data.set('CONFIG_LIBUDEV', libudev.found())
542 config_host_data.set('CONFIG_MPATH', mpathpersist.found())
543 config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
544 config_host_data.set('CONFIG_SDL', sdl.found())
545 config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
546 config_host_data.set('CONFIG_VNC', vnc.found())
547 config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
548 config_host_data.set('CONFIG_VNC_PNG', png.found())
549 config_host_data.set('CONFIG_VNC_SASL', sasl.found())
550 config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found())
551 config_host_data.set('CONFIG_KEYUTILS', keyutils.found())
552 config_host_data.set('CONFIG_GETTID', has_gettid)
553 config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim)
554 config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version()))
555 config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0])
556 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
557 config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
559 arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
560 strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'bindir', 'prefix', 'qemu_confdir', 'qemu_datadir',
561 'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir',
562 'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath', 'sysconfdir']
563 foreach k, v: config_host
564 if arrays.contains(k)
566 v = '"' + '", "'.join(v.split()) + '", '
568 config_host_data.set(k, v)
570 config_host_data.set('HOST_' + v.to_upper(), 1)
571 elif strings.contains(k)
572 if not k.startswith('CONFIG_')
573 k = 'CONFIG_' + k.to_upper()
575 config_host_data.set_quoted(k, v)
576 elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_')
577 config_host_data.set(k, v == 'y' ? 1 : v)
581 minikconf = find_program('scripts/minikconf.py')
583 config_all_devices = {}
584 config_all_disas = {}
585 config_devices_mak_list = []
586 config_devices_h = {}
588 config_target_mak = {}
591 'alpha' : ['CONFIG_ALPHA_DIS'],
592 'arm' : ['CONFIG_ARM_DIS'],
593 'avr' : ['CONFIG_AVR_DIS'],
594 'cris' : ['CONFIG_CRIS_DIS'],
595 'hppa' : ['CONFIG_HPPA_DIS'],
596 'i386' : ['CONFIG_I386_DIS'],
597 'x86_64' : ['CONFIG_I386_DIS'],
598 'x32' : ['CONFIG_I386_DIS'],
599 'lm32' : ['CONFIG_LM32_DIS'],
600 'm68k' : ['CONFIG_M68K_DIS'],
601 'microblaze' : ['CONFIG_MICROBLAZE_DIS'],
602 'mips' : ['CONFIG_MIPS_DIS'],
603 'moxie' : ['CONFIG_MOXIE_DIS'],
604 'nios2' : ['CONFIG_NIOS2_DIS'],
605 'or1k' : ['CONFIG_OPENRISC_DIS'],
606 'ppc' : ['CONFIG_PPC_DIS'],
607 'riscv' : ['CONFIG_RISCV_DIS'],
608 'rx' : ['CONFIG_RX_DIS'],
609 's390' : ['CONFIG_S390_DIS'],
610 'sh4' : ['CONFIG_SH4_DIS'],
611 'sparc' : ['CONFIG_SPARC_DIS'],
612 'xtensa' : ['CONFIG_XTENSA_DIS'],
614 if link_language == 'cpp'
616 'aarch64' : [ 'CONFIG_ARM_A64_DIS'],
617 'arm' : [ 'CONFIG_ARM_DIS', 'CONFIG_ARM_A64_DIS'],
618 'mips' : [ 'CONFIG_MIPS_DIS', 'CONFIG_NANOMIPS_DIS'],
622 kconfig_external_symbols = [
632 'CONFIG_VHOST_KERNEL',
637 ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS']
647 foreach target : target_dirs
648 config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak')
650 foreach k, v: disassemblers
651 if config_host['ARCH'].startswith(k) or config_target['TARGET_BASE_ARCH'].startswith(k)
653 config_target += { sym: 'y' }
654 config_all_disas += { sym: 'y' }
659 config_target_data = configuration_data()
660 foreach k, v: config_target
661 if not k.startswith('TARGET_') and not k.startswith('CONFIG_')
663 elif ignored.contains(k)
665 elif k == 'TARGET_BASE_ARCH'
666 config_target_data.set('TARGET_' + v.to_upper(), 1)
667 elif k == 'TARGET_NAME'
668 config_target_data.set_quoted(k, v)
670 config_target_data.set(k, 1)
672 config_target_data.set(k, v)
675 foreach sym: accel_symbols
676 if config_target.has_key(sym)
677 config_all += { sym: 'y' }
680 config_target_h += {target: configure_file(output: target + '-config-target.h',
681 configuration: config_target_data)}
683 if target.endswith('-softmmu')
685 foreach sym : kconfig_external_symbols
686 if sym in config_target or sym in config_host
687 base_kconfig += '@0@=y'.format(sym)
691 config_devices_mak = target + '-config-devices.mak'
692 config_devices_mak = configure_file(
693 input: ['default-configs' / target + '.mak', 'Kconfig'],
694 output: config_devices_mak,
695 depfile: config_devices_mak + '.d',
697 command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'],
698 config_devices_mak, '@DEPFILE@', '@INPUT@',
701 config_devices_data = configuration_data()
702 config_devices = keyval.load(config_devices_mak)
703 foreach k, v: config_devices
704 config_devices_data.set(k, 1)
706 config_devices_mak_list += config_devices_mak
707 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
708 configuration: config_devices_data)}
709 config_target += config_devices
710 config_all_devices += config_devices
712 config_target_mak += {target: config_target}
715 # This configuration is used to build files that are shared by
716 # multiple binaries, and then extracted out of the "common"
717 # static_library target.
719 # We do not use all_sources()/all_dependencies(), because it would
720 # build literally all source files, including devices only used by
721 # targets that are not built for this compilation. The CONFIG_ALL
722 # pseudo symbol replaces it.
724 config_all += config_all_devices
725 config_all += config_host
726 config_all += config_all_disas
728 'CONFIG_XEN': config_host.has_key('CONFIG_XEN_BACKEND'),
729 'CONFIG_SOFTMMU': have_system,
730 'CONFIG_USER_ONLY': have_user,
737 capstone_opt = get_option('capstone')
738 if capstone_opt in ['enabled', 'auto', 'system']
739 have_internal = fs.exists(meson.current_source_dir() / 'capstone/Makefile')
740 capstone = dependency('capstone', version: '>=4.0',
741 static: enable_static, method: 'pkg-config',
742 required: capstone_opt == 'system' or
743 capstone_opt == 'enabled' and not have_internal)
745 capstone_opt = 'system'
747 capstone_opt = 'internal'
749 capstone_opt = 'disabled'
752 if capstone_opt == 'internal'
753 capstone_data = configuration_data()
754 capstone_data.set('CAPSTONE_USE_SYS_DYN_MEM', '1')
756 capstone_files = files(
759 'capstone/MCInstrDesc.c',
760 'capstone/MCRegisterInfo.c',
761 'capstone/SStream.c',
765 if 'CONFIG_ARM_DIS' in config_all_disas
766 capstone_data.set('CAPSTONE_HAS_ARM', '1')
767 capstone_files += files(
768 'capstone/arch/ARM/ARMDisassembler.c',
769 'capstone/arch/ARM/ARMInstPrinter.c',
770 'capstone/arch/ARM/ARMMapping.c',
771 'capstone/arch/ARM/ARMModule.c'
775 # FIXME: This config entry currently depends on a c++ compiler.
776 # Which is needed for building libvixl, but not for capstone.
777 if 'CONFIG_ARM_A64_DIS' in config_all_disas
778 capstone_data.set('CAPSTONE_HAS_ARM64', '1')
779 capstone_files += files(
780 'capstone/arch/AArch64/AArch64BaseInfo.c',
781 'capstone/arch/AArch64/AArch64Disassembler.c',
782 'capstone/arch/AArch64/AArch64InstPrinter.c',
783 'capstone/arch/AArch64/AArch64Mapping.c',
784 'capstone/arch/AArch64/AArch64Module.c'
788 if 'CONFIG_PPC_DIS' in config_all_disas
789 capstone_data.set('CAPSTONE_HAS_POWERPC', '1')
790 capstone_files += files(
791 'capstone/arch/PowerPC/PPCDisassembler.c',
792 'capstone/arch/PowerPC/PPCInstPrinter.c',
793 'capstone/arch/PowerPC/PPCMapping.c',
794 'capstone/arch/PowerPC/PPCModule.c'
798 if 'CONFIG_S390_DIS' in config_all_disas
799 capstone_data.set('CAPSTONE_HAS_SYSZ', '1')
800 capstone_files += files(
801 'capstone/arch/SystemZ/SystemZDisassembler.c',
802 'capstone/arch/SystemZ/SystemZInstPrinter.c',
803 'capstone/arch/SystemZ/SystemZMapping.c',
804 'capstone/arch/SystemZ/SystemZModule.c',
805 'capstone/arch/SystemZ/SystemZMCTargetDesc.c'
809 if 'CONFIG_I386_DIS' in config_all_disas
810 capstone_data.set('CAPSTONE_HAS_X86', 1)
811 capstone_files += files(
812 'capstone/arch/X86/X86Disassembler.c',
813 'capstone/arch/X86/X86DisassemblerDecoder.c',
814 'capstone/arch/X86/X86ATTInstPrinter.c',
815 'capstone/arch/X86/X86IntelInstPrinter.c',
816 'capstone/arch/X86/X86InstPrinterCommon.c',
817 'capstone/arch/X86/X86Mapping.c',
818 'capstone/arch/X86/X86Module.c'
822 configure_file(output: 'capstone-defs.h', configuration: capstone_data)
825 # FIXME: There does not seem to be a way to completely replace the c_args
826 # that come from add_project_arguments() -- we can only add to them.
827 # So: disable all warnings with a big hammer.
830 # Include all configuration defines via a header file, which will wind up
831 # as a dependency on the object file, and thus changes here will result
833 '-include', 'capstone-defs.h'
836 libcapstone = static_library('capstone',
837 sources: capstone_files,
838 c_args: capstone_cargs,
839 include_directories: 'capstone/include')
840 capstone = declare_dependency(link_with: libcapstone,
841 include_directories: 'capstone/include/capstone')
843 config_host_data.set('CONFIG_CAPSTONE', capstone.found())
845 genh += configure_file(output: 'config-host.h', configuration: config_host_data)
849 hxtool = find_program('scripts/hxtool')
850 shaderinclude = find_program('scripts/shaderinclude.pl')
851 qapi_gen = find_program('scripts/qapi-gen.py')
852 qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
853 meson.source_root() / 'scripts/qapi/commands.py',
854 meson.source_root() / 'scripts/qapi/common.py',
855 meson.source_root() / 'scripts/qapi/error.py',
856 meson.source_root() / 'scripts/qapi/events.py',
857 meson.source_root() / 'scripts/qapi/expr.py',
858 meson.source_root() / 'scripts/qapi/gen.py',
859 meson.source_root() / 'scripts/qapi/introspect.py',
860 meson.source_root() / 'scripts/qapi/parser.py',
861 meson.source_root() / 'scripts/qapi/schema.py',
862 meson.source_root() / 'scripts/qapi/source.py',
863 meson.source_root() / 'scripts/qapi/types.py',
864 meson.source_root() / 'scripts/qapi/visit.py',
865 meson.source_root() / 'scripts/qapi/common.py',
866 meson.source_root() / 'scripts/qapi-gen.py'
870 python, files('scripts/tracetool.py'),
871 '--backend=' + config_host['TRACE_BACKENDS']
874 qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
875 meson.current_source_dir(),
876 config_host['PKGVERSION'], meson.project_version()]
877 qemu_version = custom_target('qemu-version.h',
878 output: 'qemu-version.h',
879 command: qemu_version_cmd,
881 build_by_default: true,
882 build_always_stale: true)
887 ['qemu-options.hx', 'qemu-options.def'],
888 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
892 ['hmp-commands.hx', 'hmp-commands.h'],
893 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
896 foreach d : hx_headers
897 hxdep += custom_target(d[1],
901 build_by_default: true, # to be removed when added to a target
902 command: [hxtool, '-h', '@INPUT0@'])
906 SPHINX_ARGS = [config_host['SPHINX_BUILD'],
907 '-Dversion=' + meson.project_version(),
908 '-Drelease=' + config_host['PKGVERSION']]
910 if get_option('werror')
911 SPHINX_ARGS += [ '-W' ]
914 sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py',
915 meson.source_root() / 'docs/sphinx/hxtool.py',
916 meson.source_root() / 'docs/sphinx/kerneldoc.py',
917 meson.source_root() / 'docs/sphinx/kernellog.py',
918 meson.source_root() / 'docs/sphinx/qapidoc.py',
919 meson.source_root() / 'docs/sphinx/qmp_lexer.py',
922 # Collect sourcesets.
924 util_ss = ss.source_set()
925 stub_ss = ss.source_set()
926 trace_ss = ss.source_set()
927 block_ss = ss.source_set()
928 blockdev_ss = ss.source_set()
929 qmp_ss = ss.source_set()
930 common_ss = ss.source_set()
931 softmmu_ss = ss.source_set()
932 user_ss = ss.source_set()
933 bsd_user_ss = ss.source_set()
934 linux_user_ss = ss.source_set()
935 specific_ss = ss.source_set()
936 specific_fuzz_ss = ss.source_set()
941 target_softmmu_arch = {}
947 # TODO: add each directory to the subdirs from its own meson.build, once
949 trace_events_subdirs = [
956 trace_events_subdirs += [ 'linux-user' ]
959 trace_events_subdirs += [
968 trace_events_subdirs += [
979 'hw/block/dataplane',
1024 trace_events_subdirs += [
1051 libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO')
1052 modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
1055 # Build targets from sourcesets
1057 stub_ss = stub_ss.apply(config_all, strict: false)
1059 util_ss.add_all(trace_ss)
1060 util_ss = util_ss.apply(config_all, strict: false)
1061 libqemuutil = static_library('qemuutil',
1062 sources: util_ss.sources() + stub_ss.sources() + genh,
1063 dependencies: [util_ss.dependencies(), m, glib, socket, malloc])
1064 qemuutil = declare_dependency(link_with: libqemuutil,
1065 sources: genh + version_res)
1067 decodetree = generator(find_program('scripts/decodetree.py'),
1068 output: 'decode-@BASENAME@.c.inc',
1069 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
1075 subdir('libdecnumber')
1086 block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
1092 blockdev_ss.add(files(
1098 # os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
1099 # os-win32.c does not
1100 blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
1101 softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
1103 softmmu_ss.add_all(blockdev_ss)
1104 softmmu_ss.add(files(
1110 softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
1111 softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), seccomp])
1112 softmmu_ss.add(when: ['CONFIG_FDT', fdt], if_true: [files('device_tree.c')])
1114 common_ss.add(files('cpus-common.c'))
1118 common_ss.add(capstone)
1119 specific_ss.add(files('disas.c', 'exec.c', 'gdbstub.c'), capstone, libpmem, libdaxctl)
1120 specific_ss.add(files('exec-vary.c'))
1121 specific_ss.add(when: 'CONFIG_TCG', if_true: files(
1125 'tcg/tcg-op-gvec.c',
1130 specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.c', 'tcg/tci.c'))
1142 subdir('linux-user')
1144 bsd_user_ss.add(files('gdbstub.c'))
1145 specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
1147 linux_user_ss.add(files('gdbstub.c', 'thunk.c'))
1148 specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
1150 # needed for fuzzing binaries
1151 subdir('tests/qtest/libqos')
1152 subdir('tests/qtest/fuzz')
1156 foreach d, list : modules
1157 foreach m, module_ss : list
1158 if enable_modules and targetos != 'windows'
1159 module_ss = module_ss.apply(config_all, strict: false)
1160 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
1161 dependencies: [modulecommon, module_ss.dependencies()], pic: true)
1169 block_ss.add_all(module_ss)
1171 softmmu_ss.add_all(module_ss)
1177 nm = find_program('nm')
1178 undefsym = find_program('scripts/undefsym.py')
1179 block_syms = custom_target('block.syms', output: 'block.syms',
1180 input: [libqemuutil, block_mods],
1182 command: [undefsym, nm, '@INPUT@'])
1183 qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
1184 input: [libqemuutil, softmmu_mods],
1186 command: [undefsym, nm, '@INPUT@'])
1188 block_ss = block_ss.apply(config_host, strict: false)
1189 libblock = static_library('block', block_ss.sources() + genh,
1190 dependencies: block_ss.dependencies(),
1191 link_depends: block_syms,
1193 build_by_default: false)
1195 block = declare_dependency(link_whole: [libblock],
1196 link_args: '@block.syms',
1197 dependencies: [crypto, io])
1199 qmp_ss = qmp_ss.apply(config_host, strict: false)
1200 libqmp = static_library('qmp', qmp_ss.sources() + genh,
1201 dependencies: qmp_ss.dependencies(),
1203 build_by_default: false)
1205 qmp = declare_dependency(link_whole: [libqmp])
1207 foreach m : block_mods + softmmu_mods
1208 shared_module(m.name(),
1212 install_dir: config_host['qemu_moddir'])
1215 softmmu_ss.add(authz, block, chardev, crypto, io, qmp)
1216 common_ss.add(qom, qemuutil)
1218 common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss])
1219 common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
1221 common_all = common_ss.apply(config_all, strict: false)
1222 common_all = static_library('common',
1223 build_by_default: false,
1224 sources: common_all.sources() + genh,
1225 dependencies: common_all.dependencies(),
1228 feature_to_c = find_program('scripts/feature_to_c.sh')
1231 foreach target : target_dirs
1232 config_target = config_target_mak[target]
1233 target_name = config_target['TARGET_NAME']
1234 arch = config_target['TARGET_BASE_ARCH']
1235 arch_srcs = [config_target_h[target]]
1237 c_args = ['-DNEED_CPU_H',
1238 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
1239 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
1242 config_target += config_host
1243 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
1244 if targetos == 'linux'
1245 target_inc += include_directories('linux-headers', is_system: true)
1247 if target.endswith('-softmmu')
1248 qemu_target_name = 'qemu-system-' + target_name
1249 target_type='system'
1250 t = target_softmmu_arch[arch].apply(config_target, strict: false)
1251 arch_srcs += t.sources()
1252 arch_deps += t.dependencies()
1254 hw_dir = target_name == 'sparc64' ? 'sparc64' : arch
1255 hw = hw_arch[hw_dir].apply(config_target, strict: false)
1256 arch_srcs += hw.sources()
1257 arch_deps += hw.dependencies()
1259 arch_srcs += config_devices_h[target]
1260 link_args += ['@block.syms', '@qemu.syms']
1262 abi = config_target['TARGET_ABI_DIR']
1264 qemu_target_name = 'qemu-' + target_name
1265 if 'CONFIG_LINUX_USER' in config_target
1266 base_dir = 'linux-user'
1267 target_inc += include_directories('linux-user/host/' / config_host['ARCH'])
1269 base_dir = 'bsd-user'
1271 target_inc += include_directories(
1275 if 'CONFIG_LINUX_USER' in config_target
1276 dir = base_dir / abi
1277 arch_srcs += files(dir / 'signal.c', dir / 'cpu_loop.c')
1278 if config_target.has_key('TARGET_SYSTBL_ABI')
1280 syscall_nr_generators[abi].process(base_dir / abi / config_target['TARGET_SYSTBL'],
1281 extra_args : config_target['TARGET_SYSTBL_ABI'])
1286 if 'TARGET_XML_FILES' in config_target
1287 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
1288 output: target + '-gdbstub-xml.c',
1289 input: files(config_target['TARGET_XML_FILES'].split()),
1290 command: [feature_to_c, '@INPUT@'],
1292 arch_srcs += gdbstub_xml
1295 t = target_arch[arch].apply(config_target, strict: false)
1296 arch_srcs += t.sources()
1297 arch_deps += t.dependencies()
1299 target_common = common_ss.apply(config_target, strict: false)
1300 objects = common_all.extract_objects(target_common.sources())
1301 deps = target_common.dependencies()
1303 target_specific = specific_ss.apply(config_target, strict: false)
1304 arch_srcs += target_specific.sources()
1305 arch_deps += target_specific.dependencies()
1307 lib = static_library('qemu-' + target,
1308 sources: arch_srcs + genh,
1309 dependencies: arch_deps,
1311 include_directories: target_inc,
1313 build_by_default: false,
1316 if target.endswith('-softmmu')
1318 'name': 'qemu-system-' + target_name,
1320 'sources': files('softmmu/main.c'),
1323 if targetos == 'windows' and (sdl.found() or gtk.found())
1325 'name': 'qemu-system-' + target_name + 'w',
1327 'sources': files('softmmu/main.c'),
1331 if config_host.has_key('CONFIG_FUZZ')
1332 specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false)
1334 'name': 'qemu-fuzz-' + target_name,
1336 'sources': specific_fuzz.sources(),
1337 'dependencies': specific_fuzz.dependencies(),
1342 'name': 'qemu-' + target_name,
1349 emulators += {exe['name']:
1350 executable(exe['name'], exe['sources'],
1353 dependencies: arch_deps + deps + exe['dependencies'],
1354 objects: lib.extract_all_objects(recursive: true),
1355 link_language: link_language,
1356 link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []),
1357 link_args: link_args,
1358 gui_app: exe['gui'])
1361 if 'CONFIG_TRACE_SYSTEMTAP' in config_host
1363 {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe['name'], 'install': false},
1364 {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe['name'], 'install': true},
1365 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
1366 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
1368 custom_target(exe['name'] + stp['ext'],
1369 input: trace_events_all,
1370 output: exe['name'] + stp['ext'],
1372 install: stp['install'],
1373 install_dir: qemu_datadir / '../systemtap/tapset',
1375 tracetool, '--group=all', '--format=' + stp['fmt'],
1376 '--binary=' + stp['bin'],
1377 '--target-name=' + target_name,
1378 '--target-type=' + target_type,
1379 '--probe-prefix=qemu.' + target_type + '.' + target_name,
1387 # Other build targets
1389 if 'CONFIG_PLUGIN' in config_host
1390 install_headers('include/qemu/qemu-plugin.h')
1393 if 'CONFIG_GUEST_AGENT' in config_host
1397 # Don't build qemu-keymap if xkbcommon is not explicitly enabled
1398 # when we don't build tools or system
1399 if xkbcommon.found()
1400 # used for the update-keymaps target, so include rules even if !have_tools
1401 qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
1402 dependencies: [qemuutil, xkbcommon], install: have_tools)
1406 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
1407 dependencies: [authz, block, crypto, io, qom, qemuutil], install: true)
1408 qemu_io = executable('qemu-io', files('qemu-io.c'),
1409 dependencies: [block, qemuutil], install: true)
1410 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
1411 dependencies: [block, qemuutil], install: true)
1413 subdir('storage-daemon')
1414 subdir('contrib/rdmacm-mux')
1415 subdir('contrib/elf2dmp')
1417 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
1418 dependencies: qemuutil,
1421 if 'CONFIG_VHOST_USER' in config_host
1422 subdir('contrib/libvhost-user')
1423 subdir('contrib/vhost-user-blk')
1424 subdir('contrib/vhost-user-gpu')
1425 subdir('contrib/vhost-user-input')
1426 subdir('contrib/vhost-user-scsi')
1429 if targetos == 'linux'
1430 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
1431 dependencies: [qemuutil, libcap_ng],
1433 install_dir: get_option('libexecdir'))
1435 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
1436 dependencies: [authz, crypto, io, qom, qemuutil,
1437 libcap_ng, mpathpersist],
1441 if 'CONFIG_IVSHMEM' in config_host
1442 subdir('contrib/ivshmem-client')
1443 subdir('contrib/ivshmem-server')
1452 if 'CONFIG_GTK' in config_host
1456 if host_machine.system() == 'windows'
1458 find_program('scripts/nsis.py'),
1460 get_option('prefix'),
1461 meson.current_source_dir(),
1462 host_machine.cpu_family(),
1464 '-DDISPLAYVERSION=' + meson.project_version(),
1467 nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
1469 if 'CONFIG_GTK' in config_host
1470 nsis_cmd += '-DCONFIG_GTK=y'
1473 nsis = custom_target('nsis',
1474 output: 'qemu-setup-' + meson.project_version() + '.exe',
1475 input: files('qemu.nsi'),
1476 build_always_stale: true,
1477 command: nsis_cmd + ['@INPUT@'])
1478 alias_target('installer', nsis)
1482 summary_info += {'Install prefix': config_host['prefix']}
1483 summary_info += {'BIOS directory': config_host['qemu_datadir']}
1484 summary_info += {'firmware path': config_host['qemu_firmwarepath']}
1485 summary_info += {'binary directory': config_host['bindir']}
1486 summary_info += {'library directory': config_host['libdir']}
1487 summary_info += {'module directory': config_host['qemu_moddir']}
1488 summary_info += {'libexec directory': config_host['libexecdir']}
1489 summary_info += {'include directory': config_host['includedir']}
1490 summary_info += {'config directory': config_host['sysconfdir']}
1491 if targetos != 'windows'
1492 summary_info += {'local state directory': config_host['qemu_localstatedir']}
1493 summary_info += {'Manual directory': get_option('mandir')}
1495 summary_info += {'local state directory': 'queried at runtime'}
1497 summary_info += {'Doc directory': get_option('docdir')}
1498 summary_info += {'Build directory': meson.current_build_dir()}
1499 summary_info += {'Source path': meson.current_source_dir()}
1500 summary_info += {'GIT binary': config_host['GIT']}
1501 summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
1502 summary_info += {'C compiler': meson.get_compiler('c').cmd_array()[0]}
1503 summary_info += {'Host C compiler': meson.get_compiler('c', native: true).cmd_array()[0]}
1504 if link_language == 'cpp'
1505 summary_info += {'C++ compiler': meson.get_compiler('cpp').cmd_array()[0]}
1507 summary_info += {'C++ compiler': false}
1509 if targetos == 'darwin'
1510 summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
1512 summary_info += {'ARFLAGS': config_host['ARFLAGS']}
1513 summary_info += {'CFLAGS': config_host['CFLAGS']}
1514 summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
1515 summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
1516 summary_info += {'make': config_host['MAKE']}
1517 summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
1518 summary_info += {'sphinx-build': config_host['SPHINX_BUILD']}
1519 summary_info += {'genisoimage': config_host['GENISOIMAGE']}
1520 # TODO: add back version
1521 summary_info += {'slirp support': config_host.has_key('CONFIG_SLIRP')}
1522 if config_host.has_key('CONFIG_SLIRP')
1523 summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']}
1525 summary_info += {'module support': config_host.has_key('CONFIG_MODULES')}
1526 if config_host.has_key('CONFIG_MODULES')
1527 summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')}
1529 summary_info += {'host CPU': cpu}
1530 summary_info += {'host endianness': build_machine.endian()}
1531 summary_info += {'target list': config_host['TARGET_DIRS']}
1532 summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')}
1533 summary_info += {'sparse enabled': meson.get_compiler('c').cmd_array().contains('cgcc')}
1534 summary_info += {'strip binaries': get_option('strip')}
1535 summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
1536 summary_info += {'static build': config_host.has_key('CONFIG_STATIC')}
1537 if targetos == 'darwin'
1538 summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
1540 # TODO: add back version
1541 summary_info += {'SDL support': sdl.found()}
1542 summary_info += {'SDL image support': sdl_image.found()}
1543 # TODO: add back version
1544 summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
1545 summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')}
1546 summary_info += {'pixman': pixman.found()}
1547 # TODO: add back version
1548 summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
1549 summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
1550 summary_info += {'GNUTLS support': config_host.has_key('CONFIG_GNUTLS')}
1551 # TODO: add back version
1552 summary_info += {'libgcrypt': config_host.has_key('CONFIG_GCRYPT')}
1553 if config_host.has_key('CONFIG_GCRYPT')
1554 summary_info += {' hmac': config_host.has_key('CONFIG_GCRYPT_HMAC')}
1555 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1557 # TODO: add back version
1558 summary_info += {'nettle': config_host.has_key('CONFIG_NETTLE')}
1559 if config_host.has_key('CONFIG_NETTLE')
1560 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1562 summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')}
1563 summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')}
1564 summary_info += {'iconv support': config_host.has_key('CONFIG_ICONV')}
1565 summary_info += {'curses support': config_host.has_key('CONFIG_CURSES')}
1566 # TODO: add back version
1567 summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')}
1568 summary_info += {'curl support': config_host.has_key('CONFIG_CURL')}
1569 summary_info += {'mingw32 support': targetos == 'windows'}
1570 summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']}
1571 summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
1572 summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
1573 summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')}
1574 summary_info += {'Multipath support': mpathpersist.found()}
1575 summary_info += {'VNC support': vnc.found()}
1577 summary_info += {'VNC SASL support': sasl.found()}
1578 summary_info += {'VNC JPEG support': jpeg.found()}
1579 summary_info += {'VNC PNG support': png.found()}
1581 summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')}
1582 if config_host.has_key('CONFIG_XEN_BACKEND')
1583 summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
1585 summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')}
1586 summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')}
1587 summary_info += {'PIE': get_option('b_pie')}
1588 summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
1589 summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
1590 summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
1591 summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
1592 summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')}
1593 summary_info += {'Install blobs': config_host.has_key('INSTALL_BLOBS')}
1594 summary_info += {'KVM support': config_all.has_key('CONFIG_KVM')}
1595 summary_info += {'HAX support': config_all.has_key('CONFIG_HAX')}
1596 summary_info += {'HVF support': config_all.has_key('CONFIG_HVF')}
1597 summary_info += {'WHPX support': config_all.has_key('CONFIG_WHPX')}
1598 summary_info += {'TCG support': config_all.has_key('CONFIG_TCG')}
1599 if config_all.has_key('CONFIG_TCG')
1600 summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
1601 summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')}
1603 summary_info += {'malloc trim support': has_malloc_trim}
1604 summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
1605 summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}
1606 summary_info += {'fdt support': config_host.has_key('CONFIG_FDT')}
1607 summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')}
1608 summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')}
1609 summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')}
1610 summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')}
1611 summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}
1612 summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')}
1613 summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')}
1614 summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
1615 summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
1616 summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
1617 summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
1618 summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')}
1619 summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
1620 summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
1621 summary_info += {'Trace backends': config_host['TRACE_BACKENDS']}
1622 if config_host['TRACE_BACKENDS'].split().contains('simple')
1623 summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
1625 # TODO: add back protocol and server version
1626 summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
1627 summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')}
1628 summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')}
1629 summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
1630 summary_info += {'U2F support': u2f.found()}
1631 summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')}
1632 summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')}
1633 summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
1634 summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')}
1635 summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')}
1636 summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')}
1637 summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
1638 if targetos == 'windows'
1639 if 'WIN_SDK' in config_host
1640 summary_info += {'Windows SDK': config_host['WIN_SDK']}
1642 summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')}
1643 summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
1644 summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI')}
1646 summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')}
1647 summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
1648 summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'}
1649 summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
1650 summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')}
1651 summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')}
1652 summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')}
1653 summary_info += {'gcov': get_option('b_coverage')}
1654 summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')}
1655 summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')}
1656 summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
1657 summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
1658 summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')}
1659 summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')}
1660 summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')}
1661 summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')}
1662 summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')}
1663 summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
1664 summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}
1665 summary_info += {'memory allocator': get_option('malloc')}
1666 summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
1667 summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
1668 summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
1669 summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')}
1670 summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')}
1671 summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')}
1672 summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')}
1673 summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')}
1674 summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')}
1675 summary_info += {'qed support': config_host.has_key('CONFIG_QED')}
1676 summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
1677 summary_info += {'sheepdog support': config_host.has_key('CONFIG_SHEEPDOG')}
1678 summary_info += {'capstone': capstone_opt == 'disabled' ? false : capstone_opt}
1679 summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')}
1680 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
1681 summary_info += {'libudev': libudev.found()}
1682 summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'}
1683 summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')}
1684 summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')}
1685 if config_host.has_key('HAVE_GDB_BIN')
1686 summary_info += {'gdb': config_host['HAVE_GDB_BIN']}
1688 summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')}
1689 summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')}
1690 summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')}
1691 summary(summary_info, bool_yn: true)
1693 if not supported_cpus.contains(cpu)
1695 warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
1697 message('CPU host architecture ' + cpu + ' support is not currently maintained.')
1698 message('The QEMU project intends to remove support for this host CPU in')
1699 message('a future release if nobody volunteers to maintain it and to')
1700 message('provide a build host for our continuous integration setup.')
1701 message('configure has succeeded and you can continue to build, but')
1702 message('if you care about QEMU on this platform you should contact')
1703 message('us upstream at qemu-devel@nongnu.org.')
1706 if not supported_oses.contains(targetos)
1708 warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!')
1710 message('Host OS ' + targetos + 'support is not currently maintained.')
1711 message('The QEMU project intends to remove support for this host OS in')
1712 message('a future release if nobody volunteers to maintain it and to')
1713 message('provide a build host for our continuous integration setup.')
1714 message('configure has succeeded and you can continue to build, but')
1715 message('if you care about QEMU on this platform you should contact')
1716 message('us upstream at qemu-devel@nongnu.org.')