After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 704185 - GnuCash 2.5 doesn't build on FreeBSD - undefined symbols 'timezone' and 'daylight'
GnuCash 2.5 doesn't build on FreeBSD - undefined symbols 'timezone' and 'dayl...
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: General
2.5.x
Other FreeBSD
: Normal normal
: ---
Assigned To: John Ralls
gnucash-general-maint
Depends on:
Blocks:
 
 
Reported: 2013-07-14 08:59 UTC by Graham Menhennitt
Modified: 2018-06-29 23:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to build on FreeBSD (1.22 KB, patch)
2013-07-14 08:59 UTC, Graham Menhennitt
none Details | Review

Description Graham Menhennitt 2013-07-14 08:59:43 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.
Comment 1 John Ralls 2013-07-14 17:12:09 UTC
I looked to see if we actually use those globals anywhere, and we don't, so I removed them. r23106.

Thanks for your patience.
Comment 2 John Ralls 2018-06-29 23:17:25 UTC
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.