Skip to content
lennax edited this page May 25, 2012 · 13 revisions

Compiling : Mac OSX

Note: If you need PPC support, see the Universal instructions below before starting.

Install Macports

http://www.macports.org/

Configure Macports

Set up Macports to automatically install framework variants.

sudo vi /opt/local/etc/macports/variants.conf

Add the following line to this file (ESC :wq to write and quit):

+universal

Fix port files

  • Fix libvpx Portfile to force darwin9 for ppc build
  • Fix libmng config.in file to remove outdated automake function call

Install dependencies

Macports

If you didn't set your variants for macports above, be sure to add +framework on the end of the port install command.

sudo port install tcl tk qt4-mac-devel OpenSceneGraph-devel +framework

OpenSceneGraph

The OpenSceneGraph-devel build will fail due to some corrupt dependencies, but it gets what is needed for the source build. Download the latest OpenSceneGraph source and build it. Make sure to set the flags to build statically.

Universal

Edit macports config

sudo vi /opt/local/etc/macports/macports.conf

Set universal architectures and the binary path for builds. The universal architectures lets us compile universal binaries supporting all mac platforms. The binpath tells macports to use the tools like gcc built by macports in preference to the ones found in /usr/bin :

universal_arches = i386 ppc x86_64
binpath = /opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

Edit macports variants file

This will modify your variants so by default they are universal and use frameworks.

sudo vi /opt/local/etc/macports/variants.conf

Set +universal and +framework as default variants.

+universal +framework