| 1 |
AC_DEFUN([AC_TNY_TIMEZONE_CHECK], |
|---|
| 2 |
[ |
|---|
| 3 |
|
|---|
| 4 |
AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, |
|---|
| 5 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
|---|
| 6 |
#include <time.h> |
|---|
| 7 |
]], [[ |
|---|
| 8 |
struct tm tm; |
|---|
| 9 |
tm.tm_gmtoff = 1; |
|---|
| 10 |
]])],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no])) |
|---|
| 11 |
if test $ac_cv_struct_tm_gmtoff = yes; then |
|---|
| 12 |
AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member]) |
|---|
| 13 |
else |
|---|
| 14 |
AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone, |
|---|
| 15 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
|---|
| 16 |
#include <time.h> |
|---|
| 17 |
]], [[ |
|---|
| 18 |
timezone = 1; |
|---|
| 19 |
]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])) |
|---|
| 20 |
if test $ac_cv_var_timezone = yes; then |
|---|
| 21 |
AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable]) |
|---|
| 22 |
AC_CACHE_CHECK(for altzone variable, ac_cv_var_altzone, |
|---|
| 23 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
|---|
| 24 |
#include <time.h> |
|---|
| 25 |
]], [[ |
|---|
| 26 |
altzone = 1; |
|---|
| 27 |
]])],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no])) |
|---|
| 28 |
if test $ac_cv_var_altzone = yes; then |
|---|
| 29 |
AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable]) |
|---|
| 30 |
fi |
|---|
| 31 |
else |
|---|
| 32 |
AC_MSG_ERROR([unable to find a way to determine timezone]) |
|---|
| 33 |
fi |
|---|
| 34 |
fi |
|---|
| 35 |
|
|---|
| 36 |
]) |
|---|
| 37 |
|
|---|