Commit 552c7febc3fa5c5a3e754493998f9dd2dd72c3a5

Authored by Perry Werneck
1 parent 4634de31
Exists in master

Ajustes para compilação em windows.

@@ -245,7 +245,7 @@ if test "$app_cv_java" = "yes" ; then @@ -245,7 +245,7 @@ if test "$app_cv_java" = "yes" ; then
245 245
246 else 246 else
247 247
248 - AC_MSG_NOTICE([jdk is NOT present or disabled.]) 248 + AC_MSG_ERROR([jdk is NOT present or disabled.])
249 249
250 fi 250 fi
251 251
@@ -275,6 +275,21 @@ AC_SUBST(GTK_LIBS) @@ -275,6 +275,21 @@ AC_SUBST(GTK_LIBS)
275 AC_SUBST(GTK_CFLAGS) 275 AC_SUBST(GTK_CFLAGS)
276 AC_SUBST(GTK_VERSION,`$PKG_CONFIG --modversion gtk+-3.0`) 276 AC_SUBST(GTK_VERSION,`$PKG_CONFIG --modversion gtk+-3.0`)
277 277
  278 +dnl ---------------------------------------------------------------------------
  279 +dnl Check for lib3270
  280 +dnl ---------------------------------------------------------------------------
  281 +
  282 +PKG_CHECK_MODULES( [LIB3270], [lib3270], AC_DEFINE(HAVE_LIB3270), AC_MSG_ERROR([Can't find lib3270 devel.]))
  283 +AC_SUBST(LIB3270_LIBS)
  284 +AC_SUBST(LIB3270_CFLAGS)
  285 +
  286 +dnl ---------------------------------------------------------------------------
  287 +dnl Check for PW3270
  288 +dnl ---------------------------------------------------------------------------
  289 +
  290 +PKG_CHECK_MODULES( [PW3270], [pw3270], AC_DEFINE(HAVE_PW3270), AC_MSG_ERROR([Can't find lib3270 devel.]))
  291 +AC_SUBST(PW3270_LIBS)
  292 +AC_SUBST(PW3270_CFLAGS)
278 293
279 dnl --------------------------------------------------------------------------- 294 dnl ---------------------------------------------------------------------------
280 dnl Check for integer types & library functions 295 dnl Check for integer types & library functions
src/include/java3270.h
@@ -41,8 +41,6 @@ @@ -41,8 +41,6 @@
41 extern "C" { 41 extern "C" {
42 #endif 42 #endif
43 43
44 - LIB3270_EXPORT void java3270_set_session(H3270 *session);  
45 -  
46 #ifdef __cplusplus 44 #ifdef __cplusplus
47 } 45 }
48 #endif 46 #endif
src/plugin/Makefile.in
@@ -69,7 +69,7 @@ CXX=@CXX@ @@ -69,7 +69,7 @@ CXX=@CXX@
69 CC=@CC@ 69 CC=@CC@
70 LD=@CXX@ 70 LD=@CXX@
71 71
72 -LIBS=-lpw3270cpp @LIBS@ @GTK_LIBS@ 72 +LIBS=-lpw3270cpp @PW3270_LIBS@ @LIB3270_LIBS@ @LIBS@ @GTK_LIBS@
73 CXXFLAGS=@CXXFLAGS@ @GTK_CFLAGS@ \ 73 CXXFLAGS=@CXXFLAGS@ @GTK_CFLAGS@ \
74 -I../include \ 74 -I../include \
75 -DJARDIR="\"${jardir}\"" \ 75 -DJARDIR="\"${jardir}\"" \
src/plugin/plugin.cc
@@ -108,8 +108,6 @@ extern "C" { @@ -108,8 +108,6 @@ extern "C" {
108 g_mutex_init(&mutex); 108 g_mutex_init(&mutex);
109 #endif // GTK_CHECK_VERSION 109 #endif // GTK_CHECK_VERSION
110 110
111 - java3270_set_session(lib3270_get_default_session_handle());  
112 -  
113 return 0; 111 return 0;
114 } 112 }
115 113
src/plugin/startstop.cc
@@ -170,6 +170,7 @@ bool load_jvm(GtkWidget *widget) { @@ -170,6 +170,7 @@ bool load_jvm(GtkWidget *widget) {
170 170
171 // Dynamically load jvm library to avoid naming and path problems. 171 // Dynamically load jvm library to avoid naming and path problems.
172 HMODULE kernel; 172 HMODULE kernel;
  173 + HMODULE hModule;
173 HANDLE WINAPI (*AddDllDirectory)(PCWSTR NewDirectory); 174 HANDLE WINAPI (*AddDllDirectory)(PCWSTR NewDirectory);
174 BOOL WINAPI (*RemoveDllDirectory)(HANDLE Cookie); 175 BOOL WINAPI (*RemoveDllDirectory)(HANDLE Cookie);
175 176
@@ -214,19 +215,19 @@ bool load_jvm(GtkWidget *widget) { @@ -214,19 +215,19 @@ bool load_jvm(GtkWidget *widget) {
214 215
215 } else { 216 } else {
216 217
217 - lib3270_trace_event(v3270_get_session(widget),"Can't find %s: %s","AddDllDirectory",session::win32_strerror(GetLastError()).c_str()); 218 + lib3270_trace_event(v3270_get_session(widget),"Can't find %s: %s","AddDllDirectory",lib3270_win32_strerror(GetLastError()));
218 219
219 } 220 }
220 221
221 } else { 222 } else {
222 223
223 - lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n","kernel32.dll",session::win32_strerror(GetLastError()).c_str()); 224 + lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n","kernel32.dll",lib3270_win32_strerror(GetLastError()));
224 225
225 } 226 }
226 227
227 hModule = LoadLibrary("jvm.dll"); 228 hModule = LoadLibrary("jvm.dll");
228 if(!hModule) { 229 if(!hModule) {
229 - lib3270_trace_event(v3270_get_session(widget),"Can't load %s\n","jvm.dll",session::win32_strerror(GetLastError()).c_str()); 230 + lib3270_trace_event(v3270_get_session(widget),"Can't load %s\n","jvm.dll",lib3270_win32_strerror(GetLastError()));
230 231
231 for(size_t f = 0; !hModule && f < G_N_ELEMENTS(dlldir); f++) { 232 for(size_t f = 0; !hModule && f < G_N_ELEMENTS(dlldir); f++) {
232 233
@@ -239,7 +240,7 @@ bool load_jvm(GtkWidget *widget) { @@ -239,7 +240,7 @@ bool load_jvm(GtkWidget *widget) {
239 gchar *p = g_build_filename(env,dlldir[f].path,"jvm.dll",NULL); 240 gchar *p = g_build_filename(env,dlldir[f].path,"jvm.dll",NULL);
240 hModule = LoadLibrary(p); 241 hModule = LoadLibrary(p);
241 if(!hModule) { 242 if(!hModule) {
242 - lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n",p,session::win32_strerror(GetLastError()).c_str()); 243 + lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n",p,lib3270_win32_strerror(GetLastError()));
243 } 244 }
244 g_free(p); 245 g_free(p);
245 246
@@ -248,7 +249,7 @@ bool load_jvm(GtkWidget *widget) { @@ -248,7 +249,7 @@ bool load_jvm(GtkWidget *widget) {
248 } 249 }
249 250
250 if(!hModule) { 251 if(!hModule) {
251 - failed(widget, _( "Can't load java virtual machine" ), "%s", session::win32_strerror(GetLastError()).c_str()); 252 + failed(widget, _( "Can't load java virtual machine" ), "%s", lib3270_win32_strerror(GetLastError()));
252 } 253 }
253 254
254 if(kernel) { 255 if(kernel) {
@@ -279,7 +280,7 @@ bool load_jvm(GtkWidget *widget) { @@ -279,7 +280,7 @@ bool load_jvm(GtkWidget *widget) {
279 jint JNICALL (*CreateJavaVM)(JavaVM **, void **, void *) = (jint JNICALL (*)(JavaVM **, void **, void *)) GetProcAddress(hModule,"JNI_CreateJavaVM"); 280 jint JNICALL (*CreateJavaVM)(JavaVM **, void **, void *) = (jint JNICALL (*)(JavaVM **, void **, void *)) GetProcAddress(hModule,"JNI_CreateJavaVM");
280 281
281 if(!CreateJavaVM) { 282 if(!CreateJavaVM) {
282 - failed(widget, _( "Can't load java virtual machine creation method" ), "%s", session::win32_strerror(GetLastError()).c_str()); 283 + failed(widget, _( "Can't load java virtual machine creation method" ), "%s", lib3270_win32_strerror(GetLastError()));
283 return false; 284 return false;
284 } 285 }
285 286