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 (unless you can find it hidden somewhere in your system; I've heard Apple bundles it with the development tools).
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
Now, you'll be patching configure itself.
sed -e 's/-lopenal//g' configure > configure.tmp && mv configure.tmp configure && chmod +x configure
At long last, you can run configure. (You will only need to specify more commandline arguments.)
./configure --with-apple-opengl-framework CPPFLAGS="-I." LDFLAGS="-framework OpenAL"
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.
If jam fails because it couldn't find parser.hpp, issue the following commands (renaming a file and continuing the build):
mv tools/miniswig/parser.cpp.h tools/miniswig/parser.hpp jam
So... with a portion of luck, 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. (For example, I will outline how to create a Mac OS X Application to simply pull over into your Applications folder on request.)