set -e
-if [ -z $ANDROID_NDK_HOME ]; then
- echo "ANDROID_NDK_HOME env var must be set!"
- exit 1
-fi
+NDK_BASE=$1
-test -e $ANDROID_NDK_HOME || mkdir -p $ANDROID_NDK_HOME
-cd $ANDROID_NDK_HOME
+test -e $NDK_BASE || mkdir -p $NDK_BASE
+cd $NDK_BASE
-if [ ! -e $ANDROID_NDK_HOME/r9b ]; then
+if [ ! -e $NDK_BASE/r9b ]; then
if [ `uname -m` == 'x86_64' ] ; then
SUFFIX='_64'
else
mv android-ndk-r9b r9b
fi
-if [ ! -e $ANDROID_NDK_HOME/r10e ]; then
+if [ ! -e $NDK_BASE/r10e ]; then
if [ `uname -m` == 'x86_64' ] ; then
SUFFIX='_64'
else
mv android-ndk-r10e r10e
fi
-chmod -R a+rX $ANDROID_NDK_HOME/
-find $ANDROID_NDK_HOME/ -type f -executable -print0 | xargs -0 chmod a+x
+chmod -R a+rX $NDK_BASE/
+find $NDK_BASE/ -type f -executable -print0 | xargs -0 chmod a+x