New module 'mktime-internal'.
authorBruno Haible <bruno@clisp.org>
Sun, 22 May 2011 14:39:23 +0000 (16:39 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 22 May 2011 14:39:23 +0000 (16:39 +0200)
* modules/mktime-internal: New file.
* m4/timegm.m4 (gl_PREREQ_TIMEGM): Move contents to ...
* m4/mktime.m4 (gl_FUNC_MKTIME_INTERNAL): New macro. Define
mktime_internal as a C macro if libc has __mktime_internal.
* modules/timegm (Depends-on): Add mktime-internal. Remove mktime. Add
conditions.
* MODULES.html.sh (Date and time <time.h>): Add mktime-internal.

ChangeLog
MODULES.html.sh
m4/mktime.m4
m4/timegm.m4
modules/mktime-internal [new file with mode: 0644]
modules/timegm

index fcdfe3c2861293f26aff102920aba23dc5f0d795..342a13039f4516f65e53e3c74d1533c179ec2ac5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-05-22  Bruno Haible  <bruno@clisp.org>
+
+       New module 'mktime-internal'.
+       * modules/mktime-internal: New file.
+       * m4/timegm.m4 (gl_PREREQ_TIMEGM): Move contents to ...
+       * m4/mktime.m4 (gl_FUNC_MKTIME_INTERNAL): New macro. Define
+       mktime_internal as a C macro if libc has __mktime_internal.
+       * modules/timegm (Depends-on): Add mktime-internal. Remove mktime. Add
+       conditions.
+       * MODULES.html.sh (Date and time <time.h>): Add mktime-internal.
+
 2011-05-22  Bruno Haible  <bruno@clisp.org>
 
        timegm: Correct mktime replacement statements.
index 3d3add3b8e67b21c83fb8c449fc2595059dec7cc..18a7472d72013cbf8f09c8f7504e771b8ef0a4f0 100755 (executable)
@@ -1834,6 +1834,7 @@ func_all_modules ()
   func_echo "$element"
 
   func_begin_table
+  func_module mktime-internal
   func_module parse-datetime
   func_module timegm
   func_module tzset
index 56b2416d619302fba98577929692500717d61f3c..01167a1ec0ec0ffef9c4cd8deb61455bcf364ab4 100644 (file)
@@ -1,4 +1,4 @@
-# serial 19
+# serial 20
 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -234,6 +234,23 @@ AC_DEFUN([gl_FUNC_MKTIME],
   fi
 ])
 
+AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [
+  AC_REQUIRE([gl_FUNC_MKTIME])
+  if test $REPLACE_MKTIME = 0; then
+    dnl BeOS has __mktime_internal in libc, but other platforms don't.
+    AC_CHECK_FUNC([__mktime_internal],
+      [AC_DEFINE([mktime_internal], [__mktime_internal],
+         [Define to the real name of the mktime_internal function.])
+      ],
+      [dnl mktime works but it doesn't export __mktime_internal,
+       dnl so we need to substitute our own mktime implementation.
+       REPLACE_MKTIME=1
+       AC_LIBOBJ([mktime])
+       gl_PREREQ_MKTIME
+      ])
+  fi
+])
+
 # Prerequisites of lib/mktime.c.
 AC_DEFUN([gl_PREREQ_MKTIME],
 [
index 62e76b44376eb7f475b38a34564e661149d82dd2..ca97eb2529cd1f926125e3d7ef68af907812cfc4 100644 (file)
@@ -26,13 +26,5 @@ AC_DEFUN([gl_FUNC_TIMEGM],
 
 # Prerequisites of lib/timegm.c.
 AC_DEFUN([gl_PREREQ_TIMEGM], [
-  AC_REQUIRE([gl_FUNC_MKTIME])
-  if test $ac_cv_func_working_mktime = yes; then
-    AC_CHECK_FUNC([__mktime_internal], ,
-      [# mktime works but it doesn't export __mktime_internal,
-       # so we need to substitute our own mktime implementation.
-       AC_LIBOBJ([mktime])
-       REPLACE_MKTIME=1
-       gl_PREREQ_MKTIME])
-  fi
+  :
 ])
diff --git a/modules/mktime-internal b/modules/mktime-internal
new file mode 100644 (file)
index 0000000..c26b622
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+mktime_internal() function: convert broken-down time to linear time.
+
+Files:
+lib/mktime-internal.h
+lib/mktime.c
+
+Depends-on:
+mktime
+
+configure.ac:
+gl_FUNC_MKTIME_INTERNAL
+
+Makefile.am:
+
+Include:
+"mktime-internal.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Bruno Haible, Paul Eggert
index 91623cf75bec42318b3781d2f3cdc503b75dab09..ade34754fff25a37786af403654caa3153463cfd 100644 (file)
@@ -7,9 +7,9 @@ lib/timegm.c
 m4/timegm.m4
 
 Depends-on:
-mktime
 time
-time_r
+mktime-internal [test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1]
+time_r          [test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1]
 
 configure.ac:
 gl_FUNC_TIMEGM