From e5a69010ed6814e3cbd586ac13bac7bc87f331d4 Mon Sep 17 00:00:00 2001 From: John Barboza Date: Tue, 29 May 2018 14:57:50 -0700 Subject: [PATCH] zos: add search locations for libnode.x Node.js on z/OS uses shared dll (libnode.so). When linking native addons, node-gyp needs to find the corresponding libnode.x during the link step. PR-URL: https://github.com/nodejs/node-gyp/pull/1451 Reviewed-By: Ben Noordhuis Reviewed-By: Refael Ackermann --- lib/configure.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/lib/configure.js b/lib/configure.js index bc39302979..f4820b514b 100644 --- a/lib/configure.js +++ b/lib/configure.js @@ -244,25 +244,29 @@ function configure (gyp, argv, callback) { argv.push('-I', config) }) - // for AIX we need to set up the path to the exp file - // which contains the symbols needed for linking. - // The file will either be in one of the following - // depending on whether it is an installed or - // development environment: - // - the include/node directory - // - the out/Release directory - // - the out/Debug directory - // - the root directory + // For AIX and z/OS we need to set up the path to the exports file + // which contains the symbols needed for linking. var node_exp_file = undefined if (process.platform === 'aix' || process.platform === 'os390') { var ext = process.platform === 'aix' ? 'exp' : 'x' var node_root_dir = findNodeDirectory() - var candidates = ['include/node/node', - 'out/Release/node', - 'out/Debug/node', - 'node'].map(function(file) { - return file + '.' + ext - }) + var candidates = undefined + if (process.platform === 'aix') { + candidates = ['include/node/node', + 'out/Release/node', + 'out/Debug/node', + 'node' + ].map(function(file) { + return file + '.' + ext + }) + } else { + candidates = ['out/Release/obj.target/libnode', + 'out/Debug/obj.target/libnode', + 'lib/libnode' + ].map(function(file) { + return file + '.' + ext + }) + } var logprefix = 'find exports file' node_exp_file = findAccessibleSync(logprefix, node_root_dir, candidates) if (node_exp_file !== undefined) {