The android_setup.csh script is sourced to initialize the environment to build the Intel TBB library.
Note: android_setup.csh has been tested on Android* NDKs from r7. Future changes in the NDK directory structure may require changes in the setup script.
Note: android_setup.csh has not been tested with the android-ndk-r8d. In particular the LLVM* compiler has not been tested.
The format of the arguments are:
source android_setup.csh <-n NDK> <-c cpu-type> <-g version> <-p NDK-path> <-a abi-level> -d device-id <-v> <-h> source android_setup.csh <-p NDK-path> -s standalone-toolchain-location -d device-id <-v> <-h> source android_setup.csh <-p NDK-path> -t prebuilt-toolchain-location <-a abi-level> -d device-id <-v> <-h>
switch | default | description |
---|---|---|
-n | 8 | the version of the Android* NDK being built against. For example, if the NDK is android-ndk-r8b, specify "-n 8b" |
-c | x86 | an available cpu type. Currently-accepted values are "x86" and "arm". |
-g | 4.4.3 | a version of GCC* available in the NDK. For example, NDK r8b has "4.4.3" and "4.6". |
-p | /localdisk | the location of the NDKs and the default location of the toolchains if not specified by absolute path. For example, if the NDK "android-ndk-r8" was uncompressed in the /tmp directory, then when using the "-n 8" switch, specify "-p /tmp". If this switch is specified it must appear before any switches affected by it. |
-s | none | either an absolute path to the standalone toolchain, or a path relative to the "-p NDK-path" location. If for example the standalone toolchain is in /tmp/my-toolchain, then the path can be specified either by "s /tmp/my-toolchain" or "-p /tmp -s my-toolchain". If the -s switch is specified the cpu-type, GCC-version and abi-level are derived from the toolchain. |
-t | none | either an absolute path to the prebuilt toolchain, or a path relative to the "-p NDK-path" location. For example, if the NDK is installed in /localdisk, then to specify the x86 compiler for GCC* 4.4.3, use "-t /localdisk/android-ndk-r8b/toolchains/x86-4.4.3/prebuilt/linux-x86". If the -t switch is specified the cpu-type and GCC-version are derived from the toolchain. |
-a | 14 | a supported ABI level in the NDK. |
-d | none | the ID returned by "adb devices" on the host machine. Note that some devices do not appear on the list but can be connected to. The device must be connected to the host machine for both library build and test, so target system information is available. |
-v | verbose output | |
-h |
|
Once the environment is set up the shared libraries can be built. The format of the build command is
gmake target=android cpp0x=1 run_cmd=\# <other switches>Note the "run_cmd=\#" switch. The "run_cmd" is executed after the build stage is complete; when building the library no run step is required. The "#" just makes this run command a no-op.
After the libraries are built the unit tests can be performed. To test:
gmake target=android cpp0x=1 run_cmd="../android.linux.launcher.sh" test
Running an executable on an attached Android* device requires all the shared libraries and data being used be copied to the device. The android.linux.launcher.sh script does this.
Note: The script is tailored to meet the needs of the unit test system, and may not be suitable for general use.
The script will: