Building FreeSWITCH on OpenSolaris os2008.11 for fun and profit

Posted in OpenSolaris, OpenSource, freeswitch on March 13th, 2009 by Michal Bielicki

This is basically a redo of my Building FreeSWITCH on Nevada post with changes for os2008.11 and probably latest Nevada as well added. Be sure to follow the CBE parts or you will have problems. Trust me, I had them !

So lets start. I assume you are using your nice already role added user for building, than you can skip the following. Otherwise, read on.

  • Select your development user. I will assume for the time being that the user is called freeswitch.
  • Create the target directory for freeswitch
mkdir /opt/freeswitch; chown freeswitch /opt/freeswitch
  • Give your build and development user software installation rights
usermod -P "Software Installation" freeswitch

* log out and log back in as the freeswitch user (so that the new permissions become active)

* download and unpack the new jds-cbe beta package:

wget http://dlc.sun.com/osol/jds/downloads/cbe/test/desktop-cbe-1.7.0-rc1-x86.tar.bz2
gtar xvfj desktop-cbe-1.7.0-rc1-x86.tar.bz2

Install the following packages if they are not already installed:

pfexec pkg install SUNWgawk SUNWgm4 SUNWant SUNWaconf SUNWgnu-automake-110 \
SUNWbison SUNWgnu-coreutils SUNWcvs SUNWsvn SUNWgnu-diffutils SUNWflexlex \
SUNWgsed SUNWgnu-gettext SUNWlibtool SUNWgmake ss-dev SUNWrsync SUNWTiff \
SUNWgnutls SUNWsfwhea SUNWhea SUNWxwinc SUNWxorg-headers

Install Desktop-CBE

cd desktop-cbe-1.7.0-rc1
./cbe-install

* leave everything as default. Select the SunStudio compiler as your default compiler. Don’t choose to install gnome and kde tools unless you want to compile those later.

* Download the spec-files-extra repository into a subdirectory called SFE

svn co https://pkgbuild.svn.sourceforge.net/svnroot/pkgbuild/spec-files-extra/trunk SFE

* Load the jds-cbe environment

. /opt/dtbld/bin/env.sh

* Compile and install SFEunixodbc

cd SFE
pkgtool --download build SFEunixodbc.spec

* Download freeswitch trunk

svn co http://svn.freeswitch.org/svn/freeswitch/trunk fstrunk

* Prepare the freeswitch sources

cd fstrunk; ./bootstrap.sh

* and edit the modules.conf file to select which modules you would like to have installed

vim modules.conf

* Configure freeswitch sources for 64bit and let the c compiler apply some optimization

CFLAGS="-g -m64 -I/usr/sfw/include -L/usr/sfw/lib" \
CXXFLAGS="-g  -m64 -I/usr/sfw/include -L/usr/sfw/lib" \
LDFLAGS="-m64 -L/usr/sfw/lib -R/usr/sfw/lib" \
./configure --prefix=/opt/freeswitch \
--enable-core-odbc-support --enable-core-libedit-support \
--enable-64 --with-openssl=/usr/sfw --disable-visibility

* or for 32bit

CFLAGS="-g -m32 -I/usr/sfw/include -L/usr/sfw/lib" \
CXXYFLAGS="-g -m32 -I/usr/sfw/include -L/usr/sfw/lib" \
LDFLAGS="-m32 -L/usr/sfw/lib -R/usr/sfw/lib" \
./configure --prefix=/opt/freeswitch \
--enable-core-odbc-support --enable-core-libedit-support \
--with-openssl=/usr/sfw --disable-visibility

* Drink a cup of coffee

* run make :)

gmake

* Install freeswitch into its target directory

pfexec gmake install

You are done :)

If you want soundfiles, check which quality you want. I usualy do this:

pfexec gmake uhd-sounds-install

and

pfexec gmake uhd-moh-install

One of those days I will finish my SFE package than it will be even easier :)

Technorati Tags: Freeswitch, opensolaris, telephony, voip, solaris

Tags: , , , , ,