Commit 054cdd23a204523757ffeefb557dac81c5b37d49

Authored by perry.werneck@gmail.com
1 parent 31b86eaa

Corrigindo carga de plugins em linux

@@ -150,7 +150,7 @@ case "$host" in @@ -150,7 +150,7 @@ case "$host" in
150 LDSOFLAGS="-Wl,-soname,\`basename \$@\`" 150 LDSOFLAGS="-Wl,-soname,\`basename \$@\`"
151 LDAPPFLAGS="" 151 LDAPPFLAGS=""
152 DBGRPATH="-Wl,--rpath,.bin/Debug/lib" 152 DBGRPATH="-Wl,--rpath,.bin/Debug/lib"
153 - DBGCMDPREFIX="PATH=\$(BINDIR)/Debug/lib:\$(PATH)" 153 + DBGCMDPREFIX="LD_LIBRARY_PATH=\$(BINDIR)/Debug/lib"
154 154
155 esac 155 esac
156 156
src/plugins/dbus3270/Makefile.in
@@ -119,7 +119,7 @@ Debug: $(BINDBG)/plugins/$(MODULE_NAME).so @@ -119,7 +119,7 @@ Debug: $(BINDBG)/plugins/$(MODULE_NAME).so
119 $(BINDBG)/plugins/$(MODULE_NAME).so: $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJDBG)/$(SRC).o) 119 $(BINDBG)/plugins/$(MODULE_NAME).so: $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJDBG)/$(SRC).o)
120 @echo " CCLD `basename $@`" 120 @echo " CCLD `basename $@`"
121 @$(MKDIR) `dirname $@` 121 @$(MKDIR) `dirname $@`
122 - @$(LD) $(DLL_FLAGS) -Wl,-soname,`basename $@` $(LDFLAGS) -o $@ $^ $(LIBS) $(LIB3270_LIBS) $(PW3270_LIBS) $(GLIB_LIBS) $(GTK_LIBS) 122 + @$(LD) $(DLL_FLAGS) @DBGRPATH@ -Wl,-soname,`basename $@` $(LDFLAGS) -o $@ $^ $(LIBS) $(LIB3270_LIBS) $(PW3270_LIBS) $(GLIB_LIBS) $(GTK_LIBS)
123 123
124 #---[ Misc targets ]----------------------------------------------------------- 124 #---[ Misc targets ]-----------------------------------------------------------
125 125
src/pw3270/plugin.c
@@ -64,10 +64,17 @@ @@ -64,10 +64,17 @@
64 { 64 {
65 gchar *filename = g_build_filename(path,name,NULL); 65 gchar *filename = g_build_filename(path,name,NULL);
66 66
  67 +// trace("%s is %s",filename,g_str_has_suffix(filename,G_MODULE_SUFFIX) ? "valid" : "invalid");
  68 +
67 if(g_str_has_suffix(filename,G_MODULE_SUFFIX)) 69 if(g_str_has_suffix(filename,G_MODULE_SUFFIX))
68 { 70 {
69 GModule *handle = g_module_open(filename,G_MODULE_BIND_LOCAL); 71 GModule *handle = g_module_open(filename,G_MODULE_BIND_LOCAL);
70 - if(handle) 72 +
  73 + if(!handle)
  74 + {
  75 + g_message("Error \"%s\" loading %s",g_module_error(),filename);
  76 + }
  77 + else
71 { 78 {
72 int (*init)(GtkWidget *); 79 int (*init)(GtkWidget *);
73 80
@@ -82,6 +89,7 @@ @@ -82,6 +89,7 @@
82 { 89 {
83 // Plugin init is ok, save handle 90 // Plugin init is ok, save handle
84 lst = g_list_append(lst,handle); 91 lst = g_list_append(lst,handle);
  92 + trace("%s=%p",filename,handle);
85 } 93 }
86 } 94 }
87 else 95 else
@@ -105,7 +113,7 @@ @@ -105,7 +113,7 @@
105 int f; 113 int f;
106 114
107 nPlugin = g_list_length(lst); 115 nPlugin = g_list_length(lst);
108 - g_message("%d plugin(s) loaded",nPlugin); 116 + g_message("%d plugin%s loaded",nPlugin,nPlugin > 1 ? "s" : "");
109 hPlugin = g_malloc0(nPlugin * sizeof(GModule *)); 117 hPlugin = g_malloc0(nPlugin * sizeof(GModule *));
110 118
111 for(f=0;f<nPlugin && l;f++) 119 for(f=0;f<nPlugin && l;f++)
@@ -158,6 +166,7 @@ @@ -158,6 +166,7 @@
158 g_free(dir); 166 g_free(dir);
159 167
160 #endif 168 #endif
  169 +
161 } 170 }
162 171
163 LIB3270_EXPORT void pw3270_deinit_plugins(GtkWidget *widget) 172 LIB3270_EXPORT void pw3270_deinit_plugins(GtkWidget *widget)