aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-10-14 22:10:48 -0500
committerPaul Eggert2018-10-14 22:12:46 -0500
commit6b8fd34c4ab1aa23b180440cdc8210900896bbf4 (patch)
tree21787b9f7ba030e501ff12c9c4259beab01b00e8
parentaba7910e368f98790fdbaf5256c75da558d7b195 (diff)
downloademacs-6b8fd34c4ab1aa23b180440cdc8210900896bbf4.tar.gz
emacs-6b8fd34c4ab1aa23b180440cdc8210900896bbf4.zip
Update from Gnulib
This is minor refactoring that should not affect Emacs builds. It incorporates: 2018-10-12 Make better use of Autoconf * m4/environ.m4, m4/fsusage.m4, m4/manywarnings.m4, m4/socklen.m4: Copy from Gnulib.
-rw-r--r--m4/environ.m420
-rw-r--r--m4/fsusage.m4352
-rw-r--r--m4/manywarnings.m479
-rw-r--r--m4/socklen.m415
4 files changed, 234 insertions, 232 deletions
diff --git a/m4/environ.m4 b/m4/environ.m4
index 68b67eaca4e..acee5364b77 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,4 +1,4 @@
1# environ.m4 serial 6 1# environ.m4 serial 7
2dnl Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2004, 2006-2018 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,
@@ -29,16 +29,14 @@ AC_DEFUN_ONCE([gl_ENVIRON],
29AC_DEFUN([gt_CHECK_VAR_DECL], 29AC_DEFUN([gt_CHECK_VAR_DECL],
30[ 30[
31 define([gt_cv_var], [gt_cv_var_]$2[_declaration]) 31 define([gt_cv_var], [gt_cv_var_]$2[_declaration])
32 AC_MSG_CHECKING([if $2 is properly declared]) 32 AC_CACHE_CHECK([if $2 is properly declared], [gt_cv_var],
33 AC_CACHE_VAL([gt_cv_var], [ 33 [AC_COMPILE_IFELSE(
34 AC_COMPILE_IFELSE( 34 [AC_LANG_PROGRAM(
35 [AC_LANG_PROGRAM( 35 [[$1
36 [[$1 36 extern struct { int foo; } $2;]],
37 extern struct { int foo; } $2;]], 37 [[$2.foo = 1;]])],
38 [[$2.foo = 1;]])], 38 [gt_cv_var=no],
39 [gt_cv_var=no], 39 [gt_cv_var=yes])])
40 [gt_cv_var=yes])])
41 AC_MSG_RESULT([$gt_cv_var])
42 if test $gt_cv_var = yes; then 40 if test $gt_cv_var = yes; then
43 AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1, 41 AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
44 [Define if you have the declaration of $2.]) 42 [Define if you have the declaration of $2.])
diff --git a/m4/fsusage.m4 b/m4/fsusage.m4
index f9dfbcb7a04..aab4024a975 100644
--- a/m4/fsusage.m4
+++ b/m4/fsusage.m4
@@ -1,4 +1,4 @@
1# serial 32 1# serial 33
2# Obtaining file system usage information. 2# Obtaining file system usage information.
3 3
4# Copyright (C) 1997-1998, 2000-2001, 2003-2018 Free Software Foundation, Inc. 4# Copyright (C) 1997-1998, 2000-2001, 2003-2018 Free Software Foundation, Inc.
@@ -29,27 +29,30 @@ AC_DEFUN([gl_FSUSAGE],
29 29
30AC_DEFUN([gl_FILE_SYSTEM_USAGE], 30AC_DEFUN([gl_FILE_SYSTEM_USAGE],
31[ 31[
32dnl Enable large-file support. This has the effect of changing the size 32 dnl Enable large-file support. This has the effect of changing the size
33dnl of field f_blocks in 'struct statvfs' from 32 bit to 64 bit on 33 dnl of field f_blocks in 'struct statvfs' from 32 bit to 64 bit on
34dnl glibc/Hurd, HP-UX 11, Solaris (32-bit mode). It also changes the size 34 dnl glibc/Hurd, HP-UX 11, Solaris (32-bit mode). It also changes the size
35dnl of field f_blocks in 'struct statfs' from 32 bit to 64 bit on 35 dnl of field f_blocks in 'struct statfs' from 32 bit to 64 bit on
36dnl Mac OS X >= 10.5 (32-bit mode). 36 dnl Mac OS X >= 10.5 (32-bit mode).
37AC_REQUIRE([AC_SYS_LARGEFILE]) 37 AC_REQUIRE([AC_SYS_LARGEFILE])
38 38
39AC_MSG_CHECKING([how to get file system space usage]) 39 AC_MSG_CHECKING([how to get file system space usage])
40ac_fsusage_space=no 40 ac_fsusage_space=no
41 41
42# Perform only the link test since it seems there are no variants of the 42 # Perform only the link test since it seems there are no variants of the
43# statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs]) 43 # statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs])
44# because that got a false positive on SCO OSR5. Adding the declaration 44 # because that got a false positive on SCO OSR5. Adding the declaration
45# of a 'struct statvfs' causes this test to fail (as it should) on such 45 # of a 'struct statvfs' causes this test to fail (as it should) on such
46# systems. That system is reported to work fine with STAT_STATFS4 which 46 # systems. That system is reported to work fine with STAT_STATFS4 which
47# is what it gets when this test fails. 47 # is what it gets when this test fails.
48if test $ac_fsusage_space = no; then 48 if test $ac_fsusage_space = no; then
49 # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, 49 # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
50 # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS. 50 # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
51 AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs], 51 AC_CACHE_CHECK([for statvfs function (SVR4)],
52 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 52 [fu_cv_sys_stat_statvfs],
53 [AC_LINK_IFELSE(
54 [AC_LANG_PROGRAM([[
55#include <sys/types.h>
53#ifdef __osf__ 56#ifdef __osf__
54"Do not use Tru64's statvfs implementation" 57"Do not use Tru64's statvfs implementation"
55#endif 58#endif
@@ -68,45 +71,47 @@ struct statvfs fsd;
68int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1]; 71int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
69#endif 72#endif
70]], 73]],
71 [[statvfs (0, &fsd);]])], 74 [[statvfs (0, &fsd);]])],
72 [fu_cv_sys_stat_statvfs=yes], 75 [fu_cv_sys_stat_statvfs=yes],
73 [fu_cv_sys_stat_statvfs=no])]) 76 [fu_cv_sys_stat_statvfs=no])
74 if test $fu_cv_sys_stat_statvfs = yes; then
75 ac_fsusage_space=yes
76 # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs.
77 # glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems
78 # statvfs with large-file support is already equivalent to statvfs64.
79 AC_CACHE_CHECK([whether to use statvfs64],
80 [fu_cv_sys_stat_statvfs64],
81 [AC_LINK_IFELSE(
82 [AC_LANG_PROGRAM(
83 [[#include <sys/types.h>
84 #include <sys/statvfs.h>
85 struct statvfs64 fsd;
86 int check_f_blocks_larger_in_statvfs64
87 [sizeof (((struct statvfs64 *) 0)->f_blocks)
88 > sizeof (((struct statvfs *) 0)->f_blocks)
89 ? 1 : -1];
90 ]],
91 [[statvfs64 (0, &fsd);]])],
92 [fu_cv_sys_stat_statvfs64=yes],
93 [fu_cv_sys_stat_statvfs64=no])
94 ]) 77 ])
95 if test $fu_cv_sys_stat_statvfs64 = yes; then 78 if test $fu_cv_sys_stat_statvfs = yes; then
96 AC_DEFINE([STAT_STATVFS64], [1], 79 ac_fsusage_space=yes
97 [ Define if statvfs64 should be preferred over statvfs.]) 80 # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs.
98 else 81 # glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems
99 AC_DEFINE([STAT_STATVFS], [1], 82 # statvfs with large-file support is already equivalent to statvfs64.
100 [ Define if there is a function named statvfs. (SVR4)]) 83 AC_CACHE_CHECK([whether to use statvfs64],
84 [fu_cv_sys_stat_statvfs64],
85 [AC_LINK_IFELSE(
86 [AC_LANG_PROGRAM(
87 [[#include <sys/types.h>
88 #include <sys/statvfs.h>
89 struct statvfs64 fsd;
90 int check_f_blocks_larger_in_statvfs64
91 [sizeof (((struct statvfs64 *) 0)->f_blocks)
92 > sizeof (((struct statvfs *) 0)->f_blocks)
93 ? 1 : -1];
94 ]],
95 [[statvfs64 (0, &fsd);]])],
96 [fu_cv_sys_stat_statvfs64=yes],
97 [fu_cv_sys_stat_statvfs64=no])
98 ])
99 if test $fu_cv_sys_stat_statvfs64 = yes; then
100 AC_DEFINE([STAT_STATVFS64], [1],
101 [Define if statvfs64 should be preferred over statvfs.])
102 else
103 AC_DEFINE([STAT_STATVFS], [1],
104 [Define if there is a function named statvfs. (SVR4)])
105 fi
101 fi 106 fi
102 fi 107 fi
103fi
104 108
105# Check for this unconditionally so we have a 109 # Check for this unconditionally so we have a
106# good fallback on glibc/Linux > 2.6 < 2.6.36 110 # good fallback on glibc/Linux > 2.6 < 2.6.36
107AC_MSG_CHECKING([for two-argument statfs with statfs.f_frsize member]) 111 AC_CACHE_CHECK([for two-argument statfs with statfs.f_frsize member],
108AC_CACHE_VAL([fu_cv_sys_stat_statfs2_frsize], 112 [fu_cv_sys_stat_statfs2_frsize],
109[AC_RUN_IFELSE([AC_LANG_SOURCE([[ 113 [AC_RUN_IFELSE(
114 [AC_LANG_SOURCE([[
110#ifdef HAVE_SYS_PARAM_H 115#ifdef HAVE_SYS_PARAM_H
111#include <sys/param.h> 116#include <sys/param.h>
112#endif 117#endif
@@ -119,26 +124,26 @@ AC_CACHE_VAL([fu_cv_sys_stat_statfs2_frsize],
119 int 124 int
120 main () 125 main ()
121 { 126 {
122 struct statfs fsd; 127 struct statfs fsd;
123 fsd.f_frsize = 0; 128 fsd.f_frsize = 0;
124 return statfs (".", &fsd) != 0; 129 return statfs (".", &fsd) != 0;
125 }]])], 130 }]])],
126 [fu_cv_sys_stat_statfs2_frsize=yes], 131 [fu_cv_sys_stat_statfs2_frsize=yes],
127 [fu_cv_sys_stat_statfs2_frsize=no], 132 [fu_cv_sys_stat_statfs2_frsize=no],
128 [fu_cv_sys_stat_statfs2_frsize=no])]) 133 [fu_cv_sys_stat_statfs2_frsize=no])
129AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_frsize]) 134 ])
130if test $fu_cv_sys_stat_statfs2_frsize = yes; then 135 if test $fu_cv_sys_stat_statfs2_frsize = yes; then
131 ac_fsusage_space=yes 136 ac_fsusage_space=yes
132 AC_DEFINE([STAT_STATFS2_FRSIZE], [1], 137 AC_DEFINE([STAT_STATFS2_FRSIZE], [1],
133[ Define if statfs takes 2 args and struct statfs has a field named f_frsize. 138 [Define if statfs takes 2 args and struct statfs has a field named f_frsize.
134 (glibc/Linux > 2.6)]) 139 (glibc/Linux > 2.6)])
135fi 140 fi
136 141
137if test $ac_fsusage_space = no; then 142 if test $ac_fsusage_space = no; then
138 # DEC Alpha running OSF/1 143 # DEC Alpha running OSF/1
139 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) 144 AC_CACHE_CHECK([for 3-argument statfs function (DEC OSF/1)],
140 AC_CACHE_VAL([fu_cv_sys_stat_statfs3_osf1], 145 [fu_cv_sys_stat_statfs3_osf1],
141 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ 146 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
142#include <sys/param.h> 147#include <sys/param.h>
143#include <sys/types.h> 148#include <sys/types.h>
144#include <sys/mount.h> 149#include <sys/mount.h>
@@ -149,28 +154,27 @@ if test $ac_fsusage_space = no; then
149 fsd.f_fsize = 0; 154 fsd.f_fsize = 0;
150 return statfs (".", &fsd, sizeof (struct statfs)) != 0; 155 return statfs (".", &fsd, sizeof (struct statfs)) != 0;
151 }]])], 156 }]])],
152 [fu_cv_sys_stat_statfs3_osf1=yes], 157 [fu_cv_sys_stat_statfs3_osf1=yes],
153 [fu_cv_sys_stat_statfs3_osf1=no], 158 [fu_cv_sys_stat_statfs3_osf1=no],
154 [fu_cv_sys_stat_statfs3_osf1=no])]) 159 [fu_cv_sys_stat_statfs3_osf1=no])
155 AC_MSG_RESULT([$fu_cv_sys_stat_statfs3_osf1]) 160 ])
156 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then 161 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
157 ac_fsusage_space=yes 162 ac_fsusage_space=yes
158 AC_DEFINE([STAT_STATFS3_OSF1], [1], 163 AC_DEFINE([STAT_STATFS3_OSF1], [1],
159 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)]) 164 [Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
165 fi
160 fi 166 fi
161fi
162 167
163if test $ac_fsusage_space = no; then 168 if test $ac_fsusage_space = no; then
164 # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4. 169 # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
165 # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, 170 # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
166 # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.) 171 # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.)
167 # (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and 172 # (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
168 # <sys/vfs.h>.) 173 # <sys/vfs.h>.)
169 # (On Solaris, statfs has 4 arguments.) 174 # (On Solaris, statfs has 4 arguments.)
170 AC_MSG_CHECKING([for two-argument statfs with statfs.f_bsize dnl 175 AC_CACHE_CHECK([for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)],
171member (AIX, 4.3BSD)]) 176 [fu_cv_sys_stat_statfs2_bsize],
172 AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize], 177 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
173 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
174#ifdef HAVE_SYS_PARAM_H 178#ifdef HAVE_SYS_PARAM_H
175#include <sys/param.h> 179#include <sys/param.h>
176#endif 180#endif
@@ -183,57 +187,56 @@ member (AIX, 4.3BSD)])
183 int 187 int
184 main () 188 main ()
185 { 189 {
186 struct statfs fsd; 190 struct statfs fsd;
187 fsd.f_bsize = 0; 191 fsd.f_bsize = 0;
188 return statfs (".", &fsd) != 0; 192 return statfs (".", &fsd) != 0;
189 }]])], 193 }]])],
190 [fu_cv_sys_stat_statfs2_bsize=yes], 194 [fu_cv_sys_stat_statfs2_bsize=yes],
191 [fu_cv_sys_stat_statfs2_bsize=no], 195 [fu_cv_sys_stat_statfs2_bsize=no],
192 [fu_cv_sys_stat_statfs2_bsize=no])]) 196 [fu_cv_sys_stat_statfs2_bsize=no])
193 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize]) 197 ])
194 if test $fu_cv_sys_stat_statfs2_bsize = yes; then 198 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
195 ac_fsusage_space=yes 199 ac_fsusage_space=yes
196 AC_DEFINE([STAT_STATFS2_BSIZE], [1], 200 AC_DEFINE([STAT_STATFS2_BSIZE], [1],
197[ Define if statfs takes 2 args and struct statfs has a field named f_bsize. 201 [Define if statfs takes 2 args and struct statfs has a field named f_bsize.
198 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)]) 202 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
203 fi
199 fi 204 fi
200fi
201 205
202if test $ac_fsusage_space = no; then 206 if test $ac_fsusage_space = no; then
203 # SVR3 207 # SVR3
204 # (Solaris already handled above.) 208 # (Solaris already handled above.)
205 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) 209 AC_CACHE_CHECK([for four-argument statfs (AIX-3.2.5, SVR3)],
206 AC_CACHE_VAL([fu_cv_sys_stat_statfs4], 210 [fu_cv_sys_stat_statfs4],
207 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ 211 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
208#include <sys/types.h> 212#include <sys/types.h>
209#include <sys/statfs.h> 213#include <sys/statfs.h>
210 int 214 int
211 main () 215 main ()
212 { 216 {
213 struct statfs fsd; 217 struct statfs fsd;
214 return statfs (".", &fsd, sizeof fsd, 0) != 0; 218 return statfs (".", &fsd, sizeof fsd, 0) != 0;
215 }]])], 219 }]])],
216 [fu_cv_sys_stat_statfs4=yes], 220 [fu_cv_sys_stat_statfs4=yes],
217 [fu_cv_sys_stat_statfs4=no], 221 [fu_cv_sys_stat_statfs4=no],
218 [fu_cv_sys_stat_statfs4=no])]) 222 [fu_cv_sys_stat_statfs4=no])
219 AC_MSG_RESULT([$fu_cv_sys_stat_statfs4]) 223 ])
220 if test $fu_cv_sys_stat_statfs4 = yes; then 224 if test $fu_cv_sys_stat_statfs4 = yes; then
221 ac_fsusage_space=yes 225 ac_fsusage_space=yes
222 AC_DEFINE([STAT_STATFS4], [1], 226 AC_DEFINE([STAT_STATFS4], [1],
223 [ Define if statfs takes 4 args. (SVR3, Dynix, old Irix, old AIX, Dolphin)]) 227 [Define if statfs takes 4 args. (SVR3, Dynix, old Irix, old AIX, Dolphin)])
228 fi
224 fi 229 fi
225fi
226 230
227if test $ac_fsusage_space = no; then 231 if test $ac_fsusage_space = no; then
228 # 4.4BSD and older NetBSD 232 # 4.4BSD and older NetBSD
229 # (OSF/1 already handled above.) 233 # (OSF/1 already handled above.)
230 # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.) 234 # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
231 # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in 235 # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
232 # <sys/mount.h>.) 236 # <sys/mount.h>.)
233 AC_MSG_CHECKING([for two-argument statfs with statfs.f_fsize dnl 237 AC_CACHE_CHECK([for two-argument statfs with statfs.f_fsize member (4.4BSD and NetBSD)],
234member (4.4BSD and NetBSD)]) 238 [fu_cv_sys_stat_statfs2_fsize],
235 AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize], 239 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
236 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
237#include <sys/types.h> 240#include <sys/types.h>
238#ifdef HAVE_SYS_PARAM_H 241#ifdef HAVE_SYS_PARAM_H
239#include <sys/param.h> 242#include <sys/param.h>
@@ -244,27 +247,27 @@ member (4.4BSD and NetBSD)])
244 int 247 int
245 main () 248 main ()
246 { 249 {
247 struct statfs fsd; 250 struct statfs fsd;
248 fsd.f_fsize = 0; 251 fsd.f_fsize = 0;
249 return statfs (".", &fsd) != 0; 252 return statfs (".", &fsd) != 0;
250 }]])], 253 }]])],
251 [fu_cv_sys_stat_statfs2_fsize=yes], 254 [fu_cv_sys_stat_statfs2_fsize=yes],
252 [fu_cv_sys_stat_statfs2_fsize=no], 255 [fu_cv_sys_stat_statfs2_fsize=no],
253 [fu_cv_sys_stat_statfs2_fsize=no])]) 256 [fu_cv_sys_stat_statfs2_fsize=no])
254 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize]) 257 ])
255 if test $fu_cv_sys_stat_statfs2_fsize = yes; then 258 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
256 ac_fsusage_space=yes 259 ac_fsusage_space=yes
257 AC_DEFINE([STAT_STATFS2_FSIZE], [1], 260 AC_DEFINE([STAT_STATFS2_FSIZE], [1],
258[ Define if statfs takes 2 args and struct statfs has a field named f_fsize. 261 [Define if statfs takes 2 args and struct statfs has a field named f_fsize.
259 (4.4BSD, NetBSD)]) 262 (4.4BSD, NetBSD)])
263 fi
260 fi 264 fi
261fi
262 265
263if test $ac_fsusage_space = no; then 266 if test $ac_fsusage_space = no; then
264 # Ultrix 267 # Ultrix
265 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) 268 AC_CACHE_CHECK([for two-argument statfs with struct fs_data (Ultrix)],
266 AC_CACHE_VAL([fu_cv_sys_stat_fs_data], 269 [fu_cv_sys_stat_fs_data],
267 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ 270 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
268#include <sys/types.h> 271#include <sys/types.h>
269#ifdef HAVE_SYS_PARAM_H 272#ifdef HAVE_SYS_PARAM_H
270#include <sys/param.h> 273#include <sys/param.h>
@@ -278,24 +281,24 @@ if test $ac_fsusage_space = no; then
278 int 281 int
279 main () 282 main ()
280 { 283 {
281 struct fs_data fsd; 284 struct fs_data fsd;
282 /* Ultrix's statfs returns 1 for success, 285 /* Ultrix's statfs returns 1 for success,
283 0 for not mounted, -1 for failure. */ 286 0 for not mounted, -1 for failure. */
284 return statfs (".", &fsd) != 1; 287 return statfs (".", &fsd) != 1;
285 }]])], 288 }]])],
286 [fu_cv_sys_stat_fs_data=yes], 289 [fu_cv_sys_stat_fs_data=yes],
287 [fu_cv_sys_stat_fs_data=no], 290 [fu_cv_sys_stat_fs_data=no],
288 [fu_cv_sys_stat_fs_data=no])]) 291 [fu_cv_sys_stat_fs_data=no])
289 AC_MSG_RESULT([$fu_cv_sys_stat_fs_data]) 292 ])
290 if test $fu_cv_sys_stat_fs_data = yes; then 293 if test $fu_cv_sys_stat_fs_data = yes; then
291 ac_fsusage_space=yes 294 ac_fsusage_space=yes
292 AC_DEFINE([STAT_STATFS2_FS_DATA], [1], 295 AC_DEFINE([STAT_STATFS2_FS_DATA], [1],
293[ Define if statfs takes 2 args and the second argument has 296 [Define if statfs takes 2 args and the second argument has
294 type struct fs_data. (Ultrix)]) 297 type struct fs_data. (Ultrix)])
298 fi
295 fi 299 fi
296fi
297 300
298AS_IF([test $ac_fsusage_space = yes], [$1], [$2]) 301 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
299 302
300]) 303])
301 304
@@ -305,18 +308,22 @@ AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
305# enable the work-around code in fsusage.c. 308# enable the work-around code in fsusage.c.
306AC_DEFUN([gl_STATFS_TRUNCATES], 309AC_DEFUN([gl_STATFS_TRUNCATES],
307[ 310[
308 AC_MSG_CHECKING([for statfs that truncates block counts]) 311 AC_CACHE_CHECK([for statfs that truncates block counts],
309 AC_CACHE_VAL([fu_cv_sys_truncating_statfs], 312 [fu_cv_sys_truncating_statfs],
310 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 313 [AC_COMPILE_IFELSE(
314 [AC_LANG_PROGRAM([[
311#if !defined(sun) && !defined(__sun) 315#if !defined(sun) && !defined(__sun)
312choke -- this is a workaround for a Sun-specific problem 316choke -- this is a workaround for a Sun-specific problem
313#endif 317#endif
314#include <sys/types.h> 318#include <sys/types.h>
315#include <sys/vfs.h>]], 319#include <sys/vfs.h>
316 [[struct statfs t; long c = *(t.f_spare); 320 ]],
317 if (c) return 0;]])], 321 [[struct statfs t; long c = *(t.f_spare);
318 [fu_cv_sys_truncating_statfs=yes], 322 if (c) return 0;
319 [fu_cv_sys_truncating_statfs=no])]) 323 ]])],
324 [fu_cv_sys_truncating_statfs=yes],
325 [fu_cv_sys_truncating_statfs=no])
326 ])
320 if test $fu_cv_sys_truncating_statfs = yes; then 327 if test $fu_cv_sys_truncating_statfs = yes; then
321 AC_DEFINE([STATFS_TRUNCATES_BLOCK_COUNTS], [1], 328 AC_DEFINE([STATFS_TRUNCATES_BLOCK_COUNTS], [1],
322 [Define if the block counts reported by statfs may be truncated to 2GB 329 [Define if the block counts reported by statfs may be truncated to 2GB
@@ -324,7 +331,6 @@ choke -- this is a workaround for a Sun-specific problem
324 (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. 331 (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
325 SunOS 4.1.1 seems not to be affected.)]) 332 SunOS 4.1.1 seems not to be affected.)])
326 fi 333 fi
327 AC_MSG_RESULT([$fu_cv_sys_truncating_statfs])
328]) 334])
329 335
330 336
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 516c5874765..d831ed2eb60 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,4 +1,4 @@
1# manywarnings.m4 serial 16 1# manywarnings.m4 serial 17
2dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2018 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,
@@ -51,54 +51,53 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
51 51
52 dnl Check if -W -Werror -Wno-missing-field-initializers is supported 52 dnl Check if -W -Werror -Wno-missing-field-initializers is supported
53 dnl with the current $CC $CFLAGS $CPPFLAGS. 53 dnl with the current $CC $CFLAGS $CPPFLAGS.
54 AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) 54 AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported],
55 AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ 55 [gl_cv_cc_nomfi_supported],
56 gl_save_CFLAGS="$CFLAGS" 56 [gl_save_CFLAGS="$CFLAGS"
57 CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" 57 CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
58 AC_COMPILE_IFELSE( 58 AC_COMPILE_IFELSE(
59 [AC_LANG_PROGRAM([[]], [[]])], 59 [AC_LANG_PROGRAM([[]], [[]])],
60 [gl_cv_cc_nomfi_supported=yes], 60 [gl_cv_cc_nomfi_supported=yes],
61 [gl_cv_cc_nomfi_supported=no]) 61 [gl_cv_cc_nomfi_supported=no])
62 CFLAGS="$gl_save_CFLAGS"]) 62 CFLAGS="$gl_save_CFLAGS"
63 AC_MSG_RESULT([$gl_cv_cc_nomfi_supported]) 63 ])
64 64
65 if test "$gl_cv_cc_nomfi_supported" = yes; then 65 if test "$gl_cv_cc_nomfi_supported" = yes; then
66 dnl Now check whether -Wno-missing-field-initializers is needed 66 dnl Now check whether -Wno-missing-field-initializers is needed
67 dnl for the { 0, } construct. 67 dnl for the { 0, } construct.
68 AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed]) 68 AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed],
69 AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [ 69 [gl_cv_cc_nomfi_needed],
70 gl_save_CFLAGS="$CFLAGS" 70 [gl_save_CFLAGS="$CFLAGS"
71 CFLAGS="$CFLAGS -W -Werror" 71 CFLAGS="$CFLAGS -W -Werror"
72 AC_COMPILE_IFELSE( 72 AC_COMPILE_IFELSE(
73 [AC_LANG_PROGRAM( 73 [AC_LANG_PROGRAM(
74 [[int f (void) 74 [[int f (void)
75 { 75 {
76 typedef struct { int a; int b; } s_t; 76 typedef struct { int a; int b; } s_t;
77 s_t s1 = { 0, }; 77 s_t s1 = { 0, };
78 return s1.b; 78 return s1.b;
79 } 79 }
80 ]], 80 ]],
81 [[]])], 81 [[]])],
82 [gl_cv_cc_nomfi_needed=no], 82 [gl_cv_cc_nomfi_needed=no],
83 [gl_cv_cc_nomfi_needed=yes]) 83 [gl_cv_cc_nomfi_needed=yes])
84 CFLAGS="$gl_save_CFLAGS" 84 CFLAGS="$gl_save_CFLAGS"
85 ]) 85 ])
86 AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
87 fi 86 fi
88 87
89 dnl Next, check if -Werror -Wuninitialized is useful with the 88 dnl Next, check if -Werror -Wuninitialized is useful with the
90 dnl user's choice of $CFLAGS; some versions of gcc warn that it 89 dnl user's choice of $CFLAGS; some versions of gcc warn that it
91 dnl has no effect if -O is not also used 90 dnl has no effect if -O is not also used
92 AC_MSG_CHECKING([whether -Wuninitialized is supported]) 91 AC_CACHE_CHECK([whether -Wuninitialized is supported],
93 AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [ 92 [gl_cv_cc_uninitialized_supported],
94 gl_save_CFLAGS="$CFLAGS" 93 [gl_save_CFLAGS="$CFLAGS"
95 CFLAGS="$CFLAGS -Werror -Wuninitialized" 94 CFLAGS="$CFLAGS -Werror -Wuninitialized"
96 AC_COMPILE_IFELSE( 95 AC_COMPILE_IFELSE(
97 [AC_LANG_PROGRAM([[]], [[]])], 96 [AC_LANG_PROGRAM([[]], [[]])],
98 [gl_cv_cc_uninitialized_supported=yes], 97 [gl_cv_cc_uninitialized_supported=yes],
99 [gl_cv_cc_uninitialized_supported=no]) 98 [gl_cv_cc_uninitialized_supported=no])
100 CFLAGS="$gl_save_CFLAGS"]) 99 CFLAGS="$gl_save_CFLAGS"
101 AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported]) 100 ])
102 101
103 fi 102 fi
104 103
diff --git a/m4/socklen.m4 b/m4/socklen.m4
index f2d996d0eb8..fa79b07b6e4 100644
--- a/m4/socklen.m4
+++ b/m4/socklen.m4
@@ -1,4 +1,4 @@
1# socklen.m4 serial 10 1# socklen.m4 serial 11
2dnl Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 2005-2007, 2009-2018 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,
@@ -15,8 +15,8 @@ dnl So we have to test to find something that will work.
15AC_DEFUN([gl_TYPE_SOCKLEN_T], 15AC_DEFUN([gl_TYPE_SOCKLEN_T],
16 [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl 16 [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
17 AC_CHECK_TYPE([socklen_t], , 17 AC_CHECK_TYPE([socklen_t], ,
18 [AC_MSG_CHECKING([for socklen_t equivalent]) 18 [AC_CACHE_CHECK([for socklen_t equivalent],
19 AC_CACHE_VAL([gl_cv_socklen_t_equiv], 19 [gl_cv_socklen_t_equiv],
20 [# Systems have either "struct sockaddr *" or 20 [# Systems have either "struct sockaddr *" or
21 # "void *" as the second argument to getpeername 21 # "void *" as the second argument to getpeername
22 gl_cv_socklen_t_equiv= 22 gl_cv_socklen_t_equiv=
@@ -34,11 +34,10 @@ AC_DEFUN([gl_TYPE_SOCKLEN_T],
34 done 34 done
35 test "$gl_cv_socklen_t_equiv" != "" && break 35 test "$gl_cv_socklen_t_equiv" != "" && break
36 done 36 done
37 ]) 37 if test "$gl_cv_socklen_t_equiv" = ""; then
38 if test "$gl_cv_socklen_t_equiv" = ""; then 38 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
39 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) 39 fi
40 fi 40 ])
41 AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
42 AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv], 41 AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
43 [type to use in place of socklen_t if not defined])], 42 [type to use in place of socklen_t if not defined])],
44 [gl_SOCKET_HEADERS])]) 43 [gl_SOCKET_HEADERS])])