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;
to
static volatile int intr_signal;
Save your changes and you should now be able to build with no errors.
Build Libraries
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!
找到build_all: build_libs build_apps build_tests build_tools(大概在242行)
修改为build_all: build_libs build_apps build_tools
分享到:
相关推荐
How to compile Amalgamation for android
how to compile the sample ?
SQLCipher-4.4.0 How to compile SQLCipher on Windows
How to compile Windows Server 2003-bO0daYbti5g.mkv windows server 2003操作系统源代码构建指南视频教程
1、直接将编译好的包openssl1.1.1i-compile.tar上传包至/opt 2、解压 tar -zxvf openssl1.1.1i-compile.tar.gz 3、将解压出来的openssl移动到/usr/local下 mv openssl /usr/local/ 4、备份原来的,设置软链(参考我...
How to build compile server with virtualbox & samba
(跑通sqlcipher-4.4.0)https://www.youtube.com/watch?v=SFHGeetZ0po
OpenSSL Installation Project is dedicated to providing a simple installation of OpenSSL for Microsoft Windows. It is easy to set up and easy to use through the simple, effective installer. No need to ...
openssl android ndk编译脚本,可通过修改配置单独编译输出arm32 arm64的库
We'll look at how to use the unit test framework called Ceedling to help us do this. In the first example, we'll see how to create tests and write the code to make them pass. In the second example we ...
The last chapter explains how a compiler works and shows how to compile "by hand" little (but not trivial--even recursive) programs. The book is intended for anyone who thinks mathematically and ...
n List the major elements of the .NET Framew ork and explain how C# fits into the .NET platform. n Analyze the basic structure of a C# application and be able to debug, compile, and run a simple ...
通过整理和实践,详细说明如何编译QT动态库和静态库
Android L Dialog A library to be used for creating android-l like dialogs on android 2.3 ...How to compile the example Download the zip Extract Import with android studio or intellij Run How to
I would like to thank the following people for taking the time to explain things that were unclear to me and for proofreading the document. Andrey A. Chernov Bruce A. Mah Dag-Erling Smørgrav ...
Moving ahead, you'll master design constraints and learn how to use the power of the GPU in your Julia code and compile Julia code directly to the GPU. Then, you'll learn how tasks and asynchronous ...
2.Introduce how to compile and install linux kernel with ACPI support . 3.Introduce ACPI power state and ACPI tables 4.Introduce CPU management under ACPI. 5.Introduce Linux suspend to ram and how to ...
Instructions on how to download and install the JavaMail API are contained in the course. In addition, you will need a development environment such as the JDK 1.1.6+ or the Java 2 Platform, Standard...
Chapter 6, Building a Smart Contract Deployment Platform, shows how to compile smart contracts using web3.js and deploy it using web3.js and EthereumJS. Chapter 7, Building a Betting App, explains how...
tech you how to compile,and use