iOS compiling OpenSSL guide

Source: Internet
Author: User

First, OpenSSL supports iOS compilation, which is no doubt that the compilation on iOS is also no different from the Configure make make install mode, but there are some differences such as
 
   
  
  1. ./Configure iphoneos-cross --openssldir="${cur_output}"
Configure to use the Configure command, pass the cross-parameter Iphoneos-cross, Openssldir call this sentence after the installation directory
 
   
  
  1. sed -ie "s!^CFLAG=!CFLAG=-miphoneos-version-min=7.0 !" "Makefile"
Modify the Cflag parameter in the makefile file generated in the previous step, plus-miphoneos-version-min=7.0Specify the target minimum version, the result of my experiment is that if I do not add this sentence, the last link will be an error, probably means that I think you want to compile on the Mac to run the east, but now I want to connect to I386CPU prepared for, I fainted and so on.
The next one is make. We know that iOS is divided into many platforms, and on iOS, multiple platform files can be lipo into a package, so how to control the platform parameters of this OpenSSL compilation?
 
   
  
  1. export CROSS_TOP=${cur_cross_top}
  2. export CROSS_SDK=${cur_cross_sdk}
  3. export CC=${cur_cc}
Note that the above three can be variable, must be exported, makefile file has reference to these three variables cross_top variable similar
 
   
  
  1. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
This way
CROSS_SDK variable Similar
 
   
  
  1. iPhoneOS8.1.sdk
This way
And the CC variable is probably
 
   
  
  1. /Applications/Xcode.app/Contents/Developer/usr/lib/gcc -arch armv7
Such a
This experimental environment is MacOS10.10 Xcode 6.1 environment



From for notes (Wiz)

iOS compiling OpenSSL guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.