IOS: 5.1
OS: Lion 10.7.4
1) Compile arm6
Makedir arm6lib
./Configure BSD-generic32 -- prefix =/libs/OpenSSL -- openssldir =/libs/OpenSSL
Change the makefile
Cc =/applications/xcode. APP/contents/developer/platforms/iphoneos. Platform/developer/usr/bin/GCC-arch armv7
Cflag =-dopenssl_threads-pthread-d_thread_safe-d_reentrant-ddso_dlfcn-dhave_dlfcn_h-dtermios-O3-fomit-frame-pointer-wall-isysroot/applications/xcode. APP/contents/developer/platforms/iphoneos. platform/developer/sdks/iphoneos5.1.sdk
Make
Make install
Copy the arm6lib directory
Delete the openssl-0.9.8d directory because it is found that make clean does not really clear all, leave a lot of. O files directly in this environment to compile the ARM7 will generate errors
2) Compile the ARM7 program.
Compiling in the new environment is similar to that in arm6
Makedir arm7lib
./Configure BSD-generic32 -- prefix =/libs/OpenSSL -- openssldir =/libs/OpenSSL
Change the makefile
Cc =/applications/xcode. APP/contents/developer/platforms/iphoneos. Platform/developer/usr/bin/GCC-arch armv7
Cflag =-dopenssl_threads-pthread-d_thread_safe-d_reentrant-ddso_dlfcn-dhave_dlfcn_h-dtermios-O3-fomit-frame-pointer-wall-isysroot/applications/xcode. APP/contents/developer/platforms/iphoneos. platform/developer/sdks/iphoneos5.1.sdk
Make
Make install
Copy the arm7lib directory
3) connect to the universal lib
We copied arm6lib arm7lib to a directory to go to this directory.
Lipo-create./arm6lib/lib/libcrypto. A./arm7lib/lib/libcrypto. A-output./libcrypto.
Lipo-create./arm6lib/lib/libssl. A./arm7lib/lib/libssl. A-output./libssl.
Inspection result
Lipo-Info libssl.
Result:
Ubuntures In the FAT file: libssl. A are: armv6 armv7
Success
4) Simulator Compilation
Similar to the above, it is a little different when you modify makefile.
Cc =/applications/xcode. APP/contents/developer/platforms/iphonesimulator. Platform/developer/usr/bin/GCC-arch i386
Cflag =-dopenssl_threads-pthread-d_thread_safe-d_reentrant-ddso_dlfcn-dhave_dlfcn_h-dtermios-O3-fomit-frame-pointer-wall-isysroot/applications/xcode. APP/contents/developer/platforms/iphonesimulator. platform/developer/sdks/iphonesimulator5.1.sdk