Revision 7ba1e619 configure

b/configure
115 115
nptl="yes"
116 116
mixemu="no"
117 117
bluez="yes"
118
kvm="yes"
118 119

  
119 120
# OS specific
120 121
targetos=`uname -s`
......
303 304
  ;;
304 305
  --disable-bluez) bluez="no"
305 306
  ;;
307
  --disable-kvm) kvm="no"
308
  ;;
306 309
  --enable-profiler) profiler="yes"
307 310
  ;;
308 311
  --enable-cocoa)
......
448 451
echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
449 452
echo "  --disable-curses         disable curses output"
450 453
echo "  --disable-bluez          disable bluez stack connectivity"
454
echo "  --disable-kvm            disable KVM acceleration support"
451 455
echo "  --disable-nptl           disable usermode NPTL support"
452 456
echo "  --enable-system          enable all system emulation targets"
453 457
echo "  --disable-system         disable all system emulation targets"
......
951 955
fi
952 956

  
953 957
##########################################
958
# kvm probe
959
if test "$kvm" = "yes" ; then
960
    cat > $TMPC <<EOF
961
#include <linux/kvm.h>
962
#if !defined(KVM_API_VERSION) || \
963
    KVM_API_VERSION < 12 || \
964
    KVM_API_VERSION > 12 || \
965
    !defined(KVM_CAP_USER_MEMORY) || \
966
    !defined(KVM_CAP_SET_TSS_ADDR)
967
#error Invalid KVM version
968
#endif
969
int main(void) { return 0; }
970
EOF
971
  # FIXME make this configurable
972
  kvm_cflags=-I/lib/modules/`uname -r`/build/include
973
  if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
974
      2>/dev/null ; then
975
    :
976
  else
977
    kvm="no"
978
  fi
979
fi
980

  
981
##########################################
954 982
# AIO probe
955 983
if test "$aio" = "yes" ; then
956 984
  aio=no
......
1036 1064
echo "NPTL support      $nptl"
1037 1065
echo "vde support       $vde"
1038 1066
echo "AIO support       $aio"
1067
echo "KVM support       $kvm"
1039 1068

  
1040 1069
if test $sdl_too_old = "yes"; then
1041 1070
echo "-> Your SDL version is too old - please upgrade to have SDL support"
......
1411 1440
echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1412 1441
gdb_xml_files=""
1413 1442

  
1443
# FIXME allow i386 to build on x86_64 and vice versa
1444
if test "$kvm" = "yes" -a "$target_cpu" != "$cpu" ; then
1445
  kvm="no"
1446
fi
1447
# Disable KVM for linux-user
1448
if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1449
  kvm="no"
1450
fi
1451

  
1414 1452
case "$target_cpu" in
1415 1453
  i386)
1416 1454
    echo "TARGET_ARCH=i386" >> $config_mak
......
1420 1458
    then
1421 1459
      echo "#define USE_KQEMU 1" >> $config_h
1422 1460
    fi
1461
    if test "$kvm" = "yes" ; then
1462
      echo "CONFIG_KVM=yes" >> $config_mak
1463
      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1464
      echo "#define CONFIG_KVM" >> $config_h
1465
    fi
1423 1466
    gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
1424 1467
    if test -n "$gcc3minver" && test $gcc3minver -gt 3
1425 1468
    then
......
1437 1480
    then
1438 1481
      echo "#define USE_KQEMU 1" >> $config_h
1439 1482
    fi
1483
    if test "$kvm" = "yes" ; then
1484
      echo "CONFIG_KVM=yes" >> $config_mak
1485
      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1486
      echo "#define CONFIG_KVM 1" >> $config_h
1487
    fi
1440 1488
  ;;
1441 1489
  alpha)
1442 1490
    echo "TARGET_ARCH=alpha" >> $config_mak

Also available in: Unified diff