changeset 14974:8421bcc8acbf

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.
author Bruno Haible <bruno@clisp.org>
date Sun, 08 May 2011 17:45:18 +0200
parents 5a32f410f1b7
children 599acc01166d
files ChangeLog m4/gettimeofday.m4 m4/tzset.m4 modules/tzset
diffstat 4 files changed, 28 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-05-08  Bruno Haible  <bruno@clisp.org>
+
+	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  <bruno@clisp.org>
 
 	getsubopt: Move AC_LIBOBJ invocations to module description.
--- 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
--- 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
 ])
--- a/modules/tzset
+++ b/modules/tzset
@@ -8,7 +8,7 @@
 gettimeofday
 
 configure.ac:
-gl_FUNC_TZSET_CLOBBER
+gl_FUNC_TZSET
 
 Makefile.am: