转载自:http://blog.csdn.net/suer0101/article/details/7428221
在UBUNTU下
./configure --prefix=/usr --enable-macsnd=no --enable-video=no --enable-tests
去掉了苹果系统的声卡支持,去掉了视频支持,增加了测试程序
移植到开发板上
./configure --prefix=/phone --host=arm-linux --with-gnu-ld --disable-static --enable-macsnd=no --enable-video=no --enable-tests --disable-gsm
error: cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation
怎么办?尝试了下其它版本的mediastreaer2,包括2.0和2.5的,都是会出现同样的错误!换个UBUNTU编译说是找不到SPEEX,可我是把交叉编译好的文件就放到指定的文件夹里啊!
第二天:
在INSTALL里看到这么一段话:
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
总结
其实整个编译过程并不难,之所以走了这么多弯路应该是在不同环境编译时会产生影响!以后就得注意点了!总结下整个步骤吧!
1)编译OGG库
./configure --prefix=/phone --host=arm-linux --with-gnu-ld --disable-static
2)编译SPEEX
./configure --prefix=/phone --host=arm-linux --with-gnu-ld --disable-static --enable-fixed-point --disable-float-api --with-ogg=/phone
3)编译ORTP库
./configure --prefix=/phone --host=arm-linux --with-gnu-ld --disable-static
4)轮到主角了MEDIASTREAMER2
./configure --prefix=/phone --host=arm-linux --with-gnu-ld --disable-static --enable-macsnd=no --enable-video=no --enable-tests --disable-gsm PKG_CONFIG_PATH=/phone/lib/pkgconfig
PS:
刚才突然又想明白了一个问题,即最开始出现的那个错误,其实加上参数
- PKG_CONFIG_PATH=/phone/lib/pkgconfig
就可以解决问题!看来问题是出现在配置参数上的!虽然折腾了很长时间但问题还是解决了!