编译iOS下支持arm64的.a库

因为项目中有用到libidn.a,苹果官方规定2015年2月之后提交的app都要支持arm64,所以要着手支持arm64了,项目中有用到的.a库要找对应的64位版本,有些网上找不到的就得自己编译了

下载源码libidn.tar

解压后创建一个目录

mkdir /var/tmp/build-armv7

./configure --prefix=/var/tmp/build-armv7 --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc CFLAGS="-arch arm64 -pipe -std=c99 -Wno-extended-offsetof -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=6.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk" AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar LDFLAGS="-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -miphoneos-version-min=6.0"

 make install

然后cd到/var/tmp/buid-armv7目录

cp libidn.a libidn-arm64.a

再将libidn-arm64.a拖到xcode中就可以用了。

posted @ 2014-11-12 09:16  我去ios  阅读(2761)  评论(0编辑  收藏  举报