Skip to content

Commit 65d4d25

Browse files
Gioyikbnoordhuis
authored andcommitted
build: default to armv7+vfpv3 for android
Also add Android build instructions to the README. PR-URL: #1307 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent ad93775 commit 65d4d25

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ deps/icu*.zip
5454
deps/icu*.tgz
5555
deps/icu-tmp
5656
./node_modules
57+
android-toolchain/
5758
.svn/
5859

5960
# generated by gyp on Windows

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ To run the tests:
140140
> vcbuild test
141141
```
142142

143+
### Android / Android based devices, aka. Firefox OS
144+
145+
Be sure you have downloaded and extracted [Android NDK]
146+
(https://developer.android.com/tools/sdk/ndk/index.html)
147+
before in a folder. Then run:
148+
149+
```
150+
$ ./android-configure /path/to/your/android-ndk
151+
$ make
152+
```
153+
143154
### `Intl` (ECMA-402) support:
144155

145156
[Intl](https://github.com/joyent/node/wiki/Intl) support is not

android-configure

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
export TOOLCHAIN=$PWD/android-toolchain
44
mkdir -p $TOOLCHAIN
55
$1/build/tools/make-standalone-toolchain.sh \
6-
--toolchain=arm-linux-androideabi-4.7 \
6+
--toolchain=arm-linux-androideabi-4.9 \
77
--arch=arm \
88
--install-dir=$TOOLCHAIN \
99
--platform=android-9
1010
export PATH=$TOOLCHAIN/bin:$PATH
11-
export AR=arm-linux-androideabi-ar
12-
export CC=arm-linux-androideabi-gcc
13-
export CXX=arm-linux-androideabi-g++
14-
export LINK=arm-linux-androideabi-g++
11+
export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar
12+
export CC=$TOOLCHAIN/bin/arm-linux-androideabi-gcc
13+
export CXX=$TOOLCHAIN/bin/arm-linux-androideabi-g++
14+
export LINK=$TOOLCHAIN/bin/arm-linux-androideabi-g++
1515

1616
./configure \
1717
--dest-cpu=arm \

configure

+6-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ def is_arch_armv7():
431431
return ('__ARM_ARCH_7__' in cc_macros_cache or
432432
'__ARM_ARCH_7A__' in cc_macros_cache or
433433
'__ARM_ARCH_7R__' in cc_macros_cache or
434-
'__ARM_ARCH_7M__' in cc_macros_cache)
434+
'__ARM_ARCH_7M__' in cc_macros_cache or
435+
'__ARM_ARCH_7S__' in cc_macros_cache)
435436

436437

437438
def is_arch_armv6():
@@ -508,6 +509,10 @@ def configure_arm(o):
508509
o['variables']['arm_thumb'] = 0 # -marm
509510
o['variables']['arm_float_abi'] = arm_float_abi
510511

512+
if options.dest_os == 'android':
513+
o['variables']['arm_fpu'] = 'vfpv3'
514+
o['variables']['arm_version'] = '7'
515+
511516
# Print warning when snapshot is enabled and building on armv6
512517
if is_arch_armv6() and options.with_snapshot:
513518
warn('when building on ARMv6, don\'t use --with-snapshot')

0 commit comments

Comments
 (0)