Skip to content

Commit 6e0fb0e

Browse files
authored
Merge pull request #1634 from ProfoundLogic/master
Add support for building on IBM i (PASE)
2 parents 931172f + 75e363f commit 6e0fb0e

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

generate/templates/templates/binding.gyp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"variables": {
3-
"is_electron%": "<!(node ./utils/isBuildingForElectron.js <(node_root_dir))"
3+
"is_electron%": "<!(node ./utils/isBuildingForElectron.js <(node_root_dir))",
4+
"is_IBMi%": "<!(node ./utils/isBuildingForIBMi.js)"
45
},
56

67
"targets": [
@@ -153,19 +154,29 @@
153154
}
154155
],
155156
[
156-
"OS=='linux' or OS.endswith('bsd')", {
157+
"OS=='linux' or OS.endswith('bsd') or <(is_IBMi) == 1", {
157158
"cflags": [
158159
"-std=c++11"
159160
]
160161
}
161162
],
162163
[
163-
"OS.endswith('bsd') or (<(is_electron) == 1 and OS=='linux')", {
164+
"OS.endswith('bsd') or (<(is_electron) == 1 and OS=='linux') or <(is_IBMi) == 1", {
164165
"libraries": [
165166
"-lcrypto",
166167
"-lssl"
167168
],
168169
}
170+
],
171+
[
172+
"<(is_IBMi) == 1", {
173+
"include_dirs": [
174+
"/QOpenSys/pkgs/include"
175+
],
176+
"libraries": [
177+
"-L/QOpenSys/pkgs/lib"
178+
]
179+
}
169180
]
170181
]
171182
}

utils/isBuildingForIBMi.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const os = require("os");
2+
const isIBMi = (os.platform() == "aix" && os.type() == "OS400");
3+
4+
process.stdout.write(isIBMi ? "1" : "0");

vendor/libgit2.gyp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"openssl_enable_asm%": 0, # only supported with the Visual Studio 2012 (VC11) toolchain.
99
"gcc_version%": 0,
1010
"is_electron%": "<!(node ../utils/isBuildingForElectron.js <(node_root_dir))",
11-
"is_clang%": 0
11+
"is_clang%": 0,
12+
"is_IBMi%": "<!(node ../utils/isBuildingForIBMi.js)"
1213
},
1314
"targets": [
1415
{
@@ -323,7 +324,7 @@
323324
}
324325
}
325326
}],
326-
["OS=='mac' or OS=='linux' or OS.endswith('bsd')", {
327+
["OS=='mac' or OS=='linux' or OS.endswith('bsd') or <(is_IBMi) == 1", {
327328
"defines": [
328329
"GIT_SHA1_OPENSSL"
329330
],
@@ -333,7 +334,7 @@
333334
"libgit2/src/streams/tls.h"
334335
]
335336
}],
336-
["OS=='linux' or OS.endswith('bsd')" , {
337+
["OS=='linux' or OS.endswith('bsd') or <(is_IBMi) == 1", {
337338
"cflags": [
338339
"-DGIT_SSH",
339340
"-DGIT_SSL",
@@ -344,6 +345,11 @@
344345
"GIT_USE_STAT_MTIM"
345346
]
346347
}],
348+
["<(is_IBMi) == 1", {
349+
"include_dirs": [
350+
"/QOpenSys/pkgs/include",
351+
]
352+
}],
347353
["OS=='win'", {
348354
"defines": [
349355
"GIT_WINHTTP",
@@ -582,6 +588,11 @@
582588
]
583589
}
584590
}],
591+
["<(is_IBMi) == 1", {
592+
"include_dirs": [
593+
"/QOpenSys/pkgs/include"
594+
]
595+
}],
585596
]
586597
}
587598
]

0 commit comments

Comments
 (0)