编译ios平台的openssl


发现一个不错的地方介绍如何在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:

  1. Download the OpenSSL source code directly from http://www.openssl.org/source/
  2. Clone the openssl-xcode git repo to make a local copy
  3. 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:

  1. Drag the openssl.xcodeproj file into your main project
  2. Right-click on your project target, and add openssl.xcodeproj under "Direct Dependencies" on the General tab.
  3. 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.


你可能感兴趣的:(ios,xcode,Build,平台,makefile,dependencies)