当前位置:文档之家› linphone语音版移植

linphone语音版移植

Linphone在Linux X86下的编译(一)Linphone依赖库准备:libogg-1.1.3.tar.gz(/releases/ogg/libogg-1.1.3.tar.gz)speex-1.2beta3.tar.gz(依赖于libogg)libosip2-3.3.0.tar.gz(/gnu/osip/libosip2-3.3.0.tar.gz)libeXosip2-3.3.0.tar.gz(/Unix/NonGNU/exosip/libeXosip2-3.3.0.tar.gz)依赖库打包下载地址:/source/1743975readline(optional)intltool-0.35.0.tar.gz(optional)ffmpeg(提供Linphone视频支持,如不需视频功能可不要)Linphone版本:linphone-3.2.0.tar.gzO S: Fedora9(VmWare下)(二)在Linux的/home/cena/目录下新建目录linphone在其中建立sources、build、x86_target、arm_target ;注:这里cena为用户名,以下类同![root @BCD cena]# mkdir –p /home/cena/linphone/sources,/home/cena/linphone/build \/home/cena/linphone/x86_target, /home/cena/linphone/arm_target将相应的库与Linphone源码拷贝到sources目录下|soureces--| libogg-1.1.3.tar.gz--| libosip2-3.3.0.tar.gz--| libeXosip2-3.3.0.tar.gz--| speex-1.2beta3.tar.gz--| linphone-3.2.0.tar.gz将所有压缩文件解压准备编译;[root @BCD cena]# cd linphone/sources[root @BCD sources]# tar zxvf libogg-1.1.3.tar.gz[root @BCD sources]# tar zxvf libosip2-3.3.0.tar.gz[root @BCD sources]# tar zxvf libeXosip2-3.3.0.tar.gz[root @BCD sources]# tar zxvf speex-1.2beta3.tar.gz[root @BCD sources]# tar zxvf linphone-3.2.0.tar.gz进入libogg目录,配置编译libogg[root @BCD sources]# cd ../build/libogg[root @BCD libogg]#../../sources/libogg-1.1.3/configure --prefix=/home/cena/linphone/x86_target/[root @BCD libogg]# make[root @BCD libogg]# make install进入speex目录,配置编译speex[root @BCD libogg]# cd ../speex[root @BCD speex]# ../../sources/speex-1.2beta3/configure --prefix=/home/cena/linphone/x86_target/ --with-ogg=/home/cena/linphone/x86_target/ [root @BCD speex]# make[root @BCD speex]# make install进入libosip目录,配置编译libosip[root @BCD speex]# cd ../libosip[root @BCD libosip]# ../../sources/libosip2-3.3.0/configure --prefix=/home/cena/linphone/x86_target/[root @BCD libosip]# make[root @BCD libosip]# make install进入libeXosip目录,配置编译libeXosip[root @BCD libosip]# cd ../libeXosip[root @BCD libeXosip]# ../../sources/libeXosip2-3.3.0/configure --prefix=/home/cena/linphone/x86_target/PKG_CONFIG_PATH=/home/cena/linphone/x86_target/lib/pkgconfig[root @BCD libeXosip]# make ; make install注:这里如果上一步的libosip的安装不是默认的,那么在配置libeXosip时要附上PKG_CONFIG_PATH=安装目录\lib\pkgconfig进入linphone目录,配置编译linphone[root @BCD libeXosip]# cd .../linphone[root @BCD linphone]# ../../sources/linphone-3.2.0/configure --prefix=/home/cena/linphone/x86_target/ --disable-video --enable-gtk_ui=no --with-osip=/home/cena/linphone/x86_target/PKG_CONFIG_PATH=/home/cena/linphone/x86_target/lib/pkgconfig[root @BCD linphone]# make[root @BCD linphone]# make install注: --enable-gtk_ui=no 目的是去除gtk的ui,否则编译过程中会需要gtk+库。

--disable-video 目的是裁剪掉视频功能,否则编译过程会需要ffmeg库。

--with-osip 目的是指明编译过程所需要的osip库的位置。

P1:configure过程中可能会报intltool not found,这时只需要下载intltool-0.35.0.tar.gz安装即可,最好安装到/usr下P2:make过程中,会出现linphone-3.2.0/mediastreamer2/src/msconf.c:272 和274行的SPEEX_PREPROCESS_GET_PSD_SIZE和SPEEX_PREPROCESS_GET_PSD未定义的错误。

在x86_target/include/speex找到speex_preprocess.h文件在其中加入以上两个宏的定义。

#define SPEEX_PREPROCESS_GET_PSD_SIZE 34#define SPEEX_PREPROCESS_GET_PSD 35P3:make过程中,会出现config.h和coreapi中以及x86_target/include/osipparser2中的几个文件重定义的错误,经查对源代码可知道是config.h被引用了2次所致。

故将coreapi中的sipsetup.c和siplogin.c中的第21行#include <../config.h>注释掉即可再次编译,成功!!!安装后可在x86_target/bin下找到linphonecLinphone的交叉编译Cross- tools:arm-linux-gcc-3.4.1O S:Fedra9(VMware)进入libogg库编译[root @BCD cena]# cd linphone/build/libogg[root @BCD libogg]# ../../sources/libogg-1.1.3/configure --prefix=/home/cena/linphone/arm_target/ CC=arm-linux-gcc --host=arm-linux --enable-static --disable-shared[root @BCD libogg]# make[root @BCD libogg]# make install编译speex库[root @BCD libogg]# cd ../speex[root @BCD speex]# ../../sources/speex-1.2beta3/configure --prefix=/home/cena/linphone/arm_target/ CC=arm-linux-gcc --host=arm-linux --with-ogg=/home/cena/linphone/arm_target/ --enable-static --disable-shared[root @BCD speex]# make[root @BCD speex]# make install编译libosip库[root @BCD speex]# cd ../libosip[root @BCD libosip]# ../../sources/libosip2-3.3.0/configure --prefix=/home/cena/linphone/arm_target/ CC=arm-linux-gcc --host=arm-linux --enable-shared --disable-static[root @BCD libosip]# make[root @BCD libosip]# make install注:这里libosip库编译成动态库,否则编译linphone时会出错。

编译libeXosip库注:仍然编译为动态库,原因同上。

[root @BCD libosip]# cd ../libeXosip[root @BCD libeXosip]# ../../sources/libeXosip2-3.3.0/configure --prefix=/home/cena/linphone/arm_target/ CC=arm-linux-gcc --host=arm-linux --enable-shared --disable-static PKG_CONFIG_PATH=/home/cena/linphone/arm_target/lib/pkgconfig[root @BCD libeXosip]# make[root @BCD libeXosip]# make install编译linphone[root @BCD libeXosip]# cd ../linphone[root @BCD linphone]# ../../sources/linphone-3.2.0/configure --prefix=/home/cena/linphone/arm_target/ --host=arm-linux CC=arm-linux-gcc --enable-static --disable-shared --disable-nls --disable-manual --enable-gtk_ui=no --disable-glib --with-osip=/home/cena/linphone/arm_target/ --enable-alsa=no --enable-video=no --enable-strict=no --enable-artsc=no PKG_CONFIG_PATH=/home/cena/linphone/arm_target/lib/pkgconfig[root @BCD linphone]# make[root @BCD linphone]# make installP1:make过程中会报linphone-3.2.0/mediastreamer2/src/msticker.c:248: error: `CLOCK_MONOTONIC' undeclared (first use in this function)打开 msticker.c文件找到该位置。

相关主题