summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini2021-10-15 16:47:43 +0200
committerPaolo Bonzini2022-02-21 10:35:53 +0100
commit20cf5cb487021dd1bec1eec326af138a8b15d987 (patch)
tree22ed924e9d12d6fec8fd7d68894c5686991286ac /meson.build
parentconfigure, meson: move smbd options to meson_options.txt (diff)
downloadqemu-20cf5cb487021dd1bec1eec326af138a8b15d987.tar.gz
qemu-20cf5cb487021dd1bec1eec326af138a8b15d987.tar.xz
qemu-20cf5cb487021dd1bec1eec326af138a8b15d987.zip
configure, meson: move guest-agent, tools to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build48
1 files changed, 26 insertions, 22 deletions
diff --git a/meson.build b/meson.build
index 7b3cfb6316..b9bedf928a 100644
--- a/meson.build
+++ b/meson.build
@@ -44,6 +44,20 @@ config_host_data = configuration_data()
genh = []
qapi_trace_events = []
+bsd_oses = ['gnu/kfreebsd', 'freebsd', 'netbsd', 'openbsd', 'dragonfly', 'darwin']
+supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
+supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv', 'x86', 'x86_64',
+ 'arm', 'aarch64', 'loongarch64', 'mips', 'mips64', 'sparc', 'sparc64']
+
+cpu = host_machine.cpu_family()
+
+# Unify riscv* to a single family.
+if cpu in ['riscv32', 'riscv64']
+ cpu = 'riscv'
+endif
+
+targetos = host_machine.system()
+
target_dirs = config_host['TARGET_DIRS'].split()
have_linux_user = false
have_bsd_user = false
@@ -54,24 +68,18 @@ foreach target : target_dirs
have_system = have_system or target.endswith('-softmmu')
endforeach
have_user = have_linux_user or have_bsd_user
-have_tools = 'CONFIG_TOOLS' in config_host
+have_tools = get_option('tools') \
+ .disable_auto_if(not have_system) \
+ .allowed()
+have_ga = get_option('guest_agent') \
+ .disable_auto_if(not have_system and not have_tools) \
+ .require(targetos in ['sunos', 'linux', 'windows'],
+ error_message: 'unsupported OS for QEMU guest agent') \
+ .allowed()
have_block = have_system or have_tools
python = import('python').find_installation()
-supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
-supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv', 'x86', 'x86_64',
- 'arm', 'aarch64', 'loongarch64', 'mips', 'mips64', 'sparc', 'sparc64']
-
-cpu = host_machine.cpu_family()
-
-# Unify riscv* to a single family.
-if cpu in ['riscv32', 'riscv64']
- cpu = 'riscv'
-endif
-
-targetos = host_machine.system()
-
if cpu not in supported_cpus
host_arch = 'unknown'
elif cpu == 'x86'
@@ -3214,11 +3222,7 @@ if 'CONFIG_PLUGIN' in config_host
install_headers('include/qemu/qemu-plugin.h')
endif
-if 'CONFIG_GUEST_AGENT' in config_host
- subdir('qga')
-elif get_option('guest_agent_msi').enabled()
- error('Guest agent MSI requested, but the guest agent is not being built')
-endif
+subdir('qga')
# Don't build qemu-keymap if xkbcommon is not explicitly enabled
# when we don't build tools or system
@@ -3341,7 +3345,7 @@ if config_host.has_key('HAVE_GDB_BIN')
summary_info += {'gdb': config_host['HAVE_GDB_BIN']}
endif
summary_info += {'genisoimage': config_host['GENISOIMAGE']}
-if targetos == 'windows' and config_host.has_key('CONFIG_GUEST_AGENT')
+if targetos == 'windows' and have_ga
summary_info += {'wixl': wixl}
endif
if slirp_opt != 'disabled' and have_system
@@ -3379,7 +3383,7 @@ summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_USER')}
summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
-summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')}
+summary_info += {'build guest agent': have_ga}
summary(summary_info, bool_yn: true, section: 'Configurable features')
# Compilation information
@@ -3589,7 +3593,7 @@ summary_info += {'GBM': gbm}
summary_info += {'libiscsi support': libiscsi}
summary_info += {'libnfs support': libnfs}
if targetos == 'windows'
- if config_host.has_key('CONFIG_GUEST_AGENT')
+ if have_ga
summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')}
summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')}
endif