mirror of
https://github.com/cculianu/Fulcrum.git
synced 2026-08-13 12:33:27 +02:00
docker based static builder: Allow arm64 (aarch64) hosts
This commit allows aarch64 and/or arm64 hosts to cross-build for amd64 docker targets (the reverse was always supported). This commit is needed because now I run an Apple Silicon Mac and I'd like to be able to cross-build to x64_64.
This commit is contained in:
parent
4b38a7590e
commit
92fd99fee8
1 changed files with 23 additions and 4 deletions
|
|
@ -19,6 +19,19 @@ if [ -z "$2" ]; then
|
||||||
fi
|
fi
|
||||||
tag="$2"
|
tag="$2"
|
||||||
|
|
||||||
|
host_arch=$(uname -m)
|
||||||
|
case "$host_arch" in
|
||||||
|
"arm64"|"aarch64")
|
||||||
|
host_arch="arm64"
|
||||||
|
;;
|
||||||
|
"x86_64"|"amd64")
|
||||||
|
host_arch="amd64"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
fail "Uknown host arch: $host_arch"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
arch_arg=""
|
arch_arg=""
|
||||||
arch_suffix=""
|
arch_suffix=""
|
||||||
arch="$3"
|
arch="$3"
|
||||||
|
|
@ -28,22 +41,28 @@ if [ -n "$arch" ]; then
|
||||||
arch_arg="--platform linux/arm64"
|
arch_arg="--platform linux/arm64"
|
||||||
arch_suffix="_arm64"
|
arch_suffix="_arm64"
|
||||||
;;
|
;;
|
||||||
|
"amd64")
|
||||||
|
arch_arg="--platform linux/amd64"
|
||||||
|
arch_suffix="_amd64"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
fail "Unknown arch \"$arch\", specify either nothing or \"arm64\""
|
fail "Unknown arch \"$arch\", specify either nothing or one of: \"arm64\", \"amd64\""
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
else
|
||||||
|
arch="${host_arch}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
suffix=""
|
suffix=""
|
||||||
case "$plat" in
|
case "$plat" in
|
||||||
"windows"|"win")
|
"windows"|"win")
|
||||||
[ -z "$arch_arg" ] || fail "Cannot use platform \"$plat\" with \"$arch\""
|
[ "${arch}" = "amd64" ] || fail "Cannot use platform \"$plat\" with \"$arch\""
|
||||||
plat=win # normalize to 'win'
|
plat=win # normalize to 'win'
|
||||||
docker_img_name="fulcrum-builder/qt6:windows"
|
docker_img_name="fulcrum-builder/qt6:windows"
|
||||||
docker_cont_name="fulcrum_cont_qt6_windows_$$"
|
docker_cont_name="fulcrum_cont_qt6_windows_$$"
|
||||||
;;
|
;;
|
||||||
"linux"|"lin")
|
"linux"|"lin")
|
||||||
[ -z "$arch_arg" ] || fail "Cannot use platform \"$plat\" with \"$arch\"; please use \"linux_ub20\" instead"
|
[ "${arch}" = "amd64" ] || fail "Cannot use platform \"$plat\" with \"$arch\"; please use \"linux_ub20\" instead"
|
||||||
plat=linux
|
plat=linux
|
||||||
docker_img_name="fulcrum-builder/qt6:linux"
|
docker_img_name="fulcrum-builder/qt6:linux"
|
||||||
docker_cont_name="fulcrum_cont_qt6_linux_$$"
|
docker_cont_name="fulcrum_cont_qt6_linux_$$"
|
||||||
|
|
@ -71,7 +90,7 @@ case "$plat" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
osxfs_option=""
|
osxfs_option=""
|
||||||
if [ `uname` == "Darwin" ]; then
|
if [ $(uname) == "Darwin" ]; then
|
||||||
osxfs_option=":delegated"
|
osxfs_option=":delegated"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue