Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 3 (modified by ahedges, 7 years ago) (diff)

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
OGRE 3D Graphics Engine 1.4 1.8.2
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
Boost libraries 1.35 1.49
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 Flight Gear. Sadly, I do not know how they compiled this framework.
LibOgg (not yet specified) 1.2.1
LibVorbis (not yet specified) 1.3.2
LibVorbisFile (not yet specified) 1.3.2 Comes with LibVorbis
ZLib (compression) (not yet specified) - Use Apple system version

Compiling Ogg and Vorbis

Remember: This is NOT an easy job!

Download and unzip the sources first from 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 <inttypes.h>
   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 <sys/types.h> // 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 i386" LDFLAGS="-arch i386" && make && sudo make install

next, enter the following lines:

cd ../libvorbis-1.3.2 && ./configure CFLAGS="-arch i386" LDFLAGS="-arch i386" && 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!