创建脚本文件build_openssl_for_macos_and_ios.sh,脚本内容如下:
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
set -e
usage ()
{
echo "usage: $0 [minimum iOS SDK version (default 7.0)]"
exit 127
}
if [ $1 -e "-h" ]; then
usage
fi
# 指定SDK最小版本号
MIN_SDK_VERSION="7.0"
if [ -z $1 ]; then
SDK_VERSION="9.3"
else
SDK_VERSION=$1
fi
# 指定OpenSSL的版本号
OPENSSL_VERSION="openssl-1.0.2u"
DEVELOPER=`xcode-select -print-path`
buildMac()
{
ARCH=$1
echo "Building ${OPENSSL_VERSION} for ${ARCH}"
TARGET="darwin-i386-cc"
if [[ $ARCH == "x86_64" ]

本文介绍了一个用于构建适用于iOS和Mac平台的OpenSSL库的Shell脚本。该脚本可下载并配置OpenSSL源码,针对不同架构(如i386、x86_64、armv7等)进行编译,并最终生成统一的静态库文件。
最低0.47元/天 解锁文章
1048

被折叠的 条评论
为什么被折叠?



