HedgeroidGuide.wiki
changeset 213 a2be6fe1d509
parent 211 2aebd9de1a5e
child 298 9eb97ce0fec8
--- a/HedgeroidGuide.wiki	Tue Apr 03 09:35:20 2012 +0000
+++ b/HedgeroidGuide.wiki	Thu Apr 19 14:35:00 2012 +0000
@@ -15,6 +15,8 @@
 * [http://sourceforge.net/projects/p-tools/ p-tools] (Fixed freepascal compiler, read below which to download)<br>
 * [http://ant.apache.org/ Ant] (Linux distro should just use their package manager to get it, version isn't really important)<br>
 * Java compiler, make sure you get JDK (not JRE) version 6 and up
+* [http://www.cmake.org/ Cmake]
+* You will also need qt4 although this is not strictly required for the android build it is needed for the desktop frontend
 
 ==Hedgewars Source==
 
@@ -25,7 +27,7 @@
 
 ==Android SDK==
 
-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.
+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.2 / 4.0. 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.
 
 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.
 
@@ -45,13 +47,16 @@
 {{{emulator -avd <name>}}}
 where `<`name`>` is the same name as when you created it with the line above.
 
+Note when using ant:
+Ant needs a JDK, but tries to use a JRE sometimes (there is usually a separate JRE installation outside the JDK). If you get an error about missing tools.jar, make sure Ant is actually attempting to use the JDK. You can coax it to cooperate by setting the JAVA_HOME environment variable to point to the JDK directory.
+
 ==Android NDK==
 
 Download and untar it, ill refer to the ndk as `<`NDK`>`. That’s it :)
 
 ==!FreePascal ==
 
-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.~~ _Because of a bug in the latest fpc sources I recommend you download the p-tools repository/tar. In this link http://sourceforge.net/projects/p-tools/ find the directory fpc4android when I refer to `<`fpc`>` I mean this directory_. 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:
+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.~~ _Because of a bug in the latest fpc sources I recommend you download the p-tools repository/tar. Follow this link http://sourceforge.net/projects/p-tools/ and find the directory fpc4android in their source repository. Download a tarball and extract it to a new directory, which will be called '<'fpc'>' from now on._ 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:
 
 {{{
 make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=<ndk>/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin OPT=-dFPC_ARMEL BINUTILSPREFIX=arm-linux-androideabi- INSTALL_PREFIX=<fpc>/fpc_install
@@ -59,6 +64,7 @@
 
 Note: The flag CROSSBINDDIR points to the ndk/toolchain/../prebuilt/linux-x86/bin dir, change linux-x86 to your host machine, so for windows it would be 'windows' instead of linux-x86
 
+Note2: On windows use forward slashes so '/' not '\'
 ==Final==
 
 We will generate the Makefile.android, which is needed to compile hedgewars, download SDL and you’ll need to make sure cmake knows where all the compilers are
@@ -74,6 +80,21 @@
 
 (Check google on how to do it for your specific OS if you don't know how)
 
+for windows the PATH var should include this, mind the order:
+{{{
+    - %WINDIR%\System32 (for Java)<br>
+    - <CMake>\bin<br>
+    - <QtSDK>\mingw\bin<br>
+    - <QtSDK>\Desktop\Qt\4.8.0\mingw\bin<br>
+    - <fpc-win>\bin\i386-win32<br>
+    - <fpc-android>\compiler<br>
+    - <ndk><br>
+    - <sdk>\platform-tools<br>
+    - <ant>\bin<br>
+    - <mercurial> (directory containing hg.exe, TortoiseHg dir in my case)<br>
+}}}
+
+
 2.<br>
 Now we're gonna download sdl and a couple of its libraries, if you're on linux there's a script you can use
 {{{
@@ -83,7 +104,7 @@
 }}}
 This will download and unzip sdl to the expected folders
 
-TODO: make script for windows and verify if it works for osx
+On windows the script should work fine with Git Bash.
 
 
 3.<br>
@@ -93,6 +114,12 @@
 cd <hedgewars-root>
 cmake . -DANDROID=1
 }}}
+
+on windows you will need some extra arguments:
+{{{
+cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH="%CD%/misc/winutils/include" -DCMAKE_LIBRARY_PATH="%CD%/misc/winutils/lib" -DANDROID=1 .
+}}}
+
 And that’s it. To compile:
 
 {{{
@@ -106,4 +133,4 @@
 
 
 
-TODO verify that it works on Windows and OS X add dependency list of utilities (ant, fpc compiler for host, make etcetc)
\ No newline at end of file
+TODO verify that it works on OS X, is the depencency list complete now?
\ No newline at end of file