Make bootjars work with OUT_DIR & friends

We were pre-pending $TOP to a path that was already absolute.

Test: OUT_DIR=<whatever> ./test/run-test --build-with-javac-dx --host \
                                         001-HelloWorld

Change-Id: Ib0b5bfdcc5abbe769af7f264f0e8ce0dfbebaf2a
diff --git a/tools/bootjars.sh b/tools/bootjars.sh
index bb47e55..f710de9 100755
--- a/tools/bootjars.sh
+++ b/tools/bootjars.sh
@@ -79,8 +79,10 @@
 # Print the file path (relative to $TOP) to the classes.jar of each boot jar in the intermediates directory.
 intermediates_dir=$(get_build_var "$intermediates_env_var")
 
-# turn the file path into an absolute path
-intermediates_dir=$(readlink -f $TOP/$intermediates_dir)
+# turn the file path into an absolute path if needed
+pushd "$TOP" >/dev/null
+intermediates_dir=$(readlink -m "$intermediates_dir")
+popd >/dev/null
 
 for jar in $boot_jars_list; do
   echo "$intermediates_dir/JAVA_LIBRARIES/${jar}_intermediates/classes.jar"