meson: infrastructure for building emulators
[qemu/ar7.git] / meson.build
blob6f8024cdcff6f223a585bb1cf8f3a383207e3f48
1 project('qemu', ['c'], meson_version: '>=0.55.0',
2         default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_lundef=false'],
3         version: run_command('head', meson.source_root() / 'VERSION').stdout().strip())
5 not_found = dependency('', required: false)
6 keyval = import('unstable-keyval')
7 ss = import('sourceset')
9 sh = find_program('sh')
10 cc = meson.get_compiler('c')
11 config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
12 config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak')
14 add_project_arguments(config_host['QEMU_CFLAGS'].split(),
15                       native: false, language: ['c', 'objc'])
16 add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
17                       native: false, language: 'cpp')
18 add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
19                            native: false, language: ['c', 'cpp', 'objc'])
20 add_project_arguments(config_host['QEMU_INCLUDES'].split(),
21                       language: ['c', 'cpp', 'objc'])
23 python = import('python').find_installation()
25 link_language = meson.get_external_property('link_language', 'cpp')
26 if link_language == 'cpp'
27   add_languages('cpp', required: true, native: false)
28 endif
29 if host_machine.system() == 'darwin'
30   add_languages('objc', required: false, native: false)
31 endif
33 if 'SPARSE_CFLAGS' in config_host
34   run_target('sparse',
35              command: [find_program('scripts/check_sparse.py'),
36                        config_host['SPARSE_CFLAGS'].split(),
37                        'compile_commands.json'])
38 endif
40 configure_file(input: files('scripts/ninjatool.py'),
41                output: 'ninjatool',
42                configuration: config_host)
44 supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
45 supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
46   'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
48 cpu = host_machine.cpu_family()
49 targetos = host_machine.system()
51 m = cc.find_library('m', required: false)
52 util = cc.find_library('util', required: false)
53 socket = []
54 version_res = []
55 coref = []
56 iokit = []
57 cocoa = []
58 hvf = []
59 if targetos == 'windows'
60   socket = cc.find_library('ws2_32')
62   win = import('windows')
63   version_res = win.compile_resources('version.rc',
64                                       depend_files: files('pc-bios/qemu-nsis.ico'),
65                                       include_directories: include_directories('.'))
66 elif targetos == 'darwin'
67   coref = dependency('appleframeworks', modules: 'CoreFoundation')
68   iokit = dependency('appleframeworks', modules: 'IOKit')
69   cocoa = dependency('appleframeworks', modules: 'Cocoa')
70   hvf = dependency('appleframeworks', modules: 'Hypervisor')
71 elif targetos == 'sunos'
72   socket = [cc.find_library('socket'),
73             cc.find_library('nsl'),
74             cc.find_library('resolv')]
75 elif targetos == 'haiku'
76   socket = [cc.find_library('posix_error_mapper'),
77             cc.find_library('network'),
78             cc.find_library('bsd')]
79 endif
80 glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
81                           link_args: config_host['GLIB_LIBS'].split())
82 gio = not_found
83 if 'CONFIG_GIO' in config_host
84   gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
85                            link_args: config_host['GIO_LIBS'].split())
86 endif
87 lttng = not_found
88 if 'CONFIG_TRACE_UST' in config_host
89   lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split())
90 endif
91 urcubp = not_found
92 if 'CONFIG_TRACE_UST' in config_host
93   urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split())
94 endif
95 nettle = not_found
96 if 'CONFIG_NETTLE' in config_host
97   nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(),
98                               link_args: config_host['NETTLE_LIBS'].split())
99 endif
100 gnutls = not_found
101 if 'CONFIG_GNUTLS' in config_host
102   gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
103                               link_args: config_host['GNUTLS_LIBS'].split())
104 endif
105 pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(),
106                             link_args: config_host['PIXMAN_LIBS'].split())
107 pam = not_found
108 if 'CONFIG_AUTH_PAM' in config_host
109   pam = cc.find_library('pam')
110 endif
111 libattr = not_found
112 if 'CONFIG_ATTR' in config_host
113   libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split())
114 endif
115 seccomp = not_found
116 if 'CONFIG_SECCOMP' in config_host
117   seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(),
118                                link_args: config_host['SECCOMP_LIBS'].split())
119 endif
120 libcap_ng = not_found
121 if 'CONFIG_LIBCAP_NG' in config_host
122   libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split())
123 endif
124 xkbcommon = not_found
125 if 'CONFIG_XKBCOMMON' in config_host
126   xkbcommon = declare_dependency(compile_args: config_host['XKBCOMMON_CFLAGS'].split(),
127                                  link_args: config_host['XKBCOMMON_LIBS'].split())
128 endif
129 rt = cc.find_library('rt', required: false)
130 libiscsi = not_found
131 if 'CONFIG_LIBISCSI' in config_host
132   libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(),
133                                 link_args: config_host['LIBISCSI_LIBS'].split())
134 endif
135 gbm = not_found
136 if 'CONFIG_GBM' in config_host
137   gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
138                            link_args: config_host['GBM_LIBS'].split())
139 endif
140 virgl = not_found
141 if 'CONFIG_VIRGL' in config_host
142   virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(),
143                              link_args: config_host['VIRGL_LIBS'].split())
144 endif
145 curl = not_found
146 if 'CONFIG_CURL' in config_host
147   curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(),
148                             link_args: config_host['CURL_LIBS'].split())
149 endif
150 libudev = not_found
151 if 'CONFIG_LIBUDEV' in config_host
152   libudev = declare_dependency(link_args: config_host['LIBUDEV_LIBS'].split())
153 endif
155 create_config = find_program('scripts/create_config')
156 minikconf = find_program('scripts/minikconf.py')
157 target_dirs = config_host['TARGET_DIRS'].split()
158 have_user = false
159 have_system = false
160 config_devices_mak_list = []
161 config_devices_h = {}
162 config_target_mak = {}
163 kconfig_external_symbols = [
164   'CONFIG_KVM',
165   'CONFIG_XEN',
166   'CONFIG_TPM',
167   'CONFIG_SPICE',
168   'CONFIG_IVSHMEM',
169   'CONFIG_OPENGL',
170   'CONFIG_X11',
171   'CONFIG_VHOST_USER',
172   'CONFIG_VHOST_KERNEL',
173   'CONFIG_VIRTFS',
174   'CONFIG_LINUX',
175   'CONFIG_PVRDMA',
177 foreach target : target_dirs
178   have_user = have_user or target.endswith('-user')
179   config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak') + config_host
181   if target.endswith('-softmmu')
182     have_system = true
184     base_kconfig = []
185     foreach sym : kconfig_external_symbols
186       if sym in config_target
187         base_kconfig += '@0@=y'.format(sym)
188       endif
189     endforeach
191     config_devices_mak = target + '-config-devices.mak'
192     config_devices_mak = configure_file(
193       input: ['default-configs' / target + '.mak', 'Kconfig'],
194       output: config_devices_mak,
195       depfile: config_devices_mak + '.d',
196       capture: true,
197       command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'],
198                 config_devices_mak, '@DEPFILE@', '@INPUT@',
199                 base_kconfig])
200     config_devices_h += {target: custom_target(
201       target + '-config-devices.h',
202       input: config_devices_mak,
203       output: target + '-config-devices.h',
204       capture: true,
205       command: [create_config, '@INPUT@'])}
206     config_devices_mak_list += config_devices_mak
207     config_target += keyval.load(config_devices_mak)
208   endif
209   config_target_mak += {target: config_target}
210 endforeach
211 have_tools = 'CONFIG_TOOLS' in config_host
212 have_block = have_system or have_tools
214 grepy = find_program('scripts/grepy.sh')
215 # This configuration is used to build files that are shared by
216 # multiple binaries, and then extracted out of the "common"
217 # static_library target.
219 # We do not use all_sources()/all_dependencies(), because it would
220 # build literally all source files, including devices only used by
221 # targets that are not built for this compilation.  The CONFIG_ALL
222 # pseudo symbol replaces it.
224 if have_system
225   config_all_devices_mak = configure_file(
226     output: 'config-all-devices.mak',
227     input: config_devices_mak_list,
228     capture: true,
229     command: [grepy, '@INPUT@'],
230   )
231   config_all_devices = keyval.load(config_all_devices_mak)
232 else
233   config_all_devices = {}
234 endif
235 config_all = config_all_devices
236 config_all += config_host
237 config_all += config_all_disas
238 config_all += {
239   'CONFIG_XEN': config_host.has_key('CONFIG_XEN_BACKEND'),
240   'CONFIG_SOFTMMU': have_system,
241   'CONFIG_USER_ONLY': have_user,
242   'CONFIG_ALL': true,
245 # Generators
247 genh = []
248 hxtool = find_program('scripts/hxtool')
249 shaderinclude = find_program('scripts/shaderinclude.pl')
250 qapi_gen = find_program('scripts/qapi-gen.py')
251 qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
252                      meson.source_root() / 'scripts/qapi/commands.py',
253                      meson.source_root() / 'scripts/qapi/common.py',
254                      meson.source_root() / 'scripts/qapi/doc.py',
255                      meson.source_root() / 'scripts/qapi/error.py',
256                      meson.source_root() / 'scripts/qapi/events.py',
257                      meson.source_root() / 'scripts/qapi/expr.py',
258                      meson.source_root() / 'scripts/qapi/gen.py',
259                      meson.source_root() / 'scripts/qapi/introspect.py',
260                      meson.source_root() / 'scripts/qapi/parser.py',
261                      meson.source_root() / 'scripts/qapi/schema.py',
262                      meson.source_root() / 'scripts/qapi/source.py',
263                      meson.source_root() / 'scripts/qapi/types.py',
264                      meson.source_root() / 'scripts/qapi/visit.py',
265                      meson.source_root() / 'scripts/qapi/common.py',
266                      meson.source_root() / 'scripts/qapi/doc.py',
267                      meson.source_root() / 'scripts/qapi-gen.py'
270 tracetool = [
271   python, files('scripts/tracetool.py'),
272    '--backend=' + config_host['TRACE_BACKENDS']
275 qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
276                     meson.current_source_dir(),
277                     config_host['PKGVERSION'], config_host['VERSION']]
278 qemu_version = custom_target('qemu-version.h',
279                              output: 'qemu-version.h',
280                              command: qemu_version_cmd,
281                              capture: true,
282                              build_by_default: true,
283                              build_always_stale: true)
284 genh += qemu_version
286 config_host_h = custom_target('config-host.h',
287                               input: meson.current_build_dir() / 'config-host.mak',
288                               output: 'config-host.h',
289                               capture: true,
290                               command: [create_config, '@INPUT@'])
291 genh += config_host_h
293 hxdep = []
294 hx_headers = [
295   ['qemu-options.hx', 'qemu-options.def'],
296   ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
298 if have_system
299   hx_headers += [
300     ['hmp-commands.hx', 'hmp-commands.h'],
301     ['hmp-commands-info.hx', 'hmp-commands-info.h'],
302   ]
303 endif
304 foreach d : hx_headers
305   custom_target(d[1],
306                 input: files(d[0]),
307                 output: d[1],
308                 capture: true,
309                 build_by_default: true, # to be removed when added to a target
310                 command: [hxtool, '-h', '@INPUT0@'])
311 endforeach
312 genh += hxdep
314 # Collect sourcesets.
316 util_ss = ss.source_set()
317 stub_ss = ss.source_set()
318 trace_ss = ss.source_set()
319 common_ss = ss.source_set()
320 softmmu_ss = ss.source_set()
321 user_ss = ss.source_set()
322 bsd_user_ss = ss.source_set()
323 linux_user_ss = ss.source_set()
324 specific_ss = ss.source_set()
326 hw_arch = {}
327 target_arch = {}
328 target_softmmu_arch = {}
330 ###############
331 # Trace files #
332 ###############
334 trace_events_subdirs = [
335   'accel/kvm',
336   'accel/tcg',
337   'crypto',
338   'monitor',
340 if have_user
341   trace_events_subdirs += [ 'linux-user' ]
342 endif
343 if have_block
344   trace_events_subdirs += [
345     'authz',
346     'block',
347     'io',
348     'nbd',
349     'scsi',
350   ]
351 endif
352 if have_system
353   trace_events_subdirs += [
354     'audio',
355     'backends',
356     'backends/tpm',
357     'chardev',
358     'hw/9pfs',
359     'hw/acpi',
360     'hw/alpha',
361     'hw/arm',
362     'hw/audio',
363     'hw/block',
364     'hw/block/dataplane',
365     'hw/char',
366     'hw/display',
367     'hw/dma',
368     'hw/hppa',
369     'hw/hyperv',
370     'hw/i2c',
371     'hw/i386',
372     'hw/i386/xen',
373     'hw/ide',
374     'hw/input',
375     'hw/intc',
376     'hw/isa',
377     'hw/mem',
378     'hw/mips',
379     'hw/misc',
380     'hw/misc/macio',
381     'hw/net',
382     'hw/nvram',
383     'hw/pci',
384     'hw/pci-host',
385     'hw/ppc',
386     'hw/rdma',
387     'hw/rdma/vmw',
388     'hw/rtc',
389     'hw/s390x',
390     'hw/scsi',
391     'hw/sd',
392     'hw/sparc',
393     'hw/sparc64',
394     'hw/ssi',
395     'hw/timer',
396     'hw/tpm',
397     'hw/usb',
398     'hw/vfio',
399     'hw/virtio',
400     'hw/watchdog',
401     'hw/xen',
402     'hw/gpio',
403     'hw/riscv',
404     'migration',
405     'net',
406     'ui',
407   ]
408 endif
409 trace_events_subdirs += [
410   'hw/core',
411   'qapi',
412   'qom',
413   'target/arm',
414   'target/hppa',
415   'target/i386',
416   'target/mips',
417   'target/ppc',
418   'target/riscv',
419   'target/s390x',
420   'target/sparc',
421   'util',
424 subdir('qapi')
425 subdir('qobject')
426 subdir('stubs')
427 subdir('trace')
428 subdir('util')
429 subdir('qom')
430 subdir('authz')
431 subdir('crypto')
432 subdir('storage-daemon')
433 subdir('ui')
435 # Build targets from sourcesets
437 stub_ss = stub_ss.apply(config_all, strict: false)
439 util_ss.add_all(trace_ss)
440 util_ss = util_ss.apply(config_all, strict: false)
441 libqemuutil = static_library('qemuutil',
442                              sources: util_ss.sources() + stub_ss.sources() + genh,
443                              dependencies: [util_ss.dependencies(), m, glib, socket])
444 qemuutil = declare_dependency(link_with: libqemuutil,
445                               sources: genh + version_res)
447 subdir('io')
448 subdir('fsdev')
449 subdir('target')
451 common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: softmmu_ss)
452 common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
454 common_all = common_ss.apply(config_all, strict: false)
455 common_all = static_library('common',
456                             build_by_default: false,
457                             sources: common_all.sources() + genh,
458                             dependencies: common_all.dependencies(),
459                             name_suffix: 'fa')
461 foreach target : target_dirs
462   config_target = config_target_mak[target]
463   target_name = config_target['TARGET_NAME']
464   arch = config_target['TARGET_BASE_ARCH']
465   arch_srcs = []
467   target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
468   if targetos == 'linux'
469     target_inc += include_directories('linux-headers', is_system: true)
470   endif
471   if target.endswith('-softmmu')
472     qemu_target_name = 'qemu-system-' + target_name
473     target_type='system'
474     arch_srcs += config_devices_h[target]
475   else
476     target_type='user'
477     qemu_target_name = 'qemu-' + target_name
478     if 'CONFIG_LINUX_USER' in config_target
479       base_dir = 'linux-user'
480       target_inc += include_directories('linux-user/host/' / config_host['ARCH'])
481     else
482       base_dir = 'bsd-user'
483     endif
484     target_inc += include_directories(
485       base_dir,
486       base_dir / config_target['TARGET_ABI_DIR'],
487     )
488   endif
490   target_common = common_ss.apply(config_target, strict: false)
491   objects = common_all.extract_objects(target_common.sources())
493   # TODO: Change to generator once obj-y goes away
494   config_target_h = custom_target(target + '-config-target.h',
495                               input: meson.current_build_dir() / target / 'config-target.mak',
496                               output: target + '-config-target.h',
497                               capture: true,
498                               command: [create_config, '@INPUT@'])
500   target_specific = specific_ss.apply(config_target, strict: false)
501   arch_srcs += target_specific.sources()
503   static_library('qemu-' + target,
504                  sources: arch_srcs + [config_target_h] + genh,
505                  objects: objects,
506                  include_directories: target_inc,
507                  c_args: ['-DNEED_CPU_H',
508                           '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
509                           '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)],
510                  name_suffix: 'fa')
511 endforeach
513 # Other build targets
514 if 'CONFIG_GUEST_AGENT' in config_host
515   subdir('qga')
516 endif
518 if have_tools
519   subdir('contrib/rdmacm-mux')
520   subdir('contrib/elf2dmp')
522   if 'CONFIG_XKBCOMMON' in config_host
523     executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c'),
524                dependencies: [qemuutil, xkbcommon], install: true)
525   endif
527   executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
528              dependencies: qemuutil,
529              install: true)
531   if 'CONFIG_VHOST_USER' in config_host
532     subdir('contrib/libvhost-user')
533     subdir('contrib/vhost-user-blk')
534     if 'CONFIG_LINUX' in config_host
535       subdir('contrib/vhost-user-gpu')
536     endif
537     subdir('contrib/vhost-user-input')
538     subdir('contrib/vhost-user-scsi')
539   endif
541   if targetos == 'linux'
542     executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
543                dependencies: [qemuutil, libcap_ng],
544                install: true,
545                install_dir: get_option('libexecdir'))
546   endif
548   if 'CONFIG_IVSHMEM' in config_host
549     subdir('contrib/ivshmem-client')
550     subdir('contrib/ivshmem-server')
551   endif
552 endif
554 subdir('tools')
555 subdir('pc-bios')
556 subdir('tests')
558 summary_info = {}
559 summary_info += {'Install prefix':    config_host['prefix']}
560 summary_info += {'BIOS directory':    config_host['qemu_datadir']}
561 summary_info += {'firmware path':     config_host['qemu_firmwarepath']}
562 summary_info += {'binary directory':  config_host['bindir']}
563 summary_info += {'library directory': config_host['libdir']}
564 summary_info += {'module directory':  config_host['qemu_moddir']}
565 summary_info += {'libexec directory': config_host['libexecdir']}
566 summary_info += {'include directory': config_host['includedir']}
567 summary_info += {'config directory':  config_host['sysconfdir']}
568 if targetos != 'windows'
569   summary_info += {'local state directory': config_host['qemu_localstatedir']}
570   summary_info += {'Manual directory':      config_host['mandir']}
571 else
572   summary_info += {'local state directory': 'queried at runtime'}
573 endif
574 summary_info += {'Build directory':   meson.current_build_dir()}
575 summary_info += {'Source path':       meson.current_source_dir()}
576 summary_info += {'GIT binary':        config_host['GIT']}
577 summary_info += {'GIT submodules':    config_host['GIT_SUBMODULES']}
578 summary_info += {'C compiler':        meson.get_compiler('c').cmd_array()[0]}
579 summary_info += {'Host C compiler':   meson.get_compiler('c', native: true).cmd_array()[0]}
580 if link_language == 'cpp'
581   summary_info += {'C++ compiler':      meson.get_compiler('cpp').cmd_array()[0]}
582 else
583   summary_info += {'C++ compiler':      false}
584 endif
585 if targetos == 'darwin'
586   summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
587 endif
588 summary_info += {'ARFLAGS':           config_host['ARFLAGS']}
589 summary_info += {'CFLAGS':            config_host['CFLAGS']}
590 summary_info += {'QEMU_CFLAGS':       config_host['QEMU_CFLAGS']}
591 summary_info += {'QEMU_LDFLAGS':      config_host['QEMU_LDFLAGS']}
592 summary_info += {'make':              config_host['MAKE']}
593 summary_info += {'install':           config_host['INSTALL']}
594 summary_info += {'python':            '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
595 summary_info += {'sphinx-build':      config_host['SPHINX_BUILD']}
596 summary_info += {'genisoimage':       config_host['GENISOIMAGE']}
597 # TODO: add back version
598 summary_info += {'slirp support':     config_host.has_key('CONFIG_SLIRP')}
599 if config_host.has_key('CONFIG_SLIRP')
600   summary_info += {'smbd':            config_host['CONFIG_SMBD_COMMAND']}
601 endif
602 summary_info += {'module support':    config_host.has_key('CONFIG_MODULES')}
603 if config_host.has_key('CONFIG_MODULES')
604   summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')}
605 endif
606 summary_info += {'host CPU':          cpu}
607 summary_info += {'host endianness':   build_machine.endian()}
608 summary_info += {'target list':       config_host['TARGET_DIRS']}
609 summary_info += {'gprof enabled':     config_host.has_key('CONFIG_GPROF')}
610 summary_info += {'sparse enabled':    meson.get_compiler('c').cmd_array().contains('cgcc')}
611 summary_info += {'strip binaries':    get_option('strip')}
612 summary_info += {'profiler':          config_host.has_key('CONFIG_PROFILER')}
613 summary_info += {'static build':      config_host.has_key('CONFIG_TOOLS')}
614 if targetos == 'darwin'
615   summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
616 endif
617 # TODO: add back version
618 summary_info += {'SDL support':       config_host.has_key('CONFIG_SDL')}
619 summary_info += {'SDL image support': config_host.has_key('CONFIG_SDL_IMAGE')}
620 # TODO: add back version
621 summary_info += {'GTK support':       config_host.has_key('CONFIG_GTK')}
622 summary_info += {'GTK GL support':    config_host.has_key('CONFIG_GTK_GL')}
623 # TODO: add back version
624 summary_info += {'VTE support':       config_host.has_key('CONFIG_VTE')}
625 summary_info += {'TLS priority':      config_host['CONFIG_TLS_PRIORITY']}
626 summary_info += {'GNUTLS support':    config_host.has_key('CONFIG_GNUTLS')}
627 # TODO: add back version
628 summary_info += {'libgcrypt':         config_host.has_key('CONFIG_GCRYPT')}
629 if config_host.has_key('CONFIG_GCRYPT')
630    summary_info += {'  hmac':            config_host.has_key('CONFIG_GCRYPT_HMAC')}
631    summary_info += {'  XTS':             not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
632 endif
633 # TODO: add back version
634 summary_info += {'nettle':            config_host.has_key('CONFIG_NETTLE')}
635 if config_host.has_key('CONFIG_NETTLE')
636    summary_info += {'  XTS':             not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
637 endif
638 summary_info += {'libtasn1':          config_host.has_key('CONFIG_TASN1')}
639 summary_info += {'PAM':               config_host.has_key('CONFIG_AUTH_PAM')}
640 summary_info += {'iconv support':     config_host.has_key('CONFIG_ICONV')}
641 summary_info += {'curses support':    config_host.has_key('CONFIG_CURSES')}
642 # TODO: add back version
643 summary_info += {'virgl support':     config_host.has_key('CONFIG_VIRGL')}
644 summary_info += {'curl support':      config_host.has_key('CONFIG_CURL')}
645 summary_info += {'mingw32 support':   targetos == 'windows'}
646 summary_info += {'Audio drivers':     config_host['CONFIG_AUDIO_DRIVERS']}
647 summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
648 summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
649 summary_info += {'VirtFS support':    config_host.has_key('CONFIG_VIRTFS')}
650 summary_info += {'Multipath support': config_host.has_key('CONFIG_MPATH')}
651 summary_info += {'VNC support':       config_host.has_key('CONFIG_VNC')}
652 if config_host.has_key('CONFIG_VNC')
653   summary_info += {'VNC SASL support':  config_host.has_key('CONFIG_VNC_SASL')}
654   summary_info += {'VNC JPEG support':  config_host.has_key('CONFIG_VNC_JPEG')}
655   summary_info += {'VNC PNG support':   config_host.has_key('CONFIG_VNC_PNG')}
656 endif
657 summary_info += {'xen support':       config_host.has_key('CONFIG_XEN_BACKEND')}
658 if config_host.has_key('CONFIG_XEN_BACKEND')
659   summary_info += {'xen ctrl version':  config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
660 endif
661 summary_info += {'brlapi support':    config_host.has_key('CONFIG_BRLAPI')}
662 summary_info += {'Documentation':     config_host.has_key('BUILD_DOCS')}
663 summary_info += {'PIE':               get_option('b_pie')}
664 summary_info += {'vde support':       config_host.has_key('CONFIG_VDE')}
665 summary_info += {'netmap support':    config_host.has_key('CONFIG_NETMAP')}
666 summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
667 summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
668 summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')}
669 summary_info += {'Install blobs':     config_host.has_key('INSTALL_BLOBS')}
670 # TODO: add back KVM/HAX/HVF/WHPX/TCG
671 #summary_info += {'KVM support':       have_kvm'}
672 #summary_info += {'HAX support':       have_hax'}
673 #summary_info += {'HVF support':       have_hvf'}
674 #summary_info += {'WHPX support':      have_whpx'}
675 #summary_info += {'TCG support':       have_tcg'}
676 #if get_option('tcg')
677 #  summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
678 #  summary_info += {'TCG interpreter':   config_host.has_key('CONFIG_TCG_INTERPRETER')}
679 #endif
680 summary_info += {'malloc trim support': config_host.has_key('CONFIG_MALLOC_TRIM')}
681 summary_info += {'RDMA support':      config_host.has_key('CONFIG_RDMA')}
682 summary_info += {'PVRDMA support':    config_host.has_key('CONFIG_PVRDMA')}
683 summary_info += {'fdt support':       config_host.has_key('CONFIG_FDT')}
684 summary_info += {'membarrier':        config_host.has_key('CONFIG_MEMBARRIER')}
685 summary_info += {'preadv support':    config_host.has_key('CONFIG_PREADV')}
686 summary_info += {'fdatasync':         config_host.has_key('CONFIG_FDATASYNC')}
687 summary_info += {'madvise':           config_host.has_key('CONFIG_MADVISE')}
688 summary_info += {'posix_madvise':     config_host.has_key('CONFIG_POSIX_MADVISE')}
689 summary_info += {'posix_memalign':    config_host.has_key('CONFIG_POSIX_MEMALIGN')}
690 summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')}
691 summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
692 summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
693 summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
694 summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
695 summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')}
696 summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
697 summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
698 summary_info += {'Trace backends':    config_host['TRACE_BACKENDS']}
699 if config_host['TRACE_BACKENDS'].split().contains('simple')
700   summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
701 endif
702 # TODO: add back protocol and server version
703 summary_info += {'spice support':     config_host.has_key('CONFIG_SPICE')}
704 summary_info += {'rbd support':       config_host.has_key('CONFIG_RBD')}
705 summary_info += {'xfsctl support':    config_host.has_key('CONFIG_XFS')}
706 summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
707 summary_info += {'libusb':            config_host.has_key('CONFIG_USB_LIBUSB')}
708 summary_info += {'usb net redir':     config_host.has_key('CONFIG_USB_REDIR')}
709 summary_info += {'OpenGL support':    config_host.has_key('CONFIG_OPENGL')}
710 summary_info += {'OpenGL dmabufs':    config_host.has_key('CONFIG_OPENGL_DMABUF')}
711 summary_info += {'libiscsi support':  config_host.has_key('CONFIG_LIBISCSI')}
712 summary_info += {'libnfs support':    config_host.has_key('CONFIG_LIBNFS')}
713 summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
714 if targetos == 'windows'
715   if 'WIN_SDK' in config_host
716     summary_info += {'Windows SDK':       config_host['WIN_SDK']}
717   endif
718   summary_info += {'QGA VSS support':   config_host.has_key('CONFIG_QGA_VSS')}
719   summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
720   summary_info += {'QGA MSI support':   config_host.has_key('CONFIG_QGA_MSI_ENABLED')}
721 endif
722 summary_info += {'seccomp support':   config_host.has_key('CONFIG_SECCOMP')}
723 summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
724 summary_info += {'coroutine pool':    config_host['CONFIG_COROUTINE_POOL'] == '1'}
725 summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
726 summary_info += {'mutex debugging':   config_host.has_key('CONFIG_DEBUG_MUTEX')}
727 summary_info += {'crypto afalg':      config_host.has_key('CONFIG_AF_ALG')}
728 summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')}
729 summary_info += {'gcov':              get_option('b_coverage')}
730 summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
731 summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
732 summary_info += {'QOM debugging':     config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
733 summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
734 summary_info += {'lzo support':       config_host.has_key('CONFIG_LZO')}
735 summary_info += {'snappy support':    config_host.has_key('CONFIG_SNAPPY')}
736 summary_info += {'bzip2 support':     config_host.has_key('CONFIG_BZIP2')}
737 summary_info += {'lzfse support':     config_host.has_key('CONFIG_LZFSE')}
738 summary_info += {'zstd support':      config_host.has_key('CONFIG_ZSTD')}
739 summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
740 summary_info += {'libxml2':           config_host.has_key('CONFIG_LIBXML2')}
741 summary_info += {'tcmalloc support':  config_host.has_key('CONFIG_TCMALLOC')}
742 summary_info += {'jemalloc support':  config_host.has_key('CONFIG_JEMALLOC')}
743 summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
744 summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
745 summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
746 summary_info += {'bochs support':     config_host.has_key('CONFIG_BOCHS')}
747 summary_info += {'cloop support':     config_host.has_key('CONFIG_CLOOP')}
748 summary_info += {'dmg support':       config_host.has_key('CONFIG_DMG')}
749 summary_info += {'qcow v1 support':   config_host.has_key('CONFIG_QCOW1')}
750 summary_info += {'vdi support':       config_host.has_key('CONFIG_VDI')}
751 summary_info += {'vvfat support':     config_host.has_key('CONFIG_VVFAT')}
752 summary_info += {'qed support':       config_host.has_key('CONFIG_QED')}
753 summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
754 summary_info += {'sheepdog support':  config_host.has_key('CONFIG_SHEEPDOG')}
755 summary_info += {'capstone':          config_host.has_key('CONFIG_CAPSTONE')}
756 summary_info += {'libpmem support':   config_host.has_key('CONFIG_LIBPMEM')}
757 summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
758 summary_info += {'libudev':           config_host.has_key('CONFIG_LIBUDEV')}
759 summary_info += {'default devices':   config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'}
760 summary_info += {'plugin support':    config_host.has_key('CONFIG_PLUGIN')}
761 summary_info += {'fuzzing support':   config_host.has_key('CONFIG_FUZZ')}
762 if config_host.has_key('HAVE_GDB_BIN')
763   summary_info += {'gdb':             config_host['HAVE_GDB_BIN']}
764 endif
765 summary_info += {'thread sanitizer':  config_host.has_key('CONFIG_TSAN')}
766 summary_info += {'rng-none':          config_host.has_key('CONFIG_RNG_NONE')}
767 summary_info += {'Linux keyring':     config_host.has_key('CONFIG_SECRET_KEYRING')}
768 summary(summary_info, bool_yn: true)
770 if not supported_cpus.contains(cpu)
771   message()
772   warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
773   message()
774   message('CPU host architecture ' + cpu + ' support is not currently maintained.')
775   message('The QEMU project intends to remove support for this host CPU in')
776   message('a future release if nobody volunteers to maintain it and to')
777   message('provide a build host for our continuous integration setup.')
778   message('configure has succeeded and you can continue to build, but')
779   message('if you care about QEMU on this platform you should contact')
780   message('us upstream at qemu-devel@nongnu.org.')
781 endif
783 if not supported_oses.contains(targetos)
784   message()
785   warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!')
786   message()
787   message('Host OS ' + targetos + 'support is not currently maintained.')
788   message('The QEMU project intends to remove support for this host OS in')
789   message('a future release if nobody volunteers to maintain it and to')
790   message('provide a build host for our continuous integration setup.')
791   message('configure has succeeded and you can continue to build, but')
792   message('if you care about QEMU on this platform you should contact')
793   message('us upstream at qemu-devel@nongnu.org.')
794 endif