Fwd: Building on Windows from scratch - guile problem SOLVED
jralls at ceridwen.us
Fri Jan 10 17:45:04 EST 2014
Begin forwarded message:
> From: Gary Bilkus <mail at gary.bilkus.com>
> Subject: Re: Building on Windows from scratch - guile problem SOLVED
> Date: January 10, 2014 at 2:21:54 PM PST
> To: John Ralls <jralls at ceridwen.us>
> On 10/01/2014 17:41, Gary Bilkus wrote:
>> On 10/01/2014 15:03, John Ralls wrote:
>>> On Jan 9, 2014, at 11:13 PM, Gary Bilkus <mail at gary.bilkus.com> wrote:
>>>> Well, interestingly enough, the problem is not directly with the compiler optimizer. It's with the configure test for strncasecmp. This test fails on mingw in its current incarnation because guile uses a standard test for the function, but on mingw strncasecmp is actually a cpp definition. As a result, guile is compiled with #HAVE_STRNCASECMP unset, and so guile tries to create its own version in read.c
>>>> Now if you compile with no optimization, the compiler notices that read.c is attempting to create this with a different signature and bombs out. However, with optimisation on, the code compiles for some reason, and then fails to run properly.
>>>> So there seem to be two problems: one in configure for guile and/or the standard configure macros on mingw, the other in the compiler.
>>>> Fortunately, there's a very easy although ugly workaround, which is to add an
>>>> echo "#define HAVE_STRNCASECMP" >>config.h
>>> Would adding -DHAVE_STRNCASECMP to $CFLAGS work? It's a bit cleaner than echoing a #define into the config header.
>>> Better yet, sometimes there's a variable that can be defined on the configure command line -- perhaps $ac_have_strncasecmp -- to force configure to do the right thing.
>>>> in install-impl.sh
>>>> just after the guile configure and before the make
>>>> I've incorporated this fix into my downloadable file of fixes as referred to on the wiki page I updated.
>>>> More as and when I find any further issues. As always, feedback or other experiences welcome.
>>> John Ralls
>> I agree that the configure commandline change would be cleaner, and if I can find out what to do I'll change my fix.
>> I disagree that a CFLAGS define is cleaner. With my solution the define is in the right file, even if it gets there for the wrong reason. That way, it guarantees not to affect any compilation which doesn't involve including config.h, which saves having to check for any unexpected consequenses elsewhere.
> OK. I've found the cleaner fix. You add ac_cv_func_strncasecmp=yes as a command line argument to guile configure and then all seems good.
> Have updated my patch accordingly.
More information about the gnucash-devel