acinclude.m4 1.5 KB

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