From 54b3c10c7b508efea93f2152f2ec72ca0ff79976 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Sat, 30 Oct 2021 22:36:58 +0900 Subject: [PATCH] apple: build.sh: fix compilation on Mac M1 --- extras/package/apple/build.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh index 86d48df271..aa1ed0769d 100755 --- a/extras/package/apple/build.sh +++ b/extras/package/apple/build.sh @@ -236,11 +236,8 @@ set_host_triplet() # exactly, which will cause autoconf to assume we are not cross-compiling. # Therefore we construct a triplet here without a version number, which # will not match the autoconf "guessed" host machine triplet. - if [ "${triplet_arch}" = "arm64" ]; then - triplet_arch="aarch64" - fi - VLC_HOST_TRIPLET="${triplet_arch}-apple-darwin" + VLC_HOST_TRIPLET="${VLC_HOST_TRIPLET/arm64/aarch64}" } # Set the VLC_BUILD_TRIPLET based on the architecture @@ -252,7 +249,8 @@ set_host_triplet() set_build_triplet() { local build_arch="$(uname -m | cut -d. -f1)" - VLC_BUILD_TRIPLET="$(cc -arch "${build_arch}" -dumpmachine)" + VLC_BUILD_TRIPLET="$(${VLC_HOST_CC} -arch "${build_arch}" -dumpmachine)" + VLC_BUILD_TRIPLET="${VLC_BUILD_TRIPLET/arm64/aarch64}" } # Take SDK name, verify it exists and populate