Skip to content

Commit 558a965

Browse files
committed
Updated iOS build script to fix bitcode support.
1 parent 99c9042 commit 558a965

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

build-ios-mac.sh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

3-
# This script builds the iOS and Mac OpenSSL libraries (with Bitcode enabled?)
3+
# This script builds the iOS and Mac OpenSSL libraries with Bitcode enabled
44

55
# Credits:
66
# https://gist.github.com/dgventura/812a0e02bdccf08f2866fb08bb39f4be
77

8-
# Updated to work with Xcode 8.3.3 and iOS 10.10. Currently disables bitcode due to conflicting linker flags.
8+
# Updated to work with Xcode 8.3.3 and iOS 10.10.
99

1010
set -e
1111

@@ -18,7 +18,7 @@ IOS_SDK_VERSION=$(xcodebuild -version -sdk iphoneos | grep SDKVersion | cut -f2
1818
################################################
1919
# Minimum iOS deployment target version
2020
################################################
21-
MIN_IOS_VERSION="9.3"
21+
MIN_IOS_VERSION="9.0"
2222

2323
################################################
2424
# Minimum OS X deployment target version
@@ -95,15 +95,10 @@ buildIOS()
9595
export CROSS_TOP="${XCODE_DEV_PATH}/Platforms/${PLATFORM}.platform/Developer"
9696
export CROSS_SDK="${PLATFORM}${IOS_SDK_VERSION}.sdk"
9797
export BUILD_TOOLS="${XCODE_DEV_PATH}"
98-
# export CC="${BUILD_TOOLS}/usr/bin/gcc -fembed-bitcode -mios-version-min=${MIN_IOS_VERSION} -arch ${ARCH}"
99-
export CC="${BUILD_TOOLS}/usr/bin/gcc -mios-version-min=${MIN_IOS_VERSION} -arch ${ARCH}"
98+
export CC="${BUILD_TOOLS}/usr/bin/gcc -fembed-bitcode -mios-version-min=${MIN_IOS_VERSION} -arch ${ARCH}"
10099

101100
echo "Configure"
102-
if [[ "${ARCH}" == "x86_64" ]]; then
103-
./Configure darwin64-x86_64-cc --openssldir="${TEMP_BASE_DIR}/iOS-${ARCH}" --prefix="${TEMP_BASE_DIR}/iOS-${ARCH}" &> "${TEMP_BASE_DIR}/iOS-${ARCH}.log"
104-
else
105-
./Configure iphoneos-cross --openssldir="${TEMP_BASE_DIR}/iOS-${ARCH}" --prefix="${TEMP_BASE_DIR}/iOS-${ARCH}" &> "${TEMP_BASE_DIR}/iOS-${ARCH}.log"
106-
fi
101+
./Configure iphoneos-cross -no-engine --openssldir="${TEMP_BASE_DIR}/iOS-${ARCH}" --prefix="${TEMP_BASE_DIR}/iOS-${ARCH}" &> "${TEMP_BASE_DIR}/iOS-${ARCH}.log"
107102
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -mios-version-min=${MIN_IOS_VERSION} !" "Makefile"
108103
sed -ie 's/\/usr\/bin\/gcc/\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/clang/g' Makefile
109104

@@ -141,10 +136,11 @@ lipo \
141136
"${TEMP_BASE_DIR}/x86_64/lib/libssl.a" \
142137
-create -output lib/mac/libssl.a
143138

144-
buildIOS "armv7"
145-
buildIOS "arm64"
139+
146140
buildIOS "x86_64"
147141
buildIOS "i386"
142+
buildIOS "armv7"
143+
buildIOS "arm64"
148144
echo "Building iOS libraries"
149145
lipo \
150146
"${TEMP_BASE_DIR}/iOS-armv7/lib/libcrypto.a" \
@@ -164,4 +160,4 @@ cp ${TEMP_BASE_DIR}/i386/include/openssl/* include/openssl/
164160

165161
echo "Cleaning up"
166162
rm -rf ${TEMP_BASE_DIR}/*
167-
echo "Done"
163+
echo "Done"

0 commit comments

Comments
 (0)