Ticket #1050: iPhone-guide.txt

File iPhone-guide.txt, 2.1 KB (added by ming, 11 years ago)
Line 
1How to compile PJSIP for iPhone OS
2----------------------------------
3
4First, download iPhone SDK from http://developer.apple.com/login (requires login).
5In the example below, we are using version 3.1.2. Next, follow these steps:
6
71. Apply the patch configure-diff.txt
8
92. Create pjlib/include/pj/config_site.h
10/* Disable floating point support */
11#undef PJ_HAS_FLOATING_POINT
12#define PJ_HAS_FLOATING_POINT   0
13
14/* Select codecs to disable */
15#define PJMEDIA_HAS_ILBC_CODEC       0
16#define PJMEDIA_HAS_SPEEX_CODEC 0
17
18/* For CPU reason, disable speex AEC. */
19#define PJMEDIA_HAS_SPEEX_AEC 0
20
21#define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
22
23#define COREAUDIO_MAC 0
24
253. Define environment variables
26export DEV=/Developer/Platforms/iPhoneOS.platform/Developer
27export SDK=${DEV}/SDKs/iPhoneOS3.1.2.sdk
28export PATH=${DEV}/usr/bin:${PATH}
29export CFLAGS="-O2 -arch armv6 -isysroot ${SDK}"
30export LDFLAGS="-O2 -arch armv6 -isysroot ${SDK}"
31export CPP="${DEV}/usr/bin/cpp"
32
334. Create symbolic links to arm compiler
34cd ${DEV}/usr/bin
35ln -s arm-apple-darwin9-gcc-4.0.1 arm-apple-darwin9-gcc
36ln -s arm-apple-darwin9-g++-4.0.1 arm-apple-darwin9-g++
37ln -s ranlib arm-apple-darwin9-ranlib
38
395. autoconf aconfigure.ac > aconfigure
40
416. ./aconfigure --host=arm-apple-darwin9
42
437. Create user.mak
44export LDFLAGS += -framework AudioToolbox -framework Foundation
45
468. make dep and make
47=============================================================
48
49How to develop iPhone apps
50--------------------------
51
521. Go to iPhone Provisioning Portal
53http://developer.apple.com/iphone/my/overview/index.action
54
552. Follow the steps and how-tos to create a provisioning profile (i.e. Certificates, Devices, App IDs, Provisioning).
56
573. Open XCode, change XCode-Preferences-Indentation-Tab Width 8.
58
594. Open an iPhone app (ipjsystest or ipjsua) located in pjsip-apps/src using XCode.
60
615. Change Base SDKs for All Configurations in Project-Edit Project Settings (according to the iPhone's OS version).
62
636. Edit Resources-Info.plist-Bundle identifier, change it according to your provisioning profile.
64
657. Connect the iPhone via USB, then click Build and Run.