diff mbox series

[3/9] configure: rewrite accelerator defaults as tests

Message ID 20200920130708.1156310-4-pbonzini@redhat.com
State New
Headers show
Series Move target configuration to meson | expand

Commit Message

Paolo Bonzini Sept. 20, 2020, 1:07 p.m. UTC
Prepare to process "auto" in meson rather than configure: localize the
code that changes "auto" to enabled/disabled, it will be moved to meson
and removed from configure.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

Comments

Richard Henderson Sept. 21, 2020, 12:06 a.m. UTC | #1
On 9/20/20 6:07 AM, Paolo Bonzini wrote:
> +if test "$kvm" = "auto" ; then

> +  if test "$linux" = yes ; then

> +    kvm=enabled

> +  else

> +    if test "$kvm" = "enabled" ; then

> +      feature_not_found "kvm" "KVM is only available on Linux"


Can't get here, as enabled != auto.


r~
diff mbox series

Patch

diff --git a/configure b/configure
index ade456b7af..00348c2342 100755
--- a/configure
+++ b/configure
@@ -420,7 +420,7 @@  vhost_scsi=""
 vhost_vsock=""
 vhost_user=""
 vhost_user_fs=""
-kvm="disabled"
+kvm="auto"
 hax="disabled"
 hvf="disabled"
 whpx="disabled"
@@ -814,7 +814,6 @@  HOST_VARIANT_DIR=""
 case $targetos in
 MINGW32*)
   mingw32="yes"
-  hax="enabled"
   whpx="auto"
   vhost_user="no"
   audio_possible_drivers="dsound sdl"
@@ -849,7 +848,6 @@  DragonFly)
 ;;
 NetBSD)
   bsd="yes"
-  hax="enabled"
   make="${MAKE-gmake}"
   audio_drv_list="oss try-sdl"
   audio_possible_drivers="oss sdl"
@@ -866,7 +864,6 @@  OpenBSD)
 Darwin)
   bsd="yes"
   darwin="yes"
-  hax="enabled"
   hvf="auto"
   if [ "$cpu" = "x86_64" ] ; then
     QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
@@ -903,7 +900,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
@@ -2664,6 +2660,28 @@  if test "$seccomp" != "no" ; then
         seccomp="no"
     fi
 fi
+
+##########################################
+# simple accelerator probes
+
+if test "$kvm" = "auto" ; 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
+  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