aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorMichael R. Mauger2017-07-24 22:15:04 -0400
committerMichael R. Mauger2017-07-24 22:15:04 -0400
commitdf1a71272e5cdd10b511e2ffd702ca50ddd8a773 (patch)
tree9b9ac725394ee80891e2bff57b6407d0e491e71a /m4
parenteb27fc4d49e8c914cd0e6a8a2d02159601542141 (diff)
parent32daa3cb54523006c88717cbeac87964cd687a1b (diff)
downloademacs-df1a71272e5cdd10b511e2ffd702ca50ddd8a773.tar.gz
emacs-df1a71272e5cdd10b511e2ffd702ca50ddd8a773.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'm4')
-rw-r--r--m4/dirfd.m49
-rw-r--r--m4/explicit_bzero.m422
-rw-r--r--m4/getdtablesize.m454
-rw-r--r--m4/gettimeofday.m44
-rw-r--r--m4/gnulib-comp.m417
-rw-r--r--m4/lstat.m46
-rw-r--r--m4/mktime.m410
-rw-r--r--m4/nstrftime.m4 (renamed from m4/strftime.m4)0
-rw-r--r--m4/pselect.m45
-rw-r--r--m4/putenv.m44
-rw-r--r--m4/stdint.m4108
-rw-r--r--m4/string_h.m42
-rw-r--r--m4/strtoimax.m412
-rw-r--r--m4/utimes.m422
14 files changed, 178 insertions, 97 deletions
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/explicit_bzero.m4 b/m4/explicit_bzero.m4
new file mode 100644
index 00000000000..f9dc678207a
--- /dev/null
+++ b/m4/explicit_bzero.m4
@@ -0,0 +1,22 @@
1dnl Copyright 2017 Free Software Foundation, Inc.
2dnl This file is free software; the Free Software Foundation
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([gl_FUNC_EXPLICIT_BZERO],
7[
8 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
9
10 dnl Persuade glibc <string.h> to declare explicit_bzero.
11 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
12
13 AC_CHECK_FUNCS_ONCE([explicit_bzero])
14 if test $ac_cv_func_explicit_bzero = no; then
15 HAVE_EXPLICIT_BZERO=0
16 fi
17])
18
19AC_DEFUN([gl_PREREQ_EXPLICIT_BZERO],
20[
21 AC_CHECK_FUNCS([explicit_memset])
22])
diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4
index 1af2a2478fa..f1e4f5f699e 100644
--- a/m4/getdtablesize.m4
+++ b/m4/getdtablesize.m4
@@ -1,4 +1,4 @@
1# getdtablesize.m4 serial 6 1# getdtablesize.m4 serial 7
2dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-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,
@@ -12,29 +12,43 @@ AC_DEFUN([gl_FUNC_GETDTABLESIZE],
12 AC_CHECK_DECLS_ONCE([getdtablesize]) 12 AC_CHECK_DECLS_ONCE([getdtablesize])
13 if test $ac_cv_func_getdtablesize = yes && 13 if test $ac_cv_func_getdtablesize = yes &&
14 test $ac_cv_have_decl_getdtablesize = yes; then 14 test $ac_cv_have_decl_getdtablesize = yes; then
15 # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit
16 # up to an unchangeable hard limit; all other platforms correctly
17 # require setrlimit before getdtablesize() can report a larger value.
18 AC_CACHE_CHECK([whether getdtablesize works], 15 AC_CACHE_CHECK([whether getdtablesize works],
19 [gl_cv_func_getdtablesize_works], 16 [gl_cv_func_getdtablesize_works],
20 [AC_RUN_IFELSE([ 17 [dnl There are two concepts: the "maximum possible file descriptor value + 1"
21 AC_LANG_PROGRAM([[#include <unistd.h>]], 18 dnl and the "maximum number of open file descriptors in a process".
22 [int size = getdtablesize(); 19 dnl Per SUSv2 and POSIX, getdtablesize() should return the first one.
23 if (dup2 (0, getdtablesize()) != -1) 20 dnl On most platforms, the first and the second concept are the same.
24 return 1; 21 dnl On OpenVMS, however, they are different and getdtablesize() returns
25 if (size != getdtablesize()) 22 dnl the second one; thus the test below fails. But we don't care
26 return 2; 23 dnl because there's no good way to write a replacement getdtablesize().
27 ])], 24 case "$host_os" in
28 [gl_cv_func_getdtablesize_works=yes], 25 vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
29 [gl_cv_func_getdtablesize_works=no], 26 *)
30 [case "$host_os" in 27 dnl Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft
31 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows 28 dnl limit up to an unchangeable hard limit; all other platforms
32 gl_cv_func_getdtablesize_works="guessing no" ;; 29 dnl correctly require setrlimit before getdtablesize() can report
33 *) gl_cv_func_getdtablesize_works="guessing yes" ;; 30 dnl a larger value.
34 esac]) 31 AC_RUN_IFELSE([
32 AC_LANG_PROGRAM([[#include <unistd.h>]],
33 [int size = getdtablesize();
34 if (dup2 (0, getdtablesize()) != -1)
35 return 1;
36 if (size != getdtablesize())
37 return 2;
38 ])],
39 [gl_cv_func_getdtablesize_works=yes],
40 [gl_cv_func_getdtablesize_works=no],
41 [case "$host_os" in
42 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
43 gl_cv_func_getdtablesize_works="guessing no" ;;
44 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
45 esac
46 ])
47 ;;
48 esac
35 ]) 49 ])
36 case "$gl_cv_func_getdtablesize_works" in 50 case "$gl_cv_func_getdtablesize_works" in
37 *yes) ;; 51 *yes | "no (limitation)") ;;
38 *) REPLACE_GETDTABLESIZE=1 ;; 52 *) REPLACE_GETDTABLESIZE=1 ;;
39 esac 53 esac
40 else 54 else
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/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 107645df4fd..2f135773930 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -72,6 +72,7 @@ AC_DEFUN([gl_EARLY],
72 # Code from module errno: 72 # Code from module errno:
73 # Code from module euidaccess: 73 # Code from module euidaccess:
74 # Code from module execinfo: 74 # Code from module execinfo:
75 # Code from module explicit_bzero:
75 # Code from module extensions: 76 # Code from module extensions:
76 # Code from module extern-inline: 77 # Code from module extern-inline:
77 # Code from module faccessat: 78 # Code from module faccessat:
@@ -112,6 +113,7 @@ AC_DEFUN([gl_EARLY],
112 # Code from module mktime-internal: 113 # Code from module mktime-internal:
113 # Code from module multiarch: 114 # Code from module multiarch:
114 # Code from module nocrash: 115 # Code from module nocrash:
116 # Code from module nstrftime:
115 # Code from module openat-h: 117 # Code from module openat-h:
116 # Code from module pipe2: 118 # Code from module pipe2:
117 # Code from module pselect: 119 # Code from module pselect:
@@ -138,7 +140,6 @@ AC_DEFUN([gl_EARLY],
138 # Code from module stdio: 140 # Code from module stdio:
139 # Code from module stdlib: 141 # Code from module stdlib:
140 # Code from module stpcpy: 142 # Code from module stpcpy:
141 # Code from module strftime:
142 # Code from module string: 143 # Code from module string:
143 # Code from module strtoimax: 144 # Code from module strtoimax:
144 # Code from module strtoll: 145 # Code from module strtoll:
@@ -210,6 +211,12 @@ AC_DEFUN([gl_INIT],
210 gl_UNISTD_MODULE_INDICATOR([environ]) 211 gl_UNISTD_MODULE_INDICATOR([environ])
211 gl_HEADER_ERRNO_H 212 gl_HEADER_ERRNO_H
212 gl_EXECINFO_H 213 gl_EXECINFO_H
214 gl_FUNC_EXPLICIT_BZERO
215 if test $HAVE_EXPLICIT_BZERO = 0; then
216 AC_LIBOBJ([explicit_bzero])
217 gl_PREREQ_EXPLICIT_BZERO
218 fi
219 gl_STRING_MODULE_INDICATOR([explicit_bzero])
213 AC_REQUIRE([gl_EXTERN_INLINE]) 220 AC_REQUIRE([gl_EXTERN_INLINE])
214 gl_FUNC_FACCESSAT 221 gl_FUNC_FACCESSAT
215 if test $HAVE_FACCESSAT = 0; then 222 if test $HAVE_FACCESSAT = 0; then
@@ -307,6 +314,7 @@ AC_DEFUN([gl_INIT],
307 fi 314 fi
308 gl_TIME_MODULE_INDICATOR([mktime]) 315 gl_TIME_MODULE_INDICATOR([mktime])
309 gl_MULTIARCH 316 gl_MULTIARCH
317 gl_FUNC_GNU_STRFTIME
310 gl_FUNC_PIPE2 318 gl_FUNC_PIPE2
311 gl_UNISTD_MODULE_INDICATOR([pipe2]) 319 gl_UNISTD_MODULE_INDICATOR([pipe2])
312 gl_FUNC_PSELECT 320 gl_FUNC_PSELECT
@@ -358,7 +366,6 @@ AC_DEFUN([gl_INIT],
358 gl_PREREQ_STPCPY 366 gl_PREREQ_STPCPY
359 fi 367 fi
360 gl_STRING_MODULE_INDICATOR([stpcpy]) 368 gl_STRING_MODULE_INDICATOR([stpcpy])
361 gl_FUNC_GNU_STRFTIME
362 gl_HEADER_STRING_H 369 gl_HEADER_STRING_H
363 gl_FUNC_STRTOIMAX 370 gl_FUNC_STRTOIMAX
364 if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then 371 if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
@@ -837,6 +844,7 @@ AC_DEFUN([gl_FILE_LIST], [
837 lib/euidaccess.c 844 lib/euidaccess.c
838 lib/execinfo.c 845 lib/execinfo.c
839 lib/execinfo.in.h 846 lib/execinfo.in.h
847 lib/explicit_bzero.c
840 lib/faccessat.c 848 lib/faccessat.c
841 lib/fcntl.c 849 lib/fcntl.c
842 lib/fcntl.in.h 850 lib/fcntl.in.h
@@ -885,6 +893,7 @@ AC_DEFUN([gl_FILE_LIST], [
885 lib/mkostemp.c 893 lib/mkostemp.c
886 lib/mktime-internal.h 894 lib/mktime-internal.h
887 lib/mktime.c 895 lib/mktime.c
896 lib/nstrftime.c
888 lib/openat-priv.h 897 lib/openat-priv.h
889 lib/openat-proc.c 898 lib/openat-proc.c
890 lib/openat.h 899 lib/openat.h
@@ -916,7 +925,6 @@ AC_DEFUN([gl_FILE_LIST], [
916 lib/stdio.in.h 925 lib/stdio.in.h
917 lib/stdlib.in.h 926 lib/stdlib.in.h
918 lib/stpcpy.c 927 lib/stpcpy.c
919 lib/strftime.c
920 lib/strftime.h 928 lib/strftime.h
921 lib/string.in.h 929 lib/string.in.h
922 lib/strtoimax.c 930 lib/strtoimax.c
@@ -967,6 +975,7 @@ AC_DEFUN([gl_FILE_LIST], [
967 m4/errno_h.m4 975 m4/errno_h.m4
968 m4/euidaccess.m4 976 m4/euidaccess.m4
969 m4/execinfo.m4 977 m4/execinfo.m4
978 m4/explicit_bzero.m4
970 m4/extensions.m4 979 m4/extensions.m4
971 m4/extern-inline.m4 980 m4/extern-inline.m4
972 m4/faccessat.m4 981 m4/faccessat.m4
@@ -1004,6 +1013,7 @@ AC_DEFUN([gl_FILE_LIST], [
1004 m4/mktime.m4 1013 m4/mktime.m4
1005 m4/multiarch.m4 1014 m4/multiarch.m4
1006 m4/nocrash.m4 1015 m4/nocrash.m4
1016 m4/nstrftime.m4
1007 m4/off_t.m4 1017 m4/off_t.m4
1008 m4/pipe2.m4 1018 m4/pipe2.m4
1009 m4/pselect.m4 1019 m4/pselect.m4
@@ -1028,7 +1038,6 @@ AC_DEFUN([gl_FILE_LIST], [
1028 m4/stdio_h.m4 1038 m4/stdio_h.m4
1029 m4/stdlib_h.m4 1039 m4/stdlib_h.m4
1030 m4/stpcpy.m4 1040 m4/stpcpy.m4
1031 m4/strftime.m4
1032 m4/string_h.m4 1041 m4/string_h.m4
1033 m4/strtoimax.m4 1042 m4/strtoimax.m4
1034 m4/strtoll.m4 1043 m4/strtoll.m4
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/strftime.m4 b/m4/nstrftime.m4
index d2dac9e2328..d2dac9e2328 100644
--- a/m4/strftime.m4
+++ b/m4/nstrftime.m4
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/string_h.m4 b/m4/string_h.m4
index 3d2ad2219a5..ac6311fba07 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -43,6 +43,7 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
43 43
44AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], 44AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
45[ 45[
46 GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO])
46 GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) 47 GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL])
47 GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) 48 GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL])
48 GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) 49 GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
@@ -82,6 +83,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
82 GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) 83 GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
83 HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) 84 HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
84 dnl Assume proper GNU behavior unless another module says otherwise. 85 dnl Assume proper GNU behavior unless another module says otherwise.
86 HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO])
85 HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) 87 HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
86 HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) 88 HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
87 HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) 89 HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
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])