summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-06-08 17:43:53 +0000
committerJim Meyering <jim@meyering.net>2003-06-08 17:43:53 +0000
commit450f30c5da6c0545f1504745bb74fcf2005210ee (patch)
treea35c1972dac546df45d5b42113df03209a9b11f2 /m4
parent9de1b71bda86dfdad82e47c9d26e40226a00dd2d (diff)
downloadcoreutils-450f30c5da6c0545f1504745bb74fcf2005210ee.tar.xz
change some names, reverse sense of tests
Also define TZSET_CLOBBERS_LOCALTIME_BUFFER. Arrange to compile gettimeofday.
Diffstat (limited to 'm4')
-rw-r--r--m4/tzset.m421
1 files changed, 13 insertions, 8 deletions
diff --git a/m4/tzset.m4 b/m4/tzset.m4
index dbe38c9db..40feda385 100644
--- a/m4/tzset.m4
+++ b/m4/tzset.m4
@@ -7,11 +7,11 @@
# Written by Paul Eggert and Jim Meyering.
-AC_DEFUN([gl_FUNC_TZSET],
+AC_DEFUN([gl_FUNC_TZSET_CLOBBER],
[
AC_REQUIRE([AC_HEADER_TIME])
- AC_CACHE_CHECK([whether tzset works],
- gl_cv_func_tzset_vs_localtime,
+ AC_CACHE_CHECK([whether tzset clobbers localtime buffer],
+ gl_cv_func_tzset_clobber,
[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if TIME_WITH_SYS_TIME
@@ -44,15 +44,20 @@ main ()
|| p->tm_sec != s.tm_sec);
}
]])],
- [gl_cv_func_tzset_vs_localtime=yes],
- [gl_cv_func_tzset_vs_localtime=no],
- [gl_cv_func_tzset_vs_localtime=no])])
+ [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,
[Define to 1 if you have run the test for working tzset.])
- if test $gl_cv_func_tzset_vs_localtime = yes; then
- AC_LIBOBJ(tzset)
+
+ if test $gl_cv_func_tzset_clobber = yes; then
+ AC_LIBOBJ(gettimeofday)
+ AC_DEFINE(localtime, rpl_localtime,
+ [Define to rpl_localtime if the replacement function should be used.])
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
])