Commit 054cdd23a204523757ffeefb557dac81c5b37d49
1 parent
31b86eaa
Exists in
master
and in
5 other branches
Corrigindo carga de plugins em linux
Showing
3 changed files
with
13 additions
and
4 deletions
Show diff stats
configure.ac
... | ... | @@ -150,7 +150,7 @@ case "$host" in |
150 | 150 | LDSOFLAGS="-Wl,-soname,\`basename \$@\`" |
151 | 151 | LDAPPFLAGS="" |
152 | 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 | 155 | esac |
156 | 156 | ... | ... |
src/plugins/dbus3270/Makefile.in
... | ... | @@ -119,7 +119,7 @@ Debug: $(BINDBG)/plugins/$(MODULE_NAME).so |
119 | 119 | $(BINDBG)/plugins/$(MODULE_NAME).so: $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJDBG)/$(SRC).o) |
120 | 120 | @echo " CCLD `basename $@`" |
121 | 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 | 124 | #---[ Misc targets ]----------------------------------------------------------- |
125 | 125 | ... | ... |
src/pw3270/plugin.c
... | ... | @@ -64,10 +64,17 @@ |
64 | 64 | { |
65 | 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 | 69 | if(g_str_has_suffix(filename,G_MODULE_SUFFIX)) |
68 | 70 | { |
69 | 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 | 79 | int (*init)(GtkWidget *); |
73 | 80 | |
... | ... | @@ -82,6 +89,7 @@ |
82 | 89 | { |
83 | 90 | // Plugin init is ok, save handle |
84 | 91 | lst = g_list_append(lst,handle); |
92 | + trace("%s=%p",filename,handle); | |
85 | 93 | } |
86 | 94 | } |
87 | 95 | else |
... | ... | @@ -105,7 +113,7 @@ |
105 | 113 | int f; |
106 | 114 | |
107 | 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 | 117 | hPlugin = g_malloc0(nPlugin * sizeof(GModule *)); |
110 | 118 | |
111 | 119 | for(f=0;f<nPlugin && l;f++) |
... | ... | @@ -158,6 +166,7 @@ |
158 | 166 | g_free(dir); |
159 | 167 | |
160 | 168 | #endif |
169 | + | |
161 | 170 | } |
162 | 171 | |
163 | 172 | LIB3270_EXPORT void pw3270_deinit_plugins(GtkWidget *widget) | ... | ... |