diff --git a/configure b/configure index b23bfc36a282d0..d9301941960f64 100755 --- a/configure +++ b/configure @@ -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 diff --git a/node.gyp b/node.gyp index 994de2b436cfe9..cbf957a8c7c1f6 100644 --- a/node.gyp +++ b/node.gyp @@ -248,7 +248,7 @@ ], 'conditions': [ [ 'node_module_version!=""', { - 'product_extension': 'so.<(node_module_version)', + 'product_extension': '<(shlib_suffix)', }] ], }], diff --git a/tools/install.py b/tools/install.py index a3986c5033904d..4f155376eaf534 100755 --- a/tools/install.py +++ b/tools/install.py @@ -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)