GNOME Bugzilla – Bug 569737
gnome-panel-2.24.3: clock applet uses the daylight variable from time.h which is a non posix extension and causes build failures on FreeBSD
Last modified: 2009-08-11 18:50:22 UTC
Please describe the problem: Build failure: libtool: compile: i686-gentoo-freebsd7.1-gcc -DHAVE_CONFIG_H -I. -I../.. -I./../../libpanel-applet -I../../libpanel-applet -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -D_THREAD_SAFE -DORBIT2=1 -pthread -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/gail-1.0 -I/usr/include/libglade-2.0 -I/usr/include/librsvg-2 -I/usr/include/libsoup-2.4 -DORBIT2=1 -pthread -D_THREAD_SAFE -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/gail-1.0 -I/usr/include/libglade-2.0 -DDATADIR=\"/usr/share\" -DGLADEDIR=\"/usr/share/gnome-panel/glade\" -DICONDIR=\"/usr/share/gnome-panel/pixmaps\" -DLIBDIR=\"/usr/lib\" -DSYSCONFDIR=\"/etc\" -DPREFIX=\"/usr\" -DGNOMELOCALEDIR=\"/usr/share/locale\" -DCLOCK_EDS_ICONDIR=\"\" -DCLOCK_TIME_UTILITY=\"\" -DGWEATHER_I_KNOW_THIS_IS_UNSTABLE -march=athlon-xp -O2 -pipe -g -ggdb -MT libclock_applet_la-clock.lo -MD -MP -MF .deps/libclock_applet_la-clock.Tpo -c clock.c -fPIC -DPIC -o .libs/libclock_applet_la-clock.o clock.c: In function ‘update_tooltip’: clock.c:656: error: ‘daylight’ undeclared (first use in this function) clock.c:656: error: (Each undeclared identifier is reported only once clock.c:656: error: for each function it appears in.) According to http://www.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html , daylight is an X/OPEN extension; unfortunataly it is not present on FreeBSD. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 127500 [details] [review] proposed patch FreeBSD ports use a hack that defines daylight to 1; According to what I understand of the time structures this proposed patch should preserve the behavior without using the daylight variable. Another option could be to check for daylight in configure and use it iff its available.
As a side note, here's a snippet from "man daylight" on linux : Note that the variable daylight does not indicate that daylight saving time applies right now. It used to give the number of some algorithm (see the variable tz_dsttime in gettimeofday(2)). It has been obsolete for many years but is required by SUSv2. Cheers
Thanks for the patch!