Building PJSUA2
Table of Contents
The PJSUA2 C++ library is built by default by PJSIP build system. Standard C++ library is required.
The following sections applies to building SWIG Python, Java, or C# modules.
Common Requirements
On Linux/MacOS X/Unix, you need to build PJPROJECT with
-fPIC
option. You can either put it inuser.mak
file in root pjproject directory like this:CFLAGS += -fPIC
or you can specify it when calling ./configure:
./configure CFLAGS="-fPIC"
Then rebuild pjproject.
Install SWIG
For Debian based distributions (such as Ubuntu):
sudo apt-get install swig
For Windows and other platforms please see https://www.swig.org/download.html
Building Python SWIG Module
Install SWIG as shown above.
Install Python development package:
For Debian based distributions (such as Ubuntu):
sudo apt-get install python3-dev
For other platforms, TBD.
Build:
cd pjsip-apps/src/swig/python make make install
Note
The above will install the module to user’s
site-packages
directory.If you’re currently on a virtualenv, run
python setup.py install
instead.Test the installation:
$ python3 > import pjsua2 > ^Z
Building Java SWIG Module
Install SWIG as shown above.
Install JDK.
Build:
cd pjsip-apps/src/swig/java make make install
TBD.
Building C# SWIG Module
See ticket #2086 (Add C# binding using SWIG, and support for Xamarin).