Hi,
I'm from the Fedora MinGW project (http://fedoraproject.org/wiki/MinGW), and we are cross-compiling a number of Linux libraries, from Fedora targeting Windows. So I hope this is the right place to post a couple of libgsf patches which enable libgsf to be cross-compiled using Fedora MinGW cross-compiler.
The first patch changes the way that libbz2 / bzlib.h is detected. It is my understanding that both the library and the header file are needed in order to enable BZ2 support. However autoconf's AC_CHECK_LIB cannot be used to check whether -lbz2 works on its own on Windows, for rather complex reasons which are better explained by referring to this thread:
http://www.nabble.com/failed-tests-AC_CHECK_LIB-td19588119.html#a19589469
So the first patch replaces the pair of tests with an invocation of AC_LINK_IFELSE that tries to compile and link a program with both the header file and a call to the sentinel library function.
The second patch, considerably simpler, enables deprecated functions in glib, because otherwise G_WIN32_DLLMAIN_FOR_DLL_NAME isn't defined in gsf/gsf-utils.c. I'm not really familiar with what this macro does, and maybe a better solution is just to not use it if the macro isn't defined.
Here is our development repository: http://hg.et.redhat.com/misc/fedora-mingw--devel If we make any updates then you can get the latest specfile and patches by clicking 'manifest', then 'libgsf'.
Rich.
On Sat, Nov 22, 2008 at 09:55:51PM +0000, Richard W.M. Jones wrote:
So I hope this is the right place to post a couple of libgsf patches which enable libgsf to be cross-compiled using Fedora MinGW cross-compiler.
You've got the right place.
The first patch changes the way that libbz2 / bzlib.h is detected. http://www.nabble.com/failed-tests-AC_CHECK_LIB-td19588119.html#a19589469
Applied along with a minor cosmetic tweak. Thanks for looking at this. I also tidied up our gnumeric-win32 patches for bzip2 to be more work properly.
The second patch, considerably simpler, enables deprecated functions in glib, because otherwise G_WIN32_DLLMAIN_FOR_DLL_NAME isn't defined in gsf/gsf-utils.c. I'm not really familiar with what this macro does, and maybe a better solution is just to not use it if the macro isn't defined.
I went a different direction on this one and implemented a DllMain routine to stash the hinst which appears to be what most others do. We only needed it to access installation prefix when initializing gettext.
Thanks for the assistance. Patches will be in 1.14.11