From 45684a1dbf52f1eb93e5c67330e59693a4d43dc4 Mon Sep 17 00:00:00 2001 From: Stewart Addison Date: Mon, 14 Nov 2016 13:43:41 +0000 Subject: [PATCH] build: add shared library support to AIX build Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: PR-URL: https://github.com/nodejs/node/pull/9675 Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Michael Dawson --- configure | 9 ++++++++- node.gyp | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9b4fa94521a7f4..f61fd8716f050b 100755 --- a/configure +++ b/configure @@ -843,7 +843,14 @@ def configure_node(o): o['variables']['node_no_browser_globals'] = b(options.no_browser_globals) o['variables']['node_shared'] = b(options.shared) node_module_version = getmoduleversion.get_version() - shlib_suffix = '%s.dylib' if sys.platform == 'darwin' else 'so.%s' + + if sys.platform == 'darwin': + shlib_suffix = '%s.dylib' + elif sys.platform.startswith('aix'): + shlib_suffix = '%s.a' + else: + shlib_suffix = 'so.%s' + shlib_suffix %= node_module_version o['variables']['node_module_version'] = int(node_module_version) o['variables']['shlib_suffix'] = shlib_suffix diff --git a/node.gyp b/node.gyp index fa98547e09b198..543ea56407b55e 100644 --- a/node.gyp +++ b/node.gyp @@ -919,7 +919,15 @@ 'targets': [ { 'target_name': 'node', - 'type': 'executable', + 'conditions': [ + ['node_shared=="true"', { + 'type': 'shared_library', + 'ldflags': ['--shared'], + 'product_extension': '<(shlib_suffix)', + }, { + 'type': 'executable', + }], + ], 'dependencies': ['<(node_core_target_name)', 'node_exp'], 'include_dirs': [