Windows下編譯linphone

本博文介紹了再MSYS&MINGW環境中編譯linphone(貌似當前版本是3.5.2),可參照解壓後README.mingw文件的說明進行編譯,下面把主要注意事項進行說明

1 下載最新版mingw

從官網http://www.mingw.org/下載最新版mingw-get-inst.exe,例如本人從官網(http://sourceforge.net/projects/mingw/files/MinGW/)下載到的是mingw-get-inst-20120426.exe,如圖:

以默認路徑安裝:C:\MinGW,安裝時正如README.mingw說描述,3個安裝選項必須選擇:

Download lastest mingw-get-inst.exe from http://www.mingw.org

Run mingw-get-inst.exe. Choose "download lastest catalogues".

In the feature list, select:

* C compiler

* C++ compiler

* Mingw developer toolkit

Let the installer fetch and install everything.

在mingw shell命令行執行如下安裝和操作:

mingw-get install msys-zip

mingw-get install msys-unzip

mingw-get install msys-wget

 

mkdir -p /opt/perl/bin

cp /bin/perl /opt/perl/bin/.

 

2 下載並安裝必要工具

在mingw命令行返回主目錄:

cd ~

下載intltool(在mingw命令行):

wget http://ftp.acc.umu.se/pub/GNOME/binaries/win32/intltool/0.40/intltool_0.40.4-1_win32.zip

下載linphone-deps(利用瀏覽器):

http://download.savannah.gnu.org/releases-noredirect/linphone/misc

下載最新版gtk+ win32 bundle from http://www.gtk.org

 

cd /

unzip ~/ intltool_0.40.4-1_win32.zip

unzip <path to gtk bundle zip>

unzip <path to linphone-deps>

解壓後mingw會自動把壓縮包中的文件釋放到C:\MinGW\msys\1.0相關目錄下

#Install GTK+ Outcrop theme, the one used by linphone for distribution.

cd /share/themes

wget http://art.gnome.org/download/themes/gtk2/1122/GTK2-Outcrop.tar.gz

tar -xvzf GTK2-Outcrop.tar.gz

 

#To get the translations working, remove from C:/MinGW/lib :

libintl.a libintl.la libintl.dll.a

(貌似和intltool相關庫衝突,需刪除以上三個庫文件,否則console.exe編譯不過)

 

3 下載並編譯最新版的linphone

It is recommended that you create a directory somewhere with a path without any spaces or ~ characters, for example

c:\sources\

Within msys-git bash, do

cd /c/sources

git clone git://git.linphone.org/linphone.git --recursive

 

之後進行編譯,不過以下內容沒有搞清楚,

#Compile and install tunnel

cd tunnel && ./autogen.sh && ./configure --prefix=/opt/linphone && make && make install

我是按照下面內容進行編譯的

./autogen.sh

./configure --prefix=/opt/linphone --enable-shared --disable-static

make

#will install to /opt/linphone, required for compilation of plugins.

make install

#make a binary zip of linphone

make zip

#additionally you can make binary installer if you have Inno Setup 5 installed in its default path

make setup.exe

#now you're done, you have a fresh linphone windows installer in the current directory.

我編譯成功後在windows下C:\MinGW\msys\1.0\opt\linphone\bin運行linphone.exe時,發現仍會提示少默寫庫文件,剩下的拷貝工具可能是需要自己做,我就沒有再進一步完善了!

以上是在mingw環境下的編譯,在VC環境下直接進行編譯比較困難,網上http://code.google.com/p/linphone-vs2008/有一個整理好的3.4.x版本的能直接再VC2008下進行編譯,新的3.5.x貌似還需要大牛進行整理!

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