[Python-checkins] python/dist/src configure,1.381,1.382 configure.in,1.392,1.393 pyconfig.h.in,1.72,1.73
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Fri, 14 Mar 2003 13:52:06 -0800
Update of /cvsroot/python/python/dist/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14617
Modified Files:
configure configure.in pyconfig.h.in
Log Message:
- New function time.tzset() provides access to the C library tzet()
function, if supported. (SF patch #675422, by Stuart Bishop.)
Index: configure
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure,v
retrieving revision 1.381
retrieving revision 1.382
diff -C2 -d -r1.381 -r1.382
*** configure 25 Feb 2003 13:14:43 -0000 1.381
--- configure 14 Mar 2003 21:51:20 -0000 1.382
***************
*** 1,4 ****
#! /bin/sh
! # From configure.in Revision: 1.391 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53 for python 2.3.
--- 1,4 ----
#! /bin/sh
! # From configure.in Revision: 1.392 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53 for python 2.3.
***************
*** 16547,16550 ****
--- 16547,16618 ----
cat >>confdefs.h <<\_ACEOF
#define HAVE_BROKEN_NICE 1
+ _ACEOF
+
+ fi
+
+ # tzset(3) exists and works like we expect it to
+ echo "$as_me:$LINENO: checking for working tzset()" >&5
+ echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6
+ if test "${ac_cv_working_tzset+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+
+ if test "$cross_compiling" = yes; then
+ ac_cv_working_tzset=no
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ #include "confdefs.h"
+
+ #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);
+ }
+
+ _ACEOF
+ rm -f conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_working_tzset=yes
+ else
+ echo "$as_me: program exited with status $ac_status" >&5
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ( exit $ac_status )
+ ac_cv_working_tzset=no
+ fi
+ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+
+ echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5
+ echo "${ECHO_T}$ac_cv_working_tzset" >&6
+ if test "$ac_cv_working_tzset" = yes
+ then
+
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_WORKING_TZSET 1
_ACEOF
Index: configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.392
retrieving revision 1.393
diff -C2 -d -r1.392 -r1.393
*** configure.in 25 Feb 2003 13:14:42 -0000 1.392
--- configure.in 14 Mar 2003 21:51:31 -0000 1.393
***************
*** 2501,2504 ****
--- 2501,2537 ----
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)
Index: pyconfig.h.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** pyconfig.h.in 19 Feb 2003 15:25:10 -0000 1.72
--- pyconfig.h.in 14 Mar 2003 21:51:32 -0000 1.73
***************
*** 614,617 ****
--- 614,621 ----
#undef HAVE_WCSCOLL
+ /* Define if tzset() actually switches the local timezone in a meaningful way.
+ */
+ #undef HAVE_WORKING_TZSET
+
/* Define to 1 if you have the `_getpty' function. */
#undef HAVE__GETPTY