Skip to content

Commit 8a1aa55

Browse files
authored
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 <[email protected]> PR-URL: #44361 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 3a6003a commit 8a1aa55

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

configure.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,14 @@
706706
help='compile shared library for embedding node in another project. ' +
707707
'(This mode is not officially supported for regular applications)')
708708

709+
parser.add_argument('--libdir',
710+
action='store',
711+
dest='libdir',
712+
default='lib',
713+
help='a directory to install the shared library into relative to the '
714+
'prefix. This is a no-op if --shared is not specified. ' +
715+
'(This mode is not officially supported for regular applications)')
716+
709717
parser.add_argument('--without-v8-platform',
710718
action='store_true',
711719
dest='without_v8_platform',
@@ -1323,6 +1331,7 @@ def configure_node(o):
13231331
o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
13241332

13251333
o['variables']['node_shared'] = b(options.shared)
1334+
o['variables']['libdir'] = options.libdir
13261335
node_module_version = getmoduleversion.get_version()
13271336

13281337
if options.dest_os == 'android':

tools/install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +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)
179+
action([output_prefix + output_lib], variables.get('libdir') + '/' + output_lib)
180180

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

0 commit comments

Comments
 (0)