This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.
User:RavuAlHemio/Mac OS X compilation
So you've decided to compile SuperTux on Mac OS X. It's a bit less error-prone than compiling on Windows, so just follow these instructions and you should get it up and running (optionally as a universal binary) in just about no time.
While this document describes how to make use of the OpenGL and OpenAL frameworks that are included with Mac OS X, it tells you how to get SDL compiled and installed UNIX-style (/usr/include and /usr/lib). If you wish to use the SDL framework available on its website, you will have to do some things differently. (This is where Linux programming knowledge is useful.)
This guide also makes you compile SuperTux UNIX-style; you will use the Terminal instead of Xcode. Since it also describes exclusive use of GCC 4.0, your build will only run on versions ≥ Tiger. (Search the web to find out how to use GCC 3 for the PPC build.)
Quite a few instructions here imply you have already found your way around the terminal. If you haven't, you may wish to search for a few tutorials to become more proficient.
Installing the development tools
Insert your Mac OS X installation CD into your DVD-ROM drive. In the window that opens, double-click on Xcode Tools and then on XcodeTools.mpkg. Continue through the installation wizard until you come to the Installation Type section. Here, click Customize. A successful constellation only requires Developer Tools Software, gcc 4.0, the Software Development Kits and the Mac OS X 10.4 (Universal) SDK (from under Cross Development). Keep on clicking yourself through the wizard until said tools are installed.
Building the libraries
You will need the following libraries to run SuperTux:
Most of the time, the triplet
./configure --prefix=/usr && make && sudo make install (supplying your own password when asked for it) is enough.
Since SuperTux uses jam as its building tool, you'll need to download and compile that too. (Apple bundles it with the development tools, but their version is somehow defective, so you're better off getting a clean distribution from Perforce.)
First, download the archive (either in zip or uncompressed tar format) from the Perforce FTP server. Then, extract the files into a directory of your choice, enter it via the Terminal and run
make. When everything is done, copy the resulting jam binary from build.x86 or build.ppc to /usr/bin (e.g.
sudo cp build.x86/jam /usr/bin/) and you're all set.
Getting Subversion and downloading SuperTux
To download the development version of SuperTux, you'll need Subversion. You can either download precompiled disk images or compile the source yourself using the triplet introduced above. Once this is done, follow the directions in the article Download/Subversion.
In the Terminal, switch to the directory you have checked out SuperTux into. Then, run the following command to generate the configure script:
If you don't get any answer and find yourself back at the command prompt, everything should have gone well. Next, you will have to do a nice hack: link the header files for OpenGL and OpenAL so that SuperTux can find them. This hack is awesomely stupid. Just issue the following commands:
ln -s /System/Library/Frameworks/OpenAL.framework/Headers/ AL ln -s /System/Library/Frameworks/OpenGL.framework/Headers/ GL
At long last, you can run configure. (You will only need to specify more commandline arguments.)
./configure --with-apple-opengl-framework CPPFLAGS="-I."
Now, at long last, you can run the command that will compile everything.
This will take forever, so grab a coffee or other beverage, play a game of chess, whatever.
When the build process is completed and you are feeling lucky, the following command will start SuperTux and make your life complete:
This should have done the trick. If something is too unclear or you think I haven't added enough detail, please alert me on this article's talk page and I will do my best to improve this document.
I am on a bit of a hiatus right now (June 2007), but once I return, I will tweak the build system to optionally create a Finder-launchable SuperTux application. Stay tuned.