acinclude.m4 revision 186691
1dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
2
3AC_DEFUN([AC_STRUCT_TIMEZONE_DAYLIGHT],
4[AC_REQUIRE([AC_STRUCT_TM])dnl
5AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
6[AC_TRY_COMPILE([#include <sys/types.h>
7#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
8  ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
9if test "$ac_cv_struct_tm_zone" = yes; then
10  AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE])
11fi
12AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
13[AC_TRY_LINK(
14changequote(<<, >>)dnl
15<<#include <time.h>
16#ifndef tzname /* For SGI.  */
17extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
18#endif>>,
19changequote([, ])dnl
20[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
21  if test $ac_cv_var_tzname = yes; then
22    AC_DEFINE(HAVE_TZNAME,1,[HAVE_TZNAME])
23  fi
24
25AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
26[AC_TRY_COMPILE([#include <sys/types.h>
27#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
28  ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
29if test "$ac_cv_struct_tm_isdst" = yes; then
30  AC_DEFINE(HAVE_TM_ISDST,1,[HAVE_TM_ISDST])
31fi
32AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
33[AC_TRY_LINK(
34changequote(<<, >>)dnl
35<<#include <time.h>
36#ifndef daylight /* In case IRIX #defines this, too  */
37extern int daylight;
38#endif>>,
39changequote([, ])dnl
40[atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
41  if test $ac_cv_var_daylight = yes; then
42    AC_DEFINE(HAVE_DAYLIGHT,1,[HAVE_DAYLIGHT])
43  fi
44])
45