- pkg-config (>= 0.22)
- Android NDK (tested: r10c)
- Android cross-compile toolchain (tested: arm-linux-androideabi-4.9)
- Create it via:
- ./build/tools/make-standalone-toolchain.sh \
- --platform=android-16 \
- --toolchain=arm-linux-androideabi-4.9 \
- --install-dir=$HOME/android/android-arm-toolchain
- Android SDK (tested: r23.0.2)
+Toolchain setup
+---------------
+
+You can use the script to install and setup the Android NDK,
+SDK, and the respective standalone toolchain:
+
+ $ ./sigrok-cross-android prepare
+
+This will install everything into $HOME/android.
+
+
Building
--------
set -e
+# The path where the NDK, SDK, and toolchains are located.
+ANDROID_PATH=$HOME/android
+
# The path where the Android NDK is located.
-ANDROID_NDK=$HOME/android/android-ndk-r10c
+ANDROID_NDK=$ANDROID_PATH/android-ndk-r10c
# The path where the Android SDK is located.
-ANDROID_SDK=$HOME/android/android-sdk-linux
+ANDROID_SDK=$ANDROID_PATH/android-sdk-linux
# The path where your Android toolchain directory is located.
-TOOLCHAIN=$HOME/android/android-arm-toolchain
-# TOOLCHAIN=$HOME/android/android-mipsel-toolchain
-# TOOLCHAIN=$HOME/android/android-i686-toolchain
+TOOLCHAIN=$ANDROID_PATH/android-arm-toolchain
+# TOOLCHAIN=$ANDROID_PATH/android-mipsel-toolchain
+# TOOLCHAIN=$ANDROID_PATH/android-i686-toolchain
# Select which Android toolchain to use.
# Don't forget to also adapt TOOLCHAIN above if you change TOOLCHAIN_TRIPLET!
VER_PYTHON=3.3.3
VER_BOOST=1.55.0
VER_QT=5.3.1
+VER_NDK=10c
+VER_SDK=23.0.2
SF_MIRROR=switch.dl.sourceforge.net
# -----------------------------------------------------------------------------
+# Get the Android NDK and SDK, install required packages and toolchains.
+if [ "x$1" = "xprepare" ]; then
+ mkdir -p $ANDROID_PATH
+ cd $ANDROID_PATH
+
+ # NDK
+ $WGET http://dl.google.com/android/ndk/android-ndk-r$VER_NDK-linux-x86.bin
+ chmod 700 android-ndk-r$VER_NDK-linux-x86.bin
+ ./android-ndk-r$VER_NDK-linux-x86.bin
+ cd android-ndk-r$VER_NDK
+ ./build/tools/make-standalone-toolchain.sh --platform=android-16 \
+ --toolchain=arm-linux-androideabi-4.9 \
+ --install-dir=$ANDROID_PATH/android-arm-toolchain
+ cd ..
+
+ # SDK
+ $WGET http://dl.google.com/android/android-sdk_r$VER_SDK-linux.tgz
+ tar xfz android-sdk_r$VER_SDK-linux.tgz
+ cd android-sdk-linux
+ ./tools/android update sdk --no-ui --filter platform-tools,build-tools-21.1.0,android-8,android-10,android-11,android-14,android-16
+ cd ..
+
+ exit
+fi
+
+# -----------------------------------------------------------------------------
+
# Remove build directory contents (if any) and create a new build dir.
rm -rf $BUILDDIR
mkdir $BUILDDIR