【快速開發VoIP】(使用Homebrew編譯iOS linPhone SDK)
阿新 • • 發佈:2019-02-02
目錄
前言
VoIP要使用到開源專案linphone,編譯linphone需要安裝依賴庫,官方使用的是Macports,但是這裡我們使用Homebrew來替代。如果未安裝過Homebrew的小夥伴們請檢視【快速開發VoIP】(Homebrew安裝)安裝依賴庫
[objc]- brew install coreutils automake autoconf libtool intltool wget pkgconfig cmake yasm nasm doxygen ImageMagick optipng libantlr3c gettext
在安裝Caveat的時候可能會有個警告:
- All commands have been installed with the prefix 'g'.
- If you really need to use these commands with their normal names, you
- can add a "gnubin" directory to your PATH from your bashrc like:
- PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
我們來照著說明改一下:
[objc]-
# temporarily add homebrews coreutils to the path
- $ export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
此外,我們想知道剛才安裝的gettext的版本,它預設是不連線的,或許當你安裝完成以後你想連線:
[objc]- # temporarily link gettext
- $ brew link gettext --force
安裝antlr4
注意:antlr一直在更新,根據自己安裝的版本號來修改 4. $ ln -s 路徑
[objc]- $ brew install antlr
-
# symlink into /usr/local/share/java/ so configure can find it
- $ mkdir -p /usr/local/share/java
- $ ln -s /usr/local/Cellar/antlr/4.7.1/antlr-4.7.1-complete.jar /usr/local/share/java/antlr4.jar
安裝gas-preprosessor.pl
[objc]- $ wget --no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl
- $sudo mv gas-preprocessor.pl /usr/local/bin/
- $ chmod +x /usr/local/bin/gas-preprocessor.pl
連結libtoolize到glibtoolize
[objc]- $ sudo ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
連結host strings到模擬器sdk
[objc]- $ sudo ln -s /usr/bin/strings /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings
連結/opt/local.bin to /usr/local/bin
[objc]- $ sudo ln - /opt/local/bin /usr/local/bin
編輯SDK
得到原始碼
[objc]- $ git clone git://git.linphone.org/linphone-iphone.git --recursive
下載原始碼的過程中可能會出現以下錯誤:
[objc]- could not create work tree dir'linphone-iphone':Permission denied
需要做以下修改:
[objc]- $ cd ~/
- $ mkdir code
-
$ cd code
-
git clone git://git.linphone.org/linphone-iphone.git --recursive
設定SDK版本
找出哪個版本的sdk是你可以使用的:
[objc]- $ ls /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk
對我來說,11.1是可以用的。然後編輯inphone-iphone/submodules/build/iphone-config.site進行設定:
[objc]- $ ls /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk
編輯
[objc]- $ cd linphone-iphone/submodules/build
-
# make all
---