I'm trying to build OpenSSL for iOS Simulator with the following steps: (MackBook Pro, OS X Version 10.10.5v + Xcode Version 7.2)
$ mkdir openssl
$ cd openssl
$ wget http://www.openssl.org/source/openssl-1.0.2e.tar.gz
$ tar xvzf openssl-1.0.2e.tar.gz
$ cd openssl-1.0.2e
$ mkdir /tmp/openssl-1.0.2e-i386
$ ./configure BSD-generic32 --openssldir=/tmp/openssl-1.0.2e-i386
$ vi Makefile
Make the following changes:
1) Replace
"CC= gcc"
with
"CC= /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch i386"
2) Append
"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
to the end of
"CFLAG= ..."
$ make
However, the following error occurs:
ld: building for OSX, but linking against dylib built for iOS, file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libSystem.dylib' for architecture i386
Can someone tell me what is wrong?