acinclude.m4 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_COMPILE_IFELSE(
  6. [AC_LANG_PROGRAM([#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)])
  9. if test "$ac_cv_struct_tm_zone" = yes; then
  10. AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE])
  11. fi
  12. # On SGI, apparently tzname is a #define, but that's ok, AC_CHECK_DECL will
  13. # consider it declared and we won't give our own extern.
  14. AC_CHECK_DECLS([tzname], , , [#include <time.h>])
  15. AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
  16. [AC_LINK_IFELSE(
  17. [AC_LANG_PROGRAM([#include <time.h>],
  18. [[#if !HAVE_DECL_TZNAME
  19. extern char *tzname[];
  20. #endif
  21. return tzname[0][0];]])], [ac_cv_var_tzname=yes], [ac_cv_var_tzname=no])])
  22. if test $ac_cv_var_tzname = yes; then
  23. AC_DEFINE(HAVE_TZNAME,1,[HAVE_TZNAME])
  24. fi
  25. AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
  26. [AC_COMPILE_IFELSE(
  27. [AC_LANG_PROGRAM([#include <sys/types.h>
  28. #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;])],
  29. ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
  30. if test "$ac_cv_struct_tm_isdst" = yes; then
  31. AC_DEFINE(HAVE_TM_ISDST,1,[HAVE_TM_ISDST])
  32. fi
  33. AC_CHECK_DECLS([daylight], , , [#include <time.h>
  34. #include <stdlib.h>])
  35. AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
  36. [AC_LINK_IFELSE(
  37. [AC_LANG_PROGRAM([#include <time.h>
  38. #include <stdlib.h>],
  39. [#if !HAVE_DECL_DAYLIGHT
  40. extern int daylight;
  41. #endif
  42. daylight = atoi("1");])], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
  43. if test $ac_cv_var_daylight = yes; then
  44. AC_DEFINE(HAVE_DAYLIGHT,1,[HAVE_DAYLIGHT])
  45. fi
  46. ])
  47. AC_DEFUN([AC_STRUCT_OPTION_GETOPT_H],
  48. [AC_CACHE_CHECK([for struct option in getopt], ac_cv_struct_option_getopt_h,
  49. [AC_COMPILE_IFELSE(
  50. [AC_LANG_PROGRAM([#include <getopt.h>], [struct option op; op.name;])],
  51. ac_cv_struct_option_getopt_h=yes, ac_cv_struct_option_getopt_h=no)])
  52. if test "$ac_cv_struct_option_getopt_h" = yes; then
  53. AC_DEFINE(HAVE_STRUCT_OPTION,1,[HAVE_STRUCT_OPTION])
  54. fi
  55. ])