Skip to content

Commit b5d8614

Browse files
authored
Merge pull request #1 from ibmruntimes/v8-node14-zos
zos: rebase and apply custom compile flags to support Node v8, v12 and v14
2 parents 11d557d + d6ec935 commit b5d8614

8 files changed

Lines changed: 137 additions & 84 deletions

File tree

binding.gyp

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@
2121
['OS=="mac"', {
2222
'javaver%' : "<!(awk -F/ -v h=`node findJavaHome.js` 'BEGIN {n=split(h, a); print a[2]; exit}')"
2323
}],
24-
['OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
24+
['OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" or OS=="zos"', {
2525
'javalibdir%': "<!(./find_java_libdir.sh <(target_arch) <(OS))"
2626
}],
27+
['OS=="zos"', {
28+
'nodever%': '<!(node -e "console.log(process.versions.node)" | cut -d"." -f1)'
29+
}],
2730
]
2831
},
2932
'targets': [
@@ -101,9 +104,25 @@
101104
]
102105
}
103106
],
104-
["OS=='zos'", {
105-
"cflags!": [ "-O2", "-O3" ]
106-
}],
107+
['OS=="zos"',
108+
{
109+
'conditions': [
110+
['nodever<14',
111+
{
112+
'cflags!': [ "-O2", "-O3" ]
113+
}
114+
],
115+
['nodever<12',
116+
{
117+
'cflags': [ "-U_VARARG_EXT_" ],
118+
}
119+
]
120+
],
121+
'libraries': [
122+
'<(javalibdir)/libjvm.x'
123+
]
124+
}
125+
],
107126
['OS=="mac"',
108127
{
109128
'xcode_settings': {

find_java_libdir.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ main () {
2323
fi
2424

2525
local jre_dir
26-
if [[ "${java_version}" =~ (6|7|8) ]]; then
26+
if [[ "${java_version}" =~ (6|7|8) && "${os}" != "zos" ]]; then
2727
jre_dir="${java_home}/jre/lib"
2828
else
2929
jre_dir="${java_home}/lib"
@@ -43,6 +43,8 @@ main () {
4343
if [[ -d ${jre_dir}/amd64/classic ]]; then lib_dir="${jre_dir}"/amd64/classic; else lib_dir="${jre_dir}"/amd64/server; fi
4444
elif [[ "${os}" == "linux" ]] && [[ "${target_arch}" == "s390x" || "${target_arch}" == "s390" ]]; then
4545
if [[ -d ${jre_dir}/s390x/classic ]]; then lib_dir="${jre_dir}"/s390x/classic; else lib_dir="${jre_dir}"/s390/classic; fi
46+
elif [[ "${os}" == "zos" ]]; then
47+
lib_dir="${jre_dir}"/s390x/classic
4648
elif [[ "${os}" == "linux" ]] && [[ "${target_arch}" == "ppc64" || "${target_arch}" == "ppc" ]]; then
4749
target_arch=`uname -m`
4850
if [[ -d ${jre_dir}/${target_arch}/classic ]]; then lib_dir="${jre_dir}"/${target_arch}/classic; else lib_dir="${jre_dir}"/${target_arch}/server; fi

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"jvm",
88
"bridge"
99
],
10-
"version": "0.11.1",
10+
"version": "0.12.1",
1111
"engines": {
1212
"node": ">=7.0.0"
1313
},

0 commit comments

Comments
 (0)