1 dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
3 AC_DEFUN([AC_STRUCT_TIMEZONE_DAYLIGHT],
4 [AC_REQUIRE([AC_STRUCT_TM])dnl
5 AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
7 [AC_LANG_PROGRAM([#include <sys/types.h>
8 #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;])],
9 ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
10 if test "$ac_cv_struct_tm_zone" = yes; then
11 AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE])
14 # On SGI, apparently tzname is a #define, but that's ok, AC_CHECK_DECL will
15 # consider it declared and we won't give our own extern.
16 AC_CHECK_DECLS([tzname], , , [#include <time.h>])
17 AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
19 [AC_LANG_PROGRAM([#include <time.h>],
20 [[#if !HAVE_DECL_TZNAME
21 extern char *tzname[];
23 return tzname[0][0];]])], [ac_cv_var_tzname=yes], [ac_cv_var_tzname=no])])
24 if test $ac_cv_var_tzname = yes; then
25 AC_DEFINE(HAVE_TZNAME,1,[HAVE_TZNAME])
28 AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
30 [AC_LANG_PROGRAM([#include <sys/types.h>
31 #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;])],
32 ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
33 if test "$ac_cv_struct_tm_isdst" = yes; then
34 AC_DEFINE(HAVE_TM_ISDST,1,[HAVE_TM_ISDST])
38 AC_CHECK_DECLS([daylight], , , [#include <time.h>
40 AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
42 [AC_LANG_PROGRAM([#include <time.h>
44 [#if !HAVE_DECL_DAYLIGHT
47 daylight = atoi("1");])], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
48 if test $ac_cv_var_daylight = yes; then
49 AC_DEFINE(HAVE_DAYLIGHT,1,[HAVE_DAYLIGHT])
53 AC_DEFUN([AC_STRUCT_OPTION_GETOPT_H],
54 [AC_CACHE_CHECK([for struct option in getopt], ac_cv_struct_option_getopt_h,
56 [AC_LANG_PROGRAM([#include <getopt.h>], [struct option op; op.name;])],
57 ac_cv_struct_option_getopt_h=yes, ac_cv_struct_option_getopt_h=no)])
58 if test "$ac_cv_struct_option_getopt_h" = yes; then
59 AC_DEFINE(HAVE_STRUCT_OPTION,1,[HAVE_STRUCT_OPTION])