diff options
author | Joakim Bygdell <j.bygdell@gmail.com> | 2015-07-20 11:13:00 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-20 05:52:11 -0700 |
commit | 7baa18db5fe33f5797e4603a4c2efafc6b474bd0 (patch) | |
tree | da48b8cf70bcfce15ffa16136a4cc998ff184626 | |
parent | 6608b4c7a93c1901af510b9937dc620bc36cf29a (diff) | |
download | subsurface-7baa18db5fe33f5797e4603a4c2efafc6b474bd0.tar.gz |
Enable Android build on Mac
This Changes the NDK, SDK, JAVA_HOME and ant to the appropriate versions
and locations when the script runs on a Mac.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | packaging/android/build.sh | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/packaging/android/build.sh b/packaging/android/build.sh index b9565ea67..c0d1031ac 100644 --- a/packaging/android/build.sh +++ b/packaging/android/build.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e - +PLATFORM=$(uname) # (trick to get the absolute path, either if we're called with a # absolute path or a relative path) pushd $(dirname $0)/../../ @@ -8,9 +8,15 @@ export SUBSURFACE_SOURCE=$PWD popd # Configure where we can find things here export ANDROID_NDK_ROOT=$SUBSURFACE_SOURCE/../android-ndk-r10e -export ANDROID_SDK_ROOT=$SUBSURFACE_SOURCE/../android-sdk-linux export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.5 -export ANDROID_NDK_HOST=linux-x86 +export ANDROID_SDK_ROOT=$SUBSURFACE_SOURCE/../android-sdk-linux +if [ $PLATFORM = Darwin ] ; then + export ANDROID_SDK_ROOT=$SUBSURFACE_SOURCE/../android-sdk-macosx + export ANDROID_NDK_HOST=darwin-x86_64 +else + export ANDROID_SDK_ROOT=$SUBSURFACE_SOURCE/../android-sdk-linux + export ANDROID_NDK_HOST=linux-x86 +fi # Which versions are we building against? SQLITE_VERSION=3081002 @@ -53,7 +59,12 @@ export CPPFLAGS="--sysroot=${SYSROOT}" export CXXFLAGS="--sysroot=${SYSROOT}" # Junk needed for qt-android-cmake export ANDROID_STANDALONE_TOOLCHAIN=${BUILDROOT}/ndk-$ARCH -export JAVA_HOME=/usr +if [ $PLATFORM = Darwin ] ; then + JAVA_HOME=$(/usr/libexec/java_home) + export JAVA_HOME +else + export JAVA_HOME=/usr +fi if [ ! -e sqlite-autoconf-${SQLITE_VERSION}.tar.gz ] ; then wget http://www.sqlite.org/2015/sqlite-autoconf-${SQLITE_VERSION}.tar.gz @@ -239,8 +250,13 @@ else fi # somehting in the qt-android-cmake-thingies mangles your path, so thats why we need to hard-code ant and pkg-config here. +if [ $PLATFORM = Darwin ] ; then + ANT=/usr/local/bin/ant +else + ANT=/usr/bin/ant +fi cmake $MOBILE_CMAKE \ - -DQT_ANDROID_ANT=/usr/bin/ant \ + -DQT_ANDROID_ANT=${ANT} \ -DPKG_CONFIG_EXECUTABLE=/usr/bin/pkg-config \ -DQT_ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT \ -DQT_ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT \ |