Skip to content

Commit 56c33b3

Browse files
committed
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 27c9888 commit 56c33b3

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

addon.gypi

+5
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

+2
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ function configure (gyp, argv, callback) {
153153
// For AIX and z/OS we need to set up the path to the exports file
154154
// which contains the symbols needed for linking.
155155
var nodeExpFile
156-
if (process.platform === 'aix' || process.platform === 'os390') {
157-
var ext = process.platform === 'aix' ? 'exp' : 'x'
156+
if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') {
157+
var ext = process.platform === 'os390' ? 'x' : 'exp'
158158
var nodeRootDir = findNodeDirectory()
159159
var candidates
160160

161-
if (process.platform === 'aix') {
161+
if (process.platform === 'aix' || process.platform === 'os400') {
162162
candidates = [
163163
'include/node/node',
164164
'out/Release/node',
@@ -215,7 +215,7 @@ function configure (gyp, argv, callback) {
215215
argv.push('-Dlibrary=shared_library')
216216
argv.push('-Dvisibility=default')
217217
argv.push('-Dnode_root_dir=' + nodeDir)
218-
if (process.platform === 'aix' || process.platform === 'os390') {
218+
if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') {
219219
argv.push('-Dnode_exp_file=' + nodeExpFile)
220220
}
221221
argv.push('-Dnode_gyp_dir=' + nodeGypDir)

test/test-find-node-directory.js

+1-1
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)