Skip to content

Commit

Permalink
zos: add search locations for libnode.x
Browse files Browse the repository at this point in the history
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: #1451
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
jBarz authored and bnoordhuis committed Jun 8, 2018
1 parent 79febac commit e5a6901
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions lib/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e5a6901

Please sign in to comment.