]> git.proxmox.com Git - mirror_qemu.git/blame - meson.build
meson: move summary to meson.build
[mirror_qemu.git] / meson.build
CommitLineData
a5665051
PB
1project('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')
7config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
8
9add_project_arguments(config_host['QEMU_CFLAGS'].split(),
10 native: false, language: ['c', 'objc'])
11add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
12 native: false, language: 'cpp')
13add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
14 native: false, language: ['c', 'cpp', 'objc'])
15add_project_arguments(config_host['QEMU_INCLUDES'].split(),
16 language: ['c', 'cpp', 'objc'])
17
fc929892
MAL
18python = import('python').find_installation()
19
20link_language = meson.get_external_property('link_language', 'cpp')
21if link_language == 'cpp'
22 add_languages('cpp', required: true, native: false)
23endif
a5665051
PB
24if host_machine.system() == 'darwin'
25 add_languages('objc', required: false, native: false)
26endif
27
28configure_file(input: files('scripts/ninjatool.py'),
29 output: 'ninjatool',
30 configuration: config_host)
f9332757
PB
31
32supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
33supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
34 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
35
36cpu = host_machine.cpu_family()
37targetos = host_machine.system()
38
39summary_info = {}
40summary_info += {'Install prefix': config_host['prefix']}
41summary_info += {'BIOS directory': config_host['qemu_datadir']}
42summary_info += {'firmware path': config_host['qemu_firmwarepath']}
43summary_info += {'binary directory': config_host['bindir']}
44summary_info += {'library directory': config_host['libdir']}
45summary_info += {'module directory': config_host['qemu_moddir']}
46summary_info += {'libexec directory': config_host['libexecdir']}
47summary_info += {'include directory': config_host['includedir']}
48summary_info += {'config directory': config_host['sysconfdir']}
49if targetos != 'windows'
50 summary_info += {'local state directory': config_host['qemu_localstatedir']}
51 summary_info += {'Manual directory': config_host['mandir']}
52else
53 summary_info += {'local state directory': 'queried at runtime'}
54endif
55summary_info += {'Build directory': meson.current_build_dir()}
56summary_info += {'Source path': meson.current_source_dir()}
57summary_info += {'GIT binary': config_host['GIT']}
58summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
59summary_info += {'C compiler': meson.get_compiler('c').cmd_array()[0]}
60summary_info += {'Host C compiler': meson.get_compiler('c', native: true).cmd_array()[0]}
61if link_language == 'cpp'
62 summary_info += {'C++ compiler': meson.get_compiler('cpp').cmd_array()[0]}
63else
64 summary_info += {'C++ compiler': false}
65endif
66if targetos == 'darwin'
67 summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
68endif
69summary_info += {'ARFLAGS': config_host['ARFLAGS']}
70summary_info += {'CFLAGS': config_host['CFLAGS']}
71summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
72summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
73summary_info += {'make': config_host['MAKE']}
74summary_info += {'install': config_host['INSTALL']}
75summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
76summary_info += {'sphinx-build': config_host['SPHINX_BUILD']}
77summary_info += {'genisoimage': config_host['GENISOIMAGE']}
78# TODO: add back version
79summary_info += {'slirp support': config_host.has_key('CONFIG_SLIRP')}
80if config_host.has_key('CONFIG_SLIRP')
81 summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']}
82endif
83summary_info += {'module support': config_host.has_key('CONFIG_MODULES')}
84if config_host.has_key('CONFIG_MODULES')
85 summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')}
86endif
87summary_info += {'host CPU': cpu}
88summary_info += {'host endianness': build_machine.endian()}
89summary_info += {'target list': config_host['TARGET_DIRS']}
90summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')}
91summary_info += {'sparse enabled': meson.get_compiler('c').cmd_array().contains('cgcc')}
92summary_info += {'strip binaries': get_option('strip')}
93summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
94summary_info += {'static build': config_host.has_key('CONFIG_TOOLS')}
95if targetos == 'darwin'
96 summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
97endif
98# TODO: add back version
99summary_info += {'SDL support': config_host.has_key('CONFIG_SDL')}
100summary_info += {'SDL image support': config_host.has_key('CONFIG_SDL_IMAGE')}
101# TODO: add back version
102summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
103summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')}
104# TODO: add back version
105summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
106summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
107summary_info += {'GNUTLS support': config_host.has_key('CONFIG_GNUTLS')}
108# TODO: add back version
109summary_info += {'libgcrypt': config_host.has_key('CONFIG_GCRYPT')}
110if config_host.has_key('CONFIG_GCRYPT')
111 summary_info += {' hmac': config_host.has_key('CONFIG_GCRYPT_HMAC')}
112 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
113endif
114# TODO: add back version
115summary_info += {'nettle': config_host.has_key('CONFIG_NETTLE')}
116if config_host.has_key('CONFIG_NETTLE')
117 summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')}
118endif
119summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')}
120summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')}
121summary_info += {'iconv support': config_host.has_key('CONFIG_ICONV')}
122summary_info += {'curses support': config_host.has_key('CONFIG_CURSES')}
123# TODO: add back version
124summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')}
125summary_info += {'curl support': config_host.has_key('CONFIG_CURL')}
126summary_info += {'mingw32 support': targetos == 'windows'}
127summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']}
128summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
129summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
130summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')}
131summary_info += {'Multipath support': config_host.has_key('CONFIG_MPATH')}
132summary_info += {'VNC support': config_host.has_key('CONFIG_VNC')}
133if config_host.has_key('CONFIG_VNC')
134 summary_info += {'VNC SASL support': config_host.has_key('CONFIG_VNC_SASL')}
135 summary_info += {'VNC JPEG support': config_host.has_key('CONFIG_VNC_JPEG')}
136 summary_info += {'VNC PNG support': config_host.has_key('CONFIG_VNC_PNG')}
137endif
138summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')}
139if config_host.has_key('CONFIG_XEN_BACKEND')
140 summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
141endif
142summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')}
143summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')}
144summary_info += {'PIE': get_option('b_pie')}
145summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
146summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
147summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')}
148summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')}
149summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')}
150summary_info += {'Install blobs': config_host.has_key('INSTALL_BLOBS')}
151# TODO: add back KVM/HAX/HVF/WHPX/TCG
152#summary_info += {'KVM support': have_kvm'}
153#summary_info += {'HAX support': have_hax'}
154#summary_info += {'HVF support': have_hvf'}
155#summary_info += {'WHPX support': have_whpx'}
156#summary_info += {'TCG support': have_tcg'}
157#if get_option('tcg')
158# summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
159# summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')}
160#endif
161summary_info += {'malloc trim support': config_host.has_key('CONFIG_MALLOC_TRIM')}
162summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
163summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}
164summary_info += {'fdt support': config_host.has_key('CONFIG_FDT')}
165summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')}
166summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')}
167summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')}
168summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')}
169summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}
170summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')}
171summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')}
172summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')}
173summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
174summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')}
175summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')}
176summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')}
177summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
178summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
179summary_info += {'Trace backends': config_host['TRACE_BACKENDS']}
180if config_host['TRACE_BACKENDS'].split().contains('simple')
181 summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
182endif
183# TODO: add back protocol and server version
184summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
185summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')}
186summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')}
187summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
188summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')}
189summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')}
190summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
191summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')}
192summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')}
193summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')}
194summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
195if targetos == 'windows'
196 if 'WIN_SDK' in config_host
197 summary_info += {'Windows SDK': config_host['WIN_SDK']}
198 endif
199 summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')}
200 summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
201 summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI_ENABLED')}
202endif
203summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')}
204summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
205summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'}
206summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
207summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')}
208summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')}
209summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')}
210summary_info += {'gcov': config_host.has_key('CONFIG_GCOV')}
211summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')}
212summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')}
213summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
214summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
215summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')}
216summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')}
217summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')}
218summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')}
219summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')}
220summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
221summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}
222summary_info += {'tcmalloc support': config_host.has_key('CONFIG_TCMALLOC')}
223summary_info += {'jemalloc support': config_host.has_key('CONFIG_JEMALLOC')}
224summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
225summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
226summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')}
227summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')}
228summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')}
229summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')}
230summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')}
231summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')}
232summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')}
233summary_info += {'qed support': config_host.has_key('CONFIG_QED')}
234summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')}
235summary_info += {'sheepdog support': config_host.has_key('CONFIG_SHEEPDOG')}
236summary_info += {'capstone': config_host.has_key('CONFIG_CAPSTONE')}
237summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')}
238summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
239summary_info += {'libudev': config_host.has_key('CONFIG_LIBUDEV')}
240summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'}
241summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')}
242summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')}
243if config_host.has_key('HAVE_GDB_BIN')
244 summary_info += {'gdb': config_host['HAVE_GDB_BIN']}
245endif
246summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')}
247summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')}
248summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')}
249summary(summary_info, bool_yn: true)
250
251if not supported_cpus.contains(cpu)
252 message()
253 warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
254 message()
255 message('CPU host architecture ' + cpu + ' support is not currently maintained.')
256 message('The QEMU project intends to remove support for this host CPU in')
257 message('a future release if nobody volunteers to maintain it and to')
258 message('provide a build host for our continuous integration setup.')
259 message('configure has succeeded and you can continue to build, but')
260 message('if you care about QEMU on this platform you should contact')
261 message('us upstream at qemu-devel@nongnu.org.')
262endif
263
264if not supported_oses.contains(targetos)
265 message()
266 warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!')
267 message()
268 message('Host OS ' + targetos + 'support is not currently maintained.')
269 message('The QEMU project intends to remove support for this host OS in')
270 message('a future release if nobody volunteers to maintain it and to')
271 message('provide a build host for our continuous integration setup.')
272 message('configure has succeeded and you can continue to build, but')
273 message('if you care about QEMU on this platform you should contact')
274 message('us upstream at qemu-devel@nongnu.org.')
275endif