diff options
| author | Paul Eggert | 2017-05-01 15:33:06 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-05-01 15:33:26 -0700 |
| commit | 634d0a907ff7ba5901dfe3624e58d718f3f37cec (patch) | |
| tree | 6bf86cf04d8b28a79693df9cdef1063c9b06ca76 /m4 | |
| parent | 16b49e214ad828de29ceb57ad1b443eece9bba03 (diff) | |
| download | emacs-634d0a907ff7ba5901dfe3624e58d718f3f37cec.tar.gz 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); | |||
| 54 | if test $REPLACE_STRUCT_TIMEVAL = 1; then | 54 | if test $REPLACE_STRUCT_TIMEVAL = 1; then |
| 55 | REPLACE_GETTIMEOFDAY=1 | 55 | REPLACE_GETTIMEOFDAY=1 |
| 56 | fi | 56 | fi |
| 57 | m4_ifdef([gl_FUNC_TZSET_CLOBBER], [ | ||
| 58 | gl_FUNC_TZSET_CLOBBER | ||
| 59 | case "$gl_cv_func_tzset_clobber" in | ||
| 60 | *yes) | ||
| 61 | REPLACE_GETTIMEOFDAY=1 | ||
| 62 | gl_GETTIMEOFDAY_REPLACE_LOCALTIME | ||
| 63 | AC_DEFINE([tzset], [rpl_tzset], | ||
| 64 | [Define to rpl_tzset if the wrapper function should be used.]) | ||
| 65 | AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], | ||
| 66 | [Define if tzset clobbers localtime's static buffer.]) | ||
| 67 | ;; | ||
| 68 | esac | ||
| 69 | ]) | ||
| 70 | fi | 57 | fi |
| 71 | AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], | 58 | AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], |
| 72 | [Define this to 'void' or 'struct timezone' to match the system's | 59 | [Define this to 'void' or 'struct timezone' to match the system's |
| @@ -85,6 +72,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], | |||
| 85 | [ | 72 | [ |
| 86 | AC_REQUIRE([gl_HEADER_SYS_TIME_H]) | 73 | AC_REQUIRE([gl_HEADER_SYS_TIME_H]) |
| 87 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles | 74 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles |
| 75 | AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) | ||
| 88 | 76 | ||
| 89 | AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], | 77 | AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], |
| 90 | [gl_cv_func_gettimeofday_clobber], | 78 | [gl_cv_func_gettimeofday_clobber], |
| @@ -119,17 +107,12 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], | |||
| 119 | case "$gl_cv_func_gettimeofday_clobber" in | 107 | case "$gl_cv_func_gettimeofday_clobber" in |
| 120 | *yes) | 108 | *yes) |
| 121 | REPLACE_GETTIMEOFDAY=1 | 109 | REPLACE_GETTIMEOFDAY=1 |
| 122 | gl_GETTIMEOFDAY_REPLACE_LOCALTIME | ||
| 123 | AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], | 110 | AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], |
| 124 | [Define if gettimeofday clobbers the localtime buffer.]) | 111 | [Define if gettimeofday clobbers the localtime buffer.]) |
| 112 | gl_LOCALTIME_BUFFER_NEEDED | ||
| 125 | ;; | 113 | ;; |
| 126 | esac | 114 | esac |
| 127 | ]) | 115 | ]) |
| 128 | 116 | ||
| 129 | AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ | ||
| 130 | REPLACE_GMTIME=1 | ||
| 131 | REPLACE_LOCALTIME=1 | ||
| 132 | ]) | ||
| 133 | |||
| 134 | # Prerequisites of lib/gettimeofday.c. | 117 | # Prerequisites of lib/gettimeofday.c. |
| 135 | AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:]) | 118 | 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], | |||
| 101 | # Code from module largefile: | 101 | # Code from module largefile: |
| 102 | AC_REQUIRE([AC_SYS_LARGEFILE]) | 102 | AC_REQUIRE([AC_SYS_LARGEFILE]) |
| 103 | # Code from module limits-h: | 103 | # Code from module limits-h: |
| 104 | # Code from module localtime-buffer: | ||
| 104 | # Code from module lstat: | 105 | # Code from module lstat: |
| 105 | # Code from module manywarnings: | 106 | # Code from module manywarnings: |
| 106 | # Code from module memrchr: | 107 | # Code from module memrchr: |
| @@ -413,6 +414,7 @@ AC_DEFUN([gl_INIT], | |||
| 413 | gl_gnulib_enabled_getgroups=false | 414 | gl_gnulib_enabled_getgroups=false |
| 414 | gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false | 415 | gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false |
| 415 | gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false | 416 | gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false |
| 417 | gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=false | ||
| 416 | gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false | 418 | gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false |
| 417 | gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false | 419 | gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false |
| 418 | gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false | 420 | gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false |
| @@ -512,6 +514,14 @@ AC_DEFUN([gl_INIT], | |||
| 512 | fi | 514 | fi |
| 513 | fi | 515 | fi |
| 514 | } | 516 | } |
| 517 | func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9 () | ||
| 518 | { | ||
| 519 | if ! $gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9; then | ||
| 520 | AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) | ||
| 521 | AC_LIBOBJ([localtime-buffer]) | ||
| 522 | gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=true | ||
| 523 | fi | ||
| 524 | } | ||
| 515 | func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31 () | 525 | func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31 () |
| 516 | { | 526 | { |
| 517 | if ! $gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31; then | 527 | if ! $gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31; then |
| @@ -618,6 +628,9 @@ AC_DEFUN([gl_INIT], | |||
| 618 | if test $REPLACE_GETOPT = 1; then | 628 | if test $REPLACE_GETOPT = 1; then |
| 619 | func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 | 629 | func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 |
| 620 | fi | 630 | fi |
| 631 | if test $NEED_LOCALTIME_BUFFER = 1; then | ||
| 632 | func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9 | ||
| 633 | fi | ||
| 621 | if test $REPLACE_LSTAT = 1; then | 634 | if test $REPLACE_LSTAT = 1; then |
| 622 | func_gl_gnulib_m4code_dosname | 635 | func_gl_gnulib_m4code_dosname |
| 623 | fi | 636 | fi |
| @@ -651,6 +664,7 @@ AC_DEFUN([gl_INIT], | |||
| 651 | AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups]) | 664 | AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups]) |
| 652 | AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) | 665 | AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) |
| 653 | AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1]) | 666 | AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1]) |
| 667 | AM_CONDITIONAL([gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9], [$gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9]) | ||
| 654 | AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31]) | 668 | AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31]) |
| 655 | AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7]) | 669 | AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7]) |
| 656 | AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c]) | 670 | AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c]) |
| @@ -880,6 +894,8 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 880 | lib/intprops.h | 894 | lib/intprops.h |
| 881 | lib/inttypes.in.h | 895 | lib/inttypes.in.h |
| 882 | lib/limits.in.h | 896 | lib/limits.in.h |
| 897 | lib/localtime-buffer.c | ||
| 898 | lib/localtime-buffer.h | ||
| 883 | lib/lstat.c | 899 | lib/lstat.c |
| 884 | lib/md5.c | 900 | lib/md5.c |
| 885 | lib/md5.h | 901 | lib/md5.h |
| @@ -997,6 +1013,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 997 | m4/inttypes.m4 | 1013 | m4/inttypes.m4 |
| 998 | m4/largefile.m4 | 1014 | m4/largefile.m4 |
| 999 | m4/limits-h.m4 | 1015 | m4/limits-h.m4 |
| 1016 | m4/localtime-buffer.m4 | ||
| 1000 | m4/longlong.m4 | 1017 | m4/longlong.m4 |
| 1001 | m4/lstat.m4 | 1018 | m4/lstat.m4 |
| 1002 | m4/manywarnings.m4 | 1019 | 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 @@ | |||
| 1 | # localtime-buffer.m4 serial 1 | ||
| 2 | dnl Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 3 | dnl This file is free software; the Free Software Foundation | ||
| 4 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 5 | dnl with or without modifications, as long as this notice is preserved. | ||
| 6 | |||
| 7 | AC_DEFUN([gl_LOCALTIME_BUFFER_DEFAULTS], | ||
| 8 | [ | ||
| 9 | NEED_LOCALTIME_BUFFER=0 | ||
| 10 | ]) | ||
| 11 | |||
| 12 | dnl Macro invoked from other modules, to signal that the compilation of | ||
| 13 | dnl module 'localtime-buffer' is needed. | ||
| 14 | AC_DEFUN([gl_LOCALTIME_BUFFER_NEEDED], | ||
| 15 | [ | ||
| 16 | AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) | ||
| 17 | AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) | ||
| 18 | NEED_LOCALTIME_BUFFER=1 | ||
| 19 | REPLACE_GMTIME=1 | ||
| 20 | REPLACE_LOCALTIME=1 | ||
| 21 | ]) | ||
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], | |||
| 113 | GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) | 113 | GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) |
| 114 | GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) | 114 | GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) |
| 115 | GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) | 115 | GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) |
| 116 | GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) | ||
| 116 | dnl Assume proper GNU behavior unless another module says otherwise. | 117 | dnl Assume proper GNU behavior unless another module says otherwise. |
| 117 | HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) | 118 | HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) |
| 118 | HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) | 119 | HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) |
| 119 | HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) | 120 | HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) |
| 120 | HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) | 121 | HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) |
| 122 | HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) | ||
| 121 | dnl If another module says to replace or to not replace, do that. | 123 | dnl If another module says to replace or to not replace, do that. |
| 122 | dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; | 124 | dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; |
| 123 | dnl this lets maintainers check for portability. | 125 | dnl this lets maintainers check for portability. |
| @@ -127,6 +129,7 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], | |||
| 127 | REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) | 129 | REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) |
| 128 | REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME]) | 130 | REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME]) |
| 129 | REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) | 131 | REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) |
| 132 | REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET]) | ||
| 130 | 133 | ||
| 131 | dnl Hack so that the time module doesn't depend on the sys_time module. | 134 | dnl Hack so that the time module doesn't depend on the sys_time module. |
| 132 | dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. | 135 | 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], | |||
| 12 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 12 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
| 13 | AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) | 13 | AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) |
| 14 | AC_REQUIRE([AC_STRUCT_TIMEZONE]) | 14 | AC_REQUIRE([AC_STRUCT_TIMEZONE]) |
| 15 | AC_CHECK_FUNCS_ONCE([tzset]) | ||
| 16 | 15 | ||
| 17 | AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]]) | 16 | AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]]) |
| 18 | if test "$ac_cv_type_timezone_t" = yes; then | 17 | if test "$ac_cv_type_timezone_t" = yes; then |