From a1e7da3c7f3dc469e7caa1879c82290aaf80947e Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Mon, 19 Jan 2015 11:49:10 -0800
Subject: [PATCH] add some instructions for TBB

---
 BUILD_ANDROID.md | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 159762940d..d2835f9060 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -22,6 +22,8 @@ If you would like to install Qt to a different location, or attempt to build wit
 
 Cross-compilation of OpenSSL has only been tested from an OS X machine running 10.10 compiling OpenSSL 1.0.1j. It is likely that the steps below will work for other OpenSSL versions than 1.0.1j.
 
+Download the (OpenSSL source)[https://www.openssl.org/source/] and extract the tarball inside your `ANDROID_LIB_DIR`. Rename the extracted folder to `openssl`.
+
 You will need the [setenv-android.sh script](http://wiki.openssl.org/index.php/File:Setenv-android.sh) from the OpenSSL wiki. 
 
 First, make sure `ANDROID_NDK_ROOT` is set in your env. `setenv-android.sh` needs `ANDROID_NDK_ROOT`.
@@ -37,9 +39,24 @@ make depend
 make all
 ```
 
-This should generate libcrypto and libssl in the root of the OpenSSL directory. Rename the openssl-1.0.1j folder to openssl so CMake can find it.
+This should generate libcrypto and libssl in the root of the OpenSSL directory.
 
-If you have been building other components it is possible that the OpenSSL compile will fail based on the values other cross-compilations (tbb, bullet) have set. Ensure that you are in a new terminal window to avoid compilation errors from previously set environment variables. 
+If you have been building other components it is possible that the OpenSSL compile will fail based on the values other cross-compilations (tbb, bullet) have set. Ensure that you are in a new terminal window to avoid compilation errors from previously set environment variables.
+
+####Intel Threading Building Blocks
+
+Download the (Intel Threading Building Blocks source)[https://www.threadingbuildingblocks.org/download] and extract the tarball inside your `ANDROID_LIB_DIR`. Rename the extracted folder to `tbb`.
+
+From the tbb directory, execute the following commands. This will set the compiler and archive tool to the correct ones from the NDK install and then build TBB using `ndk-build`.
+
+```
+export CC=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc
+export AR=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar
+cd jni
+ndk-build target=android tbb tbbmalloc arch=arm
+cd ../
+cp -rf build/linux_arm_*/**/*.so lib/
+``` 
 
 ####GLM