Building:Mac:SCons
From FIFE development wiki
Platform-dependent information: Mac.
The following passage contains information that is specific to PPC and Intel-x86-based Macintosh systems.
[edit] Introduction
BIG NOTE!!! FIFE now compiles on Snow Leopard(10.6). See this post for more information!
This guide explains how to compile FIFE on your PPC and Intel x86 Macintosh system with SCons.
[edit] What you need
- Development Tools
- 3rd party libraries (via MacPorts)
[edit] Getting started
In order to build FIFE you will have to install everything required to actually build the project.
- Download and install Xcode for your version of macOS:
- Go to Apple Developer Connection website. Downloads -> Developer Tools : browse for latest Xcode for you version (eg.10.x). - You need to be logged in (free account)
- Download and install MacPorts for your version (eg. 10.x).
- Install Scons (included in MacPorts). Type the following in a terminal window:
NOTE:If you already have SCons - you might have to run the (internal) update function on it, otherewise your packages will be out of date. It did not appear to be automatic.
NOTE: You don't need to use MacPorts if you are comfortable with compiling the required libraries from source on your own. Also, if you want more compatibility for older versions of Mac OSX you will have to switch the version of gcc you are using to 3.3 and install all the required libraries from source. Please see the NOTE at the bottom of this page for more info. As of writing this document MacPorts v1.5.0 is the newest and it can be downloaded from here. Installing it is as simple as double clicking on it and going through the install steps.
[edit] Build/Install the prerequisties
- SDL and frameworks
- Install boost and boost-jam:
- Install libogg and libvorbis:
- Install SWIG:
- Install Guichan
- To install guichan X11 you will need to grab your Mac OS install disc and launch the Optional Installs installer package and check the box to install X11 (Alternatively you can install the X11SDK from Xcode\Packages\Packages\x11SDK.pkg) After this step has been completed you can continue the install by running:
[edit] Obtain and build the engine
- If you do not already have subversion installed, install it using MacPorts
- Download the latest source from the svn repository
- If you need to change any of the include or library paths, edit the
build/darwin-config-dist.py file
- Build the engine by executing SCons. In the
trunk directory in the fife project directory type:
NOTE:Due to the ever-changing C++ ABI, the resulting binaries will only run on OS X versions compatible with the version of gcc you used during the build. For instance, if you build using gcc 4.0, then the resulting binaries will not run on OS X < 10.3.9. Depending on the version of MacPorts you used the binary you create will only be compatible with the version of Mac OS you are using. For better compatibility you will have to install all the required libraries from source and use gcc_select to change to gcc 3.3. Also remember, that the compiled binaries are specific to the architecture they were compiled on. I am working on build instructions for a Universal Binary which will run on both Intel and PPC Macs on OS X >= 10.2. For more information on ABI incompatibilities across OS X versions and Universal Binaries, please see the Apple Developer Connection site.
[edit] UnitTest++ (optional)
You can optionally install UnitTest++ using macports if you want to build FIFE's unit test programs. To install it type:[edit] Troubleshooting
- If you are getting a "wrong version" error from python (I got one importing fife or _fife) then you probably have python24 (or another olderversion) installed somewhere and the library is getting linked or otherwise incorporated. I removed python24 (I had both Fink and MacPorts versions!) and it worked fine. This error occurred at run time, after successful compile, but you have to rebuild with and then .

