Skip to content

Commit a26494f

Browse files
kadlerrichardlau
authored andcommitted
feat: Add proper support for IBM i
Python 3.9 on IBM i now properly returns "os400" for sys.platform instead of claiming to be AIX as it did previously. While the IBM i PASE environment is compatible with AIX, it is a subset and has numerous differences which makes it beneficial to distinguish, however this means that it now needs explicit support here.
1 parent 3e2a532 commit a26494f

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

addon.gypi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@
103103
'-Wl,-bimport:<(node_exp_file)'
104104
],
105105
}],
106+
[ 'OS=="os400"', {
107+
'ldflags': [
108+
'-Wl,-bimport:<(node_exp_file)'
109+
],
110+
}],
106111
[ 'OS=="zos"', {
107112
'cflags': [
108113
'-q64',

lib/build.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ function build (gyp, argv, callback) {
1111
var platformMake = 'make'
1212
if (process.platform === 'aix') {
1313
platformMake = 'gmake'
14+
} else if (process.platform === 'os400') {
15+
platformMake = 'gmake'
1416
} else if (process.platform.indexOf('bsd') !== -1) {
1517
platformMake = 'gmake'
1618
} else if (win && argv.length > 0) {

lib/configure.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ function configure (gyp, argv, callback) {
176176
// For AIX and z/OS we need to set up the path to the exports file
177177
// which contains the symbols needed for linking.
178178
var nodeExpFile
179-
if (process.platform === 'aix' || process.platform === 'os390') {
180-
var ext = process.platform === 'aix' ? 'exp' : 'x'
179+
if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') {
180+
var ext = process.platform === 'os390' ? 'x' : 'exp'
181181
var nodeRootDir = findNodeDirectory()
182182
var candidates
183183

184-
if (process.platform === 'aix') {
184+
if (process.platform === 'aix' || process.platform === 'os400') {
185185
candidates = [
186186
'include/node/node',
187187
'out/Release/node',
@@ -276,7 +276,7 @@ function configure (gyp, argv, callback) {
276276
argv.push('-Dlibrary=shared_library')
277277
argv.push('-Dvisibility=default')
278278
argv.push('-Dnode_root_dir=' + nodeDir)
279-
if (process.platform === 'aix' || process.platform === 'os390') {
279+
if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') {
280280
argv.push('-Dnode_exp_file=' + nodeExpFile)
281281
if (process.platform === 'os390' && zoslibIncDir) {
282282
argv.push('-Dzoslib_include_dir=' + zoslibIncDir)

test/test-find-node-directory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const test = require('tap').test
44
const path = require('path')
55
const findNodeDirectory = require('../lib/find-node-directory')
66

7-
const platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix']
7+
const platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix', 'os400']
88

99
// we should find the directory based on the directory
1010
// the script is running in and it should match the layout

0 commit comments

Comments
 (0)