Skip to content

wilsonianb/codius-lang-nodejs

 
 

Repository files navigation

Evented I/O for V8 javascript (Port for Google Native Client).

To build for Native Client (NaCl):

Prerequisites (Unix only):

  • GCC 4.2 or newer
  • G++ 4.2 or newer
  • Python 2.6 or 2.7
  • GNU Make 3.81 or newer
  • libexecinfo (FreeBSD and OpenBSD only)
  • Native Client SDK

Unix/Macintosh:

export NACL_SDK_ROOT=<your-path>/nacl_sdk/pepper_<version>
source ./nacl-configure $NACL_SDK_ROOT
make

$NACL_SDK_ROOT/tools/sel_ldr_x86_32 -B $NACL_SDK_ROOT/tools/irt_core_x86_32.nexe -a \
-- $NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/lib32/runnable-ld.so \
--library-path $NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/lib32:\
$NACL_SDK_ROOT/toolchain/linux_x86_glibc/i686-nacl/usr/lib:\
$NACL_SDK_ROOT/lib/glibc_x86_32/Release ./out/Release/bin/node.nexe <your_nodejs_file>.js

Debug build:

make BUILDTYPE=Debug 

$NACL_SDK_ROOT/tools/sel_ldr_x86_32 -h 3:3 -B $NACL_SDK_ROOT/tools/irt_core_x86_32.nexe \
-a -- $NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/lib32/runnable-ld.so \
--library-path $NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/lib32:\
$NACL_SDK_ROOT/toolchain/linux_x86_glibc/i686-nacl/usr/lib:\
$NACL_SDK_ROOT/lib/glibc_x86_32/Debug ./out/Debug/node.nexe <your_nodejs_file>.js

GDB Debugging:

Change the "program" urls for runnable-ld.so based on your nacl_sdk directory relative to your node root.

$NACL_SDK_ROOT/tools/sel_ldr_x86_32 -g -h 3:3 -B $NACL_SDK_ROOT/tools/irt_core_x86_32.nexe \
-a -- $NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/lib32/runnable-ld.so \
--library-path $NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/lib32:\
$NACL_SDK_ROOT/toolchain/linux_x86_glibc/i686-nacl/usr/lib:\
$NACL_SDK_ROOT/lib/glibc_x86_32/Debug ./out/Debug/node.nexe <your_nodejs_file>.js

(new terminal)
$NACL_SDK_ROOT/toolchain/linux_x86_glibc/bin/x86_64-nacl-gdb

(gdb) nacl-manifest <your_manifest_file>.nmf
(gdb) target remote 127.0.0.1:4014
(gdb) remote get nexe test_node.nexe
(gdb) file test_node.nexe
(gdb) remote get irt test_irt.nexe 
(gdb) nacl-irt test_irt.nexe

Issues

  • libuv uses epoll which is not yet supported in nacl_io
    • Poll or select could be used as a fallback

To build for non-Native Client:

Prerequisites (Unix only):

* GCC 4.2 or newer
* G++ 4.2 or newer
* Python 2.6 or 2.7
* GNU Make 3.81 or newer
* libexecinfo (FreeBSD and OpenBSD only)

Unix/Macintosh:

./configure
make
make install

With libicu i18n support:

svn checkout --force --revision 214189 \
   http://src.chromium.org/svn/trunk/deps/third_party/icu46 \
   deps/v8/third_party/icu46
./configure --with-icu-path=deps/v8/third_party/icu46/icu.gyp
make
make install

If your python binary is in a non-standard location or has a non-standard name, run the following instead:

export PYTHON=/path/to/python
$PYTHON ./configure
make
make install

Prerequisites (Windows only):

* Python 2.6 or 2.7
* Visual Studio 2010 or 2012

Windows:

vcbuild nosign

You can download pre-built binaries for various operating systems from http://nodejs.org/download/. The Windows and OS X installers will prompt you for the location to install to. The tarballs are self-contained; you can extract them to a local directory with:

tar xzf /path/to/node-<version>-<platform>-<arch>.tar.gz

Or system-wide with:

cd /usr/local && tar --strip-components 1 -xzf \
                    /path/to/node-<version>-<platform>-<arch>.tar.gz

To run the tests:

Unix/Macintosh:

make test

Windows:

vcbuild test

To build the documentation:

make doc

To read the documentation:

man doc/node.1

Resources for Newcomers

About

Fork of Node.js for Google Native Client compatibility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.1%
  • C++ 20.1%
  • C 7.2%
  • D 0.8%
  • Python 0.7%
  • Shell 0.3%
  • Other 0.8%