FreeBSD has a timezone() function, not a timezone global variable
(that's visible with our default configuration).
Undid most of
0e4bc6fa7fa8ad74a1c3e855411bdc0e63bc6a2e.
Pulled in from nmh. Thanks to David Levine.
dnl CHECK STRUCTURES
dnl ----------------
+dnl For platforms such as FreeBSD that have tm_gmtoff in struct tm.
+dnl (FreeBSD has a timezone() function but not a timezone global
+dnl variable that is visible).
+AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include <time.h>])
+
AC_STRUCT_DIRENT_D_TYPE
dnl Where is <signal.h> located? Needed as input for signames.awk
#include <h/tws.h>
#include <time.h>
+#if !defined(HAVE_STRUCT_TM_TM_GMTOFF)
+extern long timezone;
+#endif
+
#ifndef abs
# define abs(a) (a >= 0 ? a : -a)
#endif
if (tm->tm_isdst)
tw.tw_flags |= TW_DST;
+#ifdef HAVE_STRUCT_TM_TM_GMTOFF
+ tw.tw_zone = tm->tm_gmtoff / 60;
+ if (tm->tm_isdst) /* if DST is in effect */
+ tw.tw_zone -= 60; /* reset to normal offset */
+#else
tzset();
tw.tw_zone = -(timezone / 60);
+#endif
tw.tw_flags &= ~TW_SDAY;
tw.tw_flags |= TW_SEXP;