HedgeroidGuide.wiki
changeset 199 2db424bc559b
parent 160 8196e13b5b61
child 200 f56abd8cfc50
equal deleted inserted replaced
198:6ed8811347fc 199:2db424bc559b
     4 
     4 
     5 This guide will take you through the steps needed to succesfully compile Hedgewars for Android
     5 This guide will take you through the steps needed to succesfully compile Hedgewars for Android
     6 
     6 
     7 ==Download==
     7 ==Download==
     8 
     8 
     9 We need to download four packages:
     9 We need to download these packages:
    10 
    10 
    11 * [http://code.google.com/p/hedgewars/ Hedgewars Source]<br>
    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>
    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>
    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>
    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>
       
    17 * [http://ant.apache.org/ Ant] (Linux distro should just use their package manager to get it, version isn't really important)<br>
    15 * [http://ant.apache.org/ Ant] (Linux distro should just use their package manager to get it, version isn't really important)<br>
    18 * Java compiler, make sure you get JDK (not JRE) version 6 and up
    16 * Java compiler, make sure you get JDK (not JRE) version 6 and up
    19 
    17 
    20 ==Hedgewars Source==
    18 ==Hedgewars Source==
    21 
    19 
    55 
    53 
    56 {{{
    54 {{{
    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
    55 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 }}}
    56 }}}
    59 
    57 
    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==
    58 ==Final==
    71 
    59 
    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
    60 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 
    61 
    74 Add `<`NDK`>`:`<`SDK`>`/platform-tools:`<`FPC`>`/compiler to your path, on debian based system I would do it as follows:
    62 Add `<`NDK`>`:`<`SDK`>`/platform-tools:`<`FPC`>`/compiler to your path, on debian based system I would do it as follows:
    78 export PATH=$PATH:/home/xeli/SoftDev/android/sdk/platform-tools
    66 export PATH=$PATH:/home/xeli/SoftDev/android/sdk/platform-tools
    79 export PATH=$PATH:/home/xeli/SoftDev/android/fpc-2.4.4/compiler
    67 export PATH=$PATH:/home/xeli/SoftDev/android/fpc-2.4.4/compiler
    80 }}}
    68 }}}
    81 
    69 
    82 (Check google on how to do it for your specific OS if you don't know how)
    70 (Check google on how to do it for your specific OS if you don't know how)
       
    71 
       
    72 Now we're gonna download sdl and a couple of its libraries, if you're on linux there's a script you can use
       
    73 {{{
       
    74 cd <hedgewars-root>/project_files/Android-build
       
    75 chmod +x download_libs.sh (might not be needed)
       
    76 ./download_libs.sh
       
    77 }}}
       
    78 This will download and unzip sdl to the expected folders
       
    79 
       
    80 TODO: make script for windows and verify if it works for osx
       
    81 
    83 
    82 
    84 Next you can use cmake to create the scripts
    83 Next you can use cmake to create the scripts
    85 
    84 
    86 {{{
    85 {{{
    87 cd <hedgewars-root>
    86 cd <hedgewars-root>
    98 On the device/emulator start the application up :)
    97 On the device/emulator start the application up :)
    99 
    98 
   100 
    99 
   101 
   100 
   102 
   101 
   103 
       
   104 TODO verify that it works on Windows and OS X add dependency list of utilities (ant, fpc compiler for host, make etcetc)
   102 TODO verify that it works on Windows and OS X add dependency list of utilities (ant, fpc compiler for host, make etcetc)