@khan-lau
2015-07-22T14:16:02.000000Z
字数 6189
阅读 2630
pjsip iOS
下载源码
if wget
not exists, run brew install wget
wget http://www.pjsip.org/release/2.4/pjproject-2.4.zip
unzip pjproject-2.4.zip
if dos2unix
not exists, run brew install dos2unix
准备编译环境
cd pjproject-2.4
chmod +x aconfigure
chmod +x configure-iphone
dos2unix configure-iphone
echo '#define PJ_CONFIG_IPHONE 1' > ./pjlib/include/pj/config_site.h
echo '#include <pj/config_site_sample.h>' >> ./pjlib/include/pj/config_site.h
echo $'\n' >> ./pjlib/include/pj/config_site.h
vim configure-iphone
insert code
if [ "$ARCH" = "-arch x86_64" ]; then
DEVPATH="/Applications/XCode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer"
echo "$F: Simulator 64bit, using ${DEVPATH}"
fi
if [ "$ARCH" = "-arch i386" ]; then
DEVPATH="/Applications/XCode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer"
echo "$F: Simulator 32bit, using ${DEVPATH}"
fi
in line 25
mkdir sip
sudo ARCH='-arch armv7' ./configure-iphone --prefix=/Users/Khan/Downloads/pjproject-2.4/sip/armv7
make dep && make clean && make
make install
sudo ARCH='-arch armv7s' ./configure-iphone --prefix=/Users/Khan/Downloads/pjproject-2.4/sip/armv7s
make dep && make clean && make
make install
sudo ARCH='-arch arm64' ./configure-iphone --prefix=/Users/Khan/Downloads/pjproject-2.4/sip/arm64
make dep && make clean && make
make install
sudo ARCH="-arch i386" CFLAGS="-O2 -m64 -mios-simulator-version-min=6.0" LDFLAGS="-O2 -m64 -mios-simulator-version-min=6.0" ./configure-iphone --prefix=/Users/Khan/Downloads/pjproject-2.4/sip/x86
make dep && make clean && make
make install
sudo ARCH="-arch x86_64" CFLAGS="-O2 -m64 -mios-simulator-version-min=6.0" LDFLAGS="-O2 -m64 -mios-simulator-version-min=6.0" ./configure-iphone --prefix=/Users/Khan/Downloads/pjproject-2.4/sip/x64
make dep && make clean && make
make install
mkdir sip/all
mkdir sip/all/lib
cd pjproject-2.4/sip
lipo -create arm64/lib/libg7221codec-arm-apple-darwin9.a armv7/lib/libg7221codec-arm-apple-darwin9.a armv7s/lib/libg7221codec-arm-apple-darwin9.a x64/lib/libg7221codec-arm-apple-darwin9.a x86/lib/libg7221codec-arm-apple-darwin9.a -output all/lib/libg7221codec.a
lipo -create arm64/lib/libgsmcodec-arm-apple-darwin9.a armv7/lib/libgsmcodec-arm-apple-darwin9.a armv7s/lib/libgsmcodec-arm-apple-darwin9.a x64/lib/libgsmcodec-arm-apple-darwin9.a x86/lib/libgsmcodec-arm-apple-darwin9.a -output all/lib/libgsmcodec.a
lipo -create arm64/lib/libilbccodec-arm-apple-darwin9.a armv7/lib/libilbccodec-arm-apple-darwin9.a armv7s/lib/libilbccodec-arm-apple-darwin9.a x64/lib/libilbccodec-arm-apple-darwin9.a x86/lib/libilbccodec-arm-apple-darwin9.a -output all/lib/libilbccodec.a
lipo -create arm64/lib/libpj-arm-apple-darwin9.a armv7/lib/libpj-arm-apple-darwin9.a armv7s/lib/libpj-arm-apple-darwin9.a x64/lib/libpj-arm-apple-darwin9.a x86/lib/libpj-arm-apple-darwin9.a -output all/lib/libpj.a
lipo -create arm64/lib/libpjlib-util-arm-apple-darwin9.a armv7/lib/libpjlib-util-arm-apple-darwin9.a armv7s/lib/libpjlib-util-arm-apple-darwin9.a x64/lib/libpjlib-util-arm-apple-darwin9.a x86/lib/libpjlib-util-arm-apple-darwin9.a -output all/lib/libpjlib-util.a
lipo -create arm64/lib/libpjmedia-arm-apple-darwin9.a armv7/lib/libpjmedia-arm-apple-darwin9.a armv7s/lib/libpjmedia-arm-apple-darwin9.a x64/lib/libpjmedia-arm-apple-darwin9.a x86/lib/libpjmedia-arm-apple-darwin9.a -output all/lib/libpjmedia.a
lipo -create arm64/lib/libpjmedia-audiodev-arm-apple-darwin9.a armv7/lib/libpjmedia-audiodev-arm-apple-darwin9.a armv7s/lib/libpjmedia-audiodev-arm-apple-darwin9.a x64/lib/libpjmedia-audiodev-arm-apple-darwin9.a x86/lib/libpjmedia-audiodev-arm-apple-darwin9.a -output all/lib/libpjmedia-audiodev.a
lipo -create arm64/lib/libpjmedia-codec-arm-apple-darwin9.a armv7/lib/libpjmedia-codec-arm-apple-darwin9.a armv7s/lib/libpjmedia-codec-arm-apple-darwin9.a x64/lib/libpjmedia-codec-arm-apple-darwin9.a x86/lib/libpjmedia-codec-arm-apple-darwin9.a -output all/lib/libpjmedia-codec.a
lipo -create arm64/lib/libpjmedia-videodev-arm-apple-darwin9.a armv7/lib/libpjmedia-videodev-arm-apple-darwin9.a armv7s/lib/libpjmedia-videodev-arm-apple-darwin9.a x64/lib/libpjmedia-videodev-arm-apple-darwin9.a x86/lib/libpjmedia-videodev-arm-apple-darwin9.a -output all/lib/libpjmedia-videodev.a
lipo -create arm64/lib/libpjnath-arm-apple-darwin9.a armv7/lib/libpjnath-arm-apple-darwin9.a armv7s/lib/libpjnath-arm-apple-darwin9.a x64/lib/libpjnath-arm-apple-darwin9.a x86/lib/libpjnath-arm-apple-darwin9.a -output all/lib/libpjnath.a
lipo -create arm64/lib/libpjsip-arm-apple-darwin9.a armv7/lib/libpjsip-arm-apple-darwin9.a armv7s/lib/libpjsip-arm-apple-darwin9.a x64/lib/libpjsip-arm-apple-darwin9.a x86/lib/libpjsip-arm-apple-darwin9.a -output all/lib/libpjsip.a
lipo -create arm64/lib/libpjsip-simple-arm-apple-darwin9.a armv7/lib/libpjsip-simple-arm-apple-darwin9.a armv7s/lib/libpjsip-simple-arm-apple-darwin9.a x64/lib/libpjsip-simple-arm-apple-darwin9.a x86/lib/libpjsip-simple-arm-apple-darwin9.a -output all/lib/libpjsip-simple.a
lipo -create arm64/lib/libpjsip-ua-arm-apple-darwin9.a armv7/lib/libpjsip-ua-arm-apple-darwin9.a armv7s/lib/libpjsip-ua-arm-apple-darwin9.a x64/lib/libpjsip-ua-arm-apple-darwin9.a x86/lib/libpjsip-ua-arm-apple-darwin9.a -output all/lib/libpjsip-ua.a
lipo -create arm64/lib/libpjsua-arm-apple-darwin9.a armv7/lib/libpjsua-arm-apple-darwin9.a armv7s/lib/libpjsua-arm-apple-darwin9.a x64/lib/libpjsua-arm-apple-darwin9.a x86/lib/libpjsua-arm-apple-darwin9.a -output all/lib/libpjsua.a
lipo -create arm64/lib/libpjsua2-arm-apple-darwin9.a armv7/lib/libpjsua2-arm-apple-darwin9.a armv7s/lib/libpjsua2-arm-apple-darwin9.a x64/lib/libpjsua2-arm-apple-darwin9.a x86/lib/libpjsua2-arm-apple-darwin9.a -output all/lib/libpjsua2.a
lipo -create arm64/lib/libresample-arm-apple-darwin9.a armv7/lib/libresample-arm-apple-darwin9.a armv7s/lib/libresample-arm-apple-darwin9.a x64/lib/libresample-arm-apple-darwin9.a x86/lib/libresample-arm-apple-darwin9.a -output all/lib/libresample.a
lipo -create arm64/lib/libspeex-arm-apple-darwin9.a armv7/lib/libspeex-arm-apple-darwin9.a armv7s/lib/libspeex-arm-apple-darwin9.a x64/lib/libspeex-arm-apple-darwin9.a x86/lib/libspeex-arm-apple-darwin9.a -output all/lib/libspeex.a
lipo -create arm64/lib/libsrtp-arm-apple-darwin9.a armv7/lib/libsrtp-arm-apple-darwin9.a armv7s/lib/libsrtp-arm-apple-darwin9.a x64/lib/libsrtp-arm-apple-darwin9.a x86/lib/libsrtp-arm-apple-darwin9.a -output all/lib/libsrtp.a
cp arm64/include all/