Recent Changes - Search:

Documents

Download

Building

Support

Wiki Stuff

edit SideBar

Building PTLib on MacOSX

Main.BuildingPTLibMacOSX History

Hide minor edits - Show changes to markup

Changed line 43 from:
   export PKG_CONFIG_PATH=${PTLIBDIR}:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig
to:
   export PKG_CONFIG_PATH=${PTLIBDIR}:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig:/opt/homebrew/opt/openldap/lib/pkgconfig
Changed line 43 from:
   export PKG_CONFIG_PATH=${PTLIBDIR}
to:
   export PKG_CONFIG_PATH=${PTLIBDIR}:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig
Changed line 40 from:
   export PTLIBDIR=$HOME/Work/ptlib
to:
   export PTLIBDIR=$HOME/Wherever/ptlib
Changed lines 28-29 from:
  brew install autoconf automake expat openssl openldap unixodbc lua v8 sdl2 ffmpeg gstreamer1-gst-libav imagemagick wxwidgets@3.0
to:
  brew install autoconf automake expat openssl openldap unixodbc lua v8 sdl2 ffmpeg gstreamer imagemagick wxwidgets@3.0
Changed lines 41-42 from:
   export DYLD_LIBRARY_PATH=${PTLIBDIR}/lib_Darwin_x86_64
   export PTLIBPLUGINDIR=${PTLIBDIR}/lib_Darwin_x86_64/devices
to:
   export DYLD_LIBRARY_PATH=${PTLIBDIR}/lib_Darwin_`uname -p`
   export PTLIBPLUGINDIR=${PTLIBDIR}/lib_Darwin_`uname -p`/devices
Changed lines 24-36 from:
  • The pkg-config package management tool. To install, you may either do the following:
    curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
    tar -xzvf pkg-config-0.23.tar.gz
    cd pkg-config-0.23
    ./configure
    make
    sudo make install
  • or (highly recommended) install macports from http://www.macports.org/install.php and execute
    sudo port install pkgconfig
to:
  • Install Home Brew from https://brew.sh
Changed line 28 from:
  sudo port install autoconf automake expat openssl openldap cyrus-sasl2 unixODBC ncurses lua libsdl2 ffmpeg-devel gstreamer1-gst-libav ImageMagick wxWidgets-3.0
to:
  brew install autoconf automake expat openssl openldap unixodbc lua v8 sdl2 ffmpeg gstreamer1-gst-libav imagemagick wxwidgets@3.0
Changed lines 39-54 from:
  sudo port install autoconf automake expat openssl cyrus-sasl2 unixODBC lua libsdl ffmpeg-devel

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

to:
  sudo port install autoconf automake expat openssl openldap cyrus-sasl2 unixODBC ncurses lua libsdl2 ffmpeg-devel gstreamer1-gst-libav ImageMagick wxWidgets-3.0

3. Buildling

Changed lines 49-72 from:

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.

to:

It is also necessary to set the DYLD_LIBRARY_PATH environment variable so that programs can find the PTLib libraries at link or run time. If you are using plugins, the PTLIBPLUGINDIR environment variable also must be set to the location of the compiled plugins. Finally, it is usually the case that pkg-manager needs to know where PTLib is too. Thus, typically it is:

   export PTLIBDIR=$HOME/Work/ptlib
   export DYLD_LIBRARY_PATH=${PTLIBDIR}/lib_Darwin_x86_64
   export PTLIBPLUGINDIR=${PTLIBDIR}/lib_Darwin_x86_64/devices
   export PKG_CONFIG_PATH=${PTLIBDIR}

Once this is done, you can build the system by simply going:

  cd $PTLIBDIR
  make
Changed lines 37-39 from:
  • Optionally
    sudo port install autoconf automake expat openssl cyrus-sasl2 unixODBC lua v8 libsdl ffmpeg-devel
to:
  • Optionally (also recommended for full functionality)
    sudo port install autoconf automake expat openssl cyrus-sasl2 unixODBC lua libsdl ffmpeg-devel
Changed line 39 from:
  sudo port install autoconf automake expat openssl cyrus-sasl2 unixODBC lua v8 libsdl libjpeg-turbo gstreamer1
to:
  sudo port install autoconf automake expat openssl cyrus-sasl2 unixODBC lua v8 libsdl ffmpeg-devel
Changed line 39 from:
  sudo port install autoconf expat openssl cyrus-sasl2 unixODBC lua v8 libsdl libjpeg-turbo
to:
  sudo port install autoconf automake expat openssl cyrus-sasl2 unixODBC lua v8 libsdl libjpeg-turbo gstreamer1
Changed lines 33-34 from:
  • or install macports from http://www.macports.org/install.php and execute
to:
  • or (highly recommended) install macports from http://www.macports.org/install.php and execute
Changed lines 39-40 from:
  sudo port install openssl
sudo port install cyrus-sasl2
to:
  sudo port install autoconf expat openssl cyrus-sasl2 unixODBC lua v8 libsdl libjpeg-turbo
Added lines 42-46:

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
June 04, 2010, at 11:53 AM by 220.101.81.246 -
Changed lines 24-25 from:
  • The pkg-config package management tool. To install, do the following:
to:
  • The pkg-config package management tool. To install, you may either do the following:
Changed lines 33-34 from:
  • GNU bison and flex must be installed (TODO: put in details of macports or fink packages)
to:
  • or install macports from http://www.macports.org/install.php and execute
    sudo port install pkgconfig
  • Optionally
    sudo port install openssl
    sudo port install cyrus-sasl2
April 08, 2010, at 04:54 AM by 115.64.157.126 -
Changed line 3 from:

This page describes how to build PTLib from revision 2.8.x (Sirius) as of 8 April 2010

to:

This page describes how to build PTLib revision 2.8.x (Sirius) or later as of 8 April 2010

Changed line 38 from:

As of this date (9 April 2010) compilation of the OSX-specific sound code generates multiple warnings at compile time on some OSX versions (Snow Leopard in particular).

to:

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).

April 08, 2010, at 04:52 AM by 115.64.157.126 -
Changed lines 38-40 from:
to:

As of this date (9 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.

Changed lines 51-53 from:
   For Linux x86 32 bit     ${PTLIBDIR}/lib_Darwin_x86
   For Linux x86 64 bit     ${PTLIBDIR}/lib_Darwin_x86_64
to:
   For OSX x86 32 bit     ${PTLIBDIR}/lib_Darwin_x86
   For OSX x86 64 bit     ${PTLIBDIR}/lib_Darwin_x86_64
April 08, 2010, at 04:50 AM by 115.64.157.126 -
Changed lines 13-14 from:

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

to:

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

April 08, 2010, at 04:49 AM by 115.64.157.126 -
Changed line 9 from:
  1. [[#Compiling|Compiling]
to:
April 08, 2010, at 04:47 AM by 115.64.157.126 -
Changed lines 9-10 from:

to:
  1. [[#Compiling|Compiling]
  2. Build and use without install
Changed lines 18-19 from:
to:

2. Prerequisites

Changed lines 36-37 from:
to:

3. Compiling

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 Linux x86 32 bit     ${PTLIBDIR}/lib_Darwin_x86
   For Linux 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.

April 08, 2010, at 04:42 AM by 115.64.157.126 -
Changed lines 3-5 from:

This page describes how to build PTLib from revision 2.8.0 (Sirius) or later. Earlier versions of PTLib had only partial MacOSX support.

to:

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

Changed lines 9-12 from:
to:
Changed lines 13-20 from:

PTLib is built from source using make and configure in the same way as most other Unix programs.

If you want to install PTLib into a shared location accessible by all users of the system (normally /usr/local), and you have root access, then you can use the default configure and install procedure Introduction described here.

If you want do not want to install PTLib into a shared location, because you do not have root access or because you want to have more than one version of PTLib on the same host, then follow this procedure.

to:

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.

Changed lines 18-21 from:

2. Prerequisites

You will need the following:

to:

You will need the following.

Deleted lines 24-27:
  • Download http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
  • Execute the following commands
Changed lines 34-138 from:
  • A copy of the PTLib source archive from the SourceForge download page or from Subversion. This is extracted into a directory referrred to as srcdir

3. Default build and install

By default, PTLib will install into the /usr/local tree. In order for other packages (including Opal) to locate PTLib, the directory /usr/local/lib/pkgconfig must be added to the search path for pkg-config. This is usually done by setting the PKG_CONFIG_PATH environment variable.

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.

If you are using plugins, the PTLIBPLUGINDIR environment variable must be set to the location of the installed plugins. By default, this is /usr/local/lib/ptlib-minor.major.patch, where minor.major.patch is the version of PTlib being used.

For bash/sh

  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  export LD_LIBRARY_PATH=/usr/local/lib
  export PTLIBPLUGINDIR=/usr/local/lib/ptlib-minor.major.patch

For tcsh/csh

  setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig
  setenv LD_LIBRARY_PATH /usr/local/lib
  setenv PTLIBPLUGINDIR /usr/local/lib/ptlib-minor.major.patch

Use the following command to build and install the release version (optimised) as a shared library

  cd srcdir
  ./configure
  make
  sudo make install

Use the following command to build and install the release version (optimised) as a static library

  cd srcdir
  ./configure --disable-shared
  make
  sudo make install

Use the following command to build and install the debug version (includes debugging symbols) as a shared library

  cd srcdir
  ./configure --enable-debug
  make debug
  sudo make install

Use the following command to build and install the debug version (includes debugging symbols) as a static library

  cd srcdir
  ./configure --enable-debug --disable-shared
  make debug
  sudo make install

Multiple versions can be built in the same directory tree and installed separately

3. 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 Linux x86 32 bit     ${PTLIBDIR}/lib_linux_x86
   For Linux x86 64 bit     ${PTLIBDIR}/lib_linux_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_linux_x86
   export PTLIBPLUGINDIR=${PTLIBDIR}/lib_linux_x86

For tcsh/csh

   setenv PTLIBDIR srcdir
   setenv LD_LIBRARY_PATH ${PTLIBDIR}/lib_linux_x86
   setenv PTLIBPLUGINDIR ${PTLIBDIR}/lib_linux_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.

4. Editing configure.ac, and running aclocal and autoconf

If you are developer, it may be necessary to modify the configure.ac file and regenerate the configure script using autoconf.

The following message may appear

  configure.ac:5: error: possibly undefined macro: dnl
        If this token and others are legitimate, please use m4_pattern_allow.
        See the Autoconf documentation.

If this occurs, then you need to regnerate the aclocal.m4 file by running the following command:

  aclocal

6. Notes for specific distributions

Ubuntu 9.04

to:

April 08, 2010, at 04:14 AM by 115.64.157.126 -
Changed line 37 from:
  @@curl http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz\\
to:
  @@curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz\\
April 08, 2010, at 04:12 AM by 115.64.157.126 -
Changed line 37 from:
  @@curl http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
to:
  @@curl http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz\\
April 08, 2010, at 04:12 AM by 115.64.157.126 -
Changed lines 35-37 from:
  • Execute the followng commands
    @@tar -xzvf pkg-config-0.23.tar.gz\\
to:
  • Execute the following commands
    @@curl http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz tar -xzvf pkg-config-0.23.tar.gz\\
Edit - History - Print - Recent Changes - Search
Page last modified on October 02, 2022, at 03:31 PM