build.sh: Check whether the host is 64-bit

Abort right away if the user tries to build on a box that does not
appear to be 64-bit.

Change-Id: If71685c238c8e1690fd50fee9b4151f803305a81
This commit is contained in:
ayysir 2014-11-06 03:35:02 -05:00 committed by Valter Strods
parent 849d84766b
commit 60c934e0e8
1 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,13 @@ CLR_BLD_CYA=$CLR_RST$CLR_BLD$(tput setaf 6) # cyan, bold
echo -e '\0033\0143' echo -e '\0033\0143'
clear clear
# Make sure we are running on 64-bit before carrying on with anything
ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')
if [ "$ARCH" != "64" ]; then
echo -e "${CLR_BLD_RED}error: unsupported arch (expected: 64, found: $ARCH)${CLR_RST}"
exit 1
fi
# Set up paths # Set up paths
cd $(dirname $0) cd $(dirname $0)
DIR_ROOT=$(pwd) DIR_ROOT=$(pwd)