Installation on OS X Alternatives

From FreeSWITCH Wiki
Jump to: navigation, search




This page and other OS X pages have had major update and were converted to Confluence April 28 2014, it will no longer be updated but is still accurate. The new page is located at: https://confluence.freeswitch.org/display/FREESWITCH/Installation+on+OS+X+Alternatives


_

Contents


Warning

If there are problems installing prerequisites check if the OS X release was upgraded, for instance from 10.7 to 10.8 or 10.8 to 10.9. Also check if Xcode was upgraded, for instance from Xcode 3 to 4, or 4 to 5. It was found that in some cases older upgraded systems had issues due to old parts of a prior OS X or Xcode still intact. In these cases a fresh OS X and Xcode install may required.


 

Warning

If prerequisites were previously installed using different methods and there are problems, you should build OS X from scratch. In tests, using Homebrew or the script below worked every time on freshly installed OS X systems.

 

Introduction

This page describes methods of installing FreeSWITCH™ and its prerequisites on OS X without using Homebrew as per the Installation and Setup on OS X guide. This is for people who do not want to use Homebrew or for packages not provided by Homebrew. The Homebrew method is highly recommended since it saves a lot of time, is easy to update, and very easy to remove packages.

If you’re installing packages for the first time please use Homebrew since it has worked every time for all OS X releases on this wiki.

This page is not updated as often as the main OS X wiki pages describing an installation using Homebrew.

The options currently illustrated here are:

  • A script to install FreeSWITCH™ and required prerequisites
  • Install Individual Packages
  • A configure file used to “make” everything


Minimum Required Packages for OS X

In order to build FreeSWITCH™ on OS X the following packages must be installed first:

  • autoconf - gnu autoconf utility.
  • automake - gnu automake utility.
  • libtool - gnu libtool utility. Starting with Lion Apple no longer ships automake with XCODE 4.3.
  • pkg-config - many build functions invoke pkg-config
  • libjpeg - Some FreeSWITCH™ functions invoke SPANDSP, which invokes LIBJPEG. FreeSWITCH™ provides SPANDSP source but not LIBJPEG source.
  • openssl - Starting Feb 2014 FreeSWITCH™ requires openssl. Old OS X releases contain openssl which is too old, new OS X releases have openssl deprecated.
  • curl - Starting Mar 2014 FreeSWITCH™ 1.4 requires libcurl. Previous releases contained this package as part of FreeSWITCH™ downloaded libraries.
  • pcre - Starting Mar 2014 FreeSWITCH™ 1.4 requires pcre. Previous releases contained this package as part of FreeSWITCH™ downloaded libraries.
  • sqlite - Starting Mar 2014 FreeSWITCH™ 1.4 requires sqlite. Previous releases contained this package as part of FreeSWITCH™ downloaded libraries.
  • speex - Starting Mar 2014 FreeSWITCH™ 1.4 requires libspeex. Previous releases contained this package as part of FreeSWITCH™ downloaded libraries.


Install Using A Script

The following script was  tested March 19, 2014  on OSX 10.9.2, 10.8.5, and 10.7.5. It assumes that the /usr/local and /usr/local/src directories exists and the proper ownership security set as per the OS X wiki. Using this script allows easy removal of FreeSWITCH™ and installed packages. Read the comments for instructions and prompts. Of course, you can also cut/paste lines to run parts of the script in Terminal if desired.

#!/bin/sh
# Tested on OS X 10.9.2, 10.8.5, 10.7.5 March 19 2014
#
# This script can be run asis or separated into multiple scripts, and/or edited for different directories, or run one line at a time.
# Example of how to use this script:
# 1. Create /usr/local and /usr/local/src as documented in the OS X install wiki page
# 2. Save this text on the Desktop as fsinstall.command
# 3. chmod +x ~/Desktop/fsinstall.command
# 4. Run command in terminal: . ~/Desktop/fsinstall.command
#
# Prompts:
# Installation of openssl and pcre will prompt for the admin password during make install
# Installing on OS X 10.7 script will pause prior to freeswitch make to allow removal of mod_v8 from modules.conf
#
echo "Installing autoconf ***************************"
cd /usr/local/src/
curl -4 -o autoconf-2.69.tar.gz http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar zxfv autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/usr/local
make
make install
make clean
cd ..
rm  autoconf-2.69.tar.gz
#
echo "Installing automake ***************************"
cd /usr/local/src/
curl -4 -o automake-1.14.tar.gz http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
tar zxfv automake-1.14.tar.gz
cd automake-1.14
./configure --prefix=/usr/local
make
make install
make clean
cd ..
rm  automake-1.14.tar.gz
#
echo "Installing libtool ***************************"
cd /usr/local/src/
curl -4 -o libtool-2.4.2.tar.gz http://gnu.mirror.constant.com/libtool/libtool-2.4.2.tar.gz
tar zxfv libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure --prefix=/usr/local --program-prefix=g
make
make install
make clean
cd ..
rm  libtool-2.4.2.tar.gz
#
echo "Installing pkg-config ***************************"
cd /usr/local/src/
curl -4 -o pkg-config-0.28.tar.gz http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar zxfv pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure --prefix=/usr/local --with-internal-glib
make
make install
make clean
cd ..
rm  pkg-config-0.28.tar.gz
#
echo "Installing jpeg ***************************"
cd /usr/local/src/
curl -4 -o jpegsrc.v8d.tar.gz http://www.ijg.org/files/jpegsrc.v8d.tar.gz
tar zxfv jpegsrc.v8d.tar.gz
cd jpeg-8d
./configure --prefix=/usr/local
make
make install
make clean
cd ..
rm  jpegsrc.v8d.tar.gz
#
echo "Installing openssl ***************************"
cd /usr/local/src/
curl -4 -o openssl-1.0.1g.tar.gz http://www.openssl.org/source/openssl-1.0.1g.tar.gz
tar zxfv openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
./configure --prefix=/usr/local/ darwin64-x86_64-cc
make
echo “—————————————————————---“
echo “— enter the admin password if requested --- “
echo “—————————————————————---“
sudo make install
make clean
cd ..
rm  openssl-1.0.1g.tar.gz
echo “—————————————————————--- openssl directory change:“
echo “— enter the admin password if requested to change owner of /usr/local/lib/pkgconfig --- “
echo “— /usr/local/lib/pkgconfig must not be root for curl & pcre to install into         --- “
echo “—————————————————————---“
sudo chown $USER:staff /usr/local/lib/pkgconfig
#
echo "Installing curl ***************************"
cd /usr/local/src/
curl -4 -o curl-7.35.0.tar.gz http://curl.haxx.se/download/curl-7.35.0.tar.gz
tar zxfv curl-7.35.0.tar.gz
cd curl-7.35.0
./configure --prefix=/usr/local
make
make install
make clean
cd ..
rm  curl-7.35.0.tar.gz
#
echo "Installing pcre ***************************"
cd /usr/local/src/
curl --remote-name ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.34.tar.gz
tar zxfv pcre-8.34.tar.gz
cd pcre-8.34
./configure --prefix=/usr/local
make
make install
make clean
cd ..
rm  pcre-8.34.tar.gz
#
echo "Installing speex ***************************"
cd /usr/local/src/
curl -4 -o speex-1.2rc1.tar.gz http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
tar zxfv speex-1.2rc1.tar.gz
cd speex-1.2rc1
./configure --prefix=/usr/local
make
make install
make clean
cd ..
rm  speex-1.2rc1.tar.gz
#
echo "Installing sqlite ***************************"
cd /usr/local/src/
curl -4 -o sqlite-autoconf-3080401.tar.gz https://sqlite.org/2014/sqlite-autoconf-3080401.tar.gz
tar zxfv sqlite-autoconf-3080401.tar.gz
cd sqlite-autoconf-3080401
./configure --prefix=/usr/local
make
make install
make clean
cd ..
rm  sqlite-autoconf-3080401.tar.gz
#
#
#
echo "Installing FreeSwitch ***************************"
cd /usr/local/src/
git clone git://git.freeswitch.org/freeswitch.git
cd freeswitch
./bootstrap.sh
./configure CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" 
OS_Version=$(sw_vers -productVersion | sed "s:.digit:*.$::g")
if [[ ${OS_Version} == 10.6 ]] || [[ ${OS_Version} == 10.7 ]]; then   # mod_v8 does not build in 10.6 and 10.7
 echo “—————————————————————————————————-“
 read -p "Comment mod_v8 in modules.conf, then press [Enter] key to continue…"
fi
make
make install
make cd-sounds-install cd-moh-install
make clean

Install Packages Individually

You can use the manual technique that requires locating, downloading and following instructions for each package. That requires several commands, knowledge about configuration, takes a lot of time, places programs in directories that are much harder to remove from, and harder to update. It didn't always go smoothly. When downloading, if there are multiple file extensions available, select the file ending in tar.gz if available. You should use the script above as a starting point. There are also examples on the old Installation on OS X 10.6 Snow Leopard page.

Warning

If you're thinking about installing using this method, then later try Homebrew…. STOP! Some methods may make it difficult to remove them, and Homebrew will not fully install packages it already finds on the system. That strategy has been tested and it caused many problems. If you want to proceed, make sure to have a backup of your system before manually installing packages!

 

Install Using Makefile

Please note this was not tested by me (Mario G) but was contributed by one of the developers. It may be of interest to some.
Since formatting a make file is tricky on the wiki the source can be found here. This provides the latest updates if the file is kept up-to-date by it’s author.

Cleanup

Delete installers, compressed files, and other files no longer needed.


MacPorts Packages

There are no plans to support MacPorts built prerequisites or FreeSWITCH™.