Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 1 | project('qemu', ['c'], meson_version: '>=0.55.0', |
Gerd Hoffmann | 90756b2 | 2020-08-25 08:43:42 +0200 | [diff] [blame] | 2 | default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', |
Paolo Bonzini | 3e0e519 | 2020-09-01 12:48:00 -0400 | [diff] [blame] | 3 | 'b_colorout=auto'], |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 4 | version: run_command('head', meson.source_root() / 'VERSION').stdout().strip()) |
| 5 | |
| 6 | not_found = dependency('', required: false) |
Paolo Bonzini | b29b40f | 2020-08-10 18:04:43 +0200 | [diff] [blame] | 7 | if meson.version().version_compare('>=0.56.0') |
| 8 | keyval = import('keyval') |
| 9 | else |
| 10 | keyval = import('unstable-keyval') |
| 11 | endif |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 12 | ss = import('sourceset') |
| 13 | |
Paolo Bonzini | ce1c1e7 | 2020-01-28 16:41:44 +0100 | [diff] [blame] | 14 | sh = find_program('sh') |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 15 | cc = meson.get_compiler('c') |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 16 | config_host = keyval.load(meson.current_build_dir() / 'config-host.mak') |
Marc-André Lureau | 3154fee | 2019-08-29 22:07:01 +0400 | [diff] [blame] | 17 | enable_modules = 'CONFIG_MODULES' in config_host |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 18 | enable_static = 'CONFIG_STATIC' in config_host |
Paolo Bonzini | f8aa24e | 2020-08-05 15:49:10 +0200 | [diff] [blame] | 19 | build_docs = 'BUILD_DOCS' in config_host |
Marc-André Lureau | ab4c099 | 2020-08-26 15:04:16 +0400 | [diff] [blame] | 20 | qemu_datadir = get_option('datadir') / get_option('qemu_suffix') |
Marc-André Lureau | 491e74c | 2020-08-26 15:04:17 +0400 | [diff] [blame] | 21 | qemu_docdir = get_option('docdir') / get_option('qemu_suffix') |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 22 | config_host_data = configuration_data() |
| 23 | genh = [] |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 24 | |
Paolo Bonzini | 760e432 | 2020-08-26 08:09:48 +0200 | [diff] [blame] | 25 | target_dirs = config_host['TARGET_DIRS'].split() |
| 26 | have_user = false |
| 27 | have_system = false |
| 28 | foreach target : target_dirs |
| 29 | have_user = have_user or target.endswith('-user') |
| 30 | have_system = have_system or target.endswith('-softmmu') |
| 31 | endforeach |
| 32 | have_tools = 'CONFIG_TOOLS' in config_host |
| 33 | have_block = have_system or have_tools |
| 34 | |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 35 | add_project_arguments(config_host['QEMU_CFLAGS'].split(), |
| 36 | native: false, language: ['c', 'objc']) |
| 37 | add_project_arguments(config_host['QEMU_CXXFLAGS'].split(), |
| 38 | native: false, language: 'cpp') |
| 39 | add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(), |
| 40 | native: false, language: ['c', 'cpp', 'objc']) |
| 41 | add_project_arguments(config_host['QEMU_INCLUDES'].split(), |
| 42 | language: ['c', 'cpp', 'objc']) |
| 43 | |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 44 | python = import('python').find_installation() |
| 45 | |
| 46 | link_language = meson.get_external_property('link_language', 'cpp') |
| 47 | if link_language == 'cpp' |
| 48 | add_languages('cpp', required: true, native: false) |
| 49 | endif |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 50 | if host_machine.system() == 'darwin' |
| 51 | add_languages('objc', required: false, native: false) |
| 52 | endif |
| 53 | |
Paolo Bonzini | 968b4db | 2020-02-03 14:45:33 +0100 | [diff] [blame] | 54 | if 'SPARSE_CFLAGS' in config_host |
| 55 | run_target('sparse', |
| 56 | command: [find_program('scripts/check_sparse.py'), |
| 57 | config_host['SPARSE_CFLAGS'].split(), |
| 58 | 'compile_commands.json']) |
| 59 | endif |
| 60 | |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 61 | configure_file(input: files('scripts/ninjatool.py'), |
| 62 | output: 'ninjatool', |
| 63 | configuration: config_host) |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 64 | |
| 65 | supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux'] |
| 66 | supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64', |
| 67 | 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64'] |
| 68 | |
| 69 | cpu = host_machine.cpu_family() |
| 70 | targetos = host_machine.system() |
| 71 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 72 | m = cc.find_library('m', required: false) |
| 73 | util = cc.find_library('util', required: false) |
Paolo Bonzini | 4a96337 | 2020-08-03 16:22:28 +0200 | [diff] [blame] | 74 | winmm = [] |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 75 | socket = [] |
Marc-André Lureau | 04c6f1e | 2019-07-18 00:31:05 +0400 | [diff] [blame] | 76 | version_res = [] |
Marc-André Lureau | d92989a | 2019-08-20 19:48:59 +0400 | [diff] [blame] | 77 | coref = [] |
| 78 | iokit = [] |
| 79 | cocoa = [] |
| 80 | hvf = [] |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 81 | if targetos == 'windows' |
| 82 | socket = cc.find_library('ws2_32') |
Paolo Bonzini | 4a96337 | 2020-08-03 16:22:28 +0200 | [diff] [blame] | 83 | winmm = cc.find_library('winmm') |
Marc-André Lureau | 04c6f1e | 2019-07-18 00:31:05 +0400 | [diff] [blame] | 84 | |
| 85 | win = import('windows') |
| 86 | version_res = win.compile_resources('version.rc', |
| 87 | depend_files: files('pc-bios/qemu-nsis.ico'), |
| 88 | include_directories: include_directories('.')) |
Marc-André Lureau | d92989a | 2019-08-20 19:48:59 +0400 | [diff] [blame] | 89 | elif targetos == 'darwin' |
| 90 | coref = dependency('appleframeworks', modules: 'CoreFoundation') |
| 91 | iokit = dependency('appleframeworks', modules: 'IOKit') |
| 92 | cocoa = dependency('appleframeworks', modules: 'Cocoa') |
| 93 | hvf = dependency('appleframeworks', modules: 'Hypervisor') |
Paolo Bonzini | cfad62f | 2020-08-09 23:47:45 +0200 | [diff] [blame] | 94 | elif targetos == 'sunos' |
| 95 | socket = [cc.find_library('socket'), |
| 96 | cc.find_library('nsl'), |
| 97 | cc.find_library('resolv')] |
| 98 | elif targetos == 'haiku' |
| 99 | socket = [cc.find_library('posix_error_mapper'), |
| 100 | cc.find_library('network'), |
| 101 | cc.find_library('bsd')] |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 102 | endif |
| 103 | glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(), |
| 104 | link_args: config_host['GLIB_LIBS'].split()) |
| 105 | gio = not_found |
| 106 | if 'CONFIG_GIO' in config_host |
| 107 | gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(), |
| 108 | link_args: config_host['GIO_LIBS'].split()) |
| 109 | endif |
| 110 | lttng = not_found |
| 111 | if 'CONFIG_TRACE_UST' in config_host |
| 112 | lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split()) |
| 113 | endif |
| 114 | urcubp = not_found |
| 115 | if 'CONFIG_TRACE_UST' in config_host |
| 116 | urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split()) |
| 117 | endif |
Daniel P. Berrangé | 46859d9 | 2020-09-01 14:30:49 +0100 | [diff] [blame] | 118 | gcrypt = not_found |
| 119 | if 'CONFIG_GCRYPT' in config_host |
| 120 | gcrypt = declare_dependency(compile_args: config_host['GCRYPT_CFLAGS'].split(), |
| 121 | link_args: config_host['GCRYPT_LIBS'].split()) |
| 122 | endif |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 123 | nettle = not_found |
| 124 | if 'CONFIG_NETTLE' in config_host |
| 125 | nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(), |
| 126 | link_args: config_host['NETTLE_LIBS'].split()) |
| 127 | endif |
| 128 | gnutls = not_found |
| 129 | if 'CONFIG_GNUTLS' in config_host |
| 130 | gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(), |
| 131 | link_args: config_host['GNUTLS_LIBS'].split()) |
| 132 | endif |
Paolo Bonzini | b7612f4 | 2020-08-26 08:22:58 +0200 | [diff] [blame] | 133 | pixman = not_found |
| 134 | if have_system or have_tools |
| 135 | pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8', |
Paolo Bonzini | 1a94933 | 2020-08-31 06:27:00 -0400 | [diff] [blame] | 136 | method: 'pkg-config', static: enable_static) |
Paolo Bonzini | b7612f4 | 2020-08-26 08:22:58 +0200 | [diff] [blame] | 137 | endif |
Marc-André Lureau | 5e7fbd2 | 2019-07-15 22:54:34 +0400 | [diff] [blame] | 138 | pam = not_found |
| 139 | if 'CONFIG_AUTH_PAM' in config_host |
| 140 | pam = cc.find_library('pam') |
| 141 | endif |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 142 | libaio = cc.find_library('aio', required: false) |
Paolo Bonzini | 1ffb3bb | 2020-08-28 19:33:54 +0200 | [diff] [blame] | 143 | zlib = dependency('zlib', required: true, static: enable_static) |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 144 | linux_io_uring = not_found |
| 145 | if 'CONFIG_LINUX_IO_URING' in config_host |
| 146 | linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(), |
| 147 | link_args: config_host['LINUX_IO_URING_LIBS'].split()) |
| 148 | endif |
| 149 | libxml2 = not_found |
| 150 | if 'CONFIG_LIBXML2' in config_host |
| 151 | libxml2 = declare_dependency(compile_args: config_host['LIBXML2_CFLAGS'].split(), |
| 152 | link_args: config_host['LIBXML2_LIBS'].split()) |
| 153 | endif |
| 154 | libnfs = not_found |
| 155 | if 'CONFIG_LIBNFS' in config_host |
| 156 | libnfs = declare_dependency(link_args: config_host['LIBNFS_LIBS'].split()) |
| 157 | endif |
Marc-André Lureau | ec0d589 | 2019-07-15 15:04:49 +0400 | [diff] [blame] | 158 | libattr = not_found |
| 159 | if 'CONFIG_ATTR' in config_host |
| 160 | libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split()) |
| 161 | endif |
Paolo Bonzini | 3f99cf5 | 2020-02-05 09:45:39 +0100 | [diff] [blame] | 162 | seccomp = not_found |
| 163 | if 'CONFIG_SECCOMP' in config_host |
| 164 | seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(), |
| 165 | link_args: config_host['SECCOMP_LIBS'].split()) |
| 166 | endif |
| 167 | libcap_ng = not_found |
| 168 | if 'CONFIG_LIBCAP_NG' in config_host |
| 169 | libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split()) |
| 170 | endif |
Paolo Bonzini | 1917ec6 | 2020-08-26 03:24:11 -0400 | [diff] [blame] | 171 | if get_option('xkbcommon').auto() and not have_system and not have_tools |
| 172 | xkbcommon = not_found |
| 173 | else |
| 174 | xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'), |
Paolo Bonzini | 1a94933 | 2020-08-31 06:27:00 -0400 | [diff] [blame] | 175 | method: 'pkg-config', static: enable_static) |
Marc-André Lureau | ade60d4 | 2019-07-15 14:48:31 +0400 | [diff] [blame] | 176 | endif |
Marc-André Lureau | cdaf072 | 2019-07-22 23:47:50 +0400 | [diff] [blame] | 177 | slirp = not_found |
| 178 | if config_host.has_key('CONFIG_SLIRP') |
| 179 | slirp = declare_dependency(compile_args: config_host['SLIRP_CFLAGS'].split(), |
| 180 | link_args: config_host['SLIRP_LIBS'].split()) |
| 181 | endif |
| 182 | vde = not_found |
| 183 | if config_host.has_key('CONFIG_VDE') |
| 184 | vde = declare_dependency(link_args: config_host['VDE_LIBS'].split()) |
| 185 | endif |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 186 | pulse = not_found |
| 187 | if 'CONFIG_LIBPULSE' in config_host |
| 188 | pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(), |
| 189 | link_args: config_host['PULSE_LIBS'].split()) |
| 190 | endif |
| 191 | alsa = not_found |
| 192 | if 'CONFIG_ALSA' in config_host |
| 193 | alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(), |
| 194 | link_args: config_host['ALSA_LIBS'].split()) |
| 195 | endif |
| 196 | jack = not_found |
| 197 | if 'CONFIG_LIBJACK' in config_host |
| 198 | jack = declare_dependency(link_args: config_host['JACK_LIBS'].split()) |
| 199 | endif |
Paolo Bonzini | 2634733 | 2019-07-29 15:40:07 +0200 | [diff] [blame] | 200 | spice = not_found |
| 201 | if 'CONFIG_SPICE' in config_host |
| 202 | spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(), |
| 203 | link_args: config_host['SPICE_LIBS'].split()) |
| 204 | endif |
Marc-André Lureau | 5ee24e7 | 2019-07-12 23:16:54 +0400 | [diff] [blame] | 205 | rt = cc.find_library('rt', required: false) |
Marc-André Lureau | 897b5af | 2019-07-16 21:54:15 +0400 | [diff] [blame] | 206 | libmpathpersist = not_found |
| 207 | if config_host.has_key('CONFIG_MPATH') |
| 208 | libmpathpersist = cc.find_library('mpathpersist') |
| 209 | endif |
Paolo Bonzini | 99650b6 | 2019-06-10 12:21:14 +0200 | [diff] [blame] | 210 | libiscsi = not_found |
| 211 | if 'CONFIG_LIBISCSI' in config_host |
| 212 | libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(), |
| 213 | link_args: config_host['LIBISCSI_LIBS'].split()) |
| 214 | endif |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 215 | zstd = not_found |
| 216 | if 'CONFIG_ZSTD' in config_host |
| 217 | zstd = declare_dependency(compile_args: config_host['ZSTD_CFLAGS'].split(), |
| 218 | link_args: config_host['ZSTD_LIBS'].split()) |
| 219 | endif |
Marc-André Lureau | ea45896 | 2019-07-12 22:23:46 +0400 | [diff] [blame] | 220 | gbm = not_found |
| 221 | if 'CONFIG_GBM' in config_host |
| 222 | gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(), |
| 223 | link_args: config_host['GBM_LIBS'].split()) |
| 224 | endif |
| 225 | virgl = not_found |
| 226 | if 'CONFIG_VIRGL' in config_host |
| 227 | virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(), |
| 228 | link_args: config_host['VIRGL_LIBS'].split()) |
| 229 | endif |
Marc-André Lureau | 1d7bb6a | 2019-07-12 23:47:06 +0400 | [diff] [blame] | 230 | curl = not_found |
| 231 | if 'CONFIG_CURL' in config_host |
| 232 | curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(), |
| 233 | link_args: config_host['CURL_LIBS'].split()) |
| 234 | endif |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 235 | libudev = not_found |
| 236 | if 'CONFIG_LIBUDEV' in config_host |
| 237 | libudev = declare_dependency(link_args: config_host['LIBUDEV_LIBS'].split()) |
| 238 | endif |
Paolo Bonzini | 2634733 | 2019-07-29 15:40:07 +0200 | [diff] [blame] | 239 | brlapi = not_found |
| 240 | if 'CONFIG_BRLAPI' in config_host |
| 241 | brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split()) |
| 242 | endif |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 243 | |
Paolo Bonzini | 760e432 | 2020-08-26 08:09:48 +0200 | [diff] [blame] | 244 | sdl = not_found |
| 245 | if have_system |
Yonggang Luo | 363743d | 2020-08-26 23:10:03 +0800 | [diff] [blame] | 246 | sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static) |
Paolo Bonzini | 760e432 | 2020-08-26 08:09:48 +0200 | [diff] [blame] | 247 | sdl_image = not_found |
| 248 | endif |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 249 | if sdl.found() |
| 250 | # work around 2.0.8 bug |
| 251 | sdl = declare_dependency(compile_args: '-Wno-undef', |
| 252 | dependencies: sdl) |
Volker Rümelin | 7161a43 | 2020-08-29 12:41:58 +0200 | [diff] [blame] | 253 | sdl_image = dependency('SDL2_image', required: get_option('sdl_image'), |
Paolo Bonzini | 1a94933 | 2020-08-31 06:27:00 -0400 | [diff] [blame] | 254 | method: 'pkg-config', static: enable_static) |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 255 | else |
| 256 | if get_option('sdl_image').enabled() |
| 257 | error('sdl-image required, but SDL was @0@', |
| 258 | get_option('sdl').disabled() ? 'disabled' : 'not found') |
| 259 | endif |
| 260 | sdl_image = not_found |
Paolo Bonzini | 2634733 | 2019-07-29 15:40:07 +0200 | [diff] [blame] | 261 | endif |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 262 | |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 263 | rbd = not_found |
| 264 | if 'CONFIG_RBD' in config_host |
| 265 | rbd = declare_dependency(link_args: config_host['RBD_LIBS'].split()) |
| 266 | endif |
| 267 | glusterfs = not_found |
| 268 | if 'CONFIG_GLUSTERFS' in config_host |
| 269 | glusterfs = declare_dependency(compile_args: config_host['GLUSTERFS_CFLAGS'].split(), |
| 270 | link_args: config_host['GLUSTERFS_LIBS'].split()) |
| 271 | endif |
| 272 | libssh = not_found |
| 273 | if 'CONFIG_LIBSSH' in config_host |
| 274 | libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(), |
| 275 | link_args: config_host['LIBSSH_LIBS'].split()) |
| 276 | endif |
| 277 | libbzip2 = not_found |
| 278 | if 'CONFIG_BZIP2' in config_host |
| 279 | libbzip2 = declare_dependency(link_args: config_host['BZIP2_LIBS'].split()) |
| 280 | endif |
| 281 | liblzfse = not_found |
| 282 | if 'CONFIG_LZFSE' in config_host |
| 283 | liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split()) |
| 284 | endif |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 285 | oss = not_found |
| 286 | if 'CONFIG_AUDIO_OSS' in config_host |
| 287 | oss = declare_dependency(link_args: config_host['OSS_LIBS'].split()) |
| 288 | endif |
| 289 | dsound = not_found |
| 290 | if 'CONFIG_AUDIO_DSOUND' in config_host |
| 291 | dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split()) |
| 292 | endif |
| 293 | coreaudio = not_found |
| 294 | if 'CONFIG_AUDIO_COREAUDIO' in config_host |
| 295 | coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split()) |
| 296 | endif |
Marc-André Lureau | 2b1ccdf | 2019-07-16 23:21:02 +0400 | [diff] [blame] | 297 | opengl = not_found |
| 298 | if 'CONFIG_OPENGL' in config_host |
| 299 | opengl = declare_dependency(link_args: config_host['OPENGL_LIBS'].split()) |
| 300 | else |
| 301 | endif |
| 302 | gtk = not_found |
| 303 | if 'CONFIG_GTK' in config_host |
| 304 | gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(), |
| 305 | link_args: config_host['GTK_LIBS'].split()) |
| 306 | endif |
| 307 | vte = not_found |
| 308 | if 'CONFIG_VTE' in config_host |
| 309 | vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(), |
| 310 | link_args: config_host['VTE_LIBS'].split()) |
| 311 | endif |
| 312 | x11 = not_found |
| 313 | if 'CONFIG_X11' in config_host |
| 314 | x11 = declare_dependency(compile_args: config_host['X11_CFLAGS'].split(), |
| 315 | link_args: config_host['X11_LIBS'].split()) |
| 316 | endif |
| 317 | curses = not_found |
| 318 | if 'CONFIG_CURSES' in config_host |
| 319 | curses = declare_dependency(compile_args: config_host['CURSES_CFLAGS'].split(), |
| 320 | link_args: config_host['CURSES_LIBS'].split()) |
| 321 | endif |
| 322 | iconv = not_found |
| 323 | if 'CONFIG_ICONV' in config_host |
| 324 | iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(), |
| 325 | link_args: config_host['ICONV_LIBS'].split()) |
| 326 | endif |
| 327 | gio = not_found |
| 328 | if 'CONFIG_GIO' in config_host |
| 329 | gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(), |
| 330 | link_args: config_host['GIO_LIBS'].split()) |
| 331 | endif |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 332 | vnc = not_found |
Marc-André Lureau | 2b1ccdf | 2019-07-16 23:21:02 +0400 | [diff] [blame] | 333 | png = not_found |
Marc-André Lureau | 2b1ccdf | 2019-07-16 23:21:02 +0400 | [diff] [blame] | 334 | jpeg = not_found |
Marc-André Lureau | 2b1ccdf | 2019-07-16 23:21:02 +0400 | [diff] [blame] | 335 | sasl = not_found |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 336 | if get_option('vnc').enabled() |
| 337 | vnc = declare_dependency() # dummy dependency |
| 338 | png = dependency('libpng', required: get_option('vnc_png'), |
Paolo Bonzini | 1a94933 | 2020-08-31 06:27:00 -0400 | [diff] [blame] | 339 | method: 'pkg-config', static: enable_static) |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 340 | jpeg = cc.find_library('jpeg', has_headers: ['jpeglib.h'], |
| 341 | required: get_option('vnc_jpeg'), |
| 342 | static: enable_static) |
| 343 | sasl = cc.find_library('sasl2', has_headers: ['sasl/sasl.h'], |
| 344 | required: get_option('vnc_sasl'), |
| 345 | static: enable_static) |
| 346 | if sasl.found() |
| 347 | sasl = declare_dependency(dependencies: sasl, |
| 348 | compile_args: '-DSTRUCT_IOVEC_DEFINED') |
| 349 | endif |
Marc-André Lureau | 2b1ccdf | 2019-07-16 23:21:02 +0400 | [diff] [blame] | 350 | endif |
Paolo Bonzini | 4a96337 | 2020-08-03 16:22:28 +0200 | [diff] [blame] | 351 | fdt = not_found |
| 352 | if 'CONFIG_FDT' in config_host |
| 353 | fdt = declare_dependency(compile_args: config_host['FDT_CFLAGS'].split(), |
| 354 | link_args: config_host['FDT_LIBS'].split()) |
| 355 | endif |
Marc-André Lureau | 708eab4 | 2019-09-03 16:59:33 +0400 | [diff] [blame] | 356 | snappy = not_found |
| 357 | if 'CONFIG_SNAPPY' in config_host |
| 358 | snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split()) |
| 359 | endif |
| 360 | lzo = not_found |
| 361 | if 'CONFIG_LZO' in config_host |
| 362 | lzo = declare_dependency(link_args: config_host['LZO_LIBS'].split()) |
| 363 | endif |
Marc-André Lureau | 5516623 | 2019-07-24 19:16:22 +0400 | [diff] [blame] | 364 | rdma = not_found |
| 365 | if 'CONFIG_RDMA' in config_host |
| 366 | rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split()) |
| 367 | endif |
Marc-André Lureau | ab31805 | 2019-07-24 19:23:16 +0400 | [diff] [blame] | 368 | numa = not_found |
| 369 | if 'CONFIG_NUMA' in config_host |
| 370 | numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split()) |
| 371 | endif |
Marc-André Lureau | 582ea95 | 2019-08-15 15:15:32 +0400 | [diff] [blame] | 372 | xen = not_found |
| 373 | if 'CONFIG_XEN_BACKEND' in config_host |
| 374 | xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(), |
| 375 | link_args: config_host['XEN_LIBS'].split()) |
| 376 | endif |
Paolo Bonzini | 06677ce | 2020-08-06 13:07:39 +0200 | [diff] [blame] | 377 | cacard = not_found |
| 378 | if 'CONFIG_SMARTCARD' in config_host |
| 379 | cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(), |
| 380 | link_args: config_host['SMARTCARD_LIBS'].split()) |
| 381 | endif |
César Belley | 0a40bcb | 2020-08-26 13:42:04 +0200 | [diff] [blame] | 382 | u2f = not_found |
| 383 | if have_system |
| 384 | u2f = dependency('u2f-emu', required: get_option('u2f'), |
| 385 | method: 'pkg-config', |
| 386 | static: enable_static) |
| 387 | endif |
Paolo Bonzini | 06677ce | 2020-08-06 13:07:39 +0200 | [diff] [blame] | 388 | usbredir = not_found |
| 389 | if 'CONFIG_USB_REDIR' in config_host |
| 390 | usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(), |
| 391 | link_args: config_host['USB_REDIR_LIBS'].split()) |
| 392 | endif |
| 393 | libusb = not_found |
| 394 | if 'CONFIG_USB_LIBUSB' in config_host |
| 395 | libusb = declare_dependency(compile_args: config_host['LIBUSB_CFLAGS'].split(), |
| 396 | link_args: config_host['LIBUSB_LIBS'].split()) |
| 397 | endif |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 398 | capstone = not_found |
| 399 | if 'CONFIG_CAPSTONE' in config_host |
| 400 | capstone = declare_dependency(compile_args: config_host['CAPSTONE_CFLAGS'].split(), |
| 401 | link_args: config_host['CAPSTONE_LIBS'].split()) |
| 402 | endif |
| 403 | libpmem = not_found |
| 404 | if 'CONFIG_LIBPMEM' in config_host |
| 405 | libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(), |
| 406 | link_args: config_host['LIBPMEM_LIBS'].split()) |
| 407 | endif |
Bruce Rogers | c7c91a7 | 2020-08-24 09:52:12 -0600 | [diff] [blame] | 408 | libdaxctl = not_found |
| 409 | if 'CONFIG_LIBDAXCTL' in config_host |
| 410 | libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split()) |
| 411 | endif |
Marc-André Lureau | 8ce0a45 | 2020-08-28 15:07:20 +0400 | [diff] [blame] | 412 | tasn1 = not_found |
| 413 | if 'CONFIG_TASN1' in config_host |
| 414 | tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(), |
| 415 | link_args: config_host['TASN1_LIBS'].split()) |
| 416 | endif |
Marc-André Lureau | af04e89 | 2020-08-28 15:07:25 +0400 | [diff] [blame] | 417 | keyutils = dependency('libkeyutils', required: false, |
| 418 | method: 'pkg-config', static: enable_static) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 419 | |
Marc-André Lureau | 3909def | 2020-08-28 15:07:33 +0400 | [diff] [blame] | 420 | has_gettid = cc.has_function('gettid') |
| 421 | |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 422 | # Create config-host.h |
| 423 | |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 424 | config_host_data.set('CONFIG_SDL', sdl.found()) |
| 425 | config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 426 | config_host_data.set('CONFIG_VNC', vnc.found()) |
| 427 | config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) |
| 428 | config_host_data.set('CONFIG_VNC_PNG', png.found()) |
| 429 | config_host_data.set('CONFIG_VNC_SASL', sasl.found()) |
Laurent Vivier | 4113f4c | 2020-08-24 17:24:29 +0200 | [diff] [blame] | 430 | config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found()) |
Marc-André Lureau | af04e89 | 2020-08-28 15:07:25 +0400 | [diff] [blame] | 431 | config_host_data.set('CONFIG_KEYUTILS', keyutils.found()) |
Marc-André Lureau | 3909def | 2020-08-28 15:07:33 +0400 | [diff] [blame] | 432 | config_host_data.set('CONFIG_GETTID', has_gettid) |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 433 | config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version())) |
| 434 | config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]) |
| 435 | config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1]) |
| 436 | config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]) |
| 437 | |
| 438 | arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] |
| 439 | strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'qemu_confdir', 'qemu_datadir', |
| 440 | 'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir', |
| 441 | 'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath'] |
| 442 | foreach k, v: config_host |
| 443 | if arrays.contains(k) |
| 444 | if v != '' |
| 445 | v = '"' + '", "'.join(v.split()) + '", ' |
| 446 | endif |
| 447 | config_host_data.set(k, v) |
| 448 | elif k == 'ARCH' |
| 449 | config_host_data.set('HOST_' + v.to_upper(), 1) |
| 450 | elif strings.contains(k) |
| 451 | if not k.startswith('CONFIG_') |
| 452 | k = 'CONFIG_' + k.to_upper() |
| 453 | endif |
| 454 | config_host_data.set_quoted(k, v) |
| 455 | elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_') |
| 456 | config_host_data.set(k, v == 'y' ? 1 : v) |
| 457 | endif |
| 458 | endforeach |
| 459 | genh += configure_file(output: 'config-host.h', configuration: config_host_data) |
| 460 | |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 461 | minikconf = find_program('scripts/minikconf.py') |
Paolo Bonzini | a98006b | 2020-09-01 05:32:23 -0400 | [diff] [blame] | 462 | config_all_devices = {} |
Paolo Bonzini | ca0fc78 | 2020-09-01 06:04:28 -0400 | [diff] [blame^] | 463 | config_all_disas = {} |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 464 | config_devices_mak_list = [] |
| 465 | config_devices_h = {} |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 466 | config_target_h = {} |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 467 | config_target_mak = {} |
Paolo Bonzini | ca0fc78 | 2020-09-01 06:04:28 -0400 | [diff] [blame^] | 468 | |
| 469 | disassemblers = { |
| 470 | 'alpha' : ['CONFIG_ALPHA_DIS'], |
| 471 | 'arm' : ['CONFIG_ARM_DIS'], |
| 472 | 'avr' : ['CONFIG_AVR_DIS'], |
| 473 | 'cris' : ['CONFIG_CRIS_DIS'], |
| 474 | 'hppa' : ['CONFIG_HPPA_DIS'], |
| 475 | 'i386' : ['CONFIG_I386_DIS'], |
| 476 | 'x86_64' : ['CONFIG_I386_DIS'], |
| 477 | 'x32' : ['CONFIG_I386_DIS'], |
| 478 | 'lm32' : ['CONFIG_LM32_DIS'], |
| 479 | 'm68k' : ['CONFIG_M68K_DIS'], |
| 480 | 'microblaze' : ['CONFIG_MICROBLAZE_DIS'], |
| 481 | 'mips' : ['CONFIG_MIPS_DIS'], |
| 482 | 'moxie' : ['CONFIG_MOXIE_DIS'], |
| 483 | 'nios2' : ['CONFIG_NIOS2_DIS'], |
| 484 | 'or1k' : ['CONFIG_OPENRISC_DIS'], |
| 485 | 'ppc' : ['CONFIG_PPC_DIS'], |
| 486 | 'riscv' : ['CONFIG_RISCV_DIS'], |
| 487 | 'rx' : ['CONFIG_RX_DIS'], |
| 488 | 's390' : ['CONFIG_S390_DIS'], |
| 489 | 'sh4' : ['CONFIG_SH4_DIS'], |
| 490 | 'sparc' : ['CONFIG_SPARC_DIS'], |
| 491 | 'xtensa' : ['CONFIG_XTENSA_DIS'], |
| 492 | } |
| 493 | if link_language == 'cpp' |
| 494 | disassemblers += { |
| 495 | 'aarch64' : [ 'CONFIG_ARM_A64_DIS'], |
| 496 | 'arm' : [ 'CONFIG_ARM_DIS', 'CONFIG_ARM_A64_DIS'], |
| 497 | 'mips' : [ 'CONFIG_MIPS_DIS', 'CONFIG_NANOMIPS_DIS'], |
| 498 | } |
| 499 | endif |
| 500 | |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 501 | kconfig_external_symbols = [ |
| 502 | 'CONFIG_KVM', |
| 503 | 'CONFIG_XEN', |
| 504 | 'CONFIG_TPM', |
| 505 | 'CONFIG_SPICE', |
| 506 | 'CONFIG_IVSHMEM', |
| 507 | 'CONFIG_OPENGL', |
| 508 | 'CONFIG_X11', |
| 509 | 'CONFIG_VHOST_USER', |
| 510 | 'CONFIG_VHOST_KERNEL', |
| 511 | 'CONFIG_VIRTFS', |
| 512 | 'CONFIG_LINUX', |
| 513 | 'CONFIG_PVRDMA', |
| 514 | ] |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 515 | ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS'] |
Paolo Bonzini | ca0fc78 | 2020-09-01 06:04:28 -0400 | [diff] [blame^] | 516 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 517 | foreach target : target_dirs |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 518 | config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak') |
| 519 | |
Paolo Bonzini | ca0fc78 | 2020-09-01 06:04:28 -0400 | [diff] [blame^] | 520 | foreach k, v: disassemblers |
| 521 | if config_host['ARCH'].startswith(k) or config_target['TARGET_BASE_ARCH'].startswith(k) |
| 522 | foreach sym: v |
| 523 | config_target += { sym: 'y' } |
| 524 | config_all_disas += { sym: 'y' } |
| 525 | endforeach |
| 526 | endif |
| 527 | endforeach |
| 528 | |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 529 | config_target_data = configuration_data() |
| 530 | foreach k, v: config_target |
| 531 | if not k.startswith('TARGET_') and not k.startswith('CONFIG_') |
| 532 | # do nothing |
| 533 | elif ignored.contains(k) |
| 534 | # do nothing |
| 535 | elif k == 'TARGET_BASE_ARCH' |
| 536 | config_target_data.set('TARGET_' + v.to_upper(), 1) |
| 537 | elif k == 'TARGET_NAME' |
| 538 | config_target_data.set_quoted(k, v) |
| 539 | elif v == 'y' |
| 540 | config_target_data.set(k, 1) |
| 541 | else |
| 542 | config_target_data.set(k, v) |
| 543 | endif |
| 544 | endforeach |
| 545 | config_target_h += {target: configure_file(output: target + '-config-target.h', |
| 546 | configuration: config_target_data)} |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 547 | |
| 548 | if target.endswith('-softmmu') |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 549 | base_kconfig = [] |
| 550 | foreach sym : kconfig_external_symbols |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 551 | if sym in config_target or sym in config_host |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 552 | base_kconfig += '@0@=y'.format(sym) |
| 553 | endif |
| 554 | endforeach |
| 555 | |
| 556 | config_devices_mak = target + '-config-devices.mak' |
| 557 | config_devices_mak = configure_file( |
| 558 | input: ['default-configs' / target + '.mak', 'Kconfig'], |
| 559 | output: config_devices_mak, |
| 560 | depfile: config_devices_mak + '.d', |
| 561 | capture: true, |
| 562 | command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'], |
| 563 | config_devices_mak, '@DEPFILE@', '@INPUT@', |
| 564 | base_kconfig]) |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 565 | |
| 566 | config_devices_data = configuration_data() |
| 567 | config_devices = keyval.load(config_devices_mak) |
| 568 | foreach k, v: config_devices |
| 569 | config_devices_data.set(k, 1) |
| 570 | endforeach |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 571 | config_devices_mak_list += config_devices_mak |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 572 | config_devices_h += {target: configure_file(output: target + '-config-devices.h', |
| 573 | configuration: config_devices_data)} |
| 574 | config_target += config_devices |
Paolo Bonzini | a98006b | 2020-09-01 05:32:23 -0400 | [diff] [blame] | 575 | config_all_devices += config_devices |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 576 | endif |
| 577 | config_target_mak += {target: config_target} |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 578 | endforeach |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 579 | |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 580 | # This configuration is used to build files that are shared by |
| 581 | # multiple binaries, and then extracted out of the "common" |
| 582 | # static_library target. |
| 583 | # |
| 584 | # We do not use all_sources()/all_dependencies(), because it would |
| 585 | # build literally all source files, including devices only used by |
| 586 | # targets that are not built for this compilation. The CONFIG_ALL |
| 587 | # pseudo symbol replaces it. |
| 588 | |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 589 | config_all = config_all_devices |
| 590 | config_all += config_host |
| 591 | config_all += config_all_disas |
| 592 | config_all += { |
| 593 | 'CONFIG_XEN': config_host.has_key('CONFIG_XEN_BACKEND'), |
| 594 | 'CONFIG_SOFTMMU': have_system, |
| 595 | 'CONFIG_USER_ONLY': have_user, |
| 596 | 'CONFIG_ALL': true, |
| 597 | } |
| 598 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 599 | # Generators |
| 600 | |
Marc-André Lureau | 3f88565 | 2019-07-15 18:06:04 +0400 | [diff] [blame] | 601 | hxtool = find_program('scripts/hxtool') |
Marc-André Lureau | 650b5d5 | 2019-07-15 17:36:47 +0400 | [diff] [blame] | 602 | shaderinclude = find_program('scripts/shaderinclude.pl') |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 603 | qapi_gen = find_program('scripts/qapi-gen.py') |
| 604 | qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py', |
| 605 | meson.source_root() / 'scripts/qapi/commands.py', |
| 606 | meson.source_root() / 'scripts/qapi/common.py', |
| 607 | meson.source_root() / 'scripts/qapi/doc.py', |
| 608 | meson.source_root() / 'scripts/qapi/error.py', |
| 609 | meson.source_root() / 'scripts/qapi/events.py', |
| 610 | meson.source_root() / 'scripts/qapi/expr.py', |
| 611 | meson.source_root() / 'scripts/qapi/gen.py', |
| 612 | meson.source_root() / 'scripts/qapi/introspect.py', |
| 613 | meson.source_root() / 'scripts/qapi/parser.py', |
| 614 | meson.source_root() / 'scripts/qapi/schema.py', |
| 615 | meson.source_root() / 'scripts/qapi/source.py', |
| 616 | meson.source_root() / 'scripts/qapi/types.py', |
| 617 | meson.source_root() / 'scripts/qapi/visit.py', |
| 618 | meson.source_root() / 'scripts/qapi/common.py', |
| 619 | meson.source_root() / 'scripts/qapi/doc.py', |
| 620 | meson.source_root() / 'scripts/qapi-gen.py' |
| 621 | ] |
| 622 | |
| 623 | tracetool = [ |
| 624 | python, files('scripts/tracetool.py'), |
| 625 | '--backend=' + config_host['TRACE_BACKENDS'] |
| 626 | ] |
| 627 | |
Marc-André Lureau | 2c273f3 | 2019-07-15 17:10:19 +0400 | [diff] [blame] | 628 | qemu_version_cmd = [find_program('scripts/qemu-version.sh'), |
| 629 | meson.current_source_dir(), |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 630 | config_host['PKGVERSION'], meson.project_version()] |
Marc-André Lureau | 2c273f3 | 2019-07-15 17:10:19 +0400 | [diff] [blame] | 631 | qemu_version = custom_target('qemu-version.h', |
| 632 | output: 'qemu-version.h', |
| 633 | command: qemu_version_cmd, |
| 634 | capture: true, |
| 635 | build_by_default: true, |
| 636 | build_always_stale: true) |
| 637 | genh += qemu_version |
| 638 | |
Marc-André Lureau | 3f88565 | 2019-07-15 18:06:04 +0400 | [diff] [blame] | 639 | hxdep = [] |
| 640 | hx_headers = [ |
| 641 | ['qemu-options.hx', 'qemu-options.def'], |
| 642 | ['qemu-img-cmds.hx', 'qemu-img-cmds.h'], |
| 643 | ] |
| 644 | if have_system |
| 645 | hx_headers += [ |
| 646 | ['hmp-commands.hx', 'hmp-commands.h'], |
| 647 | ['hmp-commands-info.hx', 'hmp-commands-info.h'], |
| 648 | ] |
| 649 | endif |
| 650 | foreach d : hx_headers |
Marc-André Lureau | b7c70bf | 2019-07-16 21:37:25 +0400 | [diff] [blame] | 651 | hxdep += custom_target(d[1], |
Marc-André Lureau | 3f88565 | 2019-07-15 18:06:04 +0400 | [diff] [blame] | 652 | input: files(d[0]), |
| 653 | output: d[1], |
| 654 | capture: true, |
| 655 | build_by_default: true, # to be removed when added to a target |
| 656 | command: [hxtool, '-h', '@INPUT0@']) |
| 657 | endforeach |
| 658 | genh += hxdep |
| 659 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 660 | # Collect sourcesets. |
| 661 | |
| 662 | util_ss = ss.source_set() |
| 663 | stub_ss = ss.source_set() |
| 664 | trace_ss = ss.source_set() |
Marc-André Lureau | 3154fee | 2019-08-29 22:07:01 +0400 | [diff] [blame] | 665 | block_ss = ss.source_set() |
Paolo Bonzini | 4a96337 | 2020-08-03 16:22:28 +0200 | [diff] [blame] | 666 | blockdev_ss = ss.source_set() |
Paolo Bonzini | ff219dc | 2020-08-04 21:14:26 +0200 | [diff] [blame] | 667 | qmp_ss = ss.source_set() |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 668 | common_ss = ss.source_set() |
| 669 | softmmu_ss = ss.source_set() |
| 670 | user_ss = ss.source_set() |
| 671 | bsd_user_ss = ss.source_set() |
| 672 | linux_user_ss = ss.source_set() |
| 673 | specific_ss = ss.source_set() |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 674 | specific_fuzz_ss = ss.source_set() |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 675 | |
Marc-André Lureau | 3154fee | 2019-08-29 22:07:01 +0400 | [diff] [blame] | 676 | modules = {} |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 677 | hw_arch = {} |
| 678 | target_arch = {} |
| 679 | target_softmmu_arch = {} |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 680 | |
| 681 | ############### |
| 682 | # Trace files # |
| 683 | ############### |
| 684 | |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 685 | # TODO: add each directory to the subdirs from its own meson.build, once |
| 686 | # we have those |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 687 | trace_events_subdirs = [ |
| 688 | 'accel/kvm', |
| 689 | 'accel/tcg', |
| 690 | 'crypto', |
| 691 | 'monitor', |
| 692 | ] |
| 693 | if have_user |
| 694 | trace_events_subdirs += [ 'linux-user' ] |
| 695 | endif |
| 696 | if have_block |
| 697 | trace_events_subdirs += [ |
| 698 | 'authz', |
| 699 | 'block', |
| 700 | 'io', |
| 701 | 'nbd', |
| 702 | 'scsi', |
| 703 | ] |
| 704 | endif |
| 705 | if have_system |
| 706 | trace_events_subdirs += [ |
| 707 | 'audio', |
| 708 | 'backends', |
| 709 | 'backends/tpm', |
| 710 | 'chardev', |
| 711 | 'hw/9pfs', |
| 712 | 'hw/acpi', |
| 713 | 'hw/alpha', |
| 714 | 'hw/arm', |
| 715 | 'hw/audio', |
| 716 | 'hw/block', |
| 717 | 'hw/block/dataplane', |
| 718 | 'hw/char', |
| 719 | 'hw/display', |
| 720 | 'hw/dma', |
| 721 | 'hw/hppa', |
| 722 | 'hw/hyperv', |
| 723 | 'hw/i2c', |
| 724 | 'hw/i386', |
| 725 | 'hw/i386/xen', |
| 726 | 'hw/ide', |
| 727 | 'hw/input', |
| 728 | 'hw/intc', |
| 729 | 'hw/isa', |
| 730 | 'hw/mem', |
| 731 | 'hw/mips', |
| 732 | 'hw/misc', |
| 733 | 'hw/misc/macio', |
| 734 | 'hw/net', |
| 735 | 'hw/nvram', |
| 736 | 'hw/pci', |
| 737 | 'hw/pci-host', |
| 738 | 'hw/ppc', |
| 739 | 'hw/rdma', |
| 740 | 'hw/rdma/vmw', |
| 741 | 'hw/rtc', |
| 742 | 'hw/s390x', |
| 743 | 'hw/scsi', |
| 744 | 'hw/sd', |
| 745 | 'hw/sparc', |
| 746 | 'hw/sparc64', |
| 747 | 'hw/ssi', |
| 748 | 'hw/timer', |
| 749 | 'hw/tpm', |
| 750 | 'hw/usb', |
| 751 | 'hw/vfio', |
| 752 | 'hw/virtio', |
| 753 | 'hw/watchdog', |
| 754 | 'hw/xen', |
| 755 | 'hw/gpio', |
| 756 | 'hw/riscv', |
| 757 | 'migration', |
| 758 | 'net', |
| 759 | 'ui', |
| 760 | ] |
| 761 | endif |
| 762 | trace_events_subdirs += [ |
| 763 | 'hw/core', |
| 764 | 'qapi', |
| 765 | 'qom', |
| 766 | 'target/arm', |
| 767 | 'target/hppa', |
| 768 | 'target/i386', |
| 769 | 'target/mips', |
| 770 | 'target/ppc', |
| 771 | 'target/riscv', |
| 772 | 'target/s390x', |
| 773 | 'target/sparc', |
| 774 | 'util', |
| 775 | ] |
| 776 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 777 | subdir('qapi') |
| 778 | subdir('qobject') |
| 779 | subdir('stubs') |
| 780 | subdir('trace') |
| 781 | subdir('util') |
Marc-André Lureau | 5582c58 | 2019-07-16 19:28:54 +0400 | [diff] [blame] | 782 | subdir('qom') |
| 783 | subdir('authz') |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 784 | subdir('crypto') |
Marc-André Lureau | 2d78b56 | 2019-07-15 16:00:36 +0400 | [diff] [blame] | 785 | subdir('ui') |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 786 | |
Marc-André Lureau | 3154fee | 2019-08-29 22:07:01 +0400 | [diff] [blame] | 787 | |
| 788 | if enable_modules |
| 789 | libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO') |
| 790 | modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO') |
| 791 | endif |
| 792 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 793 | # Build targets from sourcesets |
| 794 | |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 795 | stub_ss = stub_ss.apply(config_all, strict: false) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 796 | |
| 797 | util_ss.add_all(trace_ss) |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 798 | util_ss = util_ss.apply(config_all, strict: false) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 799 | libqemuutil = static_library('qemuutil', |
| 800 | sources: util_ss.sources() + stub_ss.sources() + genh, |
| 801 | dependencies: [util_ss.dependencies(), m, glib, socket]) |
| 802 | qemuutil = declare_dependency(link_with: libqemuutil, |
Marc-André Lureau | 04c6f1e | 2019-07-18 00:31:05 +0400 | [diff] [blame] | 803 | sources: genh + version_res) |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 804 | |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 805 | decodetree = generator(find_program('scripts/decodetree.py'), |
| 806 | output: 'decode-@BASENAME@.c.inc', |
| 807 | arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@']) |
| 808 | |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 809 | subdir('audio') |
Marc-André Lureau | 7fcfd45 | 2019-07-16 19:33:55 +0400 | [diff] [blame] | 810 | subdir('io') |
Marc-André Lureau | 848e8ff | 2019-07-15 23:18:07 +0400 | [diff] [blame] | 811 | subdir('chardev') |
Marc-André Lureau | ec0d589 | 2019-07-15 15:04:49 +0400 | [diff] [blame] | 812 | subdir('fsdev') |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 813 | subdir('libdecnumber') |
Marc-André Lureau | d3b1848 | 2019-08-17 14:55:32 +0400 | [diff] [blame] | 814 | subdir('target') |
Marc-André Lureau | 708eab4 | 2019-09-03 16:59:33 +0400 | [diff] [blame] | 815 | subdir('dump') |
Marc-André Lureau | ec0d589 | 2019-07-15 15:04:49 +0400 | [diff] [blame] | 816 | |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 817 | block_ss.add(files( |
| 818 | 'block.c', |
| 819 | 'blockjob.c', |
| 820 | 'job.c', |
| 821 | 'qemu-io-cmds.c', |
| 822 | )) |
| 823 | block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c')) |
| 824 | |
| 825 | subdir('nbd') |
| 826 | subdir('scsi') |
| 827 | subdir('block') |
| 828 | |
Paolo Bonzini | 4a96337 | 2020-08-03 16:22:28 +0200 | [diff] [blame] | 829 | blockdev_ss.add(files( |
| 830 | 'blockdev.c', |
| 831 | 'blockdev-nbd.c', |
| 832 | 'iothread.c', |
| 833 | 'job-qmp.c', |
| 834 | )) |
| 835 | |
| 836 | # os-posix.c contains POSIX-specific functions used by qemu-storage-daemon, |
| 837 | # os-win32.c does not |
| 838 | blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c')) |
| 839 | softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')]) |
| 840 | |
| 841 | softmmu_ss.add_all(blockdev_ss) |
| 842 | softmmu_ss.add(files( |
| 843 | 'bootdevice.c', |
| 844 | 'dma-helpers.c', |
| 845 | 'qdev-monitor.c', |
| 846 | ), sdl) |
| 847 | |
| 848 | softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) |
| 849 | softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), seccomp]) |
| 850 | softmmu_ss.add(when: ['CONFIG_FDT', fdt], if_true: [files('device_tree.c')]) |
| 851 | |
| 852 | common_ss.add(files('cpus-common.c')) |
| 853 | |
Paolo Bonzini | 5d3ea0e | 2020-08-06 13:40:26 +0200 | [diff] [blame] | 854 | subdir('softmmu') |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 855 | |
Bruce Rogers | c7c91a7 | 2020-08-24 09:52:12 -0600 | [diff] [blame] | 856 | specific_ss.add(files('disas.c', 'exec.c', 'gdbstub.c'), capstone, libpmem, libdaxctl) |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 857 | specific_ss.add(files('exec-vary.c')) |
| 858 | specific_ss.add(when: 'CONFIG_TCG', if_true: files( |
| 859 | 'fpu/softfloat.c', |
| 860 | 'tcg/optimize.c', |
| 861 | 'tcg/tcg-common.c', |
| 862 | 'tcg/tcg-op-gvec.c', |
| 863 | 'tcg/tcg-op-vec.c', |
| 864 | 'tcg/tcg-op.c', |
| 865 | 'tcg/tcg.c', |
| 866 | )) |
| 867 | specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.c', 'tcg/tci.c')) |
| 868 | |
Marc-André Lureau | ab31805 | 2019-07-24 19:23:16 +0400 | [diff] [blame] | 869 | subdir('backends') |
Marc-André Lureau | c574e16 | 2019-07-26 12:02:31 +0400 | [diff] [blame] | 870 | subdir('disas') |
Marc-André Lureau | 5516623 | 2019-07-24 19:16:22 +0400 | [diff] [blame] | 871 | subdir('migration') |
Paolo Bonzini | ff219dc | 2020-08-04 21:14:26 +0200 | [diff] [blame] | 872 | subdir('monitor') |
Marc-André Lureau | cdaf072 | 2019-07-22 23:47:50 +0400 | [diff] [blame] | 873 | subdir('net') |
Marc-André Lureau | 17ef2af | 2019-07-22 23:40:45 +0400 | [diff] [blame] | 874 | subdir('replay') |
Marc-André Lureau | 582ea95 | 2019-08-15 15:15:32 +0400 | [diff] [blame] | 875 | subdir('hw') |
Marc-André Lureau | 1a82878 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 876 | subdir('accel') |
Paolo Bonzini | f556b4a | 2020-01-24 13:08:01 +0100 | [diff] [blame] | 877 | subdir('plugins') |
Marc-André Lureau | b309c32 | 2019-08-18 19:20:37 +0400 | [diff] [blame] | 878 | subdir('bsd-user') |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 879 | subdir('linux-user') |
| 880 | |
Marc-André Lureau | b309c32 | 2019-08-18 19:20:37 +0400 | [diff] [blame] | 881 | bsd_user_ss.add(files('gdbstub.c')) |
| 882 | specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) |
| 883 | |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 884 | linux_user_ss.add(files('gdbstub.c', 'thunk.c')) |
| 885 | specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss) |
Paolo Bonzini | 5d3ea0e | 2020-08-06 13:40:26 +0200 | [diff] [blame] | 886 | |
Paolo Bonzini | a2ce7db | 2020-08-04 20:00:40 +0200 | [diff] [blame] | 887 | # needed for fuzzing binaries |
| 888 | subdir('tests/qtest/libqos') |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 889 | subdir('tests/qtest/fuzz') |
Paolo Bonzini | a2ce7db | 2020-08-04 20:00:40 +0200 | [diff] [blame] | 890 | |
Marc-André Lureau | 3154fee | 2019-08-29 22:07:01 +0400 | [diff] [blame] | 891 | block_mods = [] |
| 892 | softmmu_mods = [] |
| 893 | foreach d, list : modules |
| 894 | foreach m, module_ss : list |
| 895 | if enable_modules and targetos != 'windows' |
| 896 | module_ss = module_ss.apply(config_host, strict: false) |
| 897 | sl = static_library(d + '-' + m, [genh, module_ss.sources()], |
| 898 | dependencies: [modulecommon, module_ss.dependencies()], pic: true) |
| 899 | if d == 'block' |
| 900 | block_mods += sl |
| 901 | else |
| 902 | softmmu_mods += sl |
| 903 | endif |
| 904 | else |
| 905 | if d == 'block' |
| 906 | block_ss.add_all(module_ss) |
| 907 | else |
| 908 | softmmu_ss.add_all(module_ss) |
| 909 | endif |
| 910 | endif |
| 911 | endforeach |
| 912 | endforeach |
| 913 | |
| 914 | nm = find_program('nm') |
| 915 | undefsym = find_program('scripts/undefsym.sh') |
| 916 | block_syms = custom_target('block.syms', output: 'block.syms', |
| 917 | input: [libqemuutil, block_mods], |
| 918 | capture: true, |
| 919 | command: [undefsym, nm, '@INPUT@']) |
| 920 | qemu_syms = custom_target('qemu.syms', output: 'qemu.syms', |
| 921 | input: [libqemuutil, softmmu_mods], |
| 922 | capture: true, |
| 923 | command: [undefsym, nm, '@INPUT@']) |
| 924 | |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 925 | block_ss = block_ss.apply(config_host, strict: false) |
| 926 | libblock = static_library('block', block_ss.sources() + genh, |
| 927 | dependencies: block_ss.dependencies(), |
| 928 | link_depends: block_syms, |
| 929 | name_suffix: 'fa', |
| 930 | build_by_default: false) |
| 931 | |
| 932 | block = declare_dependency(link_whole: [libblock], |
Marc-André Lureau | b7c70bf | 2019-07-16 21:37:25 +0400 | [diff] [blame] | 933 | link_args: '@block.syms', |
| 934 | dependencies: [crypto, io]) |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 935 | |
Paolo Bonzini | ff219dc | 2020-08-04 21:14:26 +0200 | [diff] [blame] | 936 | qmp_ss = qmp_ss.apply(config_host, strict: false) |
| 937 | libqmp = static_library('qmp', qmp_ss.sources() + genh, |
| 938 | dependencies: qmp_ss.dependencies(), |
| 939 | name_suffix: 'fa', |
| 940 | build_by_default: false) |
| 941 | |
| 942 | qmp = declare_dependency(link_whole: [libqmp]) |
| 943 | |
Marc-André Lureau | 3154fee | 2019-08-29 22:07:01 +0400 | [diff] [blame] | 944 | foreach m : block_mods + softmmu_mods |
| 945 | shared_module(m.name(), |
| 946 | name_prefix: '', |
| 947 | link_whole: m, |
| 948 | install: true, |
| 949 | install_dir: config_host['qemu_moddir']) |
| 950 | endforeach |
| 951 | |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 952 | softmmu_ss.add(authz, block, chardev, crypto, io, qmp) |
| 953 | common_ss.add(qom, qemuutil) |
| 954 | |
| 955 | common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss]) |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 956 | common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss) |
| 957 | |
| 958 | common_all = common_ss.apply(config_all, strict: false) |
| 959 | common_all = static_library('common', |
| 960 | build_by_default: false, |
| 961 | sources: common_all.sources() + genh, |
| 962 | dependencies: common_all.dependencies(), |
| 963 | name_suffix: 'fa') |
| 964 | |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 965 | feature_to_c = find_program('scripts/feature_to_c.sh') |
| 966 | |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 967 | emulators = [] |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 968 | foreach target : target_dirs |
| 969 | config_target = config_target_mak[target] |
| 970 | target_name = config_target['TARGET_NAME'] |
| 971 | arch = config_target['TARGET_BASE_ARCH'] |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 972 | arch_srcs = [config_target_h[target]] |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 973 | arch_deps = [] |
| 974 | c_args = ['-DNEED_CPU_H', |
| 975 | '-DCONFIG_TARGET="@0@-config-target.h"'.format(target), |
| 976 | '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)] |
| 977 | link_args = [] |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 978 | |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 979 | config_target += config_host |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 980 | target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])] |
| 981 | if targetos == 'linux' |
| 982 | target_inc += include_directories('linux-headers', is_system: true) |
| 983 | endif |
| 984 | if target.endswith('-softmmu') |
| 985 | qemu_target_name = 'qemu-system-' + target_name |
| 986 | target_type='system' |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 987 | t = target_softmmu_arch[arch].apply(config_target, strict: false) |
| 988 | arch_srcs += t.sources() |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 989 | arch_deps += t.dependencies() |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 990 | |
Marc-André Lureau | 2c44220 | 2019-08-17 13:55:58 +0400 | [diff] [blame] | 991 | hw_dir = target_name == 'sparc64' ? 'sparc64' : arch |
| 992 | hw = hw_arch[hw_dir].apply(config_target, strict: false) |
| 993 | arch_srcs += hw.sources() |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 994 | arch_deps += hw.dependencies() |
Marc-André Lureau | 2c44220 | 2019-08-17 13:55:58 +0400 | [diff] [blame] | 995 | |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 996 | arch_srcs += config_devices_h[target] |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 997 | link_args += ['@block.syms', '@qemu.syms'] |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 998 | else |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 999 | abi = config_target['TARGET_ABI_DIR'] |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1000 | target_type='user' |
| 1001 | qemu_target_name = 'qemu-' + target_name |
| 1002 | if 'CONFIG_LINUX_USER' in config_target |
| 1003 | base_dir = 'linux-user' |
| 1004 | target_inc += include_directories('linux-user/host/' / config_host['ARCH']) |
| 1005 | else |
| 1006 | base_dir = 'bsd-user' |
| 1007 | endif |
| 1008 | target_inc += include_directories( |
| 1009 | base_dir, |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 1010 | base_dir / abi, |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1011 | ) |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 1012 | if 'CONFIG_LINUX_USER' in config_target |
| 1013 | dir = base_dir / abi |
| 1014 | arch_srcs += files(dir / 'signal.c', dir / 'cpu_loop.c') |
| 1015 | if config_target.has_key('TARGET_SYSTBL_ABI') |
| 1016 | arch_srcs += \ |
| 1017 | syscall_nr_generators[abi].process(base_dir / abi / config_target['TARGET_SYSTBL'], |
| 1018 | extra_args : config_target['TARGET_SYSTBL_ABI']) |
| 1019 | endif |
| 1020 | endif |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1021 | endif |
| 1022 | |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 1023 | if 'TARGET_XML_FILES' in config_target |
| 1024 | gdbstub_xml = custom_target(target + '-gdbstub-xml.c', |
| 1025 | output: target + '-gdbstub-xml.c', |
| 1026 | input: files(config_target['TARGET_XML_FILES'].split()), |
| 1027 | command: [feature_to_c, '@INPUT@'], |
| 1028 | capture: true) |
| 1029 | arch_srcs += gdbstub_xml |
| 1030 | endif |
| 1031 | |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 1032 | t = target_arch[arch].apply(config_target, strict: false) |
| 1033 | arch_srcs += t.sources() |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 1034 | arch_deps += t.dependencies() |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 1035 | |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1036 | target_common = common_ss.apply(config_target, strict: false) |
| 1037 | objects = common_all.extract_objects(target_common.sources()) |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 1038 | deps = target_common.dependencies() |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1039 | |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1040 | target_specific = specific_ss.apply(config_target, strict: false) |
| 1041 | arch_srcs += target_specific.sources() |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 1042 | arch_deps += target_specific.dependencies() |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1043 | |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 1044 | lib = static_library('qemu-' + target, |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 1045 | sources: arch_srcs + genh, |
Paolo Bonzini | b7612f4 | 2020-08-26 08:22:58 +0200 | [diff] [blame] | 1046 | dependencies: arch_deps, |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1047 | objects: objects, |
| 1048 | include_directories: target_inc, |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 1049 | c_args: c_args, |
| 1050 | build_by_default: false, |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1051 | name_suffix: 'fa') |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 1052 | |
| 1053 | if target.endswith('-softmmu') |
| 1054 | execs = [{ |
| 1055 | 'name': 'qemu-system-' + target_name, |
| 1056 | 'gui': false, |
| 1057 | 'sources': files('softmmu/main.c'), |
| 1058 | 'dependencies': [] |
| 1059 | }] |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 1060 | if targetos == 'windows' and (sdl.found() or gtk.found()) |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 1061 | execs += [{ |
| 1062 | 'name': 'qemu-system-' + target_name + 'w', |
| 1063 | 'gui': true, |
| 1064 | 'sources': files('softmmu/main.c'), |
| 1065 | 'dependencies': [] |
| 1066 | }] |
| 1067 | endif |
| 1068 | if config_host.has_key('CONFIG_FUZZ') |
| 1069 | specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false) |
| 1070 | execs += [{ |
| 1071 | 'name': 'qemu-fuzz-' + target_name, |
| 1072 | 'gui': false, |
| 1073 | 'sources': specific_fuzz.sources(), |
| 1074 | 'dependencies': specific_fuzz.dependencies(), |
| 1075 | 'link_depends': [files('tests/qtest/fuzz/fork_fuzz.ld')], |
| 1076 | }] |
| 1077 | endif |
| 1078 | else |
| 1079 | execs = [{ |
| 1080 | 'name': 'qemu-' + target_name, |
| 1081 | 'gui': false, |
| 1082 | 'sources': [], |
| 1083 | 'dependencies': [] |
| 1084 | }] |
| 1085 | endif |
| 1086 | foreach exe: execs |
| 1087 | emulators += executable(exe['name'], exe['sources'], |
| 1088 | install: true, |
| 1089 | c_args: c_args, |
| 1090 | dependencies: arch_deps + deps + exe['dependencies'], |
| 1091 | objects: lib.extract_all_objects(recursive: true), |
| 1092 | link_language: link_language, |
| 1093 | link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []), |
| 1094 | link_args: link_args, |
| 1095 | gui_app: exe['gui']) |
Marc-André Lureau | 10e1d26 | 2019-08-20 12:29:52 +0400 | [diff] [blame] | 1096 | |
| 1097 | if 'CONFIG_TRACE_SYSTEMTAP' in config_host |
| 1098 | foreach stp: [ |
Stefan Hajnoczi | bd5f973 | 2020-08-25 08:49:53 +0200 | [diff] [blame] | 1099 | {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe['name'], 'install': false}, |
| 1100 | {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe['name'], 'install': true}, |
Marc-André Lureau | 10e1d26 | 2019-08-20 12:29:52 +0400 | [diff] [blame] | 1101 | {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true}, |
| 1102 | {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true}, |
| 1103 | ] |
Stefan Hajnoczi | bd5f973 | 2020-08-25 08:49:53 +0200 | [diff] [blame] | 1104 | custom_target(exe['name'] + stp['ext'], |
Marc-André Lureau | 10e1d26 | 2019-08-20 12:29:52 +0400 | [diff] [blame] | 1105 | input: trace_events_all, |
Stefan Hajnoczi | bd5f973 | 2020-08-25 08:49:53 +0200 | [diff] [blame] | 1106 | output: exe['name'] + stp['ext'], |
Marc-André Lureau | 10e1d26 | 2019-08-20 12:29:52 +0400 | [diff] [blame] | 1107 | capture: true, |
| 1108 | install: stp['install'], |
Marc-André Lureau | ab4c099 | 2020-08-26 15:04:16 +0400 | [diff] [blame] | 1109 | install_dir: qemu_datadir / '../systemtap/tapset', |
Marc-André Lureau | 10e1d26 | 2019-08-20 12:29:52 +0400 | [diff] [blame] | 1110 | command: [ |
| 1111 | tracetool, '--group=all', '--format=' + stp['fmt'], |
| 1112 | '--binary=' + stp['bin'], |
| 1113 | '--target-name=' + target_name, |
| 1114 | '--target-type=' + target_type, |
| 1115 | '--probe-prefix=qemu.' + target_type + '.' + target_name, |
| 1116 | '@INPUT@', |
| 1117 | ]) |
| 1118 | endforeach |
| 1119 | endif |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 1120 | endforeach |
Paolo Bonzini | 2becc36 | 2020-02-03 11:42:03 +0100 | [diff] [blame] | 1121 | endforeach |
| 1122 | |
Paolo Bonzini | 931049b | 2020-02-05 09:44:24 +0100 | [diff] [blame] | 1123 | # Other build targets |
Marc-André Lureau | 897b5af | 2019-07-16 21:54:15 +0400 | [diff] [blame] | 1124 | |
Paolo Bonzini | f556b4a | 2020-01-24 13:08:01 +0100 | [diff] [blame] | 1125 | if 'CONFIG_PLUGIN' in config_host |
| 1126 | install_headers('include/qemu/qemu-plugin.h') |
| 1127 | endif |
| 1128 | |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 1129 | if 'CONFIG_GUEST_AGENT' in config_host |
| 1130 | subdir('qga') |
| 1131 | endif |
| 1132 | |
Laurent Vivier | 9755c94 | 2020-08-24 17:24:30 +0200 | [diff] [blame] | 1133 | # Don't build qemu-keymap if xkbcommon is not explicitly enabled |
| 1134 | # when we don't build tools or system |
Laurent Vivier | 4113f4c | 2020-08-24 17:24:29 +0200 | [diff] [blame] | 1135 | if xkbcommon.found() |
Marc-André Lureau | 2874246 | 2019-09-19 20:24:43 +0400 | [diff] [blame] | 1136 | # used for the update-keymaps target, so include rules even if !have_tools |
| 1137 | qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh, |
| 1138 | dependencies: [qemuutil, xkbcommon], install: have_tools) |
| 1139 | endif |
| 1140 | |
Philippe Mathieu-Daudé | 8855e8f | 2020-08-21 17:05:56 +0200 | [diff] [blame] | 1141 | qemu_block_tools = [] |
Paolo Bonzini | 931049b | 2020-02-05 09:44:24 +0100 | [diff] [blame] | 1142 | if have_tools |
Marc-André Lureau | b7c70bf | 2019-07-16 21:37:25 +0400 | [diff] [blame] | 1143 | qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep], |
| 1144 | dependencies: [authz, block, crypto, io, qom, qemuutil], install: true) |
| 1145 | qemu_io = executable('qemu-io', files('qemu-io.c'), |
| 1146 | dependencies: [block, qemuutil], install: true) |
Daniel P. Berrangé | eb70598 | 2020-08-25 11:38:50 +0100 | [diff] [blame] | 1147 | qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'), |
Marc-André Lureau | b7c70bf | 2019-07-16 21:37:25 +0400 | [diff] [blame] | 1148 | dependencies: [block, qemuutil], install: true) |
Marc-André Lureau | b7c70bf | 2019-07-16 21:37:25 +0400 | [diff] [blame] | 1149 | |
Paolo Bonzini | 7c58bb7 | 2020-08-04 20:18:36 +0200 | [diff] [blame] | 1150 | subdir('storage-daemon') |
Paolo Bonzini | a9c9727 | 2019-06-10 12:27:52 +0200 | [diff] [blame] | 1151 | subdir('contrib/rdmacm-mux') |
Marc-André Lureau | 1d7bb6a | 2019-07-12 23:47:06 +0400 | [diff] [blame] | 1152 | subdir('contrib/elf2dmp') |
Paolo Bonzini | a9c9727 | 2019-06-10 12:27:52 +0200 | [diff] [blame] | 1153 | |
Marc-André Lureau | 157e7b1 | 2019-07-15 14:50:58 +0400 | [diff] [blame] | 1154 | executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'), |
| 1155 | dependencies: qemuutil, |
| 1156 | install: true) |
| 1157 | |
Paolo Bonzini | 931049b | 2020-02-05 09:44:24 +0100 | [diff] [blame] | 1158 | if 'CONFIG_VHOST_USER' in config_host |
| 1159 | subdir('contrib/libvhost-user') |
Paolo Bonzini | 2d7ac0a | 2019-06-10 12:18:02 +0200 | [diff] [blame] | 1160 | subdir('contrib/vhost-user-blk') |
Paolo Bonzini | b7612f4 | 2020-08-26 08:22:58 +0200 | [diff] [blame] | 1161 | subdir('contrib/vhost-user-gpu') |
Marc-André Lureau | 32fcc62 | 2019-07-12 22:11:20 +0400 | [diff] [blame] | 1162 | subdir('contrib/vhost-user-input') |
Paolo Bonzini | 99650b6 | 2019-06-10 12:21:14 +0200 | [diff] [blame] | 1163 | subdir('contrib/vhost-user-scsi') |
Paolo Bonzini | 931049b | 2020-02-05 09:44:24 +0100 | [diff] [blame] | 1164 | endif |
Marc-André Lureau | 8f51e01 | 2019-07-15 14:39:25 +0400 | [diff] [blame] | 1165 | |
| 1166 | if targetos == 'linux' |
| 1167 | executable('qemu-bridge-helper', files('qemu-bridge-helper.c'), |
| 1168 | dependencies: [qemuutil, libcap_ng], |
| 1169 | install: true, |
| 1170 | install_dir: get_option('libexecdir')) |
Marc-André Lureau | 897b5af | 2019-07-16 21:54:15 +0400 | [diff] [blame] | 1171 | |
| 1172 | executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'), |
| 1173 | dependencies: [authz, crypto, io, qom, qemuutil, |
| 1174 | libcap_ng, libudev, libmpathpersist], |
| 1175 | install: true) |
Marc-André Lureau | 8f51e01 | 2019-07-15 14:39:25 +0400 | [diff] [blame] | 1176 | endif |
| 1177 | |
Marc-André Lureau | 5ee24e7 | 2019-07-12 23:16:54 +0400 | [diff] [blame] | 1178 | if 'CONFIG_IVSHMEM' in config_host |
| 1179 | subdir('contrib/ivshmem-client') |
| 1180 | subdir('contrib/ivshmem-server') |
| 1181 | endif |
Paolo Bonzini | 931049b | 2020-02-05 09:44:24 +0100 | [diff] [blame] | 1182 | endif |
| 1183 | |
Marc-André Lureau | f5aa632 | 2020-08-26 17:06:18 +0400 | [diff] [blame] | 1184 | subdir('scripts') |
Paolo Bonzini | 3f99cf5 | 2020-02-05 09:45:39 +0100 | [diff] [blame] | 1185 | subdir('tools') |
Marc-André Lureau | bdcbea7 | 2019-07-15 21:22:31 +0400 | [diff] [blame] | 1186 | subdir('pc-bios') |
Paolo Bonzini | ce1c1e7 | 2020-01-28 16:41:44 +0100 | [diff] [blame] | 1187 | subdir('tests') |
Paolo Bonzini | f8aa24e | 2020-08-05 15:49:10 +0200 | [diff] [blame] | 1188 | subdir('docs') |
Marc-André Lureau | e8f3bd7 | 2019-09-19 21:02:09 +0400 | [diff] [blame] | 1189 | if 'CONFIG_GTK' in config_host |
| 1190 | subdir('po') |
| 1191 | endif |
Paolo Bonzini | 3f99cf5 | 2020-02-05 09:45:39 +0100 | [diff] [blame] | 1192 | |
Paolo Bonzini | acfdaac | 2020-08-05 13:07:48 +0200 | [diff] [blame] | 1193 | if build_docs |
| 1194 | makeinfo = find_program('makeinfo', required: build_docs) |
| 1195 | |
| 1196 | docs_inc = [ |
| 1197 | '-I', meson.current_source_dir(), |
| 1198 | '-I', meson.current_build_dir() / 'docs', |
| 1199 | '-I', '@OUTDIR@', |
| 1200 | ] |
| 1201 | |
| 1202 | version_texi = configure_file(output: 'version.texi', |
| 1203 | input: 'version.texi.in', |
| 1204 | configuration: {'VERSION': meson.project_version(), |
| 1205 | 'qemu_confdir': config_host['qemu_confdir']}) |
| 1206 | |
| 1207 | texi = { |
| 1208 | 'qemu-qmp-ref': ['docs/interop/qemu-qmp-ref.texi', qapi_doc_texi, version_texi], |
| 1209 | } |
| 1210 | if 'CONFIG_GUEST_AGENT' in config_host |
| 1211 | texi += {'qemu-ga-ref': ['docs/interop/qemu-ga-ref.texi', qga_qapi_doc_texi, version_texi]} |
| 1212 | endif |
| 1213 | |
| 1214 | if makeinfo.found() |
| 1215 | cmd = [ |
| 1216 | 'env', 'LC_ALL=C', makeinfo, '--no-split', '--number-sections', docs_inc, |
| 1217 | '@INPUT0@', '-o', '@OUTPUT@', |
| 1218 | ] |
| 1219 | foreach ext, args: { |
| 1220 | 'info': [], |
| 1221 | 'html': ['--no-headers', '--html'], |
| 1222 | 'txt': ['--no-headers', '--plaintext'], |
| 1223 | } |
| 1224 | t = [] |
| 1225 | foreach doc, input: texi |
| 1226 | output = doc + '.' + ext |
| 1227 | t += custom_target(output, |
| 1228 | input: input, |
| 1229 | output: output, |
| 1230 | install: true, |
Marc-André Lureau | 491e74c | 2020-08-26 15:04:17 +0400 | [diff] [blame] | 1231 | install_dir: qemu_docdir / 'interop', |
Paolo Bonzini | acfdaac | 2020-08-05 13:07:48 +0200 | [diff] [blame] | 1232 | command: cmd + args) |
| 1233 | endforeach |
| 1234 | alias_target(ext, t) |
| 1235 | endforeach |
| 1236 | endif |
| 1237 | |
| 1238 | texi2pdf = find_program('texi2pdf', required: false) |
| 1239 | |
| 1240 | if texi2pdf.found() |
| 1241 | pdfs = [] |
| 1242 | foreach doc, input: texi |
| 1243 | output = doc + '.pdf' |
| 1244 | pdfs += custom_target(output, |
| 1245 | input: input, |
| 1246 | output: output, |
| 1247 | command: [texi2pdf, '-q', docs_inc, '@INPUT0@', '-o', '@OUTPUT@'], |
| 1248 | build_by_default: false) |
| 1249 | endforeach |
| 1250 | alias_target('pdf', pdfs) |
| 1251 | endif |
| 1252 | |
| 1253 | texi2pod = find_program('scripts/texi2pod.pl') |
| 1254 | pod2man = find_program('pod2man', required: build_docs) |
| 1255 | |
| 1256 | if pod2man.found() |
| 1257 | foreach doc, input: texi |
| 1258 | man = doc + '.7' |
| 1259 | pod = custom_target(man + '.pod', |
| 1260 | input: input, |
| 1261 | output: man + '.pod', |
| 1262 | command: [texi2pod, |
| 1263 | '-DVERSION="' + meson.project_version() + '"', |
| 1264 | '-DCONFDIR="' + config_host['qemu_confdir'] + '"', |
| 1265 | '@INPUT0@', '@OUTPUT@']) |
| 1266 | man = custom_target(man, |
| 1267 | input: pod, |
| 1268 | output: man, |
| 1269 | capture: true, |
| 1270 | install: true, |
Marc-André Lureau | b81efab | 2020-08-26 15:04:18 +0400 | [diff] [blame] | 1271 | install_dir: get_option('mandir') / 'man7', |
Paolo Bonzini | acfdaac | 2020-08-05 13:07:48 +0200 | [diff] [blame] | 1272 | command: [pod2man, '--utf8', '--section=7', '--center=" "', |
| 1273 | '--release=" "', '@INPUT@']) |
| 1274 | endforeach |
| 1275 | endif |
| 1276 | endif |
| 1277 | |
Marc-André Lureau | 8adfeba | 2020-08-26 15:04:19 +0400 | [diff] [blame] | 1278 | if host_machine.system() == 'windows' |
| 1279 | nsis_cmd = [ |
| 1280 | find_program('scripts/nsis.py'), |
| 1281 | '@OUTPUT@', |
| 1282 | get_option('prefix'), |
| 1283 | meson.current_source_dir(), |
| 1284 | host_machine.cpu_family(), |
| 1285 | '--', |
| 1286 | '-DDISPLAYVERSION=' + meson.project_version(), |
| 1287 | ] |
| 1288 | if build_docs |
| 1289 | nsis_cmd += '-DCONFIG_DOCUMENTATION=y' |
| 1290 | endif |
| 1291 | if 'CONFIG_GTK' in config_host |
| 1292 | nsis_cmd += '-DCONFIG_GTK=y' |
| 1293 | endif |
| 1294 | |
| 1295 | nsis = custom_target('nsis', |
| 1296 | output: 'qemu-setup-' + meson.project_version() + '.exe', |
| 1297 | input: files('qemu.nsi'), |
| 1298 | build_always_stale: true, |
| 1299 | command: nsis_cmd + ['@INPUT@']) |
| 1300 | alias_target('installer', nsis) |
| 1301 | endif |
| 1302 | |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 1303 | summary_info = {} |
| 1304 | summary_info += {'Install prefix': config_host['prefix']} |
| 1305 | summary_info += {'BIOS directory': config_host['qemu_datadir']} |
| 1306 | summary_info += {'firmware path': config_host['qemu_firmwarepath']} |
| 1307 | summary_info += {'binary directory': config_host['bindir']} |
| 1308 | summary_info += {'library directory': config_host['libdir']} |
| 1309 | summary_info += {'module directory': config_host['qemu_moddir']} |
| 1310 | summary_info += {'libexec directory': config_host['libexecdir']} |
| 1311 | summary_info += {'include directory': config_host['includedir']} |
| 1312 | summary_info += {'config directory': config_host['sysconfdir']} |
| 1313 | if targetos != 'windows' |
| 1314 | summary_info += {'local state directory': config_host['qemu_localstatedir']} |
Marc-André Lureau | b81efab | 2020-08-26 15:04:18 +0400 | [diff] [blame] | 1315 | summary_info += {'Manual directory': get_option('mandir')} |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 1316 | else |
| 1317 | summary_info += {'local state directory': 'queried at runtime'} |
| 1318 | endif |
Marc-André Lureau | 491e74c | 2020-08-26 15:04:17 +0400 | [diff] [blame] | 1319 | summary_info += {'Doc directory': get_option('docdir')} |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 1320 | summary_info += {'Build directory': meson.current_build_dir()} |
| 1321 | summary_info += {'Source path': meson.current_source_dir()} |
| 1322 | summary_info += {'GIT binary': config_host['GIT']} |
| 1323 | summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']} |
| 1324 | summary_info += {'C compiler': meson.get_compiler('c').cmd_array()[0]} |
| 1325 | summary_info += {'Host C compiler': meson.get_compiler('c', native: true).cmd_array()[0]} |
| 1326 | if link_language == 'cpp' |
| 1327 | summary_info += {'C++ compiler': meson.get_compiler('cpp').cmd_array()[0]} |
| 1328 | else |
| 1329 | summary_info += {'C++ compiler': false} |
| 1330 | endif |
| 1331 | if targetos == 'darwin' |
| 1332 | summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]} |
| 1333 | endif |
| 1334 | summary_info += {'ARFLAGS': config_host['ARFLAGS']} |
| 1335 | summary_info += {'CFLAGS': config_host['CFLAGS']} |
| 1336 | summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']} |
| 1337 | summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']} |
| 1338 | summary_info += {'make': config_host['MAKE']} |
| 1339 | summary_info += {'install': config_host['INSTALL']} |
| 1340 | summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())} |
| 1341 | summary_info += {'sphinx-build': config_host['SPHINX_BUILD']} |
| 1342 | summary_info += {'genisoimage': config_host['GENISOIMAGE']} |
| 1343 | # TODO: add back version |
| 1344 | summary_info += {'slirp support': config_host.has_key('CONFIG_SLIRP')} |
| 1345 | if config_host.has_key('CONFIG_SLIRP') |
| 1346 | summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']} |
| 1347 | endif |
| 1348 | summary_info += {'module support': config_host.has_key('CONFIG_MODULES')} |
| 1349 | if config_host.has_key('CONFIG_MODULES') |
| 1350 | summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')} |
| 1351 | endif |
| 1352 | summary_info += {'host CPU': cpu} |
| 1353 | summary_info += {'host endianness': build_machine.endian()} |
| 1354 | summary_info += {'target list': config_host['TARGET_DIRS']} |
| 1355 | summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')} |
| 1356 | summary_info += {'sparse enabled': meson.get_compiler('c').cmd_array().contains('cgcc')} |
| 1357 | summary_info += {'strip binaries': get_option('strip')} |
| 1358 | summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')} |
| 1359 | summary_info += {'static build': config_host.has_key('CONFIG_TOOLS')} |
| 1360 | if targetos == 'darwin' |
| 1361 | summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')} |
| 1362 | endif |
| 1363 | # TODO: add back version |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 1364 | summary_info += {'SDL support': sdl.found()} |
| 1365 | summary_info += {'SDL image support': sdl_image.found()} |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 1366 | # TODO: add back version |
| 1367 | summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')} |
| 1368 | summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')} |
Paolo Bonzini | b7612f4 | 2020-08-26 08:22:58 +0200 | [diff] [blame] | 1369 | summary_info += {'pixman': pixman.found()} |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 1370 | # TODO: add back version |
| 1371 | summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')} |
| 1372 | summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']} |
| 1373 | summary_info += {'GNUTLS support': config_host.has_key('CONFIG_GNUTLS')} |
| 1374 | # TODO: add back version |
| 1375 | summary_info += {'libgcrypt': config_host.has_key('CONFIG_GCRYPT')} |
| 1376 | if config_host.has_key('CONFIG_GCRYPT') |
| 1377 | summary_info += {' hmac': config_host.has_key('CONFIG_GCRYPT_HMAC')} |
| 1378 | summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')} |
| 1379 | endif |
| 1380 | # TODO: add back version |
| 1381 | summary_info += {'nettle': config_host.has_key('CONFIG_NETTLE')} |
| 1382 | if config_host.has_key('CONFIG_NETTLE') |
| 1383 | summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')} |
| 1384 | endif |
| 1385 | summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')} |
| 1386 | summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')} |
| 1387 | summary_info += {'iconv support': config_host.has_key('CONFIG_ICONV')} |
| 1388 | summary_info += {'curses support': config_host.has_key('CONFIG_CURSES')} |
| 1389 | # TODO: add back version |
| 1390 | summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')} |
| 1391 | summary_info += {'curl support': config_host.has_key('CONFIG_CURL')} |
| 1392 | summary_info += {'mingw32 support': targetos == 'windows'} |
| 1393 | summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']} |
| 1394 | summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']} |
| 1395 | summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']} |
| 1396 | summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')} |
| 1397 | summary_info += {'Multipath support': config_host.has_key('CONFIG_MPATH')} |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1398 | summary_info += {'VNC support': vnc.found()} |
| 1399 | if vnc.found() |
| 1400 | summary_info += {'VNC SASL support': sasl.found()} |
| 1401 | summary_info += {'VNC JPEG support': jpeg.found()} |
| 1402 | summary_info += {'VNC PNG support': png.found()} |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 1403 | endif |
| 1404 | summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')} |
| 1405 | if config_host.has_key('CONFIG_XEN_BACKEND') |
| 1406 | summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']} |
| 1407 | endif |
| 1408 | summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')} |
| 1409 | summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')} |
| 1410 | summary_info += {'PIE': get_option('b_pie')} |
| 1411 | summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} |
| 1412 | summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} |
| 1413 | summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')} |
| 1414 | summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')} |
| 1415 | summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')} |
| 1416 | summary_info += {'Install blobs': config_host.has_key('INSTALL_BLOBS')} |
| 1417 | # TODO: add back KVM/HAX/HVF/WHPX/TCG |
| 1418 | #summary_info += {'KVM support': have_kvm'} |
| 1419 | #summary_info += {'HAX support': have_hax'} |
| 1420 | #summary_info += {'HVF support': have_hvf'} |
| 1421 | #summary_info += {'WHPX support': have_whpx'} |
| 1422 | #summary_info += {'TCG support': have_tcg'} |
| 1423 | #if get_option('tcg') |
| 1424 | # summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')} |
| 1425 | # summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')} |
| 1426 | #endif |
| 1427 | summary_info += {'malloc trim support': config_host.has_key('CONFIG_MALLOC_TRIM')} |
| 1428 | summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')} |
| 1429 | summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')} |
| 1430 | summary_info += {'fdt support': config_host.has_key('CONFIG_FDT')} |
| 1431 | summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')} |
| 1432 | summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')} |
| 1433 | summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')} |
| 1434 | summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')} |
| 1435 | summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')} |
| 1436 | summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')} |
| 1437 | summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')} |
| 1438 | summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')} |
| 1439 | summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')} |
| 1440 | summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')} |
| 1441 | summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')} |
| 1442 | summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')} |
| 1443 | summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')} |
| 1444 | summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')} |
| 1445 | summary_info += {'Trace backends': config_host['TRACE_BACKENDS']} |
| 1446 | if config_host['TRACE_BACKENDS'].split().contains('simple') |
| 1447 | summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'} |
| 1448 | endif |
| 1449 | # TODO: add back protocol and server version |
| 1450 | summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')} |
| 1451 | summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')} |
| 1452 | summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')} |
| 1453 | summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')} |
César Belley | 0a40bcb | 2020-08-26 13:42:04 +0200 | [diff] [blame] | 1454 | summary_info += {'U2F support': u2f.found()} |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 1455 | summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')} |
| 1456 | summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')} |
| 1457 | summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')} |
| 1458 | summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')} |
| 1459 | summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')} |
| 1460 | summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')} |
| 1461 | summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')} |
| 1462 | if targetos == 'windows' |
| 1463 | if 'WIN_SDK' in config_host |
| 1464 | summary_info += {'Windows SDK': config_host['WIN_SDK']} |
| 1465 | endif |
| 1466 | summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')} |
| 1467 | summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')} |
| 1468 | summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI_ENABLED')} |
| 1469 | endif |
| 1470 | summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')} |
| 1471 | summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']} |
| 1472 | summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'} |
| 1473 | summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')} |
| 1474 | summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')} |
| 1475 | summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')} |
| 1476 | summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')} |
Marc-André Lureau | bf0e56a | 2019-10-04 17:35:16 +0400 | [diff] [blame] | 1477 | summary_info += {'gcov': get_option('b_coverage')} |
Paolo Bonzini | f933275 | 2020-02-03 13:28:38 +0100 | [diff] [blame] | 1478 | summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')} |
| 1479 | summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')} |
| 1480 | summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')} |
| 1481 | summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')} |
| 1482 | summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')} |
| 1483 | summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')} |
| 1484 | summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')} |
| 1485 | summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')} |
| 1486 | summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')} |
| 1487 | summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')} |
| 1488 | summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')} |
| 1489 | summary_info += {'tcmalloc support': config_host.has_key('CONFIG_TCMALLOC')} |
| 1490 | summary_info += {'jemalloc support': config_host.has_key('CONFIG_JEMALLOC')} |
| 1491 | summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')} |
| 1492 | summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')} |
| 1493 | summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')} |
| 1494 | summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')} |
| 1495 | summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')} |
| 1496 | summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')} |
| 1497 | summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')} |
| 1498 | summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')} |
| 1499 | summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')} |
| 1500 | summary_info += {'qed support': config_host.has_key('CONFIG_QED')} |
| 1501 | summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')} |
| 1502 | summary_info += {'sheepdog support': config_host.has_key('CONFIG_SHEEPDOG')} |
| 1503 | summary_info += {'capstone': config_host.has_key('CONFIG_CAPSTONE')} |
| 1504 | summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')} |
| 1505 | summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')} |
| 1506 | summary_info += {'libudev': config_host.has_key('CONFIG_LIBUDEV')} |
| 1507 | summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'} |
| 1508 | summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')} |
| 1509 | summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')} |
| 1510 | if config_host.has_key('HAVE_GDB_BIN') |
| 1511 | summary_info += {'gdb': config_host['HAVE_GDB_BIN']} |
| 1512 | endif |
| 1513 | summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')} |
| 1514 | summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')} |
| 1515 | summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')} |
| 1516 | summary(summary_info, bool_yn: true) |
| 1517 | |
| 1518 | if not supported_cpus.contains(cpu) |
| 1519 | message() |
| 1520 | warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!') |
| 1521 | message() |
| 1522 | message('CPU host architecture ' + cpu + ' support is not currently maintained.') |
| 1523 | message('The QEMU project intends to remove support for this host CPU in') |
| 1524 | message('a future release if nobody volunteers to maintain it and to') |
| 1525 | message('provide a build host for our continuous integration setup.') |
| 1526 | message('configure has succeeded and you can continue to build, but') |
| 1527 | message('if you care about QEMU on this platform you should contact') |
| 1528 | message('us upstream at qemu-devel@nongnu.org.') |
| 1529 | endif |
| 1530 | |
| 1531 | if not supported_oses.contains(targetos) |
| 1532 | message() |
| 1533 | warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!') |
| 1534 | message() |
| 1535 | message('Host OS ' + targetos + 'support is not currently maintained.') |
| 1536 | message('The QEMU project intends to remove support for this host OS in') |
| 1537 | message('a future release if nobody volunteers to maintain it and to') |
| 1538 | message('provide a build host for our continuous integration setup.') |
| 1539 | message('configure has succeeded and you can continue to build, but') |
| 1540 | message('if you care about QEMU on this platform you should contact') |
| 1541 | message('us upstream at qemu-devel@nongnu.org.') |
| 1542 | endif |