在MAC 10.5.5 上 编译给 iPhoneOS2_X 使用的 pjsip 和 siphone
来源:互联网 发布:unity3d官网 编辑:程序博客网 时间:2024/06/08 07:06
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.
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
- pjsip在vs2013中编译和使用
- pjsip在android上使用的例子
- Jenkins在Mac上的使用,关于Xcode编译问题
- pjsip的编译及简单使用
- pjsip的编译及简单使用
- pjsip的编译及简单使用
- pjsip的编译及简单使用
- VC6 中编译使用 pjsip 的工程
- pjsip的编译及简单使用
- 如何在Mac上开发Android应用(原创,给刚接触android和mac的新人)
- 如何在Mac上开发Android应用(原创,给刚接触android和mac的新人)
- 如何在Mac上开发Android应用(原创,给刚接触android和mac的新人)
- pjsip编译与使用
- proxygen在mac上的编译
- iOS FFmpeg 在Mac OS下的编译和使用
- PJSIP的编译
- 在Wndows 上用CodeBlockes 写的代码移植到Mac OSX上,使用Xcode 编译
- emacs+cscope+ecb的配置文件
- C#多线程与UI响应
- 在Tomcat中如何部署war文件
- JTAG基本原理
- [ACM] ZOJ 1057
- 在MAC 10.5.5 上 编译给 iPhoneOS2_X 使用的 pjsip 和 siphone
- 交换机的116个知识点
- 批处理文件中获取当前所在路径的几种方法
- NS2虚拟LINUX系统下安装手记
- Asp .net 调用js
- Cisco交换机设置点滴
- 设计模式的学习(一):基本概念
- 教你如何安装PEAR
- GDI+ 将图片背景设为透明