Skip to content

Commit 233f917

Browse files
authored
Merge pull request leenjewel#53 from nguoithichkhampha/fix-bug-build-iOS13
fix bug build with open ssl 1.1.1 on iOS 13
2 parents 1c480d2 + c6757e0 commit 233f917

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tools/build-openssl4ios.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ configure_make()
7373
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
7474
export CROSS_SDK="${PLATFORM}${SDK_VERSION}.sdk"
7575
export TOOLS="${DEVELOPER}"
76-
export CC="${TOOLS}/usr/bin/gcc -arch ${ARCH}"
76+
export CC="${TOOLS}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch ${ARCH}"
7777

7878
PREFIX_DIR="${pwd_path}/../output/ios/openssl-${ARCH}"
7979
if [ -d "${PREFIX_DIR}" ]; then
@@ -83,22 +83,17 @@ configure_make()
8383

8484
if [[ "${ARCH}" == "x86_64" ]]; then
8585
unset IPHONEOS_DEPLOYMENT_TARGET
86-
./Configure darwin64-x86_64-cc --prefix="${PREFIX_DIR}"
87-
export CFLAGS="-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK}"
86+
./Configure darwin64-x86_64-cc --prefix="${PREFIX_DIR}" "-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK}"
8887
elif [[ "${ARCH}" == "i386" ]]; then
8988
unset IPHONEOS_DEPLOYMENT_TARGET
90-
./Configure darwin-i386-cc --prefix="${PREFIX_DIR}"
91-
export CFLAGS="-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK}"
89+
./Configure darwin-i386-cc --prefix="${PREFIX_DIR}" "-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK}"
9290
else
9391
# instruction:
9492
# 1.no-shared and -fembed-bitcode is not compatibility
9593
# 2.advise use only .a static library on iOS
9694
export IPHONEOS_DEPLOYMENT_TARGET=${IOS_MIN_TARGET}
97-
./Configure iphoneos-cross no-shared --prefix="${PREFIX_DIR}"
98-
export CFLAGS="-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -fembed-bitcode "
99-
sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
95+
./Configure iphoneos-cross no-shared --prefix="${PREFIX_DIR}" "-fembed-bitcode"
10096
fi
101-
echo CFLAGS=${CFLAGS}
10297
# read -n1 -p "Press any key to continue..."
10398

10499
if [ ! -d ${CROSS_TOP}/SDKs/${CROSS_SDK} ]; then

0 commit comments

Comments
 (0)