+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.
 
-# 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
       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
 
-# serial 5
+# serial 6
 
 # Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 
 # 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])
 
   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
 ])
 
 gettimeofday
 
 configure.ac:
-gl_FUNC_TZSET_CLOBBER
+gl_FUNC_TZSET
 
 Makefile.am: