From fde29f69fdfb9f48f9fae50da5068df3331e3032 Mon Sep 17 00:00:00 2001 From: TheBeastOfCaerbannog Date: Tue, 21 Mar 2017 12:02:26 +0300 Subject: [PATCH] build: don't create directory for NDK toolchain Let make-standalone-toolchain.sh create directory. --- android-configure | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/android-configure b/android-configure index 1dc238ebd0c522..29f5380bdc2ae0 100755 --- a/android-configure +++ b/android-configure @@ -38,13 +38,26 @@ case $ARCH in ;; esac +NDK_PATH=$1 +function make_toolchain { + $NDK_PATH/build/tools/make-standalone-toolchain.sh \ + --toolchain=$TOOLCHAIN_NAME-$CC_VER \ + --arch=$ARCH \ + --install-dir=$TOOLCHAIN \ + --platform=android-21 +} + export TOOLCHAIN=$PWD/android-toolchain -mkdir -p $TOOLCHAIN -$1/build/tools/make-standalone-toolchain.sh \ - --toolchain=$TOOLCHAIN_NAME-$CC_VER \ - --arch=$ARCH \ - --install-dir=$TOOLCHAIN \ - --platform=android-21 +if [ -d "$TOOLCHAIN" ]; then + read -r -p "NDK toolchain already exists. Replace it? [y/N]" response + case "$response" in + [Yy]) + rm -rf "$TOOLCHAIN" + make_toolchain + esac +else + make_toolchain +fi export PATH=$TOOLCHAIN/bin:$PATH export AR=$TOOLCHAIN/bin/$SUFFIX-ar export CC=$TOOLCHAIN/bin/$SUFFIX-gcc