author | ovibalea@gmail.com |
Fri, 13 Jan 2012 20:28:47 +0000 | |
changeset 190 | 7199dc0aca2f |
parent 160 | 8196e13b5b61 |
child 199 | 2db424bc559b |
permissions | -rw-r--r-- |
119 | 1 |
#summary Instructions for building Hedgewars for Android |
2 |
= Hedgewars for Android = |
|
3 |
== Introduction == |
|
4 |
||
5 |
This guide will take you through the steps needed to succesfully compile Hedgewars for Android |
|
6 |
||
7 |
==Download== |
|
8 |
||
9 |
We need to download four packages: |
|
10 |
||
11 |
* [http://code.google.com/p/hedgewars/ Hedgewars Source]<br> |
|
12 |
* [http://developer.android.com/sdk/index.html Android SDK] (Latest version will do)<br> |
|
13 |
* [http://developer.android.com/sdk/ndk/index.html Android NDK] (current version is r5b but anything up will probably work)<br> |
|
14 |
* [http://freepascal.org/down/source/sources.var FreePascal] (Latest (stable) version will do)<br> |
|
15 |
* [http://www.libsdl.org/tmp/android-project.zip SDL]<br> |
|
16 |
* [http://www.lua.org/ftp/lua-5.1.4.tar.gz Lua] (Current version is 5.1.4 but anything higher will probably work)<br> |
|
160 | 17 |
* [http://ant.apache.org/ Ant] (Linux distro should just use their package manager to get it, version isn't really important)<br> |
158
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
18 |
* Java compiler, make sure you get JDK (not JRE) version 6 and up |
119 | 19 |
|
20 |
==Hedgewars Source== |
|
21 |
||
22 |
Using mercurial you can pull the hedgeroid branch using |
|
23 |
{{{ |
|
24 |
hg clone https://hedgewars.googlecode.com/hg/ hedgewars |
|
25 |
hg up hedgeroid |
|
26 |
}}} |
|
27 |
||
28 |
==Android SDK== |
|
29 |
||
30 |
Download the latest version using the link above. And unzip it at a place you can remember, I’ll refer to the location with `<`SDK`>`. Once you’ve unzipped/extracted the tar navigate to `<`SDK`>`/tools and execute ‘android’. This should bring up a GUI select ‘Available packages’, then ‘Android Repository’ and check atleast SDK Platform Android 1.6 / 2.1 / 2.2. I would recommend checking all of them, but it’s up to you. Next select ‘Install Selected’ press ‘Next’ a couple of times and you should have the SDK installed. |
|
31 |
||
158
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
32 |
Optionally you could permanently add `<`SDK`>`/platform-tools to your $PATH, this makes it easier to use ‘adb’. Adb is the main program to communicate with Android, think logging/pushing and pulling files/shell. |
119 | 33 |
|
34 |
If you do not have a real android device you can create an emulator if you do I’d skip this and continue at Android NDK |
|
35 |
||
36 |
You can use either the GUI, run android and follow the signs or from cli |
|
37 |
||
38 |
{{{android create avd -n <name> -t 4}}} |
|
39 |
-n is a name of your choice -t stands for the target ID |
|
40 |
||
41 |
See this for more information |
|
42 |
||
43 |
To run the emulator navigate to `<`SDK`>`/tools and run |
|
44 |
||
45 |
{{{emulator -avd <name>}}} |
|
46 |
where `<`name`>` is the same name as when you created it with the line above. |
|
47 |
||
48 |
==Android NDK== |
|
49 |
||
50 |
Download and untar it, ill refer to the ndk as `<`NDK`>`. That’s it :) |
|
51 |
||
122
8a5eb06794eb
Edited wiki page HedgeroidGuide through web user interface.
richarddeurtje@gmail.com
parents:
121
diff
changeset
|
52 |
==!FreePascal == |
119 | 53 |
|
54 |
We need to download the sources from the Freepascal website and compile the crosscompiler. I have grabbed the latest stable release 2.4.4 , though any version will work. Once downloaded, extract the tar/zip and place the files in a known directory. I will refer to the directory with `<`fpc`>` from now on. Next navigate to the `<`fpc`>` directory and compile it, for this various tools are needed, ‘make’ for instance. But also a fpc compiler for your system. Some apt-get/aptitude magic will solve these problems, make a comment if you run in to problems. Use this to compile the crosscompiler: |
|
55 |
||
56 |
{{{ |
|
57 |
make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=<ndk>/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin BINUTILSPREFIX=arm-linux-androideabi- OPT=-dFPC_ARMEL INSTALL_PREFIX=<fpc>/fpc_install |
|
58 |
}}} |
|
59 |
||
60 |
==Lua== |
|
61 |
||
62 |
For the missions hedgewars uses Lua as it’s scripting environment. Lua almost completely works out of the box only a few files need to be modified I’ve added these to the repo so all we need to do for now is download the tar.gz, extract and decompress the tar somewhere we’ll use it in the final step. |
|
63 |
||
64 |
||
65 |
||
66 |
==SDL== |
|
67 |
||
68 |
Last thing we need is SDL, download the android-project.zip from the link above. unzip/tar it to some location. and that’s it :) After the ‘FINAL’ step (after running cmake .) you can remove this directory if you want |
|
69 |
||
70 |
==Final== |
|
71 |
||
72 |
Next we will create the scripts to compile hedgewars and move SDL directories first you’ll need to make sure cmake knows where all the compilers are |
|
73 |
||
159 | 74 |
Add `<`NDK`>`:`<`SDK`>`/platform-tools:`<`FPC`>`/compiler to your path, on debian based system I would do it as follows: |
119 | 75 |
|
158
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
76 |
{{{ |
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
77 |
export PATH=$PATH:/home/xeli/SoftDev/android/ndk |
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
78 |
export PATH=$PATH:/home/xeli/SoftDev/android/sdk/platform-tools |
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
79 |
export PATH=$PATH:/home/xeli/SoftDev/android/fpc-2.4.4/compiler |
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
80 |
}}} |
119 | 81 |
|
158
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
82 |
(Check google on how to do it for your specific OS if you don't know how) |
119 | 83 |
|
84 |
Next you can use cmake to create the scripts |
|
85 |
||
86 |
{{{ |
|
87 |
cd <hedgewars-root> |
|
88 |
cmake . |
|
89 |
}}} |
|
90 |
And that’s it. To compile: |
|
91 |
||
92 |
{{{ |
|
93 |
cd <hedgewars-root>/project_files/Android-build/ |
|
158
3c2429fd0b51
updated to the current build process
richarddeurtje@gmail.com
parents:
122
diff
changeset
|
94 |
make -f Makefile.android |
119 | 95 |
}}} |
96 |
and it should be installed on your emulator/device if it was connected. |
|
97 |
||
98 |
On the device/emulator start the application up :) |
|
99 |
||
100 |
||
120
230afa501524
Edited wiki page HedgeroidGuide through web user interface.
richarddeurtje@gmail.com
parents:
119
diff
changeset
|
101 |
|
230afa501524
Edited wiki page HedgeroidGuide through web user interface.
richarddeurtje@gmail.com
parents:
119
diff
changeset
|
102 |
|
230afa501524
Edited wiki page HedgeroidGuide through web user interface.
richarddeurtje@gmail.com
parents:
119
diff
changeset
|
103 |
|
119 | 104 |
TODO verify that it works on Windows and OS X add dependency list of utilities (ant, fpc compiler for host, make etcetc) |