Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
['OS=="win"', {
'javahome%': '<!(node findJavaHome.js)'
}],
['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"' , {
'javahome%': '<!(node findJavaHome.js)'
}],
['OS=="mac"', {
'javaver%' : "<!(awk -F/ -v h=`node findJavaHome.js` 'BEGIN {n=split(h, a); print a[2]; exit}')"
'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,6 +104,25 @@
]
}
],
['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
5 changes: 4 additions & 1 deletion src/methodCallBaton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,8 @@ InstanceMethodCallBaton::InstanceMethodCallBaton(
}

InstanceMethodCallBaton::~InstanceMethodCallBaton() {
m_javaObject->Unref();
if (m_javaObject) {
m_javaObject->Unref();
m_javaObject = NULL;
}
}