blob: 62bf8a51c293f339b7f195403e65ffa386614dac [file] [log] [blame]
Paolo Bonzinia5665052019-06-10 12:05:14 +02001project('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())
4
5not_found = dependency('', required: false)
6keyval = import('unstable-keyval')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -04007ss = import('sourceset')
8
Paolo Bonzinice1c1e72020-01-28 16:41:44 +01009sh = find_program('sh')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040010cc = meson.get_compiler('c')
Paolo Bonzinia5665052019-06-10 12:05:14 +020011config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
Paolo Bonzini2becc362020-02-03 11:42:03 +010012config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak')
Marc-André Lureau3154fee2019-08-29 22:07:01 +040013enable_modules = 'CONFIG_MODULES' in config_host
Paolo Bonzini35be72b2020-02-06 14:17:15 +010014enable_static = 'CONFIG_STATIC' in config_host
Paolo Bonzinif8aa24e2020-08-05 15:49:10 +020015build_docs = 'BUILD_DOCS' in config_host
Paolo Bonzini859aef02020-08-04 18:14:26 +020016config_host_data = configuration_data()
17genh = []
Paolo Bonzinia5665052019-06-10 12:05:14 +020018
19add_project_arguments(config_host['QEMU_CFLAGS'].split(),
20 native: false, language: ['c', 'objc'])
21add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
22 native: false, language: 'cpp')
23add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
24 native: false, language: ['c', 'cpp', 'objc'])
25add_project_arguments(config_host['QEMU_INCLUDES'].split(),
26 language: ['c', 'cpp', 'objc'])
27
Marc-André Lureaufc929892019-07-13 01:47:54 +040028python = import('python').find_installation()
29
30link_language = meson.get_external_property('link_language', 'cpp')
31if link_language == 'cpp'
32 add_languages('cpp', required: true, native: false)
33endif
Paolo Bonzinia5665052019-06-10 12:05:14 +020034if host_machine.system() == 'darwin'
35 add_languages('objc', required: false, native: false)
36endif
37
Paolo Bonzini968b4db2020-02-03 14:45:33 +010038if 'SPARSE_CFLAGS' in config_host
39 run_target('sparse',
40 command: [find_program('scripts/check_sparse.py'),
41 config_host['SPARSE_CFLAGS'].split(),
42 'compile_commands.json'])
43endif
44
Paolo Bonzinia5665052019-06-10 12:05:14 +020045configure_file(input: files('scripts/ninjatool.py'),
46 output: 'ninjatool',
47 configuration: config_host)
Paolo Bonzinif9332752020-02-03 13:28:38 +010048
49supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
50supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
51 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
52
53cpu = host_machine.cpu_family()
54targetos = host_machine.system()
55
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040056m = cc.find_library('m', required: false)
57util = cc.find_library('util', required: false)
Paolo Bonzini4a963372020-08-03 16:22:28 +020058winmm = []
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040059socket = []
Marc-André Lureau04c6f1e2019-07-18 00:31:05 +040060version_res = []
Marc-André Lureaud92989a2019-08-20 19:48:59 +040061coref = []
62iokit = []
63cocoa = []
64hvf = []
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040065if targetos == 'windows'
66 socket = cc.find_library('ws2_32')
Paolo Bonzini4a963372020-08-03 16:22:28 +020067 winmm = cc.find_library('winmm')
Marc-André Lureau04c6f1e2019-07-18 00:31:05 +040068
69 win = import('windows')
70 version_res = win.compile_resources('version.rc',
71 depend_files: files('pc-bios/qemu-nsis.ico'),
72 include_directories: include_directories('.'))
Marc-André Lureaud92989a2019-08-20 19:48:59 +040073elif targetos == 'darwin'
74 coref = dependency('appleframeworks', modules: 'CoreFoundation')
75 iokit = dependency('appleframeworks', modules: 'IOKit')
76 cocoa = dependency('appleframeworks', modules: 'Cocoa')
77 hvf = dependency('appleframeworks', modules: 'Hypervisor')
Paolo Bonzinicfad62f2020-08-09 23:47:45 +020078elif targetos == 'sunos'
79 socket = [cc.find_library('socket'),
80 cc.find_library('nsl'),
81 cc.find_library('resolv')]
82elif targetos == 'haiku'
83 socket = [cc.find_library('posix_error_mapper'),
84 cc.find_library('network'),
85 cc.find_library('bsd')]
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040086endif
87glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
88 link_args: config_host['GLIB_LIBS'].split())
89gio = not_found
90if 'CONFIG_GIO' in config_host
91 gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
92 link_args: config_host['GIO_LIBS'].split())
93endif
94lttng = not_found
95if 'CONFIG_TRACE_UST' in config_host
96 lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split())
97endif
98urcubp = not_found
99if 'CONFIG_TRACE_UST' in config_host
100 urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split())
101endif
102nettle = not_found
103if 'CONFIG_NETTLE' in config_host
104 nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(),
105 link_args: config_host['NETTLE_LIBS'].split())
106endif
107gnutls = not_found
108if 'CONFIG_GNUTLS' in config_host
109 gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
110 link_args: config_host['GNUTLS_LIBS'].split())
111endif
Marc-André Lureauea458962019-07-12 22:23:46 +0400112pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(),
113 link_args: config_host['PIXMAN_LIBS'].split())
Marc-André Lureau5e7fbd22019-07-15 22:54:34 +0400114pam = not_found
115if 'CONFIG_AUTH_PAM' in config_host
116 pam = cc.find_library('pam')
117endif
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400118libaio = cc.find_library('aio', required: false)
119zlib = not_found
120if 'CONFIG_ZLIB' in config_host
121 zlib = declare_dependency(compile_args: config_host['ZLIB_CFLAGS'].split(),
122 link_args: config_host['ZLIB_LIBS'].split())
123endif
124linux_io_uring = not_found
125if 'CONFIG_LINUX_IO_URING' in config_host
126 linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(),
127 link_args: config_host['LINUX_IO_URING_LIBS'].split())
128endif
129libxml2 = not_found
130if 'CONFIG_LIBXML2' in config_host
131 libxml2 = declare_dependency(compile_args: config_host['LIBXML2_CFLAGS'].split(),
132 link_args: config_host['LIBXML2_LIBS'].split())
133endif
134libnfs = not_found
135if 'CONFIG_LIBNFS' in config_host
136 libnfs = declare_dependency(link_args: config_host['LIBNFS_LIBS'].split())
137endif
Marc-André Lureauec0d5892019-07-15 15:04:49 +0400138libattr = not_found
139if 'CONFIG_ATTR' in config_host
140 libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split())
141endif
Paolo Bonzini3f99cf52020-02-05 09:45:39 +0100142seccomp = not_found
143if 'CONFIG_SECCOMP' in config_host
144 seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(),
145 link_args: config_host['SECCOMP_LIBS'].split())
146endif
147libcap_ng = not_found
148if 'CONFIG_LIBCAP_NG' in config_host
149 libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split())
150endif
Marc-André Lureauade60d42019-07-15 14:48:31 +0400151xkbcommon = not_found
152if 'CONFIG_XKBCOMMON' in config_host
153 xkbcommon = declare_dependency(compile_args: config_host['XKBCOMMON_CFLAGS'].split(),
154 link_args: config_host['XKBCOMMON_LIBS'].split())
155endif
Marc-André Lureaucdaf0722019-07-22 23:47:50 +0400156slirp = not_found
157if config_host.has_key('CONFIG_SLIRP')
158 slirp = declare_dependency(compile_args: config_host['SLIRP_CFLAGS'].split(),
159 link_args: config_host['SLIRP_LIBS'].split())
160endif
161vde = not_found
162if config_host.has_key('CONFIG_VDE')
163 vde = declare_dependency(link_args: config_host['VDE_LIBS'].split())
164endif
Paolo Bonzini478e9432020-08-17 12:47:55 +0200165pulse = not_found
166if 'CONFIG_LIBPULSE' in config_host
167 pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(),
168 link_args: config_host['PULSE_LIBS'].split())
169endif
170alsa = not_found
171if 'CONFIG_ALSA' in config_host
172 alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(),
173 link_args: config_host['ALSA_LIBS'].split())
174endif
175jack = not_found
176if 'CONFIG_LIBJACK' in config_host
177 jack = declare_dependency(link_args: config_host['JACK_LIBS'].split())
178endif
Paolo Bonzini26347332019-07-29 15:40:07 +0200179spice = not_found
180if 'CONFIG_SPICE' in config_host
181 spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(),
182 link_args: config_host['SPICE_LIBS'].split())
183endif
Marc-André Lureau5ee24e72019-07-12 23:16:54 +0400184rt = cc.find_library('rt', required: false)
Marc-André Lureau897b5af2019-07-16 21:54:15 +0400185libmpathpersist = not_found
186if config_host.has_key('CONFIG_MPATH')
187 libmpathpersist = cc.find_library('mpathpersist')
188endif
Paolo Bonzini99650b62019-06-10 12:21:14 +0200189libiscsi = not_found
190if 'CONFIG_LIBISCSI' in config_host
191 libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(),
192 link_args: config_host['LIBISCSI_LIBS'].split())
193endif
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400194zstd = not_found
195if 'CONFIG_ZSTD' in config_host
196 zstd = declare_dependency(compile_args: config_host['ZSTD_CFLAGS'].split(),
197 link_args: config_host['ZSTD_LIBS'].split())
198endif
Marc-André Lureauea458962019-07-12 22:23:46 +0400199gbm = not_found
200if 'CONFIG_GBM' in config_host
201 gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
202 link_args: config_host['GBM_LIBS'].split())
203endif
204virgl = not_found
205if 'CONFIG_VIRGL' in config_host
206 virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(),
207 link_args: config_host['VIRGL_LIBS'].split())
208endif
Marc-André Lureau1d7bb6a2019-07-12 23:47:06 +0400209curl = not_found
210if 'CONFIG_CURL' in config_host
211 curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(),
212 link_args: config_host['CURL_LIBS'].split())
213endif
Paolo Bonzinif15bff22019-07-18 13:19:02 +0200214libudev = not_found
215if 'CONFIG_LIBUDEV' in config_host
216 libudev = declare_dependency(link_args: config_host['LIBUDEV_LIBS'].split())
217endif
Paolo Bonzini26347332019-07-29 15:40:07 +0200218brlapi = not_found
219if 'CONFIG_BRLAPI' in config_host
220 brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
221endif
Paolo Bonzini35be72b2020-02-06 14:17:15 +0100222
223sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static,
224 include_type: 'system')
225sdl_image = not_found
226if sdl.found()
227 # work around 2.0.8 bug
228 sdl = declare_dependency(compile_args: '-Wno-undef',
229 dependencies: sdl)
230 sdl_image = dependency('sdl-image', required: get_option('sdl_image'),
231 static: enable_static)
232else
233 if get_option('sdl_image').enabled()
234 error('sdl-image required, but SDL was @0@',
235 get_option('sdl').disabled() ? 'disabled' : 'not found')
236 endif
237 sdl_image = not_found
Paolo Bonzini26347332019-07-29 15:40:07 +0200238endif
Paolo Bonzini35be72b2020-02-06 14:17:15 +0100239
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400240rbd = not_found
241if 'CONFIG_RBD' in config_host
242 rbd = declare_dependency(link_args: config_host['RBD_LIBS'].split())
243endif
244glusterfs = not_found
245if 'CONFIG_GLUSTERFS' in config_host
246 glusterfs = declare_dependency(compile_args: config_host['GLUSTERFS_CFLAGS'].split(),
247 link_args: config_host['GLUSTERFS_LIBS'].split())
248endif
249libssh = not_found
250if 'CONFIG_LIBSSH' in config_host
251 libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
252 link_args: config_host['LIBSSH_LIBS'].split())
253endif
254libbzip2 = not_found
255if 'CONFIG_BZIP2' in config_host
256 libbzip2 = declare_dependency(link_args: config_host['BZIP2_LIBS'].split())
257endif
258liblzfse = not_found
259if 'CONFIG_LZFSE' in config_host
260 liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split())
261endif
Paolo Bonzini478e9432020-08-17 12:47:55 +0200262oss = not_found
263if 'CONFIG_AUDIO_OSS' in config_host
264 oss = declare_dependency(link_args: config_host['OSS_LIBS'].split())
265endif
266dsound = not_found
267if 'CONFIG_AUDIO_DSOUND' in config_host
268 dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split())
269endif
270coreaudio = not_found
271if 'CONFIG_AUDIO_COREAUDIO' in config_host
272 coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split())
273endif
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400274opengl = not_found
275if 'CONFIG_OPENGL' in config_host
276 opengl = declare_dependency(link_args: config_host['OPENGL_LIBS'].split())
277else
278endif
279gtk = not_found
280if 'CONFIG_GTK' in config_host
281 gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(),
282 link_args: config_host['GTK_LIBS'].split())
283endif
284vte = not_found
285if 'CONFIG_VTE' in config_host
286 vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(),
287 link_args: config_host['VTE_LIBS'].split())
288endif
289x11 = not_found
290if 'CONFIG_X11' in config_host
291 x11 = declare_dependency(compile_args: config_host['X11_CFLAGS'].split(),
292 link_args: config_host['X11_LIBS'].split())
293endif
294curses = not_found
295if 'CONFIG_CURSES' in config_host
296 curses = declare_dependency(compile_args: config_host['CURSES_CFLAGS'].split(),
297 link_args: config_host['CURSES_LIBS'].split())
298endif
299iconv = not_found
300if 'CONFIG_ICONV' in config_host
301 iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(),
302 link_args: config_host['ICONV_LIBS'].split())
303endif
304gio = not_found
305if 'CONFIG_GIO' in config_host
306 gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
307 link_args: config_host['GIO_LIBS'].split())
308endif
Paolo Bonzinia0b93232020-02-06 15:48:52 +0100309vnc = not_found
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400310png = not_found
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400311jpeg = not_found
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400312sasl = not_found
Paolo Bonzinia0b93232020-02-06 15:48:52 +0100313if get_option('vnc').enabled()
314 vnc = declare_dependency() # dummy dependency
315 png = dependency('libpng', required: get_option('vnc_png'),
316 static: enable_static)
317 jpeg = cc.find_library('jpeg', has_headers: ['jpeglib.h'],
318 required: get_option('vnc_jpeg'),
319 static: enable_static)
320 sasl = cc.find_library('sasl2', has_headers: ['sasl/sasl.h'],
321 required: get_option('vnc_sasl'),
322 static: enable_static)
323 if sasl.found()
324 sasl = declare_dependency(dependencies: sasl,
325 compile_args: '-DSTRUCT_IOVEC_DEFINED')
326 endif
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400327endif
Paolo Bonzini4a963372020-08-03 16:22:28 +0200328fdt = not_found
329if 'CONFIG_FDT' in config_host
330 fdt = declare_dependency(compile_args: config_host['FDT_CFLAGS'].split(),
331 link_args: config_host['FDT_LIBS'].split())
332endif
Marc-André Lureau708eab42019-09-03 16:59:33 +0400333snappy = not_found
334if 'CONFIG_SNAPPY' in config_host
335 snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split())
336endif
337lzo = not_found
338if 'CONFIG_LZO' in config_host
339 lzo = declare_dependency(link_args: config_host['LZO_LIBS'].split())
340endif
Marc-André Lureau55166232019-07-24 19:16:22 +0400341rdma = not_found
342if 'CONFIG_RDMA' in config_host
343 rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
344endif
Marc-André Lureauab318052019-07-24 19:23:16 +0400345numa = not_found
346if 'CONFIG_NUMA' in config_host
347 numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split())
348endif
Marc-André Lureau582ea952019-08-15 15:15:32 +0400349xen = not_found
350if 'CONFIG_XEN_BACKEND' in config_host
351 xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
352 link_args: config_host['XEN_LIBS'].split())
353endif
Paolo Bonzini06677ce2020-08-06 13:07:39 +0200354cacard = not_found
355if 'CONFIG_SMARTCARD' in config_host
356 cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(),
357 link_args: config_host['SMARTCARD_LIBS'].split())
358endif
359usbredir = not_found
360if 'CONFIG_USB_REDIR' in config_host
361 usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(),
362 link_args: config_host['USB_REDIR_LIBS'].split())
363endif
364libusb = not_found
365if 'CONFIG_USB_LIBUSB' in config_host
366 libusb = declare_dependency(compile_args: config_host['LIBUSB_CFLAGS'].split(),
367 link_args: config_host['LIBUSB_LIBS'].split())
368endif
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400369capstone = not_found
370if 'CONFIG_CAPSTONE' in config_host
371 capstone = declare_dependency(compile_args: config_host['CAPSTONE_CFLAGS'].split(),
372 link_args: config_host['CAPSTONE_LIBS'].split())
373endif
374libpmem = not_found
375if 'CONFIG_LIBPMEM' in config_host
376 libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(),
377 link_args: config_host['LIBPMEM_LIBS'].split())
378endif
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400379
Paolo Bonzini859aef02020-08-04 18:14:26 +0200380# Create config-host.h
381
Paolo Bonzini35be72b2020-02-06 14:17:15 +0100382config_host_data.set('CONFIG_SDL', sdl.found())
383config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
Paolo Bonzinia0b93232020-02-06 15:48:52 +0100384config_host_data.set('CONFIG_VNC', vnc.found())
385config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
386config_host_data.set('CONFIG_VNC_PNG', png.found())
387config_host_data.set('CONFIG_VNC_SASL', sasl.found())
Paolo Bonzini859aef02020-08-04 18:14:26 +0200388config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version()))
389config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0])
390config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
391config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
392
393arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
394strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'qemu_confdir', 'qemu_datadir',
395 'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir',
396 'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath']
397foreach k, v: config_host
398 if arrays.contains(k)
399 if v != ''
400 v = '"' + '", "'.join(v.split()) + '", '
401 endif
402 config_host_data.set(k, v)
403 elif k == 'ARCH'
404 config_host_data.set('HOST_' + v.to_upper(), 1)
405 elif strings.contains(k)
406 if not k.startswith('CONFIG_')
407 k = 'CONFIG_' + k.to_upper()
408 endif
409 config_host_data.set_quoted(k, v)
410 elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_')
411 config_host_data.set(k, v == 'y' ? 1 : v)
412 endif
413endforeach
414genh += configure_file(output: 'config-host.h', configuration: config_host_data)
415
Paolo Bonzini2becc362020-02-03 11:42:03 +0100416minikconf = find_program('scripts/minikconf.py')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400417target_dirs = config_host['TARGET_DIRS'].split()
418have_user = false
419have_system = false
Paolo Bonzini2becc362020-02-03 11:42:03 +0100420config_devices_mak_list = []
421config_devices_h = {}
Paolo Bonzini859aef02020-08-04 18:14:26 +0200422config_target_h = {}
Paolo Bonzini2becc362020-02-03 11:42:03 +0100423config_target_mak = {}
424kconfig_external_symbols = [
425 'CONFIG_KVM',
426 'CONFIG_XEN',
427 'CONFIG_TPM',
428 'CONFIG_SPICE',
429 'CONFIG_IVSHMEM',
430 'CONFIG_OPENGL',
431 'CONFIG_X11',
432 'CONFIG_VHOST_USER',
433 'CONFIG_VHOST_KERNEL',
434 'CONFIG_VIRTFS',
435 'CONFIG_LINUX',
436 'CONFIG_PVRDMA',
437]
Paolo Bonzini859aef02020-08-04 18:14:26 +0200438ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS']
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400439foreach target : target_dirs
440 have_user = have_user or target.endswith('-user')
Paolo Bonzini859aef02020-08-04 18:14:26 +0200441 config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak')
442
443 config_target_data = configuration_data()
444 foreach k, v: config_target
445 if not k.startswith('TARGET_') and not k.startswith('CONFIG_')
446 # do nothing
447 elif ignored.contains(k)
448 # do nothing
449 elif k == 'TARGET_BASE_ARCH'
450 config_target_data.set('TARGET_' + v.to_upper(), 1)
451 elif k == 'TARGET_NAME'
452 config_target_data.set_quoted(k, v)
453 elif v == 'y'
454 config_target_data.set(k, 1)
455 else
456 config_target_data.set(k, v)
457 endif
458 endforeach
459 config_target_h += {target: configure_file(output: target + '-config-target.h',
460 configuration: config_target_data)}
Paolo Bonzini2becc362020-02-03 11:42:03 +0100461
462 if target.endswith('-softmmu')
463 have_system = true
464
465 base_kconfig = []
466 foreach sym : kconfig_external_symbols
Paolo Bonzini859aef02020-08-04 18:14:26 +0200467 if sym in config_target or sym in config_host
Paolo Bonzini2becc362020-02-03 11:42:03 +0100468 base_kconfig += '@0@=y'.format(sym)
469 endif
470 endforeach
471
472 config_devices_mak = target + '-config-devices.mak'
473 config_devices_mak = configure_file(
474 input: ['default-configs' / target + '.mak', 'Kconfig'],
475 output: config_devices_mak,
476 depfile: config_devices_mak + '.d',
477 capture: true,
478 command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'],
479 config_devices_mak, '@DEPFILE@', '@INPUT@',
480 base_kconfig])
Paolo Bonzini859aef02020-08-04 18:14:26 +0200481
482 config_devices_data = configuration_data()
483 config_devices = keyval.load(config_devices_mak)
484 foreach k, v: config_devices
485 config_devices_data.set(k, 1)
486 endforeach
Paolo Bonzini2becc362020-02-03 11:42:03 +0100487 config_devices_mak_list += config_devices_mak
Paolo Bonzini859aef02020-08-04 18:14:26 +0200488 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
489 configuration: config_devices_data)}
490 config_target += config_devices
Paolo Bonzini2becc362020-02-03 11:42:03 +0100491 endif
492 config_target_mak += {target: config_target}
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400493endforeach
494have_tools = 'CONFIG_TOOLS' in config_host
495have_block = have_system or have_tools
496
Paolo Bonzini2becc362020-02-03 11:42:03 +0100497grepy = find_program('scripts/grepy.sh')
498# This configuration is used to build files that are shared by
499# multiple binaries, and then extracted out of the "common"
500# static_library target.
501#
502# We do not use all_sources()/all_dependencies(), because it would
503# build literally all source files, including devices only used by
504# targets that are not built for this compilation. The CONFIG_ALL
505# pseudo symbol replaces it.
506
507if have_system
508 config_all_devices_mak = configure_file(
509 output: 'config-all-devices.mak',
510 input: config_devices_mak_list,
511 capture: true,
512 command: [grepy, '@INPUT@'],
513 )
514 config_all_devices = keyval.load(config_all_devices_mak)
515else
516 config_all_devices = {}
517endif
518config_all = config_all_devices
519config_all += config_host
520config_all += config_all_disas
521config_all += {
522 'CONFIG_XEN': config_host.has_key('CONFIG_XEN_BACKEND'),
523 'CONFIG_SOFTMMU': have_system,
524 'CONFIG_USER_ONLY': have_user,
525 'CONFIG_ALL': true,
526}
527
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400528# Generators
529
Marc-André Lureau3f885652019-07-15 18:06:04 +0400530hxtool = find_program('scripts/hxtool')
Marc-André Lureau650b5d52019-07-15 17:36:47 +0400531shaderinclude = find_program('scripts/shaderinclude.pl')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400532qapi_gen = find_program('scripts/qapi-gen.py')
533qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
534 meson.source_root() / 'scripts/qapi/commands.py',
535 meson.source_root() / 'scripts/qapi/common.py',
536 meson.source_root() / 'scripts/qapi/doc.py',
537 meson.source_root() / 'scripts/qapi/error.py',
538 meson.source_root() / 'scripts/qapi/events.py',
539 meson.source_root() / 'scripts/qapi/expr.py',
540 meson.source_root() / 'scripts/qapi/gen.py',
541 meson.source_root() / 'scripts/qapi/introspect.py',
542 meson.source_root() / 'scripts/qapi/parser.py',
543 meson.source_root() / 'scripts/qapi/schema.py',
544 meson.source_root() / 'scripts/qapi/source.py',
545 meson.source_root() / 'scripts/qapi/types.py',
546 meson.source_root() / 'scripts/qapi/visit.py',
547 meson.source_root() / 'scripts/qapi/common.py',
548 meson.source_root() / 'scripts/qapi/doc.py',
549 meson.source_root() / 'scripts/qapi-gen.py'
550]
551
552tracetool = [
553 python, files('scripts/tracetool.py'),
554 '--backend=' + config_host['TRACE_BACKENDS']
555]
556
Marc-André Lureau2c273f32019-07-15 17:10:19 +0400557qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
558 meson.current_source_dir(),
Paolo Bonzini859aef02020-08-04 18:14:26 +0200559 config_host['PKGVERSION'], meson.project_version()]
Marc-André Lureau2c273f32019-07-15 17:10:19 +0400560qemu_version = custom_target('qemu-version.h',
561 output: 'qemu-version.h',
562 command: qemu_version_cmd,
563 capture: true,
564 build_by_default: true,
565 build_always_stale: true)
566genh += qemu_version
567
Marc-André Lureau3f885652019-07-15 18:06:04 +0400568hxdep = []
569hx_headers = [
570 ['qemu-options.hx', 'qemu-options.def'],
571 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
572]
573if have_system
574 hx_headers += [
575 ['hmp-commands.hx', 'hmp-commands.h'],
576 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
577 ]
578endif
579foreach d : hx_headers
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +0400580 hxdep += custom_target(d[1],
Marc-André Lureau3f885652019-07-15 18:06:04 +0400581 input: files(d[0]),
582 output: d[1],
583 capture: true,
584 build_by_default: true, # to be removed when added to a target
585 command: [hxtool, '-h', '@INPUT0@'])
586endforeach
587genh += hxdep
588
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400589# Collect sourcesets.
590
591util_ss = ss.source_set()
592stub_ss = ss.source_set()
593trace_ss = ss.source_set()
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400594block_ss = ss.source_set()
Paolo Bonzini4a963372020-08-03 16:22:28 +0200595blockdev_ss = ss.source_set()
Paolo Bonziniff219dc2020-08-04 21:14:26 +0200596qmp_ss = ss.source_set()
Paolo Bonzini2becc362020-02-03 11:42:03 +0100597common_ss = ss.source_set()
598softmmu_ss = ss.source_set()
599user_ss = ss.source_set()
600bsd_user_ss = ss.source_set()
601linux_user_ss = ss.source_set()
602specific_ss = ss.source_set()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200603specific_fuzz_ss = ss.source_set()
Paolo Bonzini2becc362020-02-03 11:42:03 +0100604
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400605modules = {}
Paolo Bonzini2becc362020-02-03 11:42:03 +0100606hw_arch = {}
607target_arch = {}
608target_softmmu_arch = {}
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400609
610###############
611# Trace files #
612###############
613
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400614# TODO: add each directory to the subdirs from its own meson.build, once
615# we have those
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400616trace_events_subdirs = [
617 'accel/kvm',
618 'accel/tcg',
619 'crypto',
620 'monitor',
621]
622if have_user
623 trace_events_subdirs += [ 'linux-user' ]
624endif
625if have_block
626 trace_events_subdirs += [
627 'authz',
628 'block',
629 'io',
630 'nbd',
631 'scsi',
632 ]
633endif
634if have_system
635 trace_events_subdirs += [
636 'audio',
637 'backends',
638 'backends/tpm',
639 'chardev',
640 'hw/9pfs',
641 'hw/acpi',
642 'hw/alpha',
643 'hw/arm',
644 'hw/audio',
645 'hw/block',
646 'hw/block/dataplane',
647 'hw/char',
648 'hw/display',
649 'hw/dma',
650 'hw/hppa',
651 'hw/hyperv',
652 'hw/i2c',
653 'hw/i386',
654 'hw/i386/xen',
655 'hw/ide',
656 'hw/input',
657 'hw/intc',
658 'hw/isa',
659 'hw/mem',
660 'hw/mips',
661 'hw/misc',
662 'hw/misc/macio',
663 'hw/net',
664 'hw/nvram',
665 'hw/pci',
666 'hw/pci-host',
667 'hw/ppc',
668 'hw/rdma',
669 'hw/rdma/vmw',
670 'hw/rtc',
671 'hw/s390x',
672 'hw/scsi',
673 'hw/sd',
674 'hw/sparc',
675 'hw/sparc64',
676 'hw/ssi',
677 'hw/timer',
678 'hw/tpm',
679 'hw/usb',
680 'hw/vfio',
681 'hw/virtio',
682 'hw/watchdog',
683 'hw/xen',
684 'hw/gpio',
685 'hw/riscv',
686 'migration',
687 'net',
688 'ui',
689 ]
690endif
691trace_events_subdirs += [
692 'hw/core',
693 'qapi',
694 'qom',
695 'target/arm',
696 'target/hppa',
697 'target/i386',
698 'target/mips',
699 'target/ppc',
700 'target/riscv',
701 'target/s390x',
702 'target/sparc',
703 'util',
704]
705
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400706subdir('qapi')
707subdir('qobject')
708subdir('stubs')
709subdir('trace')
710subdir('util')
Marc-André Lureau5582c582019-07-16 19:28:54 +0400711subdir('qom')
712subdir('authz')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400713subdir('crypto')
Marc-André Lureau2d78b562019-07-15 16:00:36 +0400714subdir('ui')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400715
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400716
717if enable_modules
718 libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO')
719 modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
720endif
721
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400722# Build targets from sourcesets
723
Paolo Bonzini2becc362020-02-03 11:42:03 +0100724stub_ss = stub_ss.apply(config_all, strict: false)
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400725
726util_ss.add_all(trace_ss)
Paolo Bonzini2becc362020-02-03 11:42:03 +0100727util_ss = util_ss.apply(config_all, strict: false)
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400728libqemuutil = static_library('qemuutil',
729 sources: util_ss.sources() + stub_ss.sources() + genh,
730 dependencies: [util_ss.dependencies(), m, glib, socket])
731qemuutil = declare_dependency(link_with: libqemuutil,
Marc-André Lureau04c6f1e2019-07-18 00:31:05 +0400732 sources: genh + version_res)
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400733
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200734decodetree = generator(find_program('scripts/decodetree.py'),
735 output: 'decode-@BASENAME@.c.inc',
736 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
737
Paolo Bonzini478e9432020-08-17 12:47:55 +0200738subdir('audio')
Marc-André Lureau7fcfd452019-07-16 19:33:55 +0400739subdir('io')
Marc-André Lureau848e8ff2019-07-15 23:18:07 +0400740subdir('chardev')
Marc-André Lureauec0d5892019-07-15 15:04:49 +0400741subdir('fsdev')
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200742subdir('libdecnumber')
Marc-André Lureaud3b18482019-08-17 14:55:32 +0400743subdir('target')
Marc-André Lureau708eab42019-09-03 16:59:33 +0400744subdir('dump')
Marc-André Lureauec0d5892019-07-15 15:04:49 +0400745
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400746block_ss.add(files(
747 'block.c',
748 'blockjob.c',
749 'job.c',
750 'qemu-io-cmds.c',
751))
752block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
753
754subdir('nbd')
755subdir('scsi')
756subdir('block')
757
Paolo Bonzini4a963372020-08-03 16:22:28 +0200758blockdev_ss.add(files(
759 'blockdev.c',
760 'blockdev-nbd.c',
761 'iothread.c',
762 'job-qmp.c',
763))
764
765# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
766# os-win32.c does not
767blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
768softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
769
770softmmu_ss.add_all(blockdev_ss)
771softmmu_ss.add(files(
772 'bootdevice.c',
773 'dma-helpers.c',
774 'qdev-monitor.c',
775), sdl)
776
777softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
778softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), seccomp])
779softmmu_ss.add(when: ['CONFIG_FDT', fdt], if_true: [files('device_tree.c')])
780
781common_ss.add(files('cpus-common.c'))
782
Paolo Bonzini5d3ea0e2020-08-06 13:40:26 +0200783subdir('softmmu')
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400784
785specific_ss.add(files('disas.c', 'exec.c', 'gdbstub.c'), capstone, libpmem)
786specific_ss.add(files('exec-vary.c'))
787specific_ss.add(when: 'CONFIG_TCG', if_true: files(
788 'fpu/softfloat.c',
789 'tcg/optimize.c',
790 'tcg/tcg-common.c',
791 'tcg/tcg-op-gvec.c',
792 'tcg/tcg-op-vec.c',
793 'tcg/tcg-op.c',
794 'tcg/tcg.c',
795))
796specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.c', 'tcg/tci.c'))
797
Marc-André Lureauab318052019-07-24 19:23:16 +0400798subdir('backends')
Marc-André Lureauc574e162019-07-26 12:02:31 +0400799subdir('disas')
Marc-André Lureau55166232019-07-24 19:16:22 +0400800subdir('migration')
Paolo Bonziniff219dc2020-08-04 21:14:26 +0200801subdir('monitor')
Marc-André Lureaucdaf0722019-07-22 23:47:50 +0400802subdir('net')
Marc-André Lureau17ef2af2019-07-22 23:40:45 +0400803subdir('replay')
Marc-André Lureau582ea952019-08-15 15:15:32 +0400804subdir('hw')
Marc-André Lureau1a828782019-08-18 16:13:08 +0400805subdir('accel')
Paolo Bonzinif556b4a2020-01-24 13:08:01 +0100806subdir('plugins')
Marc-André Lureaub309c322019-08-18 19:20:37 +0400807subdir('bsd-user')
Marc-André Lureau3a304462019-08-18 16:13:08 +0400808subdir('linux-user')
809
Marc-André Lureaub309c322019-08-18 19:20:37 +0400810bsd_user_ss.add(files('gdbstub.c'))
811specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
812
Marc-André Lureau3a304462019-08-18 16:13:08 +0400813linux_user_ss.add(files('gdbstub.c', 'thunk.c'))
814specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
Paolo Bonzini5d3ea0e2020-08-06 13:40:26 +0200815
Paolo Bonzinia2ce7db2020-08-04 20:00:40 +0200816# needed for fuzzing binaries
817subdir('tests/qtest/libqos')
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200818subdir('tests/qtest/fuzz')
Paolo Bonzinia2ce7db2020-08-04 20:00:40 +0200819
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400820block_mods = []
821softmmu_mods = []
822foreach d, list : modules
823 foreach m, module_ss : list
824 if enable_modules and targetos != 'windows'
825 module_ss = module_ss.apply(config_host, strict: false)
826 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
827 dependencies: [modulecommon, module_ss.dependencies()], pic: true)
828 if d == 'block'
829 block_mods += sl
830 else
831 softmmu_mods += sl
832 endif
833 else
834 if d == 'block'
835 block_ss.add_all(module_ss)
836 else
837 softmmu_ss.add_all(module_ss)
838 endif
839 endif
840 endforeach
841endforeach
842
843nm = find_program('nm')
844undefsym = find_program('scripts/undefsym.sh')
845block_syms = custom_target('block.syms', output: 'block.syms',
846 input: [libqemuutil, block_mods],
847 capture: true,
848 command: [undefsym, nm, '@INPUT@'])
849qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
850 input: [libqemuutil, softmmu_mods],
851 capture: true,
852 command: [undefsym, nm, '@INPUT@'])
853
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400854block_ss = block_ss.apply(config_host, strict: false)
855libblock = static_library('block', block_ss.sources() + genh,
856 dependencies: block_ss.dependencies(),
857 link_depends: block_syms,
858 name_suffix: 'fa',
859 build_by_default: false)
860
861block = declare_dependency(link_whole: [libblock],
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +0400862 link_args: '@block.syms',
863 dependencies: [crypto, io])
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400864
Paolo Bonziniff219dc2020-08-04 21:14:26 +0200865qmp_ss = qmp_ss.apply(config_host, strict: false)
866libqmp = static_library('qmp', qmp_ss.sources() + genh,
867 dependencies: qmp_ss.dependencies(),
868 name_suffix: 'fa',
869 build_by_default: false)
870
871qmp = declare_dependency(link_whole: [libqmp])
872
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400873foreach m : block_mods + softmmu_mods
874 shared_module(m.name(),
875 name_prefix: '',
876 link_whole: m,
877 install: true,
878 install_dir: config_host['qemu_moddir'])
879endforeach
880
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200881softmmu_ss.add(authz, block, chardev, crypto, io, qmp)
882common_ss.add(qom, qemuutil)
883
884common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss])
Paolo Bonzini2becc362020-02-03 11:42:03 +0100885common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
886
887common_all = common_ss.apply(config_all, strict: false)
888common_all = static_library('common',
889 build_by_default: false,
890 sources: common_all.sources() + genh,
891 dependencies: common_all.dependencies(),
892 name_suffix: 'fa')
893
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400894feature_to_c = find_program('scripts/feature_to_c.sh')
895
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200896emulators = []
Paolo Bonzini2becc362020-02-03 11:42:03 +0100897foreach target : target_dirs
898 config_target = config_target_mak[target]
899 target_name = config_target['TARGET_NAME']
900 arch = config_target['TARGET_BASE_ARCH']
Paolo Bonzini859aef02020-08-04 18:14:26 +0200901 arch_srcs = [config_target_h[target]]
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200902 arch_deps = []
903 c_args = ['-DNEED_CPU_H',
904 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
905 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
906 link_args = []
Paolo Bonzini2becc362020-02-03 11:42:03 +0100907
Paolo Bonzini859aef02020-08-04 18:14:26 +0200908 config_target += config_host
Paolo Bonzini2becc362020-02-03 11:42:03 +0100909 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
910 if targetos == 'linux'
911 target_inc += include_directories('linux-headers', is_system: true)
912 endif
913 if target.endswith('-softmmu')
914 qemu_target_name = 'qemu-system-' + target_name
915 target_type='system'
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200916 t = target_softmmu_arch[arch].apply(config_target, strict: false)
917 arch_srcs += t.sources()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200918 arch_deps += t.dependencies()
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200919
Marc-André Lureau2c442202019-08-17 13:55:58 +0400920 hw_dir = target_name == 'sparc64' ? 'sparc64' : arch
921 hw = hw_arch[hw_dir].apply(config_target, strict: false)
922 arch_srcs += hw.sources()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200923 arch_deps += hw.dependencies()
Marc-André Lureau2c442202019-08-17 13:55:58 +0400924
Paolo Bonzini2becc362020-02-03 11:42:03 +0100925 arch_srcs += config_devices_h[target]
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200926 link_args += ['@block.syms', '@qemu.syms']
Paolo Bonzini2becc362020-02-03 11:42:03 +0100927 else
Marc-André Lureau3a304462019-08-18 16:13:08 +0400928 abi = config_target['TARGET_ABI_DIR']
Paolo Bonzini2becc362020-02-03 11:42:03 +0100929 target_type='user'
930 qemu_target_name = 'qemu-' + target_name
931 if 'CONFIG_LINUX_USER' in config_target
932 base_dir = 'linux-user'
933 target_inc += include_directories('linux-user/host/' / config_host['ARCH'])
934 else
935 base_dir = 'bsd-user'
936 endif
937 target_inc += include_directories(
938 base_dir,
Marc-André Lureau3a304462019-08-18 16:13:08 +0400939 base_dir / abi,
Paolo Bonzini2becc362020-02-03 11:42:03 +0100940 )
Marc-André Lureau3a304462019-08-18 16:13:08 +0400941 if 'CONFIG_LINUX_USER' in config_target
942 dir = base_dir / abi
943 arch_srcs += files(dir / 'signal.c', dir / 'cpu_loop.c')
944 if config_target.has_key('TARGET_SYSTBL_ABI')
945 arch_srcs += \
946 syscall_nr_generators[abi].process(base_dir / abi / config_target['TARGET_SYSTBL'],
947 extra_args : config_target['TARGET_SYSTBL_ABI'])
948 endif
949 endif
Paolo Bonzini2becc362020-02-03 11:42:03 +0100950 endif
951
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400952 if 'TARGET_XML_FILES' in config_target
953 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
954 output: target + '-gdbstub-xml.c',
955 input: files(config_target['TARGET_XML_FILES'].split()),
956 command: [feature_to_c, '@INPUT@'],
957 capture: true)
958 arch_srcs += gdbstub_xml
959 endif
960
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200961 t = target_arch[arch].apply(config_target, strict: false)
962 arch_srcs += t.sources()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200963 arch_deps += t.dependencies()
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200964
Paolo Bonzini2becc362020-02-03 11:42:03 +0100965 target_common = common_ss.apply(config_target, strict: false)
966 objects = common_all.extract_objects(target_common.sources())
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200967 deps = target_common.dependencies()
Paolo Bonzini2becc362020-02-03 11:42:03 +0100968
Paolo Bonzini2becc362020-02-03 11:42:03 +0100969 target_specific = specific_ss.apply(config_target, strict: false)
970 arch_srcs += target_specific.sources()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200971 arch_deps += target_specific.dependencies()
Paolo Bonzini2becc362020-02-03 11:42:03 +0100972
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200973 lib = static_library('qemu-' + target,
Paolo Bonzini859aef02020-08-04 18:14:26 +0200974 sources: arch_srcs + genh,
Paolo Bonzini2becc362020-02-03 11:42:03 +0100975 objects: objects,
976 include_directories: target_inc,
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200977 c_args: c_args,
978 build_by_default: false,
Paolo Bonzini2becc362020-02-03 11:42:03 +0100979 name_suffix: 'fa')
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200980
981 if target.endswith('-softmmu')
982 execs = [{
983 'name': 'qemu-system-' + target_name,
984 'gui': false,
985 'sources': files('softmmu/main.c'),
986 'dependencies': []
987 }]
Paolo Bonzini35be72b2020-02-06 14:17:15 +0100988 if targetos == 'windows' and (sdl.found() or gtk.found())
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200989 execs += [{
990 'name': 'qemu-system-' + target_name + 'w',
991 'gui': true,
992 'sources': files('softmmu/main.c'),
993 'dependencies': []
994 }]
995 endif
996 if config_host.has_key('CONFIG_FUZZ')
997 specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false)
998 execs += [{
999 'name': 'qemu-fuzz-' + target_name,
1000 'gui': false,
1001 'sources': specific_fuzz.sources(),
1002 'dependencies': specific_fuzz.dependencies(),
1003 'link_depends': [files('tests/qtest/fuzz/fork_fuzz.ld')],
1004 }]
1005 endif
1006 else
1007 execs = [{
1008 'name': 'qemu-' + target_name,
1009 'gui': false,
1010 'sources': [],
1011 'dependencies': []
1012 }]
1013 endif
1014 foreach exe: execs
1015 emulators += executable(exe['name'], exe['sources'],
1016 install: true,
1017 c_args: c_args,
1018 dependencies: arch_deps + deps + exe['dependencies'],
1019 objects: lib.extract_all_objects(recursive: true),
1020 link_language: link_language,
1021 link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []),
1022 link_args: link_args,
1023 gui_app: exe['gui'])
Marc-André Lureau10e1d262019-08-20 12:29:52 +04001024
1025 if 'CONFIG_TRACE_SYSTEMTAP' in config_host
1026 foreach stp: [
1027 {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe_name, 'install': false},
1028 {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe_name, 'install': true},
1029 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
1030 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
1031 ]
1032 custom_target(exe_name + stp['ext'],
1033 input: trace_events_all,
1034 output: exe_name + stp['ext'],
1035 capture: true,
1036 install: stp['install'],
1037 install_dir: config_host['qemu_datadir'] / '../systemtap/tapset',
1038 command: [
1039 tracetool, '--group=all', '--format=' + stp['fmt'],
1040 '--binary=' + stp['bin'],
1041 '--target-name=' + target_name,
1042 '--target-type=' + target_type,
1043 '--probe-prefix=qemu.' + target_type + '.' + target_name,
1044 '@INPUT@',
1045 ])
1046 endforeach
1047 endif
Paolo Bonzini64ed6f92020-08-03 17:04:25 +02001048 endforeach
Paolo Bonzini2becc362020-02-03 11:42:03 +01001049endforeach
1050
Paolo Bonzini931049b2020-02-05 09:44:24 +01001051# Other build targets
Marc-André Lureau897b5af2019-07-16 21:54:15 +04001052
Paolo Bonzinif556b4a2020-01-24 13:08:01 +01001053if 'CONFIG_PLUGIN' in config_host
1054 install_headers('include/qemu/qemu-plugin.h')
1055endif
1056
Paolo Bonzinif15bff22019-07-18 13:19:02 +02001057if 'CONFIG_GUEST_AGENT' in config_host
1058 subdir('qga')
1059endif
1060
Paolo Bonzini931049b2020-02-05 09:44:24 +01001061if have_tools
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +04001062 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
1063 dependencies: [authz, block, crypto, io, qom, qemuutil], install: true)
1064 qemu_io = executable('qemu-io', files('qemu-io.c'),
1065 dependencies: [block, qemuutil], install: true)
Paolo Bonzinid3ca5922020-01-28 14:49:18 +01001066 qemu_block_tools = [qemu_img, qemu_io]
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +04001067 if targetos == 'linux' or targetos == 'sunos' or targetos.endswith('bsd')
1068 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
1069 dependencies: [block, qemuutil], install: true)
Paolo Bonzinid3ca5922020-01-28 14:49:18 +01001070 qemu_block_tools += [qemu_nbd]
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +04001071 endif
1072
Paolo Bonzini7c58bb72020-08-04 20:18:36 +02001073 subdir('storage-daemon')
Paolo Bonzinia9c97272019-06-10 12:27:52 +02001074 subdir('contrib/rdmacm-mux')
Marc-André Lureau1d7bb6a2019-07-12 23:47:06 +04001075 subdir('contrib/elf2dmp')
Paolo Bonzinia9c97272019-06-10 12:27:52 +02001076
Marc-André Lureauade60d42019-07-15 14:48:31 +04001077 if 'CONFIG_XKBCOMMON' in config_host
1078 executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c'),
1079 dependencies: [qemuutil, xkbcommon], install: true)
1080 endif
1081
Marc-André Lureau157e7b12019-07-15 14:50:58 +04001082 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
1083 dependencies: qemuutil,
1084 install: true)
1085
Paolo Bonzini931049b2020-02-05 09:44:24 +01001086 if 'CONFIG_VHOST_USER' in config_host
1087 subdir('contrib/libvhost-user')
Paolo Bonzini2d7ac0a2019-06-10 12:18:02 +02001088 subdir('contrib/vhost-user-blk')
Marc-André Lureauea458962019-07-12 22:23:46 +04001089 if 'CONFIG_LINUX' in config_host
1090 subdir('contrib/vhost-user-gpu')
1091 endif
Marc-André Lureau32fcc622019-07-12 22:11:20 +04001092 subdir('contrib/vhost-user-input')
Paolo Bonzini99650b62019-06-10 12:21:14 +02001093 subdir('contrib/vhost-user-scsi')
Paolo Bonzini931049b2020-02-05 09:44:24 +01001094 endif
Marc-André Lureau8f51e012019-07-15 14:39:25 +04001095
1096 if targetos == 'linux'
1097 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
1098 dependencies: [qemuutil, libcap_ng],
1099 install: true,
1100 install_dir: get_option('libexecdir'))
Marc-André Lureau897b5af2019-07-16 21:54:15 +04001101
1102 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
1103 dependencies: [authz, crypto, io, qom, qemuutil,
1104 libcap_ng, libudev, libmpathpersist],
1105 install: true)
Marc-André Lureau8f51e012019-07-15 14:39:25 +04001106 endif
1107
Marc-André Lureau5ee24e72019-07-12 23:16:54 +04001108 if 'CONFIG_IVSHMEM' in config_host
1109 subdir('contrib/ivshmem-client')
1110 subdir('contrib/ivshmem-server')
1111 endif
Paolo Bonzini931049b2020-02-05 09:44:24 +01001112endif
1113
Paolo Bonzini3f99cf52020-02-05 09:45:39 +01001114subdir('tools')
Marc-André Lureaubdcbea72019-07-15 21:22:31 +04001115subdir('pc-bios')
Paolo Bonzinice1c1e72020-01-28 16:41:44 +01001116subdir('tests')
Paolo Bonzinif8aa24e2020-08-05 15:49:10 +02001117subdir('docs')
Marc-André Lureaue8f3bd72019-09-19 21:02:09 +04001118if 'CONFIG_GTK' in config_host
1119 subdir('po')
1120endif
Paolo Bonzini3f99cf52020-02-05 09:45:39 +01001121
Paolo Bonziniacfdaac2020-08-05 13:07:48 +02001122if build_docs
1123 makeinfo = find_program('makeinfo', required: build_docs)
1124
1125 docs_inc = [
1126 '-I', meson.current_source_dir(),
1127 '-I', meson.current_build_dir() / 'docs',
1128 '-I', '@OUTDIR@',
1129 ]
1130
1131 version_texi = configure_file(output: 'version.texi',
1132 input: 'version.texi.in',
1133 configuration: {'VERSION': meson.project_version(),
1134 'qemu_confdir': config_host['qemu_confdir']})
1135
1136 texi = {
1137 'qemu-qmp-ref': ['docs/interop/qemu-qmp-ref.texi', qapi_doc_texi, version_texi],
1138 }
1139 if 'CONFIG_GUEST_AGENT' in config_host
1140 texi += {'qemu-ga-ref': ['docs/interop/qemu-ga-ref.texi', qga_qapi_doc_texi, version_texi]}
1141 endif
1142
1143 if makeinfo.found()
1144 cmd = [
1145 'env', 'LC_ALL=C', makeinfo, '--no-split', '--number-sections', docs_inc,
1146 '@INPUT0@', '-o', '@OUTPUT@',
1147 ]
1148 foreach ext, args: {
1149 'info': [],
1150 'html': ['--no-headers', '--html'],
1151 'txt': ['--no-headers', '--plaintext'],
1152 }
1153 t = []
1154 foreach doc, input: texi
1155 output = doc + '.' + ext
1156 t += custom_target(output,
1157 input: input,
1158 output: output,
1159 install: true,
1160 install_dir: config_host['qemu_docdir'] / 'interop',
1161 command: cmd + args)
1162 endforeach
1163 alias_target(ext, t)
1164 endforeach
1165 endif
1166
1167 texi2pdf = find_program('texi2pdf', required: false)
1168
1169 if texi2pdf.found()
1170 pdfs = []
1171 foreach doc, input: texi
1172 output = doc + '.pdf'
1173 pdfs += custom_target(output,
1174 input: input,
1175 output: output,
1176 command: [texi2pdf, '-q', docs_inc, '@INPUT0@', '-o', '@OUTPUT@'],
1177 build_by_default: false)
1178 endforeach
1179 alias_target('pdf', pdfs)
1180 endif
1181
1182 texi2pod = find_program('scripts/texi2pod.pl')
1183 pod2man = find_program('pod2man', required: build_docs)
1184
1185 if pod2man.found()
1186 foreach doc, input: texi
1187 man = doc + '.7'
1188 pod = custom_target(man + '.pod',
1189 input: input,
1190 output: man + '.pod',
1191 command: [texi2pod,
1192 '-DVERSION="' + meson.project_version() + '"',
1193 '-DCONFDIR="' + config_host['qemu_confdir'] + '"',
1194 '@INPUT0@', '@OUTPUT@'])
1195 man = custom_target(man,
1196 input: pod,
1197 output: man,
1198 capture: true,
1199 install: true,
1200 install_dir: config_host['mandir'] / 'man7',
1201 command: [pod2man, '--utf8', '--section=7', '--center=" "',
1202 '--release=" "', '@INPUT@'])
1203 endforeach
1204 endif
1205endif
1206
Paolo Bonzinif9332752020-02-03 13:28:38 +01001207summary_info = {}
1208summary_info += {'Install prefix': config_host['prefix']}
1209summary_info += {'BIOS directory': config_host['qemu_datadir']}
1210summary_info += {'firmware path': config_host['qemu_firmwarepath']}
1211summary_info += {'binary directory': config_host['bindir']}
1212summary_info += {'library directory': config_host['libdir']}
1213summary_info += {'module directory': config_host['qemu_moddir']}
1214summary_info += {'libexec directory': config_host['libexecdir']}
1215summary_info += {'include directory': config_host['includedir']}
1216summary_info += {'config directory': config_host['sysconfdir']}
1217if targetos != 'windows'
1218 summary_info += {'local state directory': config_host['qemu_localstatedir']}
1219 summary_info += {'Manual directory': config_host['mandir']}
1220else
1221 summary_info += {'local state directory': 'queried at runtime'}
1222endif
1223summary_info += {'Build directory': meson.current_build_dir()}
1224summary_info += {'Source path': meson.current_source_dir()}
1225summary_info += {'GIT binary': config_host['GIT']}
1226summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
1227summary_info += {'C compiler': meson.get_compiler('c').cmd_array()[0]}
1228summary_info += {'Host C compiler': meson.get_compiler('c', native: true).cmd_array()[0]}
1229if link_language == 'cpp'
1230 summary_info += {'C++ compiler': meson.get_compiler('cpp').cmd_array()[0]}
1231else
1232 summary_info += {'C++ compiler': false}
1233endif
1234if targetos == 'darwin'
1235 summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
1236endif
1237summary_info += {'ARFLAGS': config_host['ARFLAGS']}
1238summary_info += {'CFLAGS': config_host['CFLAGS']}
1239summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
1240summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
1241summary_info += {'make': config_host['MAKE']}
1242summary_info += {'install': config_host['INSTALL']}
1243summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
1244summary_info += {'sphinx-build': config_host['SPHINX_BUILD']}
1245summary_info += {'genisoimage': config_host['GENISOIMAGE']}
1246# TODO: add back version
1247summary_info += {'slirp support': config_host.has_key('CONFIG_SLIRP')}
1248if config_host.has_key('CONFIG_SLIRP')
1249 summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']}
1250endif
1251summary_info += {'module support': config_host.has_key('CONFIG_MODULES')}
1252if config_host.has_key('CONFIG_MODULES')
1253 summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')}
1254endif
1255summary_info += {'host CPU': cpu}
1256summary_info += {'host endianness': build_machine.endian()}
1257summary_info += {'target list': config_host['TARGET_DIRS']}
1258summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')}
1259summary_info += {'sparse enabled': meson.get_compiler('c').cmd_array().contains('cgcc')}
1260summary_info += {'strip binaries': get_option('strip')}
1261summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
1262summary_info += {'static build': config_host.has_key('CONFIG_TOOLS')}
1263if targetos == 'darwin'
1264 summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
1265endif
1266# TODO: add back version
Paolo Bonzini35be72b2020-02-06 14:17:15 +01001267summary_info += {'SDL support': sdl.found()}
1268summary_info += {'SDL image support': sdl_image.found()}
Paolo Bonzinif9332752020-02-03 13:28:38 +01001269# TODO: add back version
1270summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
1271summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')}
1272# TODO: add back version
1273summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
1274summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
1275summary_info += {'GNUTLS support': config_host.has_key('CONFIG_GNUTLS')}
1276# TODO: add back version
1277summary_info += {'libgcrypt': config_host.has_key('CONFIG_GCRYPT')}
1278if config_host.has_key('CONFIG_GCRYPT')
1279 summary_info += {' hmac': config_host.has_key('CONFIG_GCRYPT_HMAC')}
1280 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1281endif
1282# TODO: add back version
1283summary_info += {'nettle': config_host.has_key('CONFIG_NETTLE')}
1284if config_host.has_key('CONFIG_NETTLE')
1285 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1286endif
1287summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')}
1288summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')}
1289summary_info += {'iconv support': config_host.has_key('CONFIG_ICONV')}
1290summary_info += {'curses support': config_host.has_key('CONFIG_CURSES')}
1291# TODO: add back version
1292summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')}
1293summary_info += {'curl support': config_host.has_key('CONFIG_CURL')}
1294summary_info += {'mingw32 support': targetos == 'windows'}
1295summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']}
1296summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
1297summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
1298summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')}
1299summary_info += {'Multipath support': config_host.has_key('CONFIG_MPATH')}
Paolo Bonzinia0b93232020-02-06 15:48:52 +01001300summary_info += {'VNC support': vnc.found()}
1301if vnc.found()
1302 summary_info += {'VNC SASL support': sasl.found()}
1303 summary_info += {'VNC JPEG support': jpeg.found()}
1304 summary_info += {'VNC PNG support': png.found()}
Paolo Bonzinif9332752020-02-03 13:28:38 +01001305endif
1306summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')}
1307if config_host.has_key('CONFIG_XEN_BACKEND')
1308 summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
1309endif
1310summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')}
1311summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')}
1312summary_info += {'PIE': get_option('b_pie')}
1313summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
1314summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
1315summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
1316summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
1317summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')}
1318summary_info += {'Install blobs': config_host.has_key('INSTALL_BLOBS')}
1319# TODO: add back KVM/HAX/HVF/WHPX/TCG
1320#summary_info += {'KVM support': have_kvm'}
1321#summary_info += {'HAX support': have_hax'}
1322#summary_info += {'HVF support': have_hvf'}
1323#summary_info += {'WHPX support': have_whpx'}
1324#summary_info += {'TCG support': have_tcg'}
1325#if get_option('tcg')
1326# summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
1327# summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')}
1328#endif
1329summary_info += {'malloc trim support': config_host.has_key('CONFIG_MALLOC_TRIM')}
1330summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
1331summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}
1332summary_info += {'fdt support': config_host.has_key('CONFIG_FDT')}
1333summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')}
1334summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')}
1335summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')}
1336summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')}
1337summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}
1338summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')}
1339summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')}
1340summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
1341summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
1342summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
1343summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
1344summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')}
1345summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
1346summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
1347summary_info += {'Trace backends': config_host['TRACE_BACKENDS']}
1348if config_host['TRACE_BACKENDS'].split().contains('simple')
1349 summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
1350endif
1351# TODO: add back protocol and server version
1352summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
1353summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')}
1354summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')}
1355summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
1356summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')}
1357summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')}
1358summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
1359summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')}
1360summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')}
1361summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')}
1362summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
1363if targetos == 'windows'
1364 if 'WIN_SDK' in config_host
1365 summary_info += {'Windows SDK': config_host['WIN_SDK']}
1366 endif
1367 summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')}
1368 summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
1369 summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI_ENABLED')}
1370endif
1371summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')}
1372summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
1373summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'}
1374summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
1375summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')}
1376summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')}
1377summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')}
Marc-André Lureaubf0e56a2019-10-04 17:35:16 +04001378summary_info += {'gcov': get_option('b_coverage')}
Paolo Bonzinif9332752020-02-03 13:28:38 +01001379summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')}
1380summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')}
1381summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
1382summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
1383summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')}
1384summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')}
1385summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')}
1386summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')}
1387summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')}
1388summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
1389summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}
1390summary_info += {'tcmalloc support': config_host.has_key('CONFIG_TCMALLOC')}
1391summary_info += {'jemalloc support': config_host.has_key('CONFIG_JEMALLOC')}
1392summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
1393summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
1394summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
1395summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')}
1396summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')}
1397summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')}
1398summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')}
1399summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')}
1400summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')}
1401summary_info += {'qed support': config_host.has_key('CONFIG_QED')}
1402summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
1403summary_info += {'sheepdog support': config_host.has_key('CONFIG_SHEEPDOG')}
1404summary_info += {'capstone': config_host.has_key('CONFIG_CAPSTONE')}
1405summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')}
1406summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
1407summary_info += {'libudev': config_host.has_key('CONFIG_LIBUDEV')}
1408summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'}
1409summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')}
1410summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')}
1411if config_host.has_key('HAVE_GDB_BIN')
1412 summary_info += {'gdb': config_host['HAVE_GDB_BIN']}
1413endif
1414summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')}
1415summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')}
1416summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')}
1417summary(summary_info, bool_yn: true)
1418
1419if not supported_cpus.contains(cpu)
1420 message()
1421 warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
1422 message()
1423 message('CPU host architecture ' + cpu + ' support is not currently maintained.')
1424 message('The QEMU project intends to remove support for this host CPU in')
1425 message('a future release if nobody volunteers to maintain it and to')
1426 message('provide a build host for our continuous integration setup.')
1427 message('configure has succeeded and you can continue to build, but')
1428 message('if you care about QEMU on this platform you should contact')
1429 message('us upstream at qemu-devel@nongnu.org.')
1430endif
1431
1432if not supported_oses.contains(targetos)
1433 message()
1434 warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!')
1435 message()
1436 message('Host OS ' + targetos + 'support is not currently maintained.')
1437 message('The QEMU project intends to remove support for this host OS in')
1438 message('a future release if nobody volunteers to maintain it and to')
1439 message('provide a build host for our continuous integration setup.')
1440 message('configure has succeeded and you can continue to build, but')
1441 message('if you care about QEMU on this platform you should contact')
1442 message('us upstream at qemu-devel@nongnu.org.')
1443endif