1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
Building the ScummVM Android port
=================================
You will need these things to build:
1. Android EGL headers and library
2. Android SDK
3. An arm-android-eabi GCC toolchain
In the example commands, we are going to build against the Android 1.5
native ABI (but using the Android 1.6 SDK tools). Other version
combinations might/should be possible with a bit of tweaking.
In detail:
1. Android EGL headers and library
You can build these from the full Android source, but it is far easier
to just download the 3 Android EGL headers from here:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=opengl/include/EGL;hb=HEAD
(copy them to a directory called "EGL" somewhere)
... and grab libEGL.so off an existing phone/emulator:
adb pull /system/lib/libEGL.so /tmp
2. Android SDK
Download and install somewhere.
3. arm-android-eabi GCC toolchain
You have several choices for toolchains:
- Use Google arm-eabi prebuilt toolchain.
This is shipped with both the Android source release and Android NDK.
The problem is that "arm-eabi-gcc" can't actually link anything
successfully without extra command line flags. To use this with the
ScummVM configure/build environment you will need to create a family
of shell wrapper scripts that convert "arm-android-eabi-foo" to
"arm-eabi-foo -mandroid".
For example, I use this script:
#!/bin/sh
exec arm-eabi-${0##*-} -mandroid -DANDROID "$@"
... and create a family of symlinks/hardlinks pointing to it called
arm-android-eabi-gcc, arm-android-eabi-g++, etc. For tools that don't
take a "-mandroid" argument - like arm-eabi-strip - I bypass the shell
wrapper and just create an arm-android-eabi-strip symlink to the tool
directly.
- Build your own arm-android-eabi toolchain from GCC source.
This is lots of fun. I suggest my Android openembedded patches, see:
http://wiki.github.com/anguslees/openembedded-android/
(You just need to have lots of disk space and type a few commands)
If you get stuck, ask
Alternatively, do a websearch - there are several other cross-compile
toolchains around.
Building ScummVM
================
Apply the theme engine patch:
patch -p1 < backends/platform/android/scummvm-android-themeengine.patch
(Optionally) compress scummmodern.zip:
(ScummVM usually ships it uncompressed, but Android can read it more
efficiently if it is compressed *before* adding it to the apk)
( cd gui/themes/scummmodern && zip -f ../scummmodern.zip )
Then build ScummVM:
export ANDROID_SDK=<root of Android SDK>
PATH=$ANDROID_SDK/platforms/android-1.6/tools:$ANDROID_SDK/tools:$PATH
# You also want to ensure your arm-android-eabi toolchain is in your $PATH
export ANDROID_TOP=<root of built Android source>
EGL_INC="-I<location of EGL/ header directory>"
EGL_LIBS="-L<location of libEGL.so>"
CPPFLAGS="$EGL_INC" \
LDFLAGS="-g $EGL_LIBS" \
./configure --backend=android --host=android --enable-zlib #and any other flags
make scummvm.apk
This will build a "monolithic" ScummVM package, with the engines
statically linked in. If you want to build separate engine packages,
like on the market, add "--enable-plugins --default-dynamic" to
configure and also make scummvm-engine-scumm.apk, etc.
|