From 6721f52ae9467f73f7cb365e03e779fbfa4c6494 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 7 Apr 2015 07:07:24 -0700 Subject: [PATCH] fix to use ANDROID_NDK instead of NDK_ROOT, following fdroid's convention, but also not to require either if ndk-build is on PATH. --- xwords4/android/scripts/ndkbuild.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xwords4/android/scripts/ndkbuild.sh b/xwords4/android/scripts/ndkbuild.sh index b4ef80783..62156fc75 100755 --- a/xwords4/android/scripts/ndkbuild.sh +++ b/xwords4/android/scripts/ndkbuild.sh @@ -2,17 +2,23 @@ set -e -u +ANDROID_NDK=${ANDROID_NDK:-''} + if [ ! -e build.xml ]; then echo "no build.xml; please run from root of source tree" exit 1 fi -if [ -z "$NDK_ROOT" ]; then - echo -n "NDK_ROOT not set... " - echo "NDK not found; install and set NDK_ROOT to point to it" - exit 1 +if [ -z "$ANDROID_NDK" ]; then + if which ndk-build >/dev/null; then + ANDROID_NDK=$(dirname $(which ndk-build)) + else + echo -n "ANDROID_NDK not set... " + echo "NDK not found; install and set ANDROID_NDK to point to it" + exit 1 + fi fi -${NDK_ROOT}/ndk-build $* +${ANDROID_NDK}/ndk-build $* echo "$0 done"