Ubuntu14.04下linphone-android編譯

[size=medium][color=darkred][b]聲明:本文爲原創文章,未經許可不得轉載、發表[/b][/color][/size]

成功編譯Linphone-android,留下編譯記錄以作參考
操作系統:
Ubuntu 14.04
編譯環境:
JDK 1.7.0_71
android-sdk-linux
android-ndk-r9d
adt-bundle-linux-x86-20140702
android-api 19
api必須裝全,否則在交叉編譯時會找不到系統頭文件!

配置環境變量:
export JAVA_HOME=/.../jdk1.7.0_71
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=${JAVA_HOME}/lib:${JRE_HOME}/lib:.
export PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin:$PATH
export PATH=/.../android-sdk-linux/platform-tools:$PATH
export PATH=/.../android-sdk-linux/tools:$PATH
export PATH=/.../android-ndk-r9d:$PATH
export NDK_PATH=/.../android-ndk-r9d
export ADT_PATH=/.../adt-bundle-linux-x86-20140702
export PATH=${ADT_PATH}:$PATH
export PATH=${ADT_PATH}/sdk:$PATH
export PATH=${ADT_PATH}/sdk/tools:$PATH
export PATH=${ADT_PATH}/sdk/platform-tools:$PATH
其中“...”根據實際環境進行配置

源代碼版本: Linphone-android 2014-11月份最新源碼
下載源碼時須找個網絡穩定的環境,否則很容易下載不全,源碼下載路徑:
git clone git://git.linphone.org/linphone-android.git --recursive
下完後的源碼大小:671,759,354字節。

查看Linphone-android的README,按照說明安裝以下工具:
install yasm, nasm, curl, ant, rsync and the autotools: autoconf, automake, aclocal, libtoolize, pkgconfig
其中libtoolize的安裝名稱爲libtools
pkgconfig的安裝包名爲pkg-config

由於我是最新版的Ubuntu系統,根據說明還安裝了以下包
With the latest Debian (multiarch), you need this:
dpkg --add-architecture i386
aptitude update
aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386

由於本地網絡不穩定,因此我的源碼在Windows Server 2008服務器上下載,在Ubuntu中解壓後須將所有的.sh、configure、.pl修改爲可執行
由於我的源碼在Windows環境下下載,因此需將所有的dos換行符換成unix換行符,轉換命令:
find -type f | xargs dos2unix -o
如果提示命令沒有安裝,使用sudo apt-install命令按提示安裝即可

我所下載的源碼在安裝過程中需要下載rfc3951.txt和extract-cfile.awk兩個文件,由於這兩個文件的路徑已經變更會導致make過程出錯,可以提前下載這兩個文件放到對應的目錄中。
下載地址:
rfc3951.txt http://www.ietf.org/rfc/rfc3951.txt
extract-cfile.awk http://www.ilbcfreeware.org/documentation/extract-cfile.txt
extract-cfile.txt下載後需更名爲extract-cfile.awk

文件下載後存放到linphone-android\submodules\libilbc-rfc3951\downloads下替換原有文件,同時需修改對應的.md5文件,否則make過程校驗和會出錯

至此,準備工作已經完成,見證奇蹟的時刻就要到來
make

如果你的網絡夠好,硬件配置夠好,在一段不算漫長的等待後將會出現以下提示:
BUILD SUCCESSFUL
Total time: 52 seconds
***************************************************************************
***** CAUTION, this liblinphone SDK is built using 3rd party GPL code *****
***** Even if you acquired a proprietary license from Belledonne *****
***** Communications, this SDK is GPL and GPL only. *****
***** To disable 3rd party gpl code, please use: *****
***** $ make ENABLE_GPL_THIRD_PARTIES=0 *****
***************************************************************************

恭喜,編譯成功。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章