Home > 移动互联, 语言编程 > MAC OS编译iOS版Linphone SDK和APP

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

Categories: 移动互联, 语言编程 Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.