summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-02-20 01:42:40 -0800
committerStephen Hines <srhines@google.com>2014-02-20 01:49:41 -0800
commit971d42af252f7f3e11144e472e0ac3fc313c73a4 (patch)
treef29bb6f9dab65ba3b043655a789125276559992e
parent7e225c2c2f5bb8cbd6162077eaab6097a77cfc4f (diff)
downloadrs-971d42af252f7f3e11144e472e0ac3fc313c73a4.tar.gz
Improve RS prebuilts script.
- Dynamically configure the number of cores used for parallel make. - Make sure that we actually build LLVM from scratch. - Fix build of host "bcc". We were building host and device "bcc" before, which was unnecessary. Now we just force the .so files to be built, which ensures a dependency on host "bcc". Change-Id: I1d85f1f2c2405a4476275139705a5ae4faf29e00
-rwxr-xr-xupdate_rs_prebuilts.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/update_rs_prebuilts.sh b/update_rs_prebuilts.sh
index d6f2c592..d22253de 100755
--- a/update_rs_prebuilts.sh
+++ b/update_rs_prebuilts.sh
@@ -13,6 +13,7 @@ then
# Only build arm on darwin.
TARGETS=(arm)
SYS_NAMES=(generic)
+ NUM_CORES=`sysctl -n hw.ncpu`
else
@@ -22,9 +23,22 @@ else
# Target architectures and their system library names.
TARGETS=(arm mips x86)
SYS_NAMES=(generic generic_mips generic_x86)
+ NUM_CORES=`cat /proc/cpuinfo | grep processor | tail -n 1 | cut -f 2 -d :`
+ NUM_CORES=$(($NUM_CORES+1))
fi
+echo "Using $NUM_CORES cores"
+
+# Turn off the build cache and make sure we build all of LLVM from scratch.
+export ANDROID_USE_BUILDCACHE=false
+export FORCE_BUILD_LLVM_COMPONENTS=true
+
+# Ensure that we have constructed the latest "bcc" for the host. Without
+# this variable, we don't build the .so files, hence we never construct the
+# actual required compiler pieces.
+export FORCE_BUILD_RS_COMPAT=true
+
# ANDROID_HOST_OUT is where the new prebuilts will be constructed/copied from.
ANDROID_HOST_OUT=$MY_ANDROID_DIR/out/host/$SHORT_OSNAME-x86/
@@ -46,11 +60,9 @@ build_rs_libs() {
echo Building for target $1
lunch $1
# Build the RS runtime libraries.
- cd $MY_ANDROID_DIR/frameworks/rs/driver/runtime && mma -j32 && cd - || exit 1
+ cd $MY_ANDROID_DIR/frameworks/rs/driver/runtime && mma -j$NUM_CORES && cd - || exit 1
# Build a sample support application to ensure that all the pieces are up to date.
- cd $MY_ANDROID_DIR/frameworks/rs/java/tests/RSTest_CompatLib/ && mma -j32 && cd - || exit 2
- # Build bcc_compat.
- cd $MY_ANDROID_DIR/frameworks/compile/libbcc/ && mma -j32 && cd - || exit 3
+ cd $MY_ANDROID_DIR/frameworks/rs/java/tests/RSTest_CompatLib/ && mma -j$NUM_CORES && cd - || exit 2
}