diff --git a/build-libssl.sh b/build-libssl.sh index edca774..8b2f84d 100755 --- a/build-libssl.sh +++ b/build-libssl.sh @@ -28,14 +28,20 @@ set -u DEFAULTVERSION="1.1.1h" # 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 < { template => 1, cflags => combine('-isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common', - sub { ((!defined($ENV{'CONFIG_DISABLE_BITCODE'}) || $ENV{'CONFIG_DISABLE_BITCODE'} ne 'true') && defined($ENV{'SDKVERSION'}) && $ENV{'SDKVERSION'} =~ /^(9|[1-9][0-9]+)\./ && $disabled{shared}) - ? '-fembed-bitcode' : (); }, - ), + sub { ((!defined($ENV{'CONFIG_DISABLE_BITCODE'}) || $ENV{'CONFIG_DISABLE_BITCODE'} ne 'true') && defined($ENV{'SDKVERSION'}) && $ENV{'SDKVERSION'} =~ /^(9|[1-9][0-9]+)\./ && $disabled{shared}) + ? '-fembed-bitcode' : (); }, + ), }, - ## Base settings for iOS + ## Base settings "ios-cross-base" => { inherit_from => [ "all-base" ], 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" => { inherit_from => [ "all-base" ], 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" => { inherit_from => [ "all-base" ], template => 1, 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" => { inherit_from => [ "darwin-common", "watchos-cross-base", asm("armv7_asm") ], cflags => add("-arch armv7k -fembed-bitcode"), defines => [ "HAVE_FORK=0" ], sys_id => "WatchOS", }, - "watchos-cross-arm64_32" => { inherit_from => [ "darwin-common", "watchos-cross-base"], cflags => add("-arch arm64_32 -fembed-bitcode"), @@ -68,15 +104,7 @@ my %targets = (); defines => [ "HAVE_FORK=0" ], sys_id => "WatchOS", }, - - - "watchos-sim-cross-i386" => { - inherit_from => [ "darwin-common", "watchos-cross-base"], - cflags => add("-arch i386 -fembed-bitcode"), - defines => [ "HAVE_FORK=0" ], - sys_id => "WatchOS", - }, - + # Simulator "watchos-sim-cross-x86_64" => { inherit_from => [ "darwin64-x86_64-cc", "watchos-cross-base"], cflags => add("-fembed-bitcode"), @@ -84,67 +112,9 @@ my %targets = (); sys_id => "WatchOS", }, - ## Apple iOS simulator (x86_64) - # 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 TV - ## Apple iOS simulator (i386) - # 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 + # Device (arm64) "tvos64-cross-arm64" => { inherit_from => [ "darwin-common", "tvos-cross-base", asm("aarch64_asm") ], cflags => add("-arch arm64"), @@ -152,31 +122,9 @@ my %targets = (); perlasm_scheme => "ios64", sys_id => "tvOS", }, - - ## Apple macOS (x86_64) - "macos64-x86_64" => { - inherit_from => [ "darwin64-x86_64-cc", "macos-base" ], - 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", + # Simulator (x86_64) + "tvos-sim-cross-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "tvos-cross-base" ], + sys_id => "tvOS", }, ); diff --git a/scripts/build-loop-targets.sh b/scripts/build-loop-targets.sh index 5dc6472..36db9d3 100755 --- a/scripts/build-loop-targets.sh +++ b/scripts/build-loop-targets.sh @@ -22,35 +22,29 @@ for TARGET in ${TARGETS} do # Determine relevant SDK version - if [[ "${TARGET}" == tvos* ]]; then - SDKVERSION="${TVOS_SDKVERSION}" - elif [[ "${TARGET}" == macos* ]]; then + if [[ "${TARGET}" == macos* ]]; then SDKVERSION="${MACOS_SDKVERSION}" elif [[ "${TARGET}" == mac-catalyst-* ]]; then SDKVERSION="${CATALYST_SDKVERSION}" elif [[ "${TARGET}" == watchos* ]]; then SDKVERSION="${WATCHOS_SDKVERSION}" + elif [[ "${TARGET}" == tvos* ]]; then + SDKVERSION="${TVOS_SDKVERSION}" else SDKVERSION="${IOS_SDKVERSION}" fi # These variables are used in the configuration file export SDKVERSION + export IOS_MIN_SDK_VERSION export MACOS_MIN_SDK_VERSION export CATALYST_MIN_SDK_VERSION - export IOS_MIN_SDK_VERSION - export TVOS_MIN_SDK_VERSION export WATCHOS_MIN_SDK_VERSION + export TVOS_MIN_SDK_VERSION export CONFIG_DISABLE_BITCODE # Determine platform - if [[ "${TARGET}" == "ios-sim-cross-"* ]]; then - PLATFORM="iPhoneSimulator" - elif [[ "${TARGET}" == "tvos-sim-cross-"* ]]; then - PLATFORM="AppleTVSimulator" - elif [[ "${TARGET}" == "tvos64-cross-"* ]]; then - PLATFORM="AppleTVOS" - elif [[ "${TARGET}" == "macos"* ]]; then + if [[ "${TARGET}" == "macos"* ]]; then PLATFORM="MacOSX" elif [[ "${TARGET}" == "mac-catalyst-"* ]]; then PLATFORM="MacOSX" @@ -58,6 +52,12 @@ do PLATFORM="WatchSimulator" elif [[ "${TARGET}" == "watchos"* ]]; then 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 PLATFORM="iPhoneOS" fi