This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves minor discrepancies between android and standard POSIX systems. In addition, some configure parameters were added, and a helper-script for android configuration. Ideally, this script should be merged into the standard configure script. To build for android, source the android-configure script with an NDK path: source ./android-configure ~/android-ndk-r8d This will create an android standalone toolchain and export the necessary environment parameters. After that, build as normal: make -j8 After the build, you should now have android-compatible NodeJS binaries.
- Loading branch information
1 parent
ffcd8b9
commit 5e4e8ec
Showing
6 changed files
with
57 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/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++ | ||
|
||
./configure \ | ||
--without-snapshot \ | ||
--dest-cpu=arm \ | ||
--dest-os=android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5e4e8ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this commit message should be added to the build instructions in the README?
5e4e8ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I question the need to have the
android-configure
script in node - it only works in a limited scenario where the NDK is installled but the toolchain isn't, and where bash is available. It also assumes that you want to build the toolchain in the current directory. All the other settings like AR, CC, CXX and LINK have to be set by anyone who is cross-compiling - adding one script to satisfy one platform and toolchain could lead to having to add scripts for every platform and toolchain.That being said, I (personally) would like if configure had a
--host
parameter (that's the right one according to this blog post) which automatically prepends the AR, CC, CXX and LINK automatically based on the tuple/prefix, so at least scripts like these would be simpler with no need for endless exports as long as the prefixed tools are in the PATH.(ie.
./configure --host=arm-linux-androideabi --without-snapshot
)5e4e8ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good idea.
It also could be added to https://github.com/joyent/node/wiki/Installation where all the other building steps are.
I also feel that the whole “Node on Android” thing is underdocumented (or, in more precise and general sense, lacks information).
node.apk
files?).js
files so that their shortcuts are run from Android's desktop as applications?5e4e8ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I'll add it once the kinks are ironed out.
Maybe but it won't be us. Android is not an officially supported platform (yet - maybe in the future.)
5e4e8ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty excited about node on android. I just started playing around with the nodecopter and would love to run my programs without having to lug my laptop around.
5e4e8ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got node/io running as a shared_library on non-rooted android, baked into a repl app. I'm working towards a v4.0.0.0-rc merge.
I aim to release with:
Stay tuned.