aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2017-07-13 19:24:06 -0700
committerPaul Eggert2017-07-13 19:24:49 -0700
commit3128d5d10e702ccb0732d947370e539a54046fc9 (patch)
treea2a3c95dcf1263d55ca63fb4675b43286a8351de
parentab87dbad1d26fba4e33b62b4b5a840be77ae9aa5 (diff)
downloademacs-3128d5d10e702ccb0732d947370e539a54046fc9.tar.gz
emacs-3128d5d10e702ccb0732d947370e539a54046fc9.zip
Merge from gnulib
This incorporates: 2017-07-13 Improve cross-compilation guesses for native Windows 2017-07-11 More systematic m4 quoting and indentation 2017-07-10 Make sure $host and $host_os are defined when used 2017-07-03 stdioext: Port to OpenVMS 2017-06-24 xalloc-oversized: port to icc * doc/misc/texinfo.tex, lib/fpending.c, lib/stdio-impl.h: * lib/xalloc-oversized.h, m4/dirfd.m4, m4/gettimeofday.m4: * m4/lstat.m4, m4/mktime.m4, m4/pselect.m4, m4/putenv.m4: * m4/stdint.m4, m4/strtoimax.m4, m4/utimes.m4: Copy from Gnulib.
-rw-r--r--doc/misc/texinfo.tex14
-rw-r--r--lib/fpending.c4
-rw-r--r--lib/stdio-impl.h2
-rw-r--r--lib/xalloc-oversized.h2
-rw-r--r--m4/dirfd.m49
-rw-r--r--m4/gettimeofday.m44
-rw-r--r--m4/lstat.m46
-rw-r--r--m4/mktime.m410
-rw-r--r--m4/pselect.m45
-rw-r--r--m4/putenv.m44
-rw-r--r--m4/stdint.m4108
-rw-r--r--m4/strtoimax.m412
-rw-r--r--m4/utimes.m422
13 files changed, 113 insertions, 89 deletions
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index b40a6e2a2be..3844333faec 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2017-06-04.19} 6\def\texinfoversion{2017-07-04.16}
7% 7%
8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -11009,7 +11009,6 @@ directory should work if nowhere else does.}
11009 \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% 11009 \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
11010 \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% 11010 \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
11011 \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% 11011 \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
11012 \DeclareUnicodeCharacter{2127}{\ensuremath\mho}%
11013 \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% 11012 \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
11014 \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% 11013 \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
11015 \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% 11014 \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
@@ -11025,7 +11024,6 @@ directory should work if nowhere else does.}
11025 \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% 11024 \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
11026 \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% 11025 \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
11027 \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% 11026 \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
11028 \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}%
11029 \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% 11027 \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
11030 \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% 11028 \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
11031 \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% 11029 \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
@@ -11034,8 +11032,6 @@ directory should work if nowhere else does.}
11034 \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% 11032 \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
11035 \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% 11033 \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
11036 \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% 11034 \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
11037 \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}%
11038 \DeclareUnicodeCharacter{2201}{\ensuremath\complement}%
11039 \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% 11035 \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
11040 \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% 11036 \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
11041 \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% 11037 \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
@@ -11069,8 +11065,6 @@ directory should work if nowhere else does.}
11069 \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% 11065 \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
11070 \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% 11066 \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
11071 \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% 11067 \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
11072 \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}%
11073 \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}%
11074 \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% 11068 \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
11075 \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% 11069 \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
11076 \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% 11070 \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
@@ -11085,8 +11079,6 @@ directory should work if nowhere else does.}
11085 \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% 11079 \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
11086 \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% 11080 \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
11087 \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% 11081 \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
11088 \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}%
11089 \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}%
11090 \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% 11082 \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
11091 \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% 11083 \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
11092 \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% 11084 \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
@@ -11102,12 +11094,11 @@ directory should work if nowhere else does.}
11102 \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% 11094 \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
11103 \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% 11095 \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
11104 % 11096 %
11105 \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}%
11106 \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% 11097 \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
11107 \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% 11098 \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
11108 \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% 11099 \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
11109 \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% 11100 \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
11110 \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}% 11101 \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
11111 \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% 11102 \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
11112 \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% 11103 \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
11113 \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% 11104 \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
@@ -11129,7 +11120,6 @@ directory should work if nowhere else does.}
11129 \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% 11120 \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
11130 \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% 11121 \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
11131 \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% 11122 \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
11132 \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}%
11133 \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% 11123 \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
11134 \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% 11124 \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
11135 \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% 11125 \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
diff --git a/lib/fpending.c b/lib/fpending.c
index c9b77866858..02602a1c27f 100644
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -41,7 +41,7 @@ __fpending (FILE *fp)
41 return fp->_ptr - fp->_buffer; 41 return fp->_ptr - fp->_buffer;
42#elif defined __minix /* Minix */ 42#elif defined __minix /* Minix */
43 return fp_->_ptr - fp_->_buf; 43 return fp_->_ptr - fp_->_buf;
44#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */ 44#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */
45 return (fp_->_ptr ? fp_->_ptr - fp_->_base : 0); 45 return (fp_->_ptr ? fp_->_ptr - fp_->_base : 0);
46#elif defined __UCLIBC__ /* uClibc */ 46#elif defined __UCLIBC__ /* uClibc */
47 return (fp->__modeflags & __FLAG_WRITING ? fp->__bufpos - fp->__bufstart : 0); 47 return (fp->__modeflags & __FLAG_WRITING ? fp->__bufpos - fp->__bufstart : 0);
@@ -51,8 +51,6 @@ __fpending (FILE *fp)
51 return fp->__bufp - fp->__buffer; 51 return fp->__bufp - fp->__buffer;
52#elif defined EPLAN9 /* Plan9 */ 52#elif defined EPLAN9 /* Plan9 */
53 return fp->wp - fp->buf; 53 return fp->wp - fp->buf;
54#elif defined __VMS /* VMS */
55 return (*fp)->_ptr - (*fp)->_base;
56#else 54#else
57# error "Please port gnulib fpending.c to your platform!" 55# error "Please port gnulib fpending.c to your platform!"
58 return 1; 56 return 1;
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 75a945eb724..d5b5943fd7c 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -99,6 +99,8 @@
99 int _file; \ 99 int _file; \
100 unsigned int _flag; \ 100 unsigned int _flag; \
101 } *) fp) 101 } *) fp)
102# elif defined __VMS /* OpenVMS */
103# define fp_ ((struct _iobuf *) fp)
102# else 104# else
103# define fp_ fp 105# define fp_ fp
104# endif 106# endif
diff --git a/lib/xalloc-oversized.h b/lib/xalloc-oversized.h
index ff0efc6ba40..2e09bab0be2 100644
--- a/lib/xalloc-oversized.h
+++ b/lib/xalloc-oversized.h
@@ -44,7 +44,7 @@ typedef size_t __xalloc_count_type;
44#if 7 <= __GNUC__ 44#if 7 <= __GNUC__
45# define xalloc_oversized(n, s) \ 45# define xalloc_oversized(n, s) \
46 __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1) 46 __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
47#elif 5 <= __GNUC__ && !__STRICT_ANSI__ 47#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
48# define xalloc_oversized(n, s) \ 48# define xalloc_oversized(n, s) \
49 (__builtin_constant_p (n) && __builtin_constant_p (s) \ 49 (__builtin_constant_p (n) && __builtin_constant_p (s) \
50 ? __xalloc_oversized (n, s) \ 50 ? __xalloc_oversized (n, s) \
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index b4ec3d1910b..d472c38549d 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -1,4 +1,4 @@
1# serial 24 -*- Autoconf -*- 1# serial 26 -*- Autoconf -*-
2 2
3dnl Find out how to get the file descriptor associated with an open DIR*. 3dnl Find out how to get the file descriptor associated with an open DIR*.
4 4
@@ -12,6 +12,7 @@ dnl From Jim Meyering
12AC_DEFUN([gl_FUNC_DIRFD], 12AC_DEFUN([gl_FUNC_DIRFD],
13[ 13[
14 AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) 14 AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
15 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
15 16
16 dnl Persuade glibc <dirent.h> to declare dirfd(). 17 dnl Persuade glibc <dirent.h> to declare dirfd().
17 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) 18 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -25,15 +26,15 @@ AC_DEFUN([gl_FUNC_DIRFD],
25 fi 26 fi
26 27
27 AC_CACHE_CHECK([whether dirfd is a macro], 28 AC_CACHE_CHECK([whether dirfd is a macro],
28 gl_cv_func_dirfd_macro, 29 [gl_cv_func_dirfd_macro],
29 [AC_EGREP_CPP([dirent_header_defines_dirfd], [ 30 [AC_EGREP_CPP([dirent_header_defines_dirfd], [
30#include <sys/types.h> 31#include <sys/types.h>
31#include <dirent.h> 32#include <dirent.h>
32#ifdef dirfd 33#ifdef dirfd
33 dirent_header_defines_dirfd 34 dirent_header_defines_dirfd
34#endif], 35#endif],
35 gl_cv_func_dirfd_macro=yes, 36 [gl_cv_func_dirfd_macro=yes],
36 gl_cv_func_dirfd_macro=no)]) 37 [gl_cv_func_dirfd_macro=no])])
37 38
38 # Use the replacement if we have no function or macro with that name, 39 # Use the replacement if we have no function or macro with that name,
39 # or if OS/2 kLIBC whose dirfd() does not work. 40 # or if OS/2 kLIBC whose dirfd() does not work.
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index 8ee206eea24..efa114dfaff 100644
--- a/m4/gettimeofday.m4
+++ b/m4/gettimeofday.m4
@@ -1,4 +1,4 @@
1# serial 23 1# serial 24
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
@@ -105,6 +105,8 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
105 case "$host_os" in 105 case "$host_os" in
106 # Guess all is fine on glibc systems. 106 # Guess all is fine on glibc systems.
107 *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; 107 *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
108 # Guess no on native Windows.
109 mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
108 # If we don't know, assume the worst. 110 # If we don't know, assume the worst.
109 *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; 111 *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
110 esac 112 esac
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index 953c117d801..0b6e5d70cba 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,4 +1,4 @@
1# serial 27 1# serial 29
2 2
3# Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc. 3# Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc.
4# 4#
@@ -33,6 +33,7 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
33[ 33[
34 dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it 34 dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
35 dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ. 35 dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
36 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
36 AC_CACHE_CHECK([whether lstat correctly handles trailing slash], 37 AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
37 [gl_cv_func_lstat_dereferences_slashed_symlink], 38 [gl_cv_func_lstat_dereferences_slashed_symlink],
38 [rm -f conftest.sym conftest.file 39 [rm -f conftest.sym conftest.file
@@ -54,6 +55,9 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
54 *-gnu*) 55 *-gnu*)
55 # Guess yes on glibc systems. 56 # Guess yes on glibc systems.
56 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; 57 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
58 mingw*)
59 # Guess no on native Windows.
60 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
57 *) 61 *)
58 # If we don't know, assume the worst. 62 # If we don't know, assume the worst.
59 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; 63 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 31da65e8b2d..85666844e2e 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
1# serial 28 1# serial 29
2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation, 2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation,
3dnl Inc. 3dnl Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
@@ -25,6 +25,7 @@ dnl Test whether mktime works. Set gl_cv_func_working_mktime.
25AC_DEFUN([gl_FUNC_MKTIME_WORKS], 25AC_DEFUN([gl_FUNC_MKTIME_WORKS],
26[ 26[
27 AC_REQUIRE([gl_TIME_T_IS_SIGNED]) 27 AC_REQUIRE([gl_TIME_T_IS_SIGNED])
28 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
28 29
29 dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained 30 dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
30 dnl in Autoconf and because it invokes AC_LIBOBJ. 31 dnl in Autoconf and because it invokes AC_LIBOBJ.
@@ -239,7 +240,12 @@ main ()
239}]])], 240}]])],
240 [gl_cv_func_working_mktime=yes], 241 [gl_cv_func_working_mktime=yes],
241 [gl_cv_func_working_mktime=no], 242 [gl_cv_func_working_mktime=no],
242 [gl_cv_func_working_mktime="guessing no"]) 243 [case "$host_os" in
244 # Guess no on native Windows.
245 mingw*) gl_cv_func_working_mktime="guessing no" ;;
246 *) gl_cv_func_working_mktime="guessing no" ;;
247 esac
248 ])
243 ]) 249 ])
244]) 250])
245 251
diff --git a/m4/pselect.m4 b/m4/pselect.m4
index 3f1c43f650d..eb1ad115cc2 100644
--- a/m4/pselect.m4
+++ b/m4/pselect.m4
@@ -1,4 +1,4 @@
1# pselect.m4 serial 2 1# pselect.m4 serial 4
2dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2011-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,
@@ -8,11 +8,12 @@ AC_DEFUN([gl_FUNC_PSELECT],
8[ 8[
9 AC_REQUIRE([gl_HEADER_SYS_SELECT]) 9 AC_REQUIRE([gl_HEADER_SYS_SELECT])
10 AC_REQUIRE([AC_C_RESTRICT]) 10 AC_REQUIRE([AC_C_RESTRICT])
11 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
11 AC_CHECK_FUNCS_ONCE([pselect]) 12 AC_CHECK_FUNCS_ONCE([pselect])
12 13
13 if test $ac_cv_func_pselect = yes; then 14 if test $ac_cv_func_pselect = yes; then
14 AC_CACHE_CHECK([whether signature of pselect conforms to POSIX], 15 AC_CACHE_CHECK([whether signature of pselect conforms to POSIX],
15 gl_cv_sig_pselect, 16 [gl_cv_sig_pselect],
16 [AC_LINK_IFELSE( 17 [AC_LINK_IFELSE(
17 [AC_LANG_PROGRAM( 18 [AC_LANG_PROGRAM(
18 [[#include <sys/select.h> 19 [[#include <sys/select.h>
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index a8e3ab33dc4..08ae41697a5 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,4 +1,4 @@
1# putenv.m4 serial 20 1# putenv.m4 serial 21
2dnl Copyright (C) 2002-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-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,
@@ -36,6 +36,8 @@ AC_DEFUN([gl_FUNC_PUTENV],
36 [case "$host_os" in 36 [case "$host_os" in
37 # Guess yes on glibc systems. 37 # Guess yes on glibc systems.
38 *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; 38 *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
39 # Guess no on native Windows.
40 mingw*) gl_cv_func_svid_putenv="guessing no" ;;
39 # If we don't know, assume the worst. 41 # If we don't know, assume the worst.
40 *) gl_cv_func_svid_putenv="guessing no" ;; 42 *) gl_cv_func_svid_putenv="guessing no" ;;
41 esac 43 esac
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index 4ac854d5198..4bf3e474515 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
1# stdint.m4 serial 50 1# stdint.m4 serial 51
2dnl Copyright (C) 2001-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-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,
@@ -10,6 +10,7 @@ dnl Test whether <stdint.h> is supported or must be substituted.
10AC_DEFUN_ONCE([gl_STDINT_H], 10AC_DEFUN_ONCE([gl_STDINT_H],
11[ 11[
12 AC_PREREQ([2.59])dnl 12 AC_PREREQ([2.59])dnl
13 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13 14
14 AC_REQUIRE([gl_LIMITS_H]) 15 AC_REQUIRE([gl_LIMITS_H])
15 AC_REQUIRE([gt_TYPE_WINT_T]) 16 AC_REQUIRE([gt_TYPE_WINT_T])
@@ -288,8 +289,12 @@ static const char *macro_values[] =
288]])], 289]])],
289 [gl_cv_header_working_stdint_h=yes], 290 [gl_cv_header_working_stdint_h=yes],
290 [], 291 [],
291 [dnl When cross-compiling, assume it works. 292 [case "$host_os" in
292 gl_cv_header_working_stdint_h=yes 293 # Guess yes on native Windows.
294 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
295 # In general, assume it works.
296 *) gl_cv_header_working_stdint_h="guessing yes" ;;
297 esac
293 ]) 298 ])
294 ]) 299 ])
295 ]) 300 ])
@@ -299,15 +304,16 @@ static const char *macro_values[] =
299 HAVE_SYS_BITYPES_H=0 304 HAVE_SYS_BITYPES_H=0
300 HAVE_SYS_INTTYPES_H=0 305 HAVE_SYS_INTTYPES_H=0
301 STDINT_H=stdint.h 306 STDINT_H=stdint.h
302 if test "$gl_cv_header_working_stdint_h" = yes; then 307 case "$gl_cv_header_working_stdint_h" in
303 HAVE_C99_STDINT_H=1 308 *yes)
304 dnl Now see whether the system <stdint.h> works without 309 HAVE_C99_STDINT_H=1
305 dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. 310 dnl Now see whether the system <stdint.h> works without
306 AC_CACHE_CHECK([whether stdint.h predates C++11], 311 dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
307 [gl_cv_header_stdint_predates_cxx11_h], 312 AC_CACHE_CHECK([whether stdint.h predates C++11],
308 [gl_cv_header_stdint_predates_cxx11_h=yes 313 [gl_cv_header_stdint_predates_cxx11_h],
309 AC_COMPILE_IFELSE([ 314 [gl_cv_header_stdint_predates_cxx11_h=yes
310 AC_LANG_PROGRAM([[ 315 AC_COMPILE_IFELSE([
316 AC_LANG_PROGRAM([[
311#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ 317#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
312#include <stdint.h> 318#include <stdint.h>
313] 319]
@@ -315,45 +321,47 @@ gl_STDINT_INCLUDES
315[ 321[
316intmax_t im = INTMAX_MAX; 322intmax_t im = INTMAX_MAX;
317int32_t i32 = INT32_C (0x7fffffff); 323int32_t i32 = INT32_C (0x7fffffff);
318 ]])], 324 ]])],
319 [gl_cv_header_stdint_predates_cxx11_h=no])]) 325 [gl_cv_header_stdint_predates_cxx11_h=no])])
320 326
321 if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then 327 if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
322 AC_DEFINE([__STDC_CONSTANT_MACROS], [1], 328 AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
323 [Define to 1 if the system <stdint.h> predates C++11.]) 329 [Define to 1 if the system <stdint.h> predates C++11.])
324 AC_DEFINE([__STDC_LIMIT_MACROS], [1], 330 AC_DEFINE([__STDC_LIMIT_MACROS], [1],
325 [Define to 1 if the system <stdint.h> predates C++11.]) 331 [Define to 1 if the system <stdint.h> predates C++11.])
326 fi 332 fi
327 AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], 333 AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
328 [gl_cv_header_stdint_width], 334 [gl_cv_header_stdint_width],
329 [gl_cv_header_stdint_width=no 335 [gl_cv_header_stdint_width=no
330 AC_COMPILE_IFELSE( 336 AC_COMPILE_IFELSE(
331 [AC_LANG_PROGRAM([[ 337 [AC_LANG_PROGRAM([[
332 /* Work if build is not clean. */ 338 /* Work if build is not clean. */
333 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 339 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
334 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ 340 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
335 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 341 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
336 #endif 342 #endif
337 #include <stdint.h> 343 #include <stdint.h>
338 ]gl_STDINT_INCLUDES[ 344 ]gl_STDINT_INCLUDES[
339 int iw = UINTMAX_WIDTH; 345 int iw = UINTMAX_WIDTH;
340 ]])], 346 ]])],
341 [gl_cv_header_stdint_width=yes])]) 347 [gl_cv_header_stdint_width=yes])])
342 if test "$gl_cv_header_stdint_width" = yes; then 348 if test "$gl_cv_header_stdint_width" = yes; then
343 STDINT_H= 349 STDINT_H=
344 fi 350 fi
345 else 351 ;;
346 dnl Check for <sys/inttypes.h>, and for 352 *)
347 dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5). 353 dnl Check for <sys/inttypes.h>, and for
348 AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) 354 dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
349 if test $ac_cv_header_sys_inttypes_h = yes; then 355 AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
350 HAVE_SYS_INTTYPES_H=1 356 if test $ac_cv_header_sys_inttypes_h = yes; then
351 fi 357 HAVE_SYS_INTTYPES_H=1
352 if test $ac_cv_header_sys_bitypes_h = yes; then 358 fi
353 HAVE_SYS_BITYPES_H=1 359 if test $ac_cv_header_sys_bitypes_h = yes; then
354 fi 360 HAVE_SYS_BITYPES_H=1
355 gl_STDINT_TYPE_PROPERTIES 361 fi
356 fi 362 gl_STDINT_TYPE_PROPERTIES
363 ;;
364 esac
357 365
358 dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. 366 dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
359 LIMITS_H=limits.h 367 LIMITS_H=limits.h
diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4
index f0586f1a802..61809c8b5db 100644
--- a/m4/strtoimax.m4
+++ b/m4/strtoimax.m4
@@ -1,4 +1,4 @@
1# strtoimax.m4 serial 14 1# strtoimax.m4 serial 15
2dnl Copyright (C) 2002-2004, 2006, 2009-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2004, 2006, 2009-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,
@@ -61,10 +61,12 @@ int main ()
61 [gl_cv_func_strtoimax=yes], 61 [gl_cv_func_strtoimax=yes],
62 [gl_cv_func_strtoimax=no], 62 [gl_cv_func_strtoimax=no],
63 [case "$host_os" in 63 [case "$host_os" in
64 # Guess no on AIX 5. 64 # Guess no on AIX 5.
65 aix5*) gl_cv_func_strtoimax="guessing no" ;; 65 aix5*) gl_cv_func_strtoimax="guessing no" ;;
66 # Guess yes otherwise. 66 # Guess yes on native Windows.
67 *) gl_cv_func_strtoimax="guessing yes" ;; 67 mingw*) gl_cv_func_strtoimax="guessing yes" ;;
68 # Guess yes otherwise.
69 *) gl_cv_func_strtoimax="guessing yes" ;;
68 esac 70 esac
69 ]) 71 ])
70 ]) 72 ])
diff --git a/m4/utimes.m4 b/m4/utimes.m4
index 518824f218f..847b2eba78f 100644
--- a/m4/utimes.m4
+++ b/m4/utimes.m4
@@ -1,5 +1,5 @@
1# Detect some bugs in glibc's implementation of utimes. 1# Detect some bugs in glibc's implementation of utimes.
2# serial 4 2# serial 5
3 3
4dnl Copyright (C) 2003-2005, 2009-2017 Free Software Foundation, Inc. 4dnl Copyright (C) 2003-2005, 2009-2017 Free Software Foundation, Inc.
5dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
@@ -20,10 +20,10 @@ dnl with or without modifications, as long as this notice is preserved.
20 20
21AC_DEFUN([gl_FUNC_UTIMES], 21AC_DEFUN([gl_FUNC_UTIMES],
22[ 22[
23 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
23 AC_CACHE_CHECK([whether the utimes function works], 24 AC_CACHE_CHECK([whether the utimes function works],
24 [gl_cv_func_working_utimes], 25 [gl_cv_func_working_utimes],
25 [ 26 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
26 AC_RUN_IFELSE([AC_LANG_SOURCE([[
27#include <sys/types.h> 27#include <sys/types.h>
28#include <sys/stat.h> 28#include <sys/stat.h>
29#include <fcntl.h> 29#include <fcntl.h>
@@ -142,9 +142,17 @@ main ()
142 ]])], 142 ]])],
143 [gl_cv_func_working_utimes=yes], 143 [gl_cv_func_working_utimes=yes],
144 [gl_cv_func_working_utimes=no], 144 [gl_cv_func_working_utimes=no],
145 [gl_cv_func_working_utimes=no])]) 145 [case "$host_os" in
146 # Guess no on native Windows.
147 mingw*) gl_cv_func_working_utimes="guessing no" ;;
148 *) gl_cv_func_working_utimes="guessing no" ;;
149 esac
150 ])
151 ])
146 152
147 if test $gl_cv_func_working_utimes = yes; then 153 case "$gl_cv_func_working_utimes" in
148 AC_DEFINE([HAVE_WORKING_UTIMES], [1], [Define if utimes works properly.]) 154 *yes)
149 fi 155 AC_DEFINE([HAVE_WORKING_UTIMES], [1], [Define if utimes works properly.])
156 ;;
157 esac
150]) 158])