Index: cross-bootstrap.sh |
=================================================================== |
new file mode 100755 |
--- /dev/null |
+++ b/cross-bootstrap.sh |
@@ -0,0 +1,46 @@ |
+#!/bin/sh |
+ |
+ |
+dir=`dirname $0` |
+if [ -z "$dir" ]; then |
+ dir = "." |
+fi |
+pushd $dir |
+ |
+NDK_VERSION=r12b |
+ |
+if [ -z "$ANDROID_NDK_ROOT" ]; then |
+ |
+ case `uname` in |
+ Darwin) |
+ URL=https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-darwin-x86_64.zip |
+ ;; |
+ Linux) |
+ URL=https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux-x86_64.zip |
+ ;; |
+ *) |
+ exit 1 |
+ ;; |
+ esac |
+ if [ ! -f "third_party/android-ndk-$NDK_VERSION.zip" ]; then |
+ echo "Downloading NDK..." |
+ wget $URL -O third_party/android-ndk-$NDK_VERSION.zip |
+ fi |
+ if [ ! -d "third_party/android-ndk-$NDK_VERSION" ]; then |
+ echo "Unzipping NDK" |
+ unzip -q third_party/android-ndk-$NDK_VERSION.zip -d third_party |
+ fi |
+ ANDROID_NDK_ROOT=`pwd`/third_party/android-ndk-$NDK_VERSION |
+fi |
+ |
+for file in cross/*.in ; do |
+ outfile=`dirname $file`/`basename $file .in` |
+ sed s#@ANDROID_NDK_ROOT@#$ANDROID_NDK_ROOT#g < $file > $outfile |
+done |
+ |
+popd |
+ |
+echo |
+echo "Please do this before proceeding:" |
+echo "export ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" |
+ |