acinclude.m4 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. ])
  43. AC_DEFUN([AC_STRUCT_OPTION_GETOPT_H],
  44. [AC_CACHE_CHECK([for struct option in getopt], ac_cv_struct_option_getopt_h,
  45. [AC_TRY_COMPILE([#include <getopt.h>], [struct option op; op.name;],
  46. ac_cv_struct_option_getopt_h=yes, ac_cv_struct_option_getopt_h=no)])
  47. if test "$ac_cv_struct_option_getopt_h" = yes; then
  48. AC_DEFINE(HAVE_STRUCT_OPTION,1,[HAVE_STRUCT_OPTION])
  49. fi
  50. ])