= Mac OS X Dependencies = In order to get the orxonox dependencies to build properly on the Mac, some tricks are needed. This page will contain some or more important tidbits for compiling various dependencies on the Mac. == General Considerations == Build all libraries as 64-bit-only dynamic libraries or frameworks (fat binaries would also work, but we only need the 64 bit part). LLVM/Clang (the default Xcode compiler) uses a different standard c++ library than gcc (libc++ instead of libstdc++, they are not binary compatible). So make sure that all dependencies are linking against libc++. === Useful Tools === To see what libraries the .dylib is linking against use: {{{ otool -L libsomething.dylib }}} To change the library install name or the locations of libraries it links against, use the install_name_tool (see the man page for details). With {{{ otool -hv libsomething.dylib }}} you can check the header (useful for determining if you have a 64-bit or a fat binary). To find which symbols the library defines use nm: {{{ nm libsomething.dylib }}} == Dependency List == || Library name || Minimum Version || Recommended Version || Notes || || [http://www.ogre3d.org/ "OGRE 3D Graphics Engine"] || 1.4 || 1.8.2 || || || [http://www.cegui.org.uk/wiki/index.php/Main_Page "CEGUI (Crazy Eddie's GUI System)"] || 0.5 || 0.7.9 || We need: CEGUI.framework, CEGUILuaScriptModule.framework and ceguitolua++.framework. Plus, disable all ppc architectures || || [http://www.boost.org/ "Boost libraries"] || 1.35 || 1.49 || || || [http://www.lua.org/ "Lua (scripting language)"] || 5.0 or 5.1 || 5.1.4 || Hint: Use the patchfile located in the Tools directory of the dependency package. ($patch -p1 -i patchfile) inside source dir. But preferentially use the Lua version shipped with CEGUI || || Tcl (shell script language) || 8.4 or 8.5 || - || Use Apple system version || || OpenAL (audio) || (not yet specified) || - || Use Apple system version || || ALUT (audio) || (not yet specified) || - || Can't be compiled on Apple. Use the package included in dependency package or consult [http://wiki.flightgear.org/index.php/FlightGear_Git_on_Mac_OS_X#Install_the_ALUT.framework "Flight Gear"]. Sadly, I do not know how they compiled this framework. || || [http://www.xiph.org/vorbis/ "LibOgg"] || (not yet specified) || 1.2.1 || || || [http://www.xiph.org/vorbis/ "LibVorbis"] || (not yet specified) || 1.3.2 || || || [http://www.xiph.org/vorbis/ "LibVorbisFile"] || (not yet specified) || 1.3.2 || Comes with LibVorbis || || ZLib (compression) || (not yet specified) || - || Use Apple system version || Apple Mac OS X uses the following library paths: * /usr * /usr/local * /opt/local (MacPorts source distribution: [http://www.macports.org/ MacPorts]) * /sw (Fink binary distribution: [http://www.finkproject.org/ Fink]) * /Library/Frameworks (for Apple frameworks; dynamically linked and self-contained structures. See [http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/ CFBundles] for information.) * ~/Library/Frameworks * /System/Library/Frameworks * /Developer/Library/Frameworks === Compiling Ogre === Download the prebuilt SDK from the website. Make sure you have all the needed libraries installed (zlib, zziplib, freetype, and freeimage, you can use Homebrew to install them). Use cmake to create the Xcode project (`mkdir build && cd build && cmake .. -G Xcode`). Check the output of the cmake script to verify that it found all the needed libraries. Open the Xcode project. Set the deployment target to 10.8 and the Base SDK to 10.12. Then in the build settings make sure that it builds only the 64 bit version and uses libc++. Then it should compile and give you the Ogre.framework. === Compiling CEGUI === Compiling CEGUI is a bit tricky. '''Compiling the dependencies''': If you have to compile CEGUI 0.7 download the dependency package for 0.8. Modify the cmakefile that it compiles all dependencies by default (change all the options to have `TRUE` at the end). Build everything with cmake (`cmake . && make -j8`) Also make sure you already have compiled Ogre.framework, you'll need that later. '''Compiling the CEGUI''': like above, make sure you have all the needed libraries installed and use cmake to generate the Xcode project. Also like with ogre change the deployment target, base sdk, target architecture and c++ std library. For everything to compile correctly you have to take the libraries that are shipped with the project and replace them with the dependencies you compiled earlier. You also have to set the path to ogre, to get CEGUIOgreRenderer to work. Note that for all the libraries to find each other you might have to change some install names with `install_name_tool` (see above). === Compiling Ogg and Vorbis === Remember: This is NOT an easy job! Download and unzip the sources first from [http://www.xiph.org/vorbis/ "Xiph.org"]. Outside of libogg-1.2.1, create a directory {{{lib_build}}}. Open the file os_types.h in {{{libogg-1.2.1/include/ogg/os_types.h}}} and replace the following lines {{{ #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ # include typedef int16_t ogg_int16_t; typedef u_int16_t ogg_uint16_t; typedef int32_t ogg_int32_t; typedef u_int32_t ogg_uint32_t; typedef int64_t ogg_int64_t; }}} with: {{{ #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ # include // used wrong header file typedef int16_t ogg_int16_t; typedef u_int16_t ogg_uint16_t; typedef int32_t ogg_int32_t; typedef u_int32_t ogg_uint32_t; typedef int64_t ogg_int64_t; }}} Open up the Terminal (/Applications/Utilities/Terminal), and enter the following set of commands (assuming that you have downloaded ogg and vorbis to {{{yourname/Downloads}}} (you need to enter your password during the following sequences): {{{cd Downloads/libogg-1.2.1 && ./configure CFLAGS="-arch x86-64" LDFLAGS="-arch x86-64" && make && sudo make install}}} next, enter the following lines: {{{cd ../libvorbis-1.3.2 && ./configure CFLAGS="-arch x86-64" LDFLAGS="-arch x86-64" && make && sudo make install}}} Finally, you need to delete the ogg and vorbis files in your Orxonox dependency package (Just delete everything with the names ogg and vorbis in them). They are locaded in: {{{dependencies/include and dependencies/lib}}} That's it - now you can follow the normal building steps. If building works out for you, then please send us an e-mail with the lib_build folder as a zip file attached!