Menu

HowToBuild

Anonymous

IMPORTANT

For any question on how to build PLEASE join the development group Also, if you build CSipSimple, you should first read the Licensing wiki page

Introduction

The application has two distinct parts :

  • The pjsip dynamic library part that produce a .so (to be more precise a .so by android target).
  • The java application that produce a .apk (and can be installed on your android device).

If you are a java developer and you are not interested in building the sip stack, there is an alternate - not easy to maintain - way to build by getting auto-generated swig java class and the dynamic library from nightly build website. Please search the dev google group to get info about this method that is not recommended.

Some very important note : CSipSimple is released under GPL license. Be really aware about what does that mean before developing. Read Licensing wiki page.

So if you plan to improve CSipSimple and redistribute it, you MUST release your source code. As we (CSipSimple developers) are open to any contribution, I'd advise you to directly contribute the CSipSimple project. All contributions are welcome !!!

  • IMPORTANT
  • Introduction
  • System and Software Requirements
    • For Linux
    • For MacOSX
    • For Windows
    • With a virtual machine
  • Finalize your SDK installation
  • Checkout source code
  • Build native library
    • Without building the native library
  • Build apk
    • Setup/import application in your IDE (Optional)
    • Using ant (Optional)
  • Updates
  • Fast way to develop a GPL branded version
  • Integrate an existing pjsip module
  • Build with pjsip 1.x

System and Software Requirements

For Linux

You'll need following package you may need to adapt depending to your distribution packages names

subversion git quilt unzip wget swig2.0 python make yasm

You also have to install the android NDK and the android SDK. I do not details here how to install android NDK and SDK. Please read Android documentations about that :

  • Android NDK doc
  • Android SDK doc
    To install correctly the android NDK, please add the NDK to your path. I usually recommend to add these lines to your .bashrc :

    export ANDROID_NDK=/_path_to/android-ndk-linux/
    export ANDROID_SDK=/_path_to/android-sdk-linux/
    export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK

Anyway the naming of ANDROID_NDK export is important in the build of one part of the application. You can also do that only at build time, but if you use to develop for android, it's a good idea to do that.

Don't forget to install SDK and NDK dependencies as well. For example, on ubuntu 64bits system you will need ia32-libs for both NDK and SDK.

For MacOSX

Thx to Benjamin and Magnus for the contrib on these instructions

For main instructions it's almost the same as for Linux.

Packages are a little bit more complicated to get however. The two more difficult to get are quilt and swig2.0.

DUE TO A BUG IN MACPORT with quilt 0.6 -- DON'T USE THE FOLLOWING.

To install quilt you should install MacPorts first (http://www.macports.org). Installation instructions

If you work behind a proxy follow these instructions additionally MacPorts behind proxy

And then install quilt using :

sudo port selfupdate
sudo port install quilt

Instead build it from source

Download quilt from latest source available here : http://download.savannah.gnu.org/releases/quilt/ And then execute

./configure # optionally add prefix here to be able to install in your env
make
make install # optionally do that in sudo if target is read only for the current user

To install swig 2.0 : download from source available here : http://www.swig.org/download.html And then execute

./configure # optionally add prefix here to be able to install in your env
make
make install # optionally do that in sudo if target is read only for the current user

Finally, since csipsimple make file has some crappy hard coded link to swig tool for now, you have to add a symbolic link to allow your system to recognize swig2.0 to be the same than swig. The faster way is probably to make a symlink:

sudo ln -s <path to swig> /opt/local/bin/swig2.0

Other packages (subversion git unzip wget python make) should be easier to install but are also required on Mac.

Continue instructions of Linux build. It should go the same way once packages are installed.

For Windows

I don't not explain how to build for Windows because if you really want to develop you probably don't and shouldn't use Windows. However it should be possible to build it for Windows too. To do so, you must understand Makefile syntax and have a look on commands to run to build the project. It's most about checkouting other projects using git, getting zip files from elsewhere, applying patches, and generating a swig interface. Maybe using cygwin it's easier.

So, in this case the easiest way is to use the virtual machine as described in following chapter.

With a virtual machine

If you want to have an environment with everything required for CSipSimple you can use a Virtual Machine. Thanks to Dennis work, there is one ready for direct use :

CSipSimple-CompilerVM.vmdk

You can get root privilege with sudo command. The password is equals to the username, which should be "user".

Using, this machine, you should still read the following step for your complete understand of how things work, but don't need to run the commands since everything was already done. The step about how to update may be necessary to read if you want to be able to update to latest source code.

Finalize your SDK installation

Launch android sdk manager to download and install the SDK of versions listed as target in files : CSipSimple project.properties and ABS project.properties.

Checkout source code

We assume here you are in your folder where you put dev with a shell.

Start with a checkout of source code

# Checkout CSipSimple incl. all svn dependancies
svn checkout http://csipsimple.googlecode.com/svn/trunk/ CSipSimple-trunk

It will create a folder CSipSimple-trunk with the following folder structure containing all source code and SVN dependencies:

  • ActionBarSherlock: is a backward compatible way to use Fragments and Action Bar pattern of android newer versions
  • CSipSimple: The CSipSimple-App source code
  • CSipSimpleBranded
  • CSipSimpleCodecG729
  • CSipSimpleCodecPack
  • CSipSimpleVideoPlugin

Build native library

Go into source folder

cd CSipSimple-trunk/CSipSimple

Launch make to build the native part of the library and dependancies

make

If needed build video support libary (Optional)

make VideoLibs

If needed build CodecPackLibs (Optional)

make CodecPackLibs

If needed build CodecG729 (Optional)

make CodecG729

Note that you can use make -j4 to make things go faster if your computer allow that

If you get a problem at this point, it could be because there is a missing package on your system install. Since at this point it will do git, swig2.0, wget, unzip, quilt... there is chance one of these apps is missing. If so, try to get that installed on your system first. About swig you may have to build and install it by yourself because version 2.0 is recent.

If everything goes well, congrats, you have created the native libraries for CSipSimple (it will also produce native libs for plugins apps).

Without building the native library

Alternate way -- most developers should ignore this section

This method is not officially supported. However it's helpful if you have not knowledge in native development or GNU toolchains.

The native library build produce two things :

  • swig auto generated java/jni bindings class.
  • dynamic native library .so files
    To get the java/jni bindings class get the archive file here :

org.tar.gz and unpack it to have the org.pjsip package in the src folder of CSipSimple.

To get the .so files, download latest nightly build from nightly build website and unpack the apk file (apk files are just zip files). Then get lib/ARCH/.so files and copy it into CSipSimple libs/ARCH/.so

Build apk

There is several ways to build the apk once the native library is built. You can either use an IDE that integrates android development toolchains (described in details for Eclipse) or you can use Ant (for command line environments).

Setup/import application in your IDE (Optional)

You can now open the projects with Eclipse or your preferred java IDE that is able to build a regular android application.

Import the projects into Eclipse as an Android projects (right click > import > Android project from source) and select the folder CSipSimple-trunk.

Pick at least SipHome and ActionBarSherlock. Add CSipSimpleXXX-projects if needed.

Then when ADT plugin will ask you which android version you'd like to link on, you should check the "project.properties" file of each project you are importing (do that both for CSipSimple and ActionBarSherlock). You can have a look to online files here : CSipSimple project.properties and ABS project.properties. Obviously you need these versions to be installed by Android SDK Manager if not already done.

Don't be worried about the fact it's high values! It does not mean that your app will not run with older android versions. Actually, it will be able to run on android 1.6! MinSdk version and targetVersion are not linked. Backward compatibility is ensured by code not by the lib you link on while building.

Finally, you need to add the project dependencies to "SipHome", which is at least "ActionBarSherlock" and optional native lib projects. In Eclipse: right-click on "SipHome"-> Properties -> Java Build Path -> Projects.

If you encounter some problems about override of methods, ensure that your Eclipse env setup projects for "java 1.6" or upper. -You should also check that per project if necessary-

You should now be able to launch the application as an Android application.

Using ant (Optional)

This is particularly useful for a pure command line environment. It's used on the automatic nightly build server for example.

Directory structure:

  • ./ActionBarSherlock
  • ./CSipSimple

Steps:

  • Install ant
  • Setup SDK and NDK path (see above)
  • (if needed) Built native lib part: in ./CSipSimple execute: make
  • in ./ActionBarSherlock execute: android update project -p ./
  • in ./CSipSimple execute: android update project -p ./
  • Setup code signing for .apk
  • in ./CSipSimple execute: ant release
  • ./CSipSimple/bin/CSipSimple-release.apk

You have to create your own ant script based integrating ant scripts from the SDK. You can get inspired of what is produced by command line tool of the sdk http://developer.android.com/guide/developing/projects/projects-cmdline.html.

Some interesting tutorial to follow : http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html.

You can also add additional ant task such as the one made for automatic revision in code number of the manifest.

Updates

If you would like to update your checkout of CSipSimple-trunk to the current SVN revision use the provided make tasks! This command will remove all applied quilt patches from SVN dependencies, update the SVN dependencies and CSipSimple-repository, and re-apply the new patches. All native libraries must be re-build.

make update && make

If you want to automate the build of the native part as well as the build of the android project, you can do that by installing CDT on eclipse and then on the android project do : New Project->Other->C++->Convert to C++ and tells it's a makefile project.


Fast way to develop a GPL branded version

BuildGplBrandedVersion

Integrate an existing pjsip module

IntegrateExistingPjsipModule


Build with pjsip 1.x

OldWayToBuild wiki page gives for reference the old way to build the library on older csipsimple versions. It's not supported anymore in development process.


Related

Wiki: BuildGplBrandedVersion
Wiki: IntegrateExistingPjsipModule
Wiki: Licensing
Wiki: MainSideBar

Discussion

<< < 1 2 3 4 5 6 > >> (Page 4 of 6)
  • Anonymous

    Anonymous - 2011-11-24

    Originally posted by: murad...@gmail.com

    Hi I am getting errors compiling CSipSimple on Ubuntu 10.04 lucid

    /usr/src/android-ndk-r7/prebuilt/linux-x86/bin/awk: /usr/src/android-ndk-r7/prebuilt/linux-x86/bin/awk: cannot execute binary file Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk ! make1?: Entering directory /usr/src/CSipSimple' /usr/src/android-ndk-r7/build/core/init.mk:258: Android NDK: Aborting. . Stop. make1?: Leaving directory/usr/src/CSipSimple' make: libraries? Error 2

    Any idea how to resolve this?

    Murad

     
  • Anonymous

    Anonymous - 2011-11-24

    Originally posted by: r3gis...@gmail.com

    It's a problem with your NDK installation. Not only you'll not be able to build csipsimple but all applications that use the NDK ;). A quick search on google give this result : http://stackoverflow.com/questions/8116113/problems-with-android-ndk-7-and-awk . Hope it helps :)

     
  • Anonymous

    Anonymous - 2011-11-30

    Originally posted by: r3gis...@gmail.com

    @Aparna : If you want to use the ndk-build instead of the make method, the first part of this page is for you. The second part, as you noticed, is an obsolete method that was relevant in previous ndk versions. Besides, please, use the developer group instead of comments on this wiki page, it's very hard to share information in a simple comment thread ! Last point, if you are a developer, stop using windows ;)

     
  • Anonymous

    Anonymous - 2011-12-05

    Originally posted by: ursu.adr...@gmail.com

    Hello. I have just updated to the last revision and I have a problem running "make". I am getting this error:

    Compile++ thumb : zrtp4pj <= ZsrtpCWrapper.cpp Compile thumb : zrtp4pj <= transport_zrtp.c StaticLibrary? : libcrypto_ec_static.a Compile++ thumb : pj_webrtc_codec <= webrtc_codec.cpp make1?: *** No rule to make target jni//webrtc/android_toolchain/../sources//modules/audio_coding/codecs/CNG/main/source/webrtc_cng.c', needed byobj/local/armeabi/objs/webrtc_cng/webrtc_cng.o'. Stop. make1?: Waiting for unfinished jobs.... StaticLibrary? : libwebrtc_audio_coding.a make1?: Leaving directory `/home/home/Programs/CSipSimple/CSipSimple' make: * libraries? Error 2

    Did anyone had this issue before ?

    Thank you.

     
  • Anonymous

    Anonymous - 2011-12-05

    Originally posted by: ursu.adr...@gmail.com

    I solved the issue. I had to "make-clean". After that I typed "make" and worked very well.

     
  • Anonymous

    Anonymous - 2011-12-10

    Originally posted by: ocean.ra...@gmail.com

    Hi! i want to know the build procedure of "pjsip_android" with amrnb codec.

     
  • Anonymous

    Anonymous - 2011-12-10

    Originally posted by: r3gis...@gmail.com

    Follow instruction of the old way + read the part about how to customize your build (it's about modifying the application.mk and enabling MY_USE_AMR... ). For further information, do not hesitate to join the developer google group ;).

     
  • Anonymous

    Anonymous - 2012-01-21

    Originally posted by: tsa...@gmail.com

    Hi All, first, wonderful work with this project, thanks. So, I'm trying to compile on eclipse 3.6.2 with latest android sdk installed (all sdk are installed), on a mac, latest osx. On eclipse I follow the instructions to create a new android from source and also did a regular import for the actionbarsherlock library. I get all sorts of errors for both the library and the SipHome? project, btw. my sdk manager does not show 2.3 version (it does have 2.3.1 and 2.3.2 if I recall correctly, I chose 2.3.1), can someone help posting more clear instructions on how to import the projects into eclipse the correct way, all the best, -tzurs Errors I get:

     
  • Anonymous

    Anonymous - 2012-01-21

    Originally posted by: r3gis...@gmail.com

    @tsayag : please ask on the developer group instead it's easier to share problem... And actually I already replied that on the developer group ;). You mistake between what means the target sdk and what is the min sdk. Read my post here : http://groups.google.com/group/csipsimple-dev/msg/e82e30b0f5384c3c it explains android sdk target, min/max and library.

     
  • Anonymous

    Anonymous - 2012-01-21

    Originally posted by: tsa...@gmail.com

    Sorry about that, I'll follow up in the relevant forum. thanks!

     
  • Anonymous

    Anonymous - 2012-01-25

    Originally posted by: FaysalMi...@gmail.com

    I could not install package swig2.0 in ubuntu 10.04 LTS

     
  • Anonymous

    Anonymous - 2012-01-25

    Originally posted by: FaysalMi...@gmail.com

    make: * No rule to make target jni//swig-glue/android_toolchain/../nativesrc/pjsua_wrap.cpp', needed byobj/local/armeabi/objs/swig-glue/pjsua_wrap.o'. Stop. what is the solution of this after usning ndk to build... *

     
  • Anonymous

    Anonymous - 2012-01-31

    Originally posted by: vuthan...@gmail.com

    make: *** No rule to make target jni//webrtc/android_toolchain/../sources//modules/video_capture/main/source/Android.mk'. Stop. make: Leaving directory/buildcsip/CSipSimple' make: *** libraries Error 2

    I got this error. How can I fix it. Please help me Thanks!

     
  • Anonymous

    Anonymous - 2012-02-01

    Originally posted by: ryangho...@gmail.com

    jni//pjsip/android_toolchain/pjmedia/../../sources/pjmedia//src/pjmedia-codec/ffmpeg_codecs.c:1163: warning: 'avcodec_open' is deprecated (declared at jni//pjsip/android_toolchain/pjmedia/../../sources/pjmedia//../../../ffmpeg/ffmpeg_src/libavcodec/avcodec.h:3686) make1?: *** [obj/local/armeabi/objs/pj_video_android/src/pjmedia-codec/ffmpeg_codecs.o] Error 1 make1?: *** Waiting for unfinished jobs.... make1?: Leaving directory `/home/rayan/Desktop/check'

    Cant find the error for this !! OS = Ubuntu 11.04 , if encountered by anyone please share the solution .

     
  • Anonymous

    Anonymous - 2012-02-01

    Originally posted by: ajcpsoa...@gmail.com

    Hi ryan. I had two problems on ffmpeg_codecs.c (erros, not warnings), and my solution was to comment the lines where the error occurs.

     
  • Anonymous

    Anonymous - 2012-02-01

    Originally posted by: ryangho...@gmail.com

    Hi thanks for your advice , but where should i comment them ? , theses errors are shown in the terminal when i write make i need later on to copy them to eclipse and debug csipsimple , i would be really grateful if you would help thanks .

     
  • Anonymous

    Anonymous - 2012-02-01

    Originally posted by: r3gis...@gmail.com

    Guys, please, go on the developer group ! It's ways easier to share problems and last one at least was already replied (with a new zip ;) )!

    For ffmpeg pb, I guess that's something with the version of ffmpeg checked out try the "make update" command

     
  • Anonymous

    Anonymous - 2012-04-27

    Originally posted by: business...@gmail.com

    Ubuntu 12.04: also needed yasm and potential build-essentials

     
  • Anonymous

    Anonymous - 2012-05-03

    Originally posted by: hugh....@gmail.com

    when i building the native library,there are something wrong: make1?:***[build/x264/armeabi/lib/libx264.a] Error1 make:***[ext-lib] Error 2 How can i fix it?

     
  • Anonymous

    Anonymous - 2012-07-05

    Originally posted by: winkingk...@gmail.com

    Hi , I am learnning this project ,but svn checkout code is not the complete. I cann't find any code in CSipSimple\src\org\pjsip\ .What's the problem ,thanks a lot!

     
  • Anonymous

    Anonymous - 2012-08-19

    Originally posted by: gbat...@gmail.com

    Great work there guys, took a while to get it right and finally be able to import the vm but wow awesome, I am going through the wiki again this is great

     
  • Anonymous

    Anonymous - 2012-09-18

    Originally posted by: ascent.s...@gmail.com

    No rule to make target jni//swig-glue/android_toolchain/../nativesrc/pjsua_wrap.cpp', needed by obj/local/armeabi/objs/swig-glue/pjsua_wrap.o'. Stop. what is the solution of this after usning ndk to build Please give me solution

     
  • Anonymous

    Anonymous - 2012-09-24

    Originally posted by: ttlhu...@gmail.com

    Hi ! i am using Ubuntu 12.04 and try to compile or build CsipSimple? with this link 'http://code.google.com/p/csipsimple/wiki/HowToBuild' but it gives some problem

    please reply me as soon as possible.

    please see following logs:

    "make1?: Entering directory `/home/huyenttl/Desktop/CSipSimple/jni/zrtp4pj' Cloning into 'sources'... fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection refused

    /bin/sh: 2: cd: can't cd to sources fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git /bin/sh: 4: cd: can't cd to zsrtp Cloning into 'zrtp'... fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection refused

    /bin/sh: 6: cd: can't cd to zrtp fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git make1?: *** sources? Error 128 make1?: Leaving directory `/home/huyenttl/Desktop/CSipSimple/jni/zrtp4pj' make: *** [jni/zrtp4pj/sources] Error 2 "

     
  • Anonymous

    Anonymous - 2012-09-24

    Originally posted by: r3gis...@gmail.com

    Please join dev google group. Hard for me to reply here. In you case seems your PC is unable to checkout from github. (connection refused). Check your connection.

     
<< < 1 2 3 4 5 6 > >> (Page 4 of 6)

Log in to post a comment.