Steps to build 64-bit SolarisVoip.com Asterisk

Overview

This document outlines the steps required to build a 64-bit Asterisk, for the Solaris operating system, from the SolarisVoip.com SVN repository.

Certain Asterisk modules depend on Blastwave binaries and libraries, which are only available from Blastwave in 32-bit form. Because of this, those modules which depend on them are disabled or removed via the steps outlined below. Should you have 64-bit versions of these dependencies, you may utilize them by modifying the appropriate Makefile to enable them, but doing so is outside the scope of this document.

The steps outlined below have been tested on an AMD 64-bit system, without Zaptel and additionally on a SPARC system, without Zaptel. Both systems were running Solaris 10 U1. The SolarisVoip.com SVN repository was at revision 224.

SolarisVoip.com Zaptel

The Zaptel code from SolarisVoip.com does not build libpri or libtonezone as 64 bit libraries.
Therefore it is not possible to use them without recompiling them, which is outside the
scope of this document.

Prerequisites

You must have Subversion installed to access the source code repository at SolarisVoip.com. You may get Subversion from the Blastwave repository or any suitable location, including building it yourself.

Additionally, you must have the GCC compiler from Sun installed in /usr/sfw/bin


Steps to build a 64-bit SolarisVoip.com's Asterisk from SVN TRUNK

1. Change the PATH environment variable, so that GCC, Subversion, and supporting tools are available during the build.

BASH: export PATH=/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin:/opt/csw/bin

2. Checkout the SVN Asterisk trunk from SolarisVoip.com

svn co https://svn.sunlabs.com/svn/solaris-asterisk/asterisk/trunk asterisk-64bit

3. Move into the SVN checkout directory.

cd asterisk-64bit

4. Alter the main Asterisk Makefile to enable a 64-bit build

vi Makefile

Goto line 50 and change it from:

   OPTIMIZE+=-O6

To:

   OPTIMIZE+=-m64 -O6

Jump to line 406 and put the right 64-bit /usr/sfw/lib directory depending on your platform.

   SPARC processor: /usr/sfw/lib/sparcv9
   AMD and Intel: /usr/sfw/lib/amd64

Jump to line 409 and change it from:

   SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/opt/ssl/lib -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
   
To:

   SOLINK=-m64 -shared -fpic -L$(CROSS_COMPILE_TARGET)/opt/ssl/lib -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib

5. Alter the GSM codec, so it properly compiles: (Note: This isn't necessary on Sparc.)

vi codecs/gsm/src/preprocess.c

Jump to line 49 and change it from:

   #if defined(__sparc) || !defined(__sun)
   
To:

   #if defined(SOLARIS) || !defined(__sun)

6. Get rid of curl via CSW, because it isn't a 64-bit binary and will not link properly.

vi apps/Makefile

Goto line 73 and change it from:

   CURLLIBS=$(shell /opt/csw/bin/curl-config --libs)
   
To:

   CURLLIBS= # $(shell /opt/csw/bin/curl-config --libs)

7. Get rid of OGG/Vorbis format, because it isn't a 64-bit binary either.

vi formats/Makefile

Delete lines 25 through 30

8. Get rid of Postgres and SQLite CDR support, for the same reasons.

vi cdr/Makefile

Delete lines 107 through 112 (Removes SQLite)
Delete lines 65 through 70 (Removes Postgres)

9. Build the source code and create a development package, suitable for your usage.

gmake WITHOUT_ZAPTEL=1 dev-pkg

10. If you have made it this far without any errors, you should now have a PKG file available in SunOS-5.10-i86pc or a similarly named folder. Congratulations!


References

Solaris VoIP
http://www.solarisvoip.com/

Blastwave Repository
http://www.blastwave.org/


About the Author

Joseph Benden, Sr. is the owner of Thralling Penguin LLC. Thralling Penguin designs, develops, and extends software technologies for the most demanding business applications, as well as offering VoIP Consulting services.