get-arch.sh 446 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#! /bin/sh

HOST="$1"
if test -z "$HOST"; then
	echo "Usage: $0 <target machine>" >&2
	exit 1
fi

case "$HOST" in
	amd64-*)
		ARCH="x86_64"
		;;
	i[3456]86-*)
		ARCH="i386"
		;;
	powerpc-*|ppc-*)
		ARCH="ppc"
		;;
	powerpc64-*|ppc64-*)
		ARCH="ppc64"
		;;
Edric Milaret's avatar
Edric Milaret committed
22 23 24 25 26 27 28 29
	aarch64-*)
	if $HAVE_IOS
	then
		ARCH="arm64"
	else
		ARCH="aarch64"
	fi
		;;
30 31 32 33 34 35 36 37
	*-*)
		ARCH="${HOST%%-*}"
		;;
	*)
		echo "$HOST: invalid machine specification" >&2
		exit 1
esac
echo $ARCH