# HG changeset patch # User Bruno Haible # Date 1304869518 -7200 # Node ID 8421bcc8acbfb3b7b7d458ab9d1b1a4bc2236481 # Parent 5a32f410f1b7114a7d928c685b7dfb8e58260a2b 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. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +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. diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 --- 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 @@ 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 --- 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 @@ 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 --- a/modules/tzset +++ b/modules/tzset @@ -8,7 +8,7 @@ gettimeofday configure.ac: -gl_FUNC_TZSET_CLOBBER +gl_FUNC_TZSET Makefile.am: