build: proper support for android cross compilation

The build script needs to properly specify the target as android
so the gyp build scripts can properly leverage cross compilation
using the android NDK.

PR-URL: https://github.com/libuv/libuv/pull/433
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
guworks 2015-07-08 23:20:31 -04:00 committed by Saúl Ibarra Corretgé
parent 5df06b3f2e
commit d57c7e685f
2 changed files with 9 additions and 3 deletions

View File

@ -6,7 +6,7 @@ $1/build/tools/make-standalone-toolchain.sh \
--toolchain=arm-linux-androideabi-4.8 \
--arch=arm \
--install-dir=$TOOLCHAIN \
--platform=android-9
--platform=android-21
export PATH=$TOOLCHAIN/bin:$PATH
export AR=arm-linux-androideabi-ar
export CC=arm-linux-androideabi-gcc
@ -16,5 +16,5 @@ export PLATFORM=android
if [ $2 -a $2 == 'gyp' ]
then
./gyp_uv.py -Dtarget_arch=arm -DOS=android
./gyp_uv.py -Dtarget_arch=arm -DOS=android -f make-android
fi

View File

@ -35,7 +35,13 @@
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0',
'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ],
}
},
'conditions': [
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}]
]
},
'Release': {
'defines': [ 'NDEBUG' ],