|
BuildPJsipSDK21
This page describes how to build pjsip-1.0 on the iPhone SDK 2.x
IntroductionThis is to help one build pjsip 1.0 on OS X 10.5.5 with the iPhone SDK 2.x using the sound code from the siphon project. Noteipodsound.c does not work with the 3.0 SDK beta. The sound api probably has changes and the source will need to be ported. To have this work with other versions of the iPhone SDK (maybe) try changing the occurrences of /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS 2.1 .sdk to whichever version you have downloaded. i.e. /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS 2.2 .sdk DetailsPut the ipodsound.c file file into pjmedia/source/pjmedia directory. You can get a copy from the downloads section of this site. Set the path to include the arm tools in the SDK export PATH=$PATH:/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ Setup symbolic links for gcc like cross compile cd /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ ln -s ar arm-apple-darwin9-ar ln -s cpp arm-apple-darwin9-cpp ln -s arm-apple-darwin9-g++-4.0.1 arm-apple-darwin9-g++ ln -s arm-apple-darwin9-gcc-4.0.1 arm-apple-darwin9-gcc ln -s ld arm-apple-darwin9-ld ln -s ranlib arm-apple-darwin9-ranlib Edit aconfigure.ac and add this at line 398: arm-apple-darwin*)
LIBS="$LIBS -framework CoreAudio -framework CoreFoundation -framework AudioToolbox"
ac_pjmedia_snd=ipod
AC_MSG_RESULT([Checking sound device backend... AudioQueue])
;;Edit build/cc-gcc.mak export RANLIB = $(CROSS_COMPILE)ranlib -o Edit the following build/rules.mak $(LIB): $(OBJDIRS) $(OBJS) $($(APP)_EXTRA_DEP) if test ! -d $(LIBDIR); then $(subst @@,$(subst /,$(HOST_PSEP),$(LIBDIR)),$(HOST_MKDIR)); fi $(AR) $(LIB) $(OBJS) $(RANLIB) -static $(LIB) $(OBJS) Add this to config.h file in pjmedia/include/pjmedia: /** Constant for AudioQueue sound backend. */ #define PJMEDIA_SOUND_IPOD_SOUND 4 Copy a header that is missing in the device includes cp /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.1.sdk/usr/include/netinet/in_systm.h \ /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/usr/include/netinet/in_systm.h Edit os-auto.mak.in pjmedia/build and add # # iPod/iPhone # ifeq ($(AC_PJMEDIA_SND),ipod) export SOUND_OBJS = ipodsound.o export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_IPOD_SOUND endif Comment out the media tests build target in pjmedia/build/makefile 109: TARGETS := pjmedia pjmedia-codec pjsdp #pjmedia-test Generate configuration script autoconf aconfigure.ac > aconfigure aconfigure with these options seem to work ./aconfigure --host=arm-apple-darwin9 --disable-ssl --disable-speex-aec \ --disable-speex-codec --disable-l16-codec --disable-g722-codec \ --disable-ilbc-codec CFLAGS="-arch armv6 -pipe -O0 -isysroot \ /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk \ -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/usr/include/gcc/darwin/4.0" \ LDFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk \ -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/IphoneOS2.1.sdk/usr/lib" \ CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-cpp \ AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-ar \ RANLIB=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-ranlib \ CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc now to setup link in xcode... |
Sign in to add a comment
I followed the instructions to the dot. This is what I get when I run ./aconfigure
aconfigure:2409: checking for C compiler default output file name aconfigure:2431: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc -arch armv6 -pipe -O0 -isysroot \ /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/usr/include/gcc/darwin/4.0 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/IphoneOS2.1.sdk/usr/lib conftest.c >&5 ld: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk, can't map file, errno=22 collect2: ld returned 1 exit status
Any ideas ?
Thanks Mudit
Never mind -- fixed it -- in the aconfigure line -- you need to add a new line after -pipe -O0 -isysroot \
Now, the make dep succeeds but the make fails in the end.
ld: in ../lib/libpj-arm-apple-darwin9.a, archive has no table of contents -rw-r--r-- 1 mwahal 1000 205648 Dec 27 10:27 ./pjlib/lib/libpj-arm-apple-darwin9.a ./pjlib/lib/libpj-arm-apple-darwin9.a: current ar archive
If I remove -static from the changes in build/rules.mak, then everything compiles ok.
Hello, i'm able to compile everything properly it also runs. but the only problem is i'm getting one way voice. am not able to hear on iphone. i have a apple dev license so i have build an app. can anyone give me some idea. thanks in advance
one way audio usually is a NAT related issue, try using STUN to have the user agent try to correct this. The option is --stun-srv=name Set STUN server host or domain. See the documentation for pjsua
scott,
can you please edit/fix this line
./aconfigure --host=arm-apple-darwin9 --disable-ssl --disable-speex-aec \ --disable-speex-codec --disable-l16-codec --disable-g722-codec \ --disable-ilbc-codec CFLAGS="-arch armv6 -pipe -O0 -isysroot \ /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk \
---- please add a new line after -isysroot and before /Developer
Thanks Mudit
-pipe -O0 -isysroot \ /Developer/Platforms
Thanks mwahal.
Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h.
Further customizations can be put in:
The next step now is to run 'make dep' and 'make'.
ssts-macbook:pjproject sst$ sudo make dep for dir in pjlib pjlib-util pjnath third_party pjmedia pjsip pjsip-apps; do \
make -f /Users/sst/iphonedev/iphonedev2/pjproject/build/rules.mak APP=PJLIB app=pjlib depend .pjlib-arm-apple-darwin9.depend:1: missing separator. Stop. make1?: depend? Error 2 make: dep? Error 1Hi I made a simple application run from xcode on ipod touch device first i test dial function it work and next test receive incoming call function
This debug log from xcode debug console when program initialize
17:26:51.805 os_core_unix.c pjlib 1.0.1 for POSIX initialized
When i make call from x-lite to this sip account i got error message in debug console Assertion failed: (cport->rx_buf_count <= cport->rx_buf_cap), function read_port, file ../src/pjmedia/conference.c, line 1403.
How to slove this problem Thanks
densvc, care to share your Xcode project? I might be able to help then. Other than that I think you are missing (or the API is broken) for the ...iPhoneOS2.1.sdk/usr/include/netinet/in_systm.h library.
scoott, thank you for your fast reply i will send you the simple project by gmail. if i use iphonesdk 2.0 you think that is problem
hi densvc can you share the xcode project .i will very thankful to you .if you share plz send it my gmail account :nandan.mehra@gmail.com
can some one solve my problem which is highly appropriate.... one more thing can someone send me the source code of siphon which has devloped in xcode .. thanks in advance
Hi densvc,
Are you able to fix the problem i.e jlib-arm-apple-darwin9.depend:1: missing separator..
Currently I am trying to build the pjsip library and encountered the same problem...
I will be really thankful ,if you/anyone help me on this topic..
Thanks
Hi densvc & sahajankhan,
Help Me... :(
I am also getting the same error while compile the source.
make -f /Users/sst/iphonedev/iphonedev2/pjproject/build/rules.mak APP=PJLIB app=pjlib depend .pjlib-arm-apple-darwin9.depend:1: missing separator. Stop. make1?: depend? Error 2 make: dep? Error 1
Thanks
Hi,
I try to compile with pjproject1.1 but in the config.h in pjmedia/include/pjmedia, there is not the definition of the constants for sound backend. So I don't know if I have to add the line : / Constant for AudioQueue? sound backend. / #define PJMEDIA_SOUND_IPOD_SOUND 4
Thanks
/Hi densvc & sahajankhan,
Help Me... :(
I am also getting the same error while compile the source.
make -f /Users/sst/iphonedev/iphonedev2/pjproject/build/rules.mak APP=PJLIB app=pjlib depend .pjlib-arm-apple-darwin9.depend:1: missing separator. Stop. make1?: depend? Error 2 make: dep? Error 1
Thanks /
I have the same problem. :( there is some solution?
Hi All,
It should be noted that the above instructions are probably out of date. I will look into build instructions for current revs of pjproject, but until then these instructions are probably only good for pjproject-1.0 NOT the current version.
Thanks Scott !!!
Thanks Scott!
How many time do you think you need to make instructions for revs of pjproject ? Do you want help ?
For the last versions, I just try to compile with pjproject-1.0.1 and pjproject-1.0 and I have the same error as densvc, sahajankhan, emmanuelgranatello, ...
I find the solution : it's when we copy/put $(LIB): $(OBJDIRS) $(OBJS) $($(APP)EXTRA_DEP)
It put space instead of tab. Now I suppose it compile correctly but my Terminal have crash during the make. I will try tomorrow ;)
Sorry, how do link the files ".a" in Xcode? I have problems when linking! :(
See http://code.google.com/p/voiphone/wiki/XcodeBuildLink, you have to create a new project, open info of your target and what you need to add is in the XcodeBuildLink. Don't forget to adjust the paths.
thanks.... gives me problems when I use any function!
during linking ... error is like below... "pjsua_create",referenced from:
Do you work on your device or with the simulator ? I haved the same error with the simulator but it compile with the device.
tnks. ... work only in device? i try it on simulator :( I don't have an iphone ! :(
I think it could work on simulator but you have to change some elements. I don't know exacly what you have to change. But I think that you have to change the export path, change the links for gcc with the simulator path, and change the options of the aconfigure with the simulator path.
Good luck ;)
thanks! I will try!
someone can to make it run on the simulator?
Work with Simulator, but sound must be disable >"<
In the ./aconfigure command, I change all "iPhoneOS" to "iPhoneSimulator" and "-arch armv6" to "-arch i386", then compile. Everything linked correctly in Xcode (Simulator) except the reference to ipodsound.
I have to use --disable-sound to make Xcode (Simulator) correctly link and compile.
Anyone try this and have a solution?
Hi all,
Please let me know how to compile Pjsip in iPhoneOS 3.0 ? Even they don't provide netinet/in_systm.h file. So how could i compile by using above code. I had succefully compiled library for IphoneOs? 2.2 what i do now please let me know.
hello all,
following setting carefully, I have run ./aconfigure & make dep but when I am running make I am getting this result. please let me know how to solve this error
for dir in pjlib pjlib-util pjnath third_party pjmedia pjsip pjsip-apps; do \
make -f /Users/advantal/Nikhil/sip/pjproject-1.0.2/build/rules.mak APP=PJLIB app=pjlib ../lib/libpj-i386-apple-darwin9.6.1.a if test ! -d ../lib; then ; fi /bin/sh: -c: line 0: syntax error near unexpected token `;' /bin/sh: -c: line 0: `if test ! -d ../lib; then ; fi' make2?: ../lib/libpj-i386-apple-darwin9.6.1.a? Error 2 make1?: pjlib? Error 2 make: all? Error 1