qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure cleanup
@ 2008-04-11 19:24 Stuart Brady
  2008-04-11 21:20 ` [Qemu-devel] [PATCH] configure cleanup [v2] Stuart Brady
  2008-04-12 13:41 ` [Qemu-devel] [PATCH] configure cleanup Paul Brook
  0 siblings, 2 replies; 8+ messages in thread
From: Stuart Brady @ 2008-04-11 19:24 UTC (permalink / raw)
  To: qemu-devel

Hi,

The included patch rearranges the configure script slightly, to reduce
future merge conflicts and to make it easier to read diffs for changes
to the script that add support extra host/target architectures/ABIs.

(I wouldn't normally shuffle code around like this, but as I stated,
the intention is to avoid conflicts, not to create needless churn.)

diff -urN qemu-orig/configure qemu-new/configure
--- qemu-orig/configure	2008-04-11 20:04:02.000000000 +0100
+++ qemu-new/configure	2008-04-11 19:46:18.000000000 +0100
@@ -575,7 +575,14 @@
 else
 
 # if cross compiling, cannot launch a program, so make a static guess
-if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "mips64" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
+if test "$cpu" = "armv4b" \
+     -o "$cpu" = "m68k" \
+     -o "$cpu" = "mips" \
+     -o "$cpu" = "mips64" \
+     -o "$cpu" = "powerpc" \
+     -o "$cpu" = "s390" \
+     -o "$cpu" = "sparc" \
+     -o "$cpu" = "sparc64"; then
     bigendian="yes"
 fi
 
@@ -583,7 +590,10 @@
 
 # host long bits test
 hostlongbits="32"
-if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
+if test "$cpu" = "x86_64" \
+     -o "$cpu" = "alpha" \
+     -o "$cpu" = "ia64" \
+     -o "$cpu" = "sparc64"; then
     hostlongbits="64"
 fi
 
@@ -843,42 +853,42 @@
 elif test "$cpu" = "x86_64" ; then
   echo "ARCH=x86_64" >> $config_mak
   echo "#define HOST_X86_64 1" >> $config_h
+elif test "$cpu" = "alpha" ; then
+  echo "ARCH=alpha" >> $config_mak
+  echo "#define HOST_ALPHA 1" >> $config_h
 elif test "$cpu" = "armv4b" ; then
   echo "ARCH=arm" >> $config_mak
   echo "#define HOST_ARM 1" >> $config_h
 elif test "$cpu" = "armv4l" ; then
   echo "ARCH=arm" >> $config_mak
   echo "#define HOST_ARM 1" >> $config_h
-elif test "$cpu" = "powerpc" ; then
-  echo "ARCH=ppc" >> $config_mak
-  echo "#define HOST_PPC 1" >> $config_h
+elif test "$cpu" = "cris" ; then
+  echo "ARCH=cris" >> $config_mak
+  echo "#define HOST_CRIS 1" >> $config_h
+elif test "$cpu" = "ia64" ; then
+  echo "ARCH=ia64" >> $config_mak
+  echo "#define HOST_IA64 1" >> $config_h
+elif test "$cpu" = "m68k" ; then
+  echo "ARCH=m68k" >> $config_mak
+  echo "#define HOST_M68K 1" >> $config_h
 elif test "$cpu" = "mips" ; then
   echo "ARCH=mips" >> $config_mak
   echo "#define HOST_MIPS 1" >> $config_h
 elif test "$cpu" = "mips64" ; then
   echo "ARCH=mips64" >> $config_mak
   echo "#define HOST_MIPS64 1" >> $config_h
-elif test "$cpu" = "cris" ; then
-  echo "ARCH=cris" >> $config_mak
-  echo "#define HOST_CRIS 1" >> $config_h
+elif test "$cpu" = "powerpc" ; then
+  echo "ARCH=ppc" >> $config_mak
+  echo "#define HOST_PPC 1" >> $config_h
 elif test "$cpu" = "s390" ; then
   echo "ARCH=s390" >> $config_mak
   echo "#define HOST_S390 1" >> $config_h
-elif test "$cpu" = "alpha" ; then
-  echo "ARCH=alpha" >> $config_mak
-  echo "#define HOST_ALPHA 1" >> $config_h
 elif test "$cpu" = "sparc" ; then
   echo "ARCH=sparc" >> $config_mak
   echo "#define HOST_SPARC 1" >> $config_h
 elif test "$cpu" = "sparc64" ; then
   echo "ARCH=sparc64" >> $config_mak
   echo "#define HOST_SPARC64 1" >> $config_h
-elif test "$cpu" = "ia64" ; then
-  echo "ARCH=ia64" >> $config_mak
-  echo "#define HOST_IA64 1" >> $config_h
-elif test "$cpu" = "m68k" ; then
-  echo "ARCH=m68k" >> $config_mak
-  echo "#define HOST_M68K 1" >> $config_h
 else
   echo "Unsupported CPU = $cpu"
   exit 1
@@ -1049,18 +1059,18 @@
 target_cpu=`echo $target | cut -d '-' -f 1`
 target_bigendian="no"
 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
-[ "$target_cpu" = "sparc" ] && target_bigendian=yes
-[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
-[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
+[ "$target_cpu" = "m68k" ] && target_bigendian=yes
+[ "$target_cpu" = "mips" ] && target_bigendian=yes
+[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
+[ "$target_cpu" = "mips64" ] && target_bigendian=yes
 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
-[ "$target_cpu" = "mips" ] && target_bigendian=yes
-[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
-[ "$target_cpu" = "mips64" ] && target_bigendian=yes
 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
-[ "$target_cpu" = "m68k" ] && target_bigendian=yes
+[ "$target_cpu" = "sparc" ] && target_bigendian=yes
+[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
+[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
 target_softmmu="no"
 target_user_only="no"
 target_linux_user="no"
@@ -1129,6 +1139,18 @@
   if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
     echo "#define USE_KQEMU 1" >> $config_h
   fi
+elif test "$target_cpu" = "x86_64" ; then
+  echo "TARGET_ARCH=x86_64" >> $config_mak
+  echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
+  echo "#define TARGET_I386 1" >> $config_h
+  echo "#define TARGET_X86_64 1" >> $config_h
+  if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"  ; then
+    echo "#define USE_KQEMU 1" >> $config_h
+  fi
+elif test "$target_cpu" = "alpha" ; then
+  echo "TARGET_ARCH=alpha" >> $config_mak
+  echo "#define TARGET_ARCH \"alpha\"" >> $config_h
+  echo "#define TARGET_ALPHA 1" >> $config_h
 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
   echo "TARGET_ARCH=arm" >> $config_mak
   echo "CONFIG_NO_DYNGEN_OP=yes" >> $config_mak
@@ -1136,24 +1158,33 @@
   echo "#define TARGET_ARM 1" >> $config_h
   echo "#define CONFIG_NO_DYNGEN_OP 1" >> $config_h
   bflt="yes"
-elif test "$target_cpu" = "sparc" ; then
-  echo "TARGET_ARCH=sparc" >> $config_mak
-  echo "#define TARGET_ARCH \"sparc\"" >> $config_h
-  echo "#define TARGET_SPARC 1" >> $config_h
-elif test "$target_cpu" = "sparc64" ; then
-  echo "TARGET_ARCH=sparc64" >> $config_mak
-  echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
-  echo "#define TARGET_SPARC 1" >> $config_h
-  echo "#define TARGET_SPARC64 1" >> $config_h
-  elfload32="yes"
-elif test "$target_cpu" = "sparc32plus" ; then
-  echo "TARGET_ARCH=sparc64" >> $config_mak
-  echo "TARGET_ABI_DIR=sparc" >> $config_mak
-  echo "TARGET_ARCH2=sparc32plus" >> $config_mak
-  echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
-  echo "#define TARGET_SPARC 1" >> $config_h
-  echo "#define TARGET_SPARC64 1" >> $config_h
-  echo "#define TARGET_ABI32 1" >> $config_h
+elif test "$target_cpu" = "cris" ; then
+  echo "TARGET_ARCH=cris" >> $config_mak
+  echo "#define TARGET_ARCH \"cris\"" >> $config_h
+  echo "#define TARGET_CRIS 1" >> $config_h
+  echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
+  echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
+elif test "$target_cpu" = "m68k" ; then
+  echo "TARGET_ARCH=m68k" >> $config_mak
+  echo "#define TARGET_ARCH \"m68k\"" >> $config_h
+  echo "#define TARGET_M68K 1" >> $config_h
+  bflt="yes"
+elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
+  echo "TARGET_ARCH=mips" >> $config_mak
+  echo "#define TARGET_ARCH \"mips\"" >> $config_h
+  echo "#define TARGET_MIPS 1" >> $config_h
+  echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
+elif test "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" ; then
+  echo "TARGET_ARCH=mipsn32" >> $config_mak
+  echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
+  echo "#define TARGET_MIPS 1" >> $config_h
+  echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
+elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then
+  echo "TARGET_ARCH=mips64" >> $config_mak
+  echo "#define TARGET_ARCH \"mips64\"" >> $config_h
+  echo "#define TARGET_MIPS 1" >> $config_h
+  echo "#define TARGET_MIPS64 1" >> $config_h
+  echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
 elif test "$target_cpu" = "ppc" ; then
   echo "TARGET_ARCH=ppc" >> $config_mak
   echo "#define TARGET_ARCH \"ppc\"" >> $config_h
@@ -1178,50 +1209,29 @@
   echo "#define TARGET_PPC 1" >> $config_h
   echo "#define TARGET_PPC64 1" >> $config_h
   echo "#define TARGET_ABI32 1" >> $config_h
-elif test "$target_cpu" = "x86_64" ; then
-  echo "TARGET_ARCH=x86_64" >> $config_mak
-  echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
-  echo "#define TARGET_I386 1" >> $config_h
-  echo "#define TARGET_X86_64 1" >> $config_h
-  if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"  ; then
-    echo "#define USE_KQEMU 1" >> $config_h
-  fi
-elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
-  echo "TARGET_ARCH=mips" >> $config_mak
-  echo "#define TARGET_ARCH \"mips\"" >> $config_h
-  echo "#define TARGET_MIPS 1" >> $config_h
-  echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
-elif test "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" ; then
-  echo "TARGET_ARCH=mipsn32" >> $config_mak
-  echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
-  echo "#define TARGET_MIPS 1" >> $config_h
-  echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
-elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then
-  echo "TARGET_ARCH=mips64" >> $config_mak
-  echo "#define TARGET_ARCH \"mips64\"" >> $config_h
-  echo "#define TARGET_MIPS 1" >> $config_h
-  echo "#define TARGET_MIPS64 1" >> $config_h
-  echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
-elif test "$target_cpu" = "cris" ; then
-  echo "TARGET_ARCH=cris" >> $config_mak
-  echo "#define TARGET_ARCH \"cris\"" >> $config_h
-  echo "#define TARGET_CRIS 1" >> $config_h
-  echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
-  echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
 elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
   echo "TARGET_ARCH=sh4" >> $config_mak
   echo "#define TARGET_ARCH \"sh4\"" >> $config_h
   echo "#define TARGET_SH4 1" >> $config_h
   bflt="yes"
-elif test "$target_cpu" = "m68k" ; then
-  echo "TARGET_ARCH=m68k" >> $config_mak
-  echo "#define TARGET_ARCH \"m68k\"" >> $config_h
-  echo "#define TARGET_M68K 1" >> $config_h
-  bflt="yes"
-elif test "$target_cpu" = "alpha" ; then
-  echo "TARGET_ARCH=alpha" >> $config_mak
-  echo "#define TARGET_ARCH \"alpha\"" >> $config_h
-  echo "#define TARGET_ALPHA 1" >> $config_h
+elif test "$target_cpu" = "sparc" ; then
+  echo "TARGET_ARCH=sparc" >> $config_mak
+  echo "#define TARGET_ARCH \"sparc\"" >> $config_h
+  echo "#define TARGET_SPARC 1" >> $config_h
+elif test "$target_cpu" = "sparc64" ; then
+  echo "TARGET_ARCH=sparc64" >> $config_mak
+  echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
+  echo "#define TARGET_SPARC 1" >> $config_h
+  echo "#define TARGET_SPARC64 1" >> $config_h
+  elfload32="yes"
+elif test "$target_cpu" = "sparc32plus" ; then
+  echo "TARGET_ARCH=sparc64" >> $config_mak
+  echo "TARGET_ABI_DIR=sparc" >> $config_mak
+  echo "TARGET_ARCH2=sparc32plus" >> $config_mak
+  echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
+  echo "#define TARGET_SPARC 1" >> $config_h
+  echo "#define TARGET_SPARC64 1" >> $config_h
+  echo "#define TARGET_ABI32 1" >> $config_h
 else
   echo "Unsupported target CPU"
   exit 1
@@ -1247,7 +1257,18 @@
   echo "#define CONFIG_DARWIN_USER 1" >> $config_h
 fi
 
-if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64"  -o "$target_cpu" = "sparc32plus" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then
+if test "$target_cpu" = "arm" \
+     -o "$target_cpu" = "armeb" \
+     -o "$target_cpu" = "m68k" \
+     -o "$target_cpu" = "mips" \
+     -o "$target_cpu" = "mipsel" \
+     -o "$target_cpu" = "mipsn32" \
+     -o "$target_cpu" = "mipsn32el" \
+     -o "$target_cpu" = "mips64" \
+     -o "$target_cpu" = "mips64el" \
+     -o "$target_cpu" = "sparc" \
+     -o "$target_cpu" = "sparc64" \
+     -o "$target_cpu" = "sparc32plus"; then
   echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
   echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
 fi

Cheers,
-- 
Stuart Brady

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH] configure cleanup [v2]
  2008-04-11 19:24 [Qemu-devel] [PATCH] configure cleanup Stuart Brady
@ 2008-04-11 21:20 ` Stuart Brady
  2008-04-12 13:41 ` [Qemu-devel] [PATCH] configure cleanup Paul Brook
  1 sibling, 0 replies; 8+ messages in thread
From: Stuart Brady @ 2008-04-11 21:20 UTC (permalink / raw)
  To: qemu-devel

Hi,

The updated version below also rearranges the handling of uname -m output.

diff -urN qemu-orig/configure qemu-new/configure
--- qemu-orig/configure	2008-04-11 20:04:02.000000000 +0100
+++ qemu-new/configure	2008-04-11 22:04:21.000000000 +0100
@@ -35,17 +35,26 @@
   i386|i486|i586|i686|i86pc|BePC)
     cpu="i386"
   ;;
+  x86_64|amd64)
+    cpu="x86_64"
+  ;;
+  alpha)
+    cpu="alpha"
+  ;;
   armv*b)
     cpu="armv4b"
   ;;
   armv*l)
     cpu="armv4l"
   ;;
-  alpha)
-    cpu="alpha"
+  cris)
+    cpu="cris"
   ;;
-  "Power Macintosh"|ppc|ppc64)
-    cpu="powerpc"
+  ia64)
+    cpu="ia64"
+  ;;
+  m68k)
+    cpu="m68k"
   ;;
   mips)
     cpu="mips"
@@ -53,8 +62,8 @@
   mips64)
     cpu="mips64"
   ;;
-  cris)
-    cpu="cris"
+  "Power Macintosh"|ppc|ppc64)
+    cpu="powerpc"
   ;;
   s390*)
     cpu="s390"
@@ -65,15 +74,6 @@
   sparc64)
     cpu="sparc64"
   ;;
-  ia64)
-    cpu="ia64"
-  ;;
-  m68k)
-    cpu="m68k"
-  ;;
-  x86_64|amd64)
-    cpu="x86_64"
-  ;;
   *)
     cpu="unknown"
   ;;
@@ -575,7 +575,14 @@
 else
 
 # if cross compiling, cannot launch a program, so make a static guess
-if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "mips64" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
+if test "$cpu" = "armv4b" \
+     -o "$cpu" = "m68k" \
+     -o "$cpu" = "mips" \
+     -o "$cpu" = "mips64" \
+     -o "$cpu" = "powerpc" \
+     -o "$cpu" = "s390" \
+     -o "$cpu" = "sparc" \
+     -o "$cpu" = "sparc64"; then
     bigendian="yes"
 fi
 
@@ -583,7 +590,10 @@
 
 # host long bits test
 hostlongbits="32"
-if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
+if test "$cpu" = "x86_64" \
+     -o "$cpu" = "alpha" \
+     -o "$cpu" = "ia64" \
+     -o "$cpu" = "sparc64"; then
     hostlongbits="64"
 fi
 
@@ -843,42 +853,42 @@
 elif test "$cpu" = "x86_64" ; then
   echo "ARCH=x86_64" >> $config_mak
   echo "#define HOST_X86_64 1" >> $config_h
+elif test "$cpu" = "alpha" ; then
+  echo "ARCH=alpha" >> $config_mak
+  echo "#define HOST_ALPHA 1" >> $config_h
 elif test "$cpu" = "armv4b" ; then
   echo "ARCH=arm" >> $config_mak
   echo "#define HOST_ARM 1" >> $config_h
 elif test "$cpu" = "armv4l" ; then
   echo "ARCH=arm" >> $config_mak
   echo "#define HOST_ARM 1" >> $config_h
-elif test "$cpu" = "powerpc" ; then
-  echo "ARCH=ppc" >> $config_mak
-  echo "#define HOST_PPC 1" >> $config_h
+elif test "$cpu" = "cris" ; then
+  echo "ARCH=cris" >> $config_mak
+  echo "#define HOST_CRIS 1" >> $config_h
+elif test "$cpu" = "ia64" ; then
+  echo "ARCH=ia64" >> $config_mak
+  echo "#define HOST_IA64 1" >> $config_h
+elif test "$cpu" = "m68k" ; then
+  echo "ARCH=m68k" >> $config_mak
+  echo "#define HOST_M68K 1" >> $config_h
 elif test "$cpu" = "mips" ; then
   echo "ARCH=mips" >> $config_mak
   echo "#define HOST_MIPS 1" >> $config_h
 elif test "$cpu" = "mips64" ; then
   echo "ARCH=mips64" >> $config_mak
   echo "#define HOST_MIPS64 1" >> $config_h
-elif test "$cpu" = "cris" ; then
-  echo "ARCH=cris" >> $config_mak
-  echo "#define HOST_CRIS 1" >> $config_h
+elif test "$cpu" = "powerpc" ; then
+  echo "ARCH=ppc" >> $config_mak
+  echo "#define HOST_PPC 1" >> $config_h
 elif test "$cpu" = "s390" ; then
   echo "ARCH=s390" >> $config_mak
   echo "#define HOST_S390 1" >> $config_h
-elif test "$cpu" = "alpha" ; then
-  echo "ARCH=alpha" >> $config_mak
-  echo "#define HOST_ALPHA 1" >> $config_h
 elif test "$cpu" = "sparc" ; then
   echo "ARCH=sparc" >> $config_mak
   echo "#define HOST_SPARC 1" >> $config_h
 elif test "$cpu" = "sparc64" ; then
   echo "ARCH=sparc64" >> $config_mak
   echo "#define HOST_SPARC64 1" >> $config_h
-elif test "$cpu" = "ia64" ; then
-  echo "ARCH=ia64" >> $config_mak
-  echo "#define HOST_IA64 1" >> $config_h
-elif test "$cpu" = "m68k" ; then
-  echo "ARCH=m68k" >> $config_mak
-  echo "#define HOST_M68K 1" >> $config_h
 else
   echo "Unsupported CPU = $cpu"
   exit 1
@@ -1049,18 +1059,18 @@
 target_cpu=`echo $target | cut -d '-' -f 1`
 target_bigendian="no"
 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
-[ "$target_cpu" = "sparc" ] && target_bigendian=yes
-[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
-[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
+[ "$target_cpu" = "m68k" ] && target_bigendian=yes
+[ "$target_cpu" = "mips" ] && target_bigendian=yes
+[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
+[ "$target_cpu" = "mips64" ] && target_bigendian=yes
 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
-[ "$target_cpu" = "mips" ] && target_bigendian=yes
-[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
-[ "$target_cpu" = "mips64" ] && target_bigendian=yes
 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
-[ "$target_cpu" = "m68k" ] && target_bigendian=yes
+[ "$target_cpu" = "sparc" ] && target_bigendian=yes
+[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
+[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
 target_softmmu="no"
 target_user_only="no"
 target_linux_user="no"
@@ -1129,6 +1139,18 @@
   if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
     echo "#define USE_KQEMU 1" >> $config_h
   fi
+elif test "$target_cpu" = "x86_64" ; then
+  echo "TARGET_ARCH=x86_64" >> $config_mak
+  echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
+  echo "#define TARGET_I386 1" >> $config_h
+  echo "#define TARGET_X86_64 1" >> $config_h
+  if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"  ; then
+    echo "#define USE_KQEMU 1" >> $config_h
+  fi
+elif test "$target_cpu" = "alpha" ; then
+  echo "TARGET_ARCH=alpha" >> $config_mak
+  echo "#define TARGET_ARCH \"alpha\"" >> $config_h
+  echo "#define TARGET_ALPHA 1" >> $config_h
 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
   echo "TARGET_ARCH=arm" >> $config_mak
   echo "CONFIG_NO_DYNGEN_OP=yes" >> $config_mak
@@ -1136,24 +1158,33 @@
   echo "#define TARGET_ARM 1" >> $config_h
   echo "#define CONFIG_NO_DYNGEN_OP 1" >> $config_h
   bflt="yes"
-elif test "$target_cpu" = "sparc" ; then
-  echo "TARGET_ARCH=sparc" >> $config_mak
-  echo "#define TARGET_ARCH \"sparc\"" >> $config_h
-  echo "#define TARGET_SPARC 1" >> $config_h
-elif test "$target_cpu" = "sparc64" ; then
-  echo "TARGET_ARCH=sparc64" >> $config_mak
-  echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
-  echo "#define TARGET_SPARC 1" >> $config_h
-  echo "#define TARGET_SPARC64 1" >> $config_h
-  elfload32="yes"
-elif test "$target_cpu" = "sparc32plus" ; then
-  echo "TARGET_ARCH=sparc64" >> $config_mak
-  echo "TARGET_ABI_DIR=sparc" >> $config_mak
-  echo "TARGET_ARCH2=sparc32plus" >> $config_mak
-  echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
-  echo "#define TARGET_SPARC 1" >> $config_h
-  echo "#define TARGET_SPARC64 1" >> $config_h
-  echo "#define TARGET_ABI32 1" >> $config_h
+elif test "$target_cpu" = "cris" ; then
+  echo "TARGET_ARCH=cris" >> $config_mak
+  echo "#define TARGET_ARCH \"cris\"" >> $config_h
+  echo "#define TARGET_CRIS 1" >> $config_h
+  echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
+  echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
+elif test "$target_cpu" = "m68k" ; then
+  echo "TARGET_ARCH=m68k" >> $config_mak
+  echo "#define TARGET_ARCH \"m68k\"" >> $config_h
+  echo "#define TARGET_M68K 1" >> $config_h
+  bflt="yes"
+elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
+  echo "TARGET_ARCH=mips" >> $config_mak
+  echo "#define TARGET_ARCH \"mips\"" >> $config_h
+  echo "#define TARGET_MIPS 1" >> $config_h
+  echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
+elif test "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" ; then
+  echo "TARGET_ARCH=mipsn32" >> $config_mak
+  echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
+  echo "#define TARGET_MIPS 1" >> $config_h
+  echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
+elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then
+  echo "TARGET_ARCH=mips64" >> $config_mak
+  echo "#define TARGET_ARCH \"mips64\"" >> $config_h
+  echo "#define TARGET_MIPS 1" >> $config_h
+  echo "#define TARGET_MIPS64 1" >> $config_h
+  echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
 elif test "$target_cpu" = "ppc" ; then
   echo "TARGET_ARCH=ppc" >> $config_mak
   echo "#define TARGET_ARCH \"ppc\"" >> $config_h
@@ -1178,50 +1209,29 @@
   echo "#define TARGET_PPC 1" >> $config_h
   echo "#define TARGET_PPC64 1" >> $config_h
   echo "#define TARGET_ABI32 1" >> $config_h
-elif test "$target_cpu" = "x86_64" ; then
-  echo "TARGET_ARCH=x86_64" >> $config_mak
-  echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
-  echo "#define TARGET_I386 1" >> $config_h
-  echo "#define TARGET_X86_64 1" >> $config_h
-  if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"  ; then
-    echo "#define USE_KQEMU 1" >> $config_h
-  fi
-elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
-  echo "TARGET_ARCH=mips" >> $config_mak
-  echo "#define TARGET_ARCH \"mips\"" >> $config_h
-  echo "#define TARGET_MIPS 1" >> $config_h
-  echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
-elif test "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" ; then
-  echo "TARGET_ARCH=mipsn32" >> $config_mak
-  echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
-  echo "#define TARGET_MIPS 1" >> $config_h
-  echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
-elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then
-  echo "TARGET_ARCH=mips64" >> $config_mak
-  echo "#define TARGET_ARCH \"mips64\"" >> $config_h
-  echo "#define TARGET_MIPS 1" >> $config_h
-  echo "#define TARGET_MIPS64 1" >> $config_h
-  echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
-elif test "$target_cpu" = "cris" ; then
-  echo "TARGET_ARCH=cris" >> $config_mak
-  echo "#define TARGET_ARCH \"cris\"" >> $config_h
-  echo "#define TARGET_CRIS 1" >> $config_h
-  echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
-  echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
 elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
   echo "TARGET_ARCH=sh4" >> $config_mak
   echo "#define TARGET_ARCH \"sh4\"" >> $config_h
   echo "#define TARGET_SH4 1" >> $config_h
   bflt="yes"
-elif test "$target_cpu" = "m68k" ; then
-  echo "TARGET_ARCH=m68k" >> $config_mak
-  echo "#define TARGET_ARCH \"m68k\"" >> $config_h
-  echo "#define TARGET_M68K 1" >> $config_h
-  bflt="yes"
-elif test "$target_cpu" = "alpha" ; then
-  echo "TARGET_ARCH=alpha" >> $config_mak
-  echo "#define TARGET_ARCH \"alpha\"" >> $config_h
-  echo "#define TARGET_ALPHA 1" >> $config_h
+elif test "$target_cpu" = "sparc" ; then
+  echo "TARGET_ARCH=sparc" >> $config_mak
+  echo "#define TARGET_ARCH \"sparc\"" >> $config_h
+  echo "#define TARGET_SPARC 1" >> $config_h
+elif test "$target_cpu" = "sparc64" ; then
+  echo "TARGET_ARCH=sparc64" >> $config_mak
+  echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
+  echo "#define TARGET_SPARC 1" >> $config_h
+  echo "#define TARGET_SPARC64 1" >> $config_h
+  elfload32="yes"
+elif test "$target_cpu" = "sparc32plus" ; then
+  echo "TARGET_ARCH=sparc64" >> $config_mak
+  echo "TARGET_ABI_DIR=sparc" >> $config_mak
+  echo "TARGET_ARCH2=sparc32plus" >> $config_mak
+  echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
+  echo "#define TARGET_SPARC 1" >> $config_h
+  echo "#define TARGET_SPARC64 1" >> $config_h
+  echo "#define TARGET_ABI32 1" >> $config_h
 else
   echo "Unsupported target CPU"
   exit 1
@@ -1247,7 +1257,18 @@
   echo "#define CONFIG_DARWIN_USER 1" >> $config_h
 fi
 
-if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64"  -o "$target_cpu" = "sparc32plus" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then
+if test "$target_cpu" = "arm" \
+     -o "$target_cpu" = "armeb" \
+     -o "$target_cpu" = "m68k" \
+     -o "$target_cpu" = "mips" \
+     -o "$target_cpu" = "mipsel" \
+     -o "$target_cpu" = "mipsn32" \
+     -o "$target_cpu" = "mipsn32el" \
+     -o "$target_cpu" = "mips64" \
+     -o "$target_cpu" = "mips64el" \
+     -o "$target_cpu" = "sparc" \
+     -o "$target_cpu" = "sparc64" \
+     -o "$target_cpu" = "sparc32plus"; then
   echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
   echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
 fi

Cheers,
-- 
Stuart Brady

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] configure cleanup
  2008-04-11 19:24 [Qemu-devel] [PATCH] configure cleanup Stuart Brady
  2008-04-11 21:20 ` [Qemu-devel] [PATCH] configure cleanup [v2] Stuart Brady
@ 2008-04-12 13:41 ` Paul Brook
  2008-04-12 15:20   ` Stuart Brady
  1 sibling, 1 reply; 8+ messages in thread
From: Paul Brook @ 2008-04-12 13:41 UTC (permalink / raw)
  To: qemu-devel

> The included patch rearranges the configure script slightly, to reduce
> future merge conflicts and to make it easier to read diffs for changes
> to the script that add support extra host/target architectures/ABIs.

IMHO things like this are better expressed as switch statements. We already 
have such a switch statement a few pages above for ARCH_CFLAGS. It seems like 
these and the subsequent hostlongbits could be combined.

Paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] configure cleanup
  2008-04-12 13:41 ` [Qemu-devel] [PATCH] configure cleanup Paul Brook
@ 2008-04-12 15:20   ` Stuart Brady
  2008-04-12 16:29     ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Stuart Brady @ 2008-04-12 15:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paul Brook

On Sat, Apr 12, 2008 at 02:41:15PM +0100, Paul Brook wrote:
> > The included patch rearranges the configure script slightly, to reduce
> > future merge conflicts and to make it easier to read diffs for changes
> > to the script that add support extra host/target architectures/ABIs.
> 
> IMHO things like this are better expressed as switch statements. We already 
> have such a switch statement a few pages above for ARCH_CFLAGS. It seems like 
> these and the subsequent hostlongbits could be combined.

Using switch statements seems reasonable.

However, the lists for bigendian and hostlongbits are only used if we're
cross compiling (although the indentation does not make this obvious).
We could set them at the same time as ARCH_CFLAGS is set, but when not
cross-compiling, the values would be later replaced -- how do you feel
about that?  (Perhaps we could warn if bigendian and hostlongbits are
not guessed correctly?)

For the target_list, I've noticed we could do something like this:

for target in \
    i386-softmmu \
    x86_64-softmmu \
    arm-softmmu \
...
    sparc-softmmu \
; do target_list="$target_list $target"; done

Using switch statements for setting ARCH, HOST_$arch, TARGET_ARCH, etc.
makes sense.  However, I'm not sure what to do with target_bigendian.

I think setting CONFIG_SOFTFLOAT should probably be where TARGET_ARCH is
set... although I don't like the way the definition of TARGET_ARCH is
duplicated for each target for config.mak and config.h -- I think it'd
make more sense to set a variable for each target, and then set
TARGET_ARCH using that variable, afterwards.

Unfortunately, I could probably try to clean up 80-90% of the configure
script, but I'd rather avoid the resulting flames. :)

Cheers,
-- 
Stuart Brady

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] configure cleanup
  2008-04-12 15:20   ` Stuart Brady
@ 2008-04-12 16:29     ` Andreas Schwab
  2008-04-12 17:13       ` Stuart Brady
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2008-04-12 16:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paul Brook

Stuart Brady <sdbrady@ntlworld.com> writes:

> For the target_list, I've noticed we could do something like this:
>
> for target in \
>     i386-softmmu \
>     x86_64-softmmu \
>     arm-softmmu \
> ...
>     sparc-softmmu \
> ; do target_list="$target_list $target"; done

No need for a loop.

target_list="\
i386-softmmu \
x86_64-softmmu \
arm-softmmu \
...
sparc-softmmu \
"

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] configure cleanup
  2008-04-12 16:29     ` Andreas Schwab
@ 2008-04-12 17:13       ` Stuart Brady
  2008-04-12 18:52         ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Stuart Brady @ 2008-04-12 17:13 UTC (permalink / raw)
  To: qemu-devel

On Sat, Apr 12, 2008 at 06:29:42PM +0200, Andreas Schwab wrote:
> No need for a loop.
> 
> target_list="\
> i386-softmmu \
> x86_64-softmmu \
> arm-softmmu \
> ...
> sparc-softmmu \
> "

Oh, good point.  Are the backslashes necessary, though?

Also, as this needs to be printed, I think we'd need something like:

   target_list=`echo $target_list`

Cheers,
-- 
Stuart Brady

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] configure cleanup
  2008-04-12 17:13       ` Stuart Brady
@ 2008-04-12 18:52         ` Andreas Schwab
  2008-04-12 19:01           ` Stuart Brady
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2008-04-12 18:52 UTC (permalink / raw)
  To: qemu-devel

Stuart Brady <sdbrady@ntlworld.com> writes:

> On Sat, Apr 12, 2008 at 06:29:42PM +0200, Andreas Schwab wrote:
>> No need for a loop.
>> 
>> target_list="\
>> i386-softmmu \
>> x86_64-softmmu \
>> arm-softmmu \
>> ...
>> sparc-softmmu \
>> "
>
> Oh, good point.  Are the backslashes necessary, though?

So that the newline is ignored.

> Also, as this needs to be printed, I think we'd need something like:
>
>    target_list=`echo $target_list`

Not in the form above.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] configure cleanup
  2008-04-12 18:52         ` Andreas Schwab
@ 2008-04-12 19:01           ` Stuart Brady
  0 siblings, 0 replies; 8+ messages in thread
From: Stuart Brady @ 2008-04-12 19:01 UTC (permalink / raw)
  To: qemu-devel

On Sat, Apr 12, 2008 at 08:52:45PM +0200, Andreas Schwab wrote:
> Stuart Brady <sdbrady@ntlworld.com> writes:
> > Oh, good point.  Are the backslashes necessary, though?
> 
> So that the newline is ignored.

D'oh.  Sorry about that.  I *really* wasn't thinking straight. :(

Thanks,
-- 
Stuart Brady

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-04-12 19:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-11 19:24 [Qemu-devel] [PATCH] configure cleanup Stuart Brady
2008-04-11 21:20 ` [Qemu-devel] [PATCH] configure cleanup [v2] Stuart Brady
2008-04-12 13:41 ` [Qemu-devel] [PATCH] configure cleanup Paul Brook
2008-04-12 15:20   ` Stuart Brady
2008-04-12 16:29     ` Andreas Schwab
2008-04-12 17:13       ` Stuart Brady
2008-04-12 18:52         ` Andreas Schwab
2008-04-12 19:01           ` Stuart Brady

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).