Skip to content

Commit

Permalink
Merge pull request #1 from ibmruntimes/v8-node14-zos
Browse files Browse the repository at this point in the history
zos: rebase and apply custom compile flags to support Node v8, v12 and v14
  • Loading branch information
gabylb authored Jul 10, 2020
2 parents 11d557d + d6ec935 commit b5d8614
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 84 deletions.
27 changes: 23 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
['OS=="mac"', {
'javaver%' : "<!(awk -F/ -v h=`node findJavaHome.js` 'BEGIN {n=split(h, a); print a[2]; exit}')"
}],
['OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
['OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" or OS=="zos"', {
'javalibdir%': "<!(./find_java_libdir.sh <(target_arch) <(OS))"
}],
['OS=="zos"', {
'nodever%': '<!(node -e "console.log(process.versions.node)" | cut -d"." -f1)'
}],
]
},
'targets': [
Expand Down Expand Up @@ -101,9 +104,25 @@
]
}
],
["OS=='zos'", {
"cflags!": [ "-O2", "-O3" ]
}],
['OS=="zos"',
{
'conditions': [
['nodever<14',
{
'cflags!': [ "-O2", "-O3" ]
}
],
['nodever<12',
{
'cflags': [ "-U_VARARG_EXT_" ],
}
]
],
'libraries': [
'<(javalibdir)/libjvm.x'
]
}
],
['OS=="mac"',
{
'xcode_settings': {
Expand Down
4 changes: 3 additions & 1 deletion find_java_libdir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ main () {
fi

local jre_dir
if [[ "${java_version}" =~ (6|7|8) ]]; then
if [[ "${java_version}" =~ (6|7|8) && "${os}" != "zos" ]]; then
jre_dir="${java_home}/jre/lib"
else
jre_dir="${java_home}/lib"
Expand All @@ -43,6 +43,8 @@ main () {
if [[ -d ${jre_dir}/amd64/classic ]]; then lib_dir="${jre_dir}"/amd64/classic; else lib_dir="${jre_dir}"/amd64/server; fi
elif [[ "${os}" == "linux" ]] && [[ "${target_arch}" == "s390x" || "${target_arch}" == "s390" ]]; then
if [[ -d ${jre_dir}/s390x/classic ]]; then lib_dir="${jre_dir}"/s390x/classic; else lib_dir="${jre_dir}"/s390/classic; fi
elif [[ "${os}" == "zos" ]]; then
lib_dir="${jre_dir}"/s390x/classic
elif [[ "${os}" == "linux" ]] && [[ "${target_arch}" == "ppc64" || "${target_arch}" == "ppc" ]]; then
target_arch=`uname -m`
if [[ -d ${jre_dir}/${target_arch}/classic ]]; then lib_dir="${jre_dir}"/${target_arch}/classic; else lib_dir="${jre_dir}"/${target_arch}/server; fi
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"jvm",
"bridge"
],
"version": "0.11.1",
"version": "0.12.1",
"engines": {
"node": ">=7.0.0"
},
Expand Down
Loading

0 comments on commit b5d8614

Please sign in to comment.