为什么打出的静态库要支持这么多架构?
看看这个文章:http://blog.csdn.net/zuoyou1314/article/details/46638073
里面有详细的说明,打出所有库命令如下,因为很容易错,所以我就全部记录下来,以供提醒
这里有参考一位大神写的文章,不过他那个写的比较早没有arm64架构的,我在这里补充一下
大神文章地址:http://blog.csdn.net/ysysbaobei/article/details/8838900
1. Ogg-i386的库(模拟器)
./configure -prefix=/Users/lenkeng/Documents/speex/libogg-1.3.3/i386 -host=i386-apple-darwin -build=x86_64-apple-darwin16.7.0 CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -std=c99 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/"
make
make install
make clean(一定要clean,不然后面编译的都是第一次的编译的内容)
2.ogg-armv6库(无用)
3. Ogg-armv7库
./configure -prefix=/Users/lenkeng/Documents/speex/libogg-1.3.3/armv7 -host=armv7-apple-darwin -build=x86_64-apple-darwin16.7.0 CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -std=c99 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk"
make
make install
make clean
4. Ogg-armv7s库
./configure -prefix=/Users/lenkeng/Documents/speex/libogg-1.3.3/armv7s -host=armv7s-apple-darwin -build=x86_64-apple-darwin16.7.0 CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -std=c99 -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk"
make
make install
make clean
6. Ogg-arm64库(所有的库必须支持64位系统)
./configure -prefix=/Users/lenkeng/Documents/speex/libogg-1.3.3/arm64 -host=arm-apple-darwin -build=x86_64-apple-darwin16.7.0 CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -std=c99 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk"
make
make install
make clean
7.speex-i386库(模拟器)
./configure -prefix=/Users/lenkeng/Documents/speex/speex-1.2rc1/i386 -host=i386-apple-darwin -disable-shared -enable-static -disable-oggtest -disable-fixed-point -enable-float-api -build=x86_64-apple-darwin16.7.0 -with-ogg=/Users/lenkeng/Document/speex/libogg-1.3.3/i386 CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -std=c99 -arch i386 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/"
make
make install
make clean
8.speex-armv6(无用)
9. Speex-armv7库
./configure -prefix=/Users/lenkeng/Documents/speex/speex-1.2rc1/armv7 -host=armv7-apple-darwin -disable-shared -enable-static -disable-oggtest -disable-fixed-point -enable-float-api -build=x86_64-apple-darwin16.7.0 -with-ogg=/Users/lenkeng/Document/speex/libogg-1.3.3/armv7 CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -std=c99 -arch armv7 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk"
make
make install
make clean
10. Speex-armv7s库
./configure -prefix=/Users/lenkeng/Documents/speex/speex-1.2rc1/armv7s -host=armv7s-apple-darwin -disable-shared -enable-static -disable-oggtest -disable-fixed-point -enable-float-api -build=x86_64-apple-darwin16.7.0 -with-ogg=/Users/lenkeng/Document/speex/libogg-1.3.3/armv7s CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -std=c99 -arch armv7s -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk"
make
make install
make clean
11. Speex-arm64库(ios后期必须要64位)
./configure -prefix=/Users/lenkeng/Documents/speex/speex-1.2rc1/arm64 -host=arm-apple-darwin -disable-shared -enable-static -disable-oggtest -disable-fixed-point -enable-float-api -build=x86_64-apple-darwin16.7.0 -with-ogg=/Users/lenkeng/Document/speex/libogg-1.3.3/arm64 CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -std=c99 -arch arm64 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk"
make
make install
make clean
11.合并libogg
cd 到 libogg-1.3.3 文件夹下建立OutPut_A(mkdir)文件夹
lipo -create i386/lib/libogg.a armv7/lib/libogg.a armv7s/lib/libogg.a arm64/lib/libogg.a -output OutPut_A/libogg.a
12.合并speex的两个库
在speex-1.2rc1建立OutPut_A(mkdir)文件夹:
cd Desktop/speexLibrary/speex-1.2rc1/
不带arm6:
lipo -create i386/lib/libspeex.a armv7/lib/libspeex.a armv7s/lib/libspeex.a arm64/lib/libspeex.a -output OutPut_A/libspeex.a
lipo -create i386/lib/libspeexdsp.a armv7/lib/libspeexdsp.a armv7s/lib/libspeexdsp.a arm64/lib/libspeexdsp.a -output OutPut_A/libspeexdsp.a
通过lipo -info命令可以查看.a文件支持的架构
lipo -info libogg.a
lipo -info libspeex.a
lipo -info libspeexdsp.a
Architectures in the fat file: libogg.a are: i386 armv7 armv7s arm64