编译speex(i386、armv6、armv7、armv7s)方法

转载 2013年12月04日 11:22:53

编译speex(i386、armv6、armv7、armv7s)方法


本文借鉴:http://www.cocoachina.com/bbs/read.php?tid=114755&keyword=speex

桌面上建立speexLibrary文件夹,将下载的libogg-1.3.0speex-1.2rc1放入;

一、编译ogg:

1.ogg-i386的库

通过如下命令进入/Users/wangping/Desktop/speexLibrary/libogg-1.3.0目录,因为configure在此目录下:

1)cd Desktop/

2)ls

3)cd speexLibrary/

4)ls

5)cd libogg-1.3.0/

直接用:cd Desktop/speexLibrary/libogg-1.3.0/

编译ogg-i386库:

6./configure -prefix=/Users/wangping/Desktop/speexLibrary/libogg-1.3.0/i386 -host=i386-apple-darwin -build=x86_64-apple-darwin11.3.0 CC="/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -std=c99 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/"

7make  (如提示make命令无效,则xcode -> preferences ->downloads -> command line tools安装)

make install

make clean (一定要clean,不然后面编译的都是第一次的编译的内容)


2ogg-armv6的库 --不使用(无必要)

xcode4.6默认不能编译armv6(可以编译方法:http://blog.csdn.net/lmxxf/article/details/8770286)

./configure -prefix=/Users/wangping/Desktop/speexLibrary/libogg-1.3.0/armv6 -host=armv6-apple-darwin -build=x86_64-apple-darwin11.3.0 CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -std=c99 -arch armv6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/"


make

make install

make clean 


3ogg-armv7的库

./configure -prefix=/Users/wangping/Desktop/speexLibrary/libogg-1.3.0/armv7 -host=armv7-apple-darwin -build=x86_64-apple-darwin11.3.0 CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -std=c99 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/"


4、ogg-armv7s的库


4./configure -prefix=/Users/wangping/Desktop/speexLibrary/libogg-1.3.0/armv7s -host=armv7s-apple-darwin -build=x86_64-apple-darwin11.3.0 CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -std=c99 -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/"


make

make install

make clean


二、接着编译speex库:

关掉终端,重新打开

首先进入文件夹:cd Desktop/speexLibrary/speex-1.2rc1/

1.speex-i386的库

./configure -prefix=/Users/wangping/Desktop/speexLibrary/speex-1.2rc1/i386 -host=i386-apple-darwin -disable-shared -enable-static -disable-oggtest -disable-fixed-point -enable-float-api -build=x86_64-apple-darwin11.3.0 -with-ogg=/Users/wangping/Desktop/speexLibrary/libogg-1.3.0/i386 CC="/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -std=c99 -arch i386 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/"


make

make install

make clean 


2.speex-armv6的库 --不使用(无必要)

./configure -prefix=/Users/wangping/Desktop/speexLibrary/speex-1.2rc1/armv6 -host=armv6-apple-darwin -disable-shared -enable-static -disable-oggtest -enable-fixed-point -disable-float-api -build=x86_64-apple-darwin11.3.0 -with-ogg=/Users/wangping/Desktop/speexLibrary/libogg-1.3.0/armv6 CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -std=c99 -arch armv6 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/"


make

make install

make clean


3.speex-armv7的库

./configure -prefix=/Users/wangping/Desktop/speexLibrary/speex-1.2rc1/armv7 -host=armv7-apple-darwin -disable-shared -enable-static -disable-oggtest -enable-fixed-point -disable-float-api -build=x86_64-apple-darwin11.3.0 -with-ogg=/Users/wangping/Desktop/speexLibrary/libogg-1.3.0/armv7 CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -std=c99 -arch armv7 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/"


4speex-armv7s的库

./configure -prefix=/Users/wangping/Desktop/speexLibrary/speex-1.2rc1/armv7s -host=armv7s-apple-darwin -disable-shared -enable-static -disable-oggtest -enable-fixed-point -disable-float-api -build=x86_64-apple-darwin11.3.0 -with-ogg=/Users/wangping/Desktop/speexLibrary/libogg-1.3.0/armv7s CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -std=c99 -arch armv7s -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/"


make

make install

make clean 


最后合并静态库,进入相应文件夹:,终端键入:

1)合并libogg

libogg-1.3.0下建立OutPut_A文件夹:

cd Desktop/speexLibrary/libogg-1.3.0/

不带arm6:

lipo -create i386/lib/libogg.a armv7/lib/libogg.a armv7s/lib/libogg.a -output libogg.a


2)合并speex的2个库

speex-1.2rc1下建立OutPut_A文件夹:

cd Desktop/speexLibrary/speex-1.2rc1/

不带arm6:

lipo -create i386/lib/libspeex.a armv7/lib/libspeex.a armv7s/lib/libspeex.a -output OutPut_A/libspeex.a

lipo -create i386/lib/libspeexdsp.a armv7/lib/libspeexdsp.a armv7s/lib/libspeexdsp.a -output OutPut_A/libspeexdsp.a 



好了,这里应该已经编译完成了。如果合并静态库不成功,那么请检查上述步骤(我当时就是忘了make clean,导致编译的都是i386.a文件).你可以lipo -info xxx.a文件,后面会显示库内文件使用的平台信息,正常显示为i386,armv6,armv7那么就成功了。当然打包好的库我也一并上传了,方便大家下载。

cd Desktop/speexLibrary/libogg-1.3.0/OutPut_A


查看编译好的.a的架构:

都拷贝到桌面上来,然后

cd Desktop

lipo -info libogg.a

lipo -info libspeex.a

lipo -info libspeexdsp.a

为:i386 armv7 (cputype (12) cpusubtype (11)) 

另:在本身的文件夹里看:

bogon:speex-1.2rc1 wangping$ cd OutPut_A

bogon:OutPut_A wangping$ lipo -info libspeex.a

Architectures in the fat file: libspeex.a are: i386 armv6 armv7 

bogon:OutPut_A wangping$ lipo -info libspeexdsp.a

Architectures in the fat file: libspeexdsp.a are: i386 armv6 armv7 

相关文章推荐

iOS编译Speex

1、参考链接:http://stackoverflow.com/questions/14876504/compile-speex-on-xcode-for-ios;https://github.com...

xcode 5.1 下静态编译 libogg +speex

libogg +speex

Makefile万能写法(gcc程序以及arm-linux-gcc程序)

转自:http://7071976.blog.51cto.com/7061976/1322211 在linux下使用gcc 编译时,Makefile的万能写法 ,每次只需更改要生成的目标文件...
  • hjwang1
  • hjwang1
  • 2013年12月07日 14:11
  • 1641

GCC的arm编译选项

原文链接:https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html Next: AVR Options, Previous: A...

ios中将pcm转为wav

struct tagHXD_WAVFLIEHEAD { char RIFFNAME[4]; DWORD nRIFFLength; char WAVNAME[4]; ch...
  • zttjhm
  • zttjhm
  • 2014年12月18日 08:57
  • 3646

speex 笔记(二)

单纯从目录结构出发: 最关键的三个目录:doc,libspeex,src doc自不必说 libspeex存放了libspeex,libspeexdsp的源码,以及一些测试源码: testde...

编译speex(i386、armv6、armv7、armv7s)方法

编译speex(i386、armv6、armv7、armv7s)方法 本文借鉴:http://www.cocoachina.com/bbs/read.php?tid=114755&k...

【Cocos2d-X(1.x 2.x) 】iOS6与iphone5适相关设置随笔(解决第三方类库无法通过armv7s编译的方法、添加Default-568h@2x.png)

本站文章均为 李华明Himi 原创,转载务必在明显处注明:转载自【黑米GameDev街区】 原文链接: http://www.himigame.com/iphone-cocos2dx/1020.htm...

iOS 制作自己的FrameWork遇到的一些问题 以及FrameWork通过包合并支持arm64 armv7 i386 架构

FrameWork通过包合并支持arm64 armv7 i386 架构

Undefined symbols for architecture i386或者armv7: “_OBJC_CLASS_$_XXX

Undefined symbols for architecture i386: “_OBJC_CLASS_$_XXX”, referenced from: objc-class-re...
  • woshiwls
  • woshiwls
  • 2014年02月19日 11:57
  • 11306
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:编译speex(i386、armv6、armv7、armv7s)方法
举报原因:
原因补充:

(最多只允许输入30个字)