diff options
| author | Christos Zoulas <christos@zoulas.com> | 2001-08-07 16:01:25 +0000 |
|---|---|---|
| committer | Christos Zoulas <christos@zoulas.com> | 2001-08-07 16:01:25 +0000 |
| commit | a9b475ecaa8640ce889a6c2a7c14dd3dd707d9de (patch) | |
| tree | f66c9ce0ad9724b7e7755c2ebb6cdba105063a3f /aclocal.m4 | |
| parent | d6450d1a7ccf19ca73bc3f9120310e0b64df236e (diff) | |
| download | file-git-a9b475ecaa8640ce889a6c2a7c14dd3dd707d9de.tar.gz | |
better daylight/tm_isdst etc. detection.
Diffstat (limited to 'aclocal.m4')
| -rw-r--r-- | aclocal.m4 | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -33,6 +33,51 @@ dnl From: eggert@twinsun.com (Paul Eggert) dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars dnl Newsgroups: gnu.utils.bug +dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight + +AC_DEFUN(AC_STRUCT_TIMEZONE_DAYLIGHT, +[AC_REQUIRE([AC_STRUCT_TM])dnl +AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone, +[AC_TRY_COMPILE([#include <sys/types.h> +#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;], + ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)]) +if test "$ac_cv_struct_tm_zone" = yes; then + AC_DEFINE(HAVE_TM_ZONE) +fi +AC_CACHE_CHECK(for tzname, ac_cv_var_tzname, +[AC_TRY_LINK( +changequote(<<, >>)dnl +<<#include <time.h> +#ifndef tzname /* For SGI. */ +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ +#endif>>, +changequote([, ])dnl +[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)]) + if test $ac_cv_var_tzname = yes; then + AC_DEFINE(HAVE_TZNAME) + fi + +AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst, +[AC_TRY_COMPILE([#include <sys/types.h> +#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;], + ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)]) +if test "$ac_cv_struct_tm_isdst" = yes; then + AC_DEFINE(HAVE_TM_ISDST) +fi +AC_CACHE_CHECK(for daylight, ac_cv_var_daylight, +[AC_TRY_LINK( +changequote(<<, >>)dnl +<<#include <time.h> +#ifndef daylight /* In case IRIX #defines this, too */ +extern int daylight; +#endif>>, +changequote([, ])dnl +[atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)]) + if test $ac_cv_var_daylight = yes; then + AC_DEFINE(HAVE_DAYLIGHT) + fi +]) + dnl AC_CHECK_TYPE2(TYPE, DEFAULT) AC_DEFUN(AC_CHECK_TYPE2, [AC_REQUIRE([AC_HEADER_STDC])dnl |
