Building openc2e on OS X
From ccdevnet
These instructions are for 10.4. They are not finished yet, just fuzzie's notes. This did work for me, though (but I can't do regular/useful builds, sorry). If you just want a binary to play with then ask fuzzie for one.
Contents |
Requirements
You need at least Xcode 2.5 (probably best to go for Xcode 3 on 10.5).
Install these from the official disk images: cmake, Qt 4, SDL, SDL_ttf, SDL_net.
Build re2c from source. On at least 10.4, you also need to build bison from source.
boost
You need to build boost from source. At least version 1.34 is required. We require the following libraries right now: 'thread', 'iostreams', 'serialization', 'program-options', 'regex', 'system' and 'filesystem'. We also use at least the following header-only libraries: 'format', 'variant', 'tokenizer', 'array' and 'smart-ptr'.
It is probably easier to just download and build 1.34.1, because for boost 1.35 and above, you need to do something like the below in order to build it, to make sure you get the appropriate .a files out. bjam is the boost build tool, you can build it by running ./configure or by following the instructions on the boost site.
./tools/jam/src/bin.macosxppc/bjam --toolset=darwin --build-type=complete
After that you run it under sudo and with 'install' at the end to do the install bit.
SDL_gfx
You need to build SDL_gfx from source.
Extract the 'OSX-PB.tgz' and the 'OSX-PB-XCode.zip' files from 'Other Builds'. Copy the extracted directories 'SDL_gfx.pbproj' and 'PB/English.lproj' to the main SDL_gfx directory with all the .c files in.
Then, open SDL_gfx.pbproj in Xcode (it'll convert it for you), select the 'Deployment' setup from the combobox at the top, click 'Build', and then copy the resulting 'build/Deployment/SDL_gfx.framework' framework to /Library/Frameworks (using Finder or sudo).
fuzzie is hoping to provide a downloadable copy as soon as she can make a Universal Binary version.
Building
Now you can build openc2e in the normal way - go to the openc2e source, 'mkdir build', 'cd build', '/Applications/CMake\ 2.6-0.app/Contents/bin/cmake ..', 'make'.
At the moment we do NOT have OpenAL working on OS X (Apple suck), so before you run make you'll need to do '/Applications/CMake\ 2.6-0.app/Contents/bin/ccmake ..', go to OPENAL_USE_OPENAL, hit enter to edit, type 'NO', hit enter again, press 'c' to configure, and then 'g' to generate and exit.
Distribution notes
Your distribution will only work on your OS X version or newer (10.5-built openc2e will not work on 10.4) and for your architecture (powerpc or Intel). It is possible to build it Universal: be sure to build SDL_gfx and boost as universal (not easy), comment out all the endian stuff in the cmake file (it doesn't work when cross-compiling), and set cmake to build both architectures.
You have to make an openc2e.app folder, and put the openc2e binary in openc2e.app/Contents/MacOS. You need to make sure to run 'strip openc2e' on that binary first, if you don't want it to be huge.
You need to copy all the frameworks (SDL, SDL_net, SDL_ttf, SDL_gfx, QtCore, QtGui) from /Library/Frameworks into openc2e.app/Contents/Frameworks.
QtGui needs the path to QtCore changed (run this once, from openc2e.app/Contents/Frameworks/QtGui.framework/Versions/4):
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore QtGui
openc2e needs the path to both QtGui and QtCore changed (run this every time you rebuild, against the openc2e binary):
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore openc2e install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui openc2e
