xcode是6.3版的,ios sdk 是8.3的,
到http://www.openssl.org/source/下载最新版本openssl-1.0.2a
解压后用文本编辑器打开configure文件,
----------------------------------------------------------------------------------------------------------------------------------------------------------
将
# iPhoneOS/iOS
"iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
----------------------------------------------------------------------------------------------------------------------------------------------------------
替换为:
# iPhoneOS/iOS
"iphoneos-cross","llvm-gcc:-arch arm64 -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
----------------------------------------------------------------------------------------------------------------------------------------------------------
然后打开terminal,运行命令
./configure --prefix=/libs/openssl-1.0.2a/arm64 iphoneos-cross
make
make install
模拟器的可以用如下命令:
./configure --prefix=/libs/openssl-1.0.2a/x86_64 darwin64-x86_64-cc
./configure --prefix=/libs/openssl-1.0.2a/i386 darwin-i386-cc
make
make install
make clean