Clean up architecture detection

As with the ``$platform`` assignment in ``libretro-install.sh``, this uses ``case`` statements to greatly simplify the detection and handling of the architecture.
This commit is contained in:
Sam Stuewe 2013-07-20 09:04:37 -05:00
parent 331a95e93f
commit e2c0315031

View File

@ -88,39 +88,20 @@ die()
#exit 1 #exit 1
} }
ARCH=$(uname -m) case "$(uname -m)" in
X86=false x86_64) X86=true && X86_64=true;;
X86_64=false i686) X86=true;;
ARM=false armv*)
ARMV5=false ARM=true && export FORMAT_COMPILER_TARGET=armv
ARMV6=false case "$(uname -m)" in
ARMV7=false armv5tel) ARMV5=true;;
if [ $ARCH = x86_64 ]; then armv6l) ARMV6=true;;
echo "x86_64 CPU detected" armv7l) ARMV7=true;;
X86=true esac;;
X86_64=true esac
elif [ $ARCH = i686 ]; then
echo "x86_32 CPU detected" echo "$(uname -m) CPU detected"
X86=true export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"
elif [ $ARCH = armv5tel ]; then
echo "ARMv5 CPU detected"
ARM=true
ARMV5=true
export FORMAT_COMPILER_TARGET=armv
export FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET
elif [ $ARCH = armv6l ]; then
echo "ARMv6 CPU detected"
ARM=true
ARMV6=true
export FORMAT_COMPILER_TARGET=armv
export FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET
elif [ $ARCH = armv7l ]; then
echo "ARMv7 CPU detected"
ARM=true
ARMV7=true
export FORMAT_COMPILER_TARGET=armv
export FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET
fi
if [ "$HOST_CC" ]; then if [ "$HOST_CC" ]; then
CC="${HOST_CC}-gcc" CC="${HOST_CC}-gcc"