build: add correct shared library naming on OS X · nodejs/node@a722205

3 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -840,7 +840,11 @@ def configure_node(o):

840840
841841

o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)

842842

o['variables']['node_shared'] = b(options.shared)

843-

o['variables']['node_module_version'] = int(getmoduleversion.get_version())

843+

node_module_version = getmoduleversion.get_version()

844+

shlib_suffix = '%s.dylib' if sys.platform == 'darwin' else 'so.%s'

845+

shlib_suffix %= node_module_version

846+

o['variables']['node_module_version'] = int(node_module_version)

847+

o['variables']['shlib_suffix'] = shlib_suffix

844848
845849

if options.linked_module:

846850

o['variables']['library_files'] = options.linked_module

Original file line numberDiff line numberDiff line change

@@ -249,7 +249,7 @@

249249

],

250250

'conditions': [

251251

[ 'node_module_version!="" and OS!="win"', {

252-

'product_extension': 'so.<(node_module_version)',

252+

'product_extension': '<(shlib_suffix)',

253253

}]

254254

],

255255

}],

Original file line numberDiff line numberDiff line change

@@ -118,10 +118,11 @@ def files(action):

118118

if is_windows:

119119

output_file += '.dll'

120120

else:

121-

# GYP will output to lib.target, this is hardcoded in its source,

122-

# see the _InstallableTargetInstallPath function.

123-

output_prefix += 'lib.target/'

124-

output_file = 'lib' + output_file + '.so.' + get_version()

121+

output_file = 'lib' + output_file + '.' + variables.get('shlib_suffix')

122+

# GYP will output to lib.target except on OS X, this is hardcoded

123+

# in its source - see the _InstallableTargetInstallPath function.

124+

if sys.platform != 'darwin':

125+

output_prefix += 'lib.target/'

125126
126127

action([output_prefix + output_file], 'bin/' + output_file)

127128