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