when HAVE_STRUCT_TM_TM_ZONE is not defined.
+2004-03-28 Paul Eggert <eggert@twinsun.com>
+
+ * doc/autoconf.texi (Particular Structures): AC_STRUCT_TIMEZONE
+ now defines HAVE_DECL_TZNAME if it is declared, when
+ HAVE_STRUCT_TM_TM_ZONE is not defined.
+ * lib/autoconf/types.m4 (AC_STRUCT_TIMEZONE): Implement this.
+ Do not assume atoi. Rely on HAVE_DECL_TZNAME when testing
+ for HAVE_TZNAME.
+
2004-03-28 Steven G. Johnson <stevenj@fftw.org>
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT): Corrected
Figure out how to get the current timezone. If @code{struct tm} has a
@code{tm_zone} member, define @code{HAVE_STRUCT_TM_TM_ZONE} (and the
obsoleted @code{HAVE_TM_ZONE}). Otherwise, if the external array
-@code{tzname} is found, define @code{HAVE_TZNAME}.
+@code{tzname} is found, define @code{HAVE_TZNAME}; if it is declared,
+define @code{HAVE_DECL_TZNAME}.
@end defmac
@node Generic Structures
[Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
`HAVE_STRUCT_TM_TM_ZONE' instead.])
else
+ AC_CHECK_DECLS([tzname], , , [#include <time.h>])
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <time.h>
-#ifndef tzname /* For SGI. */
-extern char *tzname[]; /* RS6000 and others reject char **tzname. */
+#if !HAVE_DECL_TZNAME
+extern char *tzname[];
#endif
]],
-[atoi(*tzname);])],
+[[return tzname[0][0];]])],
[ac_cv_var_tzname=yes],
[ac_cv_var_tzname=no])])
if test $ac_cv_var_tzname = yes; then