Strip and reorder targets

- Adjust target min SDKs to build script
- Split opensslconf suffix by platform
- Drop old i386 targets
This commit is contained in:
Davide De Rosa 2020-11-11 20:37:03 +01:00
parent 09dc3f6031
commit 2be1214e3b
3 changed files with 174 additions and 223 deletions

View File

@ -28,14 +28,20 @@ set -u
DEFAULTVERSION="1.1.1h" DEFAULTVERSION="1.1.1h"
# Default (=full) set of targets (OpenSSL >= 1.1.1) to build # Default (=full) set of targets (OpenSSL >= 1.1.1) to build
DEFAULTTARGETS="ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e tvos-sim-cross-x86_64 tvos64-cross-arm64 macos64-x86_64 watchos-cross-armv7k watchos-cross-arm64_32 watchos-sim-cross-i386 watchos-sim-cross-x86_64 mac-catalyst-x86_64" DEFAULTTARGETS=`cat <<TARGETS
ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e
macos64-x86_64
mac-catalyst-x86_64
watchos-cross-armv7k watchos-cross-arm64_32 watchos-sim-cross-x86_64
tvos-sim-cross-x86_64 tvos64-cross-arm64
TARGETS`
# Minimum iOS/tvOS SDK version to build for # Minimum iOS/tvOS SDK version to build for
IOS_MIN_SDK_VERSION="12.0" IOS_MIN_SDK_VERSION="12.0"
TVOS_MIN_SDK_VERSION="12.0"
MACOS_MIN_SDK_VERSION="10.15" MACOS_MIN_SDK_VERSION="10.15"
CATALYST_MIN_SDK_VERSION="10.15" CATALYST_MIN_SDK_VERSION="10.15"
WATCHOS_MIN_SDK_VERSION="4.0" WATCHOS_MIN_SDK_VERSION="4.0"
TVOS_MIN_SDK_VERSION="12.0"
# Init optional env variables (use available variable or default to empty string) # Init optional env variables (use available variable or default to empty string)
CURL_OPTIONS="${CURL_OPTIONS:-}" CURL_OPTIONS="${CURL_OPTIONS:-}"
@ -49,15 +55,15 @@ echo_help()
echo " --cleanup Clean up build directories (bin, include/openssl, lib, src) before starting build" echo " --cleanup Clean up build directories (bin, include/openssl, lib, src) before starting build"
echo " --ec-nistp-64-gcc-128 Enable configure option enable-ec_nistp_64_gcc_128 for 64 bit builds" echo " --ec-nistp-64-gcc-128 Enable configure option enable-ec_nistp_64_gcc_128 for 64 bit builds"
echo " -h, --help Print help (this message)" echo " -h, --help Print help (this message)"
echo " --ios-sdk=SDKVERSION Override iOS SDK version"
echo " --macos-sdk=SDKVERSION Override macOS SDK version" echo " --macos-sdk=SDKVERSION Override macOS SDK version"
echo " --catalyst-sdk=SDKVERSION Override macOS SDK version for Catalyst" echo " --catalyst-sdk=SDKVERSION Override macOS SDK version for Catalyst"
echo " --ios-sdk=SDKVERSION Override iOS SDK version"
echo " --tvos-sdk=SDKVERSION Override tvOS SDK version"
echo " --watchos-sdk=SDKVERSION Override watchOS SDK version" echo " --watchos-sdk=SDKVERSION Override watchOS SDK version"
echo " --min-macos-sdk=SDKVERSION Set minimum macOS SDK version (default: $MACOS_MIN_SDK_VERSION)" echo " --tvos-sdk=SDKVERSION Override tvOS SDK version"
echo " --min-ios-sdk=SDKVERSION Set minimum iOS SDK version (default: $IOS_MIN_SDK_VERSION)" echo " --min-ios-sdk=SDKVERSION Set minimum iOS SDK version (default: $IOS_MIN_SDK_VERSION)"
echo " --min-tvos-sdk=SDKVERSION Set minimum tvOS SDK version (default: $TVOS_MIN_SDK_VERSION)" echo " --min-macos-sdk=SDKVERSION Set minimum macOS SDK version (default: $MACOS_MIN_SDK_VERSION)"
echo " --min-watchos-sdk=SDKVERSION Set minimum watchOS SDK version (default: $WATCHOS_MIN_SDK_VERSION)" echo " --min-watchos-sdk=SDKVERSION Set minimum watchOS SDK version (default: $WATCHOS_MIN_SDK_VERSION)"
echo " --min-tvos-sdk=SDKVERSION Set minimum tvOS SDK version (default: $TVOS_MIN_SDK_VERSION)"
echo " --noparallel Disable running make with parallel jobs (make -j)" echo " --noparallel Disable running make with parallel jobs (make -j)"
echo " --disable-bitcode Disable embedding Bitcode" echo " --disable-bitcode Disable embedding Bitcode"
echo " -v, --verbose Enable verbose logging" echo " -v, --verbose Enable verbose logging"
@ -167,18 +173,30 @@ finish_build_loop()
rm -r "${SOURCEDIR}" rm -r "${SOURCEDIR}"
# Add references to library files to relevant arrays # Add references to library files to relevant arrays
if [[ "${PLATFORM}" == AppleTV* ]]; then if [[ "${PLATFORM}" == iPhone* ]]; then
LIBSSL_TVOS+=("${TARGETDIR}/lib/libssl.a") LIBSSL_IOS+=("${TARGETDIR}/lib/libssl.a")
LIBCRYPTO_TVOS+=("${TARGETDIR}/lib/libcrypto.a") LIBCRYPTO_IOS+=("${TARGETDIR}/lib/libcrypto.a")
OPENSSLCONF_SUFFIX="tvos_${ARCH}" if [[ "${PLATFORM}" == iPhoneSimulator* ]]; then
OPENSSLCONF_SUFFIX="ios_sim_${ARCH}"
else
OPENSSLCONF_SUFFIX="ios_${ARCH}"
fi
elif [[ "${PLATFORM}" == Watch* ]]; then elif [[ "${PLATFORM}" == Watch* ]]; then
LIBSSL_WATCHOS+=("${TARGETDIR}/lib/libssl.a") LIBSSL_WATCHOS+=("${TARGETDIR}/lib/libssl.a")
LIBCRYPTO_WATCHOS+=("${TARGETDIR}/lib/libcrypto.a") LIBCRYPTO_WATCHOS+=("${TARGETDIR}/lib/libcrypto.a")
if [[ "${PLATFORM}" == WatchSimulator* ]]; then
OPENSSLCONF_SUFFIX="watchos_sim_${ARCH}"
else
OPENSSLCONF_SUFFIX="watchos_${ARCH}" OPENSSLCONF_SUFFIX="watchos_${ARCH}"
elif [[ "${PLATFORM}" == iPhone* ]]; then fi
LIBSSL_IOS+=("${TARGETDIR}/lib/libssl.a") elif [[ "${PLATFORM}" == AppleTV* ]]; then
LIBCRYPTO_IOS+=("${TARGETDIR}/lib/libcrypto.a") LIBSSL_TVOS+=("${TARGETDIR}/lib/libssl.a")
OPENSSLCONF_SUFFIX="ios_${ARCH}" LIBCRYPTO_TVOS+=("${TARGETDIR}/lib/libcrypto.a")
if [[ "${PLATFORM}" == AppleTVSimulator* ]]; then
OPENSSLCONF_SUFFIX="tvos_sim_${ARCH}"
else
OPENSSLCONF_SUFFIX="tvos_${ARCH}"
fi
elif [[ "${PLATFORM}" == Catalyst* ]]; then elif [[ "${PLATFORM}" == Catalyst* ]]; then
LIBSSL_CATALYST+=("${TARGETDIR}/lib/libssl.a") LIBSSL_CATALYST+=("${TARGETDIR}/lib/libssl.a")
LIBCRYPTO_CATALYST+=("${TARGETDIR}/lib/libcrypto.a") LIBCRYPTO_CATALYST+=("${TARGETDIR}/lib/libcrypto.a")
@ -207,14 +225,14 @@ CLEANUP=""
CONFIG_ENABLE_EC_NISTP_64_GCC_128="" CONFIG_ENABLE_EC_NISTP_64_GCC_128=""
CONFIG_DISABLE_BITCODE="" CONFIG_DISABLE_BITCODE=""
CONFIG_NO_DEPRECATED="" CONFIG_NO_DEPRECATED=""
IOS_SDKVERSION=""
MACOS_SDKVERSION="" MACOS_SDKVERSION=""
CATALYST_SDKVERSION="" CATALYST_SDKVERSION=""
IOS_SDKVERSION=""
WATCHOS_SDKVERSION="" WATCHOS_SDKVERSION=""
TVOS_SDKVERSION=""
LOG_VERBOSE="" LOG_VERBOSE=""
PARALLEL="" PARALLEL=""
TARGETS="" TARGETS=""
TVOS_SDKVERSION=""
VERSION="" VERSION=""
# Process command line arguments # Process command line arguments
@ -241,6 +259,10 @@ case $i in
echo_help echo_help
exit exit
;; ;;
--ios-sdk=*)
IOS_SDKVERSION="${i#*=}"
shift
;;
--macos-sdk=*) --macos-sdk=*)
MACOS_SDKVERSION="${i#*=}" MACOS_SDKVERSION="${i#*=}"
shift shift
@ -249,8 +271,28 @@ case $i in
CATALYST_SDKVERSION="${i#*=}" CATALYST_SDKVERSION="${i#*=}"
shift shift
;; ;;
--ios-sdk=*) --watchos-sdk=*)
IOS_SDKVERSION="${i#*=}" WATCHOS_SDKVERSION="${i#*=}"
shift
;;
--tvos-sdk=*)
TVOS_SDKVERSION="${i#*=}"
shift
;;
--min-ios-sdk=*)
IOS_MIN_SDK_VERSION="${i#*=}"
shift
;;
--min-macos-sdk=*)
MACOS_MIN_SDK_VERSION="${i#*=}"
shift
;;
--min-watchos-sdk=*)
WATCHOS_MIN_SDK_VERSION="${i#*=}"
shift
;;
--min-tvos-sdk=*)
TVOS_MIN_SDK_VERSION="${i#*=}"
shift shift
;; ;;
--noparallel) --noparallel)
@ -260,30 +302,6 @@ case $i in
TARGETS="${i#*=}" TARGETS="${i#*=}"
shift shift
;; ;;
--tvos-sdk=*)
TVOS_SDKVERSION="${i#*=}"
shift
;;
--watchos-sdk=*)
WATCHOS_SDKVERSION="${i#*=}"
shift
;;
--min-macos-sdk=*)
MACOS_MIN_SDK_VERSION="${i#*=}"
shift
;;
--min-ios-sdk=*)
IOS_MIN_SDK_VERSION="${i#*=}"
shift
;;
--min-tvos-sdk=*)
TVOS_MIN_SDK_VERSION="${i#*=}"
shift
;;
--min-watchos-sdk=*)
WATCHOS_MIN_SDK_VERSION="${i#*=}"
shift
;;
-v|--verbose) -v|--verbose)
LOG_VERBOSE="verbose" LOG_VERBOSE="verbose"
;; ;;
@ -349,21 +367,21 @@ if [ "${CONFIG_NO_DEPRECATED}" != "false" ]; then
fi fi
# Determine SDK versions # Determine SDK versions
if [ ! -n "${IOS_SDKVERSION}" ]; then
IOS_SDKVERSION=$(xcrun -sdk iphoneos --show-sdk-version)
fi
if [ ! -n "${MACOS_SDKVERSION}" ]; then if [ ! -n "${MACOS_SDKVERSION}" ]; then
MACOS_SDKVERSION=$(xcrun -sdk macosx --show-sdk-version) MACOS_SDKVERSION=$(xcrun -sdk macosx --show-sdk-version)
fi fi
if [ ! -n "${CATALYST_SDKVERSION}" ]; then if [ ! -n "${CATALYST_SDKVERSION}" ]; then
CATALYST_SDKVERSION=$(xcrun -sdk macosx --show-sdk-version) CATALYST_SDKVERSION=$(xcrun -sdk macosx --show-sdk-version)
fi fi
if [ ! -n "${IOS_SDKVERSION}" ]; then if [ ! -n "${WATCHOS_SDKVERSION}" ]; then
IOS_SDKVERSION=$(xcrun -sdk iphoneos --show-sdk-version) WATCHOS_SDKVERSION=$(xcrun -sdk watchos --show-sdk-version)
fi fi
if [ ! -n "${TVOS_SDKVERSION}" ]; then if [ ! -n "${TVOS_SDKVERSION}" ]; then
TVOS_SDKVERSION=$(xcrun -sdk appletvos --show-sdk-version) TVOS_SDKVERSION=$(xcrun -sdk appletvos --show-sdk-version)
fi fi
if [ ! -n "${WATCHOS_SDKVERSION}" ]; then
WATCHOS_SDKVERSION=$(xcrun -sdk watchos --show-sdk-version)
fi
# Truncate to minor version # Truncate to minor version
MINOR_VERSION=(${MACOS_SDKVERSION//./ }) MINOR_VERSION=(${MACOS_SDKVERSION//./ })
@ -413,11 +431,11 @@ echo
echo "Build options" echo "Build options"
echo " OpenSSL version: ${VERSION}" echo " OpenSSL version: ${VERSION}"
echo " Targets: ${TARGETS}" echo " Targets: ${TARGETS}"
echo " iOS SDK: ${IOS_SDKVERSION} (min ${IOS_MIN_SDK_VERSION})"
echo " macOS SDK: ${MACOS_SDKVERSION} (min ${MACOS_MIN_SDK_VERSION})" echo " macOS SDK: ${MACOS_SDKVERSION} (min ${MACOS_MIN_SDK_VERSION})"
echo " macOS SDK (Catalyst): ${CATALYST_SDKVERSION} (min ${CATALYST_MIN_SDK_VERSION})" echo " macOS SDK (Catalyst): ${CATALYST_SDKVERSION} (min ${CATALYST_MIN_SDK_VERSION})"
echo " iOS SDK: ${IOS_SDKVERSION} (min ${IOS_MIN_SDK_VERSION})"
echo " tvOS SDK: ${TVOS_SDKVERSION} (min ${TVOS_MIN_SDK_VERSION})"
echo " watchOS SDK: ${WATCHOS_SDKVERSION} (min ${WATCHOS_MIN_SDK_VERSION})" echo " watchOS SDK: ${WATCHOS_SDKVERSION} (min ${WATCHOS_MIN_SDK_VERSION})"
echo " tvOS SDK: ${TVOS_SDKVERSION} (min ${TVOS_MIN_SDK_VERSION})"
if [ "${CONFIG_DISABLE_BITCODE}" == "true" ]; then if [ "${CONFIG_DISABLE_BITCODE}" == "true" ]; then
echo " Bitcode embedding disabled" echo " Bitcode embedding disabled"
fi fi
@ -494,19 +512,26 @@ mkdir -p "${CURRENTPATH}/src"
# Init vars for library references # Init vars for library references
INCLUDE_DIR="" INCLUDE_DIR=""
OPENSSLCONF_ALL=() OPENSSLCONF_ALL=()
LIBSSL_IOS=()
LIBCRYPTO_IOS=()
LIBSSL_MACOS=() LIBSSL_MACOS=()
LIBCRYPTO_MACOS=() LIBCRYPTO_MACOS=()
LIBSSL_CATALYST=() LIBSSL_CATALYST=()
LIBCRYPTO_CATALYST=() LIBCRYPTO_CATALYST=()
LIBSSL_IOS=()
LIBCRYPTO_IOS=()
LIBSSL_TVOS=()
LIBCRYPTO_TVOS=()
LIBSSL_WATCHOS=() LIBSSL_WATCHOS=()
LIBCRYPTO_WATCHOS=() LIBCRYPTO_WATCHOS=()
LIBSSL_TVOS=()
LIBCRYPTO_TVOS=()
source "${SCRIPTDIR}/scripts/build-loop-targets.sh" source "${SCRIPTDIR}/scripts/build-loop-targets.sh"
# Build iOS library if selected for build
if [ ${#LIBSSL_IOS[@]} -gt 0 ]; then
echo "Build library for iOS..."
lipo -create ${LIBSSL_IOS[@]} -output "${CURRENTPATH}/lib/libssl-iPhone.a"
lipo -create ${LIBCRYPTO_IOS[@]} -output "${CURRENTPATH}/lib/libcrypto-iPhone.a"
fi
#Build macOS library if selected for build #Build macOS library if selected for build
if [ ${#LIBSSL_MACOS[@]} -gt 0 ]; then if [ ${#LIBSSL_MACOS[@]} -gt 0 ]; then
echo "Build library for macOS..." echo "Build library for macOS..."
@ -521,11 +546,11 @@ if [ ${#LIBSSL_CATALYST[@]} -gt 0 ]; then
lipo -create ${LIBCRYPTO_CATALYST[@]} -output "${CURRENTPATH}/lib/libcrypto-Catalyst.a" lipo -create ${LIBCRYPTO_CATALYST[@]} -output "${CURRENTPATH}/lib/libcrypto-Catalyst.a"
fi fi
# Build iOS library if selected for build # Build tvOS library if selected for build
if [ ${#LIBSSL_IOS[@]} -gt 0 ]; then if [ ${#LIBSSL_WATCHOS[@]} -gt 0 ]; then
echo "Build library for iOS..." echo "Build library for watchOS..."
lipo -create ${LIBSSL_IOS[@]} -output "${CURRENTPATH}/lib/libssl-iPhone.a" lipo -create ${LIBSSL_WATCHOS[@]} -output "${CURRENTPATH}/lib/libssl-WatchOS.a"
lipo -create ${LIBCRYPTO_IOS[@]} -output "${CURRENTPATH}/lib/libcrypto-iPhone.a" lipo -create ${LIBCRYPTO_WATCHOS[@]} -output "${CURRENTPATH}/lib/libcrypto-WatchOS.a"
fi fi
# Build tvOS library if selected for build # Build tvOS library if selected for build
@ -535,13 +560,6 @@ if [ ${#LIBSSL_TVOS[@]} -gt 0 ]; then
lipo -create ${LIBCRYPTO_TVOS[@]} -output "${CURRENTPATH}/lib/libcrypto-AppleTV.a" lipo -create ${LIBCRYPTO_TVOS[@]} -output "${CURRENTPATH}/lib/libcrypto-AppleTV.a"
fi fi
# Build tvOS library if selected for build
if [ ${#LIBSSL_WATCHOS[@]} -gt 0 ]; then
echo "Build library for watchOS..."
lipo -create ${LIBSSL_WATCHOS[@]} -output "${CURRENTPATH}/lib/libssl-WatchOS.a"
lipo -create ${LIBCRYPTO_WATCHOS[@]} -output "${CURRENTPATH}/lib/libcrypto-WatchOS.a"
fi
# Copy include directory # Copy include directory
cp -R "${INCLUDE_DIR}" "${CURRENTPATH}/include/" cp -R "${INCLUDE_DIR}" "${CURRENTPATH}/include/"
@ -563,38 +581,20 @@ if [ ${#OPENSSLCONF_ALL[@]} -gt 1 ]; then
# Determine define condition # Determine define condition
case "${OPENSSLCONF_CURRENT}" in case "${OPENSSLCONF_CURRENT}" in
*_macos_x86_64.h)
DEFINE_CONDITION="TARGET_OS_OSX && TARGET_CPU_X86_64"
;;
*_macos_i386.h)
DEFINE_CONDITION="TARGET_OS_OSX && TARGET_CPU_X86"
;;
*_catalyst_x86_64.h)
DEFINE_CONDITION="(TARGET_OS_MACCATALYST || (TARGET_OS_IOS && TARGET_OS_SIMULATOR)) && TARGET_CPU_X86_64"
;;
*_ios_x86_64.h)
DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64"
;;
*_ios_i386.h)
DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_SIMULATOR && TARGET_CPU_X86"
;;
*_ios_arm64.h) *_ios_arm64.h)
DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64" DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64"
;; ;;
*_ios_arm64e.h) *_ios_arm64e.h)
DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64E" DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64E"
;; ;;
*_ios_armv7s.h) *_ios_sim_x86_64.h)
DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM && defined(__ARM_ARCH_7S__)" DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64"
;; ;;
*_ios_armv7.h) *_macos_x86_64.h)
DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM && !defined(__ARM_ARCH_7S__)" DEFINE_CONDITION="TARGET_OS_OSX && TARGET_CPU_X86_64"
;; ;;
*_tvos_x86_64.h) *_catalyst_x86_64.h)
DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64" DEFINE_CONDITION="(TARGET_OS_MACCATALYST || (TARGET_OS_IOS && TARGET_OS_SIMULATOR)) && TARGET_CPU_X86_64"
;;
*_tvos_arm64.h)
DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64"
;; ;;
*_watchos_armv7k.h) *_watchos_armv7k.h)
DEFINE_CONDITION="TARGET_OS_WATCHOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARMV7K" DEFINE_CONDITION="TARGET_OS_WATCHOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARMV7K"
@ -602,12 +602,15 @@ if [ ${#OPENSSLCONF_ALL[@]} -gt 1 ]; then
*_watchos_arm64_32.h) *_watchos_arm64_32.h)
DEFINE_CONDITION="TARGET_OS_WATCHOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64_32" DEFINE_CONDITION="TARGET_OS_WATCHOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64_32"
;; ;;
*_watchos_i386.h) *_watchos_sim_x86_64.h)
DEFINE_CONDITION="TARGET_OS_SIMULATOR && TARGET_CPU_X86 || TARGET_OS_EMBEDDED"
;;
*_watchos_x86_64.h)
DEFINE_CONDITION="TARGET_OS_SIMULATOR && TARGET_CPU_X86_64 || TARGET_OS_EMBEDDED" DEFINE_CONDITION="TARGET_OS_SIMULATOR && TARGET_CPU_X86_64 || TARGET_OS_EMBEDDED"
;; ;;
*_tvos_arm64.h)
DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64"
;;
*_tvos_sim_x86_64.h)
DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64"
;;
*) *)
# Don't run into unexpected cases by setting the default condition to false # Don't run into unexpected cases by setting the default condition to false
DEFINE_CONDITION="0" DEFINE_CONDITION="0"

View File

@ -15,45 +15,81 @@ my %targets = ();
), ),
}, },
## Base settings for iOS ## Base settings
"ios-cross-base" => { "ios-cross-base" => {
inherit_from => [ "all-base" ], inherit_from => [ "all-base" ],
template => 1, template => 1,
cflags => add(sub { defined($ENV{'IOS_MIN_SDK_VERSION'}) ? '-mios-version-min=$(IOS_MIN_SDK_VERSION)' : '-mios-version-min=7.0'; }), cflags => add(sub { defined($ENV{'IOS_MIN_SDK_VERSION'}) ? '-mios-version-min=$(IOS_MIN_SDK_VERSION)' : '-mios-version-min=12.0'; }),
}, },
## Base settings for tvOS
# Defines to skip functionality that uses unsupported functions
"tvos-cross-base" => {
inherit_from => [ "all-base" ],
template => 1,
cflags => add(sub { defined($ENV{'TVOS_MIN_SDK_VERSION'}) ? '-mtvos-version-min=$(TVOS_MIN_SDK_VERSION)' : '-mtvos-version-min=9.0'; }),
defines => [ "HAVE_FORK=0" ],
},
## Base settings for macOS
"macos-base" => { "macos-base" => {
inherit_from => [ "all-base" ], inherit_from => [ "all-base" ],
template => 1, template => 1,
cflags => add(sub { defined($ENV{'MACOS_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(MACOS_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.11'; }), cflags => add(sub { defined($ENV{'MACOS_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(MACOS_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }),
},
"mac-catalyst-base" => {
inherit_from => [ "all-base" ],
template => 1,
# cflags => add(sub { defined($ENV{'CATALYST_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(CATALYST_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }),
}, },
## Apple WatchOS
## Base settings for iOS
"watchos-cross-base" => { "watchos-cross-base" => {
inherit_from => [ "all-base" ], inherit_from => [ "all-base" ],
template => 1, template => 1,
cflags => add(sub { defined($ENV{'WATCH_MIN_SDK_VERSION'}) ? '-mwatchos-version-min=$(WATCH_MIN_SDK_VERSION)' : '-mwatchos-version-min=4.0'; }), cflags => add(sub { defined($ENV{'WATCH_MIN_SDK_VERSION'}) ? '-mwatchos-version-min=$(WATCH_MIN_SDK_VERSION)' : '-mwatchos-version-min=4.0'; }),
}, },
"tvos-cross-base" => {
inherit_from => [ "all-base" ],
template => 1,
cflags => add(sub { defined($ENV{'TVOS_MIN_SDK_VERSION'}) ? '-mtvos-version-min=$(TVOS_MIN_SDK_VERSION)' : '-mtvos-version-min=12.0'; }),
defines => [ "HAVE_FORK=0" ],
},
## Apple iOS
# Device (arm64)
"ios64-cross-arm64" => {
inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ],
cflags => add("-arch arm64"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "ios64",
sys_id => "iOS",
},
# Device (arm64e)
"ios64-cross-arm64e" => {
inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ],
cflags => add("-arch arm64e"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "ios64",
sys_id => "iOS",
},
# Simulator (x86_64)
"ios-sim-cross-x86_64" => {
inherit_from => [ "darwin64-x86_64-cc", "ios-cross-base" ],
sys_id => "iOS",
},
## Apple macOS
# Device (x86_64)
"macos64-x86_64" => {
inherit_from => [ "darwin64-x86_64-cc", "macos-base" ],
sys_id => "macOS",
},
# Catalyst (x86_64)
"mac-catalyst-x86_64" => {
inherit_from => [ "darwin64-x86_64-cc", "mac-catalyst-base" ],
cflags => add("-target x86_64-apple-ios13.0-macabi"),
sys_id => "MacOSX",
},
## Apple WatchOS
# Device
"watchos-cross-armv7k" => { "watchos-cross-armv7k" => {
inherit_from => [ "darwin-common", "watchos-cross-base", asm("armv7_asm") ], inherit_from => [ "darwin-common", "watchos-cross-base", asm("armv7_asm") ],
cflags => add("-arch armv7k -fembed-bitcode"), cflags => add("-arch armv7k -fembed-bitcode"),
defines => [ "HAVE_FORK=0" ], defines => [ "HAVE_FORK=0" ],
sys_id => "WatchOS", sys_id => "WatchOS",
}, },
"watchos-cross-arm64_32" => { "watchos-cross-arm64_32" => {
inherit_from => [ "darwin-common", "watchos-cross-base"], inherit_from => [ "darwin-common", "watchos-cross-base"],
cflags => add("-arch arm64_32 -fembed-bitcode"), cflags => add("-arch arm64_32 -fembed-bitcode"),
@ -68,15 +104,7 @@ my %targets = ();
defines => [ "HAVE_FORK=0" ], defines => [ "HAVE_FORK=0" ],
sys_id => "WatchOS", sys_id => "WatchOS",
}, },
# Simulator
"watchos-sim-cross-i386" => {
inherit_from => [ "darwin-common", "watchos-cross-base"],
cflags => add("-arch i386 -fembed-bitcode"),
defines => [ "HAVE_FORK=0" ],
sys_id => "WatchOS",
},
"watchos-sim-cross-x86_64" => { "watchos-sim-cross-x86_64" => {
inherit_from => [ "darwin64-x86_64-cc", "watchos-cross-base"], inherit_from => [ "darwin64-x86_64-cc", "watchos-cross-base"],
cflags => add("-fembed-bitcode"), cflags => add("-fembed-bitcode"),
@ -84,67 +112,9 @@ my %targets = ();
sys_id => "WatchOS", sys_id => "WatchOS",
}, },
## Apple iOS simulator (x86_64) ## Apple TV
# Based on 10-main.conf: iphoneos-cross / darwin64-x86_64-cc
"ios-sim-cross-x86_64" => {
inherit_from => [ "darwin64-x86_64-cc", "ios-cross-base" ],
sys_id => "iOS",
},
## Apple iOS simulator (i386) # Device (arm64)
# Based on 10-main.conf: iphoneos-cross / darwin-i386-cc
"ios-sim-cross-i386" => {
inherit_from => [ "darwin-i386-cc", "ios-cross-base" ],
sys_id => "iOS",
},
## Apple iOS (arm64)
# Based on 10-main.conf: ios64-cross
"ios64-cross-arm64" => {
inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ],
cflags => add("-arch arm64"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "ios64",
sys_id => "iOS",
},
## Apple iOS (arm64e)
# Based on 10-main.conf: ios64-cross
"ios64-cross-arm64e" => {
inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ],
cflags => add("-arch arm64e"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "ios64",
sys_id => "iOS",
},
## Apple iOS (armv7s)
# Based on 10-main.conf: ios-cross
"ios-cross-armv7s" => {
inherit_from => [ "darwin-common", "ios-cross-base", asm("armv4_asm") ],
cflags => add("-arch armv7s"),
perlasm_scheme => "ios32",
sys_id => "iOS",
},
## Apple iOS (armv7)
# Based on 10-main.conf: ios-cross
"ios-cross-armv7" => {
inherit_from => [ "darwin-common", "ios-cross-base", asm("armv4_asm") ],
cflags => add("-arch armv7"),
perlasm_scheme => "ios32",
sys_id => "iOS",
},
## Apple tvOS simulator (x86_64)
# Based on 10-main.conf: iphoneos-cross / darwin64-x86_64-cc
"tvos-sim-cross-x86_64" => {
inherit_from => [ "darwin64-x86_64-cc", "tvos-cross-base" ],
sys_id => "tvOS",
},
## Apple tvOS (arm64)
# Based on 10-main.conf: ios64-cross
"tvos64-cross-arm64" => { "tvos64-cross-arm64" => {
inherit_from => [ "darwin-common", "tvos-cross-base", asm("aarch64_asm") ], inherit_from => [ "darwin-common", "tvos-cross-base", asm("aarch64_asm") ],
cflags => add("-arch arm64"), cflags => add("-arch arm64"),
@ -152,31 +122,9 @@ my %targets = ();
perlasm_scheme => "ios64", perlasm_scheme => "ios64",
sys_id => "tvOS", sys_id => "tvOS",
}, },
# Simulator (x86_64)
## Apple macOS (x86_64) "tvos-sim-cross-x86_64" => {
"macos64-x86_64" => { inherit_from => [ "darwin64-x86_64-cc", "tvos-cross-base" ],
inherit_from => [ "darwin64-x86_64-cc", "macos-base" ], sys_id => "tvOS",
sys_id => "macOS",
},
## Apple macOS (i386)
"macos-i386" => {
inherit_from => [ "darwin-i386-cc", "macos-base" ],
sys_id => "macOS",
},
## Catalyst
# Based on
"mac-catalyst-base" => {
inherit_from => [ "all-base" ],
template => 1,
# cflags => add(sub { defined($ENV{'CATALYST_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(CATALYST_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }),
},
## Catalyst (armv7s)
"mac-catalyst-x86_64" => {
inherit_from => [ "darwin64-x86_64-cc", "mac-catalyst-base" ],
cflags => add("-target x86_64-apple-ios13.0-macabi"),
sys_id => "MacOSX",
}, },
); );

View File

@ -22,35 +22,29 @@
for TARGET in ${TARGETS} for TARGET in ${TARGETS}
do do
# Determine relevant SDK version # Determine relevant SDK version
if [[ "${TARGET}" == tvos* ]]; then if [[ "${TARGET}" == macos* ]]; then
SDKVERSION="${TVOS_SDKVERSION}"
elif [[ "${TARGET}" == macos* ]]; then
SDKVERSION="${MACOS_SDKVERSION}" SDKVERSION="${MACOS_SDKVERSION}"
elif [[ "${TARGET}" == mac-catalyst-* ]]; then elif [[ "${TARGET}" == mac-catalyst-* ]]; then
SDKVERSION="${CATALYST_SDKVERSION}" SDKVERSION="${CATALYST_SDKVERSION}"
elif [[ "${TARGET}" == watchos* ]]; then elif [[ "${TARGET}" == watchos* ]]; then
SDKVERSION="${WATCHOS_SDKVERSION}" SDKVERSION="${WATCHOS_SDKVERSION}"
elif [[ "${TARGET}" == tvos* ]]; then
SDKVERSION="${TVOS_SDKVERSION}"
else else
SDKVERSION="${IOS_SDKVERSION}" SDKVERSION="${IOS_SDKVERSION}"
fi fi
# These variables are used in the configuration file # These variables are used in the configuration file
export SDKVERSION export SDKVERSION
export IOS_MIN_SDK_VERSION
export MACOS_MIN_SDK_VERSION export MACOS_MIN_SDK_VERSION
export CATALYST_MIN_SDK_VERSION export CATALYST_MIN_SDK_VERSION
export IOS_MIN_SDK_VERSION
export TVOS_MIN_SDK_VERSION
export WATCHOS_MIN_SDK_VERSION export WATCHOS_MIN_SDK_VERSION
export TVOS_MIN_SDK_VERSION
export CONFIG_DISABLE_BITCODE export CONFIG_DISABLE_BITCODE
# Determine platform # Determine platform
if [[ "${TARGET}" == "ios-sim-cross-"* ]]; then if [[ "${TARGET}" == "macos"* ]]; then
PLATFORM="iPhoneSimulator"
elif [[ "${TARGET}" == "tvos-sim-cross-"* ]]; then
PLATFORM="AppleTVSimulator"
elif [[ "${TARGET}" == "tvos64-cross-"* ]]; then
PLATFORM="AppleTVOS"
elif [[ "${TARGET}" == "macos"* ]]; then
PLATFORM="MacOSX" PLATFORM="MacOSX"
elif [[ "${TARGET}" == "mac-catalyst-"* ]]; then elif [[ "${TARGET}" == "mac-catalyst-"* ]]; then
PLATFORM="MacOSX" PLATFORM="MacOSX"
@ -58,6 +52,12 @@ do
PLATFORM="WatchSimulator" PLATFORM="WatchSimulator"
elif [[ "${TARGET}" == "watchos"* ]]; then elif [[ "${TARGET}" == "watchos"* ]]; then
PLATFORM="WatchOS" PLATFORM="WatchOS"
elif [[ "${TARGET}" == "tvos-sim-cross-"* ]]; then
PLATFORM="AppleTVSimulator"
elif [[ "${TARGET}" == "tvos64-cross-"* ]]; then
PLATFORM="AppleTVOS"
elif [[ "${TARGET}" == "ios-sim-cross-"* ]]; then
PLATFORM="iPhoneSimulator"
else else
PLATFORM="iPhoneOS" PLATFORM="iPhoneOS"
fi fi