From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org
Subject: [PATCH 03/12] configure: rewrite accelerator defaults as tests
Date: Wed, 23 Sep 2020 05:11:22 -0400 [thread overview]
Message-ID: <20200923091131.1591563-4-pbonzini@redhat.com> (raw)
In-Reply-To: <20200923091131.1591563-1-pbonzini@redhat.com>
Prepare to process "auto" in meson rather than configure: standardize the
shape of the code that changes "auto" to enabled/disabled, to ease the review
when it will be moved to meson.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 58 ++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 38 insertions(+), 20 deletions(-)
diff --git a/configure b/configure
index 33bd3c4cb8..04cc25f7c8 100755
--- a/configure
+++ b/configure
@@ -429,10 +429,10 @@ vhost_scsi=""
vhost_vsock=""
vhost_user=""
vhost_user_fs=""
-kvm="disabled"
-hax="disabled"
-hvf="disabled"
-whpx="disabled"
+kvm="auto"
+hax="auto"
+hvf="auto"
+whpx="auto"
rdma=""
pvrdma=""
gprof="no"
@@ -821,8 +821,6 @@ HOST_VARIANT_DIR=""
case $targetos in
MINGW32*)
mingw32="yes"
- hax="enabled"
- whpx="auto"
vhost_user="no"
audio_possible_drivers="dsound sdl"
if check_include dsound.h; then
@@ -856,7 +854,6 @@ DragonFly)
;;
NetBSD)
bsd="yes"
- hax="enabled"
make="${MAKE-gmake}"
audio_drv_list="oss try-sdl"
audio_possible_drivers="oss sdl"
@@ -873,8 +870,6 @@ OpenBSD)
Darwin)
bsd="yes"
darwin="yes"
- hax="enabled"
- hvf="auto"
if [ "$cpu" = "x86_64" ] ; then
QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
@@ -910,7 +905,6 @@ Linux)
audio_possible_drivers="oss alsa sdl pa"
linux="yes"
linux_user="yes"
- kvm="enabled"
QEMU_INCLUDES="-isystem ${source_path}/linux-headers -Ilinux-headers $QEMU_INCLUDES"
;;
esac
@@ -2668,6 +2662,29 @@ if test "$seccomp" != "no" ; then
seccomp="no"
fi
fi
+
+##########################################
+# simple accelerator probes
+
+if test "$kvm" != "disabled" ; then
+ if test "$linux" = yes ; then
+ kvm=enabled
+ else
+ if test "$kvm" = "enabled" ; then
+ feature_not_found "kvm" "KVM is only available on Linux"
+ fi
+ kvm=disabled
+ fi
+fi
+
+if test "$hax" = "auto" ; then
+ if test "$mingw" = yes || test "$darwin" = yes || test "$targetos" = NetBSD; then
+ hax=enabled
+ else
+ hax=disabled
+ fi
+fi
+
##########################################
# xen probe
@@ -2988,14 +3005,15 @@ fi
##########################################
# Windows Hypervisor Platform accelerator (WHPX) check
-if test "$whpx" = "enabled" && test "$ARCH" != "x86_64"; then
- error_exit "WHPX requires 64-bit host"
-fi
-if test "$whpx" != "disabled" && test "$ARCH" = "x86_64"; then
- if check_include "WinHvPlatform.h" && check_include "WinHvEmulation.h"; then
- whpx="yes"
+if test "$whpx" != "disabled"; then
+ if test "$mingw32" = yes && test "$ARCH" = "x86_64" &&
+ check_include "WinHvPlatform.h" && check_include "WinHvEmulation.h"; then
+ whpx="enabled"
else
- if test "$whpx" = "auto"; then
+ if test "$whpx" = "enabled"; then
+ if test "$ARCH" != "x86_64"; then
+ error_exit "WHPX requires 64-bit host"
+ fi
feature_not_found "WinHvPlatform" "WinHvEmulation is not installed"
fi
whpx="disabled"
@@ -5831,13 +5849,13 @@ if [ "$hvf" != "disabled" ] ; then
#include <Hypervisor/hv.h>
int main() { return 0;}
EOF
- if ! compile_object ""; then
+ if test "$darwin" = yes && compile_object ""; then
+ hvf='enabled'
+ else
if test "$hvf" = "enabled"; then
error_exit "Hypervisor.framework not available"
fi
hvf='disabled'
- else
- hvf='enabled'
fi
fi
--
2.26.2
next prev parent reply other threads:[~2020-09-23 9:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 9:11 [PATCH 00/12] Move target configuration to Meson Paolo Bonzini
2020-09-23 9:11 ` [PATCH 01/12] default-configs: move files to default-configs/devices/ Paolo Bonzini
2020-09-23 9:11 ` [PATCH 02/12] configure: convert accelerator variables to meson options Paolo Bonzini
2020-09-23 9:11 ` Paolo Bonzini [this message]
2020-09-23 9:11 ` [PATCH 04/12] configure: move accelerator logic to meson Paolo Bonzini
2020-09-23 9:11 ` [PATCH 05/12] configure: remove dead variable Paolo Bonzini
2020-09-23 9:11 ` [PATCH 06/12] configure: compute derivatives of target name in meson Paolo Bonzini
2020-09-23 9:11 ` [PATCH 07/12] configure: remove useless config-target.mak symbols Paolo Bonzini
2020-09-23 9:11 ` [PATCH 08/12] configure: remove target configuration Paolo Bonzini
2020-09-23 9:11 ` [PATCH 09/12] default-configs: remove default-configs/devices for user-mode targets Paolo Bonzini
2020-09-23 9:11 ` [PATCH 10/12] configure: move OpenBSD W^X test to meson Paolo Bonzini
2020-09-23 9:11 ` [PATCH 11/12] default-configs: use TARGET_ARCH key Paolo Bonzini
2020-09-23 9:11 ` [PATCH 12/12] default-configs: remove redundant keys Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200923091131.1591563-4-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).