Skip to content

Instantly share code, notes, and snippets.

@skeeet
Forked from graetzer/build.sh
Created December 7, 2017 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skeeet/2d705b4965a5665315b6bf8f6622fab5 to your computer and use it in GitHub Desktop.
Save skeeet/2d705b4965a5665315b6bf8f6622fab5 to your computer and use it in GitHub Desktop.
PJSIP 2.6 iPhone iOS 9.0 build script
#!/bin/bash
echo "Building pjsip:"
# change this to whatever DEVPATH works
# if you get make errors, maybe redownload pjsip and try again
export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
MIN_IOS="-miphoneos-version-min=9.0" ARCH="-arch i386" CFLAGS="-O2 -m32 -mios-simulator-version-min=9.0 -fembed-bitcode" LDFLAGS="-O2 -m32 -mios-simulator-version-min=9.0 -fembed-bitcode" ./configure-iphone
make dep && make clean && make
MIN_IOS="-miphoneos-version-min=9.0" ARCH="-arch x86_64" CFLAGS="-O2 -m32 -mios-simulator-version-min=9.0 -fembed-bitcode" LDFLAGS="-O2 -m32 -mios-simulator-version-min=9.0 -fembed-bitcode" ./configure-iphone
make dep && make clean && make
export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
MIN_IOS="-miphoneos-version-min=9.0" ARCH="-arch armv7" CFLAGS="-O2 -fembed-bitcode" LDFLAGS="-O2 -fembed-bitcode" ./configure-iphone
make dep && make clean && make
MIN_IOS="-miphoneos-version-min=9.0" ARCH="-arch armv7s" CFLAGS="-O2 -fembed-bitcode" LDFLAGS="-O2 -fembed-bitcode" ./configure-iphone
make dep && make clean && make
MIN_IOS="-miphoneos-version-min=9.0" ARCH="-arch arm64" CFLAGS="-O2 -fembed-bitcode" LDFLAGS="-O2 -fembed-bitcode" ./configure-iphone
make dep && make clean && make
link_libraries () {
PATH=${1}
LIB=${2}
/usr/bin/xcrun -sdk iphoneos lipo -arch i386 ${PATH}/lib/lib{LIB}-i386-apple-darwin_ios.a \
-arch armv7 ${PATH}/lib/lib${LIB}-armv7-apple-darwin_ios.a \
-arch armv7s ${PATH}/lib/lib${LIB}-armv7s-apple-darwin_ios.a \
-arch arm64 ${PATH}/lib/lib${LIB}-arm64-apple-darwin_ios.a \
-arch x86_64 ${PATH}/lib/lib${LIB}-x86_64-apple-darwin_ios.a \
-create -output ${PATH}/lib${LIB}.a
}
link_libraries pjlib pj
link_libraries pjlib-util pjlib-util
link_libraries pjmedia pjmedia
link_libraries pjmedia pjmedia-audiodev
link_libraries pjmedia pjmedia-codec
link_libraries pjnath pjnath
link_libraries pjsip pjsip
link_libraries pjsip pjsip-simple
link_libraries pjsip pjsip-ua
link_libraries pjsip pjsua
link_libraries pjsip pjsua2
link_libraries third_party g7221codec
link_libraries third_party gsmcodec
link_libraries third_party ilbccodec
link_libraries third_party resample
link_libraries third_party speex
link_libraries third_party srtp
// ios
#define PJ_CONFIG_IPHONE 1
// disable background VoIP socket, use PushKit
#undef PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT
#define PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT 0
#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
#define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
#endif
#define PJMEDIA_HAS_G729_CODEC 1
#include <pj/config_site_sample.h>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment