Skip to content

Commit e96bb14

Browse files
sgallagherjuanarbol
authored andcommittedOct 11, 2022
build: add --libdir flag to configure
This will allow distribution packages to select an alternative location for the unofficial libnode.so. For example, on Fedora it will install into /usr/lib64 on 64-bit systems. Signed-off-by: Stephen Gallagher <sgallagh@redhat.com> PR-URL: #44361 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 4c27d77 commit e96bb14

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed
 

‎configure.py

+9
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,14 @@
739739
help='compile shared library for embedding node in another project. ' +
740740
'(This mode is not officially supported for regular applications)')
741741

742+
parser.add_argument('--libdir',
743+
action='store',
744+
dest='libdir',
745+
default='lib',
746+
help='a directory to install the shared library into relative to the '
747+
'prefix. This is a no-op if --shared is not specified. ' +
748+
'(This mode is not officially supported for regular applications)')
749+
742750
parser.add_argument('--without-v8-platform',
743751
action='store_true',
744752
dest='without_v8_platform',
@@ -1372,6 +1380,7 @@ def configure_node(o):
13721380
o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
13731381

13741382
o['variables']['node_shared'] = b(options.shared)
1383+
o['variables']['libdir'] = options.libdir
13751384
node_module_version = getmoduleversion.get_version()
13761385

13771386
if options.dest_os == 'android':

‎tools/install.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,14 @@ def files(action):
169169

170170
# install libnode.version.so
171171
so_name = 'libnode.' + re.sub(r'\.x$', '.so', variables.get('shlib_suffix'))
172-
action([output_prefix + so_name], 'lib/' + so_name)
172+
action([output_prefix + so_name], variables.get('libdir') + '/' + so_name)
173173

174174
# create symlink of libnode.so -> libnode.version.so (C++ addons compat)
175175
link_path = abspath(install_path, 'lib/libnode.so')
176176
try_symlink(so_name, link_path)
177177
else:
178178
output_lib = 'libnode.' + variables.get('shlib_suffix')
179-
action([output_prefix + output_lib], 'lib/' + output_lib)
180-
if 'true' == variables.get('node_use_dtrace'):
181-
action(['out/Release/node.d'], 'lib/dtrace/node.d')
182-
183-
# behave similarly for systemtap
184-
action(['src/node.stp'], 'share/systemtap/tapset/')
179+
action([output_prefix + output_lib], variables.get('libdir') + '/' + output_lib)
185180

186181
action(['deps/v8/tools/gdbinit'], 'share/doc/node/')
187182
action(['deps/v8/tools/lldb_commands.py'], 'share/doc/node/')

0 commit comments

Comments
 (0)
Please sign in to comment.