aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert2017-05-14 01:29:05 -0700
committerPaul Eggert2017-05-14 01:29:29 -0700
commit4132bd74e9816ca913f862835cc062e092ab8b79 (patch)
tree7861e23ef6007320ca0417a147656cf9774473b7 /m4
parent9a5e864de731e113badbe300b1e4174f103547fa (diff)
downloademacs-4132bd74e9816ca913f862835cc062e092ab8b79.tar.gz
emacs-4132bd74e9816ca913f862835cc062e092ab8b79.zip
Merge from gnulib
This incorporates: 2017-05-13 largefile: Simplify 2017-05-13 largefile: Improve and document 2017-05-13 truncate: New module 2017-05-13 windows-stat-timespec: New module 2017-05-13 windows-stat-override: New module 2017-05-11 getopt-posix: port to mingw 2017-05-11 gettimeofday: Increase precision on mingw 2017-05-10 time: Fix missing initialization of HAVE_TIMEZONE_T 2017-05-10 Implement a way to opt out from MSVC support 2017-05-09 tzset: Expand comment about TZ problem on native Windows * build-aux/config.guess, lib/dup2.c, lib/fcntl.c, lib/fsync.c: * lib/getdtablesize.c, lib/getopt.c, lib/gettimeofday.c: * lib/mktime.c, lib/stat-time.h, lib/sys_stat.in.h, lib/unistd.in.h: * lib/utimens.c, m4/gettimeofday.m4, m4/largefile.m4: * m4/sys_stat_h.m4, m4/sys_time_h.m4, m4/time_h.m4, m4/time_rz.m4: * m4/unistd_h.m4: Copy from gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'm4')
-rw-r--r--m4/gettimeofday.m410
-rw-r--r--m4/gnulib-comp.m42
-rw-r--r--m4/largefile.m421
-rw-r--r--m4/sys_stat_h.m418
-rw-r--r--m4/sys_time_h.m43
-rw-r--r--m4/time_h.m44
-rw-r--r--m4/time_rz.m42
-rw-r--r--m4/unistd_h.m49
8 files changed, 49 insertions, 20 deletions
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index 34adc64778f..8ee206eea24 100644
--- a/m4/gettimeofday.m4
+++ b/m4/gettimeofday.m4
@@ -1,4 +1,4 @@
1# serial 22 1# serial 23
2 2
3# Copyright (C) 2001-2003, 2005, 2007, 2009-2017 Free Software Foundation, Inc. 3# Copyright (C) 2001-2003, 2005, 2007, 2009-2017 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4# This file is free software; the Free Software Foundation
@@ -9,9 +9,10 @@ dnl From Jim Meyering.
9 9
10AC_DEFUN([gl_FUNC_GETTIMEOFDAY], 10AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
11[ 11[
12 AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
12 AC_REQUIRE([AC_C_RESTRICT]) 13 AC_REQUIRE([AC_C_RESTRICT])
14 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([gl_HEADER_SYS_TIME_H]) 15 AC_REQUIRE([gl_HEADER_SYS_TIME_H])
14 AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
15 AC_CHECK_FUNCS_ONCE([gettimeofday]) 16 AC_CHECK_FUNCS_ONCE([gettimeofday])
16 17
17 gl_gettimeofday_timezone=void 18 gl_gettimeofday_timezone=void
@@ -54,6 +55,11 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict);
54 if test $REPLACE_STRUCT_TIMEVAL = 1; then 55 if test $REPLACE_STRUCT_TIMEVAL = 1; then
55 REPLACE_GETTIMEOFDAY=1 56 REPLACE_GETTIMEOFDAY=1
56 fi 57 fi
58 dnl On mingw, the original gettimeofday has only a precision of 15.6
59 dnl milliseconds. So override it.
60 case "$host_os" in
61 mingw*) REPLACE_GETTIMEOFDAY=1 ;;
62 esac
57 fi 63 fi
58 AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], 64 AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
59 [Define this to 'void' or 'struct timezone' to match the system's 65 [Define this to 'void' or 'struct timezone' to match the system's
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 74b197c8633..8295e483582 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -391,7 +391,7 @@ AC_DEFUN([gl_INIT],
391 fi 391 fi
392 gl_TIME_MODULE_INDICATOR([time_r]) 392 gl_TIME_MODULE_INDICATOR([time_r])
393 gl_TIME_RZ 393 gl_TIME_RZ
394 if test "$HAVE_TIMEZONE_T" = 0; then 394 if test $HAVE_TIMEZONE_T = 0; then
395 AC_LIBOBJ([time_rz]) 395 AC_LIBOBJ([time_rz])
396 fi 396 fi
397 gl_TIME_MODULE_INDICATOR([time_rz]) 397 gl_TIME_MODULE_INDICATOR([time_rz])
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index 790f7c0ad39..edc1a9b41ba 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -126,9 +126,24 @@ AC_DEFUN([gl_LARGEFILE],
126 else 126 else
127 WINDOWS_64_BIT_OFF_T=0 127 WINDOWS_64_BIT_OFF_T=0
128 fi 128 fi
129 dnl But all native Windows platforms (including mingw64) have a 32-bit 129 dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat'
130 dnl st_size member in 'struct stat'. 130 dnl to 'struct _stat32i64' or 'struct _stat64' (depending on
131 WINDOWS_64_BIT_ST_SIZE=1 131 dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member.
132 AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64],
133 [AC_COMPILE_IFELSE(
134 [AC_LANG_PROGRAM(
135 [[#include <sys/types.h>
136 struct stat buf;
137 int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
138 ]],
139 [[]])],
140 [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no])
141 ])
142 if test $gl_cv_member_st_size_64 = no; then
143 WINDOWS_64_BIT_ST_SIZE=1
144 else
145 WINDOWS_64_BIT_ST_SIZE=0
146 fi
132 ;; 147 ;;
133 *) 148 *)
134 dnl Nothing to do on gnulib's side. 149 dnl Nothing to do on gnulib's side.
diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
index 1e34ac40da1..89342789828 100644
--- a/m4/sys_stat_h.m4
+++ b/m4/sys_stat_h.m4
@@ -1,4 +1,4 @@
1# sys_stat_h.m4 serial 28 -*- Autoconf -*- 1# sys_stat_h.m4 serial 31 -*- Autoconf -*-
2dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -19,18 +19,21 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
19 dnl Ensure the type mode_t gets defined. 19 dnl Ensure the type mode_t gets defined.
20 AC_REQUIRE([AC_TYPE_MODE_T]) 20 AC_REQUIRE([AC_TYPE_MODE_T])
21 21
22 dnl Whether to override 'struct stat'. 22 dnl Whether to enable precise timestamps in 'struct stat'.
23 m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [
24 AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC])
25 ], [
26 WINDOWS_STAT_TIMESPEC=0
27 ])
28 AC_SUBST([WINDOWS_STAT_TIMESPEC])
29
30 dnl Whether to ensure that struct stat.st_size is 64-bit wide.
23 m4_ifdef([gl_LARGEFILE], [ 31 m4_ifdef([gl_LARGEFILE], [
24 AC_REQUIRE([gl_LARGEFILE]) 32 AC_REQUIRE([gl_LARGEFILE])
25 ], [ 33 ], [
26 WINDOWS_64_BIT_ST_SIZE=0 34 WINDOWS_64_BIT_ST_SIZE=0
27 ]) 35 ])
28 AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) 36 AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
29 if test $WINDOWS_64_BIT_ST_SIZE = 1; then
30 AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1],
31 [Define to 1 if Gnulib overrides 'struct stat' on Windows so that
32 struct stat.st_size becomes 64-bit.])
33 fi
34 37
35 dnl Define types that are supposed to be defined in <sys/types.h> or 38 dnl Define types that are supposed to be defined in <sys/types.h> or
36 dnl <sys/stat.h>. 39 dnl <sys/stat.h>.
@@ -72,6 +75,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
72 GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT]) 75 GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT])
73 GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) 76 GNULIB_STAT=0; AC_SUBST([GNULIB_STAT])
74 GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) 77 GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT])
78 GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT])
75 dnl Assume proper GNU behavior unless another module says otherwise. 79 dnl Assume proper GNU behavior unless another module says otherwise.
76 HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) 80 HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT])
77 HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) 81 HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT])
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
index e622dbe9a24..1c8c3cfcc32 100644
--- a/m4/sys_time_h.m4
+++ b/m4/sys_time_h.m4
@@ -1,5 +1,5 @@
1# Configure a replacement for <sys/time.h>. 1# Configure a replacement for <sys/time.h>.
2# serial 8 2# serial 9
3 3
4# Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. 4# Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation 5# This file is free software; the Free Software Foundation
@@ -105,7 +105,6 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
105 HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) 105 HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY])
106 HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) 106 HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL])
107 HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H]) 107 HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H])
108 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
109 REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY]) 108 REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY])
110 REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL]) 109 REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL])
111]) 110])
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index f52b60192e8..28e22092e14 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -2,7 +2,7 @@
2 2
3# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. 3# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc.
4 4
5# serial 10 5# serial 11
6 6
7# This file is free software; the Free Software Foundation 7# This file is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it, 8# gives unlimited permission to copy and/or distribute it,
@@ -120,6 +120,8 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
120 HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) 120 HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME])
121 HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) 121 HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM])
122 HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) 122 HAVE_TZSET=1; AC_SUBST([HAVE_TZSET])
123 dnl Even GNU libc does not have timezone_t yet.
124 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
123 dnl If another module says to replace or to not replace, do that. 125 dnl If another module says to replace or to not replace, do that.
124 dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; 126 dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
125 dnl this lets maintainers check for portability. 127 dnl this lets maintainers check for portability.
diff --git a/m4/time_rz.m4 b/m4/time_rz.m4
index 079e933b4e6..3991118b61c 100644
--- a/m4/time_rz.m4
+++ b/m4/time_rz.m4
@@ -10,7 +10,7 @@ dnl Written by Paul Eggert.
10AC_DEFUN([gl_TIME_RZ], 10AC_DEFUN([gl_TIME_RZ],
11[ 11[
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_TIME_H_DEFAULTS])
14 AC_REQUIRE([AC_STRUCT_TIMEZONE]) 14 AC_REQUIRE([AC_STRUCT_TIMEZONE])
15 15
16 AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]]) 16 AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index 25aef19ec9d..cc44677d9eb 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
1# unistd_h.m4 serial 69 1# unistd_h.m4 serial 70
2dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -46,8 +46,8 @@ AC_DEFUN([gl_UNISTD_H],
46 gethostname getlogin getlogin_r getpagesize 46 gethostname getlogin getlogin_r getpagesize
47 getusershell setusershell endusershell 47 getusershell setusershell endusershell
48 group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite 48 group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
49 readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r 49 readlink readlinkat rmdir sethostname sleep symlink symlinkat
50 unlink unlinkat usleep]) 50 truncate ttyname_r unlink unlinkat usleep])
51]) 51])
52 52
53AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], 53AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -102,6 +102,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
102 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) 102 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
103 GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) 103 GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK])
104 GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) 104 GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT])
105 GNULIB_TRUNCATE=0; AC_SUBST([GNULIB_TRUNCATE])
105 GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) 106 GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R])
106 GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) 107 GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
107 GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) 108 GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
@@ -139,6 +140,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
139 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) 140 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
140 HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) 141 HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
141 HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) 142 HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
143 HAVE_TRUNCATE=1; AC_SUBST([HAVE_TRUNCATE])
142 HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) 144 HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
143 HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) 145 HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
144 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) 146 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
@@ -179,6 +181,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
179 REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) 181 REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
180 REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) 182 REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
181 REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) 183 REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT])
184 REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE])
182 REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) 185 REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R])
183 REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) 186 REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK])
184 REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) 187 REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])