aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-05-21 11:42:18 -0700
committerPaul Eggert2018-05-21 11:43:07 -0700
commit79f15092b9d16631840cd42db034b787fae762ac (patch)
tree86f3e4917944af36516547d4d19d5dda758684f1
parentf21db9e1206f830ee5e991a26f9e30056f68efb8 (diff)
downloademacs-79f15092b9d16631840cd42db034b787fae762ac.tar.gz
emacs-79f15092b9d16631840cd42db034b787fae762ac.zip
Update from Gnulib
This incorporates: 2018-05-21 crypto: omit stream ops Emacs doesn’t need 2018-05-13 truncate: Fix compilation error on Android 2018-05-13 imaxdiv: Fix compilation error on Android 2018-05-13 Support selective inclusion of recent mingw.org headers 2018-05-13 Add cross-compilation guesses for Linux systems sans glibc 2018-05-13 stdioext: Fix compilation errors with newer Android headers 2018-05-07 af_alg: Pacify --enable-gcc-warnings 2018-05-06 af_alg: Fix bug with streams that are not at position 0 2018-05-06 Followup to 'af_alg: New module' 2018-05-05 crypto/{md5,sha1,sha256,sha512}: simplify 2018-05-05 af_alg: New module 2018-05-05 af_alg: Improve function signature 2018-04-28 md5sum: Use AF_ALG when available 2018-04-28 sha512sum: Use AF_ALG when available 2018-04-28 sha256sum: Use AF_ALG when available 2018-04-28 sha1sum: Use AF_ALG when available 2018-05-05 all: Replace more http URLs by https URLs 2018-05-03 maint: port more modules to GCC 8 2018-05-03 Simplify code; drop support for Borland C++ on Windows * admin/merge-gnulib (GNULIB_MODULES): Use crypto/md5-buffer rather than crypto/md5, since Emacs doesn’t use the stream operations that in recent Gnulib pull in other stuff Emacs doesn’t need. Similarly for crypto/sha1-buffer, crypto/sha256-buffer, crypto/sha512-buffer. * build-aux/config.guess, build-aux/config.sub, lib/dosname.h: * lib/dup2.c, lib/errno.in.h, lib/euidaccess.c, lib/fcntl.c: * lib/fcntl.in.h, lib/fpending.c, lib/fsync.c, lib/getdtablesize.c: * lib/getopt.c, lib/gettimeofday.c, lib/inttypes.in.h, lib/md5.c: * lib/md5.h, lib/open.c, lib/pipe2.c, lib/putenv.c, lib/sha1.c: * lib/sha1.h, lib/sha256.c, lib/sha256.h, lib/sha512.c: * lib/sha512.h, lib/stat-time.h, lib/stdio-impl.h, lib/stdio.in.h: * lib/stdlib.in.h, lib/sys_stat.in.h, lib/sys_types.in.h: * lib/timespec.h, lib/unistd.in.h, lib/utimens.c, m4/c-strtod.m4: * m4/gnulib-common.m4, m4/inttypes.m4, m4/lstat.m4, m4/nocrash.m4: * m4/pselect.m4, m4/readlink.m4, m4/stdio_h.m4, m4/symlink.m4: * m4/unistd_h.m4, m4/utimens.m4: Copy from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
-rwxr-xr-xadmin/merge-gnulib2
-rwxr-xr-xbuild-aux/config.guess6
-rwxr-xr-xbuild-aux/config.sub1402
-rw-r--r--lib/dosname.h5
-rw-r--r--lib/dup2.c2
-rw-r--r--lib/errno.in.h4
-rw-r--r--lib/euidaccess.c4
-rw-r--r--lib/fcntl.c4
-rw-r--r--lib/fcntl.in.h2
-rw-r--r--lib/fpending.c3
-rw-r--r--lib/fsync.c2
-rw-r--r--lib/getdtablesize.c2
-rw-r--r--lib/getopt.c2
-rw-r--r--lib/gettimeofday.c2
-rw-r--r--lib/gnulib.mk.in32
-rw-r--r--lib/inttypes.in.h6
-rw-r--r--lib/md5.c15
-rw-r--r--lib/md5.h7
-rw-r--r--lib/open.c2
-rw-r--r--lib/pipe2.c7
-rw-r--r--lib/putenv.c4
-rw-r--r--lib/sha1.c17
-rw-r--r--lib/sha1.h7
-rw-r--r--lib/sha256.c119
-rw-r--r--lib/sha256.h7
-rw-r--r--lib/sha512.c107
-rw-r--r--lib/sha512.h7
-rw-r--r--lib/stat-time.h2
-rw-r--r--lib/stdio-impl.h62
-rw-r--r--lib/stdio.in.h4
-rw-r--r--lib/stdlib.in.h4
-rw-r--r--lib/sys_stat.in.h6
-rw-r--r--lib/sys_types.in.h15
-rw-r--r--lib/timespec.h2
-rw-r--r--lib/unistd.in.h8
-rw-r--r--lib/utimens.c3
-rw-r--r--m4/c-strtod.m431
-rw-r--r--m4/gnulib-common.m49
-rw-r--r--m4/gnulib-comp.m48
-rw-r--r--m4/inttypes.m43
-rw-r--r--m4/lstat.m45
-rw-r--r--m4/nocrash.m44
-rw-r--r--m4/pselect.m412
-rw-r--r--m4/readlink.m412
-rw-r--r--m4/stdio_h.m44
-rw-r--r--m4/symlink.m412
-rw-r--r--m4/unistd_h.m46
-rw-r--r--m4/utimens.m412
48 files changed, 1044 insertions, 959 deletions
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index 9fe0021a689..9a5ad545d11 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -29,7 +29,7 @@ GNULIB_MODULES='
29 alloca-opt binary-io byteswap c-ctype c-strcase 29 alloca-opt binary-io byteswap c-ctype c-strcase
30 careadlinkat close-stream 30 careadlinkat close-stream
31 count-leading-zeros count-one-bits count-trailing-zeros 31 count-leading-zeros count-one-bits count-trailing-zeros
32 crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 32 crypto/md5-buffer crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer
33 d-type diffseq dtoastr dtotimespec dup2 33 d-type diffseq dtoastr dtotimespec dup2
34 environ execinfo explicit_bzero faccessat 34 environ execinfo explicit_bzero faccessat
35 fcntl fcntl-h fdatasync fdopendir 35 fcntl fcntl-h fdatasync fdopendir
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 256083a70d3..883a6713bf0 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -2,7 +2,7 @@
2# Attempt to guess a canonical system name. 2# Attempt to guess a canonical system name.
3# Copyright 1992-2018 Free Software Foundation, Inc. 3# Copyright 1992-2018 Free Software Foundation, Inc.
4 4
5timestamp='2018-03-08' 5timestamp='2018-05-19'
6 6
7# This file is free software; you can redistribute it and/or modify it 7# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by 8# under the terms of the GNU General Public License as published by
@@ -106,7 +106,7 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
106 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 106 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107dummy=$tmp/dummy ; 107dummy=$tmp/dummy ;
108tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 108tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109case $CC_FOR_BUILD,$HOST_CC,$CC in 109case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
110 ,,) echo "int x;" > "$dummy.c" ; 110 ,,) echo "int x;" > "$dummy.c" ;
111 for c in cc gcc c89 c99 ; do 111 for c in cc gcc c89 c99 ; do
112 if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then 112 if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
@@ -237,7 +237,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
237 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 237 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
238 # contains redundant information, the shorter form: 238 # contains redundant information, the shorter form:
239 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 239 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
240 echo "$machine-${os}${release}${abi}" 240 echo "$machine-${os}${release}${abi-}"
241 exit ;; 241 exit ;;
242 *:Bitrig:*:*) 242 *:Bitrig:*:*)
243 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 243 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
diff --git a/build-aux/config.sub b/build-aux/config.sub
index ba37cf99e26..f38250f1daa 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -2,7 +2,7 @@
2# Configuration validation subroutine script. 2# Configuration validation subroutine script.
3# Copyright 1992-2018 Free Software Foundation, Inc. 3# Copyright 1992-2018 Free Software Foundation, Inc.
4 4
5timestamp='2018-04-24' 5timestamp='2018-05-19'
6 6
7# This file is free software; you can redistribute it and/or modify it 7# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by 8# under the terms of the GNU General Public License as published by
@@ -110,28 +110,434 @@ case $# in
110 exit 1;; 110 exit 1;;
111esac 111esac
112 112
113# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). 113# Split fields of configuration type
114# Here we must recognize all the valid KERNEL-OS combinations. 114IFS="-" read -r field1 field2 field3 field4 <<EOF
115maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` 115$1
116case $maybe_os in 116EOF
117 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ 117
118 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ 118# Separate into logical components for further validation
119 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ 119case $1 in
120 kopensolaris*-gnu* | cloudabi*-eabi* | \ 120 *-*-*-*-*)
121 storm-chaos* | os2-emx* | rtmk-nova*) 121 echo Invalid configuration \`"$1"\': more than four components >&2
122 os=-$maybe_os 122 exit 1
123 basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` 123 ;;
124 ;; 124 *-*-*-*)
125 android-linux) 125 basic_machine=$field1-$field2
126 os=-linux-android 126 os=$field3-$field4
127 basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown 127 ;;
128 ;; 128 *-*-*)
129 *) 129 # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
130 basic_machine=`echo "$1" | sed 's/-[^-]*$//'` 130 # parts
131 if [ "$basic_machine" != "$1" ] 131 maybe_os=$field2-$field3
132 then os=`echo "$1" | sed 's/.*-/-/'` 132 case $maybe_os in
133 else os=; fi 133 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
134 ;; 134 | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
135 | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
136 | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
137 | storm-chaos* | os2-emx* | rtmk-nova*)
138 basic_machine=$field1
139 os=$maybe_os
140 ;;
141 android-linux)
142 basic_machine=$field1-unknown
143 os=linux-android
144 ;;
145 *)
146 basic_machine=$field1-$field2
147 os=$field3
148 ;;
149 esac
150 ;;
151 *-*)
152 basic_machine=$field1
153 os=$field2
154 ;;
155 *)
156 # Convert single-component short-hands not valid as part of
157 # multi-component configurations.
158 case $field1 in
159 386bsd)
160 basic_machine=i386-pc
161 os=bsd
162 ;;
163 a29khif)
164 basic_machine=a29k-amd
165 os=udi
166 ;;
167 adobe68k)
168 basic_machine=m68010-adobe
169 os=scout
170 ;;
171 am29k)
172 basic_machine=a29k-none
173 os=bsd
174 ;;
175 amdahl)
176 basic_machine=580-amdahl
177 os=sysv
178 ;;
179 amigaos | amigados)
180 basic_machine=m68k-unknown
181 os=amigaos
182 ;;
183 amigaunix | amix)
184 basic_machine=m68k-unknown
185 os=sysv4
186 ;;
187 apollo68)
188 basic_machine=m68k-apollo
189 os=sysv
190 ;;
191 apollo68bsd)
192 basic_machine=m68k-apollo
193 os=bsd
194 ;;
195 aros)
196 basic_machine=i386-pc
197 os=aros
198 ;;
199 aux)
200 basic_machine=m68k-apple
201 os=aux
202 ;;
203 balance)
204 basic_machine=ns32k-sequent
205 os=dynix
206 ;;
207 blackfin)
208 basic_machine=bfin-unknown
209 os=linux
210 ;;
211 cegcc)
212 basic_machine=arm-unknown
213 os=cegcc
214 ;;
215 cray)
216 basic_machine=j90-cray
217 os=unicos
218 ;;
219 craynv)
220 basic_machine=craynv-cray
221 os=unicosmp
222 ;;
223 delta88)
224 basic_machine=m88k-motorola
225 os=sysv3
226 ;;
227 dicos)
228 basic_machine=i686-pc
229 os=dicos
230 ;;
231 djgpp)
232 basic_machine=i586-pc
233 os=msdosdjgpp
234 ;;
235 ebmon29k)
236 basic_machine=a29k-amd
237 os=ebmon
238 ;;
239 es1800 | OSE68k | ose68k | ose | OSE)
240 basic_machine=m68k-ericsson
241 os=ose
242 ;;
243 gmicro)
244 basic_machine=tron-gmicro
245 os=sysv
246 ;;
247 go32)
248 basic_machine=i386-pc
249 os=go32
250 ;;
251 h8300hms)
252 basic_machine=h8300-hitachi
253 os=hms
254 ;;
255 h8300xray)
256 basic_machine=h8300-hitachi
257 os=xray
258 ;;
259 h8500hms)
260 basic_machine=h8500-hitachi
261 os=hms
262 ;;
263 harris)
264 basic_machine=m88k-harris
265 os=sysv3
266 ;;
267 hp300bsd)
268 basic_machine=m68k-hp
269 os=bsd
270 ;;
271 hp300hpux)
272 basic_machine=m68k-hp
273 os=hpux
274 ;;
275 hppaosf)
276 basic_machine=hppa1.1-hp
277 os=osf
278 ;;
279 hppro)
280 basic_machine=hppa1.1-hp
281 os=proelf
282 ;;
283 i386mach)
284 basic_machine=i386-mach
285 os=mach
286 ;;
287 vsta)
288 basic_machine=i386-unknown
289 os=vsta
290 ;;
291 isi68 | isi)
292 basic_machine=m68k-isi
293 os=sysv
294 ;;
295 m68knommu)
296 basic_machine=m68k-unknown
297 os=linux
298 ;;
299 magnum | m3230)
300 basic_machine=mips-mips
301 os=sysv
302 ;;
303 merlin)
304 basic_machine=ns32k-utek
305 os=sysv
306 ;;
307 mingw64)
308 basic_machine=x86_64-pc
309 os=mingw64
310 ;;
311 mingw32)
312 basic_machine=i686-pc
313 os=mingw32
314 ;;
315 mingw32ce)
316 basic_machine=arm-unknown
317 os=mingw32ce
318 ;;
319 monitor)
320 basic_machine=m68k-rom68k
321 os=coff
322 ;;
323 morphos)
324 basic_machine=powerpc-unknown
325 os=morphos
326 ;;
327 moxiebox)
328 basic_machine=moxie-unknown
329 os=moxiebox
330 ;;
331 msdos)
332 basic_machine=i386-pc
333 os=msdos
334 ;;
335 msys)
336 basic_machine=i686-pc
337 os=msys
338 ;;
339 mvs)
340 basic_machine=i370-ibm
341 os=mvs
342 ;;
343 nacl)
344 basic_machine=le32-unknown
345 os=nacl
346 ;;
347 ncr3000)
348 basic_machine=i486-ncr
349 os=sysv4
350 ;;
351 netbsd386)
352 basic_machine=i386-unknown
353 os=netbsd
354 ;;
355 netwinder)
356 basic_machine=armv4l-rebel
357 os=linux
358 ;;
359 news | news700 | news800 | news900)
360 basic_machine=m68k-sony
361 os=newsos
362 ;;
363 news1000)
364 basic_machine=m68030-sony
365 os=newsos
366 ;;
367 necv70)
368 basic_machine=v70-nec
369 os=sysv
370 ;;
371 nh3000)
372 basic_machine=m68k-harris
373 os=cxux
374 ;;
375 nh[45]000)
376 basic_machine=m88k-harris
377 os=cxux
378 ;;
379 nindy960)
380 basic_machine=i960-intel
381 os=nindy
382 ;;
383 mon960)
384 basic_machine=i960-intel
385 os=mon960
386 ;;
387 nonstopux)
388 basic_machine=mips-compaq
389 os=nonstopux
390 ;;
391 os400)
392 basic_machine=powerpc-ibm
393 os=os400
394 ;;
395 OSE68000 | ose68000)
396 basic_machine=m68000-ericsson
397 os=ose
398 ;;
399 os68k)
400 basic_machine=m68k-none
401 os=os68k
402 ;;
403 paragon)
404 basic_machine=i860-intel
405 os=osf
406 ;;
407 parisc)
408 basic_machine=hppa-unknown
409 os=linux
410 ;;
411 pw32)
412 basic_machine=i586-unknown
413 os=pw32
414 ;;
415 rdos | rdos64)
416 basic_machine=x86_64-pc
417 os=rdos
418 ;;
419 rdos32)
420 basic_machine=i386-pc
421 os=rdos
422 ;;
423 rom68k)
424 basic_machine=m68k-rom68k
425 os=coff
426 ;;
427 sa29200)
428 basic_machine=a29k-amd
429 os=udi
430 ;;
431 sei)
432 basic_machine=mips-sei
433 os=seiux
434 ;;
435 sps7)
436 basic_machine=m68k-bull
437 os=sysv2
438 ;;
439 stratus)
440 basic_machine=i860-stratus
441 os=sysv4
442 ;;
443 sun2os3)
444 basic_machine=m68000-sun
445 os=sunos3
446 ;;
447 sun2os4)
448 basic_machine=m68000-sun
449 os=sunos4
450 ;;
451 sun3os3)
452 basic_machine=m68k-sun
453 os=sunos3
454 ;;
455 sun3os4)
456 basic_machine=m68k-sun
457 os=sunos4
458 ;;
459 sun4os3)
460 basic_machine=sparc-sun
461 os=sunos3
462 ;;
463 sun4os4)
464 basic_machine=sparc-sun
465 os=sunos4
466 ;;
467 sun4sol2)
468 basic_machine=sparc-sun
469 os=solaris2
470 ;;
471 sv1)
472 basic_machine=sv1-cray
473 os=unicos
474 ;;
475 symmetry)
476 basic_machine=i386-sequent
477 os=dynix
478 ;;
479 t3e)
480 basic_machine=alphaev5-cray
481 os=unicos
482 ;;
483 t90)
484 basic_machine=t90-cray
485 os=unicos
486 ;;
487 toad1)
488 basic_machine=pdp10-xkl
489 os=tops20
490 ;;
491 tpf)
492 basic_machine=s390x-ibm
493 os=tpf
494 ;;
495 udi29k)
496 basic_machine=a29k-amd
497 os=udi
498 ;;
499 ultra3)
500 basic_machine=a29k-nyu
501 os=sym1
502 ;;
503 v810 | necv810)
504 basic_machine=v810-nec
505 os=none
506 ;;
507 vaxv)
508 basic_machine=vax-dec
509 os=sysv
510 ;;
511 vms)
512 basic_machine=vax-dec
513 os=vms
514 ;;
515 vxworks960)
516 basic_machine=i960-wrs
517 os=vxworks
518 ;;
519 vxworks68)
520 basic_machine=m68k-wrs
521 os=vxworks
522 ;;
523 vxworks29k)
524 basic_machine=a29k-wrs
525 os=vxworks
526 ;;
527 xbox)
528 basic_machine=i686-pc
529 os=mingw32
530 ;;
531 ymp)
532 basic_machine=ymp-cray
533 os=unicos
534 ;;
535 *)
536 basic_machine=$1
537 os=
538 ;;
539 esac
540 ;;
135esac 541esac
136 542
137### Let's recognize common machines as not being operating systems so 543### Let's recognize common machines as not being operating systems so
@@ -139,102 +545,102 @@ esac
139### recognize some manufacturers as not being operating systems, so we 545### recognize some manufacturers as not being operating systems, so we
140### can provide default operating systems below. 546### can provide default operating systems below.
141case $os in 547case $os in
142 -sun*os*) 548 sun*os*)
143 # Prevent following clause from handling this invalid input. 549 # Prevent following clause from handling this invalid input.
144 ;; 550 ;;
145 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ 551 dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* | \
146 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ 552 att* | 7300* | 3300* | delta* | motorola* | sun[234]* | \
147 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ 553 unicom* | ibm* | next | hp | isi* | apollo | altos* | \
148 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ 554 convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* |\
149 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ 555 c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* | \
150 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ 556 harris | dolphin | highlevel | gould | cbm | ns | masscomp | \
151 -apple | -axis | -knuth | -cray | -microblaze*) 557 apple | axis | knuth | cray | microblaze*)
152 os= 558 os=
153 basic_machine=$1 559 basic_machine=$1
154 ;; 560 ;;
155 -bluegene*) 561 bluegene*)
156 os=-cnk 562 os=cnk
157 ;; 563 ;;
158 -sim | -cisco | -oki | -wec | -winbond) 564 sim | cisco | oki | wec | winbond)
159 os= 565 os=
160 basic_machine=$1 566 basic_machine=$1
161 ;; 567 ;;
162 -scout) 568 scout)
163 ;; 569 ;;
164 -wrs) 570 wrs)
165 os=-vxworks 571 os=vxworks
166 basic_machine=$1 572 basic_machine=$1
167 ;; 573 ;;
168 -chorusos*) 574 chorusos*)
169 os=-chorusos 575 os=chorusos
170 basic_machine=$1 576 basic_machine=$1
171 ;; 577 ;;
172 -chorusrdb) 578 chorusrdb)
173 os=-chorusrdb 579 os=chorusrdb
174 basic_machine=$1 580 basic_machine=$1
175 ;; 581 ;;
176 -hiux*) 582 hiux*)
177 os=-hiuxwe2 583 os=hiuxwe2
178 ;; 584 ;;
179 -sco6) 585 sco6)
180 os=-sco5v6 586 os=sco5v6
181 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 587 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
182 ;; 588 ;;
183 -sco5) 589 sco5)
184 os=-sco3.2v5 590 os=sco3.2v5
185 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 591 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
186 ;; 592 ;;
187 -sco4) 593 sco4)
188 os=-sco3.2v4 594 os=sco3.2v4
189 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 595 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
190 ;; 596 ;;
191 -sco3.2.[4-9]*) 597 sco3.2.[4-9]*)
192 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` 598 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 599 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
194 ;; 600 ;;
195 -sco3.2v[4-9]*) 601 sco3.2v[4-9]*)
196 # Don't forget version if it is 3.2v4 or newer. 602 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 603 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
198 ;; 604 ;;
199 -sco5v6*) 605 sco5v6*)
200 # Don't forget version if it is 3.2v4 or newer. 606 # Don't forget version if it is 3.2v4 or newer.
201 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 607 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
202 ;; 608 ;;
203 -sco*) 609 sco*)
204 os=-sco3.2v2 610 os=sco3.2v2
205 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 611 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
206 ;; 612 ;;
207 -udk*) 613 udk*)
208 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 614 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
209 ;; 615 ;;
210 -isc) 616 isc)
211 os=-isc2.2 617 os=isc2.2
212 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 618 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
213 ;; 619 ;;
214 -clix*) 620 clix*)
215 basic_machine=clipper-intergraph 621 basic_machine=clipper-intergraph
216 ;; 622 ;;
217 -isc*) 623 isc*)
218 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 624 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
219 ;; 625 ;;
220 -lynx*178) 626 lynx*178)
221 os=-lynxos178 627 os=lynxos178
222 ;; 628 ;;
223 -lynx*5) 629 lynx*5)
224 os=-lynxos5 630 os=lynxos5
225 ;; 631 ;;
226 -lynx*) 632 lynx*)
227 os=-lynxos 633 os=lynxos
228 ;; 634 ;;
229 -ptx*) 635 ptx*)
230 basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` 636 basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
231 ;; 637 ;;
232 -psos*) 638 psos*)
233 os=-psos 639 os=psos
234 ;; 640 ;;
235 -mint | -mint[0-9]*) 641 mint | mint[0-9]*)
236 basic_machine=m68k-atari 642 basic_machine=m68k-atari
237 os=-mint 643 os=mint
238 ;; 644 ;;
239esac 645esac
240 646
@@ -293,6 +699,7 @@ case $basic_machine in
293 | mt \ 699 | mt \
294 | msp430 \ 700 | msp430 \
295 | nds32 | nds32le | nds32be \ 701 | nds32 | nds32le | nds32be \
702 | nfp \
296 | nios | nios2 | nios2eb | nios2el \ 703 | nios | nios2 | nios2eb | nios2el \
297 | ns16k | ns32k \ 704 | ns16k | ns32k \
298 | open8 | or1k | or1knd | or32 \ 705 | open8 | or1k | or1knd | or32 \
@@ -331,24 +738,23 @@ case $basic_machine in
331 ;; 738 ;;
332 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) 739 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
333 basic_machine=$basic_machine-unknown 740 basic_machine=$basic_machine-unknown
334 os=-none 741 os=${os:-none}
335 ;; 742 ;;
336 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) 743 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
337 ;; 744 ;;
338 m9s12z | m68hcs12z | hcs12z | s12z) 745 m9s12z | m68hcs12z | hcs12z | s12z)
339 basic_machine=s12z-unknown 746 basic_machine=s12z-unknown
340 os=-none 747 os=${os:-none}
341 ;; 748 ;;
342 ms1) 749 ms1)
343 basic_machine=mt-unknown 750 basic_machine=mt-unknown
344 ;; 751 ;;
345
346 strongarm | thumb | xscale) 752 strongarm | thumb | xscale)
347 basic_machine=arm-unknown 753 basic_machine=arm-unknown
348 ;; 754 ;;
349 xgate) 755 xgate)
350 basic_machine=$basic_machine-unknown 756 basic_machine=$basic_machine-unknown
351 os=-none 757 os=${os:-none}
352 ;; 758 ;;
353 xscaleeb) 759 xscaleeb)
354 basic_machine=armeb-unknown 760 basic_machine=armeb-unknown
@@ -364,11 +770,6 @@ case $basic_machine in
364 i*86 | x86_64) 770 i*86 | x86_64)
365 basic_machine=$basic_machine-pc 771 basic_machine=$basic_machine-pc
366 ;; 772 ;;
367 # Object if more than one company name word.
368 *-*-*)
369 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
370 exit 1
371 ;;
372 # Recognize the basic CPU types with company name. 773 # Recognize the basic CPU types with company name.
373 580-* \ 774 580-* \
374 | a29k-* \ 775 | a29k-* \
@@ -423,6 +824,7 @@ case $basic_machine in
423 | mt-* \ 824 | mt-* \
424 | msp430-* \ 825 | msp430-* \
425 | nds32-* | nds32le-* | nds32be-* \ 826 | nds32-* | nds32le-* | nds32be-* \
827 | nfp-* \
426 | nios-* | nios2-* | nios2eb-* | nios2el-* \ 828 | nios-* | nios2-* | nios2eb-* | nios2el-* \
427 | none-* | np1-* | ns16k-* | ns32k-* \ 829 | none-* | np1-* | ns16k-* | ns32k-* \
428 | open8-* \ 830 | open8-* \
@@ -460,92 +862,40 @@ case $basic_machine in
460 ;; 862 ;;
461 # Recognize the various machine names and aliases which stand 863 # Recognize the various machine names and aliases which stand
462 # for a CPU type and a company and sometimes even an OS. 864 # for a CPU type and a company and sometimes even an OS.
463 386bsd)
464 basic_machine=i386-pc
465 os=-bsd
466 ;;
467 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 865 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
468 basic_machine=m68000-att 866 basic_machine=m68000-att
469 ;; 867 ;;
470 3b*) 868 3b*)
471 basic_machine=we32k-att 869 basic_machine=we32k-att
472 ;; 870 ;;
473 a29khif)
474 basic_machine=a29k-amd
475 os=-udi
476 ;;
477 abacus) 871 abacus)
478 basic_machine=abacus-unknown 872 basic_machine=abacus-unknown
479 ;; 873 ;;
480 adobe68k)
481 basic_machine=m68010-adobe
482 os=-scout
483 ;;
484 alliant | fx80) 874 alliant | fx80)
485 basic_machine=fx80-alliant 875 basic_machine=fx80-alliant
486 ;; 876 ;;
487 altos | altos3068) 877 altos | altos3068)
488 basic_machine=m68k-altos 878 basic_machine=m68k-altos
489 ;; 879 ;;
490 am29k)
491 basic_machine=a29k-none
492 os=-bsd
493 ;;
494 amd64) 880 amd64)
495 basic_machine=x86_64-pc 881 basic_machine=x86_64-pc
496 ;; 882 ;;
497 amd64-*) 883 amd64-*)
498 basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` 884 basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
499 ;; 885 ;;
500 amdahl)
501 basic_machine=580-amdahl
502 os=-sysv
503 ;;
504 amiga | amiga-*) 886 amiga | amiga-*)
505 basic_machine=m68k-unknown 887 basic_machine=m68k-unknown
506 ;; 888 ;;
507 amigaos | amigados)
508 basic_machine=m68k-unknown
509 os=-amigaos
510 ;;
511 amigaunix | amix)
512 basic_machine=m68k-unknown
513 os=-sysv4
514 ;;
515 apollo68)
516 basic_machine=m68k-apollo
517 os=-sysv
518 ;;
519 apollo68bsd)
520 basic_machine=m68k-apollo
521 os=-bsd
522 ;;
523 aros)
524 basic_machine=i386-pc
525 os=-aros
526 ;;
527 asmjs) 889 asmjs)
528 basic_machine=asmjs-unknown 890 basic_machine=asmjs-unknown
529 ;; 891 ;;
530 aux)
531 basic_machine=m68k-apple
532 os=-aux
533 ;;
534 balance)
535 basic_machine=ns32k-sequent
536 os=-dynix
537 ;;
538 blackfin)
539 basic_machine=bfin-unknown
540 os=-linux
541 ;;
542 blackfin-*) 892 blackfin-*)
543 basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` 893 basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
544 os=-linux 894 os=linux
545 ;; 895 ;;
546 bluegene*) 896 bluegene*)
547 basic_machine=powerpc-ibm 897 basic_machine=powerpc-ibm
548 os=-cnk 898 os=cnk
549 ;; 899 ;;
550 c54x-*) 900 c54x-*)
551 basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` 901 basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
@@ -558,43 +908,31 @@ case $basic_machine in
558 ;; 908 ;;
559 c90) 909 c90)
560 basic_machine=c90-cray 910 basic_machine=c90-cray
561 os=-unicos 911 os=${os:-unicos}
562 ;;
563 cegcc)
564 basic_machine=arm-unknown
565 os=-cegcc
566 ;; 912 ;;
567 convex-c1) 913 convex-c1)
568 basic_machine=c1-convex 914 basic_machine=c1-convex
569 os=-bsd 915 os=bsd
570 ;; 916 ;;
571 convex-c2) 917 convex-c2)
572 basic_machine=c2-convex 918 basic_machine=c2-convex
573 os=-bsd 919 os=bsd
574 ;; 920 ;;
575 convex-c32) 921 convex-c32)
576 basic_machine=c32-convex 922 basic_machine=c32-convex
577 os=-bsd 923 os=bsd
578 ;; 924 ;;
579 convex-c34) 925 convex-c34)
580 basic_machine=c34-convex 926 basic_machine=c34-convex
581 os=-bsd 927 os=bsd
582 ;; 928 ;;
583 convex-c38) 929 convex-c38)
584 basic_machine=c38-convex 930 basic_machine=c38-convex
585 os=-bsd 931 os=bsd
586 ;;
587 cray | j90)
588 basic_machine=j90-cray
589 os=-unicos
590 ;;
591 craynv)
592 basic_machine=craynv-cray
593 os=-unicosmp
594 ;; 932 ;;
595 cr16 | cr16-*) 933 cr16 | cr16-*)
596 basic_machine=cr16-unknown 934 basic_machine=cr16-unknown
597 os=-elf 935 os=${os:-elf}
598 ;; 936 ;;
599 crds | unos) 937 crds | unos)
600 basic_machine=m68k-crds 938 basic_machine=m68k-crds
@@ -607,7 +945,7 @@ case $basic_machine in
607 ;; 945 ;;
608 crx) 946 crx)
609 basic_machine=crx-unknown 947 basic_machine=crx-unknown
610 os=-elf 948 os=${os:-elf}
611 ;; 949 ;;
612 da30 | da30-*) 950 da30 | da30-*)
613 basic_machine=m68k-da30 951 basic_machine=m68k-da30
@@ -617,35 +955,23 @@ case $basic_machine in
617 ;; 955 ;;
618 decsystem10* | dec10*) 956 decsystem10* | dec10*)
619 basic_machine=pdp10-dec 957 basic_machine=pdp10-dec
620 os=-tops10 958 os=tops10
621 ;; 959 ;;
622 decsystem20* | dec20*) 960 decsystem20* | dec20*)
623 basic_machine=pdp10-dec 961 basic_machine=pdp10-dec
624 os=-tops20 962 os=tops20
625 ;; 963 ;;
626 delta | 3300 | motorola-3300 | motorola-delta \ 964 delta | 3300 | motorola-3300 | motorola-delta \
627 | 3300-motorola | delta-motorola) 965 | 3300-motorola | delta-motorola)
628 basic_machine=m68k-motorola 966 basic_machine=m68k-motorola
629 ;; 967 ;;
630 delta88)
631 basic_machine=m88k-motorola
632 os=-sysv3
633 ;;
634 dicos)
635 basic_machine=i686-pc
636 os=-dicos
637 ;;
638 djgpp)
639 basic_machine=i586-pc
640 os=-msdosdjgpp
641 ;;
642 dpx20 | dpx20-*) 968 dpx20 | dpx20-*)
643 basic_machine=rs6000-bull 969 basic_machine=rs6000-bull
644 os=-bosx 970 os=${os:-bosx}
645 ;; 971 ;;
646 dpx2*) 972 dpx2*)
647 basic_machine=m68k-bull 973 basic_machine=m68k-bull
648 os=-sysv3 974 os=sysv3
649 ;; 975 ;;
650 e500v[12]) 976 e500v[12])
651 basic_machine=powerpc-unknown 977 basic_machine=powerpc-unknown
@@ -655,20 +981,12 @@ case $basic_machine in
655 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` 981 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
656 os=$os"spe" 982 os=$os"spe"
657 ;; 983 ;;
658 ebmon29k)
659 basic_machine=a29k-amd
660 os=-ebmon
661 ;;
662 elxsi)
663 basic_machine=elxsi-elxsi
664 os=-bsd
665 ;;
666 encore | umax | mmax) 984 encore | umax | mmax)
667 basic_machine=ns32k-encore 985 basic_machine=ns32k-encore
668 ;; 986 ;;
669 es1800 | OSE68k | ose68k | ose | OSE) 987 elxsi)
670 basic_machine=m68k-ericsson 988 basic_machine=elxsi-elxsi
671 os=-ose 989 os=${os:-bsd}
672 ;; 990 ;;
673 fx2800) 991 fx2800)
674 basic_machine=i860-alliant 992 basic_machine=i860-alliant
@@ -676,45 +994,13 @@ case $basic_machine in
676 genix) 994 genix)
677 basic_machine=ns32k-ns 995 basic_machine=ns32k-ns
678 ;; 996 ;;
679 gmicro)
680 basic_machine=tron-gmicro
681 os=-sysv
682 ;;
683 go32)
684 basic_machine=i386-pc
685 os=-go32
686 ;;
687 h3050r* | hiux*) 997 h3050r* | hiux*)
688 basic_machine=hppa1.1-hitachi 998 basic_machine=hppa1.1-hitachi
689 os=-hiuxwe2 999 os=hiuxwe2
690 ;;
691 h8300hms)
692 basic_machine=h8300-hitachi
693 os=-hms
694 ;;
695 h8300xray)
696 basic_machine=h8300-hitachi
697 os=-xray
698 ;;
699 h8500hms)
700 basic_machine=h8500-hitachi
701 os=-hms
702 ;;
703 harris)
704 basic_machine=m88k-harris
705 os=-sysv3
706 ;; 1000 ;;
707 hp300-*) 1001 hp300-*)
708 basic_machine=m68k-hp 1002 basic_machine=m68k-hp
709 ;; 1003 ;;
710 hp300bsd)
711 basic_machine=m68k-hp
712 os=-bsd
713 ;;
714 hp300hpux)
715 basic_machine=m68k-hp
716 os=-hpux
717 ;;
718 hp3k9[0-9][0-9] | hp9[0-9][0-9]) 1004 hp3k9[0-9][0-9] | hp9[0-9][0-9])
719 basic_machine=hppa1.0-hp 1005 basic_machine=hppa1.0-hp
720 ;; 1006 ;;
@@ -744,95 +1030,55 @@ case $basic_machine in
744 hp9k8[0-9][0-9] | hp8[0-9][0-9]) 1030 hp9k8[0-9][0-9] | hp8[0-9][0-9])
745 basic_machine=hppa1.0-hp 1031 basic_machine=hppa1.0-hp
746 ;; 1032 ;;
747 hppaosf)
748 basic_machine=hppa1.1-hp
749 os=-osf
750 ;;
751 hppro)
752 basic_machine=hppa1.1-hp
753 os=-proelf
754 ;;
755 i370-ibm* | ibm*) 1033 i370-ibm* | ibm*)
756 basic_machine=i370-ibm 1034 basic_machine=i370-ibm
757 ;; 1035 ;;
758 i*86v32) 1036 i*86v32)
759 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` 1037 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
760 os=-sysv32 1038 os=sysv32
761 ;; 1039 ;;
762 i*86v4*) 1040 i*86v4*)
763 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` 1041 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
764 os=-sysv4 1042 os=sysv4
765 ;; 1043 ;;
766 i*86v) 1044 i*86v)
767 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` 1045 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
768 os=-sysv 1046 os=sysv
769 ;; 1047 ;;
770 i*86sol2) 1048 i*86sol2)
771 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` 1049 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
772 os=-solaris2 1050 os=solaris2
773 ;;
774 i386mach)
775 basic_machine=i386-mach
776 os=-mach
777 ;; 1051 ;;
778 vsta) 1052 j90 | j90-cray)
779 basic_machine=i386-unknown 1053 basic_machine=j90-cray
780 os=-vsta 1054 os=${os:-unicos}
781 ;; 1055 ;;
782 iris | iris4d) 1056 iris | iris4d)
783 basic_machine=mips-sgi 1057 basic_machine=mips-sgi
784 case $os in 1058 case $os in
785 -irix*) 1059 irix*)
786 ;; 1060 ;;
787 *) 1061 *)
788 os=-irix4 1062 os=irix4
789 ;; 1063 ;;
790 esac 1064 esac
791 ;; 1065 ;;
792 isi68 | isi)
793 basic_machine=m68k-isi
794 os=-sysv
795 ;;
796 leon-*|leon[3-9]-*) 1066 leon-*|leon[3-9]-*)
797 basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` 1067 basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
798 ;; 1068 ;;
799 m68knommu)
800 basic_machine=m68k-unknown
801 os=-linux
802 ;;
803 m68knommu-*) 1069 m68knommu-*)
804 basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1070 basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
805 os=-linux 1071 os=linux
806 ;;
807 magnum | m3230)
808 basic_machine=mips-mips
809 os=-sysv
810 ;;
811 merlin)
812 basic_machine=ns32k-utek
813 os=-sysv
814 ;; 1072 ;;
815 microblaze*) 1073 microblaze*)
816 basic_machine=microblaze-xilinx 1074 basic_machine=microblaze-xilinx
817 ;; 1075 ;;
818 mingw64)
819 basic_machine=x86_64-pc
820 os=-mingw64
821 ;;
822 mingw32)
823 basic_machine=i686-pc
824 os=-mingw32
825 ;;
826 mingw32ce)
827 basic_machine=arm-unknown
828 os=-mingw32ce
829 ;;
830 miniframe) 1076 miniframe)
831 basic_machine=m68000-convergent 1077 basic_machine=m68000-convergent
832 ;; 1078 ;;
833 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) 1079 *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
834 basic_machine=m68k-atari 1080 basic_machine=m68k-atari
835 os=-mint 1081 os=mint
836 ;; 1082 ;;
837 mips3*-*) 1083 mips3*-*)
838 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` 1084 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
@@ -840,98 +1086,26 @@ case $basic_machine in
840 mips3*) 1086 mips3*)
841 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown 1087 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
842 ;; 1088 ;;
843 monitor)
844 basic_machine=m68k-rom68k
845 os=-coff
846 ;;
847 morphos)
848 basic_machine=powerpc-unknown
849 os=-morphos
850 ;;
851 moxiebox)
852 basic_machine=moxie-unknown
853 os=-moxiebox
854 ;;
855 msdos)
856 basic_machine=i386-pc
857 os=-msdos
858 ;;
859 ms1-*) 1089 ms1-*)
860 basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` 1090 basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
861 ;; 1091 ;;
862 msys)
863 basic_machine=i686-pc
864 os=-msys
865 ;;
866 mvs)
867 basic_machine=i370-ibm
868 os=-mvs
869 ;;
870 nacl)
871 basic_machine=le32-unknown
872 os=-nacl
873 ;;
874 ncr3000)
875 basic_machine=i486-ncr
876 os=-sysv4
877 ;;
878 netbsd386)
879 basic_machine=i386-unknown
880 os=-netbsd
881 ;;
882 netwinder)
883 basic_machine=armv4l-rebel
884 os=-linux
885 ;;
886 news | news700 | news800 | news900)
887 basic_machine=m68k-sony
888 os=-newsos
889 ;;
890 news1000)
891 basic_machine=m68030-sony
892 os=-newsos
893 ;;
894 news-3600 | risc-news) 1092 news-3600 | risc-news)
895 basic_machine=mips-sony 1093 basic_machine=mips-sony
896 os=-newsos 1094 os=newsos
897 ;;
898 necv70)
899 basic_machine=v70-nec
900 os=-sysv
901 ;; 1095 ;;
902 next | m*-next) 1096 next | m*-next)
903 basic_machine=m68k-next 1097 basic_machine=m68k-next
904 case $os in 1098 case $os in
905 -nextstep* ) 1099 nextstep* )
906 ;; 1100 ;;
907 -ns2*) 1101 ns2*)
908 os=-nextstep2 1102 os=nextstep2
909 ;; 1103 ;;
910 *) 1104 *)
911 os=-nextstep3 1105 os=nextstep3
912 ;; 1106 ;;
913 esac 1107 esac
914 ;; 1108 ;;
915 nh3000)
916 basic_machine=m68k-harris
917 os=-cxux
918 ;;
919 nh[45]000)
920 basic_machine=m88k-harris
921 os=-cxux
922 ;;
923 nindy960)
924 basic_machine=i960-intel
925 os=-nindy
926 ;;
927 mon960)
928 basic_machine=i960-intel
929 os=-mon960
930 ;;
931 nonstopux)
932 basic_machine=mips-compaq
933 os=-nonstopux
934 ;;
935 np1) 1109 np1)
936 basic_machine=np1-gould 1110 basic_machine=np1-gould
937 ;; 1111 ;;
@@ -952,38 +1126,18 @@ case $basic_machine in
952 ;; 1126 ;;
953 op50n-* | op60c-*) 1127 op50n-* | op60c-*)
954 basic_machine=hppa1.1-oki 1128 basic_machine=hppa1.1-oki
955 os=-proelf 1129 os=proelf
956 ;; 1130 ;;
957 openrisc | openrisc-*) 1131 openrisc | openrisc-*)
958 basic_machine=or32-unknown 1132 basic_machine=or32-unknown
959 ;; 1133 ;;
960 os400)
961 basic_machine=powerpc-ibm
962 os=-os400
963 ;;
964 OSE68000 | ose68000)
965 basic_machine=m68000-ericsson
966 os=-ose
967 ;;
968 os68k)
969 basic_machine=m68k-none
970 os=-os68k
971 ;;
972 pa-hitachi) 1134 pa-hitachi)
973 basic_machine=hppa1.1-hitachi 1135 basic_machine=hppa1.1-hitachi
974 os=-hiuxwe2 1136 os=hiuxwe2
975 ;;
976 paragon)
977 basic_machine=i860-intel
978 os=-osf
979 ;;
980 parisc)
981 basic_machine=hppa-unknown
982 os=-linux
983 ;; 1137 ;;
984 parisc-*) 1138 parisc-*)
985 basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1139 basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
986 os=-linux 1140 os=linux
987 ;; 1141 ;;
988 pbd) 1142 pbd)
989 basic_machine=sparc-tti 1143 basic_machine=sparc-tti
@@ -1053,22 +1207,6 @@ case $basic_machine in
1053 ps2) 1207 ps2)
1054 basic_machine=i386-ibm 1208 basic_machine=i386-ibm
1055 ;; 1209 ;;
1056 pw32)
1057 basic_machine=i586-unknown
1058 os=-pw32
1059 ;;
1060 rdos | rdos64)
1061 basic_machine=x86_64-pc
1062 os=-rdos
1063 ;;
1064 rdos32)
1065 basic_machine=i386-pc
1066 os=-rdos
1067 ;;
1068 rom68k)
1069 basic_machine=m68k-rom68k
1070 os=-coff
1071 ;;
1072 rm[46]00) 1210 rm[46]00)
1073 basic_machine=mips-siemens 1211 basic_machine=mips-siemens
1074 ;; 1212 ;;
@@ -1081,10 +1219,6 @@ case $basic_machine in
1081 s390x | s390x-*) 1219 s390x | s390x-*)
1082 basic_machine=s390x-ibm 1220 basic_machine=s390x-ibm
1083 ;; 1221 ;;
1084 sa29200)
1085 basic_machine=a29k-amd
1086 os=-udi
1087 ;;
1088 sb1) 1222 sb1)
1089 basic_machine=mipsisa64sb1-unknown 1223 basic_machine=mipsisa64sb1-unknown
1090 ;; 1224 ;;
@@ -1093,11 +1227,7 @@ case $basic_machine in
1093 ;; 1227 ;;
1094 sde) 1228 sde)
1095 basic_machine=mipsisa32-sde 1229 basic_machine=mipsisa32-sde
1096 os=-elf 1230 os=${os:-elf}
1097 ;;
1098 sei)
1099 basic_machine=mips-sei
1100 os=-seiux
1101 ;; 1231 ;;
1102 sequent) 1232 sequent)
1103 basic_machine=i386-sequent 1233 basic_machine=i386-sequent
@@ -1107,11 +1237,7 @@ case $basic_machine in
1107 ;; 1237 ;;
1108 simso-wrs) 1238 simso-wrs)
1109 basic_machine=sparclite-wrs 1239 basic_machine=sparclite-wrs
1110 os=-vxworks 1240 os=vxworks
1111 ;;
1112 sps7)
1113 basic_machine=m68k-bull
1114 os=-sysv2
1115 ;; 1241 ;;
1116 spur) 1242 spur)
1117 basic_machine=spur-unknown 1243 basic_machine=spur-unknown
@@ -1119,44 +1245,12 @@ case $basic_machine in
1119 st2000) 1245 st2000)
1120 basic_machine=m68k-tandem 1246 basic_machine=m68k-tandem
1121 ;; 1247 ;;
1122 stratus)
1123 basic_machine=i860-stratus
1124 os=-sysv4
1125 ;;
1126 strongarm-* | thumb-*) 1248 strongarm-* | thumb-*)
1127 basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1249 basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1128 ;; 1250 ;;
1129 sun2) 1251 sun2)
1130 basic_machine=m68000-sun 1252 basic_machine=m68000-sun
1131 ;; 1253 ;;
1132 sun2os3)
1133 basic_machine=m68000-sun
1134 os=-sunos3
1135 ;;
1136 sun2os4)
1137 basic_machine=m68000-sun
1138 os=-sunos4
1139 ;;
1140 sun3os3)
1141 basic_machine=m68k-sun
1142 os=-sunos3
1143 ;;
1144 sun3os4)
1145 basic_machine=m68k-sun
1146 os=-sunos4
1147 ;;
1148 sun4os3)
1149 basic_machine=sparc-sun
1150 os=-sunos3
1151 ;;
1152 sun4os4)
1153 basic_machine=sparc-sun
1154 os=-sunos4
1155 ;;
1156 sun4sol2)
1157 basic_machine=sparc-sun
1158 os=-solaris2
1159 ;;
1160 sun3 | sun3-*) 1254 sun3 | sun3-*)
1161 basic_machine=m68k-sun 1255 basic_machine=m68k-sun
1162 ;; 1256 ;;
@@ -1166,25 +1260,9 @@ case $basic_machine in
1166 sun386 | sun386i | roadrunner) 1260 sun386 | sun386i | roadrunner)
1167 basic_machine=i386-sun 1261 basic_machine=i386-sun
1168 ;; 1262 ;;
1169 sv1)
1170 basic_machine=sv1-cray
1171 os=-unicos
1172 ;;
1173 symmetry)
1174 basic_machine=i386-sequent
1175 os=-dynix
1176 ;;
1177 t3e)
1178 basic_machine=alphaev5-cray
1179 os=-unicos
1180 ;;
1181 t90)
1182 basic_machine=t90-cray
1183 os=-unicos
1184 ;;
1185 tile*) 1263 tile*)
1186 basic_machine=$basic_machine-unknown 1264 basic_machine=$basic_machine-unknown
1187 os=-linux-gnu 1265 os=linux-gnu
1188 ;; 1266 ;;
1189 tx39) 1267 tx39)
1190 basic_machine=mipstx39-unknown 1268 basic_machine=mipstx39-unknown
@@ -1192,80 +1270,32 @@ case $basic_machine in
1192 tx39el) 1270 tx39el)
1193 basic_machine=mipstx39el-unknown 1271 basic_machine=mipstx39el-unknown
1194 ;; 1272 ;;
1195 toad1)
1196 basic_machine=pdp10-xkl
1197 os=-tops20
1198 ;;
1199 tower | tower-32) 1273 tower | tower-32)
1200 basic_machine=m68k-ncr 1274 basic_machine=m68k-ncr
1201 ;; 1275 ;;
1202 tpf)
1203 basic_machine=s390x-ibm
1204 os=-tpf
1205 ;;
1206 udi29k)
1207 basic_machine=a29k-amd
1208 os=-udi
1209 ;;
1210 ultra3)
1211 basic_machine=a29k-nyu
1212 os=-sym1
1213 ;;
1214 v810 | necv810)
1215 basic_machine=v810-nec
1216 os=-none
1217 ;;
1218 vaxv)
1219 basic_machine=vax-dec
1220 os=-sysv
1221 ;;
1222 vms)
1223 basic_machine=vax-dec
1224 os=-vms
1225 ;;
1226 vpp*|vx|vx-*) 1276 vpp*|vx|vx-*)
1227 basic_machine=f301-fujitsu 1277 basic_machine=f301-fujitsu
1228 ;; 1278 ;;
1229 vxworks960)
1230 basic_machine=i960-wrs
1231 os=-vxworks
1232 ;;
1233 vxworks68)
1234 basic_machine=m68k-wrs
1235 os=-vxworks
1236 ;;
1237 vxworks29k)
1238 basic_machine=a29k-wrs
1239 os=-vxworks
1240 ;;
1241 w65*) 1279 w65*)
1242 basic_machine=w65-wdc 1280 basic_machine=w65-wdc
1243 os=-none 1281 os=none
1244 ;; 1282 ;;
1245 w89k-*) 1283 w89k-*)
1246 basic_machine=hppa1.1-winbond 1284 basic_machine=hppa1.1-winbond
1247 os=-proelf 1285 os=proelf
1248 ;; 1286 ;;
1249 x64) 1287 x64)
1250 basic_machine=x86_64-pc 1288 basic_machine=x86_64-pc
1251 ;; 1289 ;;
1252 xbox)
1253 basic_machine=i686-pc
1254 os=-mingw32
1255 ;;
1256 xps | xps100) 1290 xps | xps100)
1257 basic_machine=xps100-honeywell 1291 basic_machine=xps100-honeywell
1258 ;; 1292 ;;
1259 xscale-* | xscalee[bl]-*) 1293 xscale-* | xscalee[bl]-*)
1260 basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` 1294 basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
1261 ;; 1295 ;;
1262 ymp)
1263 basic_machine=ymp-cray
1264 os=-unicos
1265 ;;
1266 none) 1296 none)
1267 basic_machine=none-none 1297 basic_machine=none-none
1268 os=-none 1298 os=${os:-none}
1269 ;; 1299 ;;
1270 1300
1271# Here we handle the default manufacturer of certain CPU types. It is in 1301# Here we handle the default manufacturer of certain CPU types. It is in
@@ -1338,199 +1368,199 @@ esac
1338 1368
1339# Decode manufacturer-specific aliases for certain operating systems. 1369# Decode manufacturer-specific aliases for certain operating systems.
1340 1370
1341if [ x"$os" != x"" ] 1371if [ x$os != x ]
1342then 1372then
1343case $os in 1373case $os in
1344 # First match some system type aliases that might get confused 1374 # First match some system type aliases that might get confused
1345 # with valid system types. 1375 # with valid system types.
1346 # -solaris* is a basic system type, with this one exception. 1376 # solaris* is a basic system type, with this one exception.
1347 -auroraux) 1377 auroraux)
1348 os=-auroraux 1378 os=auroraux
1349 ;; 1379 ;;
1350 -solaris1 | -solaris1.*) 1380 solaris1 | solaris1.*)
1351 os=`echo $os | sed -e 's|solaris1|sunos4|'` 1381 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1352 ;; 1382 ;;
1353 -solaris) 1383 solaris)
1354 os=-solaris2 1384 os=solaris2
1355 ;; 1385 ;;
1356 -unixware*) 1386 unixware*)
1357 os=-sysv4.2uw 1387 os=sysv4.2uw
1358 ;; 1388 ;;
1359 -gnu/linux*) 1389 gnu/linux*)
1360 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` 1390 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1361 ;; 1391 ;;
1362 # es1800 is here to avoid being matched by es* (a different OS) 1392 # es1800 is here to avoid being matched by es* (a different OS)
1363 -es1800*) 1393 es1800*)
1364 os=-ose 1394 os=ose
1365 ;; 1395 ;;
1366 # Now accept the basic system types. 1396 # Now accept the basic system types.
1367 # The portable systems comes first. 1397 # The portable systems comes first.
1368 # Each alternative MUST end in a * to match a version number. 1398 # Each alternative MUST end in a * to match a version number.
1369 # -sysv* is not here because it comes later, after sysvr4. 1399 # sysv* is not here because it comes later, after sysvr4.
1370 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 1400 gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1371 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 1401 | *vms* | sco* | esix* | isc* | aix* | cnk* | sunos | sunos[34]*\
1372 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 1402 | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1373 | -sym* | -kopensolaris* | -plan9* \ 1403 | sym* | kopensolaris* | plan9* \
1374 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 1404 | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1375 | -aos* | -aros* | -cloudabi* | -sortix* \ 1405 | aos* | aros* | cloudabi* | sortix* \
1376 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 1406 | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1377 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 1407 | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \
1378 | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ 1408 | hiux* | knetbsd* | mirbsd* | netbsd* \
1379 | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ 1409 | bitrig* | openbsd* | solidbsd* | libertybsd* \
1380 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ 1410 | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
1381 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ 1411 | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1382 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ 1412 | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1383 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \ 1413 | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
1384 | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ 1414 | chorusos* | chorusrdb* | cegcc* | glidix* \
1385 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ 1415 | cygwin* | msys* | pe* | psos* | moss* | proelf* | rtems* \
1386 | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ 1416 | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
1387 | -linux-newlib* | -linux-musl* | -linux-uclibc* \ 1417 | linux-newlib* | linux-musl* | linux-uclibc* \
1388 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ 1418 | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1389 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ 1419 | interix* | uwin* | mks* | rhapsody* | darwin* \
1390 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ 1420 | openstep* | oskit* | conix* | pw32* | nonstopux* \
1391 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ 1421 | storm-chaos* | tops10* | tenex* | tops20* | its* \
1392 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ 1422 | os2* | vos* | palmos* | uclinux* | nucleus* \
1393 | -morphos* | -superux* | -rtmk* | -windiss* \ 1423 | morphos* | superux* | rtmk* | windiss* \
1394 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 1424 | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1395 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 1425 | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1396 | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 1426 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1397 | -midnightbsd*) 1427 | midnightbsd*)
1398 # Remember, each alternative MUST END IN *, to match a version number. 1428 # Remember, each alternative MUST END IN *, to match a version number.
1399 ;; 1429 ;;
1400 -qnx*) 1430 qnx*)
1401 case $basic_machine in 1431 case $basic_machine in
1402 x86-* | i*86-*) 1432 x86-* | i*86-*)
1403 ;; 1433 ;;
1404 *) 1434 *)
1405 os=-nto$os 1435 os=nto-$os
1406 ;; 1436 ;;
1407 esac 1437 esac
1408 ;; 1438 ;;
1409 -nto-qnx*) 1439 nto-qnx*)
1410 ;; 1440 ;;
1411 -nto*) 1441 nto*)
1412 os=`echo $os | sed -e 's|nto|nto-qnx|'` 1442 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1413 ;; 1443 ;;
1414 -sim | -xray | -os68k* | -v88r* \ 1444 sim | xray | os68k* | v88r* \
1415 | -windows* | -osx | -abug | -netware* | -os9* \ 1445 | windows* | osx | abug | netware* | os9* \
1416 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) 1446 | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
1417 ;; 1447 ;;
1418 -mac*) 1448 mac*)
1419 os=`echo "$os" | sed -e 's|mac|macos|'` 1449 os=`echo "$os" | sed -e 's|mac|macos|'`
1420 ;; 1450 ;;
1421 -linux-dietlibc) 1451 linux-dietlibc)
1422 os=-linux-dietlibc 1452 os=linux-dietlibc
1423 ;; 1453 ;;
1424 -linux*) 1454 linux*)
1425 os=`echo $os | sed -e 's|linux|linux-gnu|'` 1455 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1426 ;; 1456 ;;
1427 -sunos5*) 1457 sunos5*)
1428 os=`echo "$os" | sed -e 's|sunos5|solaris2|'` 1458 os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1429 ;; 1459 ;;
1430 -sunos6*) 1460 sunos6*)
1431 os=`echo "$os" | sed -e 's|sunos6|solaris3|'` 1461 os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1432 ;; 1462 ;;
1433 -opened*) 1463 opened*)
1434 os=-openedition 1464 os=openedition
1435 ;; 1465 ;;
1436 -os400*) 1466 os400*)
1437 os=-os400 1467 os=os400
1438 ;; 1468 ;;
1439 -wince*) 1469 wince*)
1440 os=-wince 1470 os=wince
1441 ;; 1471 ;;
1442 -utek*) 1472 utek*)
1443 os=-bsd 1473 os=bsd
1444 ;; 1474 ;;
1445 -dynix*) 1475 dynix*)
1446 os=-bsd 1476 os=bsd
1447 ;; 1477 ;;
1448 -acis*) 1478 acis*)
1449 os=-aos 1479 os=aos
1450 ;; 1480 ;;
1451 -atheos*) 1481 atheos*)
1452 os=-atheos 1482 os=atheos
1453 ;; 1483 ;;
1454 -syllable*) 1484 syllable*)
1455 os=-syllable 1485 os=syllable
1456 ;; 1486 ;;
1457 -386bsd) 1487 386bsd)
1458 os=-bsd 1488 os=bsd
1459 ;; 1489 ;;
1460 -ctix* | -uts*) 1490 ctix* | uts*)
1461 os=-sysv 1491 os=sysv
1462 ;; 1492 ;;
1463 -nova*) 1493 nova*)
1464 os=-rtmk-nova 1494 os=rtmk-nova
1465 ;; 1495 ;;
1466 -ns2) 1496 ns2)
1467 os=-nextstep2 1497 os=nextstep2
1468 ;; 1498 ;;
1469 -nsk*) 1499 nsk*)
1470 os=-nsk 1500 os=nsk
1471 ;; 1501 ;;
1472 # Preserve the version number of sinix5. 1502 # Preserve the version number of sinix5.
1473 -sinix5.*) 1503 sinix5.*)
1474 os=`echo $os | sed -e 's|sinix|sysv|'` 1504 os=`echo $os | sed -e 's|sinix|sysv|'`
1475 ;; 1505 ;;
1476 -sinix*) 1506 sinix*)
1477 os=-sysv4 1507 os=sysv4
1478 ;; 1508 ;;
1479 -tpf*) 1509 tpf*)
1480 os=-tpf 1510 os=tpf
1481 ;; 1511 ;;
1482 -triton*) 1512 triton*)
1483 os=-sysv3 1513 os=sysv3
1484 ;; 1514 ;;
1485 -oss*) 1515 oss*)
1486 os=-sysv3 1516 os=sysv3
1487 ;; 1517 ;;
1488 -svr4*) 1518 svr4*)
1489 os=-sysv4 1519 os=sysv4
1490 ;; 1520 ;;
1491 -svr3) 1521 svr3)
1492 os=-sysv3 1522 os=sysv3
1493 ;; 1523 ;;
1494 -sysvr4) 1524 sysvr4)
1495 os=-sysv4 1525 os=sysv4
1496 ;; 1526 ;;
1497 # This must come after -sysvr4. 1527 # This must come after sysvr4.
1498 -sysv*) 1528 sysv*)
1499 ;; 1529 ;;
1500 -ose*) 1530 ose*)
1501 os=-ose 1531 os=ose
1502 ;; 1532 ;;
1503 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1533 *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1504 os=-mint 1534 os=mint
1505 ;; 1535 ;;
1506 -zvmoe) 1536 zvmoe)
1507 os=-zvmoe 1537 os=zvmoe
1508 ;; 1538 ;;
1509 -dicos*) 1539 dicos*)
1510 os=-dicos 1540 os=dicos
1511 ;; 1541 ;;
1512 -pikeos*) 1542 pikeos*)
1513 # Until real need of OS specific support for 1543 # Until real need of OS specific support for
1514 # particular features comes up, bare metal 1544 # particular features comes up, bare metal
1515 # configurations are quite functional. 1545 # configurations are quite functional.
1516 case $basic_machine in 1546 case $basic_machine in
1517 arm*) 1547 arm*)
1518 os=-eabi 1548 os=eabi
1519 ;; 1549 ;;
1520 *) 1550 *)
1521 os=-elf 1551 os=elf
1522 ;; 1552 ;;
1523 esac 1553 esac
1524 ;; 1554 ;;
1525 -nacl*) 1555 nacl*)
1556 ;;
1557 ios)
1526 ;; 1558 ;;
1527 -ios) 1559 none)
1528 ;; 1560 ;;
1529 -none) 1561 *-eabi)
1530 ;; 1562 ;;
1531 *) 1563 *)
1532 # Get rid of the `-' at the beginning of $os.
1533 os=`echo $os | sed 's/[^-]*-//'`
1534 echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 1564 echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
1535 exit 1 1565 exit 1
1536 ;; 1566 ;;
@@ -1549,173 +1579,173 @@ else
1549 1579
1550case $basic_machine in 1580case $basic_machine in
1551 score-*) 1581 score-*)
1552 os=-elf 1582 os=elf
1553 ;; 1583 ;;
1554 spu-*) 1584 spu-*)
1555 os=-elf 1585 os=elf
1556 ;; 1586 ;;
1557 *-acorn) 1587 *-acorn)
1558 os=-riscix1.2 1588 os=riscix1.2
1559 ;; 1589 ;;
1560 arm*-rebel) 1590 arm*-rebel)
1561 os=-linux 1591 os=linux
1562 ;; 1592 ;;
1563 arm*-semi) 1593 arm*-semi)
1564 os=-aout 1594 os=aout
1565 ;; 1595 ;;
1566 c4x-* | tic4x-*) 1596 c4x-* | tic4x-*)
1567 os=-coff 1597 os=coff
1568 ;; 1598 ;;
1569 c8051-*) 1599 c8051-*)
1570 os=-elf 1600 os=elf
1571 ;; 1601 ;;
1572 hexagon-*) 1602 hexagon-*)
1573 os=-elf 1603 os=elf
1574 ;; 1604 ;;
1575 tic54x-*) 1605 tic54x-*)
1576 os=-coff 1606 os=coff
1577 ;; 1607 ;;
1578 tic55x-*) 1608 tic55x-*)
1579 os=-coff 1609 os=coff
1580 ;; 1610 ;;
1581 tic6x-*) 1611 tic6x-*)
1582 os=-coff 1612 os=coff
1583 ;; 1613 ;;
1584 # This must come before the *-dec entry. 1614 # This must come before the *-dec entry.
1585 pdp10-*) 1615 pdp10-*)
1586 os=-tops20 1616 os=tops20
1587 ;; 1617 ;;
1588 pdp11-*) 1618 pdp11-*)
1589 os=-none 1619 os=none
1590 ;; 1620 ;;
1591 *-dec | vax-*) 1621 *-dec | vax-*)
1592 os=-ultrix4.2 1622 os=ultrix4.2
1593 ;; 1623 ;;
1594 m68*-apollo) 1624 m68*-apollo)
1595 os=-domain 1625 os=domain
1596 ;; 1626 ;;
1597 i386-sun) 1627 i386-sun)
1598 os=-sunos4.0.2 1628 os=sunos4.0.2
1599 ;; 1629 ;;
1600 m68000-sun) 1630 m68000-sun)
1601 os=-sunos3 1631 os=sunos3
1602 ;; 1632 ;;
1603 m68*-cisco) 1633 m68*-cisco)
1604 os=-aout 1634 os=aout
1605 ;; 1635 ;;
1606 mep-*) 1636 mep-*)
1607 os=-elf 1637 os=elf
1608 ;; 1638 ;;
1609 mips*-cisco) 1639 mips*-cisco)
1610 os=-elf 1640 os=elf
1611 ;; 1641 ;;
1612 mips*-*) 1642 mips*-*)
1613 os=-elf 1643 os=elf
1614 ;; 1644 ;;
1615 or32-*) 1645 or32-*)
1616 os=-coff 1646 os=coff
1617 ;; 1647 ;;
1618 *-tti) # must be before sparc entry or we get the wrong os. 1648 *-tti) # must be before sparc entry or we get the wrong os.
1619 os=-sysv3 1649 os=sysv3
1620 ;; 1650 ;;
1621 sparc-* | *-sun) 1651 sparc-* | *-sun)
1622 os=-sunos4.1.1 1652 os=sunos4.1.1
1623 ;; 1653 ;;
1624 pru-*) 1654 pru-*)
1625 os=-elf 1655 os=elf
1626 ;; 1656 ;;
1627 *-be) 1657 *-be)
1628 os=-beos 1658 os=beos
1629 ;; 1659 ;;
1630 *-ibm) 1660 *-ibm)
1631 os=-aix 1661 os=aix
1632 ;; 1662 ;;
1633 *-knuth) 1663 *-knuth)
1634 os=-mmixware 1664 os=mmixware
1635 ;; 1665 ;;
1636 *-wec) 1666 *-wec)
1637 os=-proelf 1667 os=proelf
1638 ;; 1668 ;;
1639 *-winbond) 1669 *-winbond)
1640 os=-proelf 1670 os=proelf
1641 ;; 1671 ;;
1642 *-oki) 1672 *-oki)
1643 os=-proelf 1673 os=proelf
1644 ;; 1674 ;;
1645 *-hp) 1675 *-hp)
1646 os=-hpux 1676 os=hpux
1647 ;; 1677 ;;
1648 *-hitachi) 1678 *-hitachi)
1649 os=-hiux 1679 os=hiux
1650 ;; 1680 ;;
1651 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) 1681 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1652 os=-sysv 1682 os=sysv
1653 ;; 1683 ;;
1654 *-cbm) 1684 *-cbm)
1655 os=-amigaos 1685 os=amigaos
1656 ;; 1686 ;;
1657 *-dg) 1687 *-dg)
1658 os=-dgux 1688 os=dgux
1659 ;; 1689 ;;
1660 *-dolphin) 1690 *-dolphin)
1661 os=-sysv3 1691 os=sysv3
1662 ;; 1692 ;;
1663 m68k-ccur) 1693 m68k-ccur)
1664 os=-rtu 1694 os=rtu
1665 ;; 1695 ;;
1666 m88k-omron*) 1696 m88k-omron*)
1667 os=-luna 1697 os=luna
1668 ;; 1698 ;;
1669 *-next) 1699 *-next)
1670 os=-nextstep 1700 os=nextstep
1671 ;; 1701 ;;
1672 *-sequent) 1702 *-sequent)
1673 os=-ptx 1703 os=ptx
1674 ;; 1704 ;;
1675 *-crds) 1705 *-crds)
1676 os=-unos 1706 os=unos
1677 ;; 1707 ;;
1678 *-ns) 1708 *-ns)
1679 os=-genix 1709 os=genix
1680 ;; 1710 ;;
1681 i370-*) 1711 i370-*)
1682 os=-mvs 1712 os=mvs
1683 ;; 1713 ;;
1684 *-gould) 1714 *-gould)
1685 os=-sysv 1715 os=sysv
1686 ;; 1716 ;;
1687 *-highlevel) 1717 *-highlevel)
1688 os=-bsd 1718 os=bsd
1689 ;; 1719 ;;
1690 *-encore) 1720 *-encore)
1691 os=-bsd 1721 os=bsd
1692 ;; 1722 ;;
1693 *-sgi) 1723 *-sgi)
1694 os=-irix 1724 os=irix
1695 ;; 1725 ;;
1696 *-siemens) 1726 *-siemens)
1697 os=-sysv4 1727 os=sysv4
1698 ;; 1728 ;;
1699 *-masscomp) 1729 *-masscomp)
1700 os=-rtu 1730 os=rtu
1701 ;; 1731 ;;
1702 f30[01]-fujitsu | f700-fujitsu) 1732 f30[01]-fujitsu | f700-fujitsu)
1703 os=-uxpv 1733 os=uxpv
1704 ;; 1734 ;;
1705 *-rom68k) 1735 *-rom68k)
1706 os=-coff 1736 os=coff
1707 ;; 1737 ;;
1708 *-*bug) 1738 *-*bug)
1709 os=-coff 1739 os=coff
1710 ;; 1740 ;;
1711 *-apple) 1741 *-apple)
1712 os=-macos 1742 os=macos
1713 ;; 1743 ;;
1714 *-atari*) 1744 *-atari*)
1715 os=-mint 1745 os=mint
1716 ;; 1746 ;;
1717 *) 1747 *)
1718 os=-none 1748 os=none
1719 ;; 1749 ;;
1720esac 1750esac
1721fi 1751fi
@@ -1726,67 +1756,67 @@ vendor=unknown
1726case $basic_machine in 1756case $basic_machine in
1727 *-unknown) 1757 *-unknown)
1728 case $os in 1758 case $os in
1729 -riscix*) 1759 riscix*)
1730 vendor=acorn 1760 vendor=acorn
1731 ;; 1761 ;;
1732 -sunos*) 1762 sunos*)
1733 vendor=sun 1763 vendor=sun
1734 ;; 1764 ;;
1735 -cnk*|-aix*) 1765 cnk*|-aix*)
1736 vendor=ibm 1766 vendor=ibm
1737 ;; 1767 ;;
1738 -beos*) 1768 beos*)
1739 vendor=be 1769 vendor=be
1740 ;; 1770 ;;
1741 -hpux*) 1771 hpux*)
1742 vendor=hp 1772 vendor=hp
1743 ;; 1773 ;;
1744 -mpeix*) 1774 mpeix*)
1745 vendor=hp 1775 vendor=hp
1746 ;; 1776 ;;
1747 -hiux*) 1777 hiux*)
1748 vendor=hitachi 1778 vendor=hitachi
1749 ;; 1779 ;;
1750 -unos*) 1780 unos*)
1751 vendor=crds 1781 vendor=crds
1752 ;; 1782 ;;
1753 -dgux*) 1783 dgux*)
1754 vendor=dg 1784 vendor=dg
1755 ;; 1785 ;;
1756 -luna*) 1786 luna*)
1757 vendor=omron 1787 vendor=omron
1758 ;; 1788 ;;
1759 -genix*) 1789 genix*)
1760 vendor=ns 1790 vendor=ns
1761 ;; 1791 ;;
1762 -mvs* | -opened*) 1792 mvs* | opened*)
1763 vendor=ibm 1793 vendor=ibm
1764 ;; 1794 ;;
1765 -os400*) 1795 os400*)
1766 vendor=ibm 1796 vendor=ibm
1767 ;; 1797 ;;
1768 -ptx*) 1798 ptx*)
1769 vendor=sequent 1799 vendor=sequent
1770 ;; 1800 ;;
1771 -tpf*) 1801 tpf*)
1772 vendor=ibm 1802 vendor=ibm
1773 ;; 1803 ;;
1774 -vxsim* | -vxworks* | -windiss*) 1804 vxsim* | vxworks* | windiss*)
1775 vendor=wrs 1805 vendor=wrs
1776 ;; 1806 ;;
1777 -aux*) 1807 aux*)
1778 vendor=apple 1808 vendor=apple
1779 ;; 1809 ;;
1780 -hms*) 1810 hms*)
1781 vendor=hitachi 1811 vendor=hitachi
1782 ;; 1812 ;;
1783 -mpw* | -macos*) 1813 mpw* | macos*)
1784 vendor=apple 1814 vendor=apple
1785 ;; 1815 ;;
1786 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1816 *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1787 vendor=atari 1817 vendor=atari
1788 ;; 1818 ;;
1789 -vos*) 1819 vos*)
1790 vendor=stratus 1820 vendor=stratus
1791 ;; 1821 ;;
1792 esac 1822 esac
@@ -1794,7 +1824,7 @@ case $basic_machine in
1794 ;; 1824 ;;
1795esac 1825esac
1796 1826
1797echo "$basic_machine$os" 1827echo "$basic_machine-$os"
1798exit 1828exit
1799 1829
1800# Local variables: 1830# Local variables:
diff --git a/lib/dosname.h b/lib/dosname.h
index 66486d5209d..fef3b6daa1f 100644
--- a/lib/dosname.h
+++ b/lib/dosname.h
@@ -20,9 +20,8 @@
20#ifndef _DOSNAME_H 20#ifndef _DOSNAME_H
21#define _DOSNAME_H 21#define _DOSNAME_H
22 22
23#if (defined _WIN32 || defined __WIN32__ || \ 23#if (defined _WIN32 || defined __CYGWIN__ \
24 defined __MSDOS__ || defined __CYGWIN__ || \ 24 || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__)
25 defined __EMX__ || defined __DJGPP__)
26 /* This internal macro assumes ASCII, but all hosts that support drive 25 /* This internal macro assumes ASCII, but all hosts that support drive
27 letters use ASCII. */ 26 letters use ASCII. */
28# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \ 27# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
diff --git a/lib/dup2.c b/lib/dup2.c
index c8b49b25e47..c7d176728d4 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -29,7 +29,7 @@
29 29
30# undef dup2 30# undef dup2
31 31
32# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 32# if defined _WIN32 && ! defined __CYGWIN__
33 33
34/* Get declarations of the native Windows API functions. */ 34/* Get declarations of the native Windows API functions. */
35# define WIN32_LEAN_AND_MEAN 35# define WIN32_LEAN_AND_MEAN
diff --git a/lib/errno.in.h b/lib/errno.in.h
index 8d2f3074fab..b95c4e9ce76 100644
--- a/lib/errno.in.h
+++ b/lib/errno.in.h
@@ -30,7 +30,7 @@
30 30
31 31
32/* On native Windows platforms, many macros are not defined. */ 32/* On native Windows platforms, many macros are not defined. */
33# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 33# if defined _WIN32 && ! defined __CYGWIN__
34 34
35/* These are the same values as defined by MSVC 10, for interoperability. */ 35/* These are the same values as defined by MSVC 10, for interoperability. */
36 36
@@ -248,7 +248,7 @@
248 interoperability. */ 248 interoperability. */
249# define EOWNERDEAD 58 249# define EOWNERDEAD 58
250# define ENOTRECOVERABLE 59 250# define ENOTRECOVERABLE 59
251# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 251# elif defined _WIN32 && ! defined __CYGWIN__
252 /* We have a conflict here: pthreads-win32 defines these values 252 /* We have a conflict here: pthreads-win32 defines these values
253 differently than MSVC 10. It's hairy to decide which one to use. */ 253 differently than MSVC 10. It's hairy to decide which one to use. */
254# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS 254# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
diff --git a/lib/euidaccess.c b/lib/euidaccess.c
index 4f512f5af54..de5d82b52d5 100644
--- a/lib/euidaccess.c
+++ b/lib/euidaccess.c
@@ -29,7 +29,7 @@
29#include <sys/types.h> 29#include <sys/types.h>
30#include <sys/stat.h> 30#include <sys/stat.h>
31#include <unistd.h> 31#include <unistd.h>
32#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 32#if defined _WIN32 && ! defined __CYGWIN__
33# include <io.h> 33# include <io.h>
34#else 34#else
35# include "root-uid.h" 35# include "root-uid.h"
@@ -87,7 +87,7 @@ euidaccess (const char *file, int mode)
87 return accessx (file, mode, ACC_SELF); 87 return accessx (file, mode, ACC_SELF);
88#elif HAVE_EACCESS /* FreeBSD */ 88#elif HAVE_EACCESS /* FreeBSD */
89 return eaccess (file, mode); 89 return eaccess (file, mode);
90#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* mingw */ 90#elif defined _WIN32 && ! defined __CYGWIN__ /* mingw */
91 return _access (file, mode); 91 return _access (file, mode);
92#else /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, BeOS */ 92#else /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, BeOS */
93 93
diff --git a/lib/fcntl.c b/lib/fcntl.c
index b8cb271f55c..be6583565b4 100644
--- a/lib/fcntl.c
+++ b/lib/fcntl.c
@@ -32,7 +32,7 @@
32#endif 32#endif
33#undef fcntl 33#undef fcntl
34 34
35#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 35#if defined _WIN32 && ! defined __CYGWIN__
36/* Get declarations of the native Windows API functions. */ 36/* Get declarations of the native Windows API functions. */
37# define WIN32_LEAN_AND_MEAN 37# define WIN32_LEAN_AND_MEAN
38# include <windows.h> 38# include <windows.h>
@@ -376,7 +376,7 @@ rpl_fcntl (int fd, int action, /* arg */...)
376#if !HAVE_FCNTL 376#if !HAVE_FCNTL
377 case F_GETFD: 377 case F_GETFD:
378 { 378 {
379# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 379# if defined _WIN32 && ! defined __CYGWIN__
380 HANDLE handle = (HANDLE) _get_osfhandle (fd); 380 HANDLE handle = (HANDLE) _get_osfhandle (fd);
381 DWORD flags; 381 DWORD flags;
382 if (handle == INVALID_HANDLE_VALUE 382 if (handle == INVALID_HANDLE_VALUE
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 719a54d0f72..a1e7d35c1b9 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -68,7 +68,7 @@
68 68
69/* Native Windows platforms declare open(), creat() in <io.h>. */ 69/* Native Windows platforms declare open(), creat() in <io.h>. */
70#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ 70#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
71 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 71 && (defined _WIN32 && ! defined __CYGWIN__)
72# include <io.h> 72# include <io.h>
73#endif 73#endif
74 74
diff --git a/lib/fpending.c b/lib/fpending.c
index 7bc235deda2..de370d4b10f 100644
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -24,6 +24,9 @@
24 24
25#include "stdio-impl.h" 25#include "stdio-impl.h"
26 26
27/* This file is not used on systems that already have the __fpending function,
28 namely glibc >= 2.2, Solaris >= 7, Android API >= 23. */
29
27/* Return the number of pending (aka buffered, unflushed) 30/* Return the number of pending (aka buffered, unflushed)
28 bytes on the stream, FP, that is open for writing. */ 31 bytes on the stream, FP, that is open for writing. */
29size_t 32size_t
diff --git a/lib/fsync.c b/lib/fsync.c
index a0b12b6ccc7..ecacb0ba25e 100644
--- a/lib/fsync.c
+++ b/lib/fsync.c
@@ -25,7 +25,7 @@
25#include <config.h> 25#include <config.h>
26#include <unistd.h> 26#include <unistd.h>
27 27
28#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 28#if defined _WIN32 && ! defined __CYGWIN__
29 29
30/* FlushFileBuffers */ 30/* FlushFileBuffers */
31# define WIN32_LEAN_AND_MEAN 31# define WIN32_LEAN_AND_MEAN
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
index c6c1136fc55..ac05bc483cc 100644
--- a/lib/getdtablesize.c
+++ b/lib/getdtablesize.c
@@ -20,7 +20,7 @@
20/* Specification. */ 20/* Specification. */
21#include <unistd.h> 21#include <unistd.h>
22 22
23#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 23#if defined _WIN32 && ! defined __CYGWIN__
24 24
25# include <stdio.h> 25# include <stdio.h>
26 26
diff --git a/lib/getopt.c b/lib/getopt.c
index 55375ccd40f..11e36eef815 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -46,7 +46,7 @@
46/* When used standalone, flockfile and funlockfile might not be 46/* When used standalone, flockfile and funlockfile might not be
47 available. */ 47 available. */
48# if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \ 48# if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \
49 || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) 49 || (defined _WIN32 && ! defined __CYGWIN__))
50# define flockfile(fp) /* nop */ 50# define flockfile(fp) /* nop */
51# define funlockfile(fp) /* nop */ 51# define funlockfile(fp) /* nop */
52# endif 52# endif
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
index 39575658264..d598b2f7f56 100644
--- a/lib/gettimeofday.c
+++ b/lib/gettimeofday.c
@@ -24,7 +24,7 @@
24 24
25#include <time.h> 25#include <time.h>
26 26
27#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 27#if defined _WIN32 && ! defined __CYGWIN__
28# define WINDOWS_NATIVE 28# define WINDOWS_NATIVE
29# include <windows.h> 29# include <windows.h>
30#endif 30#endif
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index ce47b9de661..19128bab2da 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -21,7 +21,7 @@
21# the same distribution terms as the rest of that program. 21# the same distribution terms as the rest of that program.
22# 22#
23# Generated by gnulib-tool. 23# Generated by gnulib-tool.
24# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stat --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=tzset --avoid=unsetenv --avoid=utime --avoid=utime-h --gnu-make --makefile-name=gnulib.mk.in --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-leading-zeros count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 d-type diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp flexmember fstatat fsusage fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr minmax mkostemp mktime nstrftime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strtoimax symlink sys_stat sys_time tempname time time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimens vla warnings 24# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stat --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=tzset --avoid=unsetenv --avoid=utime --avoid=utime-h --gnu-make --makefile-name=gnulib.mk.in --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-leading-zeros count-one-bits count-trailing-zeros crypto/md5-buffer crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer d-type diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp flexmember fstatat fsusage fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr minmax mkostemp mktime nstrftime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strtoimax symlink sys_stat sys_time tempname time time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimens vla warnings
25 25
26 26
27MOSTLYCLEANFILES += core *.stackdump 27MOSTLYCLEANFILES += core *.stackdump
@@ -387,6 +387,7 @@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
387HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ 387HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
388HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ 388HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
389HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ 389HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
390HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
390HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ 391HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
391HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ 392HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
392HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ 393HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -421,6 +422,7 @@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
421HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ 422HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
422HAVE_GRANTPT = @HAVE_GRANTPT@ 423HAVE_GRANTPT = @HAVE_GRANTPT@
423HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ 424HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
425HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
424HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ 426HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
425HAVE_LCHMOD = @HAVE_LCHMOD@ 427HAVE_LCHMOD = @HAVE_LCHMOD@
426HAVE_LCHOWN = @HAVE_LCHOWN@ 428HAVE_LCHOWN = @HAVE_LCHOWN@
@@ -513,7 +515,6 @@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
513HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ 515HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
514HAVE_TIMEGM = @HAVE_TIMEGM@ 516HAVE_TIMEGM = @HAVE_TIMEGM@
515HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ 517HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
516HAVE_TRUNCATE = @HAVE_TRUNCATE@
517HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ 518HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
518HAVE_TZSET = @HAVE_TZSET@ 519HAVE_TZSET = @HAVE_TZSET@
519HAVE_UNISTD_H = @HAVE_UNISTD_H@ 520HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -1151,45 +1152,45 @@ EXTRA_DIST += count-trailing-zeros.h
1151endif 1152endif
1152## end gnulib module count-trailing-zeros 1153## end gnulib module count-trailing-zeros
1153 1154
1154## begin gnulib module crypto/md5 1155## begin gnulib module crypto/md5-buffer
1155ifeq (,$(OMIT_GNULIB_MODULE_crypto/md5)) 1156ifeq (,$(OMIT_GNULIB_MODULE_crypto/md5-buffer))
1156 1157
1157libgnu_a_SOURCES += md5.c 1158libgnu_a_SOURCES += md5.c
1158 1159
1159EXTRA_DIST += gl_openssl.h md5.h 1160EXTRA_DIST += gl_openssl.h md5.h
1160 1161
1161endif 1162endif
1162## end gnulib module crypto/md5 1163## end gnulib module crypto/md5-buffer
1163 1164
1164## begin gnulib module crypto/sha1 1165## begin gnulib module crypto/sha1-buffer
1165ifeq (,$(OMIT_GNULIB_MODULE_crypto/sha1)) 1166ifeq (,$(OMIT_GNULIB_MODULE_crypto/sha1-buffer))
1166 1167
1167libgnu_a_SOURCES += sha1.c 1168libgnu_a_SOURCES += sha1.c
1168 1169
1169EXTRA_DIST += gl_openssl.h sha1.h 1170EXTRA_DIST += gl_openssl.h sha1.h
1170 1171
1171endif 1172endif
1172## end gnulib module crypto/sha1 1173## end gnulib module crypto/sha1-buffer
1173 1174
1174## begin gnulib module crypto/sha256 1175## begin gnulib module crypto/sha256-buffer
1175ifeq (,$(OMIT_GNULIB_MODULE_crypto/sha256)) 1176ifeq (,$(OMIT_GNULIB_MODULE_crypto/sha256-buffer))
1176 1177
1177libgnu_a_SOURCES += sha256.c 1178libgnu_a_SOURCES += sha256.c
1178 1179
1179EXTRA_DIST += gl_openssl.h sha256.h 1180EXTRA_DIST += gl_openssl.h sha256.h
1180 1181
1181endif 1182endif
1182## end gnulib module crypto/sha256 1183## end gnulib module crypto/sha256-buffer
1183 1184
1184## begin gnulib module crypto/sha512 1185## begin gnulib module crypto/sha512-buffer
1185ifeq (,$(OMIT_GNULIB_MODULE_crypto/sha512)) 1186ifeq (,$(OMIT_GNULIB_MODULE_crypto/sha512-buffer))
1186 1187
1187libgnu_a_SOURCES += sha512.c 1188libgnu_a_SOURCES += sha512.c
1188 1189
1189EXTRA_DIST += gl_openssl.h sha512.h 1190EXTRA_DIST += gl_openssl.h sha512.h
1190 1191
1191endif 1192endif
1192## end gnulib module crypto/sha512 1193## end gnulib module crypto/sha512-buffer
1193 1194
1194## begin gnulib module diffseq 1195## begin gnulib module diffseq
1195ifeq (,$(OMIT_GNULIB_MODULE_diffseq)) 1196ifeq (,$(OMIT_GNULIB_MODULE_diffseq))
@@ -1717,6 +1718,7 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
1717 -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ 1718 -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
1718 -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ 1719 -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
1719 -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ 1720 -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
1721 -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
1720 -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ 1722 -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
1721 -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ 1723 -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
1722 -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ 1724 -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
@@ -2984,7 +2986,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
2984 -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ 2986 -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
2985 -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ 2987 -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
2986 -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ 2988 -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
2987 -e 's|@''HAVE_TRUNCATE''@|$(HAVE_TRUNCATE)|g' \
2988 -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ 2989 -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
2989 -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ 2990 -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
2990 -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ 2991 -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
@@ -2996,6 +2997,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
2996 -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ 2997 -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
2997 -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ 2998 -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
2998 -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ 2999 -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
3000 -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \
2999 -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ 3001 -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
3000 -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ 3002 -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
3001 -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ 3003 -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
index ca3cec5b477..c7d7968e6e9 100644
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -52,7 +52,7 @@
52/* Get CHAR_BIT. */ 52/* Get CHAR_BIT. */
53#include <limits.h> 53#include <limits.h>
54/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */ 54/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
55#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 55#if defined _WIN32 && ! defined __CYGWIN__
56# include <stdio.h> 56# include <stdio.h>
57#endif 57#endif
58 58
@@ -1067,11 +1067,13 @@ _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
1067#endif 1067#endif
1068 1068
1069#if @GNULIB_IMAXDIV@ 1069#if @GNULIB_IMAXDIV@
1070# if !@HAVE_DECL_IMAXDIV@ 1070# if !@HAVE_IMAXDIV_T@
1071# if !GNULIB_defined_imaxdiv_t 1071# if !GNULIB_defined_imaxdiv_t
1072typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; 1072typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
1073# define GNULIB_defined_imaxdiv_t 1 1073# define GNULIB_defined_imaxdiv_t 1
1074# endif 1074# endif
1075# endif
1076# if !@HAVE_DECL_IMAXDIV@
1075extern imaxdiv_t imaxdiv (intmax_t, intmax_t); 1077extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
1076# endif 1078# endif
1077#elif defined GNULIB_POSIXCHECK 1079#elif defined GNULIB_POSIXCHECK
diff --git a/lib/md5.c b/lib/md5.c
index 9dc915e2cf0..577aab46d7a 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -134,21 +134,29 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
134} 134}
135#endif 135#endif
136 136
137#if defined _LIBC || defined GL_COMPILE_CRYPTO_STREAM
138
139#include "af_alg.h"
140
137/* Compute MD5 message digest for bytes read from STREAM. The 141/* Compute MD5 message digest for bytes read from STREAM. The
138 resulting message digest number will be written into the 16 bytes 142 resulting message digest number will be written into the 16 bytes
139 beginning at RESBLOCK. */ 143 beginning at RESBLOCK. */
140int 144int
141md5_stream (FILE *stream, void *resblock) 145md5_stream (FILE *stream, void *resblock)
142{ 146{
143 struct md5_ctx ctx; 147 switch (afalg_stream (stream, "md5", resblock, MD5_DIGEST_SIZE))
144 size_t sum; 148 {
149 case 0: return 0;
150 case -EIO: return 1;
151 }
145 152
146 char *buffer = malloc (BLOCKSIZE + 72); 153 char *buffer = malloc (BLOCKSIZE + 72);
147 if (!buffer) 154 if (!buffer)
148 return 1; 155 return 1;
149 156
150 /* Initialize the computation context. */ 157 struct md5_ctx ctx;
151 md5_init_ctx (&ctx); 158 md5_init_ctx (&ctx);
159 size_t sum;
152 160
153 /* Iterate over full file contents. */ 161 /* Iterate over full file contents. */
154 while (1) 162 while (1)
@@ -206,6 +214,7 @@ process_partial_block:
206 free (buffer); 214 free (buffer);
207 return 0; 215 return 0;
208} 216}
217#endif
209 218
210#if ! HAVE_OPENSSL_MD5 219#if ! HAVE_OPENSSL_MD5
211/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The 220/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
diff --git a/lib/md5.h b/lib/md5.h
index d89f819a97b..db031aac04c 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -122,8 +122,11 @@ extern void *__md5_buffer (const char *buffer, size_t len,
122 void *resblock) __THROW; 122 void *resblock) __THROW;
123 123
124# endif 124# endif
125/* Compute MD5 message digest for bytes read from STREAM. The 125/* Compute MD5 message digest for bytes read from STREAM.
126 resulting message digest number will be written into the 16 bytes 126 STREAM is an open file stream. Regular files are handled more efficiently.
127 The contents of STREAM from its current position to its end will be read.
128 The case that the last operation on STREAM was an 'ungetc' is not supported.
129 The resulting message digest number will be written into the 16 bytes
127 beginning at RESBLOCK. */ 130 beginning at RESBLOCK. */
128extern int __md5_stream (FILE *stream, void *resblock) __THROW; 131extern int __md5_stream (FILE *stream, void *resblock) __THROW;
129 132
diff --git a/lib/open.c b/lib/open.c
index b344f13a92a..792e258ba0b 100644
--- a/lib/open.c
+++ b/lib/open.c
@@ -86,7 +86,7 @@ open (const char *filename, int flags, ...)
86 flags &= ~O_NONBLOCK; 86 flags &= ~O_NONBLOCK;
87#endif 87#endif
88 88
89#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 89#if defined _WIN32 && ! defined __CYGWIN__
90 if (strcmp (filename, "/dev/null") == 0) 90 if (strcmp (filename, "/dev/null") == 0)
91 filename = "NUL"; 91 filename = "NUL";
92#endif 92#endif
diff --git a/lib/pipe2.c b/lib/pipe2.c
index 807ba6a9f9d..c16d9351ec8 100644
--- a/lib/pipe2.c
+++ b/lib/pipe2.c
@@ -29,7 +29,7 @@
29# include "nonblocking.h" 29# include "nonblocking.h"
30#endif 30#endif
31 31
32#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 32#if defined _WIN32 && ! defined __CYGWIN__
33/* Native Windows API. */ 33/* Native Windows API. */
34 34
35# include <io.h> 35# include <io.h>
@@ -73,7 +73,7 @@ pipe2 (int fd[2], int flags)
73 return -1; 73 return -1;
74 } 74 }
75 75
76#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 76#if defined _WIN32 && ! defined __CYGWIN__
77/* Native Windows API. */ 77/* Native Windows API. */
78 78
79 if (_pipe (fd, 4096, flags & ~O_NONBLOCK) < 0) 79 if (_pipe (fd, 4096, flags & ~O_NONBLOCK) < 0)
@@ -152,8 +152,7 @@ pipe2 (int fd[2], int flags)
152 152
153#endif 153#endif
154 154
155#if GNULIB_defined_O_NONBLOCK || \ 155#if GNULIB_defined_O_NONBLOCK || !(defined _WIN32 && ! defined __CYGWIN__)
156 !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
157 fail: 156 fail:
158 { 157 {
159 int saved_errno = errno; 158 int saved_errno = errno;
diff --git a/lib/putenv.c b/lib/putenv.c
index 556d5f82302..801e372c329 100644
--- a/lib/putenv.c
+++ b/lib/putenv.c
@@ -34,7 +34,7 @@
34#include <string.h> 34#include <string.h>
35#include <unistd.h> 35#include <unistd.h>
36 36
37#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 37#if defined _WIN32 && ! defined __CYGWIN__
38# define WIN32_LEAN_AND_MEAN 38# define WIN32_LEAN_AND_MEAN
39# include <windows.h> 39# include <windows.h>
40#endif 40#endif
@@ -153,7 +153,7 @@ putenv (char *string)
153 *ep = string; 153 *ep = string;
154 break; 154 break;
155 } 155 }
156# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 156# if defined _WIN32 && ! defined __CYGWIN__
157 if (putenv_result == 0) 157 if (putenv_result == 0)
158 { 158 {
159 /* _putenv propagated "NAME= " into the subprocess environment; 159 /* _putenv propagated "NAME= " into the subprocess environment;
diff --git a/lib/sha1.c b/lib/sha1.c
index ce0f0b2e71f..8306d887da5 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -122,21 +122,29 @@ sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf)
122} 122}
123#endif 123#endif
124 124
125#ifdef GL_COMPILE_CRYPTO_STREAM
126
127#include "af_alg.h"
128
125/* Compute SHA1 message digest for bytes read from STREAM. The 129/* Compute SHA1 message digest for bytes read from STREAM. The
126 resulting message digest number will be written into the 16 bytes 130 resulting message digest number will be written into the 20 bytes
127 beginning at RESBLOCK. */ 131 beginning at RESBLOCK. */
128int 132int
129sha1_stream (FILE *stream, void *resblock) 133sha1_stream (FILE *stream, void *resblock)
130{ 134{
131 struct sha1_ctx ctx; 135 switch (afalg_stream (stream, "sha1", resblock, SHA1_DIGEST_SIZE))
132 size_t sum; 136 {
137 case 0: return 0;
138 case -EIO: return 1;
139 }
133 140
134 char *buffer = malloc (BLOCKSIZE + 72); 141 char *buffer = malloc (BLOCKSIZE + 72);
135 if (!buffer) 142 if (!buffer)
136 return 1; 143 return 1;
137 144
138 /* Initialize the computation context. */ 145 struct sha1_ctx ctx;
139 sha1_init_ctx (&ctx); 146 sha1_init_ctx (&ctx);
147 size_t sum;
140 148
141 /* Iterate over full file contents. */ 149 /* Iterate over full file contents. */
142 while (1) 150 while (1)
@@ -194,6 +202,7 @@ sha1_stream (FILE *stream, void *resblock)
194 free (buffer); 202 free (buffer);
195 return 0; 203 return 0;
196} 204}
205#endif
197 206
198#if ! HAVE_OPENSSL_SHA1 207#if ! HAVE_OPENSSL_SHA1
199/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The 208/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
diff --git a/lib/sha1.h b/lib/sha1.h
index b1db15da1e7..9419750f485 100644
--- a/lib/sha1.h
+++ b/lib/sha1.h
@@ -87,8 +87,11 @@ extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
87extern void *sha1_buffer (const char *buffer, size_t len, void *resblock); 87extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
88 88
89# endif 89# endif
90/* Compute SHA1 message digest for bytes read from STREAM. The 90/* Compute SHA1 message digest for bytes read from STREAM.
91 resulting message digest number will be written into the 20 bytes 91 STREAM is an open file stream. Regular files are handled more efficiently.
92 The contents of STREAM from its current position to its end will be read.
93 The case that the last operation on STREAM was an 'ungetc' is not supported.
94 The resulting message digest number will be written into the 20 bytes
92 beginning at RESBLOCK. */ 95 beginning at RESBLOCK. */
93extern int sha1_stream (FILE *stream, void *resblock); 96extern int sha1_stream (FILE *stream, void *resblock);
94 97
diff --git a/lib/sha256.c b/lib/sha256.c
index 85405b20fdf..a036befcafd 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -91,17 +91,17 @@ sha224_init_ctx (struct sha256_ctx *ctx)
91 ctx->buflen = 0; 91 ctx->buflen = 0;
92} 92}
93 93
94/* Copy the value from v into the memory location pointed to by *cp, 94/* Copy the value from v into the memory location pointed to by *CP,
95 If your architecture allows unaligned access this is equivalent to 95 If your architecture allows unaligned access, this is equivalent to
96 * (uint32_t *) cp = v */ 96 * (__typeof__ (v) *) cp = v */
97static void 97static void
98set_uint32 (char *cp, uint32_t v) 98set_uint32 (char *cp, uint32_t v)
99{ 99{
100 memcpy (cp, &v, sizeof v); 100 memcpy (cp, &v, sizeof v);
101} 101}
102 102
103/* Put result from CTX in first 32 bytes following RESBUF. The result 103/* Put result from CTX in first 32 bytes following RESBUF.
104 must be in little endian byte order. */ 104 The result must be in little endian byte order. */
105void * 105void *
106sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf) 106sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf)
107{ 107{
@@ -169,21 +169,32 @@ sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
169} 169}
170#endif 170#endif
171 171
172/* Compute SHA256 message digest for bytes read from STREAM. The 172#ifdef GL_COMPILE_CRYPTO_STREAM
173 resulting message digest number will be written into the 32 bytes 173
174 beginning at RESBLOCK. */ 174#include "af_alg.h"
175int 175
176sha256_stream (FILE *stream, void *resblock) 176/* Compute message digest for bytes read from STREAM using algorithm ALG.
177 Write the message digest into RESBLOCK, which contains HASHLEN bytes.
178 The initial and finishing operations are INIT_CTX and FINISH_CTX.
179 Return zero if and only if successful. */
180static int
181shaxxx_stream (FILE *stream, char const *alg, void *resblock,
182 ssize_t hashlen, void (*init_ctx) (struct sha256_ctx *),
183 void *(*finish_ctx) (struct sha256_ctx *, void *))
177{ 184{
178 struct sha256_ctx ctx; 185 switch (afalg_stream (stream, alg, resblock, hashlen))
179 size_t sum; 186 {
187 case 0: return 0;
188 case -EIO: return 1;
189 }
180 190
181 char *buffer = malloc (BLOCKSIZE + 72); 191 char *buffer = malloc (BLOCKSIZE + 72);
182 if (!buffer) 192 if (!buffer)
183 return 1; 193 return 1;
184 194
185 /* Initialize the computation context. */ 195 struct sha256_ctx ctx;
186 sha256_init_ctx (&ctx); 196 init_ctx (&ctx);
197 size_t sum;
187 198
188 /* Iterate over full file contents. */ 199 /* Iterate over full file contents. */
189 while (1) 200 while (1)
@@ -237,84 +248,28 @@ sha256_stream (FILE *stream, void *resblock)
237 sha256_process_bytes (buffer, sum, &ctx); 248 sha256_process_bytes (buffer, sum, &ctx);
238 249
239 /* Construct result in desired memory. */ 250 /* Construct result in desired memory. */
240 sha256_finish_ctx (&ctx, resblock); 251 finish_ctx (&ctx, resblock);
241 free (buffer); 252 free (buffer);
242 return 0; 253 return 0;
243} 254}
244 255
245/* FIXME: Avoid code duplication */
246int 256int
247sha224_stream (FILE *stream, void *resblock) 257sha256_stream (FILE *stream, void *resblock)
248{ 258{
249 struct sha256_ctx ctx; 259 return shaxxx_stream (stream, "sha256", resblock, SHA256_DIGEST_SIZE,
250 size_t sum; 260 sha256_init_ctx, sha256_finish_ctx);
251 261}
252 char *buffer = malloc (BLOCKSIZE + 72);
253 if (!buffer)
254 return 1;
255
256 /* Initialize the computation context. */
257 sha224_init_ctx (&ctx);
258
259 /* Iterate over full file contents. */
260 while (1)
261 {
262 /* We read the file in blocks of BLOCKSIZE bytes. One call of the
263 computation function processes the whole buffer so that with the
264 next round of the loop another block can be read. */
265 size_t n;
266 sum = 0;
267
268 /* Read block. Take care for partial reads. */
269 while (1)
270 {
271 n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
272
273 sum += n;
274
275 if (sum == BLOCKSIZE)
276 break;
277
278 if (n == 0)
279 {
280 /* Check for the error flag IFF N == 0, so that we don't
281 exit the loop after a partial read due to e.g., EAGAIN
282 or EWOULDBLOCK. */
283 if (ferror (stream))
284 {
285 free (buffer);
286 return 1;
287 }
288 goto process_partial_block;
289 }
290
291 /* We've read at least one byte, so ignore errors. But always
292 check for EOF, since feof may be true even though N > 0.
293 Otherwise, we could end up calling fread after EOF. */
294 if (feof (stream))
295 goto process_partial_block;
296 }
297
298 /* Process buffer with BLOCKSIZE bytes. Note that
299 BLOCKSIZE % 64 == 0
300 */
301 sha256_process_block (buffer, BLOCKSIZE, &ctx);
302 }
303
304 process_partial_block:;
305
306 /* Process any remaining bytes. */
307 if (sum > 0)
308 sha256_process_bytes (buffer, sum, &ctx);
309 262
310 /* Construct result in desired memory. */ 263int
311 sha224_finish_ctx (&ctx, resblock); 264sha224_stream (FILE *stream, void *resblock)
312 free (buffer); 265{
313 return 0; 266 return shaxxx_stream (stream, "sha224", resblock, SHA224_DIGEST_SIZE,
267 sha224_init_ctx, sha224_finish_ctx);
314} 268}
269#endif
315 270
316#if ! HAVE_OPENSSL_SHA256 271#if ! HAVE_OPENSSL_SHA256
317/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The 272/* Compute SHA256 message digest for LEN bytes beginning at BUFFER. The
318 result is always in little endian byte order, so that a byte-wise 273 result is always in little endian byte order, so that a byte-wise
319 output yields to the wanted ASCII representation of the message 274 output yields to the wanted ASCII representation of the message
320 digest. */ 275 digest. */
diff --git a/lib/sha256.h b/lib/sha256.h
index e3449864bb6..19ed3ccd4d0 100644
--- a/lib/sha256.h
+++ b/lib/sha256.h
@@ -89,8 +89,11 @@ extern void *sha256_buffer (const char *buffer, size_t len, void *resblock);
89extern void *sha224_buffer (const char *buffer, size_t len, void *resblock); 89extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
90 90
91# endif 91# endif
92/* Compute SHA256 (SHA224) message digest for bytes read from STREAM. The 92/* Compute SHA256 (SHA224) message digest for bytes read from STREAM.
93 resulting message digest number will be written into the 32 (28) bytes 93 STREAM is an open file stream. Regular files are handled more efficiently.
94 The contents of STREAM from its current position to its end will be read.
95 The case that the last operation on STREAM was an 'ungetc' is not supported.
96 The resulting message digest number will be written into the 32 (28) bytes
94 beginning at RESBLOCK. */ 97 beginning at RESBLOCK. */
95extern int sha256_stream (FILE *stream, void *resblock); 98extern int sha256_stream (FILE *stream, void *resblock);
96extern int sha224_stream (FILE *stream, void *resblock); 99extern int sha224_stream (FILE *stream, void *resblock);
diff --git a/lib/sha512.c b/lib/sha512.c
index 8a6dd4e83ac..e175e705f52 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -177,21 +177,32 @@ sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
177} 177}
178#endif 178#endif
179 179
180/* Compute SHA512 message digest for bytes read from STREAM. The 180#ifdef GL_COMPILE_CRYPTO_STREAM
181 resulting message digest number will be written into the 64 bytes 181
182 beginning at RESBLOCK. */ 182#include "af_alg.h"
183int 183
184sha512_stream (FILE *stream, void *resblock) 184/* Compute message digest for bytes read from STREAM using algorithm ALG.
185 Write the message digest into RESBLOCK, which contains HASHLEN bytes.
186 The initial and finishing operations are INIT_CTX and FINISH_CTX.
187 Return zero if and only if successful. */
188static int
189shaxxx_stream (FILE *stream, char const *alg, void *resblock,
190 ssize_t hashlen, void (*init_ctx) (struct sha512_ctx *),
191 void *(*finish_ctx) (struct sha512_ctx *, void *))
185{ 192{
186 struct sha512_ctx ctx; 193 switch (afalg_stream (stream, alg, resblock, hashlen))
187 size_t sum; 194 {
195 case 0: return 0;
196 case -EIO: return 1;
197 }
188 198
189 char *buffer = malloc (BLOCKSIZE + 72); 199 char *buffer = malloc (BLOCKSIZE + 72);
190 if (!buffer) 200 if (!buffer)
191 return 1; 201 return 1;
192 202
193 /* Initialize the computation context. */ 203 struct sha512_ctx ctx;
194 sha512_init_ctx (&ctx); 204 init_ctx (&ctx);
205 size_t sum;
195 206
196 /* Iterate over full file contents. */ 207 /* Iterate over full file contents. */
197 while (1) 208 while (1)
@@ -245,81 +256,25 @@ sha512_stream (FILE *stream, void *resblock)
245 sha512_process_bytes (buffer, sum, &ctx); 256 sha512_process_bytes (buffer, sum, &ctx);
246 257
247 /* Construct result in desired memory. */ 258 /* Construct result in desired memory. */
248 sha512_finish_ctx (&ctx, resblock); 259 finish_ctx (&ctx, resblock);
249 free (buffer); 260 free (buffer);
250 return 0; 261 return 0;
251} 262}
252 263
253/* FIXME: Avoid code duplication */
254int 264int
255sha384_stream (FILE *stream, void *resblock) 265sha512_stream (FILE *stream, void *resblock)
256{ 266{
257 struct sha512_ctx ctx; 267 return shaxxx_stream (stream, "sha512", resblock, SHA512_DIGEST_SIZE,
258 size_t sum; 268 sha512_init_ctx, sha512_finish_ctx);
259 269}
260 char *buffer = malloc (BLOCKSIZE + 72);
261 if (!buffer)
262 return 1;
263
264 /* Initialize the computation context. */
265 sha384_init_ctx (&ctx);
266
267 /* Iterate over full file contents. */
268 while (1)
269 {
270 /* We read the file in blocks of BLOCKSIZE bytes. One call of the
271 computation function processes the whole buffer so that with the
272 next round of the loop another block can be read. */
273 size_t n;
274 sum = 0;
275
276 /* Read block. Take care for partial reads. */
277 while (1)
278 {
279 n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
280
281 sum += n;
282
283 if (sum == BLOCKSIZE)
284 break;
285
286 if (n == 0)
287 {
288 /* Check for the error flag IFF N == 0, so that we don't
289 exit the loop after a partial read due to e.g., EAGAIN
290 or EWOULDBLOCK. */
291 if (ferror (stream))
292 {
293 free (buffer);
294 return 1;
295 }
296 goto process_partial_block;
297 }
298
299 /* We've read at least one byte, so ignore errors. But always
300 check for EOF, since feof may be true even though N > 0.
301 Otherwise, we could end up calling fread after EOF. */
302 if (feof (stream))
303 goto process_partial_block;
304 }
305
306 /* Process buffer with BLOCKSIZE bytes. Note that
307 BLOCKSIZE % 128 == 0
308 */
309 sha512_process_block (buffer, BLOCKSIZE, &ctx);
310 }
311
312 process_partial_block:;
313
314 /* Process any remaining bytes. */
315 if (sum > 0)
316 sha512_process_bytes (buffer, sum, &ctx);
317 270
318 /* Construct result in desired memory. */ 271int
319 sha384_finish_ctx (&ctx, resblock); 272sha384_stream (FILE *stream, void *resblock)
320 free (buffer); 273{
321 return 0; 274 return shaxxx_stream (stream, "sha384", resblock, SHA384_DIGEST_SIZE,
275 sha384_init_ctx, sha384_finish_ctx);
322} 276}
277#endif
323 278
324#if ! HAVE_OPENSSL_SHA512 279#if ! HAVE_OPENSSL_SHA512
325/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The 280/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The
diff --git a/lib/sha512.h b/lib/sha512.h
index 6a0aadba02f..2c39ab195cf 100644
--- a/lib/sha512.h
+++ b/lib/sha512.h
@@ -92,8 +92,11 @@ extern void *sha512_buffer (const char *buffer, size_t len, void *resblock);
92extern void *sha384_buffer (const char *buffer, size_t len, void *resblock); 92extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
93 93
94# endif 94# endif
95/* Compute SHA512 (SHA384) message digest for bytes read from STREAM. The 95/* Compute SHA512 (SHA384) message digest for bytes read from STREAM.
96 resulting message digest number will be written into the 64 (48) bytes 96 STREAM is an open file stream. Regular files are handled more efficiently.
97 The contents of STREAM from its current position to its end will be read.
98 The case that the last operation on STREAM was an 'ungetc' is not supported.
99 The resulting message digest number will be written into the 64 (48) bytes
97 beginning at RESBLOCK. */ 100 beginning at RESBLOCK. */
98extern int sha512_stream (FILE *stream, void *resblock); 101extern int sha512_stream (FILE *stream, void *resblock);
99extern int sha384_stream (FILE *stream, void *resblock); 102extern int sha384_stream (FILE *stream, void *resblock);
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 104f5376682..8e787bd3b2d 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -168,7 +168,7 @@ get_stat_birthtime (struct stat const *st _GL_UNUSED)
168#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 168#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
169 t.tv_sec = st->st_birthtime; 169 t.tv_sec = st->st_birthtime;
170 t.tv_nsec = st->st_birthtimensec; 170 t.tv_nsec = st->st_birthtimensec;
171#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 171#elif defined _WIN32 && ! defined __CYGWIN__
172 /* Native Windows platforms (but not Cygwin) put the "file creation 172 /* Native Windows platforms (but not Cygwin) put the "file creation
173 time" in st_ctime (!). See 173 time" in st_ctime (!). See
174 <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>. */ 174 <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>. */
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 05c5752a243..393ef0cf58d 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -60,25 +60,79 @@
60# define _flags pub._flags 60# define _flags pub._flags
61# define _r pub._r 61# define _r pub._r
62# define _w pub._w 62# define _w pub._w
63# elif defined __ANDROID__ /* Android */
64 /* Up to this commit from 2015-10-12
65 <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>
66 the innards of FILE were public, and fp_ub could be defined like for OpenBSD,
67 see <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/fileext.h>
68 and <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/local.h>.
69 After this commit, the innards of FILE are hidden. */
70# define fp_ ((struct { unsigned char *_p; \
71 int _r; \
72 int _w; \
73 int _flags; \
74 int _file; \
75 struct { unsigned char *_base; size_t _size; } _bf; \
76 int _lbfsize; \
77 void *_cookie; \
78 void *_close; \
79 void *_read; \
80 void *_seek; \
81 void *_write; \
82 struct { unsigned char *_base; size_t _size; } _ext; \
83 unsigned char *_up; \
84 int _ur; \
85 unsigned char _ubuf[3]; \
86 unsigned char _nbuf[1]; \
87 struct { unsigned char *_base; size_t _size; } _lb; \
88 int _blksize; \
89 fpos_t _offset; \
90 /* More fields, not relevant here. */ \
91 } *) fp)
63# else 92# else
64# define fp_ fp 93# define fp_ fp
65# endif 94# endif
66 95
67# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Minix 3, Android */ 96# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix /* NetBSD >= 1.5ZA, OpenBSD, Minix 3 */
68 /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> 97 /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
69 and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */ 98 and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
99 and <https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/lib/libc/stdio/fileext.h> */
70 struct __sfileext 100 struct __sfileext
71 { 101 {
72 struct __sbuf _ub; /* ungetc buffer */ 102 struct __sbuf _ub; /* ungetc buffer */
73 /* More fields, not relevant here. */ 103 /* More fields, not relevant here. */
74 }; 104 };
75# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub 105# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
76# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin, Android */ 106# elif defined __ANDROID__ /* Android */
107 struct __sfileext
108 {
109 struct { unsigned char *_base; size_t _size; } _ub; /* ungetc buffer */
110 /* More fields, not relevant here. */
111 };
112# define fp_ub ((struct __sfileext *) fp_->_ext._base)->_ub
113# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */
77# define fp_ub fp_->_ub 114# define fp_ub fp_->_ub
78# endif 115# endif
79 116
80# define HASUB(fp) (fp_ub._base != NULL) 117# define HASUB(fp) (fp_ub._base != NULL)
81 118
119# if defined __ANDROID__ /* Android */
120 /* Needed after this commit from 2016-01-25
121 <https://android.googlesource.com/platform/bionic.git/+/e70e0e9267d069bf56a5078c99307e08a7280de7> */
122# ifndef __SEOF
123# define __SLBF 1
124# define __SNBF 2
125# define __SRD 4
126# define __SWR 8
127# define __SRW 0x10
128# define __SEOF 0x20
129# define __SERR 0x40
130# endif
131# ifndef __SOFF
132# define __SOFF 0x1000
133# endif
134# endif
135
82#endif 136#endif
83 137
84 138
@@ -118,7 +172,7 @@
118# define _flag __flag 172# define _flag __flag
119# endif 173# endif
120 174
121#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* newer Windows with MSVC */ 175#elif defined _WIN32 && ! defined __CYGWIN__ /* newer Windows with MSVC */
122 176
123/* <stdio.h> does not define the innards of FILE any more. */ 177/* <stdio.h> does not define the innards of FILE any more. */
124# define WINDOWS_OPAQUE_FILE 178# define WINDOWS_OPAQUE_FILE
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index b9a43bb80ca..ff7c9c831ac 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -122,7 +122,7 @@
122 it before we #define perror rpl_perror. */ 122 it before we #define perror rpl_perror. */
123/* But in any case avoid namespace pollution on glibc systems. */ 123/* But in any case avoid namespace pollution on glibc systems. */
124#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \ 124#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
125 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ 125 && (defined _WIN32 && ! defined __CYGWIN__) \
126 && ! defined __GLIBC__ 126 && ! defined __GLIBC__
127# include <stdlib.h> 127# include <stdlib.h>
128#endif 128#endif
@@ -133,7 +133,7 @@
133 it before we #define rename rpl_rename. */ 133 it before we #define rename rpl_rename. */
134/* But in any case avoid namespace pollution on glibc systems. */ 134/* But in any case avoid namespace pollution on glibc systems. */
135#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \ 135#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
136 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ 136 && (defined _WIN32 && ! defined __CYGWIN__) \
137 && ! defined __GLIBC__ 137 && ! defined __GLIBC__
138# include <io.h> 138# include <io.h>
139#endif 139#endif
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index c8a5d0d0c61..3bf35bf6b0f 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -54,7 +54,7 @@
54#endif 54#endif
55 55
56/* Native Windows platforms declare mktemp() in <io.h>. */ 56/* Native Windows platforms declare mktemp() in <io.h>. */
57#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 57#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
58# include <io.h> 58# include <io.h>
59#endif 59#endif
60 60
@@ -90,7 +90,7 @@ struct random_data
90# endif 90# endif
91#endif 91#endif
92 92
93#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 93#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
94/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */ 94/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
95/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */ 95/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
96/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */ 96/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index d96fde1007d..6ae6ac5fbdc 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -57,13 +57,13 @@
57/* Before doing "#define mkdir rpl_mkdir" below, we need to include all 57/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
58 headers that may declare mkdir(). Native Windows platforms declare mkdir 58 headers that may declare mkdir(). Native Windows platforms declare mkdir
59 in <io.h> and/or <direct.h>, not in <unistd.h>. */ 59 in <io.h> and/or <direct.h>, not in <unistd.h>. */
60#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 60#if defined _WIN32 && ! defined __CYGWIN__
61# include <io.h> /* mingw32, mingw64 */ 61# include <io.h> /* mingw32, mingw64 */
62# include <direct.h> /* mingw64, MSVC 9 */ 62# include <direct.h> /* mingw64, MSVC 9 */
63#endif 63#endif
64 64
65/* Native Windows platforms declare umask() in <io.h>. */ 65/* Native Windows platforms declare umask() in <io.h>. */
66#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 66#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
67# include <io.h> 67# include <io.h>
68#endif 68#endif
69 69
@@ -576,7 +576,7 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
576 Additionally, it declares _mkdir (and depending on compile flags, an 576 Additionally, it declares _mkdir (and depending on compile flags, an
577 alias mkdir), only in the nonstandard includes <direct.h> and <io.h>, 577 alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
578 which are included above. */ 578 which are included above. */
579# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 579# if defined _WIN32 && ! defined __CYGWIN__
580 580
581# if !GNULIB_defined_rpl_mkdir 581# if !GNULIB_defined_rpl_mkdir
582static int 582static int
diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
index 747371644df..7f8c1c42117 100644
--- a/lib/sys_types.in.h
+++ b/lib/sys_types.in.h
@@ -20,6 +20,17 @@
20#endif 20#endif
21@PRAGMA_COLUMNS@ 21@PRAGMA_COLUMNS@
22 22
23#if defined _WIN32 && !defined __CYGWIN__ \
24 && (defined __need_off_t || defined __need___off64_t \
25 || defined __need_ssize_t || defined __need_time_t)
26
27/* Special invocation convention inside mingw header files. */
28
29#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
30
31#else
32/* Normal invocation convention. */
33
23#ifndef _@GUARD_PREFIX@_SYS_TYPES_H 34#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
24 35
25/* The include_next requires a split double-inclusion guard. */ 36/* The include_next requires a split double-inclusion guard. */
@@ -86,10 +97,10 @@ typedef unsigned long long int rpl_ino_t;
86 97
87/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */ 98/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
88/* But avoid namespace pollution on glibc systems. */ 99/* But avoid namespace pollution on glibc systems. */
89#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ 100#if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
90 && ! defined __GLIBC__
91# include <stddef.h> 101# include <stddef.h>
92#endif 102#endif
93 103
94#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ 104#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
95#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ 105#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
106#endif /* __need_XXX */
diff --git a/lib/timespec.h b/lib/timespec.h
index eef3030d9c5..94ba8d0b6a0 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -87,7 +87,7 @@ timespec_cmp (struct timespec a, struct timespec b)
87 return 1; 87 return 1;
88 88
89 /* Pacify gcc -Wstrict-overflow (bleeding-edge circa 2017-10-02). See: 89 /* Pacify gcc -Wstrict-overflow (bleeding-edge circa 2017-10-02). See:
90 http://lists.gnu.org/r/bug-gnulib/2017-10/msg00006.html */ 90 https://lists.gnu.org/r/bug-gnulib/2017-10/msg00006.html */
91 assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_RESOLUTION); 91 assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_RESOLUTION);
92 assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_RESOLUTION); 92 assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_RESOLUTION);
93 93
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index beeb8e1d6fd..b6a348f5297 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -61,7 +61,7 @@
61/* But avoid namespace pollution on glibc systems. */ 61/* But avoid namespace pollution on glibc systems. */
62#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \ 62#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
63 || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \ 63 || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
64 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \ 64 && (defined _WIN32 && ! defined __CYGWIN__)) \
65 || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \ 65 || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
66 && defined __CYGWIN__)) \ 66 && defined __CYGWIN__)) \
67 && ! defined __GLIBC__ 67 && ! defined __GLIBC__
@@ -94,13 +94,13 @@
94 lseek(), read(), unlink(), write() in <io.h>. */ 94 lseek(), read(), unlink(), write() in <io.h>. */
95#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \ 95#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
96 || defined GNULIB_POSIXCHECK) \ 96 || defined GNULIB_POSIXCHECK) \
97 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) 97 && (defined _WIN32 && ! defined __CYGWIN__))
98# include <io.h> /* mingw32, mingw64 */ 98# include <io.h> /* mingw32, mingw64 */
99# include <direct.h> /* mingw64, MSVC 9 */ 99# include <direct.h> /* mingw64, MSVC 9 */
100#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \ 100#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
101 || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \ 101 || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
102 || defined GNULIB_POSIXCHECK) \ 102 || defined GNULIB_POSIXCHECK) \
103 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 103 && (defined _WIN32 && ! defined __CYGWIN__)
104# include <io.h> 104# include <io.h>
105#endif 105#endif
106 106
@@ -1489,7 +1489,7 @@ _GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
1489 _GL_ARG_NONNULL ((1))); 1489 _GL_ARG_NONNULL ((1)));
1490_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length)); 1490_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
1491# else 1491# else
1492# if !@HAVE_TRUNCATE@ 1492# if !@HAVE_DECL_TRUNCATE@
1493_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) 1493_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
1494 _GL_ARG_NONNULL ((1))); 1494 _GL_ARG_NONNULL ((1)));
1495# endif 1495# endif
diff --git a/lib/utimens.c b/lib/utimens.c
index c0b0704eb29..e65f55d82fe 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -39,8 +39,7 @@
39 GNU Emacs, which arranges for this in some other way and which 39 GNU Emacs, which arranges for this in some other way and which
40 defines WIN32_LEAN_AND_MEAN itself. */ 40 defines WIN32_LEAN_AND_MEAN itself. */
41 41
42#if ((defined _WIN32 || defined __WIN32__) \ 42#if defined _WIN32 && ! defined __CYGWIN__ && ! defined EMACS_CONFIGURATION
43 && ! defined __CYGWIN__ && ! defined EMACS_CONFIGURATION)
44# define USE_SETFILETIME 43# define USE_SETFILETIME
45# define WIN32_LEAN_AND_MEAN 44# define WIN32_LEAN_AND_MEAN
46# include <windows.h> 45# include <windows.h>
diff --git a/m4/c-strtod.m4 b/m4/c-strtod.m4
index ccff0e6e8a2..9282cee58e9 100644
--- a/m4/c-strtod.m4
+++ b/m4/c-strtod.m4
@@ -1,4 +1,4 @@
1# c-strtod.m4 serial 15 1# c-strtod.m4 serial 16
2 2
3# Copyright (C) 2004-2006, 2009-2018 Free Software Foundation, Inc. 3# Copyright (C) 2004-2006, 2009-2018 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4# This file is free software; the Free Software Foundation
@@ -37,7 +37,34 @@ dnl Prerequisites of lib/c-strtod.c.
37AC_DEFUN([gl_C_STRTOD], 37AC_DEFUN([gl_C_STRTOD],
38[ 38[
39 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 39 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
40 AC_CHECK_FUNCS([strtod_l]) 40
41 AC_CHECK_HEADERS_ONCE([xlocale.h])
42 dnl We can't use AC_CHECK_FUNC here, because strtod_l() is defined as a
43 dnl static inline function when compiling for Android 7.1 or older.
44 AC_CACHE_CHECK([for strtod_l], [gl_cv_func_strtod_l],
45 [AC_LINK_IFELSE(
46 [AC_LANG_PROGRAM(
47 [[#include <stdlib.h>
48 #include <locale.h>
49 #if HAVE_XLOCALE_H
50 # include <xlocale.h>
51 #endif
52 locale_t loc;
53 ]],
54 [[char *end;
55 return strtod_l("0",&end,loc) < 0.0;
56 ]])
57 ],
58 [gl_cv_func_strtod_l=yes],
59 [gl_cv_func_strtod_l=no])
60 ])
61 if test $gl_cv_func_strtod_l = yes; then
62 HAVE_STRTOD_L=1
63 else
64 HAVE_STRTOD_L=0
65 fi
66 AC_DEFINE_UNQUOTED([HAVE_STRTOD_L], [$HAVE_STRTOD_L],
67 [Define to 1 if the system has the 'strtod_l' function.])
41]) 68])
42 69
43dnl Prerequisites of lib/c-strtold.c. 70dnl Prerequisites of lib/c-strtold.c.
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index de65f6b82e8..736e421016c 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
1# gnulib-common.m4 serial 38 1# gnulib-common.m4 serial 39
2dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-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,
@@ -72,6 +72,13 @@ AC_DEFUN([gl_COMMON_BODY], [
72#else 72#else
73# define _GL_ATTRIBUTE_CONST /* empty */ 73# define _GL_ATTRIBUTE_CONST /* empty */
74#endif 74#endif
75
76/* The __malloc__ attribute was added in gcc 3. */
77#if 3 <= __GNUC__
78# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
79#else
80# define _GL_ATTRIBUTE_MALLOC /* empty */
81#endif
75]) 82])
76 dnl Preparation for running test programs: 83 dnl Preparation for running test programs:
77 dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not 84 dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index fc03db2aa86..5c78f5a809c 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -58,10 +58,10 @@ AC_DEFUN([gl_EARLY],
58 # Code from module count-leading-zeros: 58 # Code from module count-leading-zeros:
59 # Code from module count-one-bits: 59 # Code from module count-one-bits:
60 # Code from module count-trailing-zeros: 60 # Code from module count-trailing-zeros:
61 # Code from module crypto/md5: 61 # Code from module crypto/md5-buffer:
62 # Code from module crypto/sha1: 62 # Code from module crypto/sha1-buffer:
63 # Code from module crypto/sha256: 63 # Code from module crypto/sha256-buffer:
64 # Code from module crypto/sha512: 64 # Code from module crypto/sha512-buffer:
65 # Code from module d-type: 65 # Code from module d-type:
66 # Code from module diffseq: 66 # Code from module diffseq:
67 # Code from module dirent: 67 # Code from module dirent:
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
index 8069493cab5..d756f012f6a 100644
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -1,4 +1,4 @@
1# inttypes.m4 serial 26 1# inttypes.m4 serial 27
2dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 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,
@@ -147,6 +147,7 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
147 HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) 147 HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
148 HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) 148 HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
149 HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) 149 HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
150 HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
150 REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX]) 151 REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
151 REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX]) 152 REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
152 INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) 153 INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index ac6f143ce7d..3694e4ceaf7 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,4 +1,4 @@
1# serial 31 1# serial 32
2 2
3# Copyright (C) 1997-2001, 2003-2018 Free Software Foundation, Inc. 3# Copyright (C) 1997-2001, 2003-2018 Free Software Foundation, Inc.
4# 4#
@@ -53,6 +53,9 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
53 [gl_cv_func_lstat_dereferences_slashed_symlink=yes], 53 [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
54 [gl_cv_func_lstat_dereferences_slashed_symlink=no], 54 [gl_cv_func_lstat_dereferences_slashed_symlink=no],
55 [case "$host_os" in 55 [case "$host_os" in
56 linux-* | linux)
57 # Guess yes on Linux systems.
58 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
56 *-gnu* | gnu*) 59 *-gnu* | gnu*)
57 # Guess yes on glibc systems. 60 # Guess yes on glibc systems.
58 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; 61 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
index 87b2d4cbf69..49140074d08 100644
--- a/m4/nocrash.m4
+++ b/m4/nocrash.m4
@@ -1,4 +1,4 @@
1# nocrash.m4 serial 4 1# nocrash.m4 serial 5
2dnl Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 2005, 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,
@@ -79,7 +79,7 @@ nocrash_init (void)
79 } 79 }
80 } 80 }
81} 81}
82#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 82#elif defined _WIN32 && ! defined __CYGWIN__
83/* Avoid a crash on native Windows. */ 83/* Avoid a crash on native Windows. */
84#define WIN32_LEAN_AND_MEAN 84#define WIN32_LEAN_AND_MEAN
85#include <windows.h> 85#include <windows.h>
diff --git a/m4/pselect.m4 b/m4/pselect.m4
index edf4d828209..5cd1e044fc9 100644
--- a/m4/pselect.m4
+++ b/m4/pselect.m4
@@ -1,4 +1,4 @@
1# pselect.m4 serial 6 1# pselect.m4 serial 7
2dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 2011-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,10 +51,12 @@ AC_DEFUN([gl_FUNC_PSELECT],
51 [gl_cv_func_pselect_detects_ebadf=no], 51 [gl_cv_func_pselect_detects_ebadf=no],
52 [ 52 [
53 case "$host_os" in 53 case "$host_os" in
54 # Guess yes on glibc systems. 54 # Guess yes on Linux systems.
55 *-gnu* | gnu*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;; 55 linux-* | linux) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
56 # If we don't know, assume the worst. 56 # Guess yes on glibc systems.
57 *) gl_cv_func_pselect_detects_ebadf="guessing no" ;; 57 *-gnu* | gnu*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
58 # If we don't know, assume the worst.
59 *) gl_cv_func_pselect_detects_ebadf="guessing no" ;;
58 esac 60 esac
59 ]) 61 ])
60 ]) 62 ])
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index 9d73f5cfa18..4d0ab4836b0 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,4 +1,4 @@
1# readlink.m4 serial 13 1# readlink.m4 serial 14
2dnl Copyright (C) 2003, 2007, 2009-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 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,
@@ -34,10 +34,12 @@ AC_DEFUN([gl_FUNC_READLINK],
34 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], 34 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])],
35 [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], 35 [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no],
36 [case "$host_os" in 36 [case "$host_os" in
37 # Guess yes on glibc systems. 37 # Guess yes on Linux systems.
38 *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;; 38 linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
39 # If we don't know, assume the worst. 39 # Guess yes on glibc systems.
40 *) gl_cv_func_readlink_works="guessing no" ;; 40 *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;;
41 # If we don't know, assume the worst.
42 *) gl_cv_func_readlink_works="guessing no" ;;
41 esac 43 esac
42 ]) 44 ])
43 rm -f conftest.link conftest.lnk2]) 45 rm -f conftest.link conftest.lnk2])
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index e06461e6934..0debe69e92d 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
1# stdio_h.m4 serial 48 1# stdio_h.m4 serial 49
2dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-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,
@@ -28,7 +28,7 @@ AC_DEFUN([gl_STDIO_H],
28 /* For non-mingw systems, compilation will trivially succeed. 28 /* For non-mingw systems, compilation will trivially succeed.
29 For mingw, compilation will succeed for older mingw (system 29 For mingw, compilation will succeed for older mingw (system
30 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ 30 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
31 #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ 31 #if (defined _WIN32 && ! defined __CYGWIN__) && \
32 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) 32 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
33 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; 33 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
34 #endif 34 #endif
diff --git a/m4/symlink.m4 b/m4/symlink.m4
index a452f7cc3a8..afaa941744e 100644
--- a/m4/symlink.m4
+++ b/m4/symlink.m4
@@ -1,4 +1,4 @@
1# serial 7 1# serial 8
2# See if we need to provide symlink replacement. 2# See if we need to provide symlink replacement.
3 3
4dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. 4dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
@@ -36,10 +36,12 @@ AC_DEFUN([gl_FUNC_SYMLINK],
36 ]])], 36 ]])],
37 [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no], 37 [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
38 [case "$host_os" in 38 [case "$host_os" in
39 # Guess yes on glibc systems. 39 # Guess yes on Linux systems.
40 *-gnu* | gnu*) gl_cv_func_symlink_works="guessing yes" ;; 40 linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;;
41 # If we don't know, assume the worst. 41 # Guess yes on glibc systems.
42 *) gl_cv_func_symlink_works="guessing no" ;; 42 *-gnu* | gnu*) gl_cv_func_symlink_works="guessing yes" ;;
43 # If we don't know, assume the worst.
44 *) gl_cv_func_symlink_works="guessing no" ;;
43 esac 45 esac
44 ]) 46 ])
45 rm -f conftest.f conftest.link conftest.lnk2]) 47 rm -f conftest.f conftest.link conftest.lnk2])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index b3b71ec2709..159c48aeef1 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
1# unistd_h.m4 serial 71 1# unistd_h.m4 serial 73
2dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. 2dnl Copyright (C) 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,
@@ -37,7 +37,7 @@ AC_DEFUN([gl_UNISTD_H],
37# include <fcntl.h> 37# include <fcntl.h>
38# include <stdio.h> 38# include <stdio.h>
39# include <stdlib.h> 39# include <stdlib.h>
40# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 40# if defined _WIN32 && ! defined __CYGWIN__
41# include <io.h> 41# include <io.h>
42# endif 42# endif
43#endif 43#endif
@@ -140,7 +140,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
140 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) 140 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
141 HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) 141 HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
142 HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) 142 HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
143 HAVE_TRUNCATE=1; AC_SUBST([HAVE_TRUNCATE])
144 HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) 143 HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
145 HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) 144 HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
146 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) 145 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
@@ -152,6 +151,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
152 HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) 151 HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
153 HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) 152 HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
154 HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) 153 HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
154 HAVE_DECL_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE])
155 HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) 155 HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
156 HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) 156 HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
157 HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) 157 HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
diff --git a/m4/utimens.m4 b/m4/utimens.m4
index 16798a0ad1e..9a4db07a3da 100644
--- a/m4/utimens.m4
+++ b/m4/utimens.m4
@@ -3,7 +3,7 @@ dnl This file is free software; the Free Software Foundation
3dnl gives unlimited permission to copy and/or distribute it, 3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved. 4dnl with or without modifications, as long as this notice is preserved.
5 5
6dnl serial 8 6dnl serial 9
7 7
8AC_DEFUN([gl_UTIMENS], 8AC_DEFUN([gl_UTIMENS],
9[ 9[
@@ -31,10 +31,12 @@ AC_DEFUN([gl_UTIMENS],
31 [gl_cv_func_futimesat_works=yes], 31 [gl_cv_func_futimesat_works=yes],
32 [gl_cv_func_futimesat_works=no], 32 [gl_cv_func_futimesat_works=no],
33 [case "$host_os" in 33 [case "$host_os" in
34 # Guess yes on glibc systems. 34 # Guess yes on Linux systems.
35 *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;; 35 linux-* | linux) gl_cv_func_futimesat_works="guessing yes" ;;
36 # If we don't know, assume the worst. 36 # Guess yes on glibc systems.
37 *) gl_cv_func_futimesat_works="guessing no" ;; 37 *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;;
38 # If we don't know, assume the worst.
39 *) gl_cv_func_futimesat_works="guessing no" ;;
38 esac 40 esac
39 ]) 41 ])
40 rm -f conftest.file]) 42 rm -f conftest.file])