1. 下載程式
http://www.pjsip.org/download.htm,本次測試使用的版本為 version 2.0.12. 設定環境變數
$ export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
$ export CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc CFLAGS="-O2 -m32 -miphoneos-version-min=6.0" LDFLAGS="-O2 -m32"
$ export ARCH="-arch i386"
執行 "./configure-iphone",完成時會出現下列log
Further customizations can be put in:因此我們需要修改 config_site.h 加入下列兩行
- 'user.mak'
- 'pjlib/include/pj/config_site.h'
#define PJ_CONFIG_IPHONE 1
#include <pj/config_site_sample.h>
4. 編譯 PJSIP library
$ make dep && make clean && make