Friday 11 December 2009

Getting and building FreeSwitch (Part 1)

Time for some excitement. I'm all prepped. Beer on the desk. Let's go for it.

Going to play with the latest trunk. Dev's seem happier when people are on trunk ;) Is there any time that trunk is badly broken, or is it relatively stable ?

ok. Enough rambling. From the website (http://wiki.freeswitch.org/wiki/Installation_Guide#Obtaining_the_Source_Code)


svn checkout http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch


17:04 - and off it goes, downloading all the FS source goodness ;)
17:10 - done. Wow. Lot more source than Asterisk. Let's see what it does ...

Ok, need to bootstrap.


./bootstrap.sh


Actually, what does this do ? Is it the same as ./configure in Asterisk ? Can't seem to find any "this is what it does" on the web. Aha, looking at the source of bootstrap.sh, we have


 bootstrap: Build the support scripts needed to compile from a
#            checked-out version of the source code.

So, there you have it.

17:13 - Bootstrapping now ...

#1 is configure.ac:66: warning: AC_CANONICAL_BUILD invoked multiple times  a problem  ? ]
#2 got a couple of these  - is this a problem, or not ? Is there something I should be doing ?


configure.in: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.in: You should verify that configure.in invokes AM_INIT_AUTOMAKE,
configure.in: that aclocal.m4 is present in the top-level directory,
configure.in: and that aclocal.m4 was recently regenerated (using aclocal).

#3 configure.ac:84: warning: AC_LIBTOOL_SETUP was called before AC_LIBTOOL_WIN32_DLL

win32 ? on Linux ? Yikes ;)


17:22 - Done.

What now. Hmm.


./configure


Ooookkayyy. So what did bootstrap.sh do then ? Noob question, I know. Just trying to figure out the difference between the Asterisk and FS builds . Does Asterisk have the build scripts as part of the source, but FS builds the build scripts as it needs ? Anyhow, on with it ...

17:31 - ./configure
17:31 - done. Wow. A *lot* more work goes on here than in asterisk.

Heh. A quote from the website

"If you are unsure, leave this to the defaults. FreeSWITCH™ comes with a good set of modules as the default, until you become more familiar with FreeSWITCH™ it is advised that you not edit modules.conf."


Well, I'm going to build all of the modules - a good test for FS and me. :)


update: Mike from FS comments "generally do not recommend just building everything, for example, mod_alsa is a module written specifically for the n800 due to mod_portaudio not working there.  This module is barely touched and I would not use it unless you have a good reason to."


vi modules.conf. Ooo, need mod_curl, for sure . Ok, ignoring all mod_say_xx except for mod_en. And I'm not going to try the Experimental modules . I think that the comment "(don't cry if they're broken)" says it all ;)


Next step:

"If you intend on building mod_fax you may want to do the following to avoid some potential problems (once its stabilized the build system will automagically do this for you)"


So, is the build system stabilized, or not ? And how would I know ? As I'm building mod_fax, guess I'm going to have to take the risk and do the commands:



pushd libs/spandsp
 ./configure --prefix=/usr/local/freeswitch
 make all
 popd


Aw crap. Missing libtiff-devel.  yum install libtiff-devel. Start again :)

I am going to condense all of my findings into an easy howto. This is the "this is what happened when" blog ;)

WooHoo! Time for the big build !


make all install sounds-install moh-install


17:54 - Started

Mmmm. "Well's Bombardier Burning Gold" is going down very nicely, thankyouverymuch ;) (http://www.ratebeer.com/beer/wells-bombardier-burning-gold/71876/)

Oh crap. That sucks. I've just scrolled down to the the "Prerequisites"section. Surely this should be at the very top of the installation page, so we get to install all of the right packages *before* we start building. Yeah, yeah, I know - read the page before doing anything. As if ;)

Oh. Fail !


making all mod_alsa
Compiling /usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c...
mkdir .libs
Compiling /usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c ...
/usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c:38:28: error: alsa/asoundlib.h: No such file or directory
/usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c:114: error: expected specifier-qualifier-list before 'snd_pcm_t'


Need to install all Prerequisites now, just to check.

Onto Part 2

1 comment:

  1. Found some info:

    FreeSWITCH tries to leverage existing Open Source libraries and projects. Note that when a "make installall" is done, these are downloaded for you; you do not have to download and install them yourself (in fact even if you do, they are ignored).

    http://wiki.freeswitch.org/wiki/FreeSwitch_Dependencies

    ReplyDelete