## SPDX-License-Identifier: Apache-2.0 ## An extension of OpenSSL's Configurations, after the settings of its targets in 10-main.conf and 15-ios.conf ## (Copyright The OpenSSL Project Authors), under OpenSSL's license, the Apache License 2.0. ## Configure targets of the otok recipe: one per OS and architecture of the Apple slices. otok's ## toolchain brings the compiler and its flags (CC, CFLAGS with -target and -isysroot), so these targets ## carry no compiler, SDK or deployment version, unlike the -xcrun targets of 15-ios.conf. my %targets = ( "otok-apple" => { template => 1, inherit_from => [ "darwin-common" ], disable => [ "shared", "async" ], }, # as darwin64-arm64; ios64-xcrun adds RC4_CHAR, a speed choice for RC4. Where the architectures of # one platform differ in bn_ops (watchOS: arm64_32 beside arm64), otok keeps configuration.h per # architecture. "otok-apple-arm64" => { template => 1, inherit_from => [ "otok-apple" ], lib_cppflags => add("-DL_ENDIAN"), bn_ops => "SIXTY_FOUR_BIT_LONG", asm_arch => 'aarch64', perlasm_scheme => "ios64", }, "otok-apple-x86_64" => { template => 1, inherit_from => [ "otok-apple" ], lib_cppflags => add("-DL_ENDIAN"), bn_ops => "SIXTY_FOUR_BIT_LONG", asm_arch => 'x86_64', perlasm_scheme => "macosx", }, # Apple Watch: 32-bit pointers on a 64-bit CPU, no assembler "otok-apple-arm64_32" => { template => 1, inherit_from => [ "otok-apple" ], lib_cppflags => add("-DL_ENDIAN"), bn_ops => "BN_LLONG RC4_CHAR", }, ); # sys_id tells OpenSSL the OS; macOS and Mac Catalyst keep darwin-common's MACOSX my @systems = ([ "macos", undef, [] ], [ "ios", "iOS", [] ], [ "tvos", "tvOS", [ "engine" ] ], [ "watchos", "watchOS", [ "engine" ] ], [ "xros", "visionOS", [] ]); foreach my $system (@systems) { my ($os, $sys_id, $disable) = @$system; foreach my $arch ("arm64", "x86_64", "arm64_32") { $targets{"otok-$os-$arch"} = { inherit_from => [ "otok-apple-$arch" ], (defined $sys_id ? (sys_id => $sys_id) : ()), (@$disable ? (disable => add(@$disable)) : ()), }; } } %targets;