apple-xcframework.sh: force cross-compilation when relevant

Works around instabilities of the latest Tahoe beta version
This commit is contained in:
Frank Denis
2025-08-28 23:04:19 +02:00
parent ce526f94aa
commit 93030d2cae
+26 -26
View File
@@ -117,7 +117,7 @@ build_ios() {
export LDFLAGS="-arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$IOS64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$IOS64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -126,7 +126,7 @@ build_ios() {
export LDFLAGS="-arch arm64e -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$IOS64E_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$IOS64E_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
}
@@ -141,7 +141,7 @@ build_ios_simulator() {
export LDFLAGS="-arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$IOS_SIMULATOR_ARM64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$IOS_SIMULATOR_ARM64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -150,7 +150,7 @@ build_ios_simulator() {
export LDFLAGS="-arch arm64e -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$IOS_SIMULATOR_ARM64E_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$IOS_SIMULATOR_ARM64E_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -160,7 +160,7 @@ build_ios_simulator() {
export LDFLAGS="-arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=i686-apple-darwin23 --prefix="$IOS_SIMULATOR_I386_PREFIX" \
./configure --build=aarch64-apple-darwin --host=i686-apple-darwin23 --prefix="$IOS_SIMULATOR_I386_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
fi
@@ -170,7 +170,7 @@ build_ios_simulator() {
export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=x86_64-apple-darwin23 --prefix="$IOS_SIMULATOR_X86_64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=x86_64-apple-darwin23 --prefix="$IOS_SIMULATOR_X86_64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG}
make -j${PROCESSORS} install || exit 1
}
@@ -185,7 +185,7 @@ build_watchos() {
export LDFLAGS="-mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=arm-apple-darwin23 --prefix="$WATCHOS32_PREFIX" \
./configure --build=aarch64-apple-darwin --host=arm-apple-darwin23 --prefix="$WATCHOS32_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -194,7 +194,7 @@ build_watchos() {
export LDFLAGS="-mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$WATCHOS64_32_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$WATCHOS64_32_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -203,7 +203,7 @@ build_watchos() {
export LDFLAGS="-mthumb -arch arm64 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$WATCHOS64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$WATCHOS64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -212,7 +212,7 @@ build_watchos() {
export LDFLAGS="-mthumb -arch arm64e -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$WATCHOS64E_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$WATCHOS64E_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
}
@@ -227,7 +227,7 @@ build_watchos_simulator() {
export LDFLAGS="-arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_ARM64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_ARM64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -236,7 +236,7 @@ build_watchos_simulator() {
export LDFLAGS="-arch arm64e -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_ARM64E_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_ARM64E_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -245,7 +245,7 @@ build_watchos_simulator() {
export LDFLAGS="-arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=i686-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_I386_PREFIX" \
./configure --build=aarch64-apple-darwin --host=i686-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_I386_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -254,7 +254,7 @@ build_watchos_simulator() {
export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=x86_64-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_X86_64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=x86_64-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_X86_64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
}
@@ -269,7 +269,7 @@ build_tvos() {
export LDFLAGS="-arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$TVOS_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$TVOS_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -278,7 +278,7 @@ build_tvos() {
export LDFLAGS="-arch arm64e -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$TVOSE_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$TVOSE_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
}
@@ -293,7 +293,7 @@ build_tvos_simulator() {
export LDFLAGS="-arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$TVOS_SIMULATOR_ARM64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$TVOS_SIMULATOR_ARM64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -302,7 +302,7 @@ build_tvos_simulator() {
export LDFLAGS="-arch arm64e -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$TVOS_SIMULATOR_ARM64E_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$TVOS_SIMULATOR_ARM64E_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -311,7 +311,7 @@ build_tvos_simulator() {
export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=x86_64-apple-darwin23 --prefix="$TVOS_SIMULATOR_X86_64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=x86_64-apple-darwin23 --prefix="$TVOS_SIMULATOR_X86_64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG}
make -j${PROCESSORS} install || exit 1
}
@@ -325,7 +325,7 @@ build_visionos() {
export LDFLAGS="-arch arm64 -isysroot ${SDK}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$VISIONOS_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$VISIONOS_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -333,7 +333,7 @@ build_visionos() {
export LDFLAGS="-arch arm64e -isysroot ${SDK}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$VISIONOSE_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$VISIONOSE_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
}
@@ -347,7 +347,7 @@ build_visionos_simulator() {
export LDFLAGS="-arch arm64 -isysroot ${SDK}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$VISIONOS_SIMULATOR_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$VISIONOS_SIMULATOR_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -355,7 +355,7 @@ build_visionos_simulator() {
export LDFLAGS="-arch arm64e -isysroot ${SDK}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-darwin23 --prefix="$VISIONOSE_SIMULATOR_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-darwin23 --prefix="$VISIONOSE_SIMULATOR_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
}
@@ -370,7 +370,7 @@ build_catalyst() {
export LDFLAGS="-arch arm64 -target arm64-apple-ios13.1-macabi -isysroot ${SDK}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-ios --prefix="$CATALYST_ARM64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-ios --prefix="$CATALYST_ARM64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -379,7 +379,7 @@ build_catalyst() {
export LDFLAGS="-arch arm64e -target arm64e-apple-ios13.1-macabi -isysroot ${SDK}"
make distclean >/dev/null 2>&1
./configure --host=aarch64-apple-ios --prefix="$CATALYST_ARM64E_PREFIX" \
./configure --build=aarch64-apple-darwin --host=aarch64-apple-ios --prefix="$CATALYST_ARM64E_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
@@ -388,7 +388,7 @@ build_catalyst() {
export LDFLAGS="-arch x86_64 -target x86_64-apple-ios13.1-macabi -isysroot ${SDK}"
make distclean >/dev/null 2>&1
./configure --host=x86_64-apple-ios --prefix="$CATALYST_X86_64_PREFIX" \
./configure --build=aarch64-apple-darwin --host=x86_64-apple-ios --prefix="$CATALYST_X86_64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
}