Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 2 (modified by youngk, 13 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.

Configure Flags

For a list of all possible configure flags, run ../configure —help. The following are common ones:

Configure Flag Description
--enable-universal_binary Gives you a universal binary running on ppc and i386 OS X variants.
--with-macosx-version-min For specifing the minimal supported OS X version, eg. —with-macosx-version-min=10.4.
--with-macosx-sdk For specifing which SDK you want to build against, the maximum system whose API you want to benefit from, ie it can run on newer systems, but newer APIs would not be used, eg —with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk.
--enable-debug Build the library with debug support (recommended for development phase of your product)
--disable-shared Builds static libraries. (note: Linking your own applications against dynamic libraries is quicker than against static ones.)(note 2 : do not combine with monolithic)

Compiler Flags

Compiler and Linker Flag Description
-arch Set both the CFLAGS and the LDFLAGS variable to the desired architecture, i.e. i386, ppc, ppc64, x86_64

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!