[Freeswitch-users] Compiling freeswitch for Dragonfly BSD

Vincent Stemen vince.freeswitch at hightek.org
Mon Jun 22 21:08:53 PDT 2009


Hi.

I have been searching for an alternative PBX to asterisk (which has not
been all that stable) to run on Dragonfly BSD.  I spent a fair amount of
time a couple months ago trying to compile freeswitch without success.

I have since tried Yate, but it consumes 85-95% of the cpu when idle
(not processing any calls).

I am considering revisiting freeswitch.  I have included below my notes
of all the various problems I encountered before, which ones I resolved
and how, up to the point where I left off.  I am in hopes of getting
feedback on whether any of the issues have been fixed or are planned to
be fixed and/or suggestions on getting it working.  Also, perhaps these
notes on my experiences will be helpful for the developers to improve
freeswitch.

Keep in mind that Dragonfly is a branch from Freebsd and stays fairly
compatible.  I am able to compile most software, that is ported to
FreeBSD, with few problems.

Here are my notes
=================

To compile on dragonfly BSD 1.10.1-RELEASE 
==========================================
I had to add -D__FreeBSD__ to CPPFLAGS
ln sh to bash or zsh
    because I got "unexpected operator" errors from "test" during configure
    with the bsd shell.
ln make to gmake
    Their scripts were calling make even though I ran the build 
    using gmake.
Must have apr-0.9.16.2.0.61 and apr-util-0.9.16.2.0.61 installed
    apr-0.xxx has headers, which freeswitch is including, that apr-1.xxx
    does not have.
    I sym-linked the apr-util libs from apr-util-1.2.8nb1 because 
    apr-util-0.9.16.2.0.61 was not available as a binary package.

The freeswitch-1.0.3.tar.gz release did not have bootstrap.sh, which is 
required for building from the svn repository.

Somebody on the #freeswitch IRC suggested I get it from the subversion
repository and run the bootstrap script.  bootstrap.sh is not in the
release.

==========================================
Tue Mar 31 00:12:37 CDT 2009 

I posted on the freeswitch mailing list asking about the compilation errors
Got no responses.

This first set of apr_... warnings turned out to clearly be from not having the
correct apr-util package installed, I should have gotten a response on the list
about it, considering it is a clear dependency that they do not directly
specify on the web site or the source docs.  apr-util is a dependency of
subversion.  They list SVN as a dependency of freeswitch, which is the utility
in the subversion package, not the package name.  svn should not be
a dependency to build from a release archive that is not retrieved from the svn
repository.

As it turns out, it had to be apr-util version 0.9.15.  See notes below.
==========================================

Tue Mar 31 22:22:58 CDT 2009

I tried the freeswitch-snapshot.tar.gz from the freeswitch site, which is
a 03/30/2009 snapshot from the svn trunk.

*concern*
It was nearly twice as big as the release for some reason.
    27016871 Mar 28 13:08 freeswitch-1.0.3.tar.gz
    52854882 Mar 31 18:25 freeswitch-snapshot.tar.gz

Running bootstrap.sh produced a bunch of these errors from automake:

Use of uninitialized value in exists at /usr/pkg/bin/automake line 4823, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/pkg/bin/automake line 4823, <GEN0> line 1.
automake: ####################
automake: ## Internal Error ##
automake: ####################
automake: unrequested trace `'
automake: Please contact <bug-automake at gnu.org>.
 at /usr/pkg/share/automake-1.10/Automake/Channels.pm line 570
        Automake::Channels::msg('automake', '', 'unrequested trace `\'') called at /usr/pkg/share/automake-1.10/Automake/ChannelDefs.pm line 191
        Automake::ChannelDefs::prog_error('unrequested trace `\'') called at /usr/pkg/bin/automake line 4823
        Automake::scan_autoconf_traces('configure.ac') called at /usr/pkg/bin/automake line 5046
        Automake::scan_autoconf_files() called at /usr/pkg/bin/automake line 781


==========================================
Thu Apr  2 20:51:44 CDT 2009

Going back to the 1.0.3 release.

I was getting a a bunch of apr_... warnings like

    Compiling src/switch_apr.c ...
    src/switch_apr.c: In function `switch_thread_self':
    src/switch_apr.c:74: warning: implicit declaration of function `apr_os_thread_current'
    src/switch_apr.c:74: warning: return makes pointer from integer without a cast
    ...
Then
    gmake[3]: *** [libfreeswitch_la-switch_apr.lo] Error 1

I finally got past that by installing apr-0.9.16.2.0.61 and apr-util-0.9.15.
I compiled apr-util-0.9.15 myself because it was not available as a binary
package.
Source files are including headers from apr-util-0.9.15 that do not exist in the 
binary package, apr-util-1.2.8nb1.tgz.

I also got past the "Cannot guess build type" error during configure by adding
"--build=i386" instead of having to use the uname wrapper to fake FreeBSD.

==========================================
New error: (This one is not the fault of freeswitch)

    Compiling src/switch_core.c ...
    src/switch_core.c: In function `switch_core_setrlimits':
    src/switch_core.c:795: error: `RLIMIT_AS' undeclared (first use in this function)

Turns out RLIMIT_AS is defined in /usr/include/sys/resource.h on some other
systems including FreeBSD but not Dragonfly.

It is used in the source like this
    #if !defined(__OpenBSD__) && !defined(__NetBSD__)
            setrlimit(RLIMIT_AS, &rlp);

It is defined in resource.h in FreeBSD like this
    #define RLIMIT_AS       RLIMIT_VMEM     /* standard name for RLIMIT_VMEM */

I created a patch for src/switch_core.c which fixed this error.

Since then, I discussed this on the Dragonfly BSD mailing list and it is
apparently going to be fixed on a future release of Dragonfly now that
they are aware of it.

==========================================
New error:

Tons of warnings like
    warning: return makes pointer from integer without a cast
(this needs cleaned up)

Then error'd with
    gmake[8]: *** No rule to make target `iptsec/libiptsec.la', needed by `libsofia-sip-ua.la'.  Stop.

I cd'd to libs/sofia-sip/libsofia-sip-ua/su
and ran make there.  It completed successfully in spite of the same warnings.

Then ran make again form the top.

Got further until

==========================================
New error:

    making all mod_spidermonkey
    cd config; gmake -j1 export
    cd pr; gmake -j1 export
    cd include; gmake export
    cd md; gmake export
    ../../../config/./nsinstall: cannot make symbolic link /u1/falcon/ports/freeswitch-1.0.3/work/freeswitch-1.0.3/libs/js/nsprpub/dist/include/nspr/.: File exists

Why would it be trying to make a sym-link of '.' ??

==========================================

Giving up for now.






More information about the FreeSWITCH-users mailing list