meson.build (73258b386489c410e4d449159a6c8420e3b7733f) meson.build (1f2146f7ca0f04afc62c4a170ec78bd030f3e72f)
1project('qemu', ['c'], meson_version: '>=0.63.0',
2 default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto',
3 'b_staticpic=false', 'stdsplit=false', 'optimization=2', 'b_pie=true'],
4 version: files('VERSION'))
5
6add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: true)
7add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
8add_test_setup('thorough', env: ['G_TEST_SLOW=1', 'SPEED=thorough'])

--- 2055 unchanged lines hidden (view full) ---

2064if get_option('module_upgrades') and not enable_modules
2065 error('Cannot enable module-upgrades as modules are not enabled')
2066endif
2067config_host_data.set('CONFIG_MODULE_UPGRADES', get_option('module_upgrades'))
2068
2069config_host_data.set('CONFIG_ATTR', libattr.found())
2070config_host_data.set('CONFIG_BDRV_WHITELIST_TOOLS', get_option('block_drv_whitelist_in_tools'))
2071config_host_data.set('CONFIG_BRLAPI', brlapi.found())
1project('qemu', ['c'], meson_version: '>=0.63.0',
2 default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto',
3 'b_staticpic=false', 'stdsplit=false', 'optimization=2', 'b_pie=true'],
4 version: files('VERSION'))
5
6add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: true)
7add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
8add_test_setup('thorough', env: ['G_TEST_SLOW=1', 'SPEED=thorough'])

--- 2055 unchanged lines hidden (view full) ---

2064if get_option('module_upgrades') and not enable_modules
2065 error('Cannot enable module-upgrades as modules are not enabled')
2066endif
2067config_host_data.set('CONFIG_MODULE_UPGRADES', get_option('module_upgrades'))
2068
2069config_host_data.set('CONFIG_ATTR', libattr.found())
2070config_host_data.set('CONFIG_BDRV_WHITELIST_TOOLS', get_option('block_drv_whitelist_in_tools'))
2071config_host_data.set('CONFIG_BRLAPI', brlapi.found())
2072config_host_data.set('CONFIG_BSD', targetos in bsd_oses)
2072config_host_data.set('CONFIG_COCOA', cocoa.found())
2073config_host_data.set('CONFIG_COCOA', cocoa.found())
2074config_host_data.set('CONFIG_DARWIN', targetos == 'darwin')
2073config_host_data.set('CONFIG_FUZZ', get_option('fuzzing'))
2074config_host_data.set('CONFIG_GCOV', get_option('b_coverage'))
2075config_host_data.set('CONFIG_LIBUDEV', libudev.found())
2075config_host_data.set('CONFIG_FUZZ', get_option('fuzzing'))
2076config_host_data.set('CONFIG_GCOV', get_option('b_coverage'))
2077config_host_data.set('CONFIG_LIBUDEV', libudev.found())
2078config_host_data.set('CONFIG_LINUX', targetos == 'linux')
2079config_host_data.set('CONFIG_POSIX', targetos != 'windows')
2080config_host_data.set('CONFIG_WIN32', targetos == 'windows')
2076config_host_data.set('CONFIG_LZO', lzo.found())
2077config_host_data.set('CONFIG_MPATH', mpathpersist.found())
2078config_host_data.set('CONFIG_BLKIO', blkio.found())
2079if blkio.found()
2080 config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD',
2081 blkio.version().version_compare('>=1.3.0'))
2082endif
2083config_host_data.set('CONFIG_CURL', curl.found())

--- 710 unchanged lines hidden (view full) ---

2794 endif
2795endif
2796
2797########################
2798# Target configuration #
2799########################
2800
2801minikconf = find_program('scripts/minikconf.py')
2081config_host_data.set('CONFIG_LZO', lzo.found())
2082config_host_data.set('CONFIG_MPATH', mpathpersist.found())
2083config_host_data.set('CONFIG_BLKIO', blkio.found())
2084if blkio.found()
2085 config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD',
2086 blkio.version().version_compare('>=1.3.0'))
2087endif
2088config_host_data.set('CONFIG_CURL', curl.found())

--- 710 unchanged lines hidden (view full) ---

2799 endif
2800endif
2801
2802########################
2803# Target configuration #
2804########################
2805
2806minikconf = find_program('scripts/minikconf.py')
2807config_targetos = {
2808 (targetos == 'windows' ? 'CONFIG_WIN32' : 'CONFIG_POSIX'): 'y'
2809}
2810if targetos == 'darwin'
2811 config_targetos += {'CONFIG_DARWIN': 'y'}
2812elif targetos == 'linux'
2813 config_targetos += {'CONFIG_LINUX': 'y'}
2814endif
2815if targetos in bsd_oses
2816 config_targetos += {'CONFIG_BSD': 'y'}
2817endif
2818
2802config_all = {}
2803config_all_devices = {}
2804config_all_disas = {}
2805config_devices_mak_list = []
2806config_devices_h = {}
2807config_target_h = {}
2808config_target_mak = {}
2809

--- 27 unchanged lines hidden (view full) ---

2837 (spice.found() ? ['CONFIG_SPICE=y'] : []) + \
2838 (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
2839 (opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
2840 (x11.found() ? ['CONFIG_X11=y'] : []) + \
2841 (have_vhost_user ? ['CONFIG_VHOST_USER=y'] : []) + \
2842 (have_vhost_vdpa ? ['CONFIG_VHOST_VDPA=y'] : []) + \
2843 (have_vhost_kernel ? ['CONFIG_VHOST_KERNEL=y'] : []) + \
2844 (have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \
2819config_all = {}
2820config_all_devices = {}
2821config_all_disas = {}
2822config_devices_mak_list = []
2823config_devices_h = {}
2824config_target_h = {}
2825config_target_mak = {}
2826

--- 27 unchanged lines hidden (view full) ---

2854 (spice.found() ? ['CONFIG_SPICE=y'] : []) + \
2855 (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
2856 (opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
2857 (x11.found() ? ['CONFIG_X11=y'] : []) + \
2858 (have_vhost_user ? ['CONFIG_VHOST_USER=y'] : []) + \
2859 (have_vhost_vdpa ? ['CONFIG_VHOST_VDPA=y'] : []) + \
2860 (have_vhost_kernel ? ['CONFIG_VHOST_KERNEL=y'] : []) + \
2861 (have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \
2845 ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
2862 (targetos == 'linux' ? ['CONFIG_LINUX=y'] : []) + \
2846 (have_pvrdma ? ['CONFIG_PVRDMA=y'] : []) + \
2847 (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : []) + \
2848 (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=y'] : [])
2849
2850ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
2851
2852default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host
2853actual_target_dirs = []

--- 4 unchanged lines hidden (view full) ---

2858 if targetos != 'linux'
2859 if default_targets
2860 continue
2861 endif
2862 error('Target @0@ is only available on a Linux host'.format(target))
2863 endif
2864 config_target += { 'CONFIG_LINUX_USER': 'y' }
2865 elif target.endswith('bsd-user')
2863 (have_pvrdma ? ['CONFIG_PVRDMA=y'] : []) + \
2864 (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : []) + \
2865 (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=y'] : [])
2866
2867ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
2868
2869default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host
2870actual_target_dirs = []

--- 4 unchanged lines hidden (view full) ---

2875 if targetos != 'linux'
2876 if default_targets
2877 continue
2878 endif
2879 error('Target @0@ is only available on a Linux host'.format(target))
2880 endif
2881 config_target += { 'CONFIG_LINUX_USER': 'y' }
2882 elif target.endswith('bsd-user')
2866 if 'CONFIG_BSD' not in config_host
2883 if targetos not in bsd_oses
2867 if default_targets
2868 continue
2869 endif
2870 error('Target @0@ is only available on a BSD host'.format(target))
2871 endif
2872 config_target += { 'CONFIG_BSD_USER': 'y' }
2873 elif target.endswith('softmmu')
2874 config_target += { 'CONFIG_SYSTEM_ONLY': 'y' }

--- 114 unchanged lines hidden (view full) ---

2989# static_library target.
2990#
2991# We do not use all_sources()/all_dependencies(), because it would
2992# build literally all source files, including devices only used by
2993# targets that are not built for this compilation. The CONFIG_ALL
2994# pseudo symbol replaces it.
2995
2996config_all += config_all_devices
2884 if default_targets
2885 continue
2886 endif
2887 error('Target @0@ is only available on a BSD host'.format(target))
2888 endif
2889 config_target += { 'CONFIG_BSD_USER': 'y' }
2890 elif target.endswith('softmmu')
2891 config_target += { 'CONFIG_SYSTEM_ONLY': 'y' }

--- 114 unchanged lines hidden (view full) ---

3006# static_library target.
3007#
3008# We do not use all_sources()/all_dependencies(), because it would
3009# build literally all source files, including devices only used by
3010# targets that are not built for this compilation. The CONFIG_ALL
3011# pseudo symbol replaces it.
3012
3013config_all += config_all_devices
2997config_all += config_host
3014config_all += config_targetos
2998config_all += config_all_disas
2999config_all += {
3000 'CONFIG_XEN': xen.found(),
3001 'CONFIG_SYSTEM_ONLY': have_system,
3002 'CONFIG_USER_ONLY': have_user,
3003 'CONFIG_ALL': true,
3004}
3005

--- 330 unchanged lines hidden (view full) ---

3336subdir('hw')
3337subdir('gdbstub')
3338
3339if enable_modules
3340 libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO')
3341 modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
3342endif
3343
3015config_all += config_all_disas
3016config_all += {
3017 'CONFIG_XEN': xen.found(),
3018 'CONFIG_SYSTEM_ONLY': have_system,
3019 'CONFIG_USER_ONLY': have_user,
3020 'CONFIG_ALL': true,
3021}
3022

--- 330 unchanged lines hidden (view full) ---

3353subdir('hw')
3354subdir('gdbstub')
3355
3356if enable_modules
3357 libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO')
3358 modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
3359endif
3360
3344qom_ss = qom_ss.apply(config_host, strict: false)
3361qom_ss = qom_ss.apply(config_targetos, strict: false)
3345libqom = static_library('qom', qom_ss.sources() + genh,
3346 dependencies: [qom_ss.dependencies()],
3347 name_suffix: 'fa')
3348qom = declare_dependency(link_whole: libqom)
3349
3350event_loop_base = files('event-loop-base.c')
3351event_loop_base = static_library('event-loop-base', sources: event_loop_base + genh,
3352 build_by_default: true)

--- 157 unchanged lines hidden (view full) ---

3510endforeach
3511
3512foreach d, list : target_modules
3513 foreach m, module_ss : list
3514 if enable_modules
3515 foreach target : target_dirs
3516 if target.endswith('-softmmu')
3517 config_target = config_target_mak[target]
3362libqom = static_library('qom', qom_ss.sources() + genh,
3363 dependencies: [qom_ss.dependencies()],
3364 name_suffix: 'fa')
3365qom = declare_dependency(link_whole: libqom)
3366
3367event_loop_base = files('event-loop-base.c')
3368event_loop_base = static_library('event-loop-base', sources: event_loop_base + genh,
3369 build_by_default: true)

--- 157 unchanged lines hidden (view full) ---

3527endforeach
3528
3529foreach d, list : target_modules
3530 foreach m, module_ss : list
3531 if enable_modules
3532 foreach target : target_dirs
3533 if target.endswith('-softmmu')
3534 config_target = config_target_mak[target]
3518 config_target += config_host
3535 config_target += config_targetos
3519 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
3520 c_args = ['-DNEED_CPU_H',
3521 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
3522 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
3523 target_module_ss = module_ss.apply(config_target, strict: false)
3524 if target_module_ss.sources() != []
3525 module_name = d + '-' + m + '-' + config_target['TARGET_NAME']
3526 sl = static_library(module_name,

--- 44 unchanged lines hidden (view full) ---

3571 input: [libqemuutil, block_mods],
3572 capture: true,
3573 command: [undefsym, nm, '@INPUT@'])
3574qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
3575 input: [libqemuutil, softmmu_mods],
3576 capture: true,
3577 command: [undefsym, nm, '@INPUT@'])
3578
3536 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
3537 c_args = ['-DNEED_CPU_H',
3538 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
3539 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
3540 target_module_ss = module_ss.apply(config_target, strict: false)
3541 if target_module_ss.sources() != []
3542 module_name = d + '-' + m + '-' + config_target['TARGET_NAME']
3543 sl = static_library(module_name,

--- 44 unchanged lines hidden (view full) ---

3588 input: [libqemuutil, block_mods],
3589 capture: true,
3590 command: [undefsym, nm, '@INPUT@'])
3591qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
3592 input: [libqemuutil, softmmu_mods],
3593 capture: true,
3594 command: [undefsym, nm, '@INPUT@'])
3595
3579authz_ss = authz_ss.apply(config_host, strict: false)
3596authz_ss = authz_ss.apply(config_targetos, strict: false)
3580libauthz = static_library('authz', authz_ss.sources() + genh,
3581 dependencies: [authz_ss.dependencies()],
3582 name_suffix: 'fa',
3583 build_by_default: false)
3584
3585authz = declare_dependency(link_whole: libauthz,
3586 dependencies: qom)
3587
3597libauthz = static_library('authz', authz_ss.sources() + genh,
3598 dependencies: [authz_ss.dependencies()],
3599 name_suffix: 'fa',
3600 build_by_default: false)
3601
3602authz = declare_dependency(link_whole: libauthz,
3603 dependencies: qom)
3604
3588crypto_ss = crypto_ss.apply(config_host, strict: false)
3605crypto_ss = crypto_ss.apply(config_targetos, strict: false)
3589libcrypto = static_library('crypto', crypto_ss.sources() + genh,
3590 dependencies: [crypto_ss.dependencies()],
3591 name_suffix: 'fa',
3592 build_by_default: false)
3593
3594crypto = declare_dependency(link_whole: libcrypto,
3595 dependencies: [authz, qom])
3596
3606libcrypto = static_library('crypto', crypto_ss.sources() + genh,
3607 dependencies: [crypto_ss.dependencies()],
3608 name_suffix: 'fa',
3609 build_by_default: false)
3610
3611crypto = declare_dependency(link_whole: libcrypto,
3612 dependencies: [authz, qom])
3613
3597io_ss = io_ss.apply(config_host, strict: false)
3614io_ss = io_ss.apply(config_targetos, strict: false)
3598libio = static_library('io', io_ss.sources() + genh,
3599 dependencies: [io_ss.dependencies()],
3600 link_with: libqemuutil,
3601 name_suffix: 'fa',
3602 build_by_default: false)
3603
3604io = declare_dependency(link_whole: libio, dependencies: [crypto, qom])
3605
3606libmigration = static_library('migration', sources: migration_files + genh,
3607 name_suffix: 'fa',
3608 build_by_default: false)
3609migration = declare_dependency(link_with: libmigration,
3610 dependencies: [zlib, qom, io])
3611system_ss.add(migration)
3612
3615libio = static_library('io', io_ss.sources() + genh,
3616 dependencies: [io_ss.dependencies()],
3617 link_with: libqemuutil,
3618 name_suffix: 'fa',
3619 build_by_default: false)
3620
3621io = declare_dependency(link_whole: libio, dependencies: [crypto, qom])
3622
3623libmigration = static_library('migration', sources: migration_files + genh,
3624 name_suffix: 'fa',
3625 build_by_default: false)
3626migration = declare_dependency(link_with: libmigration,
3627 dependencies: [zlib, qom, io])
3628system_ss.add(migration)
3629
3613block_ss = block_ss.apply(config_host, strict: false)
3630block_ss = block_ss.apply(config_targetos, strict: false)
3614libblock = static_library('block', block_ss.sources() + genh,
3615 dependencies: block_ss.dependencies(),
3616 link_depends: block_syms,
3617 name_suffix: 'fa',
3618 build_by_default: false)
3619
3620block = declare_dependency(link_whole: [libblock],
3621 link_args: '@block.syms',
3622 dependencies: [crypto, io])
3623
3631libblock = static_library('block', block_ss.sources() + genh,
3632 dependencies: block_ss.dependencies(),
3633 link_depends: block_syms,
3634 name_suffix: 'fa',
3635 build_by_default: false)
3636
3637block = declare_dependency(link_whole: [libblock],
3638 link_args: '@block.syms',
3639 dependencies: [crypto, io])
3640
3624blockdev_ss = blockdev_ss.apply(config_host, strict: false)
3641blockdev_ss = blockdev_ss.apply(config_targetos, strict: false)
3625libblockdev = static_library('blockdev', blockdev_ss.sources() + genh,
3626 dependencies: blockdev_ss.dependencies(),
3627 name_suffix: 'fa',
3628 build_by_default: false)
3629
3630blockdev = declare_dependency(link_whole: [libblockdev],
3631 dependencies: [block, event_loop_base])
3632
3642libblockdev = static_library('blockdev', blockdev_ss.sources() + genh,
3643 dependencies: blockdev_ss.dependencies(),
3644 name_suffix: 'fa',
3645 build_by_default: false)
3646
3647blockdev = declare_dependency(link_whole: [libblockdev],
3648 dependencies: [block, event_loop_base])
3649
3633qmp_ss = qmp_ss.apply(config_host, strict: false)
3650qmp_ss = qmp_ss.apply(config_targetos, strict: false)
3634libqmp = static_library('qmp', qmp_ss.sources() + genh,
3635 dependencies: qmp_ss.dependencies(),
3636 name_suffix: 'fa',
3637 build_by_default: false)
3638
3639qmp = declare_dependency(link_whole: [libqmp])
3640
3641libchardev = static_library('chardev', chardev_ss.sources() + genh,
3642 name_suffix: 'fa',
3643 dependencies: chardev_ss.dependencies(),
3644 build_by_default: false)
3645
3646chardev = declare_dependency(link_whole: libchardev)
3647
3651libqmp = static_library('qmp', qmp_ss.sources() + genh,
3652 dependencies: qmp_ss.dependencies(),
3653 name_suffix: 'fa',
3654 build_by_default: false)
3655
3656qmp = declare_dependency(link_whole: [libqmp])
3657
3658libchardev = static_library('chardev', chardev_ss.sources() + genh,
3659 name_suffix: 'fa',
3660 dependencies: chardev_ss.dependencies(),
3661 build_by_default: false)
3662
3663chardev = declare_dependency(link_whole: libchardev)
3664
3648hwcore_ss = hwcore_ss.apply(config_host, strict: false)
3665hwcore_ss = hwcore_ss.apply(config_targetos, strict: false)
3649libhwcore = static_library('hwcore', sources: hwcore_ss.sources() + genh,
3650 name_suffix: 'fa',
3651 build_by_default: false)
3652hwcore = declare_dependency(link_whole: libhwcore)
3653common_ss.add(hwcore)
3654
3655###########
3656# Targets #

--- 40 unchanged lines hidden (view full) ---

3697 target_base_arch = config_target['TARGET_BASE_ARCH']
3698 arch_srcs = [config_target_h[target]]
3699 arch_deps = []
3700 c_args = ['-DNEED_CPU_H',
3701 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
3702 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
3703 link_args = emulator_link_args
3704
3666libhwcore = static_library('hwcore', sources: hwcore_ss.sources() + genh,
3667 name_suffix: 'fa',
3668 build_by_default: false)
3669hwcore = declare_dependency(link_whole: libhwcore)
3670common_ss.add(hwcore)
3671
3672###########
3673# Targets #

--- 40 unchanged lines hidden (view full) ---

3714 target_base_arch = config_target['TARGET_BASE_ARCH']
3715 arch_srcs = [config_target_h[target]]
3716 arch_deps = []
3717 c_args = ['-DNEED_CPU_H',
3718 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
3719 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
3720 link_args = emulator_link_args
3721
3705 config_target += config_host
3722 config_target += config_targetos
3706 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
3707 if targetos == 'linux'
3708 target_inc += include_directories('linux-headers', is_system: true)
3709 endif
3710 if target.endswith('-softmmu')
3711 target_type='system'
3712 t = target_softmmu_arch[target_base_arch].apply(config_target, strict: false)
3713 arch_srcs += t.sources()

--- 641 unchanged lines hidden ---
3723 target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
3724 if targetos == 'linux'
3725 target_inc += include_directories('linux-headers', is_system: true)
3726 endif
3727 if target.endswith('-softmmu')
3728 target_type='system'
3729 t = target_softmmu_arch[target_base_arch].apply(config_target, strict: false)
3730 arch_srcs += t.sources()

--- 641 unchanged lines hidden ---