Compiling ScummVM/Mac OS X 10.2.8

From ScummVM :: Wiki
< Compiling ScummVM
Revision as of 16:08, 7 May 2008 by Fingolfin (talk | contribs) (→‎Bundle: changed ref pointing to Makefile to point to ports.mk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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)
  • After running make bundle, I get "Text::Wrap version >= 2001.0929 is required. You have 98.112902", so it needs to be updated

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 ports.mk 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.

Change sdl-config Path

Change

OSX_STATIC_LIBS := `sdl-config --static-libs`

to

OSX_STATIC_LIBS := `/usr/local/bin/sdl-config --static-libs`

Reason: It needs to be set to the correct path to find the file.

Make libfluidsynth Static

Add

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

after

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

Reason: If you compiled with libfluidsynth, it needs to be compiled in statically as well.

Make zlib Static

Add

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

after

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

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.

Add CoreAudio Framework

Add

-framework CoreAudio \

after

-framework CoreServices \

Reason: Corrects linker error with libfluidsynth.

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.