OLD | NEW |
(Empty) | |
| 1 #!/bin/sh |
| 2 |
| 3 |
| 4 dir=`dirname $0` |
| 5 if [ -z "$dir" ]; then |
| 6 dir = "." |
| 7 fi |
| 8 pushd $dir |
| 9 |
| 10 NDK_VERSION=r16b |
| 11 |
| 12 if [ -z "$ANDROID_NDK_ROOT" ]; then |
| 13 |
| 14 case `uname` in |
| 15 Darwin) |
| 16 URL=https://dl.google.com/android/repository/android-ndk-$NDK_VERSIO
N-darwin-x86_64.zip |
| 17 ;; |
| 18 Linux) |
| 19 URL=https://dl.google.com/android/repository/android-ndk-$NDK_VERSIO
N-linux-x86_64.zip |
| 20 ;; |
| 21 *) |
| 22 exit 1 |
| 23 ;; |
| 24 esac |
| 25 if [ ! -f "third_party/android-ndk-$NDK_VERSION.zip" ]; then |
| 26 echo "Downloading NDK..." |
| 27 wget $URL -O third_party/android-ndk-$NDK_VERSION.zip |
| 28 fi |
| 29 if [ ! -d "third_party/android-ndk-$NDK_VERSION" ]; then |
| 30 echo "Unzipping NDK" |
| 31 unzip -q third_party/android-ndk-$NDK_VERSION.zip -d third_party |
| 32 fi |
| 33 ANDROID_NDK_ROOT=`pwd`/third_party/android-ndk-$NDK_VERSION |
| 34 fi |
| 35 |
| 36 for file in cross/$NDK_VERSION/*.in ; do |
| 37 outfile=`dirname $file`/../`basename $file .in` |
| 38 sed s#@ANDROID_NDK_ROOT@#$ANDROID_NDK_ROOT#g < $file > $outfile |
| 39 done |
| 40 |
| 41 popd |
| 42 |
| 43 echo |
| 44 echo "Please do this before proceeding:" |
| 45 echo "export ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" |
| 46 |
OLD | NEW |