您的位置:首页 > 移动开发 > IOS开发

编译ios平台的openssl

2011-11-28 11:53 495 查看
发现一个不错的地方介绍如何在ios平台下编译openssl,试用了一下,成功了。

需要注意的一点是,需要用openssl1.0编译,同时编译出来的文件生成在openssl目录下面:libCrypto.a libssl.a
https://github.com/sjlombardo/openssl-xcode


Usage

In a normal case you would use it thusly:

Download the OpenSSL source code directly from http://www.openssl.org/source/

Clone the openssl-xcode git repo to make a local copy

Either: a. Put the downloaded OpenSSL source tar.gz into the same folder as openssl.xcodeproj.

b. Place an extracted OpenSSL distribution in a folder called 'openssl' within the same folder as openssl.xcodeproj c. Extracted the OpenSSL distribution directly into the same folder as openssl.xcodeproj. d. Setup a source tree definition in XCode for OPENSSL_SRC
pointing the folder containing openssl source code

Then, either open openssl.xcodeproj in XCode and initiate a build, or integrate it within another project:

Drag the openssl.xcodeproj file into your main project

Right-click on your project target, and add openssl.xcodeproj under "Direct Dependencies" on the General tab.

On the Build tab for your project's target, find the "Header Search Paths" option, and add the path: >
$(SRCROOT)/Library/openssl/build/openssl.build/openssl/include


(Assuming you've put openssl.xcodeproj at the path Library/openssl, and are building from a source tarball) 4. Expand your target's "Link Binary With Libraries" build stage, and drag libcrypto.a from the openssl.xcodeproj group.

This project actually relies on the OpenSSL configure and make system to build the libraries. However, it does attempt to automatically detect and use the appropriate build settings for arch (i386/ppc/armv6), build tools, and SDK directories. This makes it
appropriate for inclusion as a project reference into an iPhone application project. This project will also check to see if the resulting crypto library is newer than the project Makefile to avoid time consuming rebuild cycles.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: