* 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>
+
+ 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.
func_echo "$element"
func_begin_table
+ func_module mktime-internal
func_module parse-datetime
func_module timegm
func_module tzset
-# 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
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],
[
# 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
+ :
])
--- /dev/null
+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
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