From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDdl1-00034s-Cz for qemu-devel@nongnu.org; Mon, 17 Sep 2012 12:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDdkt-0000K2-SG for qemu-devel@nongnu.org; Mon, 17 Sep 2012 12:01:11 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:54240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDdkt-0000Hr-MY for qemu-devel@nongnu.org; Mon, 17 Sep 2012 12:01:03 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp12so9799681pbb.4 for ; Mon, 17 Sep 2012 09:01:03 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 17 Sep 2012 18:00:40 +0200 Message-Id: <1347897649-23236-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1347897649-23236-1-git-send-email-pbonzini@redhat.com> References: <1347897649-23236-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [RFC PATCH 01/10] configure: factor out list of supported Xen/KVM targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini --- configure | 63 +++++++++++++++++++++++++++++++++++++-------------------------- 1 file modificato, 37 inserzioni(+), 26 rimozioni(-) diff --git a/configure b/configure index 7e23309..cea8db0 100755 --- a/configure +++ b/configure @@ -3664,6 +3664,31 @@ if test "$linux" = "yes" ; then fi fi +supported_kvm_target() { + test "$kvm" = "yes" || return 1 + test "$target_softmmu" = "yes" || return 1 + case "$target_arch2:$cpu" in + i386:i386 | i386:x86_64 | x86_64:i386 | x86_64:x86_64 | \ + ppc:ppc | ppcemb:ppc | ppc64:ppc | \ + ppc:ppc64 | ppcemb:ppc64 | ppc64:ppc64 | \ + s390x:s390x) + return 0 + ;; + esac + return 1 +} + +supported_xen_target() { + test "$xen" = "yes" || return 1 + test "$target_softmmu" = "yes" || return 1 + case "$target_arch2:$cpu" in + i386:i386 | i386:x86_64 | x86_64:i386 | x86_64:x86_64) + return 0 + ;; + esac + return 1 +} + for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak @@ -3886,38 +3911,24 @@ if [ "$TARGET_ABI_DIR" = "" ]; then TARGET_ABI_DIR=$TARGET_ARCH fi echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak -case "$target_arch2" in - i386|x86_64) - if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then - target_phys_bits=64 - echo "CONFIG_XEN=y" >> $config_target_mak - if test "$xen_pci_passthrough" = yes; then + +if supported_xen_target; then + target_phys_bits=64 + echo "CONFIG_XEN=y" >> $config_target_mak + if test "$xen_pci_passthrough" = yes; then echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" - fi - else - echo "CONFIG_NO_XEN=y" >> $config_target_mak fi - ;; - *) +else echo "CONFIG_NO_XEN=y" >> $config_target_mak -esac -case "$target_arch2" in - i386|x86_64|ppcemb|ppc|ppc64|s390x) +fi +if supported_kvm_target; then # Make sure the target and host cpus are compatible - if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ - \( "$target_arch2" = "$cpu" -o \ - \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \ - \( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \) -o \ - \( "$target_arch2" = "ppc" -a "$cpu" = "ppc64" \) -o \ - \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ - \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ - \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then - echo "CONFIG_KVM=y" >> $config_target_mak - if test "$vhost_net" = "yes" ; then + echo "CONFIG_KVM=y" >> $config_target_mak + if test "$vhost_net" = "yes" ; then echo "CONFIG_VHOST_NET=y" >> $config_target_mak - fi fi -esac +fi + case "$target_arch2" in i386|x86_64) echo "CONFIG_HAVE_GET_MEMORY_MAPPING=y" >> $config_target_mak -- 1.7.12