Open main menu

Difference between revisions of "Compiling ScummVM/iPhone"

342 bytes removed ,  07:14, 13 September 2008
no edit summary
Line 5: Line 5:


=== Toolchain ===
=== Toolchain ===
First, you'll need to set up the [http://code.google.com/p/iphone-dev/ toolchain]. We recommend 0.3 (which is the newest version at time of writing), any other and you might have to do some manual modifications to the build process.
First, you'll need to set up the [http://www.saurik.com/id/4 toolchain]. Earlier versions than the one linked will NOT work.


Important: If you want to compile the ARM ASM optimizations for SMUSH and sound (and otherwise you'll have to manually change the configure script to remove them), you'll have to apply a patch to the toolchain before compiling/installing it (so it can handle our asm files).
=== External libs ===
Then, set up any of the external libs you might want. Meaning libMAD for MP3 playback, libFLAC for FLAC support and/or Tremor for Ogg support. You can add mpeg2dec as well, but it's only used for MPEG2 BS1/2 cutscene support and you really should be using the DXA versions instead (can be downloaded from [http://scummvm.org/downloads.php ScummVM's download page].
 
Note that you only need to add these if you need support for those filetypes. ScummVM itself will run fine without them.


Download the patch [http://worldsmainorganization.org/scummvm/index.php?dir=iphone%2F&download=iphone-toolkit-scummvm-1.patch here].
The below script should usually do the trick for these:
export SDKROOT=<your toolkit directory>
export SYSROOT="$SDKROOT/sys"
export BUILDENV="$SDKROOT/pre"


Apply it in the iphone-dev directory like so:
  export FDIR="$SYSROOT"
  patch -p0 < iphone-toolkit-scummvm-1.patch


This patch simply allows ".ifdef" statements to appear in the assembly source files, and won't affect the toolchain in any other way (the .ifdef will automatically evaluate to false at the moment).
export CC="$BUILDENV/bin/arm-apple-darwin9-gcc -v"
export CXX="$BUILDENV/bin/arm-apple-darwin9-g++"
export LD=$CC


=== External libs ===
export SHAREDOPTS="-isysroot $SYSROOT -fobjc-abi-version=2 -I$SDKROOT/include"
Then, set up any of the external libs you might want. Meaning libMAD for MP3 playback, libFLAC for FLAC support and/or Tremor for Ogg support. You can add mpeg2dec as well, but it's only used for MPEG2 BS1/2 cutscene support and you really should be using the DXA versions instead (can be downloaded from [http://scummvm.org/downloads.php ScummVM's download page].
export FRAMEWORKS="-F$FDIR/System/Library/PrivateFrameworks/ -F$FDIR/System/Library/Frameworks/"
export LDFLAGS="-L$BUILDENV/arm-apple-darwin9/lib/ $FRAMEWORKS $SHAREDOPTS -bind_at_load -lobjc"


Note that you only need to add these if you need support for those filetypes, ScummVM will run fine without them.
export CXXFLAGS="-I$SYSROOT/usr/include $SHAREDOPTS"
export OBJCFLAGS="-I$SYSROOT/usr/include/ $SHAREDOPTS --std=c99"


The below script is what I use to configure these libraries:
export CFLAGS="$CXXFLAGS"


#!/bin/bash
  export AS=$SDKROOT/pre/bin/arm-apple-darwin9-as
  export CC='/usr/local/bin/arm-apple-darwin-gcc -v'
export CXX='/usr/local/bin/arm-apple-darwin-g++'
export LD=$CC
export LDFLAGS="-L/usr/local/arm-apple-darwin/lib/ -Wl,-lstdc++,-lgcc_s.1"
./configure --host=arm-darwin --prefix=/usr/local/arm-apple-darwin/


After that, 'make' and 'make install' should do the trick.
./configure --host=arm-darwin --prefix=$SDKROOT/sys/
make && make install


=== ScummVM ===
=== ScummVM ===
64

edits