Changes between Version 232 and Version 233 of AndroidPort


Ignore:
Timestamp:
Feb 15, 2012, 10:55:44 AM (12 years ago)
Author:
Anders Feder
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AndroidPort

    v232 v233  
    163163Google publishes a [http://developer.android.com/sdk/ndk/index.html Native Development Kit] (NDK), which is a set of tools for building native applications for the Android platform. Unfortunately, the official NDK does not and will not support the `std::wstring` (wide characters) datatype, which is required by the game, so we'll have to use the unofficial [http://www.crystax.net/android/ndk.php Crystax NDK]. This is merely an extension of the official NDK, adding support for wide characters and other features maligned by Google.
    164164
    165 Currently, the port of the Boost C++ Libraries that we use require us to use the !r5 version of the NDK. Download the package from [http://www.crystax.net/da/android/ndk/5 this page] to the working directory and then unpack there, e.g.:
    166 
    167 {{{
    168 $ cd ~/android
    169 $ tar -xvf android-ndk-r5-crystax-2-linux-x86.tar.bz2
     165Download the latest release from [http://www.crystax.net/en/android/ndk this page] to the working directory and then unpack there, e.g.:
     166
     167{{{
     168$ cd ~/android
     169$ tar -xvf android-ndk-r7-crystax-4-linux-x86.tar.bz2
    170170}}}
    171171Now use the NDK to set up a standalone toolchain:
    172172
    173173{{{
    174 $ ~/android/android-ndk-r5-crystax-2/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$HOME/android/toolchain
     174$ ~/android/android-ndk-r7-crystax-4/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$HOME/android/toolchain
    175175}}}
    176176You also must install a Java Development Kit (JDK) if you haven't already, e.g. [https://apps.ubuntu.com/cat/applications/oneiric/default-jdk/ the standard JDK from Ubuntu Software Center]:
     
    201201{{{
    202202$ SDK=$HOME/android/android-sdk-linux/
    203 $ NDK=$HOME/android/android-ndk-r5-crystax-2
     203$ NDK=$HOME/android/android-ndk-r7-crystax-4
    204204$ TOOLCHAIN=$HOME/android/toolchain
    205205$ SYSROOT=$TOOLCHAIN/sysroot
     
    217217$ cd MysticTreeGames-Boost-for-Android-70838fc
    218218}}}
     219Apply [http://www.wildfiregames.com/forum/index.php?showtopic=15436&view=findpost&p=234163 this patch] somehow.
     220
    219221Then execute the following command to download the Boost C++ Libraries package and compile it for the target device:
    220222
    221223{{{
    222 $ ./build-android.sh $NDK
     224$ ./build-android.sh $TOOLCHAIN
    223225}}}
    224226Copy the resulting headers and library files into the `usr` directory in the toolchain's sysroot:
     
    227229$ cp -r build/* $SYSROOT/usr/
    228230}}}
     231Fix some weird path issue:
     232
     233{{{
     234$ mv $SYSROOT/usr/include/boost-1_45/boost $SYSROOT/usr/include
     235}}}
     236
     237
    229238Spidermonkey is designed to build against an older version of the NDK than that of our main compiler toolchain. Download [http://ftp.mozilla.org/pub/mozilla.org/mobile/source/android-ndk-r4c-0moz3.tar.bz2 Mozilla's own toolchain] to the working directory and then unpack it there, e.g.:
    230239
     
    272281$ make install
    273282}}}
    274 Set up the environment for cross-compiling using the standalone toolchain:
     283Finally, hand-edit the mozjs185.pc file to remove the requirement for NSPR somehow.
     284
     285Set up the environment for cross-compiling using the main standalone toolchain:
    275286
    276287{{{