為什么打出的靜態庫要支持這么多架構?
看看這個文章: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