zos: support platform

Initial work to add z/OS support to node-gyp.


PR-URL: https://github.com/nodejs/node-gyp/pull/1276
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
John Barboza 2017-09-26 14:11:39 -04:00 committed by Ben Noordhuis
parent 90d86512f4
commit b2024dee7b
6 changed files with 69 additions and 12 deletions

View file

@ -254,18 +254,21 @@ function configure (gyp, argv, callback) {
// - the out/Debug directory
// - the root directory
var node_exp_file = undefined
if (process.platform === 'aix') {
if (process.platform === 'aix' || process.platform === 'os390') {
var ext = process.platform === 'aix' ? 'exp' : 'x'
var node_root_dir = findNodeDirectory()
var candidates = ['include/node/node.exp',
'out/Release/node.exp',
'out/Debug/node.exp',
'node.exp']
var candidates = ['include/node/node',
'out/Release/node',
'out/Debug/node',
'node'].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) {
log.verbose(logprefix, 'Found exports file: %s', node_exp_file)
} else {
var msg = msgFormat('Could not find node.exp file in %s', node_root_dir)
var msg = msgFormat('Could not find node.%s file in %s', ext, node_root_dir)
log.error(logprefix, 'Could not find exports file')
return callback(new Error(msg))
}
@ -294,7 +297,7 @@ function configure (gyp, argv, callback) {
argv.push('-Dlibrary=shared_library')
argv.push('-Dvisibility=default')
argv.push('-Dnode_root_dir=' + nodeDir)
if (process.platform === 'aix') {
if (process.platform === 'aix' || process.platform === 'os390') {
argv.push('-Dnode_exp_file=' + node_exp_file)
}
argv.push('-Dnode_gyp_dir=' + nodeGypDir)