1 | How to compile PJSIP for iPhone OS |
---|
2 | ---------------------------------- |
---|
3 | |
---|
4 | First, download iPhone SDK from http://developer.apple.com/login (requires login). |
---|
5 | In the example below, we are using version 3.1.2. Next, follow these steps: |
---|
6 | |
---|
7 | 1. Apply the patch configure-diff.txt |
---|
8 | |
---|
9 | 2. 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 | |
---|
25 | 3. Define environment variables |
---|
26 | export DEV=/Developer/Platforms/iPhoneOS.platform/Developer |
---|
27 | export SDK=${DEV}/SDKs/iPhoneOS3.1.2.sdk |
---|
28 | export PATH=${DEV}/usr/bin:${PATH} |
---|
29 | export CFLAGS="-O2 -arch armv6 -isysroot ${SDK}" |
---|
30 | export LDFLAGS="-O2 -arch armv6 -isysroot ${SDK}" |
---|
31 | export CPP="${DEV}/usr/bin/cpp" |
---|
32 | |
---|
33 | 4. Create symbolic links to arm compiler |
---|
34 | cd ${DEV}/usr/bin |
---|
35 | ln -s arm-apple-darwin9-gcc-4.0.1 arm-apple-darwin9-gcc |
---|
36 | ln -s arm-apple-darwin9-g++-4.0.1 arm-apple-darwin9-g++ |
---|
37 | ln -s ranlib arm-apple-darwin9-ranlib |
---|
38 | |
---|
39 | 5. autoconf aconfigure.ac > aconfigure |
---|
40 | |
---|
41 | 6. ./aconfigure --host=arm-apple-darwin9 |
---|
42 | |
---|
43 | 7. Create user.mak |
---|
44 | export LDFLAGS += -framework AudioToolbox -framework Foundation |
---|
45 | |
---|
46 | 8. make dep and make |
---|
47 | ============================================================= |
---|
48 | |
---|
49 | How to develop iPhone apps |
---|
50 | -------------------------- |
---|
51 | |
---|
52 | 1. Go to iPhone Provisioning Portal |
---|
53 | http://developer.apple.com/iphone/my/overview/index.action |
---|
54 | |
---|
55 | 2. Follow the steps and how-tos to create a provisioning profile (i.e. Certificates, Devices, App IDs, Provisioning). |
---|
56 | |
---|
57 | 3. Open XCode, change XCode-Preferences-Indentation-Tab Width 8. |
---|
58 | |
---|
59 | 4. Open an iPhone app (ipjsystest or ipjsua) located in pjsip-apps/src using XCode. |
---|
60 | |
---|
61 | 5. Change Base SDKs for All Configurations in Project-Edit Project Settings (according to the iPhone's OS version). |
---|
62 | |
---|
63 | 6. Edit Resources-Info.plist-Bundle identifier, change it according to your provisioning profile. |
---|
64 | |
---|
65 | 7. Connect the iPhone via USB, then click Build and Run. |
---|