-if test "$target_cpu" = "i386" ; then
- echo "TARGET_ARCH=i386" >> $config_mak
- echo "#define TARGET_ARCH \"i386\"" >> $config_h
- echo "#define TARGET_I386 1" >> $config_h
- if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
- echo "#define USE_KQEMU 1" >> $config_h
- fi
-elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
- echo "TARGET_ARCH=arm" >> $config_mak
- echo "#define TARGET_ARCH \"arm\"" >> $config_h
- echo "#define TARGET_ARM 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
-elif test "$target_cpu" = "ppc" ; then
- echo "TARGET_ARCH=ppc" >> $config_mak
- echo "#define TARGET_ARCH \"ppc\"" >> $config_h
- echo "#define TARGET_PPC 1" >> $config_h
-elif test "$target_cpu" = "ppc64" ; then
- echo "TARGET_ARCH=ppc64" >> $config_mak
- echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
- echo "#define TARGET_PPC 1" >> $config_h
- echo "#define TARGET_PPC64 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 "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"
-else
- echo "Unsupported target CPU"
- exit 1
-fi
+case "$target_cpu" in
+ i386)
+ echo "TARGET_ARCH=i386" >> $config_mak
+ echo "#define TARGET_ARCH \"i386\"" >> $config_h
+ echo "#define TARGET_I386 1" >> $config_h
+ if test $kqemu = "yes" -a "$target_softmmu" = "yes"
+ then
+ echo "#define USE_KQEMU 1" >> $config_h
+ fi
+ gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
+ if test -n "$gcc3minver" && test $gcc3minver -gt 3
+ then
+ echo "HAVE_GT_GCC_3_3=true" >> $config_mak
+ else
+ echo "HAVE_GT_GCC_3_3=false" >> $config_mak
+ fi
+ ;;
+ x86_64)
+ 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
+ ;;
+ alpha)
+ echo "TARGET_ARCH=alpha" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
+ echo "#define TARGET_ARCH \"alpha\"" >> $config_h
+ echo "#define TARGET_ALPHA 1" >> $config_h
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ ;;
+ arm|armeb)
+ echo "TARGET_ARCH=arm" >> $config_mak
+ echo "#define TARGET_ARCH \"arm\"" >> $config_h
+ echo "#define TARGET_ARM 1" >> $config_h
+ bflt="yes"
+ target_nptl="yes"
+ ;;
+ cris)
+ echo "TARGET_ARCH=cris" >> $config_mak
+ echo "#define TARGET_ARCH \"cris\"" >> $config_h
+ echo "#define TARGET_CRIS 1" >> $config_h
+ ;;
+ m68k)
+ echo "TARGET_ARCH=m68k" >> $config_mak
+ echo "#define TARGET_ARCH \"m68k\"" >> $config_h
+ echo "#define TARGET_M68K 1" >> $config_h
+ bflt="yes"
+ ;;
+ mips|mipsel)
+ echo "TARGET_ARCH=mips" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
+ echo "#define TARGET_ARCH \"mips\"" >> $config_h
+ echo "#define TARGET_MIPS 1" >> $config_h
+ echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ ;;
+ mipsn32|mipsn32el)
+ echo "TARGET_ARCH=mipsn32" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
+ echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
+ echo "#define TARGET_MIPS 1" >> $config_h
+ echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ ;;
+ mips64|mips64el)
+ echo "TARGET_ARCH=mips64" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $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
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ ;;
+ ppc)
+ echo "TARGET_ARCH=ppc" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
+ echo "#define TARGET_ARCH \"ppc\"" >> $config_h
+ echo "#define TARGET_PPC 1" >> $config_h
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ ;;
+ ppcemb)
+ echo "TARGET_ARCH=ppcemb" >> $config_mak
+ echo "TARGET_ABI_DIR=ppc" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
+ echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
+ echo "#define TARGET_PPC 1" >> $config_h
+ echo "#define TARGET_PPCEMB 1" >> $config_h
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ ;;
+ ppc64)
+ echo "TARGET_ARCH=ppc64" >> $config_mak
+ echo "TARGET_ABI_DIR=ppc" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
+ echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
+ echo "#define TARGET_PPC 1" >> $config_h
+ echo "#define TARGET_PPC64 1" >> $config_h
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ ;;
+ ppc64abi32)
+ echo "TARGET_ARCH=ppc64" >> $config_mak
+ echo "TARGET_ABI_DIR=ppc" >> $config_mak
+ echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
+ echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
+ echo "#define TARGET_PPC 1" >> $config_h
+ echo "#define TARGET_PPC64 1" >> $config_h
+ echo "#define TARGET_ABI32 1" >> $config_h
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ ;;
+ sh4|sh4eb)
+ echo "TARGET_ARCH=sh4" >> $config_mak
+ echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
+ echo "#define TARGET_ARCH \"sh4\"" >> $config_h
+ echo "#define TARGET_SH4 1" >> $config_h
+ echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+ bflt="yes"
+ ;;
+ sparc)
+ echo "TARGET_ARCH=sparc" >> $config_mak
+ echo "#define TARGET_ARCH \"sparc\"" >> $config_h
+ echo "#define TARGET_SPARC 1" >> $config_h
+ ;;
+ sparc64)
+ 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"
+ ;;
+ sparc32plus)
+ 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
+ ;;
+ *)
+ echo "Unsupported target CPU"
+ exit 1
+ ;;
+esac