在MAC 10.5.5 上 编译给 iPhoneOS2_X 使用的 pjsip 和 siphone

Compilation guide for pjsip on iPhone OS 2.X.

Introduction

This article describes the steps to generate pjsip on Mac OS X 10.5.5

Details

Get pjsip source code

Get PjSIP from subversion repository:

svn checkout http
:
//svn.pjsip.org/repos/pjproject/trunk pjproject

Modify some files

aconfigure.ac

In aconfigure.ac file add the lines below displayed with '+'. Of course copy without '+' ;-)

  if  test  "$enable_sound"   =   "no" ;   then 

   
true ;
 
else
 
case $target in
+   arm - apple - darwin *)
+        LIBS = "$LIBS -framework CoreAudio -framework CoreFoundation -framework AudioToolbox"
+        ac_pjmedia_snd = iphone
+        AC_MSG_RESULT ([ Checking sound device backend ... AudioQueue ])

+         ;;
   
* darwin *)
        LIBS
= "$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox"
       
if test "`uname -r`" = "6.8" ; then

build/rules.mak

In rules.mak modify, remove lines with '-' and add lines with '+':

 $ ( LIB ):  $ ( OBJDIRS )  $ ( OBJS )  $ ( $ ( APP ) _EXTRA_DEP ) 

       
if test ! - d $ ( LIBDIR ); then $ ( subst @@, $ ( subst /, $ ( HOST_PSEP ), $ ( LIBDIR )), $ ( HOST_MKDIR )); fi
-       $ ( AR ) $ ( LIB ) $ ( OBJS )
-       $ ( RANLIB ) $ ( LIB )
+       $ ( RANLIB ) - static - o $ ( LIB ) $ ( OBJS )

pjlib/include/pj/compat/os_darwinos.h

In os_darwinos.h find and comment the following lines :

/*
 * Socket related
 */

//typedef int socklen_t;

Without this, you will get an error when you will compile, because socklen_t is redefined.

pjlib/include/pj/config_site.h

It can be necessary to define some macro. For example :

#undef PJ_HAS_FLOATING_POINT 

#define PJ_HAS_FLOATING_POINT   1

/* SRTP has not been ported to iPhone yet */
#   undef PJMEDIA_HAS_SRTP
#   define PJMEDIA_HAS_SRTP             0

/* Disable some codecs for now */
#   define PJMEDIA_HAS_GSM_CODEC        1
#   define PJMEDIA_HAS_L16_CODEC        0
#   define PJMEDIA_HAS_ILBC_CODEC       0
#   define PJMEDIA_HAS_SPEEX_CODEC      0
#   define PJMEDIA_HAS_G722_CODEC       0

pjmedia/build/os-auto.mak.in

In os-auto.mak.in , add the line with '+'

  #   - ds:              Win32 DirectSound (dsound.c) 

+ #   - iphone:       iPhone AudioQueue (iphonesound.c)
 
#   - null:            Null sound device (nullsound.c)

Add the line below, for example between "Win 32 Direct Sound" and " Null Sound Device"

# 

# iPod/iPhone
#
ifeq
( $ ( AC_PJMEDIA_SND ), iphone )
export SOUND_OBJS = iphonesound . o
export CFLAGS += - DPJMEDIA_SOUND_IMPLEMENTATION =
PJMEDIA_SOUND_IPHONE_SOUND
endif

We have defined a new target for sound device.

pjmedia/include/pjmedia/config.h

in config.h add the lines below with '+':

  /** Constant for Win32 MME sound backend. */ 

 
#define PJMEDIA_SOUND_WIN32_MME_SOUND      3

+ /** Constant for AudioQueue sound backend. */
+ #define PJMEDIA_SOUND_IPHONE_SOUND            4

pjmedia/src/pjmedia

For the moment I didn't upload iphonesound.c so we need to compile with null_sound.

Configuration

Generate configuration script

autoconf aconfigure . ac  >  aconfigure 

Compilation

iPhone SDK doesn't provide some programs without version number, so we create symbolic link. We should test before create link, but we are very lazy. Copy the lines below in file with name like compile.sh in the root of pjsip.

#!/bin/sh 


export DEV = /Developer/ Platforms / iPhoneOS . platform / Developer
export SDK = $ { DEV }/ SDKs / iPhoneOS2 . 1.sdk

pushd $
{ DEV }/ usr / bin
ln
- s arm - apple - darwin9 - gcc - 4.0 . 1 arm - apple - darwin9 -
gcc
ln
- s arm - apple - darwin9 - g ++- 4.0 . 1 arm - apple - darwin9 - g ++

ln
- s ranlib arm - apple - darwin9 - ranlib
popd

export PATH = $ { DEV }/ usr / bin : $ { PATH }


export CFLAGS = "-O2 -arch armv6 -isysroot ${SDK}"

export LDFLAGS = "-O2 -arch armv6 -isysroot ${SDK}"

export CPP = "${DEV}/usr/bin/cpp"

./ aconfigure -- host = arm - apple - darwin9 -- disable - speex - aec /
   
-- disable - speex - codec -- disable - l16 - codec -- disable - g722 - codec /
   
-- disable - ilbc - codec -- disable - ssl -- disable - sound

make dep
make

We must not forget to change access right to allow execution. We can run compile.sh after some minutes pjsip is compiled.

 

Siphon Compilation

Getting siphon source code

Get Siphon from subversion repository:

svn checkout http : //siphon.googlecode.com/svn/trunk/ siphon-read-only 

Installation pjsip

Create directory to install pjsip in Siphon:

mkdir  - p pjsip / 
include
mkdir
- p pjsip / lib

Put these pjsip include directories in the pjsip/include path:

  • pjlib/include
  • pjlib-util/include
  • pjmedia/include
  • pjnath/include
  • pjsip/include

Put these pjsip library directories in the pjsip/lib path:

  • pjlib/lib
  • pjlib-util/lib
  • pjmedia/lib
  • pjnath/lib
  • pjsip/lib
  • third_party/lib

Compilation

pushd settings
make
popd
pushd src
make
popd

For installation read the Manual .

 

ManualInstallation  
Manual installation instructions.

Manual Installation

The preferred method of installing Siphon is through the AppTapp Installer . However, if you are unable to or prefer not to use the Installer, you can follow the steps below to install Siphon manually.

NOTE: Siphon requires firmware version 1.1.X.

Manual Installation after compilation

  • Compile Siphon.

The three directories are in 'dist' directory.

  • Copy Siphon.app into /Applications or /Widgets on your device. You may see some error messages during this process, are there are several symbolic links in here that the Installer source would normally deal with. You can safely ignore these errors as we will copy the files manually.
  • Copy SiphonSettings.bundle into /System/Library/PreferenceBundles/SiphonSettings.bundle on your device.
  • Copy SpringBoard.app into /System/Library/CoreServices/SpringBoard.app on your device.

Manual Installation after download

  • Download the last version on this page .
  • Unzip downloaded file in /Applications or /Widgets on your device. You may see some error messages during this process, are there are several symbolic links in here that the Installer source would normally deal with. You can safely ignore these errors as we will copy the files manually.
  • Copy SiphonSettings.bundle into /System/Library/PreferenceBundles/SiphonSettings.bundle on your device.
  • Copy SpringBoard.app into /System/Library/CoreServices/SpringBoard.app on your device.

Last operations

Next, run the following command to complete the installation:

/Applications/ Siphon . app / Siphon   -- installPrefBundle 

Finally, restart the SpringBoard:

killall  SpringBoard 

你可能感兴趣的:(在MAC 10.5.5 上 编译给 iPhoneOS2_X 使用的 pjsip 和 siphone)