1 From cf581096dd350cf7267e5a12ff26159120274c5c Mon Sep 17 00:00:00 2001
2 From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
3 Date: Tue, 19 Mar 2019 23:22:40 -0400
4 Subject: [PATCH 2/3] Install both binaries and use libdir.
6 This allows us to build with a shared library for other users while
7 still providing the normal executable.
9 Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
11 configure.py | 7 +++++++
12 tools/install.py | 29 +++++++++++++----------------
13 2 files changed, 20 insertions(+), 16 deletions(-)
15 diff --git a/configure.py b/configure.py
16 index 20cce214dbb113aeef8f1044d7af88d842a11fd7..e2d78a2a51ef81621618cb20fa76f4a1421bf9e0 100755
19 @@ -559,6 +559,12 @@ parser.add_option('--shared',
20 help='compile shared library for embedding node in another project. ' +
21 '(This mode is not officially supported for regular applications)')
23 +parser.add_argument('--libdir',
27 + help='a directory to install the shared library into')
29 parser.add_argument('--without-v8-platform',
31 dest='without_v8_platform',
32 @@ -1103,6 +1109,7 @@ def configure_node(o):
33 o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
35 o['variables']['node_shared'] = b(options.shared)
36 + o['variables']['libdir'] = options.libdir
37 node_module_version = getmoduleversion.get_version()
39 if options.dest_os == 'android':
40 diff --git a/tools/install.py b/tools/install.py
41 index 655802980a6ea94d1d4ca1dc63c8c8e905fbb83a..fe4723bf15012c8aacacb0393dc8294c049b0503 100755
42 --- a/tools/install.py
43 +++ b/tools/install.py
44 @@ -121,22 +121,19 @@ def subdir_files(path, dest, action):
47 is_windows = sys.platform == 'win32'
48 - output_file = 'node'
49 output_prefix = 'out/Release/'
50 + output_libprefix = output_prefix
52 - if 'false' == variables.get('node_shared'):
54 - output_file += '.exe'
56 + output_bin = 'node.exe'
57 + output_lib = 'node.dll'
60 - output_file += '.dll'
62 - output_file = 'lib' + output_file + '.' + variables.get('shlib_suffix')
64 + output_lib = 'libnode.' + variables.get('shlib_suffix')
66 - if 'false' == variables.get('node_shared'):
67 - action([output_prefix + output_file], 'bin/' + output_file)
69 - action([output_prefix + output_file], 'lib/' + output_file)
70 + action([output_prefix + output_bin], 'bin/' + output_bin)
71 + if 'true' == variables.get('node_shared'):
72 + action([output_libprefix + output_lib], variables.get('libdir') + '/' + output_lib)
74 if 'true' == variables.get('node_use_dtrace'):
75 action(['out/Release/node.d'], 'lib/dtrace/node.d')