Difference between revisions of "Compiling ScummVM/Mac OS X 10.2.8"

From ScummVM :: Wiki
Jump to navigation Jump to search
m (corrected one linker error)
m (corrected another linker error)
Line 3: Line 3:
= Problems =
= Problems =
* kyra uses a lot of templates, and gcc 3.1 can't handle it, so I had to disable it (<tt>--disable-kyra</tt>)
* kyra uses a lot of templates, and gcc 3.1 can't handle it, so I had to disable it (<tt>--disable-kyra</tt>)
* When making the bundle, I get linker errors complaining about an "illegal reference to symbol" and "defined in indirectly referenced dynamic library".
* When making the bundle, I get several undefined symbols related to <tt>/bin/sh: sdl-config: command not found</tt>
** <tt>backends/libbackends.a(quicktime.o) illegal reference to symbol: _CloseComponent defined in indirectly referenced dynamic library /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore</tt>


= Getting a Compiler =
= Getting a Compiler =
Line 118: Line 117:
  -framework CoreMIDI \
  -framework CoreMIDI \
Reason: Corrects linker error.
Reason: Corrects linker error.
   
 
=== Add CoreService Framework ===
Add
  -framework CoreServices \
after
-framework CoreFoundation \
Reason: Corrects linker error.
 
=== Other ===
Change
$(OSX_STATIC_LIBS) \
to
$(OSX_STATIC_LIBS)
Reason: Can cause errors while compiling.
 
 
 
'''TODO''' (See [[Compiling_ScummVM/MacOS_X_10.2.8#Problems|Problems]])
'''TODO''' (See [[Compiling_ScummVM/MacOS_X_10.2.8#Problems|Problems]])



Revision as of 17:31, 17 August 2007

So, I'm going to attempt to document how I was able to compile ScummVM on my 10.2.8 laptop*. However, if you don't have 10.2.8, I recommend you check out the cross compiling page.

Problems

  • kyra uses a lot of templates, and gcc 3.1 can't handle it, so I had to disable it (--disable-kyra)
  • When making the bundle, I get several undefined symbols related to /bin/sh: sdl-config: command not found

Getting a Compiler

So, as you may or may not know, you need gcc to compile gcc. Yes, it's one of those loopholes in life. So, we have to get the precompiled XCode from Apple. So, go to their developer site and sign up. Then, go to downloads, Development Tools, and way down at the bottom should be the December 2002 development tools for 10.2.8. That's the one you want. So, download it and install it. However, once it's installed, don't delete it as you may have to install it again**.

Getting the Libraries

There is no really specific order except: SDL must be compiled before libmpeg2, libogg must be compiled before libvorbis libogg must be compiled before flac

Let's start with the one I had most trouble with:

SDL

First off, we need to get the 1.2.8 version of SDL. Nothing higher than that compiles on 10.2.8 (it's broken currently). If you try to compile higher than 1.2.8, for example 1.2.12, it will give you a whole bunch of warnings about "__VEC__" before some errors.

Then, as long as you have 1.2.8, you should be ok. But, I wasn't***

Run:

./configure
make install

zlib

Zlib is included with the developer tools, but it's too old to be used with ScummVM. So, download the zlib 1.2.3 source and run:

./configure
make install

libmad

Download libmad 0.15.1b. Run

./configure
make install

libogg/libvorbis

Download libogg 1.1.3 and libvorbis 1.2.0. Run (in libogg):

./configure
make install

And, then the same for libvorbis. libogg must be compiled first.

flac

Download flac 1.2.0. Run:

./configure
make install

libmpeg2

Download the libmpeg2 0.4.1 source. As with the other libraries, run

./configure
make install

There will be errors found, but it will turn off the preprocessing mode and compile fine, so don't worry about it.

libfluidsynth

Download the libfluidsynth source. Run

./configure
make install

nasm

Download the nasm 0.99.01 source. Run

./configure
make install

Just ignore the 100's of warnings you will get ;)

Configuring Configure

Assuming you already compiled SDL, we need to point ScummVM in the right direction. Open up configure in your favorite text editor and change the _sdlpath="$PATH" to _sdlpath="/usr/local/bin".

Compiling ScummVM

If you just want the engines that are enabled always just run (see Problems about kyra):

./configure

However, for other ones (such as Lure, CruisE, and Drascula) run:

./configure --enable-lure --enable-cruise --enable-drascula

After that is run, make sure that all the libraries you installed appear on the text that Terminal should spit out at you.

Executable Only

Just run

make

To use this, just drag it into the Terminal and hit enter.

Bundle

We have to modify the makefile a bit, so open it up

Change Library Path

Change

OSXOPT=/sw

to

OSXOPT=/usr/local

Reason: Fink puts the installs there, but we compiled from scratch, so they're in a different folder.

Make zlib Static

Add

OSX_STATIC_LIBS += $(OSXOPT)/lib/libz.a

after

ifdef USE_MPEG2
OSX_STATIC_LIBS += $(OSXOPT)/lib/libmpeg2.a
endif

Reason: zlib should be compiled statically to be used on all systems


Remove

-lz

Reason: We're compiling zlib statically, not dynamically.

Remove SystemStubs

Remove

-lSystemStubs

Reason: Not needed, and not in 10.2.8

Add CoreFoundation Framework

Add

-framework CoreFoundation \

after

-framework CoreMIDI \

Reason: Corrects linker error.

Add CoreService Framework

Add

-framework CoreServices \

after

-framework CoreFoundation \

Reason: Corrects linker error.

Other

Change

$(OSX_STATIC_LIBS) \

to

$(OSX_STATIC_LIBS)

Reason: Can cause errors while compiling.


TODO (See Problems)

Notes

* Your results may vary
** Sometimes the installer "forgets" to install key components to the compiler (you may get a strange error during a configure after trying to find the compiler's default output). If so, just reinstall it.
*** It complained that I was missing some x11 files. If this happens to you, download xfree86 source part 1. After extracting it, go to the include folder, and copy it's contents to a /usr/include/x11 as well as copying Xlib.h from the bin/x11 folder to /usr/include/x11.