GNOME Bugzilla – Bug 704185
GnuCash 2.5 doesn't build on FreeBSD - undefined symbols 'timezone' and 'daylight'
Last modified: 2018-06-29 23:17:25 UTC
Created attachment 249105 [details] [review] patch to build on FreeBSD Building GnuCash 2.5 on FreeBSD 9-stable (and presumably all other versions) produces compiler errors. Apparently Linux has global variables 'timezone' and 'daylight'. FreeBSD doesn't have these (actually timezone() is a function). This causes compiler errors in gnc-date.c and test-gnc-date.c: 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 The attached patch allows the build to complete. The binary produced seems to run correctly, although I have not tested it during Daylight Saving. My GLib is version glib-2.34.3 (installed from FreeBSD ports). I'm not sure what the correct thing to test for in the #ifdefs should be - I've used __FreeBSD__, but there are most likely better ways of doing it. I have simply defined local variables 'timezone' and 'daylight' to avoid the compilation errors. There may be better ways of doing that.
I looked to see if we actually use those globals anywhere, and we don't, so I removed them. r23106. Thanks for your patience.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=704185. Please update any external references or bookmarks.