xcode 编译openssl (good)
来源:互联网 发布:怎么治疗灰指甲知乎 编辑:程序博客网 时间:2024/05/16 08:38
You can get the Source of the example app with compiled OpenSSL athttp://github.com/x2on/OpenSSL-for-iPhone
Tutorial: iPhone App With Compiled OpenSSL 1.0.0a Library
This is a tutorial for using self-compiled builds of the OpenSSL-library on the iPhone. You can build apps with XCode and the official SDK from Apple with this. I also made a small example-app for using the libraries with XCode and the iPhone/iPhone-Simulator. You can also download the precompiled OpenSSL-library (1.0.0a).
This tutorial works with OpenSSL 1.0.0a and Xcode 3.2.3 with iOS 4.
Update: Script for automatic building OpenSSL (currently 1.0.0d) for iOS:http://www.x2on.de/2010/12/16/tutorial-script-for-building-openssl-for-ios-iphoneipad/
You can find the tutorial for OpenSSL 0.9.8 at http://www.x2on.de/2010/02/01/tutorial-iphone-app-with-compiled-openssl-library/
You can get the Source of the example app with compiled OpenSSL at http://github.com/x2on/OpenSSL-for-iPhone
Create OpenSSL Libary:
Download OpenSSL Sourcecode
Change in crypto/ui/ui_openssl.c
static volatile sig_atomic_t intr_signal;
to
static volatile int intr_signal;
for preventing building error
Build OpenSSL for i368 iPhoneSimulator:
mkdir ssllibscd openssl-1.0.0amkdir openssl_armv6 openssl_armv7 openssl_i386./configure BSD-generic32 --openssldir=/Users/<username>/openssl-1.0.0a/openssl_i386
Edit Makefile:
Change CC = cc
to:
CC= /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386
Add as first item to CFLAG
:
-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk
Build it:
makemake install
Your libcrypto.a and libssl.a are in the folder openssl_i368/lib
Build OpenSSL for armv6 iOS:
mv openssl_i386 ../ssllibsmake clean./configure BSD-generic32 --openssldir=/Users/<username>/openssl-1.0.0a/openssl_armv6
Edit Makefile:
Change CC = cc
to:
CC= /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6
Add as first item to CFLAG
:
-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk
Build it:
makemake install
Your libcrypto.a and libssl.a are in the folder openssl_armv6/lib
Build OpenSSL for armv7 iOS:
mv openssl_armv6 ../ssllibsmake clean./configure BSD-generic32 --openssldir=/Users/<username>/openssl-1.0.0a/openssl_armv7
Edit Makefile:
Change CC = cc
to:
CC= /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7
Add as first item to CFLAG
:
-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk
Build it:
makemake install
Your libcrypto.a and libssl.a are in the folder openssl_armv7/lib
Create universal libs:
cp -r openssl_armv7/include ../ssllibs/lipo -create ../ssllibs/openssl_i386/lib/libcrypto.a ../ssllibs/openssl_armv6/lib/libcrypto.a openssl_armv7/lib/libcrypto.a -output ../ssllibs/libcrypto.alipo -create ../ssllibs/openssl_i386/lib/libssl.a ../ssllibs/openssl_armv6/lib/libssl.a openssl_armv7/lib/libssl.a -output ../ssllibs/libssl.a
Edit your iPhone-XCode project:
Copy the “include” folder from OpenSSL into your project-folder
Copy the libcrypto.a and libssl.a files into your project-folder
Drag the libcrypto.a and libssl.a files into your XCode Framework Folder-Tree
Open the Build-Info from your “Target” (Righclick on Target – Get Info)
Change _Library Search Paths_
to
$(inherited) "$(SRCROOT)"
Change _User Header Search Paths_
to _include_
Activate _Always Search User Paths_
Enjoy OpenSSL on the iPhone!
I have made an iOS 3.2/4.0 XCode Project with OpenSSL 1.0.0a libaries. The examples uses the MD5-algorithm to calculate an md5 hash from an UITextfield.
Download: http://github.com/x2on/OpenSSL-for-iPhone
Disclaimer: Use this at your own risk.
Links:
- http://www.therareair.com/2009/01/01/tutorial-how-to-compile-openssl-for-the-iphone/
- http://www.openssl.org/
- http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html
- xcode 编译openssl (good)
- xcode openssl
- Xcode环境下osip,eXosip, openssl的静态库编译方法(编译出来给IOS使用)
- Xcode环境下osip,eXosip, openssl的静态库编译方法(编译出来给IOS使用)
- osx的openssl的安装以及xcode连接编译
- 解决xcode 7.0以上编译找不到openssl头文件问题
- openssl windows 编译 (总结)
- OpenSSL编译(Visual Studio)
- openssl编译
- openssl编译
- 编译OpenSSL
- 编译OpenSSL
- 编译openssl
- 编译openssl
- Openssl编译
- OpenSSl编译
- OPENSSL 编译
- 编译OpenSSL
- xargs命令
- 调用lua函数executeGlobalFunction
- win7下Apache ant的安装与配置
- jsp 自定义标签库
- shell之source exec fork
- xcode 编译openssl (good)
- 图片拖拽布局
- Extjs4自定义Window关闭按钮
- FFPZ傺岸房守涝辟频sishai
- 横屏小游戏--萝莉快跑源码分析一
- Windows7(64bit)下Qt开发环境搭建
- gcc的参数 -I和-L 的用法
- 圆角窗体
- 百万级运维经验五:网站缓存设计