See the Resources for Newcomers section in README.upstream.md for links to information on the upstream project. Do not use the build instructions found there.
Below are the tools and libraries (and their minimum versions) required to build nodejs:
- cmake 2.6
- gcc 4.3
- make (any version)
- python 2.6 or 2.7 (3.0 cannot be used)
Once you have downloaded the source, execute the following to build it:
$ mkdir BUILD $ cd BUILD $ cmake .. $ make $ sudo make install
The executable will be installed under
The header files will be installed under
and the pkg-config file under
You can install it elsewhere by supplying a value for CMAKE_INSTALL_PREFIX when invoking cmake. For example:
$ cmake -D CMAKE_INSTALL_PREFIX:STRING=$HOME/projects/openwebos .. $ make $ make install
will install the files in subdirectories of $HOME/projects/openwebos instead of subdirectories of /usr/local.
Specifying CMAKE_INSTALL_PREFIX also causes the pkg-config files under it to be used to find headers and libraries. To have pkg-config look in a different tree, set the environment variable PKG_CONFIG_PATH to the path to its lib/pkgconfig subdirectory.
To compile with -Wall, configure for debug:
$ cmake -D CMAKE_BUILD_TYPE:STRING=Debug .. $ make
From the directory where you originally ran make install, invoke:
$ sudo xargs rm < install_manifest.txt
Once you have run cmake, execute the following to generate the documentation:
$ make doc
To view the generated HTML documentation for the API, point your browser to:
To run the test programs, run:
$ make test
If your system has pkg-config then you can just add this to your makefile:
CFLAGS += $(shell pkg-config --cflags nodejs)
See the file LICENSE.