compilation guide for pjsip on iphone os 2.x.
introductionthis article describes the steps to generate pjsip on mac os x 10.5.5
detailsget pjsip source codeget pjsip from subversion repository:
svn checkout http://svn.pjsip.org/repos/pjproject/trunk pjproject
modify some filesaconfigure.acin 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.makin 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.hin 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.hit 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.inin 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.hin 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/pjmediafor the moment i didn't upload iphonesound.c so we need to compile with null_sound.
configurationgenerate configuration script
autoconf aconfigure.ac > aconfigure
compilationiphone 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 compilationgetting siphon source codeget siphon from subversion repository:
svn checkout http://siphon.googlecode.com/svn/trunk/ siphon-read-only
installation pjsipcreate 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 compilationpushd settings
make
popd
pushd src
make
popd
for installation read the manual.
manualinstallation
manual installation instructions.
manual installationthe 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 compilationcompile 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 downloaddownload 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 operationsnext, run the following command to complete the installation:
/applications/siphon.app/siphon--installprefbundle
finally, restart the springboard:
killall springboard