From dc70bda00a5fba84668c1424e754802f7766ee74 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost <ehabkost@redhat.com> Date: Fri, 2 Oct 2009 14:15:30 -0300 Subject: [PATCH 08/10] force --enable-options RH-Author: Juan Quintela <quintela@redhat.com> Message-id: <184c942cc0ea3af810d40cb6694c9c448bcb20d3.1254313767.git.quintela@redhat.com> Patchwork-id: 3545 O-Subject: [PATCH 1/3] force --enable-options Bugzilla: 489900 RH-Acked-by: Kevin Wolf <kwolf@redhat.com> RH-Acked-by: Markus Armbruster <armbru@redhat.com> RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com> v4: - kvm_nested: add --enable-kvm-nested and remove dead code - spice: check for specific spice version v3: - fix type on --enable-qxl help - re-enable qxl by default v2. --enable-foo means that if foo is not detected, configure exits. Main upstream commit is: commit 249247c9fd962e8155ebcf01c9ab648c886682ae Author: Juan Quintela <quintela@redhat.com> Date: Wed Aug 12 18:20:25 2009 +0200 Add error message for feature not found And the following ones. I added --enable-spice, --enable-qxl, --enable-kvm, --enable-gcrypt --enable-vnc-tls qxl don't have a compile test. spice and qxl are not upstream. vnc_tls, and kvm exist also on upstream. Signed-off-by: Juan Quintela <quintela@redhat.com> --- qemu/configure | 97 ++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 60 insertions(+), 37 deletions(-) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- qemu/configure | 97 ++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 60 insertions(+), 37 deletions(-) diff --git a/qemu/configure b/qemu/configure index 052fd49..6a3a38e 100755 --- a/qemu/configure +++ b/qemu/configure @@ -154,8 +154,8 @@ vde="yes" fmod_lib="" fmod_inc="" oss_lib="" -vnc_tls="yes" -libgcrypt="yes" +vnc_tls="" +libgcrypt="" bsd="no" linux="no" solaris="no" @@ -185,8 +185,8 @@ usb_bluez="yes" vmware="yes" nbd="yes" x86_only_generic_cpus="no" -kvm="yes" -kvm_nested="no" +kvm="" +kvm_nested="yes" kvm_cap_pit="no" kvm_cap_device_assignment="no" kerneldir="" @@ -197,7 +197,7 @@ signalfd="no" eventfd="no" cpu_emulation="yes" qxl="yes" -spice="no" +spice="" # OS specific if check_define __linux__ ; then @@ -236,7 +236,6 @@ audio_drv_list="oss" audio_possible_drivers="oss sdl esd pa" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then kqemu="yes" - kvm="yes" fi ;; NetBSD) @@ -308,17 +307,12 @@ usb="linux" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then kqemu="yes" audio_possible_drivers="$audio_possible_drivers fmod" - kvm="yes" fi if [ "$cpu" = "ia64" ] ; then - kvm="yes" cpu_emulation="no" gdbstub="no" slirp="no" fi -if [ "$cpu" = "powerpc" ]; then - kvm="yes" -fi ;; esac @@ -330,10 +324,6 @@ if [ "$bsd" = "yes" ] ; then bsd_user="yes" fi -if [ "$kvm" == "yes" ] ; then - kvm_nested="yes" -fi - # find source path source_path=`dirname "$0"` source_path_used="no" @@ -401,18 +391,26 @@ for opt do ;; --disable-sparse) sparse="no" ;; + --enable-vnc-tls) vnc_tls="yes" + ;; --disable-vnc-tls) vnc_tls="no" ;; --disable-gcrypt) libgcrypt="no" ;; + --enable-gcrypt) libgcrypt="yes" + ;; --disable-slirp) slirp="no" ;; --disable-vde) vde="no" ;; + --enable-qxl) qxl="yes" + ;; --disable-qxl) qxl="no" ;; --enable-spice) spice="yes" ;; + --disable-spice) spice="no" + ;; --disable-kqemu) kqemu="no" ;; --disable-brlapi) brlapi="no" @@ -427,6 +425,8 @@ for opt do ;; --disable-kvm-nested) kvm_nested="no" ;; + --enable-kvm-nested) kvm_nested="yes" + ;; --disable-usb-msd) usb_msd="no" ;; --disable-usb-wacom) usb_wacom="no" @@ -445,6 +445,8 @@ for opt do ;; --disable-kvm) kvm="no" ;; + --enable-kvm) kvm="yes" + ;; --enable-profiler) profiler="yes" ;; --enable-cocoa) @@ -593,6 +595,7 @@ echo " --enable-mixemu enable mixer emulation" echo " --disable-brlapi disable BrlAPI" echo " --disable-vnc-tls disable TLS encryption for VNC server" echo " --disable-gcrypt disable libgcrypt usage" +echo " --enable-gcrypt enable libgcrypt usage" echo " --disable-curses disable curses output" echo " --disable-bluez disable bluez stack connectivity" echo " --disable-smb disable smb user directories" @@ -603,7 +606,10 @@ echo " --disable-usb-wacom disable usb wacom tablets" echo " --disable-usb-serial disable usb serial" echo " --disable-vmware disable vmware drivers" echo " --disable-nbd disable nbd support" +echo " --disable-kvm-nested disable KVM nested support" +echo " --enable-kvm-nested enable KVM nested support" echo " --disable-kvm disable KVM acceleration support" +echo " --enable-kvm enable KVM acceleration support" echo " --disable-nptl disable usermode NPTL support" echo " --enable-system enable all system emulation targets" echo " --disable-system disable all system emulation targets" @@ -624,7 +630,9 @@ echo " --disable-blobs disable installing provided firmware blobs" echo " --kerneldir=PATH look for kernel includes in PATH" echo " --disable-cpu-emulation disables use of qemu cpu emulation code" echo " --disable-qxl disable qxl" +echo " --enable-qxl enable qxl" echo " --enable-spice use spice" +echo " --disable-spice don't use spice" echo "" echo "NOTE: The object files are built at the place where configure is launched" exit 1 @@ -732,6 +740,16 @@ if test -z "$target_list" ; then exit 1 fi +feature_not_found() { + feature=$1 + + echo "ERROR" + echo "ERROR: User requested feature $feature" + echo "ERROR: configure was not able to find it" + echo "ERROR" + exit 1; +} + if test -z "$cross_prefix" ; then # --- @@ -813,7 +831,7 @@ fi ########################################## # KVM probe -if test "$kvm" = "yes" ; then +if test "$kvm" != "no" ; then # test for KVM_CAP_PIT @@ -928,7 +946,7 @@ fi # -z $sdl ########################################## # VNC TLS detection -if test "$vnc_tls" = "yes" ; then +if test "$vnc_tls" != "no" ; then cat > $TMPC <<EOF #include <gnutls/gnutls.h> int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } @@ -937,15 +955,18 @@ EOF vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null` if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \ $vnc_tls_libs > /dev/null 2> /dev/null ; then - : + vnc_tls="yes" else + if test "$vnc_tls" = "yes" ; then + feature_not_found "vnc_tls" + fi vnc_tls="no" fi fi ########################################## # libgcrypt detection -if test "$libgcrypt" = "yes" ; then +if test "$libgcrypt" != "no" ; then cat > $TMPC <<EOF #include <gcrypt.h> int main(void) { @@ -958,22 +979,16 @@ EOF libgcrypt_libs=`libgcrypt-config --libs 2> /dev/null` if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $libgcrypt_cflags $TMPC \ $libgcrypt_libs > /dev/null 2> /dev/null ; then - : + libgcrypt="yes" else + if test "$libgcrypt" = "yes" ; then + feature_not_found "libgcrypt" + fi libgcrypt="no" fi fi -if [ "$libgcrypt" != "yes" ];then - echo - echo "qemu currently requires libgcrypt to compile" - echo "Make sure you have libgcrypt headers and libraries available" - echo - exit 1 -fi - - ########################################## # vde libraries probe if test "$vde" = "yes" ; then @@ -1112,7 +1127,7 @@ fi ########################################## # kvm probe -if test "$kvm" = "yes" ; then +if test "$kvm" != "no" ; then cat > $TMPC <<EOF #include <linux/kvm.h> #if !defined(KVM_API_VERSION) || \ @@ -1138,9 +1153,12 @@ EOF fi if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \ > /dev/null 2>/dev/null ; then - : + kvm=yes else - kvm="no" + if test "$kvm" = "yes" ; then + feature_not_found "kvm" + fi + kvm=no fi fi @@ -1218,20 +1236,25 @@ fi ########################################## # spice probe -if test "$spice" = "yes" ; then - `pkg-config --atleast-version=0.3.0 spice` || spice="no" -fi -if test "$spice" = "yes" ; then +if test "$spice" != "no" ; then cat > $TMPC << EOF #include <spice.h> int main(void) { CoreInterface ci; spice_init(&ci); return 0; } EOF spice_cflags=`pkg-config --cflags spice` spice_libs=`pkg-config --libs spice` + if test "$spice" = "yes" ; then + if ! `pkg-config --atleast-version=0.3.0 spice` ; then + feature_not_found "spice" + fi + fi if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $spice_cflags $TMPC \ $spice_libs > /dev/null 2> /dev/null ; then - : + spice="yes" else + if test "$spice" = "yes" ; then + feature_not_found "spice" + fi spice="no" fi fi -- 1.6.3.rc4.29.g8146