xref: /freebsd-src/crypto/openssl/Configurations/15-ios.conf (revision a7148ab39c03abd4d1a84997c70bf96f15dd2a09)
1e0c4386eSCy Schubert#### iPhoneOS/iOS
2e0c4386eSCy Schubert#
3e0c4386eSCy Schubert# It takes recent enough Xcode to use following two targets. It shouldn't
4e0c4386eSCy Schubert# be a problem by now, but if they don't work, original targets below
5e0c4386eSCy Schubert# that depend on manual definition of environment variables should still
6e0c4386eSCy Schubert# work...
7e0c4386eSCy Schubert#
8e0c4386eSCy Schubertmy %targets = (
9e0c4386eSCy Schubert    "ios-common" => {
10e0c4386eSCy Schubert        template         => 1,
11e0c4386eSCy Schubert        inherit_from     => [ "darwin-common" ],
12e0c4386eSCy Schubert        sys_id           => "iOS",
13*a7148ab3SEnji Cooper        disable          => [ "async" ],
14e0c4386eSCy Schubert    },
15e0c4386eSCy Schubert    "ios-xcrun" => {
16e0c4386eSCy Schubert        inherit_from     => [ "ios-common" ],
17e0c4386eSCy Schubert        # It should be possible to go below iOS 6 and even add -arch armv6,
18e0c4386eSCy Schubert        # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
19e0c4386eSCy Schubert        # at this point.
20e0c4386eSCy Schubert        CC               => "xcrun -sdk iphoneos cc",
21e0c4386eSCy Schubert        cflags           => add("-arch armv7 -mios-version-min=6.0.0 -fno-common"),
22e0c4386eSCy Schubert        asm_arch         => 'armv4',
23e0c4386eSCy Schubert        perlasm_scheme   => "ios32",
24e0c4386eSCy Schubert    },
25e0c4386eSCy Schubert    "ios64-xcrun" => {
26e0c4386eSCy Schubert        inherit_from     => [ "ios-common" ],
27e0c4386eSCy Schubert        CC               => "xcrun -sdk iphoneos cc",
28e0c4386eSCy Schubert        cflags           => add("-arch arm64 -mios-version-min=7.0.0 -fno-common"),
29e0c4386eSCy Schubert        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
30e0c4386eSCy Schubert        asm_arch         => 'aarch64',
31e0c4386eSCy Schubert        perlasm_scheme   => "ios64",
32e0c4386eSCy Schubert    },
33e0c4386eSCy Schubert    "iossimulator-xcrun" => {
34e0c4386eSCy Schubert        inherit_from     => [ "ios-common" ],
35e0c4386eSCy Schubert        CC               => "xcrun -sdk iphonesimulator cc",
36e0c4386eSCy Schubert    },
37e0c4386eSCy Schubert# It takes three prior-set environment variables to make it work:
38e0c4386eSCy Schubert#
39e0c4386eSCy Schubert# CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
40e0c4386eSCy Schubert# CROSS_TOP=/where/SDKs/are
41e0c4386eSCy Schubert# CROSS_SDK=iPhoneOSx.y.sdk
42e0c4386eSCy Schubert#
43e0c4386eSCy Schubert# Exact paths vary with Xcode releases, but for couple of last ones
44e0c4386eSCy Schubert# they would look like this:
45e0c4386eSCy Schubert#
46e0c4386eSCy Schubert# CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
47e0c4386eSCy Schubert# CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
48e0c4386eSCy Schubert# CROSS_SDK=iPhoneOS.sdk
49e0c4386eSCy Schubert#
50e0c4386eSCy Schubert    "iphoneos-cross" => {
51e0c4386eSCy Schubert        inherit_from     => [ "ios-common" ],
5244096ebdSEnji Cooper        cflags           => add("-isysroot \"\$(CROSS_TOP)/SDKs/\$(CROSS_SDK)\" -fno-common"),
53e0c4386eSCy Schubert    },
54e0c4386eSCy Schubert    "ios-cross" => {
55e0c4386eSCy Schubert        inherit_from     => [ "ios-xcrun" ],
56e0c4386eSCy Schubert        CC               => "cc",
5744096ebdSEnji Cooper        cflags           => add("-isysroot \"\$(CROSS_TOP)/SDKs/\$(CROSS_SDK)\""),
58e0c4386eSCy Schubert    },
59e0c4386eSCy Schubert    "ios64-cross" => {
60e0c4386eSCy Schubert        inherit_from     => [ "ios64-xcrun" ],
61e0c4386eSCy Schubert        CC               => "cc",
6244096ebdSEnji Cooper        cflags           => add("-isysroot \"\$(CROSS_TOP)/SDKs/\$(CROSS_SDK)\""),
63e0c4386eSCy Schubert    },
64e0c4386eSCy Schubert);
65