scripts: template_setup_posix: Add Bash 3.x support on M1 Mac
The macOS default Bash 3.x (`/bin/bash`) sets the `HOSTTYPE` variable to `arm64` instead of `aarch64` on the M1 Macs, causing the setup script to try fetching the toolchain tarballs from an incorrect URL. This commit updates the setup script to re-set the `HOSTTYPE` variable to `aarch64` if `arm64` is set by the Bash. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
parent
524d52fbc7
commit
0cc56ecd18
|
@ -185,8 +185,17 @@ version=$(<sdk_version)
|
|||
|
||||
# Resolve host type
|
||||
case ${OSTYPE} in
|
||||
linux-gnu*) host="linux-${HOSTTYPE}" ;;
|
||||
darwin*) host="macos-${HOSTTYPE}" ;;
|
||||
linux-gnu*)
|
||||
host="linux-${HOSTTYPE}"
|
||||
;;
|
||||
darwin*)
|
||||
# Bash 3.x on AArch64 Darwin sets HOSTTYPE to 'arm64'
|
||||
if [ "${HOSTTYPE}" = "arm64" ]; then
|
||||
HOSTTYPE="aarch64"
|
||||
fi
|
||||
|
||||
host="macos-${HOSTTYPE}"
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unsupported host operating system"
|
||||
exit 5
|
||||
|
|
Loading…
Reference in New Issue