diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-02 15:24:25 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-08 15:26:05 +0100 |
commit | f63a0a529ef9d2b819dc1bc7754fcf9e1d60bd74 (patch) | |
tree | e9e746230d5474f343c8e9fdf779836b5d309d20 /tools/art | |
parent | 7c7686e62d262f1823876cebb3700e20f967dd56 (diff) | |
download | art-f63a0a529ef9d2b819dc1bc7754fcf9e1d60bd74.tar.gz art-f63a0a529ef9d2b819dc1bc7754fcf9e1d60bd74.tar.bz2 art-f63a0a529ef9d2b819dc1bc7754fcf9e1d60bd74.zip |
Clean-up and make the art script usable on target.
Also add a phony target to build what's needed to use it.
Change-Id: I0bca6b0cbe921653de05fec0ae0cbbff63df580e
Diffstat (limited to 'tools/art')
-rw-r--r-- | tools/art | 63 |
1 files changed, 33 insertions, 30 deletions
@@ -14,27 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -lib=-XXlib:libart.so -invoke_with= - -while true; do - if [ "$1" = "--invoke-with" ]; then - shift - invoke_with="$1" - shift - elif [ "$1" = "-d" ]; then - lib="-XXlib:libartd.so" - shift - elif expr "$1" : "--" >/dev/null 2>&1; then - echo "unknown option: $1" 1>&2 - exit 1 +function follow_links() { + if [ z"$BASH_SOURCE" != z ]; then + file="$BASH_SOURCE" else - break + file="$0" fi -done - -function follow_links() { - file="$1" while [ -h "$file" ]; do # On Mac OS, readlink -f doesn't work. file="$(readlink "$file")" @@ -42,13 +27,6 @@ function follow_links() { 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/.. -ANDROID_DATA=$PWD/android-data$$ -DALVIKVM_EXECUTABLE=$ANDROID_HOST_OUT/bin/dalvikvm - function find_libdir() { if [ "$(readlink "$DALVIKVM_EXECUTABLE")" = "dalvikvm64" ]; then echo "lib64" @@ -57,14 +35,39 @@ function find_libdir() { fi } -LD_LIBRARY_PATH=$ANDROID_HOST_OUT/"$(find_libdir)" +PROG_NAME="$(follow_links)" +PROG_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" +ANDROID_ROOT=$PROG_DIR/.. +ANDROID_DATA=$PWD/android-data$$ +DALVIKVM_EXECUTABLE=$ANDROID_ROOT/bin/dalvikvm +LIBDIR=$(find_libdir) +LD_LIBRARY_PATH=$ANDROID_ROOT/$LIBDIR + +lib=-XXlib:$ANDROID_ROOT/$LIBDIR/libart.so +invoke_with= + +while true; do + if [ "$1" = "--invoke-with" ]; then + shift + invoke_with="$1" + shift + elif [ "$1" = "-d" ]; then + lib="-XXlib:$LIBDIR/libartd.so" + shift + elif expr "$1" : "--" >/dev/null 2>&1; then + echo "unknown option: $1" 1>&2 + exit 1 + else + break + fi +done -mkdir -p $ANDROID_DATA/dalvik-cache/{x86,x86_64} +mkdir -p $ANDROID_DATA/dalvik-cache/{arm,arm64,x86,x86_64} ANDROID_DATA=$ANDROID_DATA \ - ANDROID_ROOT=$ANDROID_HOST_OUT \ + ANDROID_ROOT=$ANDROID_ROOT \ LD_LIBRARY_PATH=$LD_LIBRARY_PATH \ $invoke_with $DALVIKVM_EXECUTABLE $lib \ - -Ximage:$ANDROID_HOST_OUT/framework/core.art \ + -Ximage:$ANDROID_ROOT/framework/core.art \ "$@" EXIT_STATUS=$? rm -rf $ANDROID_DATA |