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

来源:互联网 发布:unity3d官网 编辑:程序博客网 时间:2024/06/08 07:06
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
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 智学号密码忘了怎么办 正方教务管理系统忘记密码怎么办 正方教务系统忘记密码怎么办 教务网密码忘了怎么办 电动车解除限速报警器不响怎么办 公租房住满5年怎么办 广州公租房收入超标怎么办 深圳法院拍卖房子不肯搬走怎么办 上海奉贤公租房的期满怎么办 公租房人口少了怎么办 公租房太远了怎么办 商品房没有门厅业主该怎么办 公帐付款备注错了怎么办 我是农村户口在外省交社保怎么办 北京租房遇到黑中介怎么办 上海租房子不让带孩子怎么办 租的房子没窗户怎么办 北京安河桥安河家园租房被骗怎么办 领完失业金后怎么办 北京公租房太小怎么办 申请公租房太小怎么办 房东电费收贵了怎么办 申请公租房工资超了怎么办 重庆公租房工资超了怎么办 公租房申请父母房子贷款怎么办 公产房父母去世办公证怎么办 动迁过程中承租人去世了怎么办 公租房的房间带阳台怎么办 公租房合同到期没有社保怎么办 租房合同没有到期违约了怎么办 租房户到期不搬怎么办 公租房摇号摇到了又怎么办 公租房被清退会怎么办 公租房摇不到号怎么办 公租房到期不搬怎么办 租房到期租客不搬怎么办 房产证面积与实际不符怎么办 社保晚交了1天怎么办 个人社保忘交了怎么办 个人社保晚交了怎么办 医保晚交了几天怎么办