diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-05-01 15:33:06 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-05-01 15:33:26 -0700 |
commit | 634d0a907ff7ba5901dfe3624e58d718f3f37cec (patch) | |
tree | 6bf86cf04d8b28a79693df9cdef1063c9b06ca76 /m4 | |
parent | 16b49e214ad828de29ceb57ad1b443eece9bba03 (diff) | |
download | emacs-634d0a907ff7ba5901dfe3624e58d718f3f37cec.tar.gz emacs-634d0a907ff7ba5901dfe3624e58d718f3f37cec.tar.bz2 emacs-634d0a907ff7ba5901dfe3624e58d718f3f37cec.zip |
Merge from gnulib
This incorporates:
2017-05-01 New module 'localtime-buffer'
2017-04-30 utimens: Add support for native Windows
* admin/merge-gnulib (AVOIDED_MODULES): Add tzset.
* configure.ac (tzset): No need for Emacs itself to check now.
* lib/gettimeofday.c, lib/time.in.h, lib/time_rz.c, lib/utimens.c:
* m4/gettimeofday.m4, m4/time_h.m4, m4/time_rz.m4: Copy from gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/localtime-buffer.c, lib/localtime-buffer.h:
* m4/localtime-buffer.m4: New files, copied from gnulib.
* src/editfns.c (init_editfns): Assume tzset is callable.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/gettimeofday.m4 | 21 | ||||
-rw-r--r-- | m4/gnulib-comp.m4 | 17 | ||||
-rw-r--r-- | m4/localtime-buffer.m4 | 21 | ||||
-rw-r--r-- | m4/time_h.m4 | 3 | ||||
-rw-r--r-- | m4/time_rz.m4 | 1 |
5 files changed, 43 insertions, 20 deletions
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 742b6c9e10e..34adc64778f 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -54,19 +54,6 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict); if test $REPLACE_STRUCT_TIMEVAL = 1; then REPLACE_GETTIMEOFDAY=1 fi - m4_ifdef([gl_FUNC_TZSET_CLOBBER], [ - gl_FUNC_TZSET_CLOBBER - case "$gl_cv_func_tzset_clobber" in - *yes) - 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.]) - ;; - esac - ]) fi AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], [Define this to 'void' or 'struct timezone' to match the system's @@ -85,6 +72,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], [ AC_REQUIRE([gl_HEADER_SYS_TIME_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], [gl_cv_func_gettimeofday_clobber], @@ -119,17 +107,12 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], case "$gl_cv_func_gettimeofday_clobber" in *yes) REPLACE_GETTIMEOFDAY=1 - gl_GETTIMEOFDAY_REPLACE_LOCALTIME AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], [Define if gettimeofday clobbers the localtime buffer.]) + gl_LOCALTIME_BUFFER_NEEDED ;; esac ]) -AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ - REPLACE_GMTIME=1 - REPLACE_LOCALTIME=1 -]) - # Prerequisites of lib/gettimeofday.c. AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 136762430e0..74b197c8633 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -101,6 +101,7 @@ AC_DEFUN([gl_EARLY], # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) # Code from module limits-h: + # Code from module localtime-buffer: # Code from module lstat: # Code from module manywarnings: # Code from module memrchr: @@ -413,6 +414,7 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_getgroups=false gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false + gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=false gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false @@ -512,6 +514,14 @@ AC_DEFUN([gl_INIT], fi fi } + func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9 () + { + if ! $gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9; then + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_LIBOBJ([localtime-buffer]) + gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=true + fi + } func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31 () { if ! $gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31; then @@ -618,6 +628,9 @@ AC_DEFUN([gl_INIT], if test $REPLACE_GETOPT = 1; then func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 fi + if test $NEED_LOCALTIME_BUFFER = 1; then + func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9 + fi if test $REPLACE_LSTAT = 1; then func_gl_gnulib_m4code_dosname fi @@ -651,6 +664,7 @@ AC_DEFUN([gl_INIT], AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups]) AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9], [$gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9]) AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31]) AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7]) AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c]) @@ -880,6 +894,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/intprops.h lib/inttypes.in.h lib/limits.in.h + lib/localtime-buffer.c + lib/localtime-buffer.h lib/lstat.c lib/md5.c lib/md5.h @@ -997,6 +1013,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/inttypes.m4 m4/largefile.m4 m4/limits-h.m4 + m4/localtime-buffer.m4 m4/longlong.m4 m4/lstat.m4 m4/manywarnings.m4 diff --git a/m4/localtime-buffer.m4 b/m4/localtime-buffer.m4 new file mode 100644 index 00000000000..3965b5d9f2b --- /dev/null +++ b/m4/localtime-buffer.m4 @@ -0,0 +1,21 @@ +# localtime-buffer.m4 serial 1 +dnl Copyright (C) 2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_LOCALTIME_BUFFER_DEFAULTS], +[ + NEED_LOCALTIME_BUFFER=0 +]) + +dnl Macro invoked from other modules, to signal that the compilation of +dnl module 'localtime-buffer' is needed. +AC_DEFUN([gl_LOCALTIME_BUFFER_NEEDED], +[ + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 +]) diff --git a/m4/time_h.m4 b/m4/time_h.m4 index e0f663ec711..f52b60192e8 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -113,11 +113,13 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) + GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) + HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) dnl If another module says to replace or to not replace, do that. dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; dnl this lets maintainers check for portability. @@ -127,6 +129,7 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME]) REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) + REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET]) dnl Hack so that the time module doesn't depend on the sys_time module. dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. diff --git a/m4/time_rz.m4 b/m4/time_rz.m4 index 79060e00fcc..079e933b4e6 100644 --- a/m4/time_rz.m4 +++ b/m4/time_rz.m4 @@ -12,7 +12,6 @@ AC_DEFUN([gl_TIME_RZ], AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) AC_REQUIRE([AC_STRUCT_TIMEZONE]) - AC_CHECK_FUNCS_ONCE([tzset]) AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]]) if test "$ac_cv_type_timezone_t" = yes; then |