0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00

build: add correct shared library naming on OS X

The build system currently creates a shared library on OS X with the
same name as on Linux i.e.  libnode.so.48.  This is inconsistent with
the conventions on OS X which uses libnode.48.so This commit changes
the build process and install.py (used by make binary) to build with
the correct name on OS X when the --shared configure parameter is used.

PR-URL: https://github.com/nodejs/node/pull/7687
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
Stewart Addison 2016-07-12 19:04:29 +01:00 committed by Michael Dawson
parent e03a7b2a2b
commit a7222052d4
3 changed files with 11 additions and 6 deletions

6
configure vendored
View File

@ -840,7 +840,11 @@ def configure_node(o):
o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
o['variables']['node_shared'] = b(options.shared)
o['variables']['node_module_version'] = int(getmoduleversion.get_version())
node_module_version = getmoduleversion.get_version()
shlib_suffix = '%s.dylib' if sys.platform == 'darwin' else 'so.%s'
shlib_suffix %= node_module_version
o['variables']['node_module_version'] = int(node_module_version)
o['variables']['shlib_suffix'] = shlib_suffix
if options.linked_module:
o['variables']['library_files'] = options.linked_module

View File

@ -249,7 +249,7 @@
],
'conditions': [
[ 'node_module_version!="" and OS!="win"', {
'product_extension': 'so.<(node_module_version)',
'product_extension': '<(shlib_suffix)',
}]
],
}],

View File

@ -118,10 +118,11 @@ def files(action):
if is_windows:
output_file += '.dll'
else:
# GYP will output to lib.target, this is hardcoded in its source,
# see the _InstallableTargetInstallPath function.
output_prefix += 'lib.target/'
output_file = 'lib' + output_file + '.so.' + get_version()
output_file = 'lib' + output_file + '.' + variables.get('shlib_suffix')
# GYP will output to lib.target except on OS X, this is hardcoded
# in its source - see the _InstallableTargetInstallPath function.
if sys.platform != 'darwin':
output_prefix += 'lib.target/'
action([output_prefix + output_file], 'bin/' + output_file)