分享

Linphone-3.2.0的X86编译与ARM移植

 鸟人(天使) 2010-09-15
  Linphone-3.2.0的X86编译与ARM移植 收藏
Linphone在Linux X86下的编译
 
(一)
 
Linphone依赖库准备:
 
       speex-1.2beta3.tar.gz(依赖于libogg)
       libosip2-3.3.0.tar.gz(http://ftp./gnu/osip/libosip2-3.3.0.tar.gz
       libeXosip2-3.3.0.tar.gz(http://ftp./Unix/NonGNU/exosip/libeXosip2-3.3.0.tar.gz
       依赖库打包下载地址:http://download.csdn.net/source/1743975
       readline(optional)
       intltool-0.35.0.tar.gz(optional)
       ffmpeg(提供Linphone视频支持,如不需视频功能可不要)
 
Linphone版本:
      
       linphone-3.2.0.tar.gz
 
O 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                35
 
P3:make过程中,会出现config.h和coreapi中以及x86_target/include/osipparser2中的几个文件重定义的错误,经查对源代码可知道是config.h被引用了2次所致。故将coreapi中的sipsetup.c和siplogin.c中的第21行#include <../config.h>注释掉即可
 
再次编译,成功!!!安装后可在x86_target/bin下找到linphonec
 
Linphone的交叉编译
Cross-tools:arm-linux-gcc-3.4.1
 
O 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 install
 
 
 
P1:
make过程中会报
linphone-3.2.0/mediastreamer2/src/msticker.c:248: error: `CLOCK_MONOTONIC' undeclared (first use in this function)
打开msticker.c文件找到该位置。无法确定是来自哪个头文件,无奈下将该else语段注释掉。
 
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                35
 
 
再次编译,成功!!!安装后可在arm_target/bin下找到linphonec
 
注:这里alsa被禁止了,alsa是声音的编码库,只有移植了alsa到arm上linphone才能进行语音通话,现阶段只能进行sip协议的互通测试。
 
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/jj425161693/archive/2009/10/15/4674988.aspx

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多