https://github.com/x2on/OpenSSL-for-iPhone
./configure --disable-automatic-init-and-cleanup CC="/Applications/Xcode7.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" LDFLAGS="-L/Users/XXX/OpenSSL-for-iPhone/lib" CPPFLAGS="-I/Users/XXX/OpenSSL-for-iPhone/include" CFLAGS="-isysroot /Applications/Xcode7.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -arch arm64" --enable-static --with-zlib=bundled --with-libbson=bundled --host=armv7-apple-darwin --enable-ssl=openssl
LDFLAGS
指定openssl库的路径CPPFLAGS
指定openssl头文件的路径CC
指定clang的位置CFLAGS
指定iOS的编译器参数
- 将
libmongoc.a
、libbson.a
和他们的头文件加入到工程,数量很多,建议在PC系统中make install以后拷贝头文件。 - 需要替换bson的头文件引用尖括号为引号,数量很多,建议用替换的方式一次性决解。