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

原创 2014年01月23日 11:08:32

编译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 

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

编译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

Mac OS X10.10_xcode6.1_ios8.1环境下,编译lame静态库libmp3lame.a,支持arm64 armv7s x86_64 i386 armv7指令集

最近升级了系统到Mac OS X 10.10 并且更新了XCode6.1和iOS 8.1 之前app用到的libmp3lame.a静态库,也要支持64位的模拟器(x86_64)和64位的真机(arm6...
  • vieri_ch
  • vieri_ch
  • 2014年10月31日 11:18
  • 13675

iOS下解决libzbar.a不支持armv7s的方法

解决 libzbar.a' for architecture armv7 的问题 下载最新的zbar源码 http://sourceforge.net/p/zbar/code/ci/def...

iOS关于armv7,armv7s,arm64,i386,x86_64

iOS测试分为模拟器测试和真机测试,处理器分为32位处理器,和64位处理器, 模拟器32位处理器测试需要i386架构,(iphone5,iphone5s以下的模拟器) 模拟器64位处理器测...

IOS:armv7,armv7s,arm64,i386,x86

一、概要 平时项目开发中,可能使用第三方提供的静态库.a,如果.a提供方技术不成熟,使用的时候就会出现问题,例如: 在真机上编译报错:No architectures to compile for...

iOS 中的 armv7,armv7s,arm64,i386,x86_64 都是什么

前言 iOS 中的 armv7,armv7s,arm64,i386,x86_64 这些都代表什么?在Xcode中如何选择。 介绍 armv7|armv7s|arm64都是ARM处理器的指令集...

关于armv7,armv7s,arm64,i386,x86_64的理解

前言 iOS 中的 armv7,armv7s,arm64,i386,x86_64 这些都代表什么?在Xcode中如何选择。 介绍 armv7|armv7s|arm64都是ARM处理器的指令集i386...
  • BX_Jobs
  • BX_Jobs
  • 2016年07月12日 13:53
  • 1026
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:编译speex(i386、armv6、armv7、armv7s)方法
举报原因:
原因补充:

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