Recent Changes - Search:





Wiki Stuff

edit SideBar

Building PTLib on MacOSX

This page describes how to build PTLib revision 2.8.x (Sirius) or later as of 8 April 2010 Earlier versions of PTLib had only partial MacOSX support and may required patches


  1. Introduction
  2. Prerequisites
  3. Compiling
  4. Build and use without install

1. Introduction

Building PTLib from source is almost to identical to building from source on other Unix platforms

There are additional prerequisites and OSX-specific features to be aware of.

2. Prerequisites

You will need the following.

If you see error messages about illegal macros, PKG_CONFIG and OPENSSL etc, then execute the following commands and try again:

  sudo cp /opt/local/share/aclocal/pkg.m4 /usr/share/aclocal
make distclean

3. Compiling

As of this date (8 April 2010) compilation of the OSX-specific sound code generates multiple warnings at compile time on some OSX versions (Snow Leopard in particular). This will be fixed at a later date.

4. Build and use without install

Set the PTLIBDIR environment variable to point to srcdir as follows. This allows other libraries that use PTLib to find the code without using pkg-config.

IMPORTANT: you must set the environment variable before executing the configure script or the system will get very confused.

It is also necessary to set the LD_LIBRARY_PATH environment variable so that programs can find the PTLib libraries at link or run time. The correct directory name depends on the host architecture:

   For OSX x86 32 bit     ${PTLIBDIR}/lib_Darwin_x86
   For OSX x86 64 bit     ${PTLIBDIR}/lib_Darwin_x86_64

If you are using plugins, the PTLIBPLUGINDIR environment variable must be set to the location of the compiled plugins. This will be the same directory as used above for the LD_LIBRARY_PATH

For bash/sh

   export PTLIBDIR=srcdir
   export LD_LIBRARY_PATH=${PTLIBDIR}/lib_Darwin_x86
   export PTLIBPLUGINDIR=${PTLIBDIR}/lib_Darwin_x86

For tcsh/csh

   setenv PTLIBDIR srcdir
   setenv LD_LIBRARY_PATH ${PTLIBDIR}/lib_Darwin_x86
   setenv PTLIBPLUGINDIR ${PTLIBDIR}/lib_Darwin_x86

Once this is done, configure and build the appropriate version of the code using the same commands as described in section 3 above, but omit the sudo make install

Note that it may be necessary to add /usr/local/lib to LD_LIBRARY_PATH and set PKG_CONFIG_PATH to /usr/local/lib/pkgconfig in order for other packages to be detected correctly.

Edit - History - Print - Recent Changes - Search
Page last modified on June 11, 2015, at 09:04 PM