GNOME Bugzilla – Bug 92060
Compilation on Windows
Last modified: 2006-05-08 10:31:35 UTC
Summary of problems: 1- The addition of: LIBGDA_CFLAGS=$(echo $LIBGDA_FLAGS -I/include/glib-2.0 -I/lib/glib-2.0/include) to configure should not be necessary if pkg-config works ok, which seems not to be the case. The problem is the glib's pkg-config file in $prefix/lib/pkgconfig which contains the bogus line prefix=/target 2- The pre-compiled libraries for glib stuff in http://www.gimp.org/~tml/gimp/win32/downloads.html are compiled with the -mno-cygwin -fnative-struct flags and so other code using them must also be compiled with the same options. This means either: - forget cygwin and the porting of libgda to Windows is harder - port glib for cygwin (hard) and the porting of libgda is easier 3- Minor bug in gda_config_get_provider_list (void) There is no need to look for libraries with ".so" extension. This would transparently support ".dll" libraries. But is g_module_open really able to load a .dll???
The answer to 3 is: yes. #include <glib.h> #include <gmodule.h> int main (int argc, char *argv[]) { GModule *mod; if (argc == 1) return 1; g_print ("Trying to load %s %d\n", argv [1], g_module_supported ()); mod = g_module_open (argv [1], G_MODULE_BIND_LAZY); if (mod == NULL) { g_print ("Failed: %s\n", g_module_error ()); return 1; } else { g_print ("It works!\n"); g_module_close (mod); return 0; } } Compile this program and give it something like: C:/cygwin/bin/cygpcre (loading directly from dlname works) C:/cygwin/lib/libpcre (fails and there is a .la file with a dlname field that is equals to "../bin/cygpcre.dll")
Yes, but the problem is that we just have a directory, and we have to get all providers that are in that directory. For linux/unix, in that dir there is a .so, a .a and a .la for each provider. So, how can we read the directory and just open the correct file? I added the check for .so because it opened correctly both the .a and the .so, so I loaded twice each provider. So, how can we discard files? Check for .so and .dll extensions?
It looks like this should be a constant defined at ./configure time. If environment is Linux, use ".so", if Windows, use ".dll", ...
G_MODULE_SUFFIX :-) It's "dll" on windows, "so" on linux, "sl" on HP-UX...
ok, I added the usage of G_MODULE_SUFFIX. It works on linux, so please test it on windows.
Let's assume this was fixed. Please reopen if it wasn't.