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