]> git.proxmox.com Git - mirror_qemu.git/blame - meson.build
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-reques...
[mirror_qemu.git] / meson.build
CommitLineData
a5665051 1project('qemu', ['c'], meson_version: '>=0.55.0',
90756b2f 2 default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11',
3e0e5190 3 'b_colorout=auto'],
a5665051
PB
4 version: run_command('head', meson.source_root() / 'VERSION').stdout().strip())
5
6not_found = dependency('', required: false)
b29b40f4
PB
7if meson.version().version_compare('>=0.56.0')
8 keyval = import('keyval')
9else
10 keyval = import('unstable-keyval')
11endif
a81df1b6 12ss = import('sourceset')
8b18cdbf 13fs = import('fs')
a81df1b6 14
ce1c1e7a 15sh = find_program('sh')
a81df1b6 16cc = meson.get_compiler('c')
a5665051 17config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
3154fee4 18enable_modules = 'CONFIG_MODULES' in config_host
35be72ba 19enable_static = 'CONFIG_STATIC' in config_host
f8aa24ea 20build_docs = 'BUILD_DOCS' in config_host
8fe11232
MAL
21
22if get_option('qemu_suffix').startswith('/')
23 error('qemu_suffix cannot start with a /')
24endif
25
ab4c0996 26qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
491e74c1 27qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
859aef02
PB
28config_host_data = configuration_data()
29genh = []
a5665051 30
760e4327
PB
31target_dirs = config_host['TARGET_DIRS'].split()
32have_user = false
33have_system = false
34foreach target : target_dirs
35 have_user = have_user or target.endswith('-user')
36 have_system = have_system or target.endswith('-softmmu')
37endforeach
38have_tools = 'CONFIG_TOOLS' in config_host
39have_block = have_system or have_tools
40
201e8ed7
PB
41python = import('python').find_installation()
42
43supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
6125673e 44supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', 'x86_64',
201e8ed7
PB
45 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
46
47cpu = host_machine.cpu_family()
48targetos = host_machine.system()
49
50configure_file(input: files('scripts/ninjatool.py'),
51 output: 'ninjatool',
52 configuration: config_host)
53
8a19980e
PB
54if cpu in ['x86', 'x86_64']
55 kvm_targets = ['i386-softmmu', 'x86_64-softmmu']
56elif cpu == 'aarch64'
57 kvm_targets = ['aarch64-softmmu']
58elif cpu == 's390x'
59 kvm_targets = ['s390x-softmmu']
60elif cpu in ['ppc', 'ppc64']
61 kvm_targets = ['ppc-softmmu', 'ppc64-softmmu']
fbc5884c
HC
62elif cpu in ['mips', 'mips64']
63 kvm_targets = ['mips-softmmu', 'mipsel-softmmu', 'mips64-softmmu', 'mips64el-softmmu']
8a19980e
PB
64else
65 kvm_targets = []
66endif
67
68accelerator_targets = { 'CONFIG_KVM': kvm_targets }
69if cpu in ['x86', 'x86_64']
70 accelerator_targets += {
71 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'],
72 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'],
73 'CONFIG_HVF': ['x86_64-softmmu'],
74 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
75 }
76endif
77
201e8ed7
PB
78##################
79# Compiler flags #
80##################
81
ff9ed62b
AB
82# Specify linker-script with add_project_link_arguments so that it is not placed
83# within a linker --start-group/--end-group pair
84if 'CONFIG_FUZZ' in config_host
85 add_project_link_arguments(['-Wl,-T,',
86 (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
87 native: false, language: ['c', 'cpp', 'objc'])
88endif
89
a5665051
PB
90add_project_arguments(config_host['QEMU_CFLAGS'].split(),
91 native: false, language: ['c', 'objc'])
92add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
93 native: false, language: 'cpp')
94add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
95 native: false, language: ['c', 'cpp', 'objc'])
96add_project_arguments(config_host['QEMU_INCLUDES'].split(),
97 language: ['c', 'cpp', 'objc'])
98
c46f76d1 99
fc929892
MAL
100link_language = meson.get_external_property('link_language', 'cpp')
101if link_language == 'cpp'
102 add_languages('cpp', required: true, native: false)
103endif
a5665051
PB
104if host_machine.system() == 'darwin'
105 add_languages('objc', required: false, native: false)
106endif
107
deb62371
PB
108sparse = find_program('cgcc', required: get_option('sparse'))
109if sparse.found()
968b4db3
PB
110 run_target('sparse',
111 command: [find_program('scripts/check_sparse.py'),
deb62371
PB
112 'compile_commands.json', sparse.full_path(), '-Wbitwise',
113 '-Wno-transparent-union', '-Wno-old-initializer',
114 '-Wno-non-pointer-null'])
968b4db3
PB
115endif
116
6ec0e15d
PB
117###########################################
118# Target-specific checks and dependencies #
119###########################################
120
121if targetos != 'linux' and get_option('mpath').enabled()
122 error('Multipath is supported only on Linux')
123endif
124
a81df1b6
PB
125m = cc.find_library('m', required: false)
126util = cc.find_library('util', required: false)
4a96337d 127winmm = []
a81df1b6 128socket = []
04c6f1e7 129version_res = []
d92989aa
MAL
130coref = []
131iokit = []
b6c7cfd4 132emulator_link_args = []
b4e312e9 133cocoa = not_found
8a19980e 134hvf = not_found
a81df1b6
PB
135if targetos == 'windows'
136 socket = cc.find_library('ws2_32')
4a96337d 137 winmm = cc.find_library('winmm')
04c6f1e7
MAL
138
139 win = import('windows')
140 version_res = win.compile_resources('version.rc',
141 depend_files: files('pc-bios/qemu-nsis.ico'),
142 include_directories: include_directories('.'))
d92989aa
MAL
143elif targetos == 'darwin'
144 coref = dependency('appleframeworks', modules: 'CoreFoundation')
145 iokit = dependency('appleframeworks', modules: 'IOKit')
b4e312e9 146 cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
cfad62f1
PB
147elif targetos == 'sunos'
148 socket = [cc.find_library('socket'),
149 cc.find_library('nsl'),
150 cc.find_library('resolv')]
151elif targetos == 'haiku'
152 socket = [cc.find_library('posix_error_mapper'),
153 cc.find_library('network'),
154 cc.find_library('bsd')]
b6c7cfd4
PB
155elif targetos == 'openbsd'
156 if not get_option('tcg').disabled() and target_dirs.length() > 0
157 # Disable OpenBSD W^X if available
158 emulator_link_args = cc.get_supported_link_arguments('-Wl,-z,wxneeded')
159 endif
a81df1b6 160endif
6ec0e15d 161
8a19980e
PB
162accelerators = []
163if not get_option('kvm').disabled() and targetos == 'linux'
164 accelerators += 'CONFIG_KVM'
165endif
166if not get_option('xen').disabled() and 'CONFIG_XEN_BACKEND' in config_host
167 accelerators += 'CONFIG_XEN'
168 have_xen_pci_passthrough = not get_option('xen_pci_passthrough').disabled() and targetos == 'linux'
169else
170 have_xen_pci_passthrough = false
171endif
172if not get_option('whpx').disabled() and targetos == 'windows'
173 if get_option('whpx').enabled() and cpu != 'x86_64'
174 error('WHPX requires 64-bit host')
175 elif cc.has_header('WinHvPlatform.h', required: get_option('whpx')) and \
176 cc.has_header('WinHvEmulation.h', required: get_option('whpx'))
177 accelerators += 'CONFIG_WHPX'
178 endif
179endif
180if not get_option('hvf').disabled()
181 hvf = dependency('appleframeworks', modules: 'Hypervisor',
182 required: get_option('hvf'))
183 if hvf.found()
184 accelerators += 'CONFIG_HVF'
185 endif
186endif
187if not get_option('hax').disabled()
188 if get_option('hax').enabled() or targetos in ['windows', 'darwin', 'netbsd']
189 accelerators += 'CONFIG_HAX'
190 endif
191endif
192if not get_option('tcg').disabled()
193 if cpu not in supported_cpus
194 if 'CONFIG_TCG_INTERPRETER' in config_host
195 warning('Unsupported CPU @0@, will use TCG with TCI (experimental)'.format(cpu))
196 else
197 error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
198 endif
199 endif
200 accelerators += 'CONFIG_TCG'
201 config_host += { 'CONFIG_TCG': 'y' }
202endif
203
204if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled()
205 error('KVM not available on this platform')
206endif
207if 'CONFIG_HVF' not in accelerators and get_option('hvf').enabled()
208 error('HVF not available on this platform')
209endif
210if 'CONFIG_WHPX' not in accelerators and get_option('whpx').enabled()
211 error('WHPX not available on this platform')
212endif
213if not have_xen_pci_passthrough and get_option('xen_pci_passthrough').enabled()
214 if 'CONFIG_XEN' in accelerators
215 error('Xen PCI passthrough not available on this platform')
216 else
217 error('Xen PCI passthrough requested but Xen not enabled')
218 endif
219endif
b4e312e9
PB
220if not cocoa.found() and get_option('cocoa').enabled()
221 error('Cocoa not available on this platform')
222endif
223
6ec0e15d
PB
224################
225# Dependencies #
226################
227
215b0c2f
PB
228# The path to glib.h is added to all compilation commands. This was
229# grandfathered in from the QEMU Makefiles.
230add_project_arguments(config_host['GLIB_CFLAGS'].split(),
231 native: false, language: ['c', 'cpp', 'objc'])
232glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
a81df1b6
PB
233gio = not_found
234if 'CONFIG_GIO' in config_host
235 gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
236 link_args: config_host['GIO_LIBS'].split())
237endif
238lttng = not_found
239if 'CONFIG_TRACE_UST' in config_host
240 lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split())
241endif
242urcubp = not_found
243if 'CONFIG_TRACE_UST' in config_host
244 urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split())
245endif
46859d93
DB
246gcrypt = not_found
247if 'CONFIG_GCRYPT' in config_host
248 gcrypt = declare_dependency(compile_args: config_host['GCRYPT_CFLAGS'].split(),
249 link_args: config_host['GCRYPT_LIBS'].split())
250endif
a81df1b6
PB
251nettle = not_found
252if 'CONFIG_NETTLE' in config_host
253 nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(),
254 link_args: config_host['NETTLE_LIBS'].split())
255endif
256gnutls = not_found
257if 'CONFIG_GNUTLS' in config_host
258 gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
259 link_args: config_host['GNUTLS_LIBS'].split())
260endif
b7612f45
PB
261pixman = not_found
262if have_system or have_tools
263 pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
1a94933f 264 method: 'pkg-config', static: enable_static)
b7612f45 265endif
5e7fbd25
MAL
266pam = not_found
267if 'CONFIG_AUTH_PAM' in config_host
268 pam = cc.find_library('pam')
269endif
5e5733e5 270libaio = cc.find_library('aio', required: false)
1ffb3bbb 271zlib = dependency('zlib', required: true, static: enable_static)
5e5733e5
MAL
272linux_io_uring = not_found
273if 'CONFIG_LINUX_IO_URING' in config_host
274 linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(),
275 link_args: config_host['LINUX_IO_URING_LIBS'].split())
276endif
277libxml2 = not_found
278if 'CONFIG_LIBXML2' in config_host
279 libxml2 = declare_dependency(compile_args: config_host['LIBXML2_CFLAGS'].split(),
280 link_args: config_host['LIBXML2_LIBS'].split())
281endif
282libnfs = not_found
283if 'CONFIG_LIBNFS' in config_host
284 libnfs = declare_dependency(link_args: config_host['LIBNFS_LIBS'].split())
285endif
ec0d5893
MAL
286libattr = not_found
287if 'CONFIG_ATTR' in config_host
288 libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split())
289endif
3f99cf57
PB
290seccomp = not_found
291if 'CONFIG_SECCOMP' in config_host
292 seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(),
293 link_args: config_host['SECCOMP_LIBS'].split())
294endif
295libcap_ng = not_found
296if 'CONFIG_LIBCAP_NG' in config_host
297 libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split())
298endif
1917ec6d
PB
299if get_option('xkbcommon').auto() and not have_system and not have_tools
300 xkbcommon = not_found
301else
302 xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
1a94933f 303 method: 'pkg-config', static: enable_static)
ade60d4f 304endif
cdaf0722
MAL
305vde = not_found
306if config_host.has_key('CONFIG_VDE')
307 vde = declare_dependency(link_args: config_host['VDE_LIBS'].split())
308endif
478e943f
PB
309pulse = not_found
310if 'CONFIG_LIBPULSE' in config_host
311 pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(),
312 link_args: config_host['PULSE_LIBS'].split())
313endif
314alsa = not_found
315if 'CONFIG_ALSA' in config_host
316 alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(),
317 link_args: config_host['ALSA_LIBS'].split())
318endif
319jack = not_found
320if 'CONFIG_LIBJACK' in config_host
321 jack = declare_dependency(link_args: config_host['JACK_LIBS'].split())
322endif
2634733c
PB
323spice = not_found
324if 'CONFIG_SPICE' in config_host
325 spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(),
326 link_args: config_host['SPICE_LIBS'].split())
327endif
5ee24e78 328rt = cc.find_library('rt', required: false)
ccf7afa5
PB
329libdl = not_found
330if 'CONFIG_PLUGIN' in config_host
331 libdl = cc.find_library('dl', required: true)
332endif
99650b62
PB
333libiscsi = not_found
334if 'CONFIG_LIBISCSI' in config_host
335 libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(),
336 link_args: config_host['LIBISCSI_LIBS'].split())
337endif
5e5733e5
MAL
338zstd = not_found
339if 'CONFIG_ZSTD' in config_host
340 zstd = declare_dependency(compile_args: config_host['ZSTD_CFLAGS'].split(),
341 link_args: config_host['ZSTD_LIBS'].split())
342endif
ea458960
MAL
343gbm = not_found
344if 'CONFIG_GBM' in config_host
345 gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
346 link_args: config_host['GBM_LIBS'].split())
347endif
348virgl = not_found
349if 'CONFIG_VIRGL' in config_host
350 virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(),
351 link_args: config_host['VIRGL_LIBS'].split())
352endif
1d7bb6ab
MAL
353curl = not_found
354if 'CONFIG_CURL' in config_host
355 curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(),
356 link_args: config_host['CURL_LIBS'].split())
357endif
f15bff25 358libudev = not_found
f01496a3 359if targetos == 'linux' and (have_system or have_tools)
6ec0e15d
PB
360 libudev = dependency('libudev',
361 required: get_option('mpath').enabled(),
362 static: enable_static)
363endif
364
365mpathpersist = not_found
366mpathpersist_new_api = false
367if targetos == 'linux' and have_tools and not get_option('mpath').disabled()
368 mpath_test_source_new = '''
369 #include <libudev.h>
370 #include <mpath_persist.h>
371 unsigned mpath_mx_alloc_len = 1024;
372 int logsink;
373 static struct config *multipath_conf;
374 extern struct udev *udev;
375 extern struct config *get_multipath_config(void);
376 extern void put_multipath_config(struct config *conf);
377 struct udev *udev;
378 struct config *get_multipath_config(void) { return multipath_conf; }
379 void put_multipath_config(struct config *conf) { }
380 int main(void) {
381 udev = udev_new();
382 multipath_conf = mpath_lib_init();
383 return 0;
384 }'''
385 mpath_test_source_old = '''
386 #include <libudev.h>
387 #include <mpath_persist.h>
388 unsigned mpath_mx_alloc_len = 1024;
389 int logsink;
390 int main(void) {
391 struct udev *udev = udev_new();
392 mpath_lib_init(udev);
393 return 0;
394 }'''
43b43a40
PB
395 mpathlibs = [libudev]
396 if enable_static
397 mpathlibs += cc.find_library('devmapper',
398 required: get_option('mpath'),
399 static: enable_static)
400 endif
401 mpathlibs += cc.find_library('multipath',
402 required: get_option('mpath'),
403 static: enable_static)
404 mpathlibs += cc.find_library('mpathpersist',
405 required: get_option('mpath'),
406 static: enable_static)
407 foreach lib: mpathlibs
408 if not lib.found()
409 mpathlibs = []
410 break
411 endif
412 endforeach
413 if mpathlibs.length() > 0
6ec0e15d
PB
414 if cc.links(mpath_test_source_new, dependencies: mpathlibs)
415 mpathpersist = declare_dependency(dependencies: mpathlibs)
416 mpathpersist_new_api = true
417 elif cc.links(mpath_test_source_old, dependencies: mpathlibs)
418 mpathpersist = declare_dependency(dependencies: mpathlibs)
419 else
420 if get_option('mpath').enabled()
421 error('Cannot detect libmpathpersist API')
422 else
423 warning('Cannot detect libmpathpersist API, disabling')
424 endif
425 endif
426 endif
f15bff25 427endif
6ec0e15d 428
2634733c
PB
429brlapi = not_found
430if 'CONFIG_BRLAPI' in config_host
431 brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
432endif
35be72ba 433
760e4327
PB
434sdl = not_found
435if have_system
363743da 436 sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static)
760e4327
PB
437 sdl_image = not_found
438endif
35be72ba
PB
439if sdl.found()
440 # work around 2.0.8 bug
441 sdl = declare_dependency(compile_args: '-Wno-undef',
442 dependencies: sdl)
7161a433 443 sdl_image = dependency('SDL2_image', required: get_option('sdl_image'),
1a94933f 444 method: 'pkg-config', static: enable_static)
35be72ba
PB
445else
446 if get_option('sdl_image').enabled()
a8dc2ace
ST
447 error('sdl-image required, but SDL was @0@'.format(
448 get_option('sdl').disabled() ? 'disabled' : 'not found'))
35be72ba
PB
449 endif
450 sdl_image = not_found
2634733c 451endif
35be72ba 452
5e5733e5
MAL
453rbd = not_found
454if 'CONFIG_RBD' in config_host
455 rbd = declare_dependency(link_args: config_host['RBD_LIBS'].split())
456endif
457glusterfs = not_found
458if 'CONFIG_GLUSTERFS' in config_host
459 glusterfs = declare_dependency(compile_args: config_host['GLUSTERFS_CFLAGS'].split(),
460 link_args: config_host['GLUSTERFS_LIBS'].split())
461endif
462libssh = not_found
463if 'CONFIG_LIBSSH' in config_host
464 libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
465 link_args: config_host['LIBSSH_LIBS'].split())
466endif
467libbzip2 = not_found
468if 'CONFIG_BZIP2' in config_host
469 libbzip2 = declare_dependency(link_args: config_host['BZIP2_LIBS'].split())
470endif
471liblzfse = not_found
472if 'CONFIG_LZFSE' in config_host
473 liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split())
474endif
478e943f
PB
475oss = not_found
476if 'CONFIG_AUDIO_OSS' in config_host
477 oss = declare_dependency(link_args: config_host['OSS_LIBS'].split())
478endif
479dsound = not_found
480if 'CONFIG_AUDIO_DSOUND' in config_host
481 dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split())
482endif
483coreaudio = not_found
484if 'CONFIG_AUDIO_COREAUDIO' in config_host
485 coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split())
2b1ccdf4
MAL
486endif
487opengl = not_found
488if 'CONFIG_OPENGL' in config_host
de2d3005
PB
489 opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
490 link_args: config_host['OPENGL_LIBS'].split())
2b1ccdf4
MAL
491endif
492gtk = not_found
493if 'CONFIG_GTK' in config_host
494 gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(),
495 link_args: config_host['GTK_LIBS'].split())
496endif
497vte = not_found
498if 'CONFIG_VTE' in config_host
499 vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(),
500 link_args: config_host['VTE_LIBS'].split())
501endif
502x11 = not_found
503if 'CONFIG_X11' in config_host
504 x11 = declare_dependency(compile_args: config_host['X11_CFLAGS'].split(),
505 link_args: config_host['X11_LIBS'].split())
506endif
507curses = not_found
508if 'CONFIG_CURSES' in config_host
509 curses = declare_dependency(compile_args: config_host['CURSES_CFLAGS'].split(),
510 link_args: config_host['CURSES_LIBS'].split())
511endif
512iconv = not_found
513if 'CONFIG_ICONV' in config_host
514 iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(),
515 link_args: config_host['ICONV_LIBS'].split())
516endif
a0b93237 517vnc = not_found
2b1ccdf4 518png = not_found
2b1ccdf4 519jpeg = not_found
2b1ccdf4 520sasl = not_found
a0b93237
PB
521if get_option('vnc').enabled()
522 vnc = declare_dependency() # dummy dependency
523 png = dependency('libpng', required: get_option('vnc_png'),
1a94933f 524 method: 'pkg-config', static: enable_static)
a0b93237
PB
525 jpeg = cc.find_library('jpeg', has_headers: ['jpeglib.h'],
526 required: get_option('vnc_jpeg'),
527 static: enable_static)
528 sasl = cc.find_library('sasl2', has_headers: ['sasl/sasl.h'],
529 required: get_option('vnc_sasl'),
530 static: enable_static)
531 if sasl.found()
532 sasl = declare_dependency(dependencies: sasl,
533 compile_args: '-DSTRUCT_IOVEC_DEFINED')
534 endif
478e943f 535endif
708eab42
MAL
536snappy = not_found
537if 'CONFIG_SNAPPY' in config_host
538 snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split())
539endif
540lzo = not_found
541if 'CONFIG_LZO' in config_host
542 lzo = declare_dependency(link_args: config_host['LZO_LIBS'].split())
543endif
55166230
MAL
544rdma = not_found
545if 'CONFIG_RDMA' in config_host
546 rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
547endif
ab318051
MAL
548numa = not_found
549if 'CONFIG_NUMA' in config_host
550 numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split())
551endif
582ea95f
MAL
552xen = not_found
553if 'CONFIG_XEN_BACKEND' in config_host
554 xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
555 link_args: config_host['XEN_LIBS'].split())
556endif
06677ce1
PB
557cacard = not_found
558if 'CONFIG_SMARTCARD' in config_host
559 cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(),
560 link_args: config_host['SMARTCARD_LIBS'].split())
561endif
0a40bcb7
CB
562u2f = not_found
563if have_system
564 u2f = dependency('u2f-emu', required: get_option('u2f'),
565 method: 'pkg-config',
566 static: enable_static)
567endif
06677ce1
PB
568usbredir = not_found
569if 'CONFIG_USB_REDIR' in config_host
570 usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(),
571 link_args: config_host['USB_REDIR_LIBS'].split())
572endif
573libusb = not_found
574if 'CONFIG_USB_LIBUSB' in config_host
575 libusb = declare_dependency(compile_args: config_host['LIBUSB_CFLAGS'].split(),
576 link_args: config_host['LIBUSB_LIBS'].split())
577endif
c9322ab5
MAL
578libpmem = not_found
579if 'CONFIG_LIBPMEM' in config_host
580 libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(),
581 link_args: config_host['LIBPMEM_LIBS'].split())
582endif
c7c91a74
BR
583libdaxctl = not_found
584if 'CONFIG_LIBDAXCTL' in config_host
585 libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split())
586endif
8ce0a45f
MAL
587tasn1 = not_found
588if 'CONFIG_TASN1' in config_host
589 tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(),
590 link_args: config_host['TASN1_LIBS'].split())
591endif
af04e89d
MAL
592keyutils = dependency('libkeyutils', required: false,
593 method: 'pkg-config', static: enable_static)
a81df1b6 594
3909def8
MAL
595has_gettid = cc.has_function('gettid')
596
aa087962
PB
597# Malloc tests
598
599malloc = []
600if get_option('malloc') == 'system'
601 has_malloc_trim = \
602 not get_option('malloc_trim').disabled() and \
603 cc.links('''#include <malloc.h>
604 int main(void) { malloc_trim(0); return 0; }''')
605else
606 has_malloc_trim = false
607 malloc = cc.find_library(get_option('malloc'), required: true)
608endif
609if not has_malloc_trim and get_option('malloc_trim').enabled()
610 if get_option('malloc') == 'system'
611 error('malloc_trim not available on this platform.')
612 else
613 error('malloc_trim not available with non-libc memory allocator')
614 endif
615endif
616
a0c9162c
PB
617#################
618# config-host.h #
619#################
859aef02 620
b4e312e9 621config_host_data.set('CONFIG_COCOA', cocoa.found())
f01496a3 622config_host_data.set('CONFIG_LIBUDEV', libudev.found())
6ec0e15d
PB
623config_host_data.set('CONFIG_MPATH', mpathpersist.found())
624config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
35be72ba
PB
625config_host_data.set('CONFIG_SDL', sdl.found())
626config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
a0b93237
PB
627config_host_data.set('CONFIG_VNC', vnc.found())
628config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
629config_host_data.set('CONFIG_VNC_PNG', png.found())
630config_host_data.set('CONFIG_VNC_SASL', sasl.found())
4113f4cf 631config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found())
af04e89d 632config_host_data.set('CONFIG_KEYUTILS', keyutils.found())
3909def8 633config_host_data.set('CONFIG_GETTID', has_gettid)
aa087962 634config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim)
859aef02
PB
635config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version()))
636config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0])
637config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
638config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
639
765686d6 640ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target
859aef02 641arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
f4f5ed2c 642strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'bindir', 'prefix', 'qemu_confdir', 'qemu_datadir',
859aef02 643 'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir',
f4f5ed2c 644 'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath', 'sysconfdir']
859aef02 645foreach k, v: config_host
765686d6
PB
646 if ignored.contains(k)
647 # do nothing
648 elif arrays.contains(k)
859aef02
PB
649 if v != ''
650 v = '"' + '", "'.join(v.split()) + '", '
651 endif
652 config_host_data.set(k, v)
653 elif k == 'ARCH'
654 config_host_data.set('HOST_' + v.to_upper(), 1)
655 elif strings.contains(k)
656 if not k.startswith('CONFIG_')
657 k = 'CONFIG_' + k.to_upper()
658 endif
659 config_host_data.set_quoted(k, v)
660 elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_')
661 config_host_data.set(k, v == 'y' ? 1 : v)
662 endif
663endforeach
859aef02 664
a0c9162c
PB
665########################
666# Target configuration #
667########################
668
2becc36a 669minikconf = find_program('scripts/minikconf.py')
05512f55 670config_all = {}
a98006bc 671config_all_devices = {}
ca0fc784 672config_all_disas = {}
2becc36a
PB
673config_devices_mak_list = []
674config_devices_h = {}
859aef02 675config_target_h = {}
2becc36a 676config_target_mak = {}
ca0fc784
PB
677
678disassemblers = {
679 'alpha' : ['CONFIG_ALPHA_DIS'],
680 'arm' : ['CONFIG_ARM_DIS'],
681 'avr' : ['CONFIG_AVR_DIS'],
682 'cris' : ['CONFIG_CRIS_DIS'],
683 'hppa' : ['CONFIG_HPPA_DIS'],
684 'i386' : ['CONFIG_I386_DIS'],
685 'x86_64' : ['CONFIG_I386_DIS'],
686 'x32' : ['CONFIG_I386_DIS'],
687 'lm32' : ['CONFIG_LM32_DIS'],
688 'm68k' : ['CONFIG_M68K_DIS'],
689 'microblaze' : ['CONFIG_MICROBLAZE_DIS'],
690 'mips' : ['CONFIG_MIPS_DIS'],
691 'moxie' : ['CONFIG_MOXIE_DIS'],
692 'nios2' : ['CONFIG_NIOS2_DIS'],
693 'or1k' : ['CONFIG_OPENRISC_DIS'],
694 'ppc' : ['CONFIG_PPC_DIS'],
695 'riscv' : ['CONFIG_RISCV_DIS'],
696 'rx' : ['CONFIG_RX_DIS'],
697 's390' : ['CONFIG_S390_DIS'],
698 'sh4' : ['CONFIG_SH4_DIS'],
699 'sparc' : ['CONFIG_SPARC_DIS'],
700 'xtensa' : ['CONFIG_XTENSA_DIS'],
701}
702if link_language == 'cpp'
703 disassemblers += {
704 'aarch64' : [ 'CONFIG_ARM_A64_DIS'],
705 'arm' : [ 'CONFIG_ARM_DIS', 'CONFIG_ARM_A64_DIS'],
706 'mips' : [ 'CONFIG_MIPS_DIS', 'CONFIG_NANOMIPS_DIS'],
707 }
708endif
709
2becc36a
PB
710kconfig_external_symbols = [
711 'CONFIG_KVM',
712 'CONFIG_XEN',
713 'CONFIG_TPM',
714 'CONFIG_SPICE',
715 'CONFIG_IVSHMEM',
716 'CONFIG_OPENGL',
717 'CONFIG_X11',
718 'CONFIG_VHOST_USER',
40bc0ca9 719 'CONFIG_VHOST_VDPA',
2becc36a
PB
720 'CONFIG_VHOST_KERNEL',
721 'CONFIG_VIRTFS',
722 'CONFIG_LINUX',
723 'CONFIG_PVRDMA',
724]
a9a74907 725ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
05512f55 726
fdb75aef
PB
727default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host
728actual_target_dirs = []
fbb4121d 729fdt_required = []
a81df1b6 730foreach target : target_dirs
765686d6
PB
731 config_target = { 'TARGET_NAME': target.split('-')[0] }
732 if target.endswith('linux-user')
fdb75aef
PB
733 if targetos != 'linux'
734 if default_targets
735 continue
736 endif
737 error('Target @0@ is only available on a Linux host'.format(target))
738 endif
765686d6
PB
739 config_target += { 'CONFIG_LINUX_USER': 'y' }
740 elif target.endswith('bsd-user')
fdb75aef
PB
741 if 'CONFIG_BSD' not in config_host
742 if default_targets
743 continue
744 endif
745 error('Target @0@ is only available on a BSD host'.format(target))
746 endif
765686d6
PB
747 config_target += { 'CONFIG_BSD_USER': 'y' }
748 elif target.endswith('softmmu')
749 config_target += { 'CONFIG_SOFTMMU': 'y' }
750 endif
751 if target.endswith('-user')
752 config_target += {
753 'CONFIG_USER_ONLY': 'y',
754 'CONFIG_QEMU_INTERP_PREFIX':
755 config_host['CONFIG_QEMU_INTERP_PREFIX'].format(config_target['TARGET_NAME'])
756 }
757 endif
859aef02 758
8a19980e
PB
759 have_accel = false
760 foreach sym: accelerators
761 if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, [])
762 config_target += { sym: 'y' }
763 config_all += { sym: 'y' }
764 if sym == 'CONFIG_XEN' and have_xen_pci_passthrough
765 config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' }
766 endif
767 have_accel = true
768 endif
769 endforeach
fdb75aef
PB
770 if not have_accel
771 if default_targets
772 continue
773 endif
774 error('No accelerator available for target @0@'.format(target))
775 endif
8a19980e 776
fdb75aef 777 actual_target_dirs += target
765686d6 778 config_target += keyval.load('default-configs/targets' / target + '.mak')
a9a74907 779 config_target += { 'TARGET_' + config_target['TARGET_ARCH'].to_upper(): 'y' }
765686d6 780
fbb4121d
PB
781 if 'TARGET_NEED_FDT' in config_target
782 fdt_required += target
783 endif
784
fa73168b
PB
785 # Add default keys
786 if 'TARGET_BASE_ARCH' not in config_target
787 config_target += {'TARGET_BASE_ARCH': config_target['TARGET_ARCH']}
788 endif
789 if 'TARGET_ABI_DIR' not in config_target
790 config_target += {'TARGET_ABI_DIR': config_target['TARGET_ARCH']}
791 endif
859aef02 792
ca0fc784
PB
793 foreach k, v: disassemblers
794 if config_host['ARCH'].startswith(k) or config_target['TARGET_BASE_ARCH'].startswith(k)
795 foreach sym: v
796 config_target += { sym: 'y' }
797 config_all_disas += { sym: 'y' }
798 endforeach
799 endif
800 endforeach
801
859aef02
PB
802 config_target_data = configuration_data()
803 foreach k, v: config_target
804 if not k.startswith('TARGET_') and not k.startswith('CONFIG_')
805 # do nothing
806 elif ignored.contains(k)
807 # do nothing
808 elif k == 'TARGET_BASE_ARCH'
a9a74907
PB
809 # Note that TARGET_BASE_ARCH ends up in config-target.h but it is
810 # not used to select files from sourcesets.
859aef02 811 config_target_data.set('TARGET_' + v.to_upper(), 1)
765686d6 812 elif k == 'TARGET_NAME' or k == 'CONFIG_QEMU_INTERP_PREFIX'
859aef02
PB
813 config_target_data.set_quoted(k, v)
814 elif v == 'y'
815 config_target_data.set(k, 1)
816 else
817 config_target_data.set(k, v)
818 endif
819 endforeach
820 config_target_h += {target: configure_file(output: target + '-config-target.h',
821 configuration: config_target_data)}
2becc36a
PB
822
823 if target.endswith('-softmmu')
2becc36a
PB
824 base_kconfig = []
825 foreach sym : kconfig_external_symbols
859aef02 826 if sym in config_target or sym in config_host
2becc36a
PB
827 base_kconfig += '@0@=y'.format(sym)
828 endif
829 endforeach
830
831 config_devices_mak = target + '-config-devices.mak'
832 config_devices_mak = configure_file(
1bb4cb1c 833 input: ['default-configs/devices' / target + '.mak', 'Kconfig'],
2becc36a
PB
834 output: config_devices_mak,
835 depfile: config_devices_mak + '.d',
836 capture: true,
837 command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'],
838 config_devices_mak, '@DEPFILE@', '@INPUT@',
839 base_kconfig])
859aef02
PB
840
841 config_devices_data = configuration_data()
842 config_devices = keyval.load(config_devices_mak)
843 foreach k, v: config_devices
844 config_devices_data.set(k, 1)
845 endforeach
2becc36a 846 config_devices_mak_list += config_devices_mak
859aef02
PB
847 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
848 configuration: config_devices_data)}
849 config_target += config_devices
a98006bc 850 config_all_devices += config_devices
2becc36a
PB
851 endif
852 config_target_mak += {target: config_target}
a81df1b6 853endforeach
fdb75aef 854target_dirs = actual_target_dirs
a81df1b6 855
2becc36a
PB
856# This configuration is used to build files that are shared by
857# multiple binaries, and then extracted out of the "common"
858# static_library target.
859#
860# We do not use all_sources()/all_dependencies(), because it would
861# build literally all source files, including devices only used by
862# targets that are not built for this compilation. The CONFIG_ALL
863# pseudo symbol replaces it.
864
05512f55 865config_all += config_all_devices
2becc36a
PB
866config_all += config_host
867config_all += config_all_disas
868config_all += {
869 'CONFIG_XEN': config_host.has_key('CONFIG_XEN_BACKEND'),
870 'CONFIG_SOFTMMU': have_system,
871 'CONFIG_USER_ONLY': have_user,
872 'CONFIG_ALL': true,
873}
874
a0c9162c
PB
875##############
876# Submodules #
877##############
8b18cdbf
RH
878
879capstone = not_found
880capstone_opt = get_option('capstone')
881if capstone_opt in ['enabled', 'auto', 'system']
882 have_internal = fs.exists(meson.current_source_dir() / 'capstone/Makefile')
bcf36862
RH
883 capstone = dependency('capstone', version: '>=4.0',
884 static: enable_static, method: 'pkg-config',
8b18cdbf
RH
885 required: capstone_opt == 'system' or
886 capstone_opt == 'enabled' and not have_internal)
887 if capstone.found()
888 capstone_opt = 'system'
889 elif have_internal
890 capstone_opt = 'internal'
891 else
892 capstone_opt = 'disabled'
893 endif
894endif
895if capstone_opt == 'internal'
896 capstone_data = configuration_data()
897 capstone_data.set('CAPSTONE_USE_SYS_DYN_MEM', '1')
898
899 capstone_files = files(
900 'capstone/cs.c',
901 'capstone/MCInst.c',
902 'capstone/MCInstrDesc.c',
903 'capstone/MCRegisterInfo.c',
904 'capstone/SStream.c',
905 'capstone/utils.c'
906 )
907
908 if 'CONFIG_ARM_DIS' in config_all_disas
909 capstone_data.set('CAPSTONE_HAS_ARM', '1')
910 capstone_files += files(
911 'capstone/arch/ARM/ARMDisassembler.c',
912 'capstone/arch/ARM/ARMInstPrinter.c',
913 'capstone/arch/ARM/ARMMapping.c',
914 'capstone/arch/ARM/ARMModule.c'
915 )
916 endif
917
918 # FIXME: This config entry currently depends on a c++ compiler.
919 # Which is needed for building libvixl, but not for capstone.
920 if 'CONFIG_ARM_A64_DIS' in config_all_disas
921 capstone_data.set('CAPSTONE_HAS_ARM64', '1')
922 capstone_files += files(
923 'capstone/arch/AArch64/AArch64BaseInfo.c',
924 'capstone/arch/AArch64/AArch64Disassembler.c',
925 'capstone/arch/AArch64/AArch64InstPrinter.c',
926 'capstone/arch/AArch64/AArch64Mapping.c',
927 'capstone/arch/AArch64/AArch64Module.c'
928 )
929 endif
930
931 if 'CONFIG_PPC_DIS' in config_all_disas
932 capstone_data.set('CAPSTONE_HAS_POWERPC', '1')
933 capstone_files += files(
934 'capstone/arch/PowerPC/PPCDisassembler.c',
935 'capstone/arch/PowerPC/PPCInstPrinter.c',
936 'capstone/arch/PowerPC/PPCMapping.c',
937 'capstone/arch/PowerPC/PPCModule.c'
938 )
939 endif
940
3d562845
RH
941 if 'CONFIG_S390_DIS' in config_all_disas
942 capstone_data.set('CAPSTONE_HAS_SYSZ', '1')
943 capstone_files += files(
944 'capstone/arch/SystemZ/SystemZDisassembler.c',
945 'capstone/arch/SystemZ/SystemZInstPrinter.c',
946 'capstone/arch/SystemZ/SystemZMapping.c',
947 'capstone/arch/SystemZ/SystemZModule.c',
948 'capstone/arch/SystemZ/SystemZMCTargetDesc.c'
949 )
950 endif
951
8b18cdbf
RH
952 if 'CONFIG_I386_DIS' in config_all_disas
953 capstone_data.set('CAPSTONE_HAS_X86', 1)
954 capstone_files += files(
955 'capstone/arch/X86/X86Disassembler.c',
956 'capstone/arch/X86/X86DisassemblerDecoder.c',
957 'capstone/arch/X86/X86ATTInstPrinter.c',
958 'capstone/arch/X86/X86IntelInstPrinter.c',
eef20e40 959 'capstone/arch/X86/X86InstPrinterCommon.c',
8b18cdbf
RH
960 'capstone/arch/X86/X86Mapping.c',
961 'capstone/arch/X86/X86Module.c'
962 )
963 endif
964
965 configure_file(output: 'capstone-defs.h', configuration: capstone_data)
966
967 capstone_cargs = [
968 # FIXME: There does not seem to be a way to completely replace the c_args
969 # that come from add_project_arguments() -- we can only add to them.
970 # So: disable all warnings with a big hammer.
971 '-Wno-error', '-w',
972
973 # Include all configuration defines via a header file, which will wind up
974 # as a dependency on the object file, and thus changes here will result
975 # in a rebuild.
976 '-include', 'capstone-defs.h'
977 ]
978
979 libcapstone = static_library('capstone',
980 sources: capstone_files,
981 c_args: capstone_cargs,
982 include_directories: 'capstone/include')
983 capstone = declare_dependency(link_with: libcapstone,
eef20e40 984 include_directories: 'capstone/include/capstone')
8b18cdbf 985endif
4d34a86b
PB
986
987slirp = not_found
988slirp_opt = 'disabled'
989if have_system
990 slirp_opt = get_option('slirp')
991 if slirp_opt in ['enabled', 'auto', 'system']
992 have_internal = fs.exists(meson.current_source_dir() / 'slirp/meson.build')
993 slirp = dependency('slirp', static: enable_static,
994 method: 'pkg-config',
995 required: slirp_opt == 'system' or
996 slirp_opt == 'enabled' and not have_internal)
997 if slirp.found()
998 slirp_opt = 'system'
999 elif have_internal
1000 slirp_opt = 'internal'
1001 else
1002 slirp_opt = 'disabled'
1003 endif
1004 endif
1005 if slirp_opt == 'internal'
1006 slirp_deps = []
1007 if targetos == 'windows'
1008 slirp_deps = cc.find_library('iphlpapi')
1009 endif
1010 slirp_conf = configuration_data()
1011 slirp_conf.set('SLIRP_MAJOR_VERSION', meson.project_version().split('.')[0])
1012 slirp_conf.set('SLIRP_MINOR_VERSION', meson.project_version().split('.')[1])
1013 slirp_conf.set('SLIRP_MICRO_VERSION', meson.project_version().split('.')[2])
1014 slirp_conf.set_quoted('SLIRP_VERSION_STRING', meson.project_version())
1015 slirp_cargs = ['-DG_LOG_DOMAIN="Slirp"']
1016 slirp_files = [
1017 'slirp/src/arp_table.c',
1018 'slirp/src/bootp.c',
1019 'slirp/src/cksum.c',
1020 'slirp/src/dhcpv6.c',
1021 'slirp/src/dnssearch.c',
1022 'slirp/src/if.c',
1023 'slirp/src/ip6_icmp.c',
1024 'slirp/src/ip6_input.c',
1025 'slirp/src/ip6_output.c',
1026 'slirp/src/ip_icmp.c',
1027 'slirp/src/ip_input.c',
1028 'slirp/src/ip_output.c',
1029 'slirp/src/mbuf.c',
1030 'slirp/src/misc.c',
1031 'slirp/src/ncsi.c',
1032 'slirp/src/ndp_table.c',
1033 'slirp/src/sbuf.c',
1034 'slirp/src/slirp.c',
1035 'slirp/src/socket.c',
1036 'slirp/src/state.c',
1037 'slirp/src/stream.c',
1038 'slirp/src/tcp_input.c',
1039 'slirp/src/tcp_output.c',
1040 'slirp/src/tcp_subr.c',
1041 'slirp/src/tcp_timer.c',
1042 'slirp/src/tftp.c',
1043 'slirp/src/udp.c',
1044 'slirp/src/udp6.c',
1045 'slirp/src/util.c',
1046 'slirp/src/version.c',
1047 'slirp/src/vmstate.c',
1048 ]
1049
1050 configure_file(
1051 input : 'slirp/src/libslirp-version.h.in',
1052 output : 'libslirp-version.h',
1053 configuration: slirp_conf)
1054
1055 slirp_inc = include_directories('slirp', 'slirp/src')
1056 libslirp = static_library('slirp',
1057 sources: slirp_files,
1058 c_args: slirp_cargs,
1059 include_directories: slirp_inc)
1060 slirp = declare_dependency(link_with: libslirp,
1061 dependencies: slirp_deps,
1062 include_directories: slirp_inc)
1063 endif
1064endif
1065
fbb4121d
PB
1066fdt = not_found
1067fdt_opt = get_option('fdt')
1068if have_system
1069 if fdt_opt in ['enabled', 'auto', 'system']
1070 have_internal = fs.exists(meson.current_source_dir() / 'dtc/libfdt/Makefile.libfdt')
1071 fdt = cc.find_library('fdt', static: enable_static,
1072 required: fdt_opt == 'system' or
1073 fdt_opt == 'enabled' and not have_internal)
1074 if fdt.found() and cc.links('''
1075 #include <libfdt.h>
1076 #include <libfdt_env.h>
1077 int main(void) { fdt_check_full(NULL, 0); return 0; }''',
1078 dependencies: fdt)
1079 fdt_opt = 'system'
1080 elif have_internal
1081 fdt_opt = 'internal'
1082 else
1083 fdt_opt = 'disabled'
1084 endif
1085 endif
1086 if fdt_opt == 'internal'
1087 fdt_files = files(
1088 'dtc/libfdt/fdt.c',
1089 'dtc/libfdt/fdt_ro.c',
1090 'dtc/libfdt/fdt_wip.c',
1091 'dtc/libfdt/fdt_sw.c',
1092 'dtc/libfdt/fdt_rw.c',
1093 'dtc/libfdt/fdt_strerror.c',
1094 'dtc/libfdt/fdt_empty_tree.c',
1095 'dtc/libfdt/fdt_addresses.c',
1096 'dtc/libfdt/fdt_overlay.c',
1097 'dtc/libfdt/fdt_check.c',
1098 )
1099
1100 fdt_inc = include_directories('dtc/libfdt')
1101 libfdt = static_library('fdt',
1102 sources: fdt_files,
1103 include_directories: fdt_inc)
1104 fdt = declare_dependency(link_with: libfdt,
1105 include_directories: fdt_inc)
1106 endif
1107endif
1108if not fdt.found() and fdt_required.length() > 0
1109 error('fdt not available but required by targets ' + ', '.join(fdt_required))
1110endif
1111
8b18cdbf 1112config_host_data.set('CONFIG_CAPSTONE', capstone.found())
fbb4121d 1113config_host_data.set('CONFIG_FDT', fdt.found())
4d34a86b 1114config_host_data.set('CONFIG_SLIRP', slirp.found())
8b18cdbf 1115
a0c9162c
PB
1116#####################
1117# Generated sources #
1118#####################
8b18cdbf 1119
a0c9162c 1120genh += configure_file(output: 'config-host.h', configuration: config_host_data)
a81df1b6 1121
3f885659 1122hxtool = find_program('scripts/hxtool')
650b5d54 1123shaderinclude = find_program('scripts/shaderinclude.pl')
a81df1b6
PB
1124qapi_gen = find_program('scripts/qapi-gen.py')
1125qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
1126 meson.source_root() / 'scripts/qapi/commands.py',
1127 meson.source_root() / 'scripts/qapi/common.py',
a81df1b6
PB
1128 meson.source_root() / 'scripts/qapi/error.py',
1129 meson.source_root() / 'scripts/qapi/events.py',
1130 meson.source_root() / 'scripts/qapi/expr.py',
1131 meson.source_root() / 'scripts/qapi/gen.py',
1132 meson.source_root() / 'scripts/qapi/introspect.py',
1133 meson.source_root() / 'scripts/qapi/parser.py',
1134 meson.source_root() / 'scripts/qapi/schema.py',
1135 meson.source_root() / 'scripts/qapi/source.py',
1136 meson.source_root() / 'scripts/qapi/types.py',
1137 meson.source_root() / 'scripts/qapi/visit.py',
1138 meson.source_root() / 'scripts/qapi/common.py',
a81df1b6
PB
1139 meson.source_root() / 'scripts/qapi-gen.py'
1140]
1141
1142tracetool = [
1143 python, files('scripts/tracetool.py'),
1144 '--backend=' + config_host['TRACE_BACKENDS']
1145]
1146
2c273f32
MAL
1147qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
1148 meson.current_source_dir(),
859aef02 1149 config_host['PKGVERSION'], meson.project_version()]
2c273f32
MAL
1150qemu_version = custom_target('qemu-version.h',
1151 output: 'qemu-version.h',
1152 command: qemu_version_cmd,
1153 capture: true,
1154 build_by_default: true,
1155 build_always_stale: true)
1156genh += qemu_version
1157
3f885659
MAL
1158hxdep = []
1159hx_headers = [
1160 ['qemu-options.hx', 'qemu-options.def'],
1161 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
1162]
1163if have_system
1164 hx_headers += [
1165 ['hmp-commands.hx', 'hmp-commands.h'],
1166 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
1167 ]
1168endif
1169foreach d : hx_headers
b7c70bf2 1170 hxdep += custom_target(d[1],
3f885659
MAL
1171 input: files(d[0]),
1172 output: d[1],
1173 capture: true,
1174 build_by_default: true, # to be removed when added to a target
1175 command: [hxtool, '-h', '@INPUT0@'])
1176endforeach
1177genh += hxdep
1178
eb937365
PM
1179SPHINX_ARGS = [config_host['SPHINX_BUILD'],
1180 '-Dversion=' + meson.project_version(),
1181 '-Drelease=' + config_host['PKGVERSION']]
1182
1183if get_option('werror')
1184 SPHINX_ARGS += [ '-W' ]
1185endif
1186
b3f4830a
PM
1187sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py',
1188 meson.source_root() / 'docs/sphinx/hxtool.py',
1189 meson.source_root() / 'docs/sphinx/kerneldoc.py',
1190 meson.source_root() / 'docs/sphinx/kernellog.py',
1191 meson.source_root() / 'docs/sphinx/qapidoc.py',
1192 meson.source_root() / 'docs/sphinx/qmp_lexer.py',
1193 qapi_gen_depends ]
1194
a0c9162c
PB
1195###################
1196# Collect sources #
1197###################
a81df1b6 1198
55567891 1199authz_ss = ss.source_set()
4a96337d 1200blockdev_ss = ss.source_set()
7e2b888f 1201block_ss = ss.source_set()
2becc36a 1202bsd_user_ss = ss.source_set()
c2306d71 1203chardev_ss = ss.source_set()
7e2b888f 1204common_ss = ss.source_set()
2389304a 1205crypto_ss = ss.source_set()
f78536b1 1206io_ss = ss.source_set()
2becc36a 1207linux_user_ss = ss.source_set()
7e2b888f 1208qmp_ss = ss.source_set()
da33fc09 1209qom_ss = ss.source_set()
7e2b888f 1210softmmu_ss = ss.source_set()
64ed6f92 1211specific_fuzz_ss = ss.source_set()
7e2b888f
PMD
1212specific_ss = ss.source_set()
1213stub_ss = ss.source_set()
1214trace_ss = ss.source_set()
1215user_ss = ss.source_set()
1216util_ss = ss.source_set()
2becc36a 1217
3154fee4 1218modules = {}
2becc36a
PB
1219hw_arch = {}
1220target_arch = {}
1221target_softmmu_arch = {}
a81df1b6
PB
1222
1223###############
1224# Trace files #
1225###############
1226
c9322ab5
MAL
1227# TODO: add each directory to the subdirs from its own meson.build, once
1228# we have those
a81df1b6
PB
1229trace_events_subdirs = [
1230 'accel/kvm',
1231 'accel/tcg',
1232 'crypto',
1233 'monitor',
1234]
1235if have_user
1236 trace_events_subdirs += [ 'linux-user' ]
1237endif
1238if have_block
1239 trace_events_subdirs += [
1240 'authz',
1241 'block',
1242 'io',
1243 'nbd',
1244 'scsi',
1245 ]
1246endif
1247if have_system
1248 trace_events_subdirs += [
1249 'audio',
1250 'backends',
1251 'backends/tpm',
1252 'chardev',
1253 'hw/9pfs',
1254 'hw/acpi',
1255 'hw/alpha',
1256 'hw/arm',
1257 'hw/audio',
1258 'hw/block',
1259 'hw/block/dataplane',
1260 'hw/char',
1261 'hw/display',
1262 'hw/dma',
1263 'hw/hppa',
1264 'hw/hyperv',
1265 'hw/i2c',
1266 'hw/i386',
1267 'hw/i386/xen',
1268 'hw/ide',
1269 'hw/input',
1270 'hw/intc',
1271 'hw/isa',
1272 'hw/mem',
1273 'hw/mips',
1274 'hw/misc',
1275 'hw/misc/macio',
1276 'hw/net',
1277 'hw/nvram',
1278 'hw/pci',
1279 'hw/pci-host',
1280 'hw/ppc',
1281 'hw/rdma',
1282 'hw/rdma/vmw',
1283 'hw/rtc',
1284 'hw/s390x',
1285 'hw/scsi',
1286 'hw/sd',
1287 'hw/sparc',
1288 'hw/sparc64',
1289 'hw/ssi',
1290 'hw/timer',
1291 'hw/tpm',
1292 'hw/usb',
1293 'hw/vfio',
1294 'hw/virtio',
1295 'hw/watchdog',
1296 'hw/xen',
1297 'hw/gpio',
a81df1b6
PB
1298 'migration',
1299 'net',
8b7a5507 1300 'softmmu',
a81df1b6
PB
1301 'ui',
1302 ]
1303endif
1304trace_events_subdirs += [
1305 'hw/core',
1306 'qapi',
1307 'qom',
1308 'target/arm',
1309 'target/hppa',
1310 'target/i386',
1311 'target/mips',
1312 'target/ppc',
1313 'target/riscv',
1314 'target/s390x',
1315 'target/sparc',
1316 'util',
1317]
1318
a81df1b6
PB
1319subdir('qapi')
1320subdir('qobject')
1321subdir('stubs')
1322subdir('trace')
1323subdir('util')
5582c58f
MAL
1324subdir('qom')
1325subdir('authz')
a81df1b6 1326subdir('crypto')
2d78b56e 1327subdir('ui')
a81df1b6 1328
3154fee4
MAL
1329
1330if enable_modules
1331 libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO')
1332 modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
1333endif
1334
2becc36a 1335stub_ss = stub_ss.apply(config_all, strict: false)
a81df1b6
PB
1336
1337util_ss.add_all(trace_ss)
2becc36a 1338util_ss = util_ss.apply(config_all, strict: false)
a81df1b6
PB
1339libqemuutil = static_library('qemuutil',
1340 sources: util_ss.sources() + stub_ss.sources() + genh,
aa087962 1341 dependencies: [util_ss.dependencies(), m, glib, socket, malloc])
a81df1b6 1342qemuutil = declare_dependency(link_with: libqemuutil,
04c6f1e7 1343 sources: genh + version_res)
a81df1b6 1344
abff1abf
PB
1345decodetree = generator(find_program('scripts/decodetree.py'),
1346 output: 'decode-@BASENAME@.c.inc',
1347 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
1348
478e943f 1349subdir('audio')
7fcfd456 1350subdir('io')
848e8ff6 1351subdir('chardev')
ec0d5893 1352subdir('fsdev')
abff1abf 1353subdir('libdecnumber')
d3b18480 1354subdir('target')
708eab42 1355subdir('dump')
ec0d5893 1356
5e5733e5
MAL
1357block_ss.add(files(
1358 'block.c',
56ee8626 1359 'blockdev-nbd.c',
5e5733e5
MAL
1360 'blockjob.c',
1361 'job.c',
1362 'qemu-io-cmds.c',
1363))
1364block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
1365
1366subdir('nbd')
1367subdir('scsi')
1368subdir('block')
1369
4a96337d
PB
1370blockdev_ss.add(files(
1371 'blockdev.c',
4a96337d
PB
1372 'iothread.c',
1373 'job-qmp.c',
1374))
1375
1376# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
1377# os-win32.c does not
1378blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
1379softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
4a96337d 1380softmmu_ss.add_all(blockdev_ss)
4a96337d
PB
1381
1382common_ss.add(files('cpus-common.c'))
1383
5d3ea0e1 1384subdir('softmmu')
c9322ab5 1385
f343346b 1386common_ss.add(capstone)
d9f24bf5 1387specific_ss.add(files('cpu.c', 'disas.c', 'gdbstub.c'), capstone)
c9322ab5
MAL
1388specific_ss.add(files('exec-vary.c'))
1389specific_ss.add(when: 'CONFIG_TCG', if_true: files(
1390 'fpu/softfloat.c',
1391 'tcg/optimize.c',
1392 'tcg/tcg-common.c',
1393 'tcg/tcg-op-gvec.c',
1394 'tcg/tcg-op-vec.c',
1395 'tcg/tcg-op.c',
1396 'tcg/tcg.c',
1397))
1398specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.c', 'tcg/tci.c'))
1399
ab318051 1400subdir('backends')
c574e161 1401subdir('disas')
55166230 1402subdir('migration')
ff219dca 1403subdir('monitor')
cdaf0722 1404subdir('net')
17ef2af6 1405subdir('replay')
582ea95f 1406subdir('hw')
1a82878a 1407subdir('accel')
f556b4a1 1408subdir('plugins')
b309c321 1409subdir('bsd-user')
3a30446a
MAL
1410subdir('linux-user')
1411
b309c321
MAL
1412bsd_user_ss.add(files('gdbstub.c'))
1413specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
1414
3a30446a
MAL
1415linux_user_ss.add(files('gdbstub.c', 'thunk.c'))
1416specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
5d3ea0e1 1417
a2ce7dbd
PB
1418# needed for fuzzing binaries
1419subdir('tests/qtest/libqos')
64ed6f92 1420subdir('tests/qtest/fuzz')
a2ce7dbd 1421
a0c9162c
PB
1422########################
1423# Library dependencies #
1424########################
1425
3154fee4
MAL
1426block_mods = []
1427softmmu_mods = []
1428foreach d, list : modules
1429 foreach m, module_ss : list
1430 if enable_modules and targetos != 'windows'
3e292c51 1431 module_ss = module_ss.apply(config_all, strict: false)
3154fee4
MAL
1432 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
1433 dependencies: [modulecommon, module_ss.dependencies()], pic: true)
1434 if d == 'block'
1435 block_mods += sl
1436 else
1437 softmmu_mods += sl
1438 endif
1439 else
1440 if d == 'block'
1441 block_ss.add_all(module_ss)
1442 else
1443 softmmu_ss.add_all(module_ss)
1444 endif
1445 endif
1446 endforeach
1447endforeach
1448
1449nm = find_program('nm')
604f3e4e 1450undefsym = find_program('scripts/undefsym.py')
3154fee4
MAL
1451block_syms = custom_target('block.syms', output: 'block.syms',
1452 input: [libqemuutil, block_mods],
1453 capture: true,
1454 command: [undefsym, nm, '@INPUT@'])
1455qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
1456 input: [libqemuutil, softmmu_mods],
1457 capture: true,
1458 command: [undefsym, nm, '@INPUT@'])
1459
da33fc09
PMD
1460qom_ss = qom_ss.apply(config_host, strict: false)
1461libqom = static_library('qom', qom_ss.sources() + genh,
1462 dependencies: [qom_ss.dependencies()],
1463 name_suffix: 'fa')
1464
1465qom = declare_dependency(link_whole: libqom)
1466
55567891
PMD
1467authz_ss = authz_ss.apply(config_host, strict: false)
1468libauthz = static_library('authz', authz_ss.sources() + genh,
1469 dependencies: [authz_ss.dependencies()],
1470 name_suffix: 'fa',
1471 build_by_default: false)
1472
1473authz = declare_dependency(link_whole: libauthz,
1474 dependencies: qom)
1475
2389304a
PMD
1476crypto_ss = crypto_ss.apply(config_host, strict: false)
1477libcrypto = static_library('crypto', crypto_ss.sources() + genh,
1478 dependencies: [crypto_ss.dependencies()],
1479 name_suffix: 'fa',
1480 build_by_default: false)
1481
1482crypto = declare_dependency(link_whole: libcrypto,
1483 dependencies: [authz, qom])
1484
f78536b1
PMD
1485io_ss = io_ss.apply(config_host, strict: false)
1486libio = static_library('io', io_ss.sources() + genh,
1487 dependencies: [io_ss.dependencies()],
1488 link_with: libqemuutil,
1489 name_suffix: 'fa',
1490 build_by_default: false)
1491
1492io = declare_dependency(link_whole: libio, dependencies: [crypto, qom])
1493
7e6edef3
PMD
1494libmigration = static_library('migration', sources: migration_files + genh,
1495 name_suffix: 'fa',
1496 build_by_default: false)
1497migration = declare_dependency(link_with: libmigration,
1498 dependencies: [zlib, qom, io])
1499softmmu_ss.add(migration)
1500
5e5733e5
MAL
1501block_ss = block_ss.apply(config_host, strict: false)
1502libblock = static_library('block', block_ss.sources() + genh,
1503 dependencies: block_ss.dependencies(),
1504 link_depends: block_syms,
1505 name_suffix: 'fa',
1506 build_by_default: false)
1507
1508block = declare_dependency(link_whole: [libblock],
b7c70bf2
MAL
1509 link_args: '@block.syms',
1510 dependencies: [crypto, io])
5e5733e5 1511
ff219dca
PB
1512qmp_ss = qmp_ss.apply(config_host, strict: false)
1513libqmp = static_library('qmp', qmp_ss.sources() + genh,
1514 dependencies: qmp_ss.dependencies(),
1515 name_suffix: 'fa',
1516 build_by_default: false)
1517
1518qmp = declare_dependency(link_whole: [libqmp])
1519
c2306d71
PMD
1520libchardev = static_library('chardev', chardev_ss.sources() + genh,
1521 name_suffix: 'fa',
1522 build_by_default: false)
1523
1524chardev = declare_dependency(link_whole: libchardev)
1525
e28ab096
PMD
1526libhwcore = static_library('hwcore', sources: hwcore_files + genh,
1527 name_suffix: 'fa',
1528 build_by_default: false)
1529hwcore = declare_dependency(link_whole: libhwcore)
1530common_ss.add(hwcore)
1531
064f8ee7
PMD
1532###########
1533# Targets #
1534###########
1535
3154fee4
MAL
1536foreach m : block_mods + softmmu_mods
1537 shared_module(m.name(),
1538 name_prefix: '',
1539 link_whole: m,
1540 install: true,
1541 install_dir: config_host['qemu_moddir'])
1542endforeach
1543
64ed6f92
PB
1544softmmu_ss.add(authz, block, chardev, crypto, io, qmp)
1545common_ss.add(qom, qemuutil)
1546
1547common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss])
2becc36a
PB
1548common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
1549
1550common_all = common_ss.apply(config_all, strict: false)
1551common_all = static_library('common',
1552 build_by_default: false,
1553 sources: common_all.sources() + genh,
1554 dependencies: common_all.dependencies(),
1555 name_suffix: 'fa')
1556
c9322ab5
MAL
1557feature_to_c = find_program('scripts/feature_to_c.sh')
1558
fd5eef85 1559emulators = {}
2becc36a
PB
1560foreach target : target_dirs
1561 config_target = config_target_mak[target]
1562 target_name = config_target['TARGET_NAME']
1563 arch = config_target['TARGET_BASE_ARCH']
859aef02 1564 arch_srcs = [config_target_h[target]]
64ed6f92
PB
1565 arch_deps = []
1566 c_args = ['-DNEED_CPU_H',
1567 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
1568 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
b6c7cfd4 1569 link_args = emulator_link_args
2becc36a 1570
859aef02 1571 config_target += config_host
2becc36a
PB
1572 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
1573 if targetos == 'linux'
1574 target_inc += include_directories('linux-headers', is_system: true)
1575 endif
1576 if target.endswith('-softmmu')
1577 qemu_target_name = 'qemu-system-' + target_name
1578 target_type='system'
abff1abf
PB
1579 t = target_softmmu_arch[arch].apply(config_target, strict: false)
1580 arch_srcs += t.sources()
64ed6f92 1581 arch_deps += t.dependencies()
abff1abf 1582
2c44220d
MAL
1583 hw_dir = target_name == 'sparc64' ? 'sparc64' : arch
1584 hw = hw_arch[hw_dir].apply(config_target, strict: false)
1585 arch_srcs += hw.sources()
64ed6f92 1586 arch_deps += hw.dependencies()
2c44220d 1587
2becc36a 1588 arch_srcs += config_devices_h[target]
64ed6f92 1589 link_args += ['@block.syms', '@qemu.syms']
2becc36a 1590 else
3a30446a 1591 abi = config_target['TARGET_ABI_DIR']
2becc36a
PB
1592 target_type='user'
1593 qemu_target_name = 'qemu-' + target_name
1594 if 'CONFIG_LINUX_USER' in config_target
1595 base_dir = 'linux-user'
1596 target_inc += include_directories('linux-user/host/' / config_host['ARCH'])
1597 else
1598 base_dir = 'bsd-user'
1599 endif
1600 target_inc += include_directories(
1601 base_dir,
3a30446a 1602 base_dir / abi,
2becc36a 1603 )
3a30446a
MAL
1604 if 'CONFIG_LINUX_USER' in config_target
1605 dir = base_dir / abi
1606 arch_srcs += files(dir / 'signal.c', dir / 'cpu_loop.c')
1607 if config_target.has_key('TARGET_SYSTBL_ABI')
1608 arch_srcs += \
1609 syscall_nr_generators[abi].process(base_dir / abi / config_target['TARGET_SYSTBL'],
1610 extra_args : config_target['TARGET_SYSTBL_ABI'])
1611 endif
1612 endif
2becc36a
PB
1613 endif
1614
c9322ab5
MAL
1615 if 'TARGET_XML_FILES' in config_target
1616 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
1617 output: target + '-gdbstub-xml.c',
1618 input: files(config_target['TARGET_XML_FILES'].split()),
1619 command: [feature_to_c, '@INPUT@'],
1620 capture: true)
1621 arch_srcs += gdbstub_xml
1622 endif
1623
abff1abf
PB
1624 t = target_arch[arch].apply(config_target, strict: false)
1625 arch_srcs += t.sources()
64ed6f92 1626 arch_deps += t.dependencies()
abff1abf 1627
2becc36a
PB
1628 target_common = common_ss.apply(config_target, strict: false)
1629 objects = common_all.extract_objects(target_common.sources())
64ed6f92 1630 deps = target_common.dependencies()
2becc36a 1631
2becc36a
PB
1632 target_specific = specific_ss.apply(config_target, strict: false)
1633 arch_srcs += target_specific.sources()
64ed6f92 1634 arch_deps += target_specific.dependencies()
2becc36a 1635
64ed6f92 1636 lib = static_library('qemu-' + target,
859aef02 1637 sources: arch_srcs + genh,
b7612f45 1638 dependencies: arch_deps,
2becc36a
PB
1639 objects: objects,
1640 include_directories: target_inc,
64ed6f92
PB
1641 c_args: c_args,
1642 build_by_default: false,
2becc36a 1643 name_suffix: 'fa')
64ed6f92
PB
1644
1645 if target.endswith('-softmmu')
1646 execs = [{
1647 'name': 'qemu-system-' + target_name,
1648 'gui': false,
1649 'sources': files('softmmu/main.c'),
1650 'dependencies': []
1651 }]
35be72ba 1652 if targetos == 'windows' and (sdl.found() or gtk.found())
64ed6f92
PB
1653 execs += [{
1654 'name': 'qemu-system-' + target_name + 'w',
1655 'gui': true,
1656 'sources': files('softmmu/main.c'),
1657 'dependencies': []
1658 }]
1659 endif
1660 if config_host.has_key('CONFIG_FUZZ')
1661 specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false)
1662 execs += [{
1663 'name': 'qemu-fuzz-' + target_name,
1664 'gui': false,
1665 'sources': specific_fuzz.sources(),
1666 'dependencies': specific_fuzz.dependencies(),
64ed6f92
PB
1667 }]
1668 endif
1669 else
1670 execs = [{
1671 'name': 'qemu-' + target_name,
1672 'gui': false,
1673 'sources': [],
1674 'dependencies': []
1675 }]
1676 endif
1677 foreach exe: execs
fd5eef85
PB
1678 emulators += {exe['name']:
1679 executable(exe['name'], exe['sources'],
64ed6f92
PB
1680 install: true,
1681 c_args: c_args,
1682 dependencies: arch_deps + deps + exe['dependencies'],
1683 objects: lib.extract_all_objects(recursive: true),
1684 link_language: link_language,
1685 link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []),
1686 link_args: link_args,
1687 gui_app: exe['gui'])
fd5eef85 1688 }
10e1d263
MAL
1689
1690 if 'CONFIG_TRACE_SYSTEMTAP' in config_host
1691 foreach stp: [
bd5f973a
SH
1692 {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe['name'], 'install': false},
1693 {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe['name'], 'install': true},
10e1d263
MAL
1694 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
1695 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
1696 ]
bd5f973a 1697 custom_target(exe['name'] + stp['ext'],
10e1d263 1698 input: trace_events_all,
bd5f973a 1699 output: exe['name'] + stp['ext'],
10e1d263
MAL
1700 capture: true,
1701 install: stp['install'],
ab4c0996 1702 install_dir: qemu_datadir / '../systemtap/tapset',
10e1d263
MAL
1703 command: [
1704 tracetool, '--group=all', '--format=' + stp['fmt'],
1705 '--binary=' + stp['bin'],
1706 '--target-name=' + target_name,
1707 '--target-type=' + target_type,
1708 '--probe-prefix=qemu.' + target_type + '.' + target_name,
1709 '@INPUT@',
1710 ])
1711 endforeach
1712 endif
64ed6f92 1713 endforeach
2becc36a
PB
1714endforeach
1715
931049b4 1716# Other build targets
897b5afa 1717
f556b4a1
PB
1718if 'CONFIG_PLUGIN' in config_host
1719 install_headers('include/qemu/qemu-plugin.h')
1720endif
1721
f15bff25
PB
1722if 'CONFIG_GUEST_AGENT' in config_host
1723 subdir('qga')
1724endif
1725
9755c94a
LV
1726# Don't build qemu-keymap if xkbcommon is not explicitly enabled
1727# when we don't build tools or system
4113f4cf 1728if xkbcommon.found()
28742467
MAL
1729 # used for the update-keymaps target, so include rules even if !have_tools
1730 qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
1731 dependencies: [qemuutil, xkbcommon], install: have_tools)
1732endif
1733
931049b4 1734if have_tools
b7c70bf2
MAL
1735 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
1736 dependencies: [authz, block, crypto, io, qom, qemuutil], install: true)
1737 qemu_io = executable('qemu-io', files('qemu-io.c'),
1738 dependencies: [block, qemuutil], install: true)
eb705985 1739 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
b7c70bf2 1740 dependencies: [block, qemuutil], install: true)
b7c70bf2 1741
7c58bb76 1742 subdir('storage-daemon')
a9c9727c 1743 subdir('contrib/rdmacm-mux')
1d7bb6ab 1744 subdir('contrib/elf2dmp')
a9c9727c 1745
157e7b13
MAL
1746 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
1747 dependencies: qemuutil,
1748 install: true)
1749
931049b4
PB
1750 if 'CONFIG_VHOST_USER' in config_host
1751 subdir('contrib/libvhost-user')
2d7ac0af 1752 subdir('contrib/vhost-user-blk')
b7612f45 1753 subdir('contrib/vhost-user-gpu')
32fcc624 1754 subdir('contrib/vhost-user-input')
99650b62 1755 subdir('contrib/vhost-user-scsi')
931049b4 1756 endif
8f51e01c
MAL
1757
1758 if targetos == 'linux'
1759 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
1760 dependencies: [qemuutil, libcap_ng],
1761 install: true,
1762 install_dir: get_option('libexecdir'))
897b5afa
MAL
1763
1764 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
1765 dependencies: [authz, crypto, io, qom, qemuutil,
6ec0e15d 1766 libcap_ng, mpathpersist],
897b5afa 1767 install: true)
8f51e01c
MAL
1768 endif
1769
5ee24e78
MAL
1770 if 'CONFIG_IVSHMEM' in config_host
1771 subdir('contrib/ivshmem-client')
1772 subdir('contrib/ivshmem-server')
1773 endif
931049b4
PB
1774endif
1775
f5aa6320 1776subdir('scripts')
3f99cf57 1777subdir('tools')
bdcbea7a 1778subdir('pc-bios')
ce1c1e7a 1779subdir('tests')
f8aa24ea 1780subdir('docs')
e8f3bd71
MAL
1781if 'CONFIG_GTK' in config_host
1782 subdir('po')
1783endif
3f99cf57 1784
8adfeba9
MAL
1785if host_machine.system() == 'windows'
1786 nsis_cmd = [
1787 find_program('scripts/nsis.py'),
1788 '@OUTPUT@',
1789 get_option('prefix'),
1790 meson.current_source_dir(),
1791 host_machine.cpu_family(),
1792 '--',
1793 '-DDISPLAYVERSION=' + meson.project_version(),
1794 ]
1795 if build_docs
1796 nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
1797 endif
1798 if 'CONFIG_GTK' in config_host
1799 nsis_cmd += '-DCONFIG_GTK=y'
1800 endif
1801
1802 nsis = custom_target('nsis',
1803 output: 'qemu-setup-' + meson.project_version() + '.exe',
1804 input: files('qemu.nsi'),
1805 build_always_stale: true,
1806 command: nsis_cmd + ['@INPUT@'])
1807 alias_target('installer', nsis)
1808endif
1809
a0c9162c
PB
1810#########################
1811# Configuration summary #
1812#########################
1813
f9332757
PB
1814summary_info = {}
1815summary_info += {'Install prefix': config_host['prefix']}
1816summary_info += {'BIOS directory': config_host['qemu_datadir']}
1817summary_info += {'firmware path': config_host['qemu_firmwarepath']}
1818summary_info += {'binary directory': config_host['bindir']}
1819summary_info += {'library directory': config_host['libdir']}
1820summary_info += {'module directory': config_host['qemu_moddir']}
1821summary_info += {'libexec directory': config_host['libexecdir']}
1822summary_info += {'include directory': config_host['includedir']}
1823summary_info += {'config directory': config_host['sysconfdir']}
1824if targetos != 'windows'
1825 summary_info += {'local state directory': config_host['qemu_localstatedir']}
b81efab7 1826 summary_info += {'Manual directory': get_option('mandir')}
f9332757
PB
1827else
1828 summary_info += {'local state directory': 'queried at runtime'}
1829endif
491e74c1 1830summary_info += {'Doc directory': get_option('docdir')}
f9332757
PB
1831summary_info += {'Build directory': meson.current_build_dir()}
1832summary_info += {'Source path': meson.current_source_dir()}
1833summary_info += {'GIT binary': config_host['GIT']}
1834summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
1835summary_info += {'C compiler': meson.get_compiler('c').cmd_array()[0]}
1836summary_info += {'Host C compiler': meson.get_compiler('c', native: true).cmd_array()[0]}
1837if link_language == 'cpp'
1838 summary_info += {'C++ compiler': meson.get_compiler('cpp').cmd_array()[0]}
1839else
1840 summary_info += {'C++ compiler': false}
1841endif
1842if targetos == 'darwin'
1843 summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
1844endif
1845summary_info += {'ARFLAGS': config_host['ARFLAGS']}
47b30835
PB
1846summary_info += {'CFLAGS': ' '.join(get_option('c_args')
1847 + ['-O' + get_option('optimization')]
1848 + (get_option('debug') ? ['-g'] : []))}
1849if link_language == 'cpp'
1850 summary_info += {'CXXFLAGS': ' '.join(get_option('cpp_args')
1851 + ['-O' + get_option('optimization')]
1852 + (get_option('debug') ? ['-g'] : []))}
1853endif
1854link_args = get_option(link_language + '_link_args')
1855if link_args.length() > 0
1856 summary_info += {'LDFLAGS': ' '.join(link_args)}
1857endif
f9332757
PB
1858summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
1859summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
1860summary_info += {'make': config_host['MAKE']}
f9332757
PB
1861summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
1862summary_info += {'sphinx-build': config_host['SPHINX_BUILD']}
1863summary_info += {'genisoimage': config_host['GENISOIMAGE']}
1864# TODO: add back version
4d34a86b
PB
1865summary_info += {'slirp support': slirp_opt == 'disabled' ? false : slirp_opt}
1866if slirp_opt != 'disabled'
f9332757
PB
1867 summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']}
1868endif
1869summary_info += {'module support': config_host.has_key('CONFIG_MODULES')}
1870if config_host.has_key('CONFIG_MODULES')
1871 summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')}
1872endif
1873summary_info += {'host CPU': cpu}
1874summary_info += {'host endianness': build_machine.endian()}
fdb75aef 1875summary_info += {'target list': ' '.join(target_dirs)}
f9332757 1876summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')}
deb62371 1877summary_info += {'sparse enabled': sparse.found()}
f9332757
PB
1878summary_info += {'strip binaries': get_option('strip')}
1879summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
3e8529dd 1880summary_info += {'static build': config_host.has_key('CONFIG_STATIC')}
f9332757
PB
1881if targetos == 'darwin'
1882 summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
1883endif
1884# TODO: add back version
35be72ba
PB
1885summary_info += {'SDL support': sdl.found()}
1886summary_info += {'SDL image support': sdl_image.found()}
f9332757
PB
1887# TODO: add back version
1888summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
1889summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')}
b7612f45 1890summary_info += {'pixman': pixman.found()}
f9332757
PB
1891# TODO: add back version
1892summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
1893summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
1894summary_info += {'GNUTLS support': config_host.has_key('CONFIG_GNUTLS')}
1895# TODO: add back version
1896summary_info += {'libgcrypt': config_host.has_key('CONFIG_GCRYPT')}
1897if config_host.has_key('CONFIG_GCRYPT')
1898 summary_info += {' hmac': config_host.has_key('CONFIG_GCRYPT_HMAC')}
1899 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1900endif
1901# TODO: add back version
1902summary_info += {'nettle': config_host.has_key('CONFIG_NETTLE')}
1903if config_host.has_key('CONFIG_NETTLE')
1904 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1905endif
1906summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')}
1907summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')}
1908summary_info += {'iconv support': config_host.has_key('CONFIG_ICONV')}
1909summary_info += {'curses support': config_host.has_key('CONFIG_CURSES')}
1910# TODO: add back version
1911summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')}
1912summary_info += {'curl support': config_host.has_key('CONFIG_CURL')}
1913summary_info += {'mingw32 support': targetos == 'windows'}
1914summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']}
1915summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
1916summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
1917summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')}
6ec0e15d 1918summary_info += {'Multipath support': mpathpersist.found()}
a0b93237
PB
1919summary_info += {'VNC support': vnc.found()}
1920if vnc.found()
1921 summary_info += {'VNC SASL support': sasl.found()}
1922 summary_info += {'VNC JPEG support': jpeg.found()}
1923 summary_info += {'VNC PNG support': png.found()}
f9332757
PB
1924endif
1925summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')}
1926if config_host.has_key('CONFIG_XEN_BACKEND')
1927 summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
1928endif
1929summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')}
1930summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')}
1931summary_info += {'PIE': get_option('b_pie')}
1932summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
1933summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
1934summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
1935summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
1936summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')}
1937summary_info += {'Install blobs': config_host.has_key('INSTALL_BLOBS')}
05512f55
PB
1938summary_info += {'KVM support': config_all.has_key('CONFIG_KVM')}
1939summary_info += {'HAX support': config_all.has_key('CONFIG_HAX')}
1940summary_info += {'HVF support': config_all.has_key('CONFIG_HVF')}
1941summary_info += {'WHPX support': config_all.has_key('CONFIG_WHPX')}
1942summary_info += {'TCG support': config_all.has_key('CONFIG_TCG')}
1943if config_all.has_key('CONFIG_TCG')
1944 summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
1945 summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')}
1946endif
aa087962 1947summary_info += {'malloc trim support': has_malloc_trim}
f9332757
PB
1948summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
1949summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}
fbb4121d 1950summary_info += {'fdt support': fdt_opt == 'disabled' ? false : fdt_opt}
f9332757
PB
1951summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')}
1952summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')}
1953summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')}
1954summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')}
1955summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}
1956summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')}
1957summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')}
1958summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
1959summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
1960summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
1961summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
1962summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')}
1963summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
1964summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
1965summary_info += {'Trace backends': config_host['TRACE_BACKENDS']}
1966if config_host['TRACE_BACKENDS'].split().contains('simple')
1967 summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
1968endif
1969# TODO: add back protocol and server version
1970summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
1971summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')}
1972summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')}
1973summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
0a40bcb7 1974summary_info += {'U2F support': u2f.found()}
f9332757
PB
1975summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')}
1976summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')}
1977summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
1978summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')}
1979summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')}
1980summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')}
1981summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
1982if targetos == 'windows'
1983 if 'WIN_SDK' in config_host
1984 summary_info += {'Windows SDK': config_host['WIN_SDK']}
1985 endif
1986 summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')}
1987 summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
4bad7c3b 1988 summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI')}
f9332757
PB
1989endif
1990summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')}
1991summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
1992summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'}
1993summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
1994summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')}
1995summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')}
1996summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')}
bf0e56a3 1997summary_info += {'gcov': get_option('b_coverage')}
f9332757
PB
1998summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')}
1999summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')}
2000summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
2001summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
2002summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')}
2003summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')}
2004summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')}
2005summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')}
2006summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')}
2007summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
2008summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}
aa087962 2009summary_info += {'memory allocator': get_option('malloc')}
f9332757
PB
2010summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
2011summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
2012summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
2013summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')}
2014summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')}
2015summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')}
2016summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')}
2017summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')}
2018summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')}
2019summary_info += {'qed support': config_host.has_key('CONFIG_QED')}
2020summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
2021summary_info += {'sheepdog support': config_host.has_key('CONFIG_SHEEPDOG')}
8b18cdbf 2022summary_info += {'capstone': capstone_opt == 'disabled' ? false : capstone_opt}
f9332757
PB
2023summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')}
2024summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
f01496a3 2025summary_info += {'libudev': libudev.found()}
f9332757
PB
2026summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'}
2027summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')}
2028summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')}
2029if config_host.has_key('HAVE_GDB_BIN')
2030 summary_info += {'gdb': config_host['HAVE_GDB_BIN']}
2031endif
2032summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')}
2033summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')}
2034summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')}
2035summary(summary_info, bool_yn: true)
2036
2037if not supported_cpus.contains(cpu)
2038 message()
2039 warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
2040 message()
2041 message('CPU host architecture ' + cpu + ' support is not currently maintained.')
2042 message('The QEMU project intends to remove support for this host CPU in')
2043 message('a future release if nobody volunteers to maintain it and to')
2044 message('provide a build host for our continuous integration setup.')
2045 message('configure has succeeded and you can continue to build, but')
2046 message('if you care about QEMU on this platform you should contact')
2047 message('us upstream at qemu-devel@nongnu.org.')
2048endif
2049
2050if not supported_oses.contains(targetos)
2051 message()
2052 warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!')
2053 message()
2054 message('Host OS ' + targetos + 'support is not currently maintained.')
2055 message('The QEMU project intends to remove support for this host OS in')
2056 message('a future release if nobody volunteers to maintain it and to')
2057 message('provide a build host for our continuous integration setup.')
2058 message('configure has succeeded and you can continue to build, but')
2059 message('if you care about QEMU on this platform you should contact')
2060 message('us upstream at qemu-devel@nongnu.org.')
2061endif