How to compile
OpenH323 and PWLib 
on Solaris 9
Craig Southeren
Last updated 18 June 2004

Contents

Introduction
Prerequisites
Environment

Compiling
Installing
Running
Bison problems
Compile problems
Change history

Introduction

OpenH323 is capable of running on many Unix-like platforms due to an underlying multi-platform library called PWLib. While this library is supposed to compile "out of the box" for most common platforms, it can be difficult for some users to know what actions are required for some of the less common environments . 

This document describes the steps followed by the author between 23rd April and 10th May 2004 to get OpenH323 compiled and running under Solaris 9. The version of Solaris used was obtained under the Free Solaris Binary License Program, and an evaluation version of VMWare was used on a Windows 2000 host to avoid reconfiguring or purchasing new hardware. 

Prerequisites

The following packages must be downloaded and installed in order to compile OpenH323 on Solaris. These are all Open Source packages that can be downloaded in binary form from many different web sites, such as Sunfreeware.com

GNU gcc, version 2.95.x, version 3.2.x, 3.3.x or 3.4.0
GNU Make
GNU Bison (see note below)
GNU Flex

Installation of the following packages is recommended as they can be used by PWLib and OpenH323 to provide significant additional functionality

Expat XML library
OpenSSL 

Environment

The following components were used for this test:

gcc 3.3.2 package from Sunfreeware.com
make  3.80 package from Sunfreeware.com
bison 1.875 compiled from source, as described below
flex 2.5.31 package from Sunfreeware.com
expat 1.95.5 package from Sunfreeware.com
openssl 0.9.7d package from Sunfreeware.com
PWLib and OpenH323 CVS head revision as of 10 May 2004  

Compiling

PWLib and OpenH323 configured and compiled cleanly using both the "debug" and "opt" targets after resolving the following three issues (see below for additional information):

  1. The PATH must include the directory /usr/local/bin. 
  2. The LD_LIBRARY_PATH environment variable must contain the directory /usr/local/lib. Without this, configure fails as follows:

    checking for g++... g++
    checking for C++ compiler default output... a.out
    checking whether the C++ compiler works... configure: error: cannot run C++ compiled programs.
    If you meant to cross compile, use `--host'.
    See `config.log' for more details.

  3. The version of bison available from Sunfreeware.com did not work - see below for how this was resolved.

Installing

As of this date (10 May 2004) the install target does work as required on Solaris, but the installed files have problems relating to incorrect paths. This is a not a Solaris specific problem - the same problem exists on Linux. It is also important to use the GNU make when running install, which requires specifying the full path of make on the command line or putting /usr/local/bin into the PATH for root.

Running

The OpenH323 sample program openam was used for testing as it was preferred to avoid any problems that may have been caused by VMWare attempting to emulate the Sun audio hardware. The only problem encountered was that the LD_LIBRARY_PATH environment variable must include the OpenH323, PWLib and OpenSSL lib directories, as follows:


               /usr/local/lib:${HOME}/openh323/lib:${HOME}/pwlib/lib:/usr/local/ssl/lib

There were problems running openam on Solaris, but these matched similar problems on Linux and are attributed to the current state of the development code in the CVS

Bison problems

The quality of software from the Sunfreeware.com is usually excellent, but the bison-1.75 package for Solaris 9 on Intel did not work correctly during this test. When compiling PWLib, the following error occurred:  

gcc -DP_USE_PRAGMA -D_REENTRANT -I/usr/local/ssl/include -Wall -gstabs+ -D_DEBUG -DNDEBUG -I/home/craigs/pwlib/include -c ../common/getdate.tab.c -o /home/craigs/pwlib/lib/obj_solaris_x86_d/getdate.tab.o
gcc: ../common/getdate.tab.c: No such file or directory
gcc: no input files

The problem was fixed by removing precompiled bison-1.75 package, and compiling and installing the bison 1.875 direct from the GNU sources. This required the installation of GNU M4, as the M4 supplied with Solaris 9 cannot be used for this purpose. Note that this requires a PATH that has /usr/local/bin before /usr/bin,  work (after installing M4 as required by bison). With the new bison version installed, PWLib was able to compile cleanly.

Compile problems

  1. The attempt to compile "openam" on 23rd April 2004 under Solaris 9 failed due to link errors related to the IXJ driver. When the compile was next attempted (27 April) the problem had been fixed as part of an unrelated fix for OPAL
  2. The attempt to link "openam" on 27 April failed due to problems with the plugin codecs.  When the compile was atempted on 10 May 2004, these problems had been fixed.
  3. On 17 June 2004, two major changes were made that greatly improved the Solaris builds. The first was to change the the Makefiles to use "g++" rather than "ld" to link Solaris libraries and executables. This was the probable source of the ongoing problems with global statics not being initialised correctly. Secondly, the "attribute (( constructor ))" feature of gcc was used to ensure that all abstract factories are correctly instantiated when a shared library is loaded. This combination of changes means that Solaris builds now work reliably.

As of this date (18 June 2004) the only known problem with the Solaris build relate to link problems when creating static executable (make debugnoshared and make optnoshared)

Change History

18 June 2004 Craig Southeren Added section on final completion 
10 June 2004 Craig Southeren Renamed to "How to compile OpenH323 and PWLib on Solaris 9"
10 May 2004 Craig Southeren Checked and verified with latest plugin changes
27 April 2004 Craig Southeren Updated for latest CVS and additional information on compiling, running and installing
23 April 2004 Craig Southeren Initial version started

Copyright © 2003-2007 by Post Increment A.B.N 95 856 785 279
All Rights Reserved
All trademarks and copyrights on this page are owned by their respective owners.