linphone的交叉编译(MIPS)

 

转载自:http://bbs.rosoo.net/thread-1096-1-1.html

 

最近的任务是移植linphone ,弄明白alsa的驱动。花了好长时间吧才把linphone交叉编译过,网上有一篇叫arm无界面linphone的交叉编译的文章,按照他的步骤,我是编译不过的,下面是我自己的编译步骤,注意,所有的库都编译成了动态库,要不然在编译或configure过程中可能会报错,我还没弄明白是什么原因,我分析,可能和mipsel的编译器有关吧

无界面版的linphone3.1.0交叉编译
linphone3.1.0所依赖的库如下
linphone-3.1.0依赖的库如下:
speex(又依赖libogg)
libosip2-3.3.0
libeXosip2-3.3.0
readline(可选)

1.分别下载以上程序源代码
2.在/home/data/donghatiao/下建立linphone目录
3.cd linphone 并mkdir src build target
3.把下载的源码包放在src目录下并分别解压
4.进入build目录
5.mkdir libogg
6. cd libogg 执行 ../../src/libogg-1.1.3/configure --disable-static --enalbe-shared --host=mipsel-linux --prefix=/home/data/donghaitao/linphone/target
make
make install
7. cd .. 
   mkdir speex
   cd speex
../../src/speex-1.2beta3/configure --disable-static --enalbe-shared --host=mipsel-linux --prefix=/home/data/donghaitao/linphone/target --with-ogg=/home/data/donghaitao/linphone/target
make
make install
7. cd ..
   mkdir libosip
   cd libosip
   ../../src/libosip2-3.3.0/configure --disable-static --enalbe-shared --host=mipsel-linux --prefix=/home/data/donghaitao/linphone/target
    make
    make install
8. cd ..
   mkdir libeXosip
   ../../src/libeXosip2-3.3.0/configure --host=mipsel-linux --with-openssl --disable-shared --enable-static --prefix=/home/data/donghaitao/linphone/target PKG_CONFIG_PATH=/home/data/donghaitao/linphone/target/lib/pkgconfig CFLAGS="-L/home/data/donghaitao/linphone/target/lib"

在configure过程中会提示有错误,即需要openssl的支持,下载openssl-0.9.8k.tar.tar包,放在src目录下,解压,执行CC=mipsel-linux-gcc ./config no-asm -shared --prefix=/opt/tuxbuilder-1.0/mipsel-unknown-linux-gnu/cross 交叉编译openssl,注意,此时-shared是必须的,如果编译为static库,在configure libeXosip时会报错

重新执行../../src/libeXosip2-3.3.0/configure --host=mipsel-linux --with-openssl --disable-shared --enable-static --prefix=/home/data/donghaitao/linphone/target PKG_CONFIG_PATH=/home/data/donghaitao/linphone/target/lib/pkgconfig CFLAGS="-L/home/data/donghaitao/linphone/target/lib"
make
make install

9 cd ..
mkdir linphone
cd linphone
../../src/linphone-3.1.0/configure --prefix=/home/data/donghaitao/yealink/target --host=mipsel-linux --disable-static --disable-glib --enable-gnome_ui=no --disable-manual --enable-ipv6 --enable-alsa --enable-gtk_ui=no --enable-video=no --enable-strict=no --enable-artsc=no CFLAGS="-I/home/data/donghaitao/linphone/target/include -L/home/data/donghaitao/linphone/target/lib" PKG_CONFIG_PATH=/home/data/donghaitao/linphone/target/lib/pkgconfig

其中 如果不加入--enable-gtk_ui=no --enable-video=no 在configure的时候会报有关gtk++ 和ffmeg的错误 这两个需要gtk++和ffmeg库的支持 如果不加入PKG_CONFIG_PATH=/home/data/donghaitao/linphone/target/lib/pkgconfig,在configure的时候会找不到speex的库 ,不加入 CFLAGS="-I/home/data/donghaitao/linphone/target/include -L/home/data/donghaitao/linphone/target/lib" ,在configure的时候会找不到libosip和libeXosip的库

make

make install

注意,在编译的过程中可能会出现could not read symbols: File in wrong format
的错误,google一把,会有解释如下:
This problem is due to compiling distHash.o on a different architecture
machine. For instance, Sun workstations compile into SPARC machine code while
our LINUX workstations compile into Intel x86 code. If you compile part of a
project on one type of architecture and then try to compile the rest of the
project on another type of architecture, when you go to make the final
executable the linker/loader will NOT be able to read one of the parts of the
project .o files to create an executable, thus the 
"could not read symbols: File in wrong format" error message.

If you change machine architectures, or even operating system versions, while
doing a project it is reasonable to clean/remove all the existing .o files
and re-create the whole project on the current machine you are sitting at.


按照提示,删除编译过程中生成的.o文件,重新编译即可,但是比较麻烦,,相关的文件夹全部删除,然后重新解压,重新configure就OK了

你可能感兴趣的:(linphone的交叉编译(MIPS))