2.5 on FreeBSD (was Re: 2.5.1 on FreeBSD 9-Stable)

Graham Menhennitt graham at menhennitt.com.au
Sat Jul 13 20:02:22 EDT 2013

On 06/05/2013 07:50, John Ralls wrote:
> On May 5, 2013, at 1:37 PM, Graham Menhennitt <graham at menhennitt.com.au> wrote:
>> On 06/05/2013 01:28, John Ralls wrote:
>>> On May 5, 2013, at 2:45 AM, Graham Menhennitt <graham at menhennitt.com.au> wrote:
>>>> I thought I'd try building GnuCash 2.5.1 on FreeBSD 9-STable. I copied
>>>> the port directory, changed the version to 2.5.1, and fixed the file
>>>> size and SHA256 values to suit. I then started the build. It progresses
>>>> for a few seconds and then exits with an error:
>>>> libtool: compile:  cc -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/libc
>>>> -I../../../src -pthread -I/usr/local/include/glib-2.0
>>>> -I/usr/local/include -DG_LOG_DOMAIN=\"qof\" -I/usr/local/include
>>>> -Wdeclaration-after-statement -Wno-pointer-sign -D_FORTIFY_SOURCE=2 -O2
>>>> -pipe -fno-strict-aliasing -Wall -Wunused -Wmissing-prototypes
>>>> -Wmissing-declarations -Wno-unused -MT gnc-date.lo -MD -MP -MF
>>>> .deps/gnc-date.Tpo -c gnc-date.c  -fPIC -DPIC -o .libs/gnc-date.o
>>>> gnc-date.c: In function 'gnc_localtime_r':
>>>> gnc-date.c:310: error: lvalue required as left operand of assignment
>>>> gnc-date.c:314: error: 'daylight' undeclared (first use in this function)
>>>> gnc-date.c:314: error: (Each undeclared identifier is reported only once
>>>> gnc-date.c:314: error: for each function it appears in.)
>>>> gnc-date.c:319: error: wrong type argument to unary minus
>>>> gmake[5]: *** [gnc-date.lo] Error 1
>>>> I can't see the variables "timezone" and "daylight" declared anywhere so
>>>> I'm not surprised that it doesn't compile. How does this work on Linux?
>>>> Are they globals or something? If so, where are they declared?
>>> Yes, they are globals defined in time.h on both Linux and Darwin. If they're not there on FreeBSD
>>> we'll have to define them in an ifdef, but IIRC they're part of the POSIX spec so it would be strange
>>> if they're not there.
>>> Regards,
>>> John Ralls
>> Thanks for replying, John.
>> Well they don't exist here. The only mention of "daylight" in
>> /usr/include is in a comment. And "timezone" is the name of a function:
>> #if __BSD_VISIBLE
>> char *timezone(int, int);       /* XXX XSI conflict */
>> void tzsetwall(void);
>> time_t timelocal(struct tm * const);
>> time_t timegm(struct tm * const);
>> #endif /* __BSD_VISIBLE */
>> This must have changed since 2.4 as that builds fine. Looking at the
>> same file in 2.4.11, there doesn't seem to be anything similar.
> Please remember to copy all replies to the list: Use "Reply All" or if your client supports it "Reply List".
> Yes, gnc-date is thoroughly rewritten for 2.6. The POSIX-compliant functions are designed to fail in 2038, and we've had user complaints about being unable to set up mortgages which extend beyond that date.
> I'll set up a FreeBSD VM and see what I can figure out for 2.5.2. Thanks for the report.
> Regards,
> John Ralls
G'day John,

I tried 2.5.3 (and 2.5.2) on FreeBSD and still have the same problem.
It's trivial to make the changes to get it to build. With those changes,
it seems to  run correctly (although I'm not currently in Daylight
Saving, so I'm not sure if that works correctly). However, I very much
doubt that my trivial fix is the "correct" way of doing it. Could you
please have another look at this.


More information about the gnucash-devel mailing list