Skip to content

build: introduce configure --shared

Checklist
  • tests and code linting passes
  • documentation is changed or added
  • the commit message follows commit guidelines
Affected core subsystem(s)

build, configure

Description of change

This PR is the continuation of https://github.com/nodejs/node/pull/5918 where the originator (@indutny) agreed that I can take over this task in order to land the changes as soon as possible.

The PR consists of two commits, the original one from https://github.com/nodejs/node/pull/5918 which adds "[a] configure flag for building shared library that could be used to embed Node.js in some application (like Electron)" and a second commit that modifies the following aspects:

  • Use the "--shared" configure flag to build a shared library.
  • Use the "--no-bundled-v8" flag to exclude V8 headers from the deps/ folder, this option is useful to Electron which provides its own copy of V8.
  • Use the "--no-v8-platform" flag to avoid initializing the V8 platform inside Node (useful for some embedders).
  • Insure that "./configure --shared && make" works and produces a useable libnode.so for anyone (i.e. decouple --shared from Electron's build system).

I intend to land both commits in the PR at the same time (the original one from @indutny and my changes on top of it) to maintain a clear history/ownership of the work. If anyone feels strongly about this approach either way, please let me know.

All these options are provided as-is for embedders are not officially supported at this time, as indicated in the documentation.

Future changes:

This PR is concerned with Linux only - once this PR is landed a separate PR will be made to resolve issues related to building a DLL on Windows.

Merge request reports

Loading