Configuring a build environment on Mac OS X

Post Reply
Site Admin
Posts: 77
Joined: Wed Mar 24, 2010 2:19 pm

Configuring a build environment on Mac OS X

Post by rotunda »

Compared to what you need to do on Windows, this is straightforward :-)

1. First, you will need to install a compiler. It can be downloaded for free from .
As a result, you should get something like this when you run "gcc -v" in the terminal emulator:

Code: Select all

mac:~ user$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Other requirements:
- macports
and install the following: autoconf automake

- XQuartz (for X11 devel files)

2. Download SDL libraries from and install them in /Library/Frameworks

Apparently it is necessary to copy all SDL-related header files to /usr/local/include/SDL.
Then copy the entire directory to /Library/Frameworks/SDL_ttf.framework/Headers.

3. Download OpenAL from ... Items.aspx and install it in /Library/Frameworks

EDIT: it appears the OpenAL package is in 32bit version only, so in a 64bit environment we need to build our own. I have not figured out how to build openal and alut as frameworks, so this tutorial will show the traditional Unix way.

We begin by downloading the source code for both openal and alut from ... Items.aspx
Uncompress openal:

Code: Select all

tar xjvf openal-soft-1.13.tbz2
In the file openal-soft-1.13/CMakeFileLists.txt add SET(LIBTYPE STATIC) before the line IF(NOT LIBTYPE)
(if anyone known a better way, preferably directly from the command line, to force a static build, please tell me)

Build and install openal:

Code: Select all

cd openal-soft-1.13/build
cmake ..
sudo make install
Uncompress and build alut:

Code: Select all

tar zxvf freealut-1.1.0.tar.gz
cd freealut-1.1.0
sudo make install
The libraries and headers will be in /usr/local/lib and /usr/local/include/AL, respectively.
Post Reply