From ddce8e763bdef0ae63882127e8014fac25b38931 Mon Sep 17 00:00:00 2001 From: Hollis Blanchard Date: Wed, 29 Oct 2008 13:27:49 -0500 Subject: [PATCH] kvm: user: consolidate $arch tests and allow $arch to be "-" Use case/esac instead of multiple if/fi tests, allowing us to use wildcards. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity --- kvm/configure | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/kvm/configure b/kvm/configure index 3b5d14fa08..1a279e7a31 100755 --- a/kvm/configure +++ b/kvm/configure @@ -87,26 +87,21 @@ done #set kenel directory libkvm_kerneldir=$(readlink -f kernel) -#if arch is an x86 arch set to i386 -if [[ $arch = i?86 ]]; then - arch="i386" -fi - -#set parameters compiling -if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then - target_exec="x86_64-softmmu" - qemu_cflags="$qemu_cflags -DCONFIG_X86" -fi - -if [ "$arch" = "ia64" ]; then - target_exec="ia64-softmmu" -fi - -if [ "$arch" = "powerpc" ]; then - target_exec="ppcemb-softmmu" - qemu_cflags="$qemu_cflags -I $PWD/libfdt" - qemu_ldflags="$qemu_ldflags -L $PWD/libfdt" -fi +case $arch in + i?86*|x86_64*) + arch=${arch/#i?86/i386} + target_exec="x86_64-softmmu" + qemu_cflags="$qemu_cflags -DCONFIG_X86" + ;; + ia64*) + target_exec="ia64-softmmu" + ;; + powerpc*) + target_exec="ppcemb-softmmu" + qemu_cflags="$qemu_cflags -I $PWD/libfdt" + qemu_ldflags="$qemu_ldflags -L $PWD/libfdt" + ;; +esac # see if we have split build and source directories if [ -d "$kerneldir/include2" ]; then -- 2.11.4.GIT