How To Compile OpenSSL for the iPhone
来源:互联网 发布:vivo软件商店网页版 编辑:程序博客网 时间:2024/06/11 12:21
This is a quick tutorial to show you how to minimally compile a version of the openssl and crypto libraries for the iPhone/iPad.
Download and Configure OpenSSL
First thing to do is grab the openssl source. You can get that here. I’ll be using openssl-1.0.0 for this demo. Unzip this file (mines on the desktop). Open up a terminal and go to the unzipped folder and run the default configuration. The argument passed is where your ‘make install’ will place the compiled libraries. You should replace this with your path.
cd Desktop/openssl-1.0.0./config --openssldir=/Users/airpard/Desktop/openssl_ios/ no-asm
* Note if you want a simulator build you should do a regular make; make install at this point. The following steps are for armv6 and armv7 using the latest v4.2 iOS environment.
Edit the Makefile
Next thing to do is open up the make file. This is named “Makefile” in the current directory you should already be in with the terminal. Here are the list of changes to make (for armv7, replace armv6 references below):
Find CC= cc and change it to:CC= /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 Find -arch i386 in CFLAG and change it to:-arch armv6 Find CFLAG and add to the BEGINNING!!:-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk Find SHARED_LDFLAGS=-arch i386 -dynamiclib and change it to:SHARED_LDFLAGS=-arch armv6 -dynamiclib Find PEX_LIBS= -Wl, -search_paths_firstxc and change it to:PEX_LIBS= -Wl
Fix Build Error
If you build it at this point you may have noticed a build error. To fix this open up ui_openssl.c. This is located in openssl-1.0.0/crypto/ui/ folder. If you have a text editor with line numbers, head down to line 407. Otherwise do a text search to make this change:
static volatile sig_atomic_t intr_signal;tostatic volatile int intr_signal;
Save your changes and you should now be able to build with no errors.
Build Libraries
makemake install
That’s it. You’ll notice that everything was moved to the path provided in step 1 when configuring openssl. Remember to add the include folder to your Xcode project. Also, remember these libraries are only built for the iPhone and will not work in the simulator. You can change all the armv6 references to i386 and build it again if you choose to. Happy Coding!
http://www.therareair.com/2009/01/01/tutorial-how-to-compile-openssl-for-the-iphone/
- How To Compile OpenSSL for the iPhone
- How to cross-compile OpenSSL for ARM
- How to compile openssl library
- How to compile kernel modules for the kernel 2.6
- How to Cross Compile the Bash shell for Android 1.5
- How to write Assembly code for the iPhone:
- How to cross-compile Chromium for ARM
- How to Compile the Linux Kernel
- How to Cross Compile the Busybox
- how to compile the linux kernel
- How to Cross Compile the Bash shell for Android 1.5 (为Android平台编译Bash shell)
- How to compile the IJG JPEG library (libjpeg) for Visual Studio 2010
- (OK) how to compile the source code for Android-x86 (Android 7.1.1)
- compile openssl for ios
- How to cross compile the PPP to arm-xscale
- How to compile VLC media player for Windows
- How to Compile SQLite for Android using NDK
- How to compile FFmpeg for Raspberry Pi (Raspbian)
- Window.ShowModalDialog使用手册
- snd_kcontrol_new名称中的SOURCE字段
- CFI Flash, JEDEC Flash ,Parellel Flash, SPI Flash, Nand Flash,Nor Flash的区别和联系
- .net面试题总结1
- 解决ads工程转到MDK(keil)可能出现的error
- How To Compile OpenSSL for the iPhone
- linux的链接
- 水仙花数
- linux删除unity
- 我也要开始写博客啦
- 什么是 MIME Type?
- android 资源文件详解
- 使用libcurl连接https服务器
- 面试算法题总结——引言