gettimeofday, tzset: Respect rules for use of AC_LIBOBJ.
authorBruno Haible <bruno@clisp.org>
Sun, 8 May 2011 15:45:18 +0000 (17:45 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Jun 2011 22:06:08 +0000 (00:06 +0200)
* 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
m4/gettimeofday.m4
m4/tzset.m4
modules/tzset

index a82380a..c6d6557 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 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.
        * m4/getsubopt.m4 (gl_FUNC_GETSUBOPT): Move AC_LIBOBJ and
        gl_PREREQ_GETSUBOPT invocations from here...
index 84acadf..4613411 100644 (file)
@@ -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
index 3c78b3b..261ad5c 100644 (file)
@@ -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
 
 # 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
 ])
index 608f775..8fa9ee6 100644 (file)
@@ -8,7 +8,7 @@ Depends-on:
 gettimeofday
 
 configure.ac:
-gl_FUNC_TZSET_CLOBBER
+gl_FUNC_TZSET
 
 Makefile.am: