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
./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
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?
export CROSS_TOP=${cur_cross_top}
export CROSS_SDK=${cur_cross_sdk}
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
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
This way
CROSS_SDK variable Similar
iPhoneOS8.1.sdk
This way
And the CC variable is probably
/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