2001-10-08 22:50:54 +00:00
|
|
|
dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
|
|
|
|
|
2002-09-16 05:54:26 +00:00
|
|
|
AC_DEFUN([AC_STRUCT_TIMEZONE_DAYLIGHT],
|
2001-10-08 22:50:54 +00:00
|
|
|
[AC_REQUIRE([AC_STRUCT_TM])dnl
|
|
|
|
AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
|
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
|
|
|
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
|
|
|
|
ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
|
|
|
|
if test "$ac_cv_struct_tm_zone" = yes; then
|
2002-09-16 05:54:26 +00:00
|
|
|
AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE])
|
2001-10-08 22:50:54 +00:00
|
|
|
fi
|
|
|
|
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
|
|
|
|
[AC_TRY_LINK(
|
|
|
|
changequote(<<, >>)dnl
|
|
|
|
<<#include <time.h>
|
|
|
|
#ifndef tzname /* For SGI. */
|
|
|
|
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
|
|
|
|
#endif>>,
|
|
|
|
changequote([, ])dnl
|
|
|
|
[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
|
|
|
|
if test $ac_cv_var_tzname = yes; then
|
2002-09-16 05:54:26 +00:00
|
|
|
AC_DEFINE(HAVE_TZNAME,1,[HAVE_TZNAME])
|
2001-10-08 22:50:54 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
|
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
|
|
|
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
|
|
|
|
ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
|
|
|
|
if test "$ac_cv_struct_tm_isdst" = yes; then
|
2009-01-02 02:57:16 +00:00
|
|
|
AC_DEFINE(HAVE_TM_ISDST,1,[HAVE_TM_ISDST])
|
2001-10-08 22:50:54 +00:00
|
|
|
fi
|
|
|
|
AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
|
|
|
|
[AC_TRY_LINK(
|
|
|
|
changequote(<<, >>)dnl
|
|
|
|
<<#include <time.h>
|
|
|
|
#ifndef daylight /* In case IRIX #defines this, too */
|
|
|
|
extern int daylight;
|
|
|
|
#endif>>,
|
|
|
|
changequote([, ])dnl
|
|
|
|
[atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
|
|
|
|
if test $ac_cv_var_daylight = yes; then
|
2009-01-02 02:57:16 +00:00
|
|
|
AC_DEFINE(HAVE_DAYLIGHT,1,[HAVE_DAYLIGHT])
|
2001-10-08 22:50:54 +00:00
|
|
|
fi
|
|
|
|
])
|