文章依據linphone-iphone源碼中的readme,以及在實際的操作記錄的筆記整理。
1、安裝Xcode和Command Line
建議在AppStore中安裝Xcode,或者去蘋果開發者網站下載Xcode獨立的安裝包
(https://developer.apple.com/xcode/index.php),注意自己的Mac OS系統版本。
安裝完畢Xcode後,在Xcode-Preference-Downloads中找到Command Line Tools,
如果沒有安裝點擊後面的“install”按鈕。
2、安裝MacPorts
https://distfiles.macports.org/MacPorts/
1.1、注意自己Mac OS的系統版本,使用的MacPorts要適用宿主Mac OS的系統版本
1.2、下載安裝完畢之後,檢查環境變量:
:$PATH
查看是否符合要求,readme中標註:“Make sure that /opt/local/bin (macport tools)
arrives first in your PATH env variable”沒有被自動添加的話,手動編輯環境變量:
:vim ~/.profile
在最前面添加“/opt/local/bin:/opt/local/sbin:”
3、安裝Required build-time tools:
:sudo port install coreutils automake autoconf libtool intltool
wget pkgconfig cmake gmake yasm grep doxygen ImageMagick optipng
4、安裝gas-preprosessor.pl(http://github.com/yuvi/gas-preprocessor/ ) 並複製到
目錄 /opt/local/bin (執行下列操作即可):
:wget --no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl:sudo mv gas-preprocessor.pl /opt/local/bin/
:sudo chmod +x /opt/local/bin/gas-preprocessor.pl
5、Link macport libtoolize to glibtoolize
:sudo ln -s /opt/local/bin/glibtoolize /opt/local/bin/libtoolize
6、Link host's strings to simulator SDK
6.1、Xcode版本小於等於4.3的話
: sudo ln -s /usr/bin/strings /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings
6.2、Xcode版本大於4.3
:sudo ln -s /usr/bin/strings /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings
7、編譯Linphone SDK
:cd submodules/build
:make all