Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 884812c

Browse files
committed
[[ Android ]] Update dev build instructions
1 parent 052ae84 commit 884812c

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

docs/development/build-android.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,84 +16,84 @@ The main non-standard dependency needed for building LiveCode is a Java Developm
1616

1717
LiveCode requires both the Android Software Development Kit (SDK) and Native Development Kit (NDK). You can download both from the [Android Developers site](https://developer.android.com/sdk/index.html).
1818

19-
Extract both the NDK and SDK to a suitable directory, e.g. `~/android/toolchain`. For example, you would run:
19+
Extract both the NDK and SDK to a suitable directory, e.g. `~/android/toolchain`. For example, for the following values of `<host>`
20+
21+
- mac: `darwin`
22+
- linux: `linux`
23+
- windows: `windows`
24+
25+
you would run:
2026

2127
````bash
22-
mkdir -p ~/android/toolchain/android-sdk-linux
28+
mkdir -p ~/android/toolchain/android-sdk-<host>
2329
cd ~/android/toolchain
2430

25-
wget https://dl.google.com/android/repository/android-ndk-r15-linux-x86_64.zip
26-
wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
31+
wget https://dl.google.com/android/repository/android-ndk-r15-<host>-x86_64.zip
32+
wget https://dl.google.com/android/repository/tools_r25.2.3-<host>.zip
2733

28-
unzip android-ndk-r15-linux-x86_64.zip
34+
unzip android-ndk-r15-<host>-x86_64.zip
2935

30-
pushd android-sdk-linux
31-
unzip tools_r25.2.3-linux.zip
36+
pushd android-sdk-<host>
37+
unzip ../tools_r25.2.3-<host>.zip
3238
popd
3339
````
3440

3541
Update the SDK:
3642

37-
android-sdk-linux/tools/android update sdk --no-ui
43+
android-sdk-<host>/tools/android update sdk --no-ui
44+
45+
(This command will download and install every Android SDK and will take some time).
3846

39-
### Setting up the ARM toolchain
47+
### Creating the toolchains
4048

4149
Create a standalone toolchain (this simplifies setting up the build environment):
4250

4351
````bash
44-
android-ndk-r15/build/tools/make_standalone_toolchain.py \
45-
--arch arm --api 16 --deprecated-headers \
46-
--install-dir ${HOME}/android/toolchain/standalone
47-
```
52+
for arch in arm arm64 x86 x86_64; do
53+
android-ndk-r15/build/tools/make_standalone_toolchain.py \
54+
--arch ${arch} --api 21 --deprecated-headers \
55+
--install-dir ${HOME}/android/toolchain/standalone-${arch}
56+
done
57+
58+
**Note:** If you are only interested in building one particular flavour
59+
of Android engines, leave out the architectures you're not interested in
60+
from the above commands.
61+
62+
### Final toolchain setup
4863
4964
Add a couple of symlinks to allow the engine configuration script to find the Android toolchain:
5065
5166
````bash
5267
ln -s android-ndk-r15 android-ndk
53-
ln -s android-sdk-linux android-sdk
68+
ln -s android-sdk-<host> android-sdk
5469
````
5570
5671
## Configuring LiveCode
5772
5873
### Build environment
5974
60-
The Android build expects a large number of environment variables to be set. If the environment variables aren't set, the build process will attempt to guess sensible defaults. If you've set up the directory structure as described above, the make command should detect everything automatically and these variables shouldn't be necessary.
75+
The Android build expects a number of environment variables to be set. If the environment variables aren't set, the build process will attempt to guess sensible defaults. If you've set up the directory structure as described above, the make command should detect everything automatically and these variables shouldn't be necessary.
6176

62-
The following script will set up the environment variables correctly. You may need to edit it depending on where your JDK and ARM toolchain are installed:
77+
The following script will set up the environment variables correctly. You may need to edit it depending on where your JDK and toolchain are installed:
6378

6479
````bash
65-
ARCH=armv6
66-
TRIPLE=arm-linux-androideabi
67-
68-
TOOLCHAIN=${HOME}/android/toolchain # Edit me!
80+
ANDROID_TOOLCHAIN_DIR=${HOME}/android/toolchain # Edit me!
6981

7082
# Java SDK
71-
JAVA_SDK=/usr/lib/jvm/java-8-openjdk-amd64/ # Edit me!
72-
73-
# Build tools
74-
BINDIR=$TOOLCHAIN/standalone/bin
75-
COMMON_FLAGS="-target ${TRIPLE} -march=${ARCH}"
76-
77-
CC="${BINDIR}/${TRIPLE}-clang ${COMMON_FLAGS} -integrated-as"
78-
CXX="${BINDIR}/${TRIPLE}-clang ${COMMON_FLAGS} -integrated-as"
79-
LINK="${BINDIR}/${TRIPLE}-clang ${COMMON_FLAGS} -fuse-ld=bfd"
80-
AR="${BINDIR}/${TRIPLE}-ar"
83+
JAVA_SDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
8184

8285
# Android platform information
8386
ANDROID_NDK_VERSION=r15
8487
ANDROID_NDK_PLATFORM_VERSION=16
8588
ANDROID_API_VERSION=28
8689
ANDROID_PLATFORM=android-${ANDROID_API_VERSION}
87-
ANDROID_NDK=${TOOLCHAIN}/android-ndk-${ANDROID_NDK_VERSION}
88-
ANDROID_SDK=${TOOLCHAIN}/android-sdk-linux
89-
ANDROID_BUILD_TOOLS=27.0.3
90-
ANDROID_LIB_PATH=${TOOLCHAIN}/standalone/${TRIPLE}/lib
91-
92-
export JAVA_SDK
93-
export CC CXX LINK AR
94-
export ANDROID_PLATFORM ANDROID_NDK ANDROID_NDK_PLATFORM_VERSION
95-
export ANDROID_SDK ANDROID_BUILD_TOOLS
96-
export ANDROID_LIB_PATH ANDROID_API_VERSION
90+
ANDROID_NDK=${ANDROID_TOOLCHAIN_DIR}/android-ndk-${ANDROID_NDK_VERSION}
91+
ANDROID_SDK=${ANDROID_TOOLCHAIN_DIR}/android-sdk
92+
ANDROID_BUILD_TOOLS=28.0.3
93+
94+
export JAVA_SDK ANDROID_TOOLCHAIN_DIR
95+
export ANDROID_NDK_PLATFORM_VERSION ANDROID_API_VERSION
96+
export ANDROID_PLATFORM ANDROID_NDK ANDROID_SDK ANDROID_BUILD_TOOLS
9797
````
9898

9999
### Generating makefiles

0 commit comments

Comments
 (0)