From 552c7febc3fa5c5a3e754493998f9dd2dd72c3a5 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 22 Mar 2017 11:31:35 -0300 Subject: [PATCH] Ajustes para compilação em windows. --- configure.ac | 17 ++++++++++++++++- src/include/java3270.h | 2 -- src/plugin/Makefile.in | 2 +- src/plugin/plugin.cc | 2 -- src/plugin/startstop.cc | 13 +++++++------ 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 0925da0..ea54b73 100644 --- a/configure.ac +++ b/configure.ac @@ -245,7 +245,7 @@ if test "$app_cv_java" = "yes" ; then else - AC_MSG_NOTICE([jdk is NOT present or disabled.]) + AC_MSG_ERROR([jdk is NOT present or disabled.]) fi @@ -275,6 +275,21 @@ AC_SUBST(GTK_LIBS) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_VERSION,`$PKG_CONFIG --modversion gtk+-3.0`) +dnl --------------------------------------------------------------------------- +dnl Check for lib3270 +dnl --------------------------------------------------------------------------- + +PKG_CHECK_MODULES( [LIB3270], [lib3270], AC_DEFINE(HAVE_LIB3270), AC_MSG_ERROR([Can't find lib3270 devel.])) +AC_SUBST(LIB3270_LIBS) +AC_SUBST(LIB3270_CFLAGS) + +dnl --------------------------------------------------------------------------- +dnl Check for PW3270 +dnl --------------------------------------------------------------------------- + +PKG_CHECK_MODULES( [PW3270], [pw3270], AC_DEFINE(HAVE_PW3270), AC_MSG_ERROR([Can't find lib3270 devel.])) +AC_SUBST(PW3270_LIBS) +AC_SUBST(PW3270_CFLAGS) dnl --------------------------------------------------------------------------- dnl Check for integer types & library functions diff --git a/src/include/java3270.h b/src/include/java3270.h index ff30bc6..dc3863e 100644 --- a/src/include/java3270.h +++ b/src/include/java3270.h @@ -41,8 +41,6 @@ extern "C" { #endif - LIB3270_EXPORT void java3270_set_session(H3270 *session); - #ifdef __cplusplus } #endif diff --git a/src/plugin/Makefile.in b/src/plugin/Makefile.in index 673230d..16d8db5 100644 --- a/src/plugin/Makefile.in +++ b/src/plugin/Makefile.in @@ -69,7 +69,7 @@ CXX=@CXX@ CC=@CC@ LD=@CXX@ -LIBS=-lpw3270cpp @LIBS@ @GTK_LIBS@ +LIBS=-lpw3270cpp @PW3270_LIBS@ @LIB3270_LIBS@ @LIBS@ @GTK_LIBS@ CXXFLAGS=@CXXFLAGS@ @GTK_CFLAGS@ \ -I../include \ -DJARDIR="\"${jardir}\"" \ diff --git a/src/plugin/plugin.cc b/src/plugin/plugin.cc index d2cf908..b13df37 100644 --- a/src/plugin/plugin.cc +++ b/src/plugin/plugin.cc @@ -108,8 +108,6 @@ extern "C" { g_mutex_init(&mutex); #endif // GTK_CHECK_VERSION - java3270_set_session(lib3270_get_default_session_handle()); - return 0; } diff --git a/src/plugin/startstop.cc b/src/plugin/startstop.cc index ecee599..d9c7d46 100644 --- a/src/plugin/startstop.cc +++ b/src/plugin/startstop.cc @@ -170,6 +170,7 @@ bool load_jvm(GtkWidget *widget) { // Dynamically load jvm library to avoid naming and path problems. HMODULE kernel; + HMODULE hModule; HANDLE WINAPI (*AddDllDirectory)(PCWSTR NewDirectory); BOOL WINAPI (*RemoveDllDirectory)(HANDLE Cookie); @@ -214,19 +215,19 @@ bool load_jvm(GtkWidget *widget) { } else { - lib3270_trace_event(v3270_get_session(widget),"Can't find %s: %s","AddDllDirectory",session::win32_strerror(GetLastError()).c_str()); + lib3270_trace_event(v3270_get_session(widget),"Can't find %s: %s","AddDllDirectory",lib3270_win32_strerror(GetLastError())); } } else { - lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n","kernel32.dll",session::win32_strerror(GetLastError()).c_str()); + lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n","kernel32.dll",lib3270_win32_strerror(GetLastError())); } hModule = LoadLibrary("jvm.dll"); if(!hModule) { - lib3270_trace_event(v3270_get_session(widget),"Can't load %s\n","jvm.dll",session::win32_strerror(GetLastError()).c_str()); + lib3270_trace_event(v3270_get_session(widget),"Can't load %s\n","jvm.dll",lib3270_win32_strerror(GetLastError())); for(size_t f = 0; !hModule && f < G_N_ELEMENTS(dlldir); f++) { @@ -239,7 +240,7 @@ bool load_jvm(GtkWidget *widget) { gchar *p = g_build_filename(env,dlldir[f].path,"jvm.dll",NULL); hModule = LoadLibrary(p); if(!hModule) { - lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n",p,session::win32_strerror(GetLastError()).c_str()); + lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n",p,lib3270_win32_strerror(GetLastError())); } g_free(p); @@ -248,7 +249,7 @@ bool load_jvm(GtkWidget *widget) { } if(!hModule) { - failed(widget, _( "Can't load java virtual machine" ), "%s", session::win32_strerror(GetLastError()).c_str()); + failed(widget, _( "Can't load java virtual machine" ), "%s", lib3270_win32_strerror(GetLastError())); } if(kernel) { @@ -279,7 +280,7 @@ bool load_jvm(GtkWidget *widget) { jint JNICALL (*CreateJavaVM)(JavaVM **, void **, void *) = (jint JNICALL (*)(JavaVM **, void **, void *)) GetProcAddress(hModule,"JNI_CreateJavaVM"); if(!CreateJavaVM) { - failed(widget, _( "Can't load java virtual machine creation method" ), "%s", session::win32_strerror(GetLastError()).c_str()); + failed(widget, _( "Can't load java virtual machine creation method" ), "%s", lib3270_win32_strerror(GetLastError())); return false; } -- libgit2 0.21.2