Compile Freeswitch for Mac

To successfully compile and run freeswitch on Mac OS X Lion, the steps listed on http://wiki.freeswitch.org/wiki/Installation_on_OS_X_10.8_Mountain_Lion needs some modifications.

First, make sure you have gcc (by installing XCode) and GNU make tools (by installing thru mac ports or brew).

Then pull the freeswitch source from its git repo:


git clone git://git.freeswitch.org/freeswitch.git


Then get into the directory where you pulled freeswitch. Then do:

bootstrap.sh

Then:

configure

I got trouble here because the freeswitch configure script will fail to find the libjpeg even after i installed it thru brew or macports.

So I downloaded the libjpeg installed from http://ethan.tira-thompson.com/Mac_OS_X_Ports.html and installed libjpeg from it. The freeswitch configure script recognized it.

But then another problem occured. The configure script failed because many warnings are treated as errors.

So I opened the configure script and deleted the following:


  if test "x$SWITCH_AM_CFLAGS" = "x"; then
    test "x$silent" != "xyes" && echo "  setting SWITCH_AM_CFLAGS to \"-Werror\""
    SWITCH_AM_CFLAGS="-Werror"
  else
    apr_addto_bugger="-Werror"
    for i in $apr_addto_bugger; do
      apr_addto_duplicate="0"
      for j in $SWITCH_AM_CFLAGS; do
        if test "x$i" = "x$j"; then
          apr_addto_duplicate="1"
          break
        fi
      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to SWITCH_AM_CFLAGS"
        SWITCH_AM_CFLAGS="$SWITCH_AM_CFLAGS $i"
      fi
    done
  fi

I ran the configure script again this time successfully. Then, sudo make, sudo make install. This will install the freeswitch into /usr/local/freeswitch.


make cd-sounds-install cd-moh-install


Then, freeswitch is ready for testing. Username 1000 until 1009 are automatically created with password 1234.

0 komentar:

Posting Komentar