diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-08 14:41:40 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-08 14:41:40 +0000 |
commit | 9d740016b6ce35e9b596391eafe64be5ceaec76b (patch) | |
tree | 26cad3c1da72cf0f6e51fa313682a439bfb03a76 /tools | |
parent | 0a1d91a69919fe4c8c5f227f9b35d76d3c05bd46 (diff) | |
parent | f63a0a529ef9d2b819dc1bc7754fcf9e1d60bd74 (diff) | |
download | art-9d740016b6ce35e9b596391eafe64be5ceaec76b.tar.gz art-9d740016b6ce35e9b596391eafe64be5ceaec76b.tar.bz2 art-9d740016b6ce35e9b596391eafe64be5ceaec76b.zip |
Merge "Clean-up and make the art script usable on target."
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Android.mk | 10 | ||||
-rw-r--r-- | tools/art | 63 |
2 files changed, 43 insertions, 30 deletions
diff --git a/tools/Android.mk b/tools/Android.mk index d3be17f4d6..9a96f7a6e7 100644 --- a/tools/Android.mk +++ b/tools/Android.mk @@ -27,3 +27,13 @@ $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/art $(ACP) @echo "Copy: $(PRIVATE_MODULE) ($@)" $(copy-file-to-new-target) $(hide) chmod 755 $@ + +# Copy the art shell script to the target's bin directory +include $(CLEAR_VARS) +LOCAL_MODULE_CLASS := EXECUTABLES +LOCAL_MODULE := art +include $(BUILD_SYSTEM)/base_rules.mk +$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/art $(ACP) + @echo "Copy: $(PRIVATE_MODULE) ($@)" + $(copy-file-to-new-target) + $(hide) chmod 755 $@ @@ -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 |