banner
李大仁博客

李大仁博客

天地虽大,但有一念向善,心存良知,虽凡夫俗子,皆可为圣贤。

MAC OS編譯iOS版Linphone SDK和APP

最近由於開發一款基於 SIP 通信的 VOIP 應用程序項目需要,自己研究了一下幾款開源 SIP 實現,主要有 PJSIP 和 Linphone,PJSIP 由於文檔說明詳細,編譯和測試都沒有費多大事情。Linphone 的編譯就比較費神費力了,開始之前查看互聯網上的資料,大家都說各種痛苦折磨,後來自己實踐了一把,除了文檔說明奇缺之外,編譯還算順利,除了調查耗費了不少時間。

簡單說明一下 PJSIP 和 Linphone PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE. It combines signaling protocol (SIP) with rich multimedia framework and NAT traversal functionality into high level API that is portable and suitable for almost any type of systems ranging from desktops, embedded systems, to mobile handsets.

Linphone is an open source SIP Phone, available on mobile and desktop environments (iOS, Android, Windows Phone 8, Linux, Windows Desktop, MAC OSX) and on web browsers. Linphone has inside a separation between the user interfaces and the core engine, allowing to create various kinds of user interface on top of the same functionalities.

編譯環境 MAC OS 10.10.5 Xcode 6.4

以下是編譯的方法步驟,500M 的源代碼官方只提供一段 README.MD 來說明。

1. 安裝 Xcode 和 command line tools,去 AppStore 下載即可,已安裝過的跳過 2. 安裝 HomeBrew,去http://brew.sh,按提示安裝最新版本的 HomeBrew 即可,或者聯網打開終端使用以下命令安裝。

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

3.Xcode 和 Homebrew 安裝無誤後可以使用以下命令進行準備工作,首先下載 linphone 的源代碼,折騰即將開始。

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

這裡準備好網絡,大約 500M 左右的文件,建議使用 VPN 下載。

4. 編譯源代碼需要安裝必要的依賴包和 lib,運行以下命令,按要求安裝即可。

./prepare.py

5. 準備工作完成後使用以下命令編譯 linphone 的 SDK。

./prepare.py -c && ./prepare.py && make

6.SDK 編譯完成後可以打開 linphone.xcodeproj,後面按正常的 ios 應用程序進行編譯即可。

編譯過程中問題與解決 1. 無法安裝和卸載 homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Failed to locate Homebrew!

原因可能是這台電腦上的其他用戶安裝過 homebrew,解決辦法是運行以下命令重新安裝

#清理 git 緩存
rm -rf /usr/local/.git
#彻底清理 Cellar,尽量不要使用
#rm -rf /usr/local/Cellar

2. 提示找不到 libtoolize,要求安裝 libtool, 原因是 MAC OS 上 libtool 和 libtoolize 這兩位改成了 glibtoolize 和 glibtool。連接一下即可

sudo ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize

參考資料 http://blog.csdn.net/showhilllee/article/details/42966305

載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。