summaryrefslogtreecommitdiff
path: root/m4/mktime.m4
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-03-05 10:08:21 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-03-05 10:08:21 +0900
commit8abe09f3b00fd31d1af24d3038f881034506d651 (patch)
tree057549dc80e468dce35223ddb305aa362968ed53 /m4/mktime.m4
parentafd456999b076e5e6505dd5ca6942a5e7471c70c (diff)
downloadwget-8abe09f3b00fd31d1af24d3038f881034506d651.tar.gz
wget-8abe09f3b00fd31d1af24d3038f881034506d651.tar.bz2
wget-8abe09f3b00fd31d1af24d3038f881034506d651.zip
Imported Upstream version 1.19.3upstream/1.19.3
Diffstat (limited to 'm4/mktime.m4')
-rw-r--r--m4/mktime.m471
1 files changed, 51 insertions, 20 deletions
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index d594ddc..4b3e399 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,5 +1,5 @@
-# serial 27
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation,
+# serial 30
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2018 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -21,10 +21,11 @@ AC_DEFUN([gl_TIME_T_IS_SIGNED],
fi
])
-AC_DEFUN([gl_FUNC_MKTIME],
+dnl Test whether mktime works. Set gl_cv_func_working_mktime.
+AC_DEFUN([gl_FUNC_MKTIME_WORKS],
[
- AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
AC_REQUIRE([gl_TIME_T_IS_SIGNED])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
dnl in Autoconf and because it invokes AC_LIBOBJ.
@@ -54,6 +55,10 @@ AC_DEFUN([gl_FUNC_MKTIME],
# include <signal.h>
#endif
+#ifndef TIME_T_IS_SIGNED
+# define TIME_T_IS_SIGNED 0
+#endif
+
/* Work around redefinition to rpl_putenv by other config tests. */
#undef putenv
@@ -239,29 +244,55 @@ main ()
}]])],
[gl_cv_func_working_mktime=yes],
[gl_cv_func_working_mktime=no],
- [gl_cv_func_working_mktime=no])
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_working_mktime="guessing no" ;;
+ *) gl_cv_func_working_mktime="guessing no" ;;
+ esac
+ ])
])
+])
+
+dnl Main macro of module 'mktime'.
+AC_DEFUN([gl_FUNC_MKTIME],
+[
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
- if test $gl_cv_func_working_mktime = no; then
+ REPLACE_MKTIME=0
+ if test "$gl_cv_func_working_mktime" != yes; then
REPLACE_MKTIME=1
- else
- REPLACE_MKTIME=0
+ AC_DEFINE([NEED_MKTIME_WORKING], [1],
+ [Define if the compilation of mktime.c should define 'mktime'
+ with the algorithmic workarounds.])
fi
+ case "$host_os" in
+ mingw*)
+ REPLACE_MKTIME=1
+ AC_DEFINE([NEED_MKTIME_WINDOWS], [1],
+ [Define if the compilation of mktime.c should define 'mktime'
+ with the native Windows TZ workaround.])
+ ;;
+ esac
])
+dnl Main macro of module 'mktime-internal'.
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
- ])
- fi
+ AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
+
+ WANT_MKTIME_INTERNAL=0
+ 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.
+ WANT_MKTIME_INTERNAL=1
+ AC_DEFINE([NEED_MKTIME_INTERNAL], [1],
+ [Define if the compilation of mktime.c should define 'mktime_internal'.])
+ ])
])
# Prerequisites of lib/mktime.c.