Reduced JNI version from 1_6 to 1_4, and used javac and jar in PATH not in JAVA_HOME to build (on MacOS)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5759 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
fdbaad17fe
commit
5fff7be5e1
|
@ -4,7 +4,6 @@
|
|||
# and define these variables to impact your build
|
||||
|
||||
JAVA_FLAGS=@JAVA_FLAGS@
|
||||
JAVA_HOME=@JAVA_HOME@
|
||||
# Without -fno-strict-aliasing, g++ generates invalid code for Java_org_freeswitch_freeswitchJNI_SWIGJavaSessionUpcast, which segfaults
|
||||
LOCAL_CFLAGS=$(JAVA_FLAGS) -fno-strict-aliasing
|
||||
LOCAL_OBJS=freeswitch_java.o switch_swig_wrap.o
|
||||
|
@ -19,8 +18,8 @@ include ../../../../build/modmake.rules
|
|||
|
||||
local_depend:
|
||||
mkdir -p classes
|
||||
$(JAVA_HOME)/bin/javac -sourcepath src -d classes $(CLASSES)
|
||||
$(JAVA_HOME)/bin/jar cf freeswitch.jar -C classes org
|
||||
javac -sourcepath src -d classes $(CLASSES)
|
||||
jar cf freeswitch.jar -C classes org
|
||||
|
||||
reswig:
|
||||
rm -f switch_swig_wrap.cpp
|
||||
|
|
|
@ -17,7 +17,7 @@ JavaSession::~JavaSession()
|
|||
JNIEnv *env;
|
||||
jint res;
|
||||
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
|
||||
if (res == JNI_OK)
|
||||
{
|
||||
if (cb_state.function)
|
||||
|
@ -57,7 +57,7 @@ void JavaSession::setDTMFCallback(jobject dtmfCallback, char *funcargs)
|
|||
jobject globalArgs = NULL;
|
||||
jint res;
|
||||
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
|
||||
if (res != JNI_OK)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error getting JNIEnv!\n");
|
||||
|
@ -104,7 +104,7 @@ void JavaSession::setHangupHook(jobject hangupHook)
|
|||
jobject globalHangupHook;
|
||||
jint res;
|
||||
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
|
||||
if (res != JNI_OK)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error getting JNIEnv!\n");
|
||||
|
@ -143,7 +143,7 @@ void JavaSession::check_hangup_hook()
|
|||
return;
|
||||
}
|
||||
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
|
||||
if (res == JNI_EDETACHED)
|
||||
{
|
||||
res = javaVM->AttachCurrentThread((void**)&env, NULL);
|
||||
|
@ -185,7 +185,7 @@ switch_status_t JavaSession::run_dtmf_callback(void *input, switch_input_type_t
|
|||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
|
||||
res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
|
||||
if (res != JNI_OK)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error getting JNIEnv!\n");
|
||||
|
|
|
@ -229,7 +229,7 @@ static switch_status_t create_java_vm(JavaVMOption *options, int optionCount)
|
|||
jint res;
|
||||
|
||||
memset(&initArgs, 0, sizeof(initArgs));
|
||||
initArgs.version = JNI_VERSION_1_6;
|
||||
initArgs.version = JNI_VERSION_1_4;
|
||||
initArgs.nOptions = optionCount;
|
||||
initArgs.options = options;
|
||||
initArgs.ignoreUnrecognized = JNI_TRUE;
|
||||
|
|
Loading…
Reference in New Issue