blob: 86a6d1319222e0d33eb133375b8780cf4302b698 [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)
Paolo Bonzinib29b40f2020-08-10 18:04:43 +02006if meson.version().version_compare('>=0.56.0')
7 keyval = import('keyval')
8else
9 keyval = import('unstable-keyval')
10endif
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040011ss = import('sourceset')
12
Paolo Bonzinice1c1e72020-01-28 16:41:44 +010013sh = find_program('sh')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040014cc = meson.get_compiler('c')
Paolo Bonzinia5665052019-06-10 12:05:14 +020015config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
Paolo Bonzini2becc362020-02-03 11:42:03 +010016config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak')
Marc-André Lureau3154fee2019-08-29 22:07:01 +040017enable_modules = 'CONFIG_MODULES' in config_host
Paolo Bonzini35be72b2020-02-06 14:17:15 +010018enable_static = 'CONFIG_STATIC' in config_host
Paolo Bonzinif8aa24e2020-08-05 15:49:10 +020019build_docs = 'BUILD_DOCS' in config_host
Paolo Bonzini859aef02020-08-04 18:14:26 +020020config_host_data = configuration_data()
21genh = []
Paolo Bonzinia5665052019-06-10 12:05:14 +020022
23add_project_arguments(config_host['QEMU_CFLAGS'].split(),
24 native: false, language: ['c', 'objc'])
25add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
26 native: false, language: 'cpp')
27add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
28 native: false, language: ['c', 'cpp', 'objc'])
29add_project_arguments(config_host['QEMU_INCLUDES'].split(),
30 language: ['c', 'cpp', 'objc'])
31
Marc-André Lureaufc929892019-07-13 01:47:54 +040032python = import('python').find_installation()
33
34link_language = meson.get_external_property('link_language', 'cpp')
35if link_language == 'cpp'
36 add_languages('cpp', required: true, native: false)
37endif
Paolo Bonzinia5665052019-06-10 12:05:14 +020038if host_machine.system() == 'darwin'
39 add_languages('objc', required: false, native: false)
40endif
41
Paolo Bonzini968b4db2020-02-03 14:45:33 +010042if 'SPARSE_CFLAGS' in config_host
43 run_target('sparse',
44 command: [find_program('scripts/check_sparse.py'),
45 config_host['SPARSE_CFLAGS'].split(),
46 'compile_commands.json'])
47endif
48
Paolo Bonzinia5665052019-06-10 12:05:14 +020049configure_file(input: files('scripts/ninjatool.py'),
50 output: 'ninjatool',
51 configuration: config_host)
Paolo Bonzinif9332752020-02-03 13:28:38 +010052
53supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
54supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
55 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
56
57cpu = host_machine.cpu_family()
58targetos = host_machine.system()
59
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040060m = cc.find_library('m', required: false)
61util = cc.find_library('util', required: false)
Paolo Bonzini4a963372020-08-03 16:22:28 +020062winmm = []
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040063socket = []
Marc-André Lureau04c6f1e2019-07-18 00:31:05 +040064version_res = []
Marc-André Lureaud92989a2019-08-20 19:48:59 +040065coref = []
66iokit = []
67cocoa = []
68hvf = []
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040069if targetos == 'windows'
70 socket = cc.find_library('ws2_32')
Paolo Bonzini4a963372020-08-03 16:22:28 +020071 winmm = cc.find_library('winmm')
Marc-André Lureau04c6f1e2019-07-18 00:31:05 +040072
73 win = import('windows')
74 version_res = win.compile_resources('version.rc',
75 depend_files: files('pc-bios/qemu-nsis.ico'),
76 include_directories: include_directories('.'))
Marc-André Lureaud92989a2019-08-20 19:48:59 +040077elif targetos == 'darwin'
78 coref = dependency('appleframeworks', modules: 'CoreFoundation')
79 iokit = dependency('appleframeworks', modules: 'IOKit')
80 cocoa = dependency('appleframeworks', modules: 'Cocoa')
81 hvf = dependency('appleframeworks', modules: 'Hypervisor')
Paolo Bonzinicfad62f2020-08-09 23:47:45 +020082elif targetos == 'sunos'
83 socket = [cc.find_library('socket'),
84 cc.find_library('nsl'),
85 cc.find_library('resolv')]
86elif targetos == 'haiku'
87 socket = [cc.find_library('posix_error_mapper'),
88 cc.find_library('network'),
89 cc.find_library('bsd')]
Paolo Bonzinia81df1b2020-08-19 08:44:56 -040090endif
91glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
92 link_args: config_host['GLIB_LIBS'].split())
93gio = not_found
94if 'CONFIG_GIO' in config_host
95 gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
96 link_args: config_host['GIO_LIBS'].split())
97endif
98lttng = not_found
99if 'CONFIG_TRACE_UST' in config_host
100 lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split())
101endif
102urcubp = not_found
103if 'CONFIG_TRACE_UST' in config_host
104 urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split())
105endif
106nettle = not_found
107if 'CONFIG_NETTLE' in config_host
108 nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(),
109 link_args: config_host['NETTLE_LIBS'].split())
110endif
111gnutls = not_found
112if 'CONFIG_GNUTLS' in config_host
113 gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
114 link_args: config_host['GNUTLS_LIBS'].split())
115endif
Paolo Bonzinib7612f42020-08-26 08:22:58 +0200116pixman = not_found
117if have_system or have_tools
118 pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
119 static: enable_static)
120endif
Marc-André Lureau5e7fbd22019-07-15 22:54:34 +0400121pam = not_found
122if 'CONFIG_AUTH_PAM' in config_host
123 pam = cc.find_library('pam')
124endif
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400125libaio = cc.find_library('aio', required: false)
126zlib = not_found
127if 'CONFIG_ZLIB' in config_host
128 zlib = declare_dependency(compile_args: config_host['ZLIB_CFLAGS'].split(),
129 link_args: config_host['ZLIB_LIBS'].split())
130endif
131linux_io_uring = not_found
132if 'CONFIG_LINUX_IO_URING' in config_host
133 linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(),
134 link_args: config_host['LINUX_IO_URING_LIBS'].split())
135endif
136libxml2 = not_found
137if 'CONFIG_LIBXML2' in config_host
138 libxml2 = declare_dependency(compile_args: config_host['LIBXML2_CFLAGS'].split(),
139 link_args: config_host['LIBXML2_LIBS'].split())
140endif
141libnfs = not_found
142if 'CONFIG_LIBNFS' in config_host
143 libnfs = declare_dependency(link_args: config_host['LIBNFS_LIBS'].split())
144endif
Marc-André Lureauec0d5892019-07-15 15:04:49 +0400145libattr = not_found
146if 'CONFIG_ATTR' in config_host
147 libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split())
148endif
Paolo Bonzini3f99cf52020-02-05 09:45:39 +0100149seccomp = not_found
150if 'CONFIG_SECCOMP' in config_host
151 seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(),
152 link_args: config_host['SECCOMP_LIBS'].split())
153endif
154libcap_ng = not_found
155if 'CONFIG_LIBCAP_NG' in config_host
156 libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split())
157endif
Laurent Vivier4113f4c2020-08-24 17:24:29 +0200158xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'), static: enable_static,
159 include_type: 'system')
160if xkbcommon.found()
161 xkbcommon = declare_dependency(dependencies: xkbcommon)
Marc-André Lureauade60d42019-07-15 14:48:31 +0400162endif
Marc-André Lureaucdaf0722019-07-22 23:47:50 +0400163slirp = not_found
164if config_host.has_key('CONFIG_SLIRP')
165 slirp = declare_dependency(compile_args: config_host['SLIRP_CFLAGS'].split(),
166 link_args: config_host['SLIRP_LIBS'].split())
167endif
168vde = not_found
169if config_host.has_key('CONFIG_VDE')
170 vde = declare_dependency(link_args: config_host['VDE_LIBS'].split())
171endif
Paolo Bonzini478e9432020-08-17 12:47:55 +0200172pulse = not_found
173if 'CONFIG_LIBPULSE' in config_host
174 pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(),
175 link_args: config_host['PULSE_LIBS'].split())
176endif
177alsa = not_found
178if 'CONFIG_ALSA' in config_host
179 alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(),
180 link_args: config_host['ALSA_LIBS'].split())
181endif
182jack = not_found
183if 'CONFIG_LIBJACK' in config_host
184 jack = declare_dependency(link_args: config_host['JACK_LIBS'].split())
185endif
Paolo Bonzini26347332019-07-29 15:40:07 +0200186spice = not_found
187if 'CONFIG_SPICE' in config_host
188 spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(),
189 link_args: config_host['SPICE_LIBS'].split())
190endif
Marc-André Lureau5ee24e72019-07-12 23:16:54 +0400191rt = cc.find_library('rt', required: false)
Marc-André Lureau897b5af2019-07-16 21:54:15 +0400192libmpathpersist = not_found
193if config_host.has_key('CONFIG_MPATH')
194 libmpathpersist = cc.find_library('mpathpersist')
195endif
Paolo Bonzini99650b62019-06-10 12:21:14 +0200196libiscsi = not_found
197if 'CONFIG_LIBISCSI' in config_host
198 libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(),
199 link_args: config_host['LIBISCSI_LIBS'].split())
200endif
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400201zstd = not_found
202if 'CONFIG_ZSTD' in config_host
203 zstd = declare_dependency(compile_args: config_host['ZSTD_CFLAGS'].split(),
204 link_args: config_host['ZSTD_LIBS'].split())
205endif
Marc-André Lureauea458962019-07-12 22:23:46 +0400206gbm = not_found
207if 'CONFIG_GBM' in config_host
208 gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
209 link_args: config_host['GBM_LIBS'].split())
210endif
211virgl = not_found
212if 'CONFIG_VIRGL' in config_host
213 virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(),
214 link_args: config_host['VIRGL_LIBS'].split())
215endif
Marc-André Lureau1d7bb6a2019-07-12 23:47:06 +0400216curl = not_found
217if 'CONFIG_CURL' in config_host
218 curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(),
219 link_args: config_host['CURL_LIBS'].split())
220endif
Paolo Bonzinif15bff22019-07-18 13:19:02 +0200221libudev = not_found
222if 'CONFIG_LIBUDEV' in config_host
223 libudev = declare_dependency(link_args: config_host['LIBUDEV_LIBS'].split())
224endif
Paolo Bonzini26347332019-07-29 15:40:07 +0200225brlapi = not_found
226if 'CONFIG_BRLAPI' in config_host
227 brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
228endif
Paolo Bonzini35be72b2020-02-06 14:17:15 +0100229
230sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static,
231 include_type: 'system')
232sdl_image = not_found
233if sdl.found()
234 # work around 2.0.8 bug
235 sdl = declare_dependency(compile_args: '-Wno-undef',
236 dependencies: sdl)
237 sdl_image = dependency('sdl-image', required: get_option('sdl_image'),
238 static: enable_static)
239else
240 if get_option('sdl_image').enabled()
241 error('sdl-image required, but SDL was @0@',
242 get_option('sdl').disabled() ? 'disabled' : 'not found')
243 endif
244 sdl_image = not_found
Paolo Bonzini26347332019-07-29 15:40:07 +0200245endif
Paolo Bonzini35be72b2020-02-06 14:17:15 +0100246
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400247rbd = not_found
248if 'CONFIG_RBD' in config_host
249 rbd = declare_dependency(link_args: config_host['RBD_LIBS'].split())
250endif
251glusterfs = not_found
252if 'CONFIG_GLUSTERFS' in config_host
253 glusterfs = declare_dependency(compile_args: config_host['GLUSTERFS_CFLAGS'].split(),
254 link_args: config_host['GLUSTERFS_LIBS'].split())
255endif
256libssh = not_found
257if 'CONFIG_LIBSSH' in config_host
258 libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
259 link_args: config_host['LIBSSH_LIBS'].split())
260endif
261libbzip2 = not_found
262if 'CONFIG_BZIP2' in config_host
263 libbzip2 = declare_dependency(link_args: config_host['BZIP2_LIBS'].split())
264endif
265liblzfse = not_found
266if 'CONFIG_LZFSE' in config_host
267 liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split())
268endif
Paolo Bonzini478e9432020-08-17 12:47:55 +0200269oss = not_found
270if 'CONFIG_AUDIO_OSS' in config_host
271 oss = declare_dependency(link_args: config_host['OSS_LIBS'].split())
272endif
273dsound = not_found
274if 'CONFIG_AUDIO_DSOUND' in config_host
275 dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split())
276endif
277coreaudio = not_found
278if 'CONFIG_AUDIO_COREAUDIO' in config_host
279 coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split())
280endif
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400281opengl = not_found
282if 'CONFIG_OPENGL' in config_host
283 opengl = declare_dependency(link_args: config_host['OPENGL_LIBS'].split())
284else
285endif
286gtk = not_found
287if 'CONFIG_GTK' in config_host
288 gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(),
289 link_args: config_host['GTK_LIBS'].split())
290endif
291vte = not_found
292if 'CONFIG_VTE' in config_host
293 vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(),
294 link_args: config_host['VTE_LIBS'].split())
295endif
296x11 = not_found
297if 'CONFIG_X11' in config_host
298 x11 = declare_dependency(compile_args: config_host['X11_CFLAGS'].split(),
299 link_args: config_host['X11_LIBS'].split())
300endif
301curses = not_found
302if 'CONFIG_CURSES' in config_host
303 curses = declare_dependency(compile_args: config_host['CURSES_CFLAGS'].split(),
304 link_args: config_host['CURSES_LIBS'].split())
305endif
306iconv = not_found
307if 'CONFIG_ICONV' in config_host
308 iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(),
309 link_args: config_host['ICONV_LIBS'].split())
310endif
311gio = not_found
312if 'CONFIG_GIO' in config_host
313 gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
314 link_args: config_host['GIO_LIBS'].split())
315endif
Paolo Bonzinia0b93232020-02-06 15:48:52 +0100316vnc = not_found
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400317png = not_found
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400318jpeg = not_found
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400319sasl = not_found
Paolo Bonzinia0b93232020-02-06 15:48:52 +0100320if get_option('vnc').enabled()
321 vnc = declare_dependency() # dummy dependency
322 png = dependency('libpng', required: get_option('vnc_png'),
323 static: enable_static)
324 jpeg = cc.find_library('jpeg', has_headers: ['jpeglib.h'],
325 required: get_option('vnc_jpeg'),
326 static: enable_static)
327 sasl = cc.find_library('sasl2', has_headers: ['sasl/sasl.h'],
328 required: get_option('vnc_sasl'),
329 static: enable_static)
330 if sasl.found()
331 sasl = declare_dependency(dependencies: sasl,
332 compile_args: '-DSTRUCT_IOVEC_DEFINED')
333 endif
Marc-André Lureau2b1ccdf2019-07-16 23:21:02 +0400334endif
Paolo Bonzini4a963372020-08-03 16:22:28 +0200335fdt = not_found
336if 'CONFIG_FDT' in config_host
337 fdt = declare_dependency(compile_args: config_host['FDT_CFLAGS'].split(),
338 link_args: config_host['FDT_LIBS'].split())
339endif
Marc-André Lureau708eab42019-09-03 16:59:33 +0400340snappy = not_found
341if 'CONFIG_SNAPPY' in config_host
342 snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split())
343endif
344lzo = not_found
345if 'CONFIG_LZO' in config_host
346 lzo = declare_dependency(link_args: config_host['LZO_LIBS'].split())
347endif
Marc-André Lureau55166232019-07-24 19:16:22 +0400348rdma = not_found
349if 'CONFIG_RDMA' in config_host
350 rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
351endif
Marc-André Lureauab318052019-07-24 19:23:16 +0400352numa = not_found
353if 'CONFIG_NUMA' in config_host
354 numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split())
355endif
Marc-André Lureau582ea952019-08-15 15:15:32 +0400356xen = not_found
357if 'CONFIG_XEN_BACKEND' in config_host
358 xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
359 link_args: config_host['XEN_LIBS'].split())
360endif
Paolo Bonzini06677ce2020-08-06 13:07:39 +0200361cacard = not_found
362if 'CONFIG_SMARTCARD' in config_host
363 cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(),
364 link_args: config_host['SMARTCARD_LIBS'].split())
365endif
366usbredir = not_found
367if 'CONFIG_USB_REDIR' in config_host
368 usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(),
369 link_args: config_host['USB_REDIR_LIBS'].split())
370endif
371libusb = not_found
372if 'CONFIG_USB_LIBUSB' in config_host
373 libusb = declare_dependency(compile_args: config_host['LIBUSB_CFLAGS'].split(),
374 link_args: config_host['LIBUSB_LIBS'].split())
375endif
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400376capstone = not_found
377if 'CONFIG_CAPSTONE' in config_host
378 capstone = declare_dependency(compile_args: config_host['CAPSTONE_CFLAGS'].split(),
379 link_args: config_host['CAPSTONE_LIBS'].split())
380endif
381libpmem = not_found
382if 'CONFIG_LIBPMEM' in config_host
383 libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(),
384 link_args: config_host['LIBPMEM_LIBS'].split())
385endif
Bruce Rogersc7c91a72020-08-24 09:52:12 -0600386libdaxctl = not_found
387if 'CONFIG_LIBDAXCTL' in config_host
388 libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split())
389endif
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400390
Paolo Bonzini859aef02020-08-04 18:14:26 +0200391# Create config-host.h
392
Paolo Bonzini35be72b2020-02-06 14:17:15 +0100393config_host_data.set('CONFIG_SDL', sdl.found())
394config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
Paolo Bonzinia0b93232020-02-06 15:48:52 +0100395config_host_data.set('CONFIG_VNC', vnc.found())
396config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
397config_host_data.set('CONFIG_VNC_PNG', png.found())
398config_host_data.set('CONFIG_VNC_SASL', sasl.found())
Laurent Vivier4113f4c2020-08-24 17:24:29 +0200399config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found())
Paolo Bonzini859aef02020-08-04 18:14:26 +0200400config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version()))
401config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0])
402config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
403config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2])
404
405arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
406strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'qemu_confdir', 'qemu_datadir',
407 'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir',
408 'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath']
409foreach k, v: config_host
410 if arrays.contains(k)
411 if v != ''
412 v = '"' + '", "'.join(v.split()) + '", '
413 endif
414 config_host_data.set(k, v)
415 elif k == 'ARCH'
416 config_host_data.set('HOST_' + v.to_upper(), 1)
417 elif strings.contains(k)
418 if not k.startswith('CONFIG_')
419 k = 'CONFIG_' + k.to_upper()
420 endif
421 config_host_data.set_quoted(k, v)
422 elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_')
423 config_host_data.set(k, v == 'y' ? 1 : v)
424 endif
425endforeach
426genh += configure_file(output: 'config-host.h', configuration: config_host_data)
427
Paolo Bonzini2becc362020-02-03 11:42:03 +0100428minikconf = find_program('scripts/minikconf.py')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400429target_dirs = config_host['TARGET_DIRS'].split()
430have_user = false
431have_system = false
Paolo Bonzini2becc362020-02-03 11:42:03 +0100432config_devices_mak_list = []
433config_devices_h = {}
Paolo Bonzini859aef02020-08-04 18:14:26 +0200434config_target_h = {}
Paolo Bonzini2becc362020-02-03 11:42:03 +0100435config_target_mak = {}
436kconfig_external_symbols = [
437 'CONFIG_KVM',
438 'CONFIG_XEN',
439 'CONFIG_TPM',
440 'CONFIG_SPICE',
441 'CONFIG_IVSHMEM',
442 'CONFIG_OPENGL',
443 'CONFIG_X11',
444 'CONFIG_VHOST_USER',
445 'CONFIG_VHOST_KERNEL',
446 'CONFIG_VIRTFS',
447 'CONFIG_LINUX',
448 'CONFIG_PVRDMA',
449]
Paolo Bonzini859aef02020-08-04 18:14:26 +0200450ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS']
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400451foreach target : target_dirs
452 have_user = have_user or target.endswith('-user')
Paolo Bonzini859aef02020-08-04 18:14:26 +0200453 config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak')
454
455 config_target_data = configuration_data()
456 foreach k, v: config_target
457 if not k.startswith('TARGET_') and not k.startswith('CONFIG_')
458 # do nothing
459 elif ignored.contains(k)
460 # do nothing
461 elif k == 'TARGET_BASE_ARCH'
462 config_target_data.set('TARGET_' + v.to_upper(), 1)
463 elif k == 'TARGET_NAME'
464 config_target_data.set_quoted(k, v)
465 elif v == 'y'
466 config_target_data.set(k, 1)
467 else
468 config_target_data.set(k, v)
469 endif
470 endforeach
471 config_target_h += {target: configure_file(output: target + '-config-target.h',
472 configuration: config_target_data)}
Paolo Bonzini2becc362020-02-03 11:42:03 +0100473
474 if target.endswith('-softmmu')
475 have_system = true
476
477 base_kconfig = []
478 foreach sym : kconfig_external_symbols
Paolo Bonzini859aef02020-08-04 18:14:26 +0200479 if sym in config_target or sym in config_host
Paolo Bonzini2becc362020-02-03 11:42:03 +0100480 base_kconfig += '@0@=y'.format(sym)
481 endif
482 endforeach
483
484 config_devices_mak = target + '-config-devices.mak'
485 config_devices_mak = configure_file(
486 input: ['default-configs' / target + '.mak', 'Kconfig'],
487 output: config_devices_mak,
488 depfile: config_devices_mak + '.d',
489 capture: true,
490 command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'],
491 config_devices_mak, '@DEPFILE@', '@INPUT@',
492 base_kconfig])
Paolo Bonzini859aef02020-08-04 18:14:26 +0200493
494 config_devices_data = configuration_data()
495 config_devices = keyval.load(config_devices_mak)
496 foreach k, v: config_devices
497 config_devices_data.set(k, 1)
498 endforeach
Paolo Bonzini2becc362020-02-03 11:42:03 +0100499 config_devices_mak_list += config_devices_mak
Paolo Bonzini859aef02020-08-04 18:14:26 +0200500 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
501 configuration: config_devices_data)}
502 config_target += config_devices
Paolo Bonzini2becc362020-02-03 11:42:03 +0100503 endif
504 config_target_mak += {target: config_target}
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400505endforeach
506have_tools = 'CONFIG_TOOLS' in config_host
507have_block = have_system or have_tools
508
Paolo Bonzini2becc362020-02-03 11:42:03 +0100509grepy = find_program('scripts/grepy.sh')
510# This configuration is used to build files that are shared by
511# multiple binaries, and then extracted out of the "common"
512# static_library target.
513#
514# We do not use all_sources()/all_dependencies(), because it would
515# build literally all source files, including devices only used by
516# targets that are not built for this compilation. The CONFIG_ALL
517# pseudo symbol replaces it.
518
519if have_system
520 config_all_devices_mak = configure_file(
521 output: 'config-all-devices.mak',
522 input: config_devices_mak_list,
523 capture: true,
524 command: [grepy, '@INPUT@'],
525 )
526 config_all_devices = keyval.load(config_all_devices_mak)
527else
528 config_all_devices = {}
529endif
530config_all = config_all_devices
531config_all += config_host
532config_all += config_all_disas
533config_all += {
534 'CONFIG_XEN': config_host.has_key('CONFIG_XEN_BACKEND'),
535 'CONFIG_SOFTMMU': have_system,
536 'CONFIG_USER_ONLY': have_user,
537 'CONFIG_ALL': true,
538}
539
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400540# Generators
541
Marc-André Lureau3f885652019-07-15 18:06:04 +0400542hxtool = find_program('scripts/hxtool')
Marc-André Lureau650b5d52019-07-15 17:36:47 +0400543shaderinclude = find_program('scripts/shaderinclude.pl')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400544qapi_gen = find_program('scripts/qapi-gen.py')
545qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
546 meson.source_root() / 'scripts/qapi/commands.py',
547 meson.source_root() / 'scripts/qapi/common.py',
548 meson.source_root() / 'scripts/qapi/doc.py',
549 meson.source_root() / 'scripts/qapi/error.py',
550 meson.source_root() / 'scripts/qapi/events.py',
551 meson.source_root() / 'scripts/qapi/expr.py',
552 meson.source_root() / 'scripts/qapi/gen.py',
553 meson.source_root() / 'scripts/qapi/introspect.py',
554 meson.source_root() / 'scripts/qapi/parser.py',
555 meson.source_root() / 'scripts/qapi/schema.py',
556 meson.source_root() / 'scripts/qapi/source.py',
557 meson.source_root() / 'scripts/qapi/types.py',
558 meson.source_root() / 'scripts/qapi/visit.py',
559 meson.source_root() / 'scripts/qapi/common.py',
560 meson.source_root() / 'scripts/qapi/doc.py',
561 meson.source_root() / 'scripts/qapi-gen.py'
562]
563
564tracetool = [
565 python, files('scripts/tracetool.py'),
566 '--backend=' + config_host['TRACE_BACKENDS']
567]
568
Marc-André Lureau2c273f32019-07-15 17:10:19 +0400569qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
570 meson.current_source_dir(),
Paolo Bonzini859aef02020-08-04 18:14:26 +0200571 config_host['PKGVERSION'], meson.project_version()]
Marc-André Lureau2c273f32019-07-15 17:10:19 +0400572qemu_version = custom_target('qemu-version.h',
573 output: 'qemu-version.h',
574 command: qemu_version_cmd,
575 capture: true,
576 build_by_default: true,
577 build_always_stale: true)
578genh += qemu_version
579
Marc-André Lureau3f885652019-07-15 18:06:04 +0400580hxdep = []
581hx_headers = [
582 ['qemu-options.hx', 'qemu-options.def'],
583 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
584]
585if have_system
586 hx_headers += [
587 ['hmp-commands.hx', 'hmp-commands.h'],
588 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
589 ]
590endif
591foreach d : hx_headers
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +0400592 hxdep += custom_target(d[1],
Marc-André Lureau3f885652019-07-15 18:06:04 +0400593 input: files(d[0]),
594 output: d[1],
595 capture: true,
596 build_by_default: true, # to be removed when added to a target
597 command: [hxtool, '-h', '@INPUT0@'])
598endforeach
599genh += hxdep
600
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400601# Collect sourcesets.
602
603util_ss = ss.source_set()
604stub_ss = ss.source_set()
605trace_ss = ss.source_set()
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400606block_ss = ss.source_set()
Paolo Bonzini4a963372020-08-03 16:22:28 +0200607blockdev_ss = ss.source_set()
Paolo Bonziniff219dc2020-08-04 21:14:26 +0200608qmp_ss = ss.source_set()
Paolo Bonzini2becc362020-02-03 11:42:03 +0100609common_ss = ss.source_set()
610softmmu_ss = ss.source_set()
611user_ss = ss.source_set()
612bsd_user_ss = ss.source_set()
613linux_user_ss = ss.source_set()
614specific_ss = ss.source_set()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200615specific_fuzz_ss = ss.source_set()
Paolo Bonzini2becc362020-02-03 11:42:03 +0100616
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400617modules = {}
Paolo Bonzini2becc362020-02-03 11:42:03 +0100618hw_arch = {}
619target_arch = {}
620target_softmmu_arch = {}
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400621
622###############
623# Trace files #
624###############
625
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400626# TODO: add each directory to the subdirs from its own meson.build, once
627# we have those
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400628trace_events_subdirs = [
629 'accel/kvm',
630 'accel/tcg',
631 'crypto',
632 'monitor',
633]
634if have_user
635 trace_events_subdirs += [ 'linux-user' ]
636endif
637if have_block
638 trace_events_subdirs += [
639 'authz',
640 'block',
641 'io',
642 'nbd',
643 'scsi',
644 ]
645endif
646if have_system
647 trace_events_subdirs += [
648 'audio',
649 'backends',
650 'backends/tpm',
651 'chardev',
652 'hw/9pfs',
653 'hw/acpi',
654 'hw/alpha',
655 'hw/arm',
656 'hw/audio',
657 'hw/block',
658 'hw/block/dataplane',
659 'hw/char',
660 'hw/display',
661 'hw/dma',
662 'hw/hppa',
663 'hw/hyperv',
664 'hw/i2c',
665 'hw/i386',
666 'hw/i386/xen',
667 'hw/ide',
668 'hw/input',
669 'hw/intc',
670 'hw/isa',
671 'hw/mem',
672 'hw/mips',
673 'hw/misc',
674 'hw/misc/macio',
675 'hw/net',
676 'hw/nvram',
677 'hw/pci',
678 'hw/pci-host',
679 'hw/ppc',
680 'hw/rdma',
681 'hw/rdma/vmw',
682 'hw/rtc',
683 'hw/s390x',
684 'hw/scsi',
685 'hw/sd',
686 'hw/sparc',
687 'hw/sparc64',
688 'hw/ssi',
689 'hw/timer',
690 'hw/tpm',
691 'hw/usb',
692 'hw/vfio',
693 'hw/virtio',
694 'hw/watchdog',
695 'hw/xen',
696 'hw/gpio',
697 'hw/riscv',
698 'migration',
699 'net',
700 'ui',
701 ]
702endif
703trace_events_subdirs += [
704 'hw/core',
705 'qapi',
706 'qom',
707 'target/arm',
708 'target/hppa',
709 'target/i386',
710 'target/mips',
711 'target/ppc',
712 'target/riscv',
713 'target/s390x',
714 'target/sparc',
715 'util',
716]
717
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400718subdir('qapi')
719subdir('qobject')
720subdir('stubs')
721subdir('trace')
722subdir('util')
Marc-André Lureau5582c582019-07-16 19:28:54 +0400723subdir('qom')
724subdir('authz')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400725subdir('crypto')
Marc-André Lureau2d78b562019-07-15 16:00:36 +0400726subdir('ui')
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400727
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400728
729if enable_modules
730 libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO')
731 modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
732endif
733
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400734# Build targets from sourcesets
735
Paolo Bonzini2becc362020-02-03 11:42:03 +0100736stub_ss = stub_ss.apply(config_all, strict: false)
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400737
738util_ss.add_all(trace_ss)
Paolo Bonzini2becc362020-02-03 11:42:03 +0100739util_ss = util_ss.apply(config_all, strict: false)
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400740libqemuutil = static_library('qemuutil',
741 sources: util_ss.sources() + stub_ss.sources() + genh,
742 dependencies: [util_ss.dependencies(), m, glib, socket])
743qemuutil = declare_dependency(link_with: libqemuutil,
Marc-André Lureau04c6f1e2019-07-18 00:31:05 +0400744 sources: genh + version_res)
Paolo Bonzinia81df1b2020-08-19 08:44:56 -0400745
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200746decodetree = generator(find_program('scripts/decodetree.py'),
747 output: 'decode-@BASENAME@.c.inc',
748 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
749
Paolo Bonzini478e9432020-08-17 12:47:55 +0200750subdir('audio')
Marc-André Lureau7fcfd452019-07-16 19:33:55 +0400751subdir('io')
Marc-André Lureau848e8ff2019-07-15 23:18:07 +0400752subdir('chardev')
Marc-André Lureauec0d5892019-07-15 15:04:49 +0400753subdir('fsdev')
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200754subdir('libdecnumber')
Marc-André Lureaud3b18482019-08-17 14:55:32 +0400755subdir('target')
Marc-André Lureau708eab42019-09-03 16:59:33 +0400756subdir('dump')
Marc-André Lureauec0d5892019-07-15 15:04:49 +0400757
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400758block_ss.add(files(
759 'block.c',
760 'blockjob.c',
761 'job.c',
762 'qemu-io-cmds.c',
763))
764block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
765
766subdir('nbd')
767subdir('scsi')
768subdir('block')
769
Paolo Bonzini4a963372020-08-03 16:22:28 +0200770blockdev_ss.add(files(
771 'blockdev.c',
772 'blockdev-nbd.c',
773 'iothread.c',
774 'job-qmp.c',
775))
776
777# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
778# os-win32.c does not
779blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
780softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
781
782softmmu_ss.add_all(blockdev_ss)
783softmmu_ss.add(files(
784 'bootdevice.c',
785 'dma-helpers.c',
786 'qdev-monitor.c',
787), sdl)
788
789softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
790softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), seccomp])
791softmmu_ss.add(when: ['CONFIG_FDT', fdt], if_true: [files('device_tree.c')])
792
793common_ss.add(files('cpus-common.c'))
794
Paolo Bonzini5d3ea0e2020-08-06 13:40:26 +0200795subdir('softmmu')
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400796
Bruce Rogersc7c91a72020-08-24 09:52:12 -0600797specific_ss.add(files('disas.c', 'exec.c', 'gdbstub.c'), capstone, libpmem, libdaxctl)
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400798specific_ss.add(files('exec-vary.c'))
799specific_ss.add(when: 'CONFIG_TCG', if_true: files(
800 'fpu/softfloat.c',
801 'tcg/optimize.c',
802 'tcg/tcg-common.c',
803 'tcg/tcg-op-gvec.c',
804 'tcg/tcg-op-vec.c',
805 'tcg/tcg-op.c',
806 'tcg/tcg.c',
807))
808specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.c', 'tcg/tci.c'))
809
Marc-André Lureauab318052019-07-24 19:23:16 +0400810subdir('backends')
Marc-André Lureauc574e162019-07-26 12:02:31 +0400811subdir('disas')
Marc-André Lureau55166232019-07-24 19:16:22 +0400812subdir('migration')
Paolo Bonziniff219dc2020-08-04 21:14:26 +0200813subdir('monitor')
Marc-André Lureaucdaf0722019-07-22 23:47:50 +0400814subdir('net')
Marc-André Lureau17ef2af2019-07-22 23:40:45 +0400815subdir('replay')
Marc-André Lureau582ea952019-08-15 15:15:32 +0400816subdir('hw')
Marc-André Lureau1a828782019-08-18 16:13:08 +0400817subdir('accel')
Paolo Bonzinif556b4a2020-01-24 13:08:01 +0100818subdir('plugins')
Marc-André Lureaub309c322019-08-18 19:20:37 +0400819subdir('bsd-user')
Marc-André Lureau3a304462019-08-18 16:13:08 +0400820subdir('linux-user')
821
Marc-André Lureaub309c322019-08-18 19:20:37 +0400822bsd_user_ss.add(files('gdbstub.c'))
823specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
824
Marc-André Lureau3a304462019-08-18 16:13:08 +0400825linux_user_ss.add(files('gdbstub.c', 'thunk.c'))
826specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
Paolo Bonzini5d3ea0e2020-08-06 13:40:26 +0200827
Paolo Bonzinia2ce7db2020-08-04 20:00:40 +0200828# needed for fuzzing binaries
829subdir('tests/qtest/libqos')
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200830subdir('tests/qtest/fuzz')
Paolo Bonzinia2ce7db2020-08-04 20:00:40 +0200831
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400832block_mods = []
833softmmu_mods = []
834foreach d, list : modules
835 foreach m, module_ss : list
836 if enable_modules and targetos != 'windows'
837 module_ss = module_ss.apply(config_host, strict: false)
838 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
839 dependencies: [modulecommon, module_ss.dependencies()], pic: true)
840 if d == 'block'
841 block_mods += sl
842 else
843 softmmu_mods += sl
844 endif
845 else
846 if d == 'block'
847 block_ss.add_all(module_ss)
848 else
849 softmmu_ss.add_all(module_ss)
850 endif
851 endif
852 endforeach
853endforeach
854
855nm = find_program('nm')
856undefsym = find_program('scripts/undefsym.sh')
857block_syms = custom_target('block.syms', output: 'block.syms',
858 input: [libqemuutil, block_mods],
859 capture: true,
860 command: [undefsym, nm, '@INPUT@'])
861qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
862 input: [libqemuutil, softmmu_mods],
863 capture: true,
864 command: [undefsym, nm, '@INPUT@'])
865
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400866block_ss = block_ss.apply(config_host, strict: false)
867libblock = static_library('block', block_ss.sources() + genh,
868 dependencies: block_ss.dependencies(),
869 link_depends: block_syms,
870 name_suffix: 'fa',
871 build_by_default: false)
872
873block = declare_dependency(link_whole: [libblock],
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +0400874 link_args: '@block.syms',
875 dependencies: [crypto, io])
Marc-André Lureau5e5733e2019-08-29 22:34:43 +0400876
Paolo Bonziniff219dc2020-08-04 21:14:26 +0200877qmp_ss = qmp_ss.apply(config_host, strict: false)
878libqmp = static_library('qmp', qmp_ss.sources() + genh,
879 dependencies: qmp_ss.dependencies(),
880 name_suffix: 'fa',
881 build_by_default: false)
882
883qmp = declare_dependency(link_whole: [libqmp])
884
Marc-André Lureau3154fee2019-08-29 22:07:01 +0400885foreach m : block_mods + softmmu_mods
886 shared_module(m.name(),
887 name_prefix: '',
888 link_whole: m,
889 install: true,
890 install_dir: config_host['qemu_moddir'])
891endforeach
892
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200893softmmu_ss.add(authz, block, chardev, crypto, io, qmp)
894common_ss.add(qom, qemuutil)
895
896common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss])
Paolo Bonzini2becc362020-02-03 11:42:03 +0100897common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
898
899common_all = common_ss.apply(config_all, strict: false)
900common_all = static_library('common',
901 build_by_default: false,
902 sources: common_all.sources() + genh,
903 dependencies: common_all.dependencies(),
904 name_suffix: 'fa')
905
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400906feature_to_c = find_program('scripts/feature_to_c.sh')
907
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200908emulators = []
Paolo Bonzini2becc362020-02-03 11:42:03 +0100909foreach target : target_dirs
910 config_target = config_target_mak[target]
911 target_name = config_target['TARGET_NAME']
912 arch = config_target['TARGET_BASE_ARCH']
Paolo Bonzini859aef02020-08-04 18:14:26 +0200913 arch_srcs = [config_target_h[target]]
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200914 arch_deps = []
915 c_args = ['-DNEED_CPU_H',
916 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
917 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
918 link_args = []
Paolo Bonzini2becc362020-02-03 11:42:03 +0100919
Paolo Bonzini859aef02020-08-04 18:14:26 +0200920 config_target += config_host
Paolo Bonzini2becc362020-02-03 11:42:03 +0100921 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
922 if targetos == 'linux'
923 target_inc += include_directories('linux-headers', is_system: true)
924 endif
925 if target.endswith('-softmmu')
926 qemu_target_name = 'qemu-system-' + target_name
927 target_type='system'
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200928 t = target_softmmu_arch[arch].apply(config_target, strict: false)
929 arch_srcs += t.sources()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200930 arch_deps += t.dependencies()
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200931
Marc-André Lureau2c442202019-08-17 13:55:58 +0400932 hw_dir = target_name == 'sparc64' ? 'sparc64' : arch
933 hw = hw_arch[hw_dir].apply(config_target, strict: false)
934 arch_srcs += hw.sources()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200935 arch_deps += hw.dependencies()
Marc-André Lureau2c442202019-08-17 13:55:58 +0400936
Paolo Bonzini2becc362020-02-03 11:42:03 +0100937 arch_srcs += config_devices_h[target]
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200938 link_args += ['@block.syms', '@qemu.syms']
Paolo Bonzini2becc362020-02-03 11:42:03 +0100939 else
Marc-André Lureau3a304462019-08-18 16:13:08 +0400940 abi = config_target['TARGET_ABI_DIR']
Paolo Bonzini2becc362020-02-03 11:42:03 +0100941 target_type='user'
942 qemu_target_name = 'qemu-' + target_name
943 if 'CONFIG_LINUX_USER' in config_target
944 base_dir = 'linux-user'
945 target_inc += include_directories('linux-user/host/' / config_host['ARCH'])
946 else
947 base_dir = 'bsd-user'
948 endif
949 target_inc += include_directories(
950 base_dir,
Marc-André Lureau3a304462019-08-18 16:13:08 +0400951 base_dir / abi,
Paolo Bonzini2becc362020-02-03 11:42:03 +0100952 )
Marc-André Lureau3a304462019-08-18 16:13:08 +0400953 if 'CONFIG_LINUX_USER' in config_target
954 dir = base_dir / abi
955 arch_srcs += files(dir / 'signal.c', dir / 'cpu_loop.c')
956 if config_target.has_key('TARGET_SYSTBL_ABI')
957 arch_srcs += \
958 syscall_nr_generators[abi].process(base_dir / abi / config_target['TARGET_SYSTBL'],
959 extra_args : config_target['TARGET_SYSTBL_ABI'])
960 endif
961 endif
Paolo Bonzini2becc362020-02-03 11:42:03 +0100962 endif
963
Marc-André Lureauc9322ab2019-08-18 19:51:17 +0400964 if 'TARGET_XML_FILES' in config_target
965 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
966 output: target + '-gdbstub-xml.c',
967 input: files(config_target['TARGET_XML_FILES'].split()),
968 command: [feature_to_c, '@INPUT@'],
969 capture: true)
970 arch_srcs += gdbstub_xml
971 endif
972
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200973 t = target_arch[arch].apply(config_target, strict: false)
974 arch_srcs += t.sources()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200975 arch_deps += t.dependencies()
Paolo Bonziniabff1ab2020-08-07 12:10:23 +0200976
Paolo Bonzini2becc362020-02-03 11:42:03 +0100977 target_common = common_ss.apply(config_target, strict: false)
978 objects = common_all.extract_objects(target_common.sources())
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200979 deps = target_common.dependencies()
Paolo Bonzini2becc362020-02-03 11:42:03 +0100980
Paolo Bonzini2becc362020-02-03 11:42:03 +0100981 target_specific = specific_ss.apply(config_target, strict: false)
982 arch_srcs += target_specific.sources()
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200983 arch_deps += target_specific.dependencies()
Paolo Bonzini2becc362020-02-03 11:42:03 +0100984
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200985 lib = static_library('qemu-' + target,
Paolo Bonzini859aef02020-08-04 18:14:26 +0200986 sources: arch_srcs + genh,
Paolo Bonzinib7612f42020-08-26 08:22:58 +0200987 dependencies: arch_deps,
Paolo Bonzini2becc362020-02-03 11:42:03 +0100988 objects: objects,
989 include_directories: target_inc,
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200990 c_args: c_args,
991 build_by_default: false,
Paolo Bonzini2becc362020-02-03 11:42:03 +0100992 name_suffix: 'fa')
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200993
994 if target.endswith('-softmmu')
995 execs = [{
996 'name': 'qemu-system-' + target_name,
997 'gui': false,
998 'sources': files('softmmu/main.c'),
999 'dependencies': []
1000 }]
Paolo Bonzini35be72b2020-02-06 14:17:15 +01001001 if targetos == 'windows' and (sdl.found() or gtk.found())
Paolo Bonzini64ed6f92020-08-03 17:04:25 +02001002 execs += [{
1003 'name': 'qemu-system-' + target_name + 'w',
1004 'gui': true,
1005 'sources': files('softmmu/main.c'),
1006 'dependencies': []
1007 }]
1008 endif
1009 if config_host.has_key('CONFIG_FUZZ')
1010 specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false)
1011 execs += [{
1012 'name': 'qemu-fuzz-' + target_name,
1013 'gui': false,
1014 'sources': specific_fuzz.sources(),
1015 'dependencies': specific_fuzz.dependencies(),
1016 'link_depends': [files('tests/qtest/fuzz/fork_fuzz.ld')],
1017 }]
1018 endif
1019 else
1020 execs = [{
1021 'name': 'qemu-' + target_name,
1022 'gui': false,
1023 'sources': [],
1024 'dependencies': []
1025 }]
1026 endif
1027 foreach exe: execs
1028 emulators += executable(exe['name'], exe['sources'],
1029 install: true,
1030 c_args: c_args,
1031 dependencies: arch_deps + deps + exe['dependencies'],
1032 objects: lib.extract_all_objects(recursive: true),
1033 link_language: link_language,
1034 link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []),
1035 link_args: link_args,
1036 gui_app: exe['gui'])
Marc-André Lureau10e1d262019-08-20 12:29:52 +04001037
1038 if 'CONFIG_TRACE_SYSTEMTAP' in config_host
1039 foreach stp: [
Stefan Hajnoczibd5f9732020-08-25 08:49:53 +02001040 {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe['name'], 'install': false},
1041 {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe['name'], 'install': true},
Marc-André Lureau10e1d262019-08-20 12:29:52 +04001042 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
1043 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
1044 ]
Stefan Hajnoczibd5f9732020-08-25 08:49:53 +02001045 custom_target(exe['name'] + stp['ext'],
Marc-André Lureau10e1d262019-08-20 12:29:52 +04001046 input: trace_events_all,
Stefan Hajnoczibd5f9732020-08-25 08:49:53 +02001047 output: exe['name'] + stp['ext'],
Marc-André Lureau10e1d262019-08-20 12:29:52 +04001048 capture: true,
1049 install: stp['install'],
1050 install_dir: config_host['qemu_datadir'] / '../systemtap/tapset',
1051 command: [
1052 tracetool, '--group=all', '--format=' + stp['fmt'],
1053 '--binary=' + stp['bin'],
1054 '--target-name=' + target_name,
1055 '--target-type=' + target_type,
1056 '--probe-prefix=qemu.' + target_type + '.' + target_name,
1057 '@INPUT@',
1058 ])
1059 endforeach
1060 endif
Paolo Bonzini64ed6f92020-08-03 17:04:25 +02001061 endforeach
Paolo Bonzini2becc362020-02-03 11:42:03 +01001062endforeach
1063
Paolo Bonzini931049b2020-02-05 09:44:24 +01001064# Other build targets
Marc-André Lureau897b5af2019-07-16 21:54:15 +04001065
Paolo Bonzinif556b4a2020-01-24 13:08:01 +01001066if 'CONFIG_PLUGIN' in config_host
1067 install_headers('include/qemu/qemu-plugin.h')
1068endif
1069
Paolo Bonzinif15bff22019-07-18 13:19:02 +02001070if 'CONFIG_GUEST_AGENT' in config_host
1071 subdir('qga')
1072endif
1073
Laurent Vivier9755c942020-08-24 17:24:30 +02001074# Don't build qemu-keymap if xkbcommon is not explicitly enabled
1075# when we don't build tools or system
1076if get_option('xkbcommon').auto() and not have_system and not have_tools
1077 xkbcommon = not_found
1078endif
Laurent Vivier4113f4c2020-08-24 17:24:29 +02001079if xkbcommon.found()
Marc-André Lureau28742462019-09-19 20:24:43 +04001080 # used for the update-keymaps target, so include rules even if !have_tools
1081 qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
1082 dependencies: [qemuutil, xkbcommon], install: have_tools)
1083endif
1084
Philippe Mathieu-Daudé8855e8f2020-08-21 17:05:56 +02001085qemu_block_tools = []
Paolo Bonzini931049b2020-02-05 09:44:24 +01001086if have_tools
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +04001087 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
1088 dependencies: [authz, block, crypto, io, qom, qemuutil], install: true)
1089 qemu_io = executable('qemu-io', files('qemu-io.c'),
1090 dependencies: [block, qemuutil], install: true)
Philippe Mathieu-Daudé8855e8f2020-08-21 17:05:56 +02001091 qemu_block_tools += [qemu_img, qemu_io]
Thomas Huth5f7e9662020-08-23 10:32:15 +02001092 if targetos != 'windows'
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +04001093 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
1094 dependencies: [block, qemuutil], install: true)
Paolo Bonzinid3ca5922020-01-28 14:49:18 +01001095 qemu_block_tools += [qemu_nbd]
Marc-André Lureaub7c70bf2019-07-16 21:37:25 +04001096 endif
1097
Paolo Bonzini7c58bb72020-08-04 20:18:36 +02001098 subdir('storage-daemon')
Paolo Bonzinia9c97272019-06-10 12:27:52 +02001099 subdir('contrib/rdmacm-mux')
Marc-André Lureau1d7bb6a2019-07-12 23:47:06 +04001100 subdir('contrib/elf2dmp')
Paolo Bonzinia9c97272019-06-10 12:27:52 +02001101
Marc-André Lureau157e7b12019-07-15 14:50:58 +04001102 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
1103 dependencies: qemuutil,
1104 install: true)
1105
Paolo Bonzini931049b2020-02-05 09:44:24 +01001106 if 'CONFIG_VHOST_USER' in config_host
1107 subdir('contrib/libvhost-user')
Paolo Bonzini2d7ac0a2019-06-10 12:18:02 +02001108 subdir('contrib/vhost-user-blk')
Paolo Bonzinib7612f42020-08-26 08:22:58 +02001109 subdir('contrib/vhost-user-gpu')
Marc-André Lureau32fcc622019-07-12 22:11:20 +04001110 subdir('contrib/vhost-user-input')
Paolo Bonzini99650b62019-06-10 12:21:14 +02001111 subdir('contrib/vhost-user-scsi')
Paolo Bonzini931049b2020-02-05 09:44:24 +01001112 endif
Marc-André Lureau8f51e012019-07-15 14:39:25 +04001113
1114 if targetos == 'linux'
1115 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
1116 dependencies: [qemuutil, libcap_ng],
1117 install: true,
1118 install_dir: get_option('libexecdir'))
Marc-André Lureau897b5af2019-07-16 21:54:15 +04001119
1120 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
1121 dependencies: [authz, crypto, io, qom, qemuutil,
1122 libcap_ng, libudev, libmpathpersist],
1123 install: true)
Marc-André Lureau8f51e012019-07-15 14:39:25 +04001124 endif
1125
Marc-André Lureau5ee24e72019-07-12 23:16:54 +04001126 if 'CONFIG_IVSHMEM' in config_host
1127 subdir('contrib/ivshmem-client')
1128 subdir('contrib/ivshmem-server')
1129 endif
Paolo Bonzini931049b2020-02-05 09:44:24 +01001130endif
1131
Paolo Bonzini3f99cf52020-02-05 09:45:39 +01001132subdir('tools')
Marc-André Lureaubdcbea72019-07-15 21:22:31 +04001133subdir('pc-bios')
Paolo Bonzinice1c1e72020-01-28 16:41:44 +01001134subdir('tests')
Paolo Bonzinif8aa24e2020-08-05 15:49:10 +02001135subdir('docs')
Marc-André Lureaue8f3bd72019-09-19 21:02:09 +04001136if 'CONFIG_GTK' in config_host
1137 subdir('po')
1138endif
Paolo Bonzini3f99cf52020-02-05 09:45:39 +01001139
Paolo Bonziniacfdaac2020-08-05 13:07:48 +02001140if build_docs
1141 makeinfo = find_program('makeinfo', required: build_docs)
1142
1143 docs_inc = [
1144 '-I', meson.current_source_dir(),
1145 '-I', meson.current_build_dir() / 'docs',
1146 '-I', '@OUTDIR@',
1147 ]
1148
1149 version_texi = configure_file(output: 'version.texi',
1150 input: 'version.texi.in',
1151 configuration: {'VERSION': meson.project_version(),
1152 'qemu_confdir': config_host['qemu_confdir']})
1153
1154 texi = {
1155 'qemu-qmp-ref': ['docs/interop/qemu-qmp-ref.texi', qapi_doc_texi, version_texi],
1156 }
1157 if 'CONFIG_GUEST_AGENT' in config_host
1158 texi += {'qemu-ga-ref': ['docs/interop/qemu-ga-ref.texi', qga_qapi_doc_texi, version_texi]}
1159 endif
1160
1161 if makeinfo.found()
1162 cmd = [
1163 'env', 'LC_ALL=C', makeinfo, '--no-split', '--number-sections', docs_inc,
1164 '@INPUT0@', '-o', '@OUTPUT@',
1165 ]
1166 foreach ext, args: {
1167 'info': [],
1168 'html': ['--no-headers', '--html'],
1169 'txt': ['--no-headers', '--plaintext'],
1170 }
1171 t = []
1172 foreach doc, input: texi
1173 output = doc + '.' + ext
1174 t += custom_target(output,
1175 input: input,
1176 output: output,
1177 install: true,
1178 install_dir: config_host['qemu_docdir'] / 'interop',
1179 command: cmd + args)
1180 endforeach
1181 alias_target(ext, t)
1182 endforeach
1183 endif
1184
1185 texi2pdf = find_program('texi2pdf', required: false)
1186
1187 if texi2pdf.found()
1188 pdfs = []
1189 foreach doc, input: texi
1190 output = doc + '.pdf'
1191 pdfs += custom_target(output,
1192 input: input,
1193 output: output,
1194 command: [texi2pdf, '-q', docs_inc, '@INPUT0@', '-o', '@OUTPUT@'],
1195 build_by_default: false)
1196 endforeach
1197 alias_target('pdf', pdfs)
1198 endif
1199
1200 texi2pod = find_program('scripts/texi2pod.pl')
1201 pod2man = find_program('pod2man', required: build_docs)
1202
1203 if pod2man.found()
1204 foreach doc, input: texi
1205 man = doc + '.7'
1206 pod = custom_target(man + '.pod',
1207 input: input,
1208 output: man + '.pod',
1209 command: [texi2pod,
1210 '-DVERSION="' + meson.project_version() + '"',
1211 '-DCONFDIR="' + config_host['qemu_confdir'] + '"',
1212 '@INPUT0@', '@OUTPUT@'])
1213 man = custom_target(man,
1214 input: pod,
1215 output: man,
1216 capture: true,
1217 install: true,
1218 install_dir: config_host['mandir'] / 'man7',
1219 command: [pod2man, '--utf8', '--section=7', '--center=" "',
1220 '--release=" "', '@INPUT@'])
1221 endforeach
1222 endif
1223endif
1224
Paolo Bonzinif9332752020-02-03 13:28:38 +01001225summary_info = {}
1226summary_info += {'Install prefix': config_host['prefix']}
1227summary_info += {'BIOS directory': config_host['qemu_datadir']}
1228summary_info += {'firmware path': config_host['qemu_firmwarepath']}
1229summary_info += {'binary directory': config_host['bindir']}
1230summary_info += {'library directory': config_host['libdir']}
1231summary_info += {'module directory': config_host['qemu_moddir']}
1232summary_info += {'libexec directory': config_host['libexecdir']}
1233summary_info += {'include directory': config_host['includedir']}
1234summary_info += {'config directory': config_host['sysconfdir']}
1235if targetos != 'windows'
1236 summary_info += {'local state directory': config_host['qemu_localstatedir']}
1237 summary_info += {'Manual directory': config_host['mandir']}
1238else
1239 summary_info += {'local state directory': 'queried at runtime'}
1240endif
1241summary_info += {'Build directory': meson.current_build_dir()}
1242summary_info += {'Source path': meson.current_source_dir()}
1243summary_info += {'GIT binary': config_host['GIT']}
1244summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
1245summary_info += {'C compiler': meson.get_compiler('c').cmd_array()[0]}
1246summary_info += {'Host C compiler': meson.get_compiler('c', native: true).cmd_array()[0]}
1247if link_language == 'cpp'
1248 summary_info += {'C++ compiler': meson.get_compiler('cpp').cmd_array()[0]}
1249else
1250 summary_info += {'C++ compiler': false}
1251endif
1252if targetos == 'darwin'
1253 summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
1254endif
1255summary_info += {'ARFLAGS': config_host['ARFLAGS']}
1256summary_info += {'CFLAGS': config_host['CFLAGS']}
1257summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
1258summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
1259summary_info += {'make': config_host['MAKE']}
1260summary_info += {'install': config_host['INSTALL']}
1261summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
1262summary_info += {'sphinx-build': config_host['SPHINX_BUILD']}
1263summary_info += {'genisoimage': config_host['GENISOIMAGE']}
1264# TODO: add back version
1265summary_info += {'slirp support': config_host.has_key('CONFIG_SLIRP')}
1266if config_host.has_key('CONFIG_SLIRP')
1267 summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']}
1268endif
1269summary_info += {'module support': config_host.has_key('CONFIG_MODULES')}
1270if config_host.has_key('CONFIG_MODULES')
1271 summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')}
1272endif
1273summary_info += {'host CPU': cpu}
1274summary_info += {'host endianness': build_machine.endian()}
1275summary_info += {'target list': config_host['TARGET_DIRS']}
1276summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')}
1277summary_info += {'sparse enabled': meson.get_compiler('c').cmd_array().contains('cgcc')}
1278summary_info += {'strip binaries': get_option('strip')}
1279summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
1280summary_info += {'static build': config_host.has_key('CONFIG_TOOLS')}
1281if targetos == 'darwin'
1282 summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
1283endif
1284# TODO: add back version
Paolo Bonzini35be72b2020-02-06 14:17:15 +01001285summary_info += {'SDL support': sdl.found()}
1286summary_info += {'SDL image support': sdl_image.found()}
Paolo Bonzinif9332752020-02-03 13:28:38 +01001287# TODO: add back version
1288summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
1289summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')}
Paolo Bonzinib7612f42020-08-26 08:22:58 +02001290summary_info += {'pixman': pixman.found()}
Paolo Bonzinif9332752020-02-03 13:28:38 +01001291# TODO: add back version
1292summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
1293summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
1294summary_info += {'GNUTLS support': config_host.has_key('CONFIG_GNUTLS')}
1295# TODO: add back version
1296summary_info += {'libgcrypt': config_host.has_key('CONFIG_GCRYPT')}
1297if config_host.has_key('CONFIG_GCRYPT')
1298 summary_info += {' hmac': config_host.has_key('CONFIG_GCRYPT_HMAC')}
1299 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1300endif
1301# TODO: add back version
1302summary_info += {'nettle': config_host.has_key('CONFIG_NETTLE')}
1303if config_host.has_key('CONFIG_NETTLE')
1304 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
1305endif
1306summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')}
1307summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')}
1308summary_info += {'iconv support': config_host.has_key('CONFIG_ICONV')}
1309summary_info += {'curses support': config_host.has_key('CONFIG_CURSES')}
1310# TODO: add back version
1311summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')}
1312summary_info += {'curl support': config_host.has_key('CONFIG_CURL')}
1313summary_info += {'mingw32 support': targetos == 'windows'}
1314summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']}
1315summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
1316summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
1317summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')}
1318summary_info += {'Multipath support': config_host.has_key('CONFIG_MPATH')}
Paolo Bonzinia0b93232020-02-06 15:48:52 +01001319summary_info += {'VNC support': vnc.found()}
1320if vnc.found()
1321 summary_info += {'VNC SASL support': sasl.found()}
1322 summary_info += {'VNC JPEG support': jpeg.found()}
1323 summary_info += {'VNC PNG support': png.found()}
Paolo Bonzinif9332752020-02-03 13:28:38 +01001324endif
1325summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')}
1326if config_host.has_key('CONFIG_XEN_BACKEND')
1327 summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
1328endif
1329summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')}
1330summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')}
1331summary_info += {'PIE': get_option('b_pie')}
1332summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
1333summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
1334summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
1335summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
1336summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')}
1337summary_info += {'Install blobs': config_host.has_key('INSTALL_BLOBS')}
1338# TODO: add back KVM/HAX/HVF/WHPX/TCG
1339#summary_info += {'KVM support': have_kvm'}
1340#summary_info += {'HAX support': have_hax'}
1341#summary_info += {'HVF support': have_hvf'}
1342#summary_info += {'WHPX support': have_whpx'}
1343#summary_info += {'TCG support': have_tcg'}
1344#if get_option('tcg')
1345# summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
1346# summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')}
1347#endif
1348summary_info += {'malloc trim support': config_host.has_key('CONFIG_MALLOC_TRIM')}
1349summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
1350summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}
1351summary_info += {'fdt support': config_host.has_key('CONFIG_FDT')}
1352summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')}
1353summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')}
1354summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')}
1355summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')}
1356summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}
1357summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')}
1358summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')}
1359summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
1360summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
1361summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
1362summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
1363summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')}
1364summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
1365summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
1366summary_info += {'Trace backends': config_host['TRACE_BACKENDS']}
1367if config_host['TRACE_BACKENDS'].split().contains('simple')
1368 summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
1369endif
1370# TODO: add back protocol and server version
1371summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
1372summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')}
1373summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')}
1374summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
1375summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')}
1376summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')}
1377summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
1378summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')}
1379summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')}
1380summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')}
1381summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
1382if targetos == 'windows'
1383 if 'WIN_SDK' in config_host
1384 summary_info += {'Windows SDK': config_host['WIN_SDK']}
1385 endif
1386 summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')}
1387 summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
1388 summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI_ENABLED')}
1389endif
1390summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')}
1391summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
1392summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'}
1393summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
1394summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')}
1395summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')}
1396summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')}
Marc-André Lureaubf0e56a2019-10-04 17:35:16 +04001397summary_info += {'gcov': get_option('b_coverage')}
Paolo Bonzinif9332752020-02-03 13:28:38 +01001398summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')}
1399summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')}
1400summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
1401summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
1402summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')}
1403summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')}
1404summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')}
1405summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')}
1406summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')}
1407summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
1408summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}
1409summary_info += {'tcmalloc support': config_host.has_key('CONFIG_TCMALLOC')}
1410summary_info += {'jemalloc support': config_host.has_key('CONFIG_JEMALLOC')}
1411summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
1412summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
1413summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
1414summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')}
1415summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')}
1416summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')}
1417summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')}
1418summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')}
1419summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')}
1420summary_info += {'qed support': config_host.has_key('CONFIG_QED')}
1421summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
1422summary_info += {'sheepdog support': config_host.has_key('CONFIG_SHEEPDOG')}
1423summary_info += {'capstone': config_host.has_key('CONFIG_CAPSTONE')}
1424summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')}
1425summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
1426summary_info += {'libudev': config_host.has_key('CONFIG_LIBUDEV')}
1427summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'}
1428summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')}
1429summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')}
1430if config_host.has_key('HAVE_GDB_BIN')
1431 summary_info += {'gdb': config_host['HAVE_GDB_BIN']}
1432endif
1433summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')}
1434summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')}
1435summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')}
1436summary(summary_info, bool_yn: true)
1437
1438if not supported_cpus.contains(cpu)
1439 message()
1440 warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
1441 message()
1442 message('CPU host architecture ' + cpu + ' support is not currently maintained.')
1443 message('The QEMU project intends to remove support for this host CPU in')
1444 message('a future release if nobody volunteers to maintain it and to')
1445 message('provide a build host for our continuous integration setup.')
1446 message('configure has succeeded and you can continue to build, but')
1447 message('if you care about QEMU on this platform you should contact')
1448 message('us upstream at qemu-devel@nongnu.org.')
1449endif
1450
1451if not supported_oses.contains(targetos)
1452 message()
1453 warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!')
1454 message()
1455 message('Host OS ' + targetos + 'support is not currently maintained.')
1456 message('The QEMU project intends to remove support for this host OS in')
1457 message('a future release if nobody volunteers to maintain it and to')
1458 message('provide a build host for our continuous integration setup.')
1459 message('configure has succeeded and you can continue to build, but')
1460 message('if you care about QEMU on this platform you should contact')
1461 message('us upstream at qemu-devel@nongnu.org.')
1462endif