Skip to content

Commit

Permalink
link to libjvm.x on z/OS
Browse files Browse the repository at this point in the history
Find Java's lib_dir to link to libjvm.x, instead of assuming
users have their LDFLAGS env variable set to that path.
  • Loading branch information
gabylb committed Jul 9, 2020
1 parent 457e708 commit d6ec935
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
['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)',
'nodever%': '<!(node -e "console.log(process.versions.node)" | cut -d"." -f1)'
}],
]
},
Expand Down Expand Up @@ -117,6 +117,9 @@
'cflags': [ "-U_VARARG_EXT_" ],
}
]
],
'libraries': [
'<(javalibdir)/libjvm.x'
]
}
],
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

0 comments on commit d6ec935

Please sign in to comment.