Work around the build name issues by instead manually adding the build target for android builds using '-DOS=android' This additionally resolves problems caused by the OS variable being rewritten from "android" to "linux" in gyp. This causes errors, as real-time support (-lrt) and pthread support (-lpthread) is not available in the android NDK toolchain as libraries. The functions present in these libraries are included automatically during the build instead during the android compilation process.
21 lines
519 B
Bash
Executable File
21 lines
519 B
Bash
Executable File
#!/bin/bash
|
|
|
|
export TOOLCHAIN=$PWD/android-toolchain
|
|
mkdir -p $TOOLCHAIN
|
|
$1/build/tools/make-standalone-toolchain.sh \
|
|
--toolchain=arm-linux-androideabi-4.7 \
|
|
--arch=arm \
|
|
--install-dir=$TOOLCHAIN \
|
|
--platform=android-9
|
|
export PATH=$TOOLCHAIN/bin:$PATH
|
|
export AR=arm-linux-androideabi-ar
|
|
export CC=arm-linux-androideabi-gcc
|
|
export CXX=arm-linux-androideabi-g++
|
|
export LINK=arm-linux-androideabi-g++
|
|
export PLATFORM=android
|
|
|
|
if [ $2 -a $2 == 'gyp' ]
|
|
then
|
|
./gyp_uv -Dtarget_arch=arm -DOS=android
|
|
fi
|