X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Ftzset.m4;h=c3ef37321dd139c8f66270b2b1fc6d84a992d234;hb=bc18fb52e080546bd6f048be78cf04968797a191;hp=134080c54bc5ad8d48c16698ed080da948791353;hpb=44d7c1c1f004fa9bfb8ec3948de2671a7958cf5b;p=gnulib.git diff --git a/m4/tzset.m4 b/m4/tzset.m4 index 134080c54..c3ef37321 100644 --- a/m4/tzset.m4 +++ b/m4/tzset.m4 @@ -1,6 +1,6 @@ -#serial 2 +# serial 6 -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2007, 2009-2012 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,23 +13,18 @@ # Written by Paul Eggert and Jim Meyering. +# A placeholder to ensure that this m4 file gets included by aclocal. +AC_DEFUN([gl_FUNC_TZSET], []) + +# Set gl_cv_func_tzset_clobber. AC_DEFUN([gl_FUNC_TZSET_CLOBBER], [ - AC_REQUIRE([AC_HEADER_TIME]) + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) AC_CACHE_CHECK([whether tzset clobbers localtime buffer], gl_cv_func_tzset_clobber, [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif +#include #include int @@ -42,27 +37,18 @@ main () s = *p; putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); tzset (); - exit (p->tm_year != s.tm_year - || p->tm_mon != s.tm_mon - || p->tm_mday != s.tm_mday - || p->tm_hour != s.tm_hour - || p->tm_min != s.tm_min - || p->tm_sec != s.tm_sec); + return (p->tm_year != s.tm_year + || p->tm_mon != s.tm_mon + || p->tm_mday != s.tm_mday + || p->tm_hour != s.tm_hour + || p->tm_min != s.tm_min + || p->tm_sec != s.tm_sec); } ]])], [gl_cv_func_tzset_clobber=no], [gl_cv_func_tzset_clobber=yes], [gl_cv_func_tzset_clobber=yes])]) - AC_DEFINE(HAVE_RUN_TZSET_TEST, 1, + AC_DEFINE([HAVE_RUN_TZSET_TEST], [1], [Define to 1 if you have run the test for working tzset.]) - - if test $gl_cv_func_tzset_clobber = yes; then - gl_GETTIMEOFDAY_REPLACE_LOCALTIME - - AC_DEFINE(tzset, rpl_tzset, - [Define to rpl_tzset if the wrapper function should be used.]) - AC_DEFINE(TZSET_CLOBBERS_LOCALTIME_BUFFER, 1, - [Define if tzset clobbers localtime's static buffer.]) - fi ])