summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-03-14 21:51:36 (GMT)
committerGuido van Rossum <guido@python.org>2003-03-14 21:51:36 (GMT)
commitd11b62edd077428935f93b36ae8d65ebaa684cca (patch)
tree9dc367fe07572083aea392a93c9aab9100ad25e4 /configure.in
parent538f1d842c3dfeff279c084d616c03113ec5dd94 (diff)
downloadcpython-d11b62edd077428935f93b36ae8d65ebaa684cca.zip
cpython-d11b62edd077428935f93b36ae8d65ebaa684cca.tar.gz
cpython-d11b62edd077428935f93b36ae8d65ebaa684cca.tar.bz2
- New function time.tzset() provides access to the C library tzet()
function, if supported. (SF patch #675422, by Stuart Bishop.)
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in33
1 files changed, 33 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index f73df53..bcde551 100644
--- a/configure.in
+++ b/configure.in
@@ -2500,6 +2500,39 @@ then
[Define if nice() returns success/failure instead of the new priority.])
fi
+# tzset(3) exists and works like we expect it to
+AC_MSG_CHECKING(for working tzset())
+AC_CACHE_VAL(ac_cv_working_tzset, [
+AC_TRY_RUN([
+#include <stdlib.h>
+#include <time.h>
+int main()
+{
+ int gmt_hour;
+ int eastern_hour;
+ time_t now;
+ now = time((time_t*)NULL);
+ putenv("TZ=GMT");
+ tzset();
+ gmt_hour = localtime(&now)->tm_hour;
+ putenv("TZ=US/Eastern");
+ tzset();
+ eastern_hour = localtime(&now)->tm_hour;
+ if (eastern_hour == gmt_hour)
+ exit(1);
+ exit(0);
+}
+],
+ac_cv_working_tzset=yes,
+ac_cv_working_tzset=no,
+ac_cv_working_tzset=no)])
+AC_MSG_RESULT($ac_cv_working_tzset)
+if test "$ac_cv_working_tzset" = yes
+then
+ AC_DEFINE(HAVE_WORKING_TZSET, 1,
+ [Define if tzset() actually switches the local timezone in a meaningful way.])
+fi
+
# Look for subsecond timestamps in struct stat
AC_MSG_CHECKING(for tv_nsec in struct stat)
AC_CACHE_VAL(ac_cv_stat_tv_nsec,