From 080e7e93ec987e12fd0e379f26388d53f50aceb9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 8 May 2011 17:45:18 +0200 Subject: [PATCH] gettimeofday, tzset: Respect rules for use of AC_LIBOBJ. * modules/tzset (configure.ac): Don't invoke gl_FUNC_TZSET_CLOBBER, just gl_FUNC_TZSET. * m4/tzset.m4 (gl_FUNC_TZSET): New macro. (gl_FUNC_TZSET_CLOBBER): Remove actions. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Invoke gl_FUNC_TZSET_CLOBBER and its actions here, if present. --- ChangeLog | 10 ++++++++++ m4/gettimeofday.m4 | 13 ++++++++++++- m4/tzset.m4 | 16 +++++----------- modules/tzset | 2 +- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index a82380a74..c6d65579f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2011-05-08 Bruno Haible + gettimeofday, tzset: Respect rules for use of AC_LIBOBJ. + * modules/tzset (configure.ac): Don't invoke gl_FUNC_TZSET_CLOBBER, + just gl_FUNC_TZSET. + * m4/tzset.m4 (gl_FUNC_TZSET): New macro. + (gl_FUNC_TZSET_CLOBBER): Remove actions. + * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Invoke + gl_FUNC_TZSET_CLOBBER and its actions here, if present. + +2011-05-08 Bruno Haible + getsubopt: Move AC_LIBOBJ invocations to module description. * m4/getsubopt.m4 (gl_FUNC_GETSUBOPT): Move AC_LIBOBJ and gl_PREREQ_GETSUBOPT invocations from here... diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 84acadf21..461341183 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,4 +1,4 @@ -# serial 15 +# serial 16 # Copyright (C) 2001-2003, 2005, 2007, 2009-2011 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -54,6 +54,17 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict); AC_LIBOBJ([gettimeofday]) gl_PREREQ_GETTIMEOFDAY fi + m4_ifdef([gl_FUNC_TZSET_CLOBBER], [ + gl_FUNC_TZSET_CLOBBER + if test $gl_cv_func_tzset_clobber = yes; then + REPLACE_GETTIMEOFDAY=1 + 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], [1], + [Define if tzset clobbers localtime's static buffer.]) + fi + ]) fi AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], [Define this to 'void' or 'struct timezone' to match the system's diff --git a/m4/tzset.m4 b/m4/tzset.m4 index 3c78b3b26..261ad5c50 100644 --- a/m4/tzset.m4 +++ b/m4/tzset.m4 @@ -1,4 +1,4 @@ -# serial 5 +# serial 6 # Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -13,6 +13,10 @@ # 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([gl_HEADER_SYS_TIME_H]) @@ -47,14 +51,4 @@ main () 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 - REPLACE_GETTIMEOFDAY=1 - 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], [1], - [Define if tzset clobbers localtime's static buffer.]) - fi ]) diff --git a/modules/tzset b/modules/tzset index 608f7756d..8fa9ee640 100644 --- a/modules/tzset +++ b/modules/tzset @@ -8,7 +8,7 @@ Depends-on: gettimeofday configure.ac: -gl_FUNC_TZSET_CLOBBER +gl_FUNC_TZSET Makefile.am: -- 2.11.0