summaryrefslogtreecommitdiffstats
path: root/tools/art
diff options
context:
space:
mode:
Diffstat (limited to 'tools/art')
-rwxr-xr-xtools/art16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/art b/tools/art
index 0a6c941..6db8cd0 100755
--- a/tools/art
+++ b/tools/art
@@ -33,9 +33,21 @@ while true; do
fi
done
-unset ANDROID_PRODUCT_OUT # avoid defaulting dex2oat --host-prefix to target output
+function follow_links() {
+ file="$1"
+ while [ -h "$file" ]; do
+ # On Mac OS, readlink -f doesn't work.
+ file="$(readlink "$file")"
+ done
+ echo "$file"
+}
+
+PROG_NAME="$(follow_links "$BASH_SOURCE")"
+PROG_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
+ANDROID_BUILD_TOP="$(cd "${PROG_DIR}/../../../../" ; pwd -P)/"
+ANDROID_HOST_OUT=$PROG_DIR/..
+
mkdir -p /tmp/android-data/dalvik-cache
-cd $ANDROID_BUILD_TOP
ANDROID_DATA=/tmp/android-data \
ANDROID_ROOT=$ANDROID_HOST_OUT \
LD_LIBRARY_PATH=$ANDROID_HOST_OUT/lib \