acinclude.m4 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. # On SGI, apparently tzname is a #define, but that's ok, AC_CHECK_DECL will
  12. # consider it declared and we won't give our own extern.
  13. AC_CHECK_DECLS([tzname], , , [#include <time.h>])
  14. AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
  15. [AC_TRY_LINK(
  16. [#include <time.h>
  17. #if !HAVE_DECL_TZNAME
  18. extern char *tzname[];
  19. #endif],
  20. [return tzname[0][0];], [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. AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
  25. [AC_TRY_COMPILE([#include <sys/types.h>
  26. #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
  27. ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
  28. if test "$ac_cv_struct_tm_isdst" = yes; then
  29. AC_DEFINE(HAVE_TM_ISDST,1,[HAVE_TM_ISDST])
  30. fi
  31. AC_CHECK_DECLS([daylight], , , [#include <time.h>])
  32. AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
  33. [AC_TRY_LINK(
  34. changequote(<<, >>)dnl
  35. <<#include <time.h>
  36. #if !HAVE_DECL_DAYLIGHT
  37. extern int daylight;
  38. #endif>>,
  39. changequote([, ])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. AC_DEFUN([AC_STRUCT_OPTION_GETOPT_H],
  46. [AC_CACHE_CHECK([for struct option in getopt], ac_cv_struct_option_getopt_h,
  47. [AC_TRY_COMPILE([#include <getopt.h>], [struct option op; op.name;],
  48. ac_cv_struct_option_getopt_h=yes, ac_cv_struct_option_getopt_h=no)])
  49. if test "$ac_cv_struct_option_getopt_h" = yes; then
  50. AC_DEFINE(HAVE_STRUCT_OPTION,1,[HAVE_STRUCT_OPTION])
  51. fi
  52. ])