xref: /openssl/Configurations/15-ios.conf (revision 070b6a96)
1#### iPhoneOS/iOS
2#
3# `xcrun` targets require an Xcode that can determine the correct C compiler via
4# `xcrun -sdk iphoneos`. This has been standard in Xcode for a while now - any recent
5# Xcode should do.  If the Xcode on the build machine doesn't support this then use
6# the legacy targets at the end of this file. These require manual definition of
7# environment variables.
8#
9my %targets = (
10    "ios-common" => {
11        template         => 1,
12        inherit_from     => [ "darwin-common" ],
13        sys_id           => "iOS",
14        disable          => [ "async" ],
15    },
16    "ios-xcrun" => {
17        inherit_from     => [ "ios-common" ],
18        # It should be possible to go below iOS 6 and even add -arch armv6,
19        # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
20        # at this point.
21        CC               => "xcrun -sdk iphoneos cc",
22        cflags           => add("-arch armv7 -fno-common"),
23        asm_arch         => 'armv4',
24        perlasm_scheme   => "ios32",
25    },
26    "ios64-xcrun" => {
27        inherit_from     => [ "ios-common" ],
28        CC               => "xcrun -sdk iphoneos cc",
29        cflags           => add("-arch arm64 -fno-common"),
30        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
31        asm_arch         => 'aarch64',
32        perlasm_scheme   => "ios64",
33    },
34    "iossimulator-xcrun" => {
35        inherit_from     => [ "ios-common" ],
36        CC               => "xcrun -sdk iphonesimulator cc",
37    },
38    "iossimulator-arm64-xcrun" => {
39        inherit_from     => [ "ios-common" ],
40        CC               => "xcrun -sdk iphonesimulator cc",
41        cflags           => add("-arch arm64 -fno-common"),
42        bn_ops           => "SIXTY_FOUR_BIT_LONG",
43        asm_arch         => 'aarch64',
44        perlasm_scheme   => "ios64",
45    },
46    "iossimulator-i386-xcrun" => {
47        inherit_from     => [ "ios-common" ],
48        CC               => "xcrun -sdk iphonesimulator cc",
49        cflags           => add("-arch i386 -fno-common"),
50        bn_ops           => "BN_LLONG",
51        asm_arch         => 'x86',
52        perlasm_scheme   => "macosx",
53    },
54    "iossimulator-x86_64-xcrun" => {
55        inherit_from     => [ "ios-common" ],
56        CC               => "xcrun -sdk iphonesimulator cc",
57        cflags           => add("-arch x86_64 -fno-common"),
58        bn_ops           => "SIXTY_FOUR_BIT_LONG",
59        asm_arch         => 'x86_64',
60        perlasm_scheme   => "macosx",
61    },
62# It takes three prior-set environment variables to make it work:
63#
64# CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
65# CROSS_TOP=/where/SDKs/are
66# CROSS_SDK=iPhoneOSx.y.sdk
67#
68# Exact paths vary with Xcode releases, but for couple of last ones
69# they would look like this:
70#
71# CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
72# CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
73# CROSS_SDK=iPhoneOS.sdk
74#
75    "iphoneos-cross" => {
76        inherit_from     => [ "ios-common" ],
77        cflags           => add("-isysroot \"\$(CROSS_TOP)/SDKs/\$(CROSS_SDK)\" -fno-common"),
78    },
79    "ios-cross" => {
80        inherit_from     => [ "ios-xcrun" ],
81        CC               => "cc",
82        cflags           => add("-isysroot \"\$(CROSS_TOP)/SDKs/\$(CROSS_SDK)\""),
83    },
84    "ios64-cross" => {
85        inherit_from     => [ "ios64-xcrun" ],
86        CC               => "cc",
87        cflags           => add("-isysroot \"\$(CROSS_TOP)/SDKs/\$(CROSS_SDK)\""),
88    },
89);
90