gnulib: import gendocs
[deliverable/binutils-gdb.git] / gnulib / configure
CommitLineData
c971b7fa
PA
1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.
d0ac1c44
SM
3# Generated by GNU Autoconf 2.69 for libgnu UNUSED-VERSION.
4#
5#
6# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
c971b7fa 7#
c971b7fa
PA
8#
9# This configure script is free software; the Free Software Foundation
10# gives unlimited permission to copy, distribute and modify it.
11## -------------------- ##
12## M4sh Initialization. ##
13## -------------------- ##
14
15# Be more Bourne compatible
16DUALCASE=1; export DUALCASE # for MKS sh
17if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
18 emulate sh
19 NULLCMD=:
20 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
21 # is contrary to our usage. Disable this feature.
22 alias -g '${1+"$@"}'='"$@"'
23 setopt NO_GLOB_SUBST
24else
25 case `(set -o) 2>/dev/null` in #(
26 *posix*) :
27 set -o posix ;; #(
28 *) :
29 ;;
30esac
31fi
32
33
34as_nl='
35'
36export as_nl
37# Printing a long string crashes Solaris 7 /usr/bin/printf.
38as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
39as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
40as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
41# Prefer a ksh shell builtin over an external printf program on Solaris,
42# but without wasting forks for bash or zsh.
43if test -z "$BASH_VERSION$ZSH_VERSION" \
44 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
45 as_echo='print -r --'
46 as_echo_n='print -rn --'
47elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
48 as_echo='printf %s\n'
49 as_echo_n='printf %s'
50else
51 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
52 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
53 as_echo_n='/usr/ucb/echo -n'
54 else
55 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
56 as_echo_n_body='eval
57 arg=$1;
58 case $arg in #(
59 *"$as_nl"*)
60 expr "X$arg" : "X\\(.*\\)$as_nl";
61 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
62 esac;
63 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
64 '
65 export as_echo_n_body
66 as_echo_n='sh -c $as_echo_n_body as_echo'
67 fi
68 export as_echo_body
69 as_echo='sh -c $as_echo_body as_echo'
70fi
71
72# The user is always right.
73if test "${PATH_SEPARATOR+set}" != set; then
74 PATH_SEPARATOR=:
75 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
76 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
77 PATH_SEPARATOR=';'
78 }
79fi
80
81
82# IFS
83# We need space, tab and new line, in precisely that order. Quoting is
84# there to prevent editors from complaining about space-tab.
85# (If _AS_PATH_WALK were called with IFS unset, it would disable word
86# splitting by setting IFS to empty value.)
87IFS=" "" $as_nl"
88
89# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 90as_myself=
c971b7fa
PA
91case $0 in #((
92 *[\\/]* ) as_myself=$0 ;;
93 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
94for as_dir in $PATH
95do
96 IFS=$as_save_IFS
97 test -z "$as_dir" && as_dir=.
98 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
99 done
100IFS=$as_save_IFS
101
102 ;;
103esac
104# We did not find ourselves, most probably we were run as `sh COMMAND'
105# in which case we are not to be found in the path.
106if test "x$as_myself" = x; then
107 as_myself=$0
108fi
109if test ! -f "$as_myself"; then
110 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
111 exit 1
112fi
113
114# Unset variables that we do not need and which cause bugs (e.g. in
115# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
116# suppresses any "Segmentation fault" message there. '((' could
117# trigger a bug in pdksh 5.2.14.
118for as_var in BASH_ENV ENV MAIL MAILPATH
119do eval test x\${$as_var+set} = xset \
120 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
121done
122PS1='$ '
123PS2='> '
124PS4='+ '
125
126# NLS nuisances.
127LC_ALL=C
128export LC_ALL
129LANGUAGE=C
130export LANGUAGE
131
132# CDPATH.
133(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
134
d0ac1c44
SM
135# Use a proper internal environment variable to ensure we don't fall
136 # into an infinite loop, continuously re-executing ourselves.
137 if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
138 _as_can_reexec=no; export _as_can_reexec;
139 # We cannot yet assume a decent shell, so we have to provide a
140# neutralization value for shells without unset; and this also
141# works around shells that cannot unset nonexistent variables.
142# Preserve -v and -x to the replacement shell.
143BASH_ENV=/dev/null
144ENV=/dev/null
145(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
146case $- in # ((((
147 *v*x* | *x*v* ) as_opts=-vx ;;
148 *v* ) as_opts=-v ;;
149 *x* ) as_opts=-x ;;
150 * ) as_opts= ;;
151esac
152exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
153# Admittedly, this is quite paranoid, since all the known shells bail
154# out after a failed `exec'.
155$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
156as_fn_exit 255
157 fi
158 # We don't want this to propagate to other subprocesses.
159 { _as_can_reexec=; unset _as_can_reexec;}
c971b7fa
PA
160if test "x$CONFIG_SHELL" = x; then
161 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
162 emulate sh
163 NULLCMD=:
164 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
165 # is contrary to our usage. Disable this feature.
166 alias -g '\${1+\"\$@\"}'='\"\$@\"'
167 setopt NO_GLOB_SUBST
168else
169 case \`(set -o) 2>/dev/null\` in #(
170 *posix*) :
171 set -o posix ;; #(
172 *) :
173 ;;
174esac
175fi
176"
177 as_required="as_fn_return () { (exit \$1); }
178as_fn_success () { as_fn_return 0; }
179as_fn_failure () { as_fn_return 1; }
180as_fn_ret_success () { return 0; }
181as_fn_ret_failure () { return 1; }
182
183exitcode=0
184as_fn_success || { exitcode=1; echo as_fn_success failed.; }
185as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
186as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
187as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
188if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
189
190else
191 exitcode=1; echo positional parameters were not saved.
192fi
d0ac1c44
SM
193test x\$exitcode = x0 || exit 1
194test -x / || exit 1"
c971b7fa
PA
195 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
196 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
197 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
198 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
199test \$(( 1 + 1 )) = 2 || exit 1"
200 if (eval "$as_required") 2>/dev/null; then :
201 as_have_required=yes
202else
203 as_have_required=no
204fi
205 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
206
207else
208 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
209as_found=false
210for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
211do
212 IFS=$as_save_IFS
213 test -z "$as_dir" && as_dir=.
214 as_found=:
215 case $as_dir in #(
216 /*)
217 for as_base in sh bash ksh sh5; do
218 # Try only shells that exist, to save several forks.
219 as_shell=$as_dir/$as_base
220 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
221 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
222 CONFIG_SHELL=$as_shell as_have_required=yes
223 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
224 break 2
225fi
226fi
227 done;;
228 esac
229 as_found=false
230done
231$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
232 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
233 CONFIG_SHELL=$SHELL as_have_required=yes
234fi; }
235IFS=$as_save_IFS
236
237
238 if test "x$CONFIG_SHELL" != x; then :
d0ac1c44
SM
239 export CONFIG_SHELL
240 # We cannot yet assume a decent shell, so we have to provide a
241# neutralization value for shells without unset; and this also
242# works around shells that cannot unset nonexistent variables.
243# Preserve -v and -x to the replacement shell.
244BASH_ENV=/dev/null
245ENV=/dev/null
246(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
247case $- in # ((((
248 *v*x* | *x*v* ) as_opts=-vx ;;
249 *v* ) as_opts=-v ;;
250 *x* ) as_opts=-x ;;
251 * ) as_opts= ;;
252esac
253exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
254# Admittedly, this is quite paranoid, since all the known shells bail
255# out after a failed `exec'.
256$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
257exit 255
c971b7fa
PA
258fi
259
260 if test x$as_have_required = xno; then :
261 $as_echo "$0: This script requires a shell more modern than all"
262 $as_echo "$0: the shells that I found on your system."
263 if test x${ZSH_VERSION+set} = xset ; then
264 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
265 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
266 else
267 $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
268$0: including any error possibly output before this
269$0: message. Then install a modern shell, or manually run
270$0: the script under such a shell if you do have one."
271 fi
272 exit 1
273fi
274fi
275fi
276SHELL=${CONFIG_SHELL-/bin/sh}
277export SHELL
278# Unset more variables known to interfere with behavior of common tools.
279CLICOLOR_FORCE= GREP_OPTIONS=
280unset CLICOLOR_FORCE GREP_OPTIONS
281
282## --------------------- ##
283## M4sh Shell Functions. ##
284## --------------------- ##
285# as_fn_unset VAR
286# ---------------
287# Portably unset VAR.
288as_fn_unset ()
289{
290 { eval $1=; unset $1;}
291}
292as_unset=as_fn_unset
293
294# as_fn_set_status STATUS
295# -----------------------
296# Set $? to STATUS, without forking.
297as_fn_set_status ()
298{
299 return $1
300} # as_fn_set_status
301
302# as_fn_exit STATUS
303# -----------------
304# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
305as_fn_exit ()
306{
307 set +e
308 as_fn_set_status $1
309 exit $1
310} # as_fn_exit
311
312# as_fn_mkdir_p
313# -------------
314# Create "$as_dir" as a directory, including parents if necessary.
315as_fn_mkdir_p ()
316{
317
318 case $as_dir in #(
319 -*) as_dir=./$as_dir;;
320 esac
321 test -d "$as_dir" || eval $as_mkdir_p || {
322 as_dirs=
323 while :; do
324 case $as_dir in #(
325 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
326 *) as_qdir=$as_dir;;
327 esac
328 as_dirs="'$as_qdir' $as_dirs"
329 as_dir=`$as_dirname -- "$as_dir" ||
330$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
331 X"$as_dir" : 'X\(//\)[^/]' \| \
332 X"$as_dir" : 'X\(//\)$' \| \
333 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
334$as_echo X"$as_dir" |
335 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
336 s//\1/
337 q
338 }
339 /^X\(\/\/\)[^/].*/{
340 s//\1/
341 q
342 }
343 /^X\(\/\/\)$/{
344 s//\1/
345 q
346 }
347 /^X\(\/\).*/{
348 s//\1/
349 q
350 }
351 s/.*/./; q'`
352 test -d "$as_dir" && break
353 done
354 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 355 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
356
357
358} # as_fn_mkdir_p
d0ac1c44
SM
359
360# as_fn_executable_p FILE
361# -----------------------
362# Test if FILE is an executable regular file.
363as_fn_executable_p ()
364{
365 test -f "$1" && test -x "$1"
366} # as_fn_executable_p
c971b7fa
PA
367# as_fn_append VAR VALUE
368# ----------------------
369# Append the text in VALUE to the end of the definition contained in VAR. Take
370# advantage of any shell optimizations that allow amortized linear growth over
371# repeated appends, instead of the typical quadratic growth present in naive
372# implementations.
373if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
374 eval 'as_fn_append ()
375 {
376 eval $1+=\$2
377 }'
378else
379 as_fn_append ()
380 {
381 eval $1=\$$1\$2
382 }
383fi # as_fn_append
384
385# as_fn_arith ARG...
386# ------------------
387# Perform arithmetic evaluation on the ARGs, and store the result in the
388# global $as_val. Take advantage of shells that can avoid forks. The arguments
389# must be portable across $(()) and expr.
390if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
391 eval 'as_fn_arith ()
392 {
393 as_val=$(( $* ))
394 }'
395else
396 as_fn_arith ()
397 {
398 as_val=`expr "$@" || test $? -eq 1`
399 }
400fi # as_fn_arith
401
402
d0ac1c44
SM
403# as_fn_error STATUS ERROR [LINENO LOG_FD]
404# ----------------------------------------
c971b7fa
PA
405# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
406# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 407# script with STATUS, using 1 if that was 0.
c971b7fa
PA
408as_fn_error ()
409{
d0ac1c44
SM
410 as_status=$1; test $as_status -eq 0 && as_status=1
411 if test "$4"; then
412 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
413 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 414 fi
d0ac1c44 415 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
416 as_fn_exit $as_status
417} # as_fn_error
418
419if expr a : '\(a\)' >/dev/null 2>&1 &&
420 test "X`expr 00001 : '.*\(...\)'`" = X001; then
421 as_expr=expr
422else
423 as_expr=false
424fi
425
426if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
427 as_basename=basename
428else
429 as_basename=false
430fi
431
432if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
433 as_dirname=dirname
434else
435 as_dirname=false
436fi
437
438as_me=`$as_basename -- "$0" ||
439$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
440 X"$0" : 'X\(//\)$' \| \
441 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
442$as_echo X/"$0" |
443 sed '/^.*\/\([^/][^/]*\)\/*$/{
444 s//\1/
445 q
446 }
447 /^X\/\(\/\/\)$/{
448 s//\1/
449 q
450 }
451 /^X\/\(\/\).*/{
452 s//\1/
453 q
454 }
455 s/.*/./; q'`
456
457# Avoid depending upon Character Ranges.
458as_cr_letters='abcdefghijklmnopqrstuvwxyz'
459as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
460as_cr_Letters=$as_cr_letters$as_cr_LETTERS
461as_cr_digits='0123456789'
462as_cr_alnum=$as_cr_Letters$as_cr_digits
463
464
465 as_lineno_1=$LINENO as_lineno_1a=$LINENO
466 as_lineno_2=$LINENO as_lineno_2a=$LINENO
467 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
468 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
469 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
470 sed -n '
471 p
472 /[$]LINENO/=
473 ' <$as_myself |
474 sed '
475 s/[$]LINENO.*/&-/
476 t lineno
477 b
478 :lineno
479 N
480 :loop
481 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
482 t loop
483 s/-\n.*//
484 ' >$as_me.lineno &&
485 chmod +x "$as_me.lineno" ||
486 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
487
d0ac1c44
SM
488 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
489 # already done that, so ensure we don't try to do so again and fall
490 # in an infinite loop. This has already happened in practice.
491 _as_can_reexec=no; export _as_can_reexec
c971b7fa
PA
492 # Don't try to exec as it changes $[0], causing all sort of problems
493 # (the dirname of $[0] is not the place where we might find the
494 # original and so on. Autoconf is especially sensitive to this).
495 . "./$as_me.lineno"
496 # Exit status is that of the last command.
497 exit
498}
499
500ECHO_C= ECHO_N= ECHO_T=
501case `echo -n x` in #(((((
502-n*)
503 case `echo 'xy\c'` in
504 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
505 xy) ECHO_C='\c';;
506 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
507 ECHO_T=' ';;
508 esac;;
509*)
510 ECHO_N='-n';;
511esac
512
513rm -f conf$$ conf$$.exe conf$$.file
514if test -d conf$$.dir; then
515 rm -f conf$$.dir/conf$$.file
516else
517 rm -f conf$$.dir
518 mkdir conf$$.dir 2>/dev/null
519fi
520if (echo >conf$$.file) 2>/dev/null; then
521 if ln -s conf$$.file conf$$ 2>/dev/null; then
522 as_ln_s='ln -s'
523 # ... but there are two gotchas:
524 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
525 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 526 # In both cases, we have to default to `cp -pR'.
c971b7fa 527 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 528 as_ln_s='cp -pR'
c971b7fa
PA
529 elif ln conf$$.file conf$$ 2>/dev/null; then
530 as_ln_s=ln
531 else
d0ac1c44 532 as_ln_s='cp -pR'
c971b7fa
PA
533 fi
534else
d0ac1c44 535 as_ln_s='cp -pR'
c971b7fa
PA
536fi
537rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
538rmdir conf$$.dir 2>/dev/null
539
540if mkdir -p . 2>/dev/null; then
541 as_mkdir_p='mkdir -p "$as_dir"'
542else
543 test -d ./-p && rmdir ./-p
544 as_mkdir_p=false
545fi
546
d0ac1c44
SM
547as_test_x='test -x'
548as_executable_p=as_fn_executable_p
c971b7fa
PA
549
550# Sed expression to map a string onto a valid CPP name.
551as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
552
553# Sed expression to map a string onto a valid variable name.
554as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
555
556
d0ac1c44
SM
557test -n "$DJDIR" || exec 7<&0 </dev/null
558exec 6>&1
c971b7fa
PA
559
560# Name of the host.
d0ac1c44 561# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
c971b7fa
PA
562# so uname gets run too.
563ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
564
565#
566# Initializations.
567#
568ac_default_prefix=/usr/local
569ac_clean_files=
570ac_config_libobj_dir=.
571LIBOBJS=
572cross_compiling=no
573subdirs=
574MFLAGS=
575MAKEFLAGS=
576
577# Identity of this package.
d0ac1c44
SM
578PACKAGE_NAME='libgnu'
579PACKAGE_TARNAME='libgnu'
580PACKAGE_VERSION='UNUSED-VERSION'
581PACKAGE_STRING='libgnu UNUSED-VERSION'
582PACKAGE_BUGREPORT=''
583PACKAGE_URL=''
c971b7fa 584
8690e634 585ac_unique_file="import/memmem.c"
9c9d63b1 586ac_header_list=
c971b7fa
PA
587# Factoring default headers for most tests.
588ac_includes_default="\
589#include <stdio.h>
590#ifdef HAVE_SYS_TYPES_H
591# include <sys/types.h>
592#endif
593#ifdef HAVE_SYS_STAT_H
594# include <sys/stat.h>
595#endif
596#ifdef STDC_HEADERS
597# include <stdlib.h>
598# include <stddef.h>
599#else
600# ifdef HAVE_STDLIB_H
601# include <stdlib.h>
602# endif
603#endif
604#ifdef HAVE_STRING_H
605# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
606# include <memory.h>
607# endif
608# include <string.h>
609#endif
610#ifdef HAVE_STRINGS_H
611# include <strings.h>
612#endif
613#ifdef HAVE_INTTYPES_H
614# include <inttypes.h>
615#endif
616#ifdef HAVE_STDINT_H
617# include <stdint.h>
618#endif
619#ifdef HAVE_UNISTD_H
620# include <unistd.h>
621#endif"
622
5abebf3c 623gl_use_threads_default=
c0c3707f 624gl_use_winpthreads_default=
c0c3707f 625ac_func_list=
8690e634 626gl_fnmatch_required=POSIX
c971b7fa
PA
627ac_subst_vars='am__EXEEXT_FALSE
628am__EXEEXT_TRUE
629gltests_LTLIBOBJS
630gltests_LIBOBJS
631gl_LTLIBOBJS
632gl_LIBOBJS
633LTLIBOBJS
634LIBOBJS
635LN_S
39be3c7e
SM
636AM_BACKSLASH
637AM_DEFAULT_VERBOSITY
d0ac1c44
SM
638AM_DEFAULT_V
639AM_V
c971b7fa
PA
640am__fastdepCC_FALSE
641am__fastdepCC_TRUE
642CCDEPMODE
d0ac1c44 643am__nodep
c971b7fa
PA
644AMDEPBACKSLASH
645AMDEP_FALSE
646AMDEP_TRUE
647am__quote
648am__include
649DEPDIR
650am__untar
651am__tar
652AMTAR
653am__leading_dot
654SET_MAKE
655AWK
656mkdir_p
c971b7fa
PA
657INSTALL_STRIP_PROGRAM
658STRIP
659install_sh
660MAKEINFO
661AUTOHEADER
662AUTOMAKE
663AUTOCONF
664ACLOCAL
665VERSION
666PACKAGE
667CYGPATH_W
668am__isrc
669INSTALL_DATA
670INSTALL_SCRIPT
671INSTALL_PROGRAM
672LIBGNU_LTLIBDEPS
673LIBGNU_LIBDEPS
674gltests_WITNESS
8690e634
JK
675REPLACE_TOWLOWER
676REPLACE_ISWCNTRL
677HAVE_WCTYPE_H
678NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
679NEXT_WCTYPE_H
680HAVE_ISWCNTRL
5df4cba6
SM
681REPLACE_ISWXDIGIT
682REPLACE_ISWDIGIT
8690e634
JK
683REPLACE_ISWBLANK
684HAVE_WCTRANS_T
685HAVE_WCTYPE_T
686HAVE_ISWBLANK
687GNULIB_TOWCTRANS
688GNULIB_WCTRANS
689GNULIB_ISWCTYPE
690GNULIB_WCTYPE
5df4cba6
SM
691GNULIB_ISWXDIGIT
692GNULIB_ISWDIGIT
8690e634 693GNULIB_ISWBLANK
c0c3707f 694HAVE_CRTDEFS_H
8690e634 695HAVE_WINT_T
8690e634
JK
696NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
697NEXT_WCHAR_H
8839a007
PA
698HAVE_UNISTD_H
699NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
700NEXT_UNISTD_H
9c9d63b1 701TIME_H_DEFINES_TIME_UTC
4a626d0a 702UNISTD_H_DEFINES_STRUCT_TIMESPEC
09607c9e
TT
703PTHREAD_H_DEFINES_STRUCT_TIMESPEC
704SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
705TIME_H_DEFINES_STRUCT_TIMESPEC
706NEXT_AS_FIRST_DIRECTIVE_TIME_H
707NEXT_TIME_H
9c9d63b1
PM
708REPLACE_LOCALTIME
709REPLACE_GMTIME
710REPLACE_TZSET
711REPLACE_TIMEGM
712REPLACE_STRFTIME
713REPLACE_NANOSLEEP
714REPLACE_MKTIME
715REPLACE_LOCALTIME_R
716REPLACE_CTIME
717HAVE_TIMEZONE_T
718HAVE_TIMESPEC_GET
719HAVE_TIMEGM
720HAVE_STRPTIME
721HAVE_NANOSLEEP
722HAVE_DECL_LOCALTIME_R
723GNULIB_MDA_TZSET
724GNULIB_TZSET
725GNULIB_TIME_RZ
726GNULIB_TIME_R
727GNULIB_TIMESPEC_GET
728GNULIB_TIMEGM
729GNULIB_STRPTIME
730GNULIB_STRFTIME
731GNULIB_NANOSLEEP
732GNULIB_LOCALTIME
733GNULIB_MKTIME
734GNULIB_CTIME
725e2999
JB
735HAVE_SYS_UIO_H
736NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
737NEXT_SYS_UIO_H
c0c3707f 738WINDOWS_STAT_INODES
63ce7108
TT
739WINDOWS_64_BIT_OFF_T
740NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
741NEXT_SYS_TYPES_H
698be2d8
CB
742HAVE_SYS_RANDOM_H
743NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H
744NEXT_SYS_RANDOM_H
2196f55f
YQ
745NEXT_AS_FIRST_DIRECTIVE_STRING_H
746NEXT_STRING_H
98399780
YQ
747NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
748NEXT_STDLIB_H
6a29c58e
YQ
749NEXT_AS_FIRST_DIRECTIVE_STDIO_H
750NEXT_STDIO_H
2196f55f
YQ
751HAVE__BOOL
752GL_GENERATE_STDBOOL_H_FALSE
753GL_GENERATE_STDBOOL_H_TRUE
754STDBOOL_H
725e2999
JB
755GL_GENERATE_STDALIGN_H_FALSE
756GL_GENERATE_STDALIGN_H_TRUE
757STDALIGN_H
0750520d
PA
758NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
759NEXT_SIGNAL_H
760REPLACE_RAISE
761REPLACE_PTHREAD_SIGMASK
762HAVE_SIGHANDLER_T
763HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
764HAVE_STRUCT_SIGACTION_SA_SIGACTION
765HAVE_SIGACTION
766HAVE_SIGINFO_T
767HAVE_SIGSET_T
768HAVE_RAISE
769HAVE_PTHREAD_SIGMASK
770HAVE_POSIX_SIGNALBLOCKING
771GNULIB_SIGACTION
772GNULIB_SIGPROCMASK
773GNULIB_SIGNAL_H_SIGPIPE
774GNULIB_RAISE
775GNULIB_PTHREAD_SIGMASK
725e2999
JB
776GL_GENERATE_NETINET_IN_H_FALSE
777GL_GENERATE_NETINET_IN_H_TRUE
778NETINET_IN_H
779HAVE_NETINET_IN_H
780NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
781NEXT_NETINET_IN_H
c971b7fa 782UNDEFINE_STRTOK_R
c971b7fa 783REPLACE_STRSIGNAL
9c9d63b1 784REPLACE_STRERRORNAME_NP
c971b7fa
PA
785REPLACE_STRERROR_R
786REPLACE_STRERROR
c0c3707f 787REPLACE_STRTOK_R
c971b7fa
PA
788REPLACE_STRCASESTR
789REPLACE_STRSTR
c0c3707f
CB
790REPLACE_STRNLEN
791REPLACE_STRNDUP
792REPLACE_STRNCAT
c971b7fa 793REPLACE_STRDUP
c0c3707f 794REPLACE_STRCHRNUL
c971b7fa
PA
795REPLACE_STPNCPY
796REPLACE_MEMMEM
797REPLACE_MEMCHR
9c9d63b1 798REPLACE_FFSLL
c971b7fa
PA
799HAVE_STRVERSCMP
800HAVE_DECL_STRSIGNAL
9c9d63b1
PM
801HAVE_SIGDESCR_NP
802HAVE_SIGABBREV_NP
803HAVE_STRERRORNAME_NP
c971b7fa
PA
804HAVE_DECL_STRERROR_R
805HAVE_DECL_STRTOK_R
806HAVE_STRCASESTR
807HAVE_STRSEP
808HAVE_STRPBRK
809HAVE_DECL_STRNLEN
810HAVE_DECL_STRNDUP
811HAVE_DECL_STRDUP
812HAVE_STRCHRNUL
813HAVE_STPNCPY
814HAVE_STPCPY
815HAVE_RAWMEMCHR
816HAVE_DECL_MEMRCHR
817HAVE_MEMPCPY
818HAVE_DECL_MEMMEM
c971b7fa
PA
819HAVE_FFSLL
820HAVE_FFSL
c0c3707f 821HAVE_EXPLICIT_BZERO
9c9d63b1
PM
822GNULIB_MDA_STRDUP
823GNULIB_MDA_MEMCCPY
c971b7fa
PA
824HAVE_MBSLEN
825GNULIB_STRVERSCMP
826GNULIB_STRSIGNAL
9c9d63b1
PM
827GNULIB_SIGDESCR_NP
828GNULIB_SIGABBREV_NP
829GNULIB_STRERRORNAME_NP
c971b7fa
PA
830GNULIB_STRERROR_R
831GNULIB_STRERROR
832GNULIB_MBSTOK_R
833GNULIB_MBSSEP
834GNULIB_MBSSPN
835GNULIB_MBSPBRK
836GNULIB_MBSCSPN
837GNULIB_MBSCASESTR
838GNULIB_MBSPCASECMP
839GNULIB_MBSNCASECMP
840GNULIB_MBSCASECMP
841GNULIB_MBSSTR
842GNULIB_MBSRCHR
843GNULIB_MBSCHR
844GNULIB_MBSNLEN
845GNULIB_MBSLEN
846GNULIB_STRTOK_R
847GNULIB_STRCASESTR
848GNULIB_STRSTR
849GNULIB_STRSEP
850GNULIB_STRPBRK
851GNULIB_STRNLEN
852GNULIB_STRNDUP
853GNULIB_STRNCAT
854GNULIB_STRDUP
855GNULIB_STRCHRNUL
856GNULIB_STPNCPY
857GNULIB_STPCPY
858GNULIB_RAWMEMCHR
859GNULIB_MEMRCHR
860GNULIB_MEMPCPY
861GNULIB_MEMMEM
862GNULIB_MEMCHR
863GNULIB_FFSLL
864GNULIB_FFSL
c0c3707f 865GNULIB_EXPLICIT_BZERO
5df4cba6
SM
866HAVE_VISIBILITY
867CFLAG_VISIBILITY
868LIB_MBRTOWC
8690e634 869LOCALE_ZH_CN
c0c3707f 870LOCALE_FR_UTF8
8690e634 871LOCALE_JA
88b48903
WN
872NEXT_AS_FIRST_DIRECTIVE_MATH_H
873NEXT_MATH_H
5abebf3c
CB
874LTLIBMULTITHREAD
875LIBMULTITHREAD
876LTLIBTHREAD
877LIBTHREAD
5df4cba6
SM
878LIBSTDTHREAD
879NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
880NEXT_LOCALE_H
881HAVE_XLOCALE_H
882NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
883NEXT_STDDEF_H
884GL_GENERATE_STDDEF_H_FALSE
885GL_GENERATE_STDDEF_H_TRUE
886STDDEF_H
887HAVE_WCHAR_T
888HAVE_MAX_ALIGN_T
889REPLACE_NULL
890REPLACE_STRUCT_LCONV
891REPLACE_FREELOCALE
892REPLACE_DUPLOCALE
893REPLACE_NEWLOCALE
894REPLACE_SETLOCALE
895REPLACE_LOCALECONV
896HAVE_FREELOCALE
897HAVE_DUPLOCALE
898HAVE_NEWLOCALE
899GNULIB_LOCALENAME
900GNULIB_DUPLOCALE
901GNULIB_SETLOCALE_NULL
902GNULIB_SETLOCALE
903GNULIB_LOCALECONV
8690e634 904LOCALCHARSET_TESTS_ENVIRONMENT
c971b7fa
PA
905NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
906NEXT_INTTYPES_H
907UINT64_MAX_EQ_ULONG_MAX
908UINT32_MAX_LT_UINTMAX_MAX
909PRIPTR_PREFIX
c971b7fa
PA
910INT64_MAX_EQ_LONG_MAX
911INT32_MAX_LT_INTMAX_MAX
4a626d0a 912REPLACE_STRTOUMAX
c971b7fa 913REPLACE_STRTOIMAX
c0c3707f 914HAVE_IMAXDIV_T
c971b7fa
PA
915HAVE_DECL_STRTOUMAX
916HAVE_DECL_STRTOIMAX
917HAVE_DECL_IMAXDIV
918HAVE_DECL_IMAXABS
919GNULIB_STRTOUMAX
920GNULIB_STRTOIMAX
921GNULIB_IMAXDIV
922GNULIB_IMAXABS
923GL_GENERATE_STDINT_H_FALSE
924GL_GENERATE_STDINT_H_TRUE
925STDINT_H
49e4877c
PA
926HAVE_SYS_INTTYPES_H
927HAVE_SYS_BITYPES_H
928HAVE_C99_STDINT_H
c971b7fa
PA
929WINT_T_SUFFIX
930WCHAR_T_SUFFIX
931SIG_ATOMIC_T_SUFFIX
932SIZE_T_SUFFIX
933PTRDIFF_T_SUFFIX
934HAVE_SIGNED_WINT_T
935HAVE_SIGNED_WCHAR_T
936HAVE_SIGNED_SIG_ATOMIC_T
937BITSIZEOF_WINT_T
938BITSIZEOF_WCHAR_T
939BITSIZEOF_SIG_ATOMIC_T
940BITSIZEOF_SIZE_T
941BITSIZEOF_PTRDIFF_T
942APPLE_UNIVERSAL_BUILD
c971b7fa
PA
943HAVE_STDINT_H
944NEXT_AS_FIRST_DIRECTIVE_STDINT_H
945NEXT_STDINT_H
c971b7fa
PA
946HAVE_SYS_TYPES_H
947HAVE_INTTYPES_H
948HAVE_WCHAR_H
c0c3707f 949GNULIB_OVERRIDES_WINT_T
49e4877c
PA
950GL_GENERATE_LIMITS_H_FALSE
951GL_GENERATE_LIMITS_H_TRUE
952LIMITS_H
953NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
954NEXT_LIMITS_H
725e2999
JB
955HAVE_SYS_SOCKET_H
956NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
957NEXT_SYS_SOCKET_H
958HAVE_ACCEPT4
959HAVE_SA_FAMILY_T
960HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
961HAVE_STRUCT_SOCKADDR_STORAGE
962GNULIB_ACCEPT4
963GNULIB_SHUTDOWN
964GNULIB_SETSOCKOPT
965GNULIB_SENDTO
966GNULIB_RECVFROM
967GNULIB_SEND
968GNULIB_RECV
969GNULIB_LISTEN
970GNULIB_GETSOCKOPT
971GNULIB_GETSOCKNAME
972GNULIB_GETPEERNAME
973GNULIB_BIND
974GNULIB_ACCEPT
975GNULIB_CONNECT
976GNULIB_SOCKET
977INET_NTOP_LIB
5df4cba6
SM
978LIB_HARD_LOCALE
979LIB_SETLOCALE_NULL
980LIB_SCHED_YIELD
981LIBPMULTITHREAD
982LIBPTHREAD
6ec2e0f5
SDJ
983GL_GENERATE_GLOB_H_FALSE
984GL_GENERATE_GLOB_H_TRUE
985GLOB_H
c0c3707f
CB
986HAVE_GLOB_H
987NEXT_AS_FIRST_DIRECTIVE_GLOB_H
988NEXT_GLOB_H
989REPLACE_GLOB_PATTERN_P
990REPLACE_GLOB
991HAVE_GLOB_PATTERN_P
992HAVE_GLOB
993GNULIB_GLOB
4a626d0a
PA
994NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
995NEXT_SYS_TIME_H
996REPLACE_STRUCT_TIMEVAL
997REPLACE_GETTIMEOFDAY
4a626d0a
PA
998HAVE_SYS_TIME_H
999HAVE_STRUCT_TIMEVAL
1000HAVE_GETTIMEOFDAY
1001GNULIB_GETTIMEOFDAY
6ec2e0f5
SDJ
1002LTLIBINTL
1003LIBINTL
698be2d8
CB
1004LIB_GETRANDOM
1005REPLACE_GETRANDOM
1006HAVE_GETRANDOM
1007GNULIB_GETRANDOM
c0c3707f 1008LIB_GETLOGIN
c17253b9
MF
1009REPLACE_VSPRINTF
1010REPLACE_VSNPRINTF
1011REPLACE_VPRINTF
1012REPLACE_VFPRINTF
1013REPLACE_VDPRINTF
1014REPLACE_VASPRINTF
1015REPLACE_TMPFILE
1016REPLACE_STDIO_WRITE_FUNCS
1017REPLACE_STDIO_READ_FUNCS
1018REPLACE_SPRINTF
1019REPLACE_SNPRINTF
1020REPLACE_RENAMEAT
1021REPLACE_RENAME
1022REPLACE_REMOVE
1023REPLACE_PRINTF
1024REPLACE_POPEN
1025REPLACE_PERROR
1026REPLACE_OBSTACK_PRINTF
1027REPLACE_GETLINE
1028REPLACE_GETDELIM
1029REPLACE_FTELLO
1030REPLACE_FTELL
1031REPLACE_FSEEKO
1032REPLACE_FSEEK
1033REPLACE_FREOPEN
1034REPLACE_FPURGE
1035REPLACE_FPRINTF
1036REPLACE_FOPEN
1037REPLACE_FFLUSH
1038REPLACE_FDOPEN
1039REPLACE_FCLOSE
1040REPLACE_DPRINTF
1041HAVE_VDPRINTF
1042HAVE_VASPRINTF
1043HAVE_RENAMEAT
1044HAVE_POPEN
1045HAVE_PCLOSE
1046HAVE_FTELLO
1047HAVE_FSEEKO
1048HAVE_DPRINTF
1049HAVE_DECL_VSNPRINTF
1050HAVE_DECL_SNPRINTF
1051HAVE_DECL_OBSTACK_PRINTF
1052HAVE_DECL_GETLINE
1053HAVE_DECL_GETDELIM
1054HAVE_DECL_FTELLO
1055HAVE_DECL_FSEEKO
1056HAVE_DECL_FPURGE
1057HAVE_DECL_FCLOSEALL
1058GNULIB_MDA_TEMPNAM
1059GNULIB_MDA_PUTW
1060GNULIB_MDA_GETW
1061GNULIB_MDA_FILENO
1062GNULIB_MDA_FDOPEN
1063GNULIB_MDA_FCLOSEALL
1064GNULIB_VSPRINTF_POSIX
1065GNULIB_VSNPRINTF
1066GNULIB_VPRINTF_POSIX
1067GNULIB_VPRINTF
1068GNULIB_VFPRINTF_POSIX
1069GNULIB_VFPRINTF
1070GNULIB_VDPRINTF
1071GNULIB_VSCANF
1072GNULIB_VFSCANF
1073GNULIB_VASPRINTF
1074GNULIB_TMPFILE
1075GNULIB_STDIO_H_SIGPIPE
1076GNULIB_STDIO_H_NONBLOCKING
1077GNULIB_SPRINTF_POSIX
1078GNULIB_SNPRINTF
1079GNULIB_SCANF
1080GNULIB_RENAMEAT
1081GNULIB_RENAME
1082GNULIB_REMOVE
1083GNULIB_PUTS
1084GNULIB_PUTCHAR
1085GNULIB_PUTC
1086GNULIB_PRINTF_POSIX
1087GNULIB_PRINTF
1088GNULIB_POPEN
1089GNULIB_PERROR
1090GNULIB_PCLOSE
1091GNULIB_OBSTACK_PRINTF_POSIX
1092GNULIB_OBSTACK_PRINTF
1093GNULIB_GETLINE
1094GNULIB_GETDELIM
1095GNULIB_GETCHAR
1096GNULIB_GETC
1097GNULIB_FWRITE
1098GNULIB_FTELLO
1099GNULIB_FTELL
1100GNULIB_FSEEKO
1101GNULIB_FSEEK
1102GNULIB_FSCANF
1103GNULIB_FREOPEN
1104GNULIB_FREAD
1105GNULIB_FPUTS
1106GNULIB_FPUTC
1107GNULIB_FPURGE
1108GNULIB_FPRINTF_POSIX
1109GNULIB_FPRINTF
1110GNULIB_FOPEN
1111GNULIB_FGETS
1112GNULIB_FGETC
1113GNULIB_FFLUSH
1114GNULIB_FDOPEN
1115GNULIB_FCLOSE
1116GNULIB_DPRINTF
6ec2e0f5 1117WINDOWS_64_BIT_ST_SIZE
c0c3707f 1118WINDOWS_STAT_TIMESPEC
6ec2e0f5
SDJ
1119NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
1120NEXT_SYS_STAT_H
1121REPLACE_UTIMENSAT
1122REPLACE_STAT
9c9d63b1 1123REPLACE_MKNODAT
6ec2e0f5 1124REPLACE_MKNOD
9c9d63b1 1125REPLACE_MKFIFOAT
6ec2e0f5
SDJ
1126REPLACE_MKFIFO
1127REPLACE_MKDIR
1128REPLACE_LSTAT
1129REPLACE_FUTIMENS
1130REPLACE_FSTATAT
1131REPLACE_FSTAT
5df4cba6 1132REPLACE_FCHMODAT
6ec2e0f5
SDJ
1133HAVE_UTIMENSAT
1134HAVE_MKNODAT
1135HAVE_MKNOD
1136HAVE_MKFIFOAT
1137HAVE_MKFIFO
1138HAVE_MKDIRAT
1139HAVE_LSTAT
1140HAVE_LCHMOD
9c9d63b1 1141HAVE_GETUMASK
6ec2e0f5
SDJ
1142HAVE_FUTIMENS
1143HAVE_FSTATAT
1144HAVE_FCHMODAT
9c9d63b1
PM
1145GNULIB_MDA_UMASK
1146GNULIB_MDA_MKDIR
1147GNULIB_MDA_CHMOD
c0c3707f 1148GNULIB_OVERRIDES_STRUCT_STAT
6ec2e0f5
SDJ
1149GNULIB_UTIMENSAT
1150GNULIB_STAT
1151GNULIB_MKNODAT
1152GNULIB_MKNOD
1153GNULIB_MKFIFOAT
1154GNULIB_MKFIFO
1155GNULIB_MKDIRAT
9c9d63b1 1156GNULIB_MKDIR
6ec2e0f5
SDJ
1157GNULIB_LSTAT
1158GNULIB_LCHMOD
9c9d63b1 1159GNULIB_GETUMASK
6ec2e0f5
SDJ
1160GNULIB_FUTIMENS
1161GNULIB_FSTATAT
1162GNULIB_FSTAT
1163GNULIB_FCHMODAT
88b48903
WN
1164FREXPL_LIBM
1165HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
1166FREXP_LIBM
1167REPLACE_TRUNCL
1168REPLACE_TRUNCF
1169REPLACE_TRUNC
c0c3707f
CB
1170REPLACE_TANHF
1171REPLACE_TANF
88b48903 1172REPLACE_SQRTL
c0c3707f
CB
1173REPLACE_SQRTF
1174REPLACE_SINHF
1175REPLACE_SINF
9c9d63b1 1176REPLACE_SIGNBIT_USING_BUILTINS
88b48903
WN
1177REPLACE_SIGNBIT
1178REPLACE_ROUNDL
1179REPLACE_ROUNDF
1180REPLACE_ROUND
c0c3707f 1181REPLACE_RINTL
88b48903
WN
1182REPLACE_REMAINDERL
1183REPLACE_REMAINDERF
1184REPLACE_REMAINDER
1185REPLACE_NAN
1186REPLACE_MODFL
1187REPLACE_MODFF
1188REPLACE_MODF
1189REPLACE_LOGBL
1190REPLACE_LOGBF
1191REPLACE_LOGB
1192REPLACE_LOG2L
1193REPLACE_LOG2F
1194REPLACE_LOG2
1195REPLACE_LOG1PL
1196REPLACE_LOG1PF
1197REPLACE_LOG1P
1198REPLACE_LOG10L
1199REPLACE_LOG10F
1200REPLACE_LOG10
1201REPLACE_LOGL
1202REPLACE_LOGF
1203REPLACE_LOG
1204REPLACE_LDEXPL
1205REPLACE_ISNAN
1206REPLACE_ISINF
1207REPLACE_ISFINITE
c0c3707f 1208REPLACE_ILOGBL
88b48903
WN
1209REPLACE_ILOGBF
1210REPLACE_ILOGB
1211REPLACE_HYPOTL
1212REPLACE_HYPOTF
1213REPLACE_HYPOT
1214REPLACE_HUGE_VAL
1215REPLACE_FREXPL
1216REPLACE_FREXP
1217REPLACE_FREXPF
1218REPLACE_FMODL
1219REPLACE_FMODF
1220REPLACE_FMOD
1221REPLACE_FMAL
1222REPLACE_FMAF
1223REPLACE_FMA
1224REPLACE_FLOORL
1225REPLACE_FLOORF
1226REPLACE_FLOOR
1227REPLACE_FABSL
1228REPLACE_EXP2L
1229REPLACE_EXP2
c0c3707f 1230REPLACE_EXPM1L
88b48903
WN
1231REPLACE_EXPM1F
1232REPLACE_EXPM1
c0c3707f
CB
1233REPLACE_EXPL
1234REPLACE_EXPF
1235REPLACE_COSHF
1236REPLACE_COSF
88b48903
WN
1237REPLACE_CEILL
1238REPLACE_CEILF
1239REPLACE_CEIL
1240REPLACE_CBRTL
1241REPLACE_CBRTF
c0c3707f
CB
1242REPLACE_ATAN2F
1243REPLACE_ATANF
1244REPLACE_ASINF
1245REPLACE_ACOSF
88b48903
WN
1246HAVE_DECL_TRUNCL
1247HAVE_DECL_TRUNCF
1248HAVE_DECL_TRUNC
1249HAVE_DECL_TANL
1250HAVE_DECL_SQRTL
1251HAVE_DECL_SINL
1252HAVE_DECL_ROUNDL
1253HAVE_DECL_ROUNDF
1254HAVE_DECL_ROUND
1255HAVE_DECL_RINTF
1256HAVE_DECL_REMAINDERL
1257HAVE_DECL_REMAINDER
1258HAVE_DECL_LOGB
1259HAVE_DECL_LOG2L
1260HAVE_DECL_LOG2F
1261HAVE_DECL_LOG2
1262HAVE_DECL_LOG10L
1263HAVE_DECL_LOGL
1264HAVE_DECL_LDEXPL
1265HAVE_DECL_FREXPL
1266HAVE_DECL_FLOORL
1267HAVE_DECL_FLOORF
1268HAVE_DECL_EXPM1L
1269HAVE_DECL_EXP2L
1270HAVE_DECL_EXP2F
1271HAVE_DECL_EXP2
1272HAVE_DECL_EXPL
1273HAVE_DECL_COSL
1274HAVE_DECL_COPYSIGNF
1275HAVE_DECL_CEILL
1276HAVE_DECL_CEILF
1277HAVE_DECL_CBRTL
1278HAVE_DECL_CBRTF
1279HAVE_DECL_ATANL
1280HAVE_DECL_ASINL
1281HAVE_DECL_ACOSL
1282HAVE_TANHF
1283HAVE_TANL
1284HAVE_TANF
1285HAVE_SQRTL
1286HAVE_SQRTF
1287HAVE_SINHF
1288HAVE_SINL
1289HAVE_SINF
1290HAVE_RINTL
1291HAVE_RINT
1292HAVE_REMAINDERF
1293HAVE_REMAINDER
1294HAVE_POWF
1295HAVE_MODFL
1296HAVE_MODFF
1297HAVE_LOGBL
1298HAVE_LOGBF
1299HAVE_LOG1PL
1300HAVE_LOG1PF
1301HAVE_LOG1P
1302HAVE_LOG10L
1303HAVE_LOG10F
1304HAVE_LOGL
1305HAVE_LOGF
1306HAVE_LDEXPF
1307HAVE_ISNANL
1308HAVE_ISNAND
1309HAVE_ISNANF
1310HAVE_ILOGBL
1311HAVE_ILOGBF
1312HAVE_ILOGB
1313HAVE_HYPOTL
1314HAVE_HYPOTF
1315HAVE_FREXPF
1316HAVE_FMODL
1317HAVE_FMODF
1318HAVE_FMAL
1319HAVE_FMAF
1320HAVE_FMA
1321HAVE_FABSL
1322HAVE_FABSF
1323HAVE_EXPM1F
1324HAVE_EXPM1
1325HAVE_EXPL
1326HAVE_EXPF
1327HAVE_COSHF
1328HAVE_COSL
1329HAVE_COSF
1330HAVE_COPYSIGNL
1331HAVE_COPYSIGN
1332HAVE_CBRTL
1333HAVE_CBRTF
1334HAVE_CBRT
1335HAVE_ATAN2F
1336HAVE_ATANL
1337HAVE_ATANF
1338HAVE_ASINL
1339HAVE_ASINF
1340HAVE_ACOSL
1341HAVE_ACOSF
9c9d63b1
PM
1342GNULIB_MDA_YN
1343GNULIB_MDA_Y1
1344GNULIB_MDA_Y0
1345GNULIB_MDA_JN
1346GNULIB_MDA_J1
1347GNULIB_MDA_J0
88b48903
WN
1348GNULIB_TRUNCL
1349GNULIB_TRUNCF
1350GNULIB_TRUNC
1351GNULIB_TANHF
1352GNULIB_TANL
1353GNULIB_TANF
1354GNULIB_SQRTL
1355GNULIB_SQRTF
1356GNULIB_SINHF
1357GNULIB_SINL
1358GNULIB_SINF
1359GNULIB_SIGNBIT
1360GNULIB_ROUNDL
1361GNULIB_ROUNDF
1362GNULIB_ROUND
1363GNULIB_RINTL
1364GNULIB_RINTF
1365GNULIB_RINT
1366GNULIB_REMAINDERL
1367GNULIB_REMAINDERF
1368GNULIB_REMAINDER
1369GNULIB_POWF
1370GNULIB_MODFL
1371GNULIB_MODFF
1372GNULIB_MODF
1373GNULIB_LOGBL
1374GNULIB_LOGBF
1375GNULIB_LOGB
1376GNULIB_LOG2L
1377GNULIB_LOG2F
1378GNULIB_LOG2
1379GNULIB_LOG1PL
1380GNULIB_LOG1PF
1381GNULIB_LOG1P
1382GNULIB_LOG10L
1383GNULIB_LOG10F
1384GNULIB_LOG10
1385GNULIB_LOGL
1386GNULIB_LOGF
1387GNULIB_LOG
1388GNULIB_LDEXPL
1389GNULIB_LDEXPF
1390GNULIB_ISNANL
1391GNULIB_ISNAND
1392GNULIB_ISNANF
1393GNULIB_ISNAN
1394GNULIB_ISINF
1395GNULIB_ISFINITE
1396GNULIB_ILOGBL
1397GNULIB_ILOGBF
1398GNULIB_ILOGB
1399GNULIB_HYPOTL
1400GNULIB_HYPOTF
1401GNULIB_HYPOT
1402GNULIB_FREXPL
1403GNULIB_FREXP
1404GNULIB_FREXPF
1405GNULIB_FMODL
1406GNULIB_FMODF
1407GNULIB_FMOD
1408GNULIB_FMAL
1409GNULIB_FMAF
1410GNULIB_FMA
1411GNULIB_FLOORL
1412GNULIB_FLOORF
1413GNULIB_FLOOR
1414GNULIB_FABSL
1415GNULIB_FABSF
1416GNULIB_EXPM1L
1417GNULIB_EXPM1F
1418GNULIB_EXPM1
1419GNULIB_EXP2L
1420GNULIB_EXP2F
1421GNULIB_EXP2
1422GNULIB_EXPL
1423GNULIB_EXPF
1424GNULIB_COSHF
1425GNULIB_COSL
1426GNULIB_COSF
1427GNULIB_COPYSIGNL
1428GNULIB_COPYSIGNF
1429GNULIB_COPYSIGN
1430GNULIB_CEILL
1431GNULIB_CEILF
1432GNULIB_CEIL
1433GNULIB_CBRTL
1434GNULIB_CBRTF
1435GNULIB_CBRT
1436GNULIB_ATAN2F
1437GNULIB_ATANL
1438GNULIB_ATANF
1439GNULIB_ASINL
1440GNULIB_ASINF
1441GNULIB_ACOSL
1442GNULIB_ACOSF
8690e634
JK
1443GL_GENERATE_FNMATCH_H_FALSE
1444GL_GENERATE_FNMATCH_H_TRUE
1445FNMATCH_H
c0c3707f
CB
1446HAVE_FNMATCH_H
1447NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H
1448NEXT_FNMATCH_H
1449REPLACE_FNMATCH
1450HAVE_FNMATCH
1451GNULIB_FNMATCH
88b48903
WN
1452REPLACE_ITOLD
1453GL_GENERATE_FLOAT_H_FALSE
1454GL_GENERATE_FLOAT_H_TRUE
1455FLOAT_H
1456NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
1457NEXT_FLOAT_H
6ec2e0f5
SDJ
1458NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
1459NEXT_FCNTL_H
1460REPLACE_OPENAT
1461REPLACE_OPEN
1462REPLACE_FCNTL
c0c3707f 1463REPLACE_CREAT
6ec2e0f5
SDJ
1464HAVE_OPENAT
1465HAVE_FCNTL
9c9d63b1
PM
1466GNULIB_MDA_OPEN
1467GNULIB_MDA_CREAT
6ec2e0f5
SDJ
1468GNULIB_OPENAT
1469GNULIB_OPEN
1470GNULIB_NONBLOCKING
1471GNULIB_FCNTL
c0c3707f 1472GNULIB_CREAT
18848e28
GF
1473EOVERFLOW_VALUE
1474EOVERFLOW_HIDDEN
1475ENOLINK_VALUE
1476ENOLINK_HIDDEN
1477EMULTIHOP_VALUE
1478EMULTIHOP_HIDDEN
1479GL_GENERATE_ERRNO_H_FALSE
1480GL_GENERATE_ERRNO_H_TRUE
1481ERRNO_H
1482NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
1483NEXT_ERRNO_H
e26b6bb0
TT
1484HAVE_DIRENT_H
1485NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
1486NEXT_DIRENT_H
698be2d8
CB
1487NEXT_AS_FIRST_DIRECTIVE_CTYPE_H
1488NEXT_CTYPE_H
1489HAVE_ISBLANK
1490GNULIB_ISBLANK
e26b6bb0
TT
1491REPLACE_FDOPENDIR
1492REPLACE_DIRFD
1493REPLACE_CLOSEDIR
1494REPLACE_OPENDIR
1495HAVE_ALPHASORT
1496HAVE_SCANDIR
1497HAVE_FDOPENDIR
1498HAVE_DECL_FDOPENDIR
1499HAVE_DECL_DIRFD
1500HAVE_CLOSEDIR
1501HAVE_REWINDDIR
1502HAVE_READDIR
1503HAVE_OPENDIR
1504GNULIB_ALPHASORT
1505GNULIB_SCANDIR
1506GNULIB_FDOPENDIR
1507GNULIB_DIRFD
1508GNULIB_CLOSEDIR
1509GNULIB_REWINDDIR
1510GNULIB_READDIR
1511GNULIB_OPENDIR
6ec2e0f5
SDJ
1512HAVE_WINSOCK2_H
1513HAVE_MSVC_INVALID_PARAMETER_HANDLER
9c9d63b1 1514LIB_CLOCK_GETTIME
e26b6bb0
TT
1515UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
1516UNISTD_H_HAVE_WINSOCK2_H
698be2d8 1517UNISTD_H_HAVE_SYS_RANDOM_H
e26b6bb0
TT
1518REPLACE_WRITE
1519REPLACE_USLEEP
1520REPLACE_UNLINKAT
1521REPLACE_UNLINK
1522REPLACE_TTYNAME_R
c0c3707f 1523REPLACE_TRUNCATE
4a626d0a 1524REPLACE_SYMLINKAT
e26b6bb0
TT
1525REPLACE_SYMLINK
1526REPLACE_SLEEP
1527REPLACE_RMDIR
4a626d0a 1528REPLACE_READLINKAT
e26b6bb0
TT
1529REPLACE_READLINK
1530REPLACE_READ
1531REPLACE_PWRITE
1532REPLACE_PREAD
1533REPLACE_LSEEK
1534REPLACE_LINKAT
1535REPLACE_LINK
1536REPLACE_LCHOWN
1537REPLACE_ISATTY
c0c3707f 1538REPLACE_GETPASS
e26b6bb0
TT
1539REPLACE_GETPAGESIZE
1540REPLACE_GETGROUPS
1541REPLACE_GETLOGIN_R
4a626d0a 1542REPLACE_GETDTABLESIZE
e26b6bb0
TT
1543REPLACE_GETDOMAINNAME
1544REPLACE_GETCWD
1545REPLACE_FTRUNCATE
1546REPLACE_FCHOWNAT
c0c3707f 1547REPLACE_FACCESSAT
9c9d63b1
PM
1548REPLACE_EXECVPE
1549REPLACE_EXECVP
1550REPLACE_EXECVE
1551REPLACE_EXECV
1552REPLACE_EXECLP
1553REPLACE_EXECLE
1554REPLACE_EXECL
e26b6bb0
TT
1555REPLACE_DUP2
1556REPLACE_DUP
1557REPLACE_CLOSE
1558REPLACE_CHOWN
c0c3707f 1559REPLACE_ACCESS
e26b6bb0
TT
1560HAVE_SYS_PARAM_H
1561HAVE_OS_H
1562HAVE_DECL_TTYNAME_R
c0c3707f 1563HAVE_DECL_TRUNCATE
e26b6bb0
TT
1564HAVE_DECL_SETHOSTNAME
1565HAVE_DECL_GETUSERSHELL
1566HAVE_DECL_GETPAGESIZE
1567HAVE_DECL_GETLOGIN_R
c0c3707f 1568HAVE_DECL_GETLOGIN
e26b6bb0
TT
1569HAVE_DECL_GETDOMAINNAME
1570HAVE_DECL_FDATASYNC
1571HAVE_DECL_FCHDIR
9c9d63b1 1572HAVE_DECL_EXECVPE
e26b6bb0
TT
1573HAVE_DECL_ENVIRON
1574HAVE_USLEEP
1575HAVE_UNLINKAT
1576HAVE_SYMLINKAT
1577HAVE_SYMLINK
1578HAVE_SLEEP
1579HAVE_SETHOSTNAME
1580HAVE_READLINKAT
1581HAVE_READLINK
1582HAVE_PWRITE
1583HAVE_PREAD
1584HAVE_PIPE2
1585HAVE_PIPE
1586HAVE_LINKAT
1587HAVE_LINK
1588HAVE_LCHOWN
1589HAVE_GROUP_MEMBER
c0c3707f 1590HAVE_GETPASS
e26b6bb0
TT
1591HAVE_GETPAGESIZE
1592HAVE_GETLOGIN
1593HAVE_GETHOSTNAME
1594HAVE_GETGROUPS
698be2d8 1595HAVE_GETENTROPY
e26b6bb0
TT
1596HAVE_GETDTABLESIZE
1597HAVE_FTRUNCATE
1598HAVE_FSYNC
1599HAVE_FDATASYNC
1600HAVE_FCHOWNAT
1601HAVE_FCHDIR
1602HAVE_FACCESSAT
9c9d63b1 1603HAVE_EXECVPE
e26b6bb0
TT
1604HAVE_EUIDACCESS
1605HAVE_DUP3
c0c3707f 1606HAVE_COPY_FILE_RANGE
e26b6bb0 1607HAVE_CHOWN
9c9d63b1
PM
1608GNULIB_MDA_WRITE
1609GNULIB_MDA_UNLINK
1610GNULIB_MDA_SWAB
1611GNULIB_MDA_RMDIR
1612GNULIB_MDA_READ
1613GNULIB_MDA_LSEEK
1614GNULIB_MDA_ISATTY
1615GNULIB_MDA_GETPID
1616GNULIB_MDA_GETCWD
1617GNULIB_MDA_EXECVPE
1618GNULIB_MDA_EXECVP
1619GNULIB_MDA_EXECVE
1620GNULIB_MDA_EXECV
1621GNULIB_MDA_EXECLP
1622GNULIB_MDA_EXECLE
1623GNULIB_MDA_EXECL
1624GNULIB_MDA_DUP2
1625GNULIB_MDA_DUP
1626GNULIB_MDA_CLOSE
1627GNULIB_MDA_CHDIR
1628GNULIB_MDA_ACCESS
e26b6bb0
TT
1629GNULIB_WRITE
1630GNULIB_USLEEP
1631GNULIB_UNLINKAT
1632GNULIB_UNLINK
1633GNULIB_UNISTD_H_SIGPIPE
1634GNULIB_UNISTD_H_NONBLOCKING
1635GNULIB_TTYNAME_R
c0c3707f 1636GNULIB_TRUNCATE
e26b6bb0
TT
1637GNULIB_SYMLINKAT
1638GNULIB_SYMLINK
1639GNULIB_SLEEP
1640GNULIB_SETHOSTNAME
1641GNULIB_RMDIR
1642GNULIB_READLINKAT
1643GNULIB_READLINK
1644GNULIB_READ
1645GNULIB_PWRITE
1646GNULIB_PREAD
1647GNULIB_PIPE2
1648GNULIB_PIPE
1649GNULIB_LSEEK
1650GNULIB_LINKAT
1651GNULIB_LINK
1652GNULIB_LCHOWN
1653GNULIB_ISATTY
1654GNULIB_GROUP_MEMBER
1655GNULIB_GETUSERSHELL
c0c3707f 1656GNULIB_GETPASS
e26b6bb0 1657GNULIB_GETPAGESIZE
5df4cba6 1658GNULIB_GETOPT_POSIX
e26b6bb0
TT
1659GNULIB_GETLOGIN_R
1660GNULIB_GETLOGIN
1661GNULIB_GETHOSTNAME
1662GNULIB_GETGROUPS
698be2d8 1663GNULIB_GETENTROPY
e26b6bb0
TT
1664GNULIB_GETDTABLESIZE
1665GNULIB_GETDOMAINNAME
1666GNULIB_GETCWD
1667GNULIB_FTRUNCATE
1668GNULIB_FSYNC
1669GNULIB_FDATASYNC
1670GNULIB_FCHOWNAT
1671GNULIB_FCHDIR
1672GNULIB_FACCESSAT
9c9d63b1
PM
1673GNULIB_EXECVPE
1674GNULIB_EXECVP
1675GNULIB_EXECVE
1676GNULIB_EXECV
1677GNULIB_EXECLP
1678GNULIB_EXECLE
1679GNULIB_EXECL
e26b6bb0
TT
1680GNULIB_EUIDACCESS
1681GNULIB_ENVIRON
1682GNULIB_DUP3
1683GNULIB_DUP2
1684GNULIB_DUP
c0c3707f 1685GNULIB_COPY_FILE_RANGE
e26b6bb0
TT
1686GNULIB_CLOSE
1687GNULIB_CHOWN
1688GNULIB_CHDIR
c0c3707f 1689GNULIB_ACCESS
98399780
YQ
1690REPLACE_WCTOMB
1691REPLACE_UNSETENV
c0c3707f 1692REPLACE_STRTOLD
98399780 1693REPLACE_STRTOD
c0c3707f 1694REPLACE_SETSTATE
98399780
YQ
1695REPLACE_SETENV
1696REPLACE_REALPATH
1697REPLACE_REALLOC
1698REPLACE_RANDOM_R
c0c3707f 1699REPLACE_RANDOM
4a626d0a 1700REPLACE_QSORT_R
98399780
YQ
1701REPLACE_PUTENV
1702REPLACE_PTSNAME_R
1703REPLACE_PTSNAME
9c9d63b1 1704REPLACE_POSIX_MEMALIGN
98399780
YQ
1705REPLACE_MKSTEMP
1706REPLACE_MBTOWC
1707REPLACE_MALLOC
c0c3707f 1708REPLACE_INITSTATE
9c9d63b1 1709REPLACE_FREE
98399780
YQ
1710REPLACE_CANONICALIZE_FILE_NAME
1711REPLACE_CALLOC
9c9d63b1 1712REPLACE_ALIGNED_ALLOC
98399780
YQ
1713HAVE_DECL_UNSETENV
1714HAVE_UNLOCKPT
1715HAVE_SYS_LOADAVG_H
1716HAVE_STRUCT_RANDOM_DATA
1717HAVE_STRTOULL
1718HAVE_STRTOLL
c0c3707f 1719HAVE_STRTOLD
98399780 1720HAVE_STRTOD
c0c3707f
CB
1721HAVE_DECL_SETSTATE
1722HAVE_SETSTATE
98399780
YQ
1723HAVE_DECL_SETENV
1724HAVE_SETENV
4a626d0a 1725HAVE_SECURE_GETENV
98399780
YQ
1726HAVE_RPMATCH
1727HAVE_REALPATH
c0c3707f 1728HAVE_REALLOCARRAY
98399780
YQ
1729HAVE_RANDOM_R
1730HAVE_RANDOM_H
1731HAVE_RANDOM
4c62b19f 1732HAVE_QSORT_R
98399780
YQ
1733HAVE_PTSNAME_R
1734HAVE_PTSNAME
1735HAVE_POSIX_OPENPT
9c9d63b1 1736HAVE_POSIX_MEMALIGN
98399780
YQ
1737HAVE_MKSTEMPS
1738HAVE_MKSTEMP
1739HAVE_MKOSTEMPS
1740HAVE_MKOSTEMP
1741HAVE_MKDTEMP
c0c3707f
CB
1742HAVE_MBTOWC
1743HAVE_DECL_INITSTATE
1744HAVE_INITSTATE
98399780
YQ
1745HAVE_GRANTPT
1746HAVE_GETSUBOPT
1747HAVE_DECL_GETLOADAVG
9c9d63b1
PM
1748HAVE_DECL_GCVT
1749HAVE_DECL_FCVT
1750HAVE_DECL_ECVT
98399780
YQ
1751HAVE_CANONICALIZE_FILE_NAME
1752HAVE_ATOLL
9c9d63b1 1753HAVE_ALIGNED_ALLOC
98399780 1754HAVE__EXIT
9c9d63b1
PM
1755GNULIB_MDA_PUTENV
1756GNULIB_MDA_MKTEMP
1757GNULIB_MDA_GCVT
1758GNULIB_MDA_FCVT
1759GNULIB_MDA_ECVT
98399780
YQ
1760GNULIB_WCTOMB
1761GNULIB_UNSETENV
1762GNULIB_UNLOCKPT
1763GNULIB_SYSTEM_POSIX
1764GNULIB_STRTOULL
1765GNULIB_STRTOLL
c0c3707f 1766GNULIB_STRTOLD
98399780
YQ
1767GNULIB_STRTOD
1768GNULIB_SETENV
4a626d0a 1769GNULIB_SECURE_GETENV
98399780
YQ
1770GNULIB_RPMATCH
1771GNULIB_REALPATH
1772GNULIB_REALLOC_POSIX
c0c3707f 1773GNULIB_REALLOCARRAY
98399780
YQ
1774GNULIB_RANDOM_R
1775GNULIB_RANDOM
4a626d0a 1776GNULIB_QSORT_R
98399780
YQ
1777GNULIB_PUTENV
1778GNULIB_PTSNAME_R
1779GNULIB_PTSNAME
1780GNULIB_POSIX_OPENPT
9c9d63b1 1781GNULIB_POSIX_MEMALIGN
98399780
YQ
1782GNULIB_MKSTEMPS
1783GNULIB_MKSTEMP
1784GNULIB_MKOSTEMPS
1785GNULIB_MKOSTEMP
1786GNULIB_MKDTEMP
1787GNULIB_MBTOWC
1788GNULIB_MALLOC_POSIX
1789GNULIB_GRANTPT
1790GNULIB_GETSUBOPT
1791GNULIB_GETLOADAVG
9c9d63b1 1792GNULIB_FREE_POSIX
98399780
YQ
1793GNULIB_CANONICALIZE_FILE_NAME
1794GNULIB_CALLOC_POSIX
1795GNULIB_ATOLL
9c9d63b1 1796GNULIB_ALIGNED_ALLOC
98399780 1797GNULIB__EXIT
698be2d8
CB
1798LOCALE_FR
1799REPLACE_WCSTOK
1800REPLACE_WCSFTIME
1801REPLACE_WCSWIDTH
1802REPLACE_WCWIDTH
1803REPLACE_WCSNRTOMBS
1804REPLACE_WCSRTOMBS
1805REPLACE_WCRTOMB
1806REPLACE_MBSNRTOWCS
1807REPLACE_MBSRTOWCS
1808REPLACE_MBRLEN
1809REPLACE_MBRTOWC
1810REPLACE_MBSINIT
1811REPLACE_WCTOB
1812REPLACE_BTOWC
1813REPLACE_MBSTATE_T
1814HAVE_DECL_WCWIDTH
9c9d63b1 1815HAVE_DECL_WCSDUP
698be2d8
CB
1816HAVE_DECL_WCTOB
1817HAVE_WCSFTIME
1818HAVE_WCSWIDTH
1819HAVE_WCSTOK
1820HAVE_WCSSTR
1821HAVE_WCSPBRK
1822HAVE_WCSSPN
1823HAVE_WCSCSPN
1824HAVE_WCSRCHR
1825HAVE_WCSCHR
1826HAVE_WCSDUP
1827HAVE_WCSXFRM
1828HAVE_WCSCOLL
1829HAVE_WCSNCASECMP
1830HAVE_WCSCASECMP
1831HAVE_WCSNCMP
1832HAVE_WCSCMP
1833HAVE_WCSNCAT
1834HAVE_WCSCAT
1835HAVE_WCPNCPY
1836HAVE_WCSNCPY
1837HAVE_WCPCPY
1838HAVE_WCSCPY
1839HAVE_WCSNLEN
1840HAVE_WCSLEN
1841HAVE_WMEMSET
1842HAVE_WMEMPCPY
1843HAVE_WMEMMOVE
1844HAVE_WMEMCPY
1845HAVE_WMEMCMP
1846HAVE_WMEMCHR
1847HAVE_WCSNRTOMBS
1848HAVE_WCSRTOMBS
1849HAVE_WCRTOMB
1850HAVE_MBSNRTOWCS
1851HAVE_MBSRTOWCS
1852HAVE_MBRLEN
1853HAVE_MBRTOWC
1854HAVE_MBSINIT
1855HAVE_BTOWC
9c9d63b1 1856GNULIB_MDA_WCSDUP
698be2d8
CB
1857GNULIB_WCSFTIME
1858GNULIB_WCSWIDTH
1859GNULIB_WCSTOK
1860GNULIB_WCSSTR
1861GNULIB_WCSPBRK
1862GNULIB_WCSSPN
1863GNULIB_WCSCSPN
1864GNULIB_WCSRCHR
1865GNULIB_WCSCHR
1866GNULIB_WCSDUP
1867GNULIB_WCSXFRM
1868GNULIB_WCSCOLL
1869GNULIB_WCSNCASECMP
1870GNULIB_WCSCASECMP
1871GNULIB_WCSNCMP
1872GNULIB_WCSCMP
1873GNULIB_WCSNCAT
1874GNULIB_WCSCAT
1875GNULIB_WCPNCPY
1876GNULIB_WCSNCPY
1877GNULIB_WCPCPY
1878GNULIB_WCSCPY
1879GNULIB_WCSNLEN
1880GNULIB_WCSLEN
1881GNULIB_WMEMSET
1882GNULIB_WMEMPCPY
1883GNULIB_WMEMMOVE
1884GNULIB_WMEMCPY
1885GNULIB_WMEMCMP
1886GNULIB_WMEMCHR
1887GNULIB_WCWIDTH
1888GNULIB_WCSNRTOMBS
1889GNULIB_WCSRTOMBS
1890GNULIB_WCRTOMB
1891GNULIB_MBSNRTOWCS
1892GNULIB_MBSRTOWCS
1893GNULIB_MBRLEN
1894GNULIB_MBRTOWC
1895GNULIB_MBSINIT
1896GNULIB_WCTOB
1897GNULIB_BTOWC
725e2999 1898MKDIR_P
c0c3707f 1899HAVE_WS2TCPIP_H
725e2999
JB
1900HAVE_FEATURES_H
1901NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
1902NEXT_ARPA_INET_H
1903PRAGMA_COLUMNS
1904PRAGMA_SYSTEM_HEADER
1905INCLUDE_NEXT_AS_FIRST_DIRECTIVE
1906INCLUDE_NEXT
1907HAVE_ARPA_INET_H
1908REPLACE_INET_PTON
1909REPLACE_INET_NTOP
1910HAVE_DECL_INET_PTON
1911HAVE_DECL_INET_NTOP
1912GNULIB_INET_PTON
1913GNULIB_INET_NTOP
c0c3707f 1914HAVE_ALLOCA_H
8690e634
JK
1915GL_GENERATE_ALLOCA_H_FALSE
1916GL_GENERATE_ALLOCA_H_TRUE
1917ALLOCA_H
1918ALLOCA
c971b7fa
PA
1919GL_COND_LIBTOOL_FALSE
1920GL_COND_LIBTOOL_TRUE
c8693053
RO
1921RANLIB
1922ARFLAGS
1923AR
1924LARGEFILE_CPPFLAGS
c971b7fa
PA
1925target_os
1926target_vendor
1927target_cpu
1928target
c971b7fa
PA
1929host_os
1930host_vendor
1931host_cpu
1932host
1933build_os
1934build_vendor
1935build_cpu
1936build
4a626d0a
PA
1937EGREP
1938GREP
1939CPP
c971b7fa
PA
1940OBJEXT
1941EXEEXT
1942ac_ct_CC
1943CPPFLAGS
1944LDFLAGS
1945CFLAGS
1946CC
1947MAINT
1948MAINTAINER_MODE_FALSE
1949MAINTAINER_MODE_TRUE
1950target_alias
1951host_alias
1952build_alias
1953LIBS
1954ECHO_T
1955ECHO_N
1956ECHO_C
1957DEFS
1958mandir
1959localedir
1960libdir
1961psdir
1962pdfdir
1963dvidir
1964htmldir
1965infodir
1966docdir
1967oldincludedir
1968includedir
1969localstatedir
1970sharedstatedir
1971sysconfdir
1972datadir
1973datarootdir
1974libexecdir
1975sbindir
1976bindir
1977program_transform_name
1978prefix
1979exec_prefix
1980PACKAGE_URL
1981PACKAGE_BUGREPORT
1982PACKAGE_STRING
1983PACKAGE_VERSION
1984PACKAGE_TARNAME
1985PACKAGE_NAME
1986PATH_SEPARATOR
1987SHELL'
1988ac_subst_files=''
1989ac_user_opts='
1990enable_option_checking
1991enable_maintainer_mode
c8693053 1992enable_plugins
2196f55f 1993enable_largefile
5abebf3c 1994enable_threads
c0c3707f 1995enable_cross_guesses
c971b7fa 1996enable_dependency_tracking
39be3c7e 1997enable_silent_rules
c971b7fa
PA
1998'
1999 ac_precious_vars='build_alias
2000host_alias
2001target_alias
2002CC
2003CFLAGS
2004LDFLAGS
2005LIBS
2006CPPFLAGS
2007CPP'
2008
2009
2010# Initialize some variables set by options.
2011ac_init_help=
2012ac_init_version=false
2013ac_unrecognized_opts=
2014ac_unrecognized_sep=
2015# The variables have the same names as the options, with
2016# dashes changed to underlines.
2017cache_file=/dev/null
2018exec_prefix=NONE
2019no_create=
2020no_recursion=
2021prefix=NONE
2022program_prefix=NONE
2023program_suffix=NONE
2024program_transform_name=s,x,x,
2025silent=
2026site=
2027srcdir=
2028verbose=
2029x_includes=NONE
2030x_libraries=NONE
2031
2032# Installation directory options.
2033# These are left unexpanded so users can "make install exec_prefix=/foo"
2034# and all the variables that are supposed to be based on exec_prefix
2035# by default will actually change.
2036# Use braces instead of parens because sh, perl, etc. also accept them.
2037# (The list follows the same order as the GNU Coding Standards.)
2038bindir='${exec_prefix}/bin'
2039sbindir='${exec_prefix}/sbin'
2040libexecdir='${exec_prefix}/libexec'
2041datarootdir='${prefix}/share'
2042datadir='${datarootdir}'
2043sysconfdir='${prefix}/etc'
2044sharedstatedir='${prefix}/com'
2045localstatedir='${prefix}/var'
2046includedir='${prefix}/include'
2047oldincludedir='/usr/include'
d0ac1c44 2048docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
c971b7fa
PA
2049infodir='${datarootdir}/info'
2050htmldir='${docdir}'
2051dvidir='${docdir}'
2052pdfdir='${docdir}'
2053psdir='${docdir}'
2054libdir='${exec_prefix}/lib'
2055localedir='${datarootdir}/locale'
2056mandir='${datarootdir}/man'
2057
2058ac_prev=
2059ac_dashdash=
2060for ac_option
2061do
2062 # If the previous option needs an argument, assign it.
2063 if test -n "$ac_prev"; then
2064 eval $ac_prev=\$ac_option
2065 ac_prev=
2066 continue
2067 fi
2068
2069 case $ac_option in
d0ac1c44
SM
2070 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
2071 *=) ac_optarg= ;;
2072 *) ac_optarg=yes ;;
c971b7fa
PA
2073 esac
2074
2075 # Accept the important Cygnus configure options, so we can diagnose typos.
2076
2077 case $ac_dashdash$ac_option in
2078 --)
2079 ac_dashdash=yes ;;
2080
2081 -bindir | --bindir | --bindi | --bind | --bin | --bi)
2082 ac_prev=bindir ;;
2083 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
2084 bindir=$ac_optarg ;;
2085
2086 -build | --build | --buil | --bui | --bu)
2087 ac_prev=build_alias ;;
2088 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
2089 build_alias=$ac_optarg ;;
2090
2091 -cache-file | --cache-file | --cache-fil | --cache-fi \
2092 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
2093 ac_prev=cache_file ;;
2094 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
2095 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
2096 cache_file=$ac_optarg ;;
2097
2098 --config-cache | -C)
2099 cache_file=config.cache ;;
2100
2101 -datadir | --datadir | --datadi | --datad)
2102 ac_prev=datadir ;;
2103 -datadir=* | --datadir=* | --datadi=* | --datad=*)
2104 datadir=$ac_optarg ;;
2105
2106 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
2107 | --dataroo | --dataro | --datar)
2108 ac_prev=datarootdir ;;
2109 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
2110 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
2111 datarootdir=$ac_optarg ;;
2112
2113 -disable-* | --disable-*)
2114 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
2115 # Reject names that are not valid shell variable names.
2116 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2117 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2118 ac_useropt_orig=$ac_useropt
2119 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2120 case $ac_user_opts in
2121 *"
2122"enable_$ac_useropt"
2123"*) ;;
2124 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
2125 ac_unrecognized_sep=', ';;
2126 esac
2127 eval enable_$ac_useropt=no ;;
2128
2129 -docdir | --docdir | --docdi | --doc | --do)
2130 ac_prev=docdir ;;
2131 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
2132 docdir=$ac_optarg ;;
2133
2134 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
2135 ac_prev=dvidir ;;
2136 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
2137 dvidir=$ac_optarg ;;
2138
2139 -enable-* | --enable-*)
2140 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
2141 # Reject names that are not valid shell variable names.
2142 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2143 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2144 ac_useropt_orig=$ac_useropt
2145 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2146 case $ac_user_opts in
2147 *"
2148"enable_$ac_useropt"
2149"*) ;;
2150 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
2151 ac_unrecognized_sep=', ';;
2152 esac
2153 eval enable_$ac_useropt=\$ac_optarg ;;
2154
2155 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
2156 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
2157 | --exec | --exe | --ex)
2158 ac_prev=exec_prefix ;;
2159 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
2160 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
2161 | --exec=* | --exe=* | --ex=*)
2162 exec_prefix=$ac_optarg ;;
2163
2164 -gas | --gas | --ga | --g)
2165 # Obsolete; use --with-gas.
2166 with_gas=yes ;;
2167
2168 -help | --help | --hel | --he | -h)
2169 ac_init_help=long ;;
2170 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
2171 ac_init_help=recursive ;;
2172 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
2173 ac_init_help=short ;;
2174
2175 -host | --host | --hos | --ho)
2176 ac_prev=host_alias ;;
2177 -host=* | --host=* | --hos=* | --ho=*)
2178 host_alias=$ac_optarg ;;
2179
2180 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
2181 ac_prev=htmldir ;;
2182 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
2183 | --ht=*)
2184 htmldir=$ac_optarg ;;
2185
2186 -includedir | --includedir | --includedi | --included | --include \
2187 | --includ | --inclu | --incl | --inc)
2188 ac_prev=includedir ;;
2189 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
2190 | --includ=* | --inclu=* | --incl=* | --inc=*)
2191 includedir=$ac_optarg ;;
2192
2193 -infodir | --infodir | --infodi | --infod | --info | --inf)
2194 ac_prev=infodir ;;
2195 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
2196 infodir=$ac_optarg ;;
2197
2198 -libdir | --libdir | --libdi | --libd)
2199 ac_prev=libdir ;;
2200 -libdir=* | --libdir=* | --libdi=* | --libd=*)
2201 libdir=$ac_optarg ;;
2202
2203 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
2204 | --libexe | --libex | --libe)
2205 ac_prev=libexecdir ;;
2206 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
2207 | --libexe=* | --libex=* | --libe=*)
2208 libexecdir=$ac_optarg ;;
2209
2210 -localedir | --localedir | --localedi | --localed | --locale)
2211 ac_prev=localedir ;;
2212 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
2213 localedir=$ac_optarg ;;
2214
2215 -localstatedir | --localstatedir | --localstatedi | --localstated \
2216 | --localstate | --localstat | --localsta | --localst | --locals)
2217 ac_prev=localstatedir ;;
2218 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
2219 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
2220 localstatedir=$ac_optarg ;;
2221
2222 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
2223 ac_prev=mandir ;;
2224 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
2225 mandir=$ac_optarg ;;
2226
2227 -nfp | --nfp | --nf)
2228 # Obsolete; use --without-fp.
2229 with_fp=no ;;
2230
2231 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
2232 | --no-cr | --no-c | -n)
2233 no_create=yes ;;
2234
2235 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
2236 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
2237 no_recursion=yes ;;
2238
2239 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
2240 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
2241 | --oldin | --oldi | --old | --ol | --o)
2242 ac_prev=oldincludedir ;;
2243 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
2244 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
2245 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
2246 oldincludedir=$ac_optarg ;;
2247
2248 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
2249 ac_prev=prefix ;;
2250 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
2251 prefix=$ac_optarg ;;
2252
2253 -program-prefix | --program-prefix | --program-prefi | --program-pref \
2254 | --program-pre | --program-pr | --program-p)
2255 ac_prev=program_prefix ;;
2256 -program-prefix=* | --program-prefix=* | --program-prefi=* \
2257 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
2258 program_prefix=$ac_optarg ;;
2259
2260 -program-suffix | --program-suffix | --program-suffi | --program-suff \
2261 | --program-suf | --program-su | --program-s)
2262 ac_prev=program_suffix ;;
2263 -program-suffix=* | --program-suffix=* | --program-suffi=* \
2264 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
2265 program_suffix=$ac_optarg ;;
2266
2267 -program-transform-name | --program-transform-name \
2268 | --program-transform-nam | --program-transform-na \
2269 | --program-transform-n | --program-transform- \
2270 | --program-transform | --program-transfor \
2271 | --program-transfo | --program-transf \
2272 | --program-trans | --program-tran \
2273 | --progr-tra | --program-tr | --program-t)
2274 ac_prev=program_transform_name ;;
2275 -program-transform-name=* | --program-transform-name=* \
2276 | --program-transform-nam=* | --program-transform-na=* \
2277 | --program-transform-n=* | --program-transform-=* \
2278 | --program-transform=* | --program-transfor=* \
2279 | --program-transfo=* | --program-transf=* \
2280 | --program-trans=* | --program-tran=* \
2281 | --progr-tra=* | --program-tr=* | --program-t=*)
2282 program_transform_name=$ac_optarg ;;
2283
2284 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
2285 ac_prev=pdfdir ;;
2286 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
2287 pdfdir=$ac_optarg ;;
2288
2289 -psdir | --psdir | --psdi | --psd | --ps)
2290 ac_prev=psdir ;;
2291 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
2292 psdir=$ac_optarg ;;
2293
2294 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2295 | -silent | --silent | --silen | --sile | --sil)
2296 silent=yes ;;
2297
2298 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
2299 ac_prev=sbindir ;;
2300 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
2301 | --sbi=* | --sb=*)
2302 sbindir=$ac_optarg ;;
2303
2304 -sharedstatedir | --sharedstatedir | --sharedstatedi \
2305 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
2306 | --sharedst | --shareds | --shared | --share | --shar \
2307 | --sha | --sh)
2308 ac_prev=sharedstatedir ;;
2309 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
2310 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
2311 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
2312 | --sha=* | --sh=*)
2313 sharedstatedir=$ac_optarg ;;
2314
2315 -site | --site | --sit)
2316 ac_prev=site ;;
2317 -site=* | --site=* | --sit=*)
2318 site=$ac_optarg ;;
2319
2320 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
2321 ac_prev=srcdir ;;
2322 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
2323 srcdir=$ac_optarg ;;
2324
2325 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
2326 | --syscon | --sysco | --sysc | --sys | --sy)
2327 ac_prev=sysconfdir ;;
2328 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
2329 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
2330 sysconfdir=$ac_optarg ;;
2331
2332 -target | --target | --targe | --targ | --tar | --ta | --t)
2333 ac_prev=target_alias ;;
2334 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
2335 target_alias=$ac_optarg ;;
2336
2337 -v | -verbose | --verbose | --verbos | --verbo | --verb)
2338 verbose=yes ;;
2339
2340 -version | --version | --versio | --versi | --vers | -V)
2341 ac_init_version=: ;;
2342
2343 -with-* | --with-*)
2344 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
2345 # Reject names that are not valid shell variable names.
2346 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2347 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2348 ac_useropt_orig=$ac_useropt
2349 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2350 case $ac_user_opts in
2351 *"
2352"with_$ac_useropt"
2353"*) ;;
2354 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
2355 ac_unrecognized_sep=', ';;
2356 esac
2357 eval with_$ac_useropt=\$ac_optarg ;;
2358
2359 -without-* | --without-*)
2360 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
2361 # Reject names that are not valid shell variable names.
2362 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2363 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2364 ac_useropt_orig=$ac_useropt
2365 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2366 case $ac_user_opts in
2367 *"
2368"with_$ac_useropt"
2369"*) ;;
2370 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
2371 ac_unrecognized_sep=', ';;
2372 esac
2373 eval with_$ac_useropt=no ;;
2374
2375 --x)
2376 # Obsolete; use --with-x.
2377 with_x=yes ;;
2378
2379 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
2380 | --x-incl | --x-inc | --x-in | --x-i)
2381 ac_prev=x_includes ;;
2382 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
2383 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
2384 x_includes=$ac_optarg ;;
2385
2386 -x-libraries | --x-libraries | --x-librarie | --x-librari \
2387 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
2388 ac_prev=x_libraries ;;
2389 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
2390 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
2391 x_libraries=$ac_optarg ;;
2392
d0ac1c44
SM
2393 -*) as_fn_error $? "unrecognized option: \`$ac_option'
2394Try \`$0 --help' for more information"
c971b7fa
PA
2395 ;;
2396
2397 *=*)
2398 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
2399 # Reject names that are not valid shell variable names.
2400 case $ac_envvar in #(
2401 '' | [0-9]* | *[!_$as_cr_alnum]* )
d0ac1c44 2402 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
c971b7fa
PA
2403 esac
2404 eval $ac_envvar=\$ac_optarg
2405 export $ac_envvar ;;
2406
2407 *)
2408 # FIXME: should be removed in autoconf 3.0.
2409 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
2410 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
2411 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
d0ac1c44 2412 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
c971b7fa
PA
2413 ;;
2414
2415 esac
2416done
2417
2418if test -n "$ac_prev"; then
2419 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
d0ac1c44 2420 as_fn_error $? "missing argument to $ac_option"
c971b7fa
PA
2421fi
2422
2423if test -n "$ac_unrecognized_opts"; then
2424 case $enable_option_checking in
2425 no) ;;
d0ac1c44 2426 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
c971b7fa
PA
2427 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
2428 esac
2429fi
2430
2431# Check all directory arguments for consistency.
2432for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
2433 datadir sysconfdir sharedstatedir localstatedir includedir \
2434 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
2435 libdir localedir mandir
2436do
2437 eval ac_val=\$$ac_var
2438 # Remove trailing slashes.
2439 case $ac_val in
2440 */ )
2441 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
2442 eval $ac_var=\$ac_val;;
2443 esac
2444 # Be sure to have absolute directory names.
2445 case $ac_val in
2446 [\\/$]* | ?:[\\/]* ) continue;;
2447 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
2448 esac
d0ac1c44 2449 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
c971b7fa
PA
2450done
2451
2452# There might be people who depend on the old broken behavior: `$host'
2453# used to hold the argument of --host etc.
2454# FIXME: To remove some day.
2455build=$build_alias
2456host=$host_alias
2457target=$target_alias
2458
2459# FIXME: To remove some day.
2460if test "x$host_alias" != x; then
2461 if test "x$build_alias" = x; then
2462 cross_compiling=maybe
c971b7fa
PA
2463 elif test "x$build_alias" != "x$host_alias"; then
2464 cross_compiling=yes
2465 fi
2466fi
2467
2468ac_tool_prefix=
2469test -n "$host_alias" && ac_tool_prefix=$host_alias-
2470
2471test "$silent" = yes && exec 6>/dev/null
2472
2473
2474ac_pwd=`pwd` && test -n "$ac_pwd" &&
2475ac_ls_di=`ls -di .` &&
2476ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
d0ac1c44 2477 as_fn_error $? "working directory cannot be determined"
c971b7fa 2478test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
d0ac1c44 2479 as_fn_error $? "pwd does not report name of working directory"
c971b7fa
PA
2480
2481
2482# Find the source files, if location was not specified.
2483if test -z "$srcdir"; then
2484 ac_srcdir_defaulted=yes
2485 # Try the directory containing this script, then the parent directory.
2486 ac_confdir=`$as_dirname -- "$as_myself" ||
2487$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2488 X"$as_myself" : 'X\(//\)[^/]' \| \
2489 X"$as_myself" : 'X\(//\)$' \| \
2490 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
2491$as_echo X"$as_myself" |
2492 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
2493 s//\1/
2494 q
2495 }
2496 /^X\(\/\/\)[^/].*/{
2497 s//\1/
2498 q
2499 }
2500 /^X\(\/\/\)$/{
2501 s//\1/
2502 q
2503 }
2504 /^X\(\/\).*/{
2505 s//\1/
2506 q
2507 }
2508 s/.*/./; q'`
2509 srcdir=$ac_confdir
2510 if test ! -r "$srcdir/$ac_unique_file"; then
2511 srcdir=..
2512 fi
2513else
2514 ac_srcdir_defaulted=no
2515fi
2516if test ! -r "$srcdir/$ac_unique_file"; then
2517 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
d0ac1c44 2518 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
c971b7fa
PA
2519fi
2520ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
2521ac_abs_confdir=`(
d0ac1c44 2522 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
c971b7fa
PA
2523 pwd)`
2524# When building in place, set srcdir=.
2525if test "$ac_abs_confdir" = "$ac_pwd"; then
2526 srcdir=.
2527fi
2528# Remove unnecessary trailing slashes from srcdir.
2529# Double slashes in file names in object file debugging info
2530# mess up M-x gdb in Emacs.
2531case $srcdir in
2532*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
2533esac
2534for ac_var in $ac_precious_vars; do
2535 eval ac_env_${ac_var}_set=\${${ac_var}+set}
2536 eval ac_env_${ac_var}_value=\$${ac_var}
2537 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
2538 eval ac_cv_env_${ac_var}_value=\$${ac_var}
2539done
2540
2541#
2542# Report the --help message.
2543#
2544if test "$ac_init_help" = "long"; then
2545 # Omit some internal or obsolete options to make the list less imposing.
2546 # This message is too long to be a string in the A/UX 3.1 sh.
2547 cat <<_ACEOF
d0ac1c44 2548\`configure' configures libgnu UNUSED-VERSION to adapt to many kinds of systems.
c971b7fa
PA
2549
2550Usage: $0 [OPTION]... [VAR=VALUE]...
2551
2552To assign environment variables (e.g., CC, CFLAGS...), specify them as
2553VAR=VALUE. See below for descriptions of some of the useful variables.
2554
2555Defaults for the options are specified in brackets.
2556
2557Configuration:
2558 -h, --help display this help and exit
2559 --help=short display options specific to this package
2560 --help=recursive display the short help of all the included packages
2561 -V, --version display version information and exit
d0ac1c44 2562 -q, --quiet, --silent do not print \`checking ...' messages
c971b7fa
PA
2563 --cache-file=FILE cache test results in FILE [disabled]
2564 -C, --config-cache alias for \`--cache-file=config.cache'
2565 -n, --no-create do not create output files
2566 --srcdir=DIR find the sources in DIR [configure dir or \`..']
2567
2568Installation directories:
2569 --prefix=PREFIX install architecture-independent files in PREFIX
2570 [$ac_default_prefix]
2571 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
2572 [PREFIX]
2573
2574By default, \`make install' will install all the files in
2575\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
2576an installation prefix other than \`$ac_default_prefix' using \`--prefix',
2577for instance \`--prefix=\$HOME'.
2578
2579For better control, use the options below.
2580
2581Fine tuning of the installation directories:
2582 --bindir=DIR user executables [EPREFIX/bin]
2583 --sbindir=DIR system admin executables [EPREFIX/sbin]
2584 --libexecdir=DIR program executables [EPREFIX/libexec]
2585 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
2586 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
2587 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
2588 --libdir=DIR object code libraries [EPREFIX/lib]
2589 --includedir=DIR C header files [PREFIX/include]
2590 --oldincludedir=DIR C header files for non-gcc [/usr/include]
2591 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
2592 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
2593 --infodir=DIR info documentation [DATAROOTDIR/info]
2594 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
2595 --mandir=DIR man documentation [DATAROOTDIR/man]
d0ac1c44 2596 --docdir=DIR documentation root [DATAROOTDIR/doc/libgnu]
c971b7fa
PA
2597 --htmldir=DIR html documentation [DOCDIR]
2598 --dvidir=DIR dvi documentation [DOCDIR]
2599 --pdfdir=DIR pdf documentation [DOCDIR]
2600 --psdir=DIR ps documentation [DOCDIR]
2601_ACEOF
2602
2603 cat <<\_ACEOF
2604
2605Program names:
2606 --program-prefix=PREFIX prepend PREFIX to installed program names
2607 --program-suffix=SUFFIX append SUFFIX to installed program names
2608 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
2609
2610System types:
2611 --build=BUILD configure for building on BUILD [guessed]
2612 --host=HOST cross-compile to build programs to run on HOST [BUILD]
2613 --target=TARGET configure for building compilers for TARGET [HOST]
2614_ACEOF
2615fi
2616
2617if test -n "$ac_init_help"; then
d0ac1c44
SM
2618 case $ac_init_help in
2619 short | recursive ) echo "Configuration of libgnu UNUSED-VERSION:";;
2620 esac
c971b7fa
PA
2621 cat <<\_ACEOF
2622
2623Optional Features:
2624 --disable-option-checking ignore unrecognized --enable/--with options
2625 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
2626 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
d0ac1c44
SM
2627 --enable-maintainer-mode
2628 enable make rules and dependencies not useful (and
2629 sometimes confusing) to the casual installer
c8693053 2630 --enable-plugins Enable support for plugins
2196f55f 2631 --disable-largefile omit support for large files
c0c3707f 2632 --enable-threads={isoc|posix|isoc+posix|windows}
5abebf3c
CB
2633 specify multithreading API
2634 --disable-threads build without multithread safety
c0c3707f
CB
2635 --enable-cross-guesses={conservative|risky}
2636 specify policy for cross-compilation guesses
d0ac1c44
SM
2637 --enable-dependency-tracking
2638 do not reject slow dependency extractors
2639 --disable-dependency-tracking
2640 speeds up one-time build
2641 --enable-silent-rules less verbose build output (undo: "make V=1")
2642 --disable-silent-rules verbose build output (undo: "make V=0")
c971b7fa
PA
2643
2644Some influential environment variables:
2645 CC C compiler command
2646 CFLAGS C compiler flags
2647 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
2648 nonstandard directory <lib dir>
2649 LIBS libraries to pass to the linker, e.g. -l<library>
d0ac1c44 2650 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
c971b7fa
PA
2651 you have headers in a nonstandard directory <include dir>
2652 CPP C preprocessor
2653
2654Use these variables to override the choices made by `configure' or to help
2655it to find libraries and programs with nonstandard names/locations.
2656
2657Report bugs to the package provider.
2658_ACEOF
2659ac_status=$?
2660fi
2661
2662if test "$ac_init_help" = "recursive"; then
2663 # If there are subdirs, report their specific --help.
2664 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
2665 test -d "$ac_dir" ||
2666 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
2667 continue
2668 ac_builddir=.
2669
2670case "$ac_dir" in
2671.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
2672*)
2673 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
2674 # A ".." for each directory in $ac_dir_suffix.
2675 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
2676 case $ac_top_builddir_sub in
2677 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
2678 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
2679 esac ;;
2680esac
2681ac_abs_top_builddir=$ac_pwd
2682ac_abs_builddir=$ac_pwd$ac_dir_suffix
2683# for backward compatibility:
2684ac_top_builddir=$ac_top_build_prefix
2685
2686case $srcdir in
2687 .) # We are building in place.
2688 ac_srcdir=.
2689 ac_top_srcdir=$ac_top_builddir_sub
2690 ac_abs_top_srcdir=$ac_pwd ;;
2691 [\\/]* | ?:[\\/]* ) # Absolute name.
2692 ac_srcdir=$srcdir$ac_dir_suffix;
2693 ac_top_srcdir=$srcdir
2694 ac_abs_top_srcdir=$srcdir ;;
2695 *) # Relative name.
2696 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
2697 ac_top_srcdir=$ac_top_build_prefix$srcdir
2698 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
2699esac
2700ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
2701
2702 cd "$ac_dir" || { ac_status=$?; continue; }
2703 # Check for guested configure.
2704 if test -f "$ac_srcdir/configure.gnu"; then
2705 echo &&
2706 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
2707 elif test -f "$ac_srcdir/configure"; then
2708 echo &&
2709 $SHELL "$ac_srcdir/configure" --help=recursive
2710 else
2711 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
2712 fi || ac_status=$?
2713 cd "$ac_pwd" || { ac_status=$?; break; }
2714 done
2715fi
2716
2717test -n "$ac_init_help" && exit $ac_status
2718if $ac_init_version; then
2719 cat <<\_ACEOF
d0ac1c44
SM
2720libgnu configure UNUSED-VERSION
2721generated by GNU Autoconf 2.69
c971b7fa 2722
d0ac1c44 2723Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
2724This configure script is free software; the Free Software Foundation
2725gives unlimited permission to copy, distribute and modify it.
2726_ACEOF
2727 exit
2728fi
2729
2730## ------------------------ ##
2731## Autoconf initialization. ##
2732## ------------------------ ##
2733
2734# ac_fn_c_try_compile LINENO
2735# --------------------------
2736# Try to compile conftest.$ac_ext, and return whether this succeeded.
2737ac_fn_c_try_compile ()
2738{
2739 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2740 rm -f conftest.$ac_objext
2741 if { { ac_try="$ac_compile"
2742case "(($ac_try" in
2743 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2744 *) ac_try_echo=$ac_try;;
2745esac
2746eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2747$as_echo "$ac_try_echo"; } >&5
2748 (eval "$ac_compile") 2>conftest.err
2749 ac_status=$?
2750 if test -s conftest.err; then
2751 grep -v '^ *+' conftest.err >conftest.er1
2752 cat conftest.er1 >&5
2753 mv -f conftest.er1 conftest.err
2754 fi
2755 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2756 test $ac_status = 0; } && {
2757 test -z "$ac_c_werror_flag" ||
2758 test ! -s conftest.err
2759 } && test -s conftest.$ac_objext; then :
2760 ac_retval=0
2761else
2762 $as_echo "$as_me: failed program was:" >&5
2763sed 's/^/| /' conftest.$ac_ext >&5
2764
2765 ac_retval=1
2766fi
d0ac1c44
SM
2767 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2768 as_fn_set_status $ac_retval
c971b7fa
PA
2769
2770} # ac_fn_c_try_compile
2771
9c9d63b1
PM
2772# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
2773# -------------------------------------------------------
2774# Tests whether HEADER exists and can be compiled using the include files in
2775# INCLUDES, setting the cache variable VAR accordingly.
2776ac_fn_c_check_header_compile ()
2777{
2778 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2780$as_echo_n "checking for $2... " >&6; }
2781if eval \${$3+:} false; then :
2782 $as_echo_n "(cached) " >&6
2783else
2784 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2785/* end confdefs.h. */
2786$4
2787#include <$2>
2788_ACEOF
2789if ac_fn_c_try_compile "$LINENO"; then :
2790 eval "$3=yes"
2791else
2792 eval "$3=no"
2793fi
2794rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2795fi
2796eval ac_res=\$$3
2797 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2798$as_echo "$ac_res" >&6; }
2799 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2800
2801} # ac_fn_c_check_header_compile
2802
c971b7fa
PA
2803# ac_fn_c_try_cpp LINENO
2804# ----------------------
2805# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
2806ac_fn_c_try_cpp ()
2807{
2808 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2809 if { { ac_try="$ac_cpp conftest.$ac_ext"
2810case "(($ac_try" in
2811 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2812 *) ac_try_echo=$ac_try;;
2813esac
2814eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2815$as_echo "$ac_try_echo"; } >&5
2816 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
2817 ac_status=$?
2818 if test -s conftest.err; then
2819 grep -v '^ *+' conftest.err >conftest.er1
2820 cat conftest.er1 >&5
2821 mv -f conftest.er1 conftest.err
2822 fi
2823 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
d0ac1c44 2824 test $ac_status = 0; } > conftest.i && {
c971b7fa
PA
2825 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
2826 test ! -s conftest.err
2827 }; then :
2828 ac_retval=0
2829else
2830 $as_echo "$as_me: failed program was:" >&5
2831sed 's/^/| /' conftest.$ac_ext >&5
2832
2833 ac_retval=1
2834fi
d0ac1c44
SM
2835 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2836 as_fn_set_status $ac_retval
c971b7fa
PA
2837
2838} # ac_fn_c_try_cpp
2839
c971b7fa
PA
2840# ac_fn_c_try_run LINENO
2841# ----------------------
2842# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
2843# that executables *can* be run.
2844ac_fn_c_try_run ()
2845{
2846 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2847 if { { ac_try="$ac_link"
2848case "(($ac_try" in
2849 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2850 *) ac_try_echo=$ac_try;;
2851esac
2852eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2853$as_echo "$ac_try_echo"; } >&5
2854 (eval "$ac_link") 2>&5
2855 ac_status=$?
2856 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2857 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
2858 { { case "(($ac_try" in
2859 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2860 *) ac_try_echo=$ac_try;;
2861esac
2862eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2863$as_echo "$ac_try_echo"; } >&5
2864 (eval "$ac_try") 2>&5
2865 ac_status=$?
2866 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2867 test $ac_status = 0; }; }; then :
2868 ac_retval=0
2869else
2870 $as_echo "$as_me: program exited with status $ac_status" >&5
2871 $as_echo "$as_me: failed program was:" >&5
2872sed 's/^/| /' conftest.$ac_ext >&5
2873
2874 ac_retval=$ac_status
2875fi
2876 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
d0ac1c44
SM
2877 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2878 as_fn_set_status $ac_retval
c971b7fa
PA
2879
2880} # ac_fn_c_try_run
2881
73cc7272
TT
2882# ac_fn_c_try_link LINENO
2883# -----------------------
2884# Try to link conftest.$ac_ext, and return whether this succeeded.
2885ac_fn_c_try_link ()
2886{
2887 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2888 rm -f conftest.$ac_objext conftest$ac_exeext
2889 if { { ac_try="$ac_link"
2890case "(($ac_try" in
2891 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2892 *) ac_try_echo=$ac_try;;
2893esac
2894eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2895$as_echo "$ac_try_echo"; } >&5
2896 (eval "$ac_link") 2>conftest.err
2897 ac_status=$?
2898 if test -s conftest.err; then
2899 grep -v '^ *+' conftest.err >conftest.er1
2900 cat conftest.er1 >&5
2901 mv -f conftest.er1 conftest.err
2902 fi
2903 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2904 test $ac_status = 0; } && {
2905 test -z "$ac_c_werror_flag" ||
2906 test ! -s conftest.err
2907 } && test -s conftest$ac_exeext && {
2908 test "$cross_compiling" = yes ||
2909 test -x conftest$ac_exeext
2910 }; then :
2911 ac_retval=0
2912else
2913 $as_echo "$as_me: failed program was:" >&5
2914sed 's/^/| /' conftest.$ac_ext >&5
2915
2916 ac_retval=1
2917fi
2918 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2919 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2920 # interfere with the next link command; also delete a directory that is
2921 # left behind by Apple's compiler. We do this before executing the actions.
2922 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2923 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2924 as_fn_set_status $ac_retval
2925
2926} # ac_fn_c_try_link
2927
d0ac1c44
SM
2928# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2929# -------------------------------------------
2930# Tests whether TYPE exists after having included INCLUDES, setting cache
2931# variable VAR accordingly.
2932ac_fn_c_check_type ()
2933{
2934 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2935 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2936$as_echo_n "checking for $2... " >&6; }
2937if eval \${$3+:} false; then :
2938 $as_echo_n "(cached) " >&6
2939else
2940 eval "$3=no"
2941 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2942/* end confdefs.h. */
2943$4
2944int
2945main ()
2946{
2947if (sizeof ($2))
2948 return 0;
2949 ;
2950 return 0;
2951}
2952_ACEOF
2953if ac_fn_c_try_compile "$LINENO"; then :
2954 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2955/* end confdefs.h. */
2956$4
2957int
2958main ()
2959{
2960if (sizeof (($2)))
2961 return 0;
2962 ;
2963 return 0;
2964}
2965_ACEOF
2966if ac_fn_c_try_compile "$LINENO"; then :
2967
2968else
2969 eval "$3=yes"
2970fi
2971rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2972fi
2973rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2974fi
2975eval ac_res=\$$3
2976 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2977$as_echo "$ac_res" >&6; }
2978 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2979
2980} # ac_fn_c_check_type
2981
9c9d63b1
PM
2982# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
2983# -------------------------------------------------------
2984# Tests whether HEADER exists, giving a warning if it cannot be compiled using
2985# the include files in INCLUDES and setting the cache variable VAR
2986# accordingly.
2987ac_fn_c_check_header_mongrel ()
2988{
2989 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2990 if eval \${$3+:} false; then :
2991 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2992$as_echo_n "checking for $2... " >&6; }
2993if eval \${$3+:} false; then :
2994 $as_echo_n "(cached) " >&6
2995fi
2996eval ac_res=\$$3
2997 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2998$as_echo "$ac_res" >&6; }
2999else
3000 # Is the header compilable?
3001{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
3002$as_echo_n "checking $2 usability... " >&6; }
3003cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3004/* end confdefs.h. */
3005$4
3006#include <$2>
3007_ACEOF
3008if ac_fn_c_try_compile "$LINENO"; then :
3009 ac_header_compiler=yes
3010else
3011 ac_header_compiler=no
3012fi
3013rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
3015$as_echo "$ac_header_compiler" >&6; }
3016
3017# Is the header present?
3018{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
3019$as_echo_n "checking $2 presence... " >&6; }
3020cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3021/* end confdefs.h. */
3022#include <$2>
3023_ACEOF
3024if ac_fn_c_try_cpp "$LINENO"; then :
3025 ac_header_preproc=yes
3026else
3027 ac_header_preproc=no
3028fi
3029rm -f conftest.err conftest.i conftest.$ac_ext
3030{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
3031$as_echo "$ac_header_preproc" >&6; }
3032
3033# So? What about this header?
3034case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
3035 yes:no: )
3036 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
3037$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
3038 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
3039$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
3040 ;;
3041 no:yes:* )
3042 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
3043$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
3044 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
3045$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
3046 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
3047$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
3048 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
3049$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
3050 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
3051$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
3052 ;;
3053esac
3054 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
3055$as_echo_n "checking for $2... " >&6; }
3056if eval \${$3+:} false; then :
3057 $as_echo_n "(cached) " >&6
3058else
3059 eval "$3=\$ac_header_compiler"
3060fi
3061eval ac_res=\$$3
3062 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3063$as_echo "$ac_res" >&6; }
3064fi
3065 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3066
3067} # ac_fn_c_check_header_mongrel
3068
8690e634
JK
3069# ac_fn_c_check_func LINENO FUNC VAR
3070# ----------------------------------
3071# Tests whether FUNC exists, setting the cache variable VAR accordingly
3072ac_fn_c_check_func ()
3073{
3074 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3075 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
3076$as_echo_n "checking for $2... " >&6; }
d0ac1c44 3077if eval \${$3+:} false; then :
8690e634
JK
3078 $as_echo_n "(cached) " >&6
3079else
3080 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3081/* end confdefs.h. */
3082/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
3083 For example, HP-UX 11i <limits.h> declares gettimeofday. */
3084#define $2 innocuous_$2
3085
3086/* System header to define __stub macros and hopefully few prototypes,
3087 which can conflict with char $2 (); below.
3088 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3089 <limits.h> exists even on freestanding compilers. */
3090
3091#ifdef __STDC__
3092# include <limits.h>
3093#else
3094# include <assert.h>
3095#endif
3096
3097#undef $2
3098
3099/* Override any GCC internal prototype to avoid an error.
3100 Use char because int might match the return type of a GCC
3101 builtin and then its argument prototype would still apply. */
3102#ifdef __cplusplus
3103extern "C"
3104#endif
3105char $2 ();
3106/* The GNU C library defines this for functions which it implements
3107 to always fail with ENOSYS. Some functions are actually named
3108 something starting with __ and the normal name is an alias. */
3109#if defined __stub_$2 || defined __stub___$2
3110choke me
3111#endif
3112
3113int
3114main ()
3115{
3116return $2 ();
3117 ;
3118 return 0;
3119}
3120_ACEOF
3121if ac_fn_c_try_link "$LINENO"; then :
3122 eval "$3=yes"
3123else
3124 eval "$3=no"
3125fi
3126rm -f core conftest.err conftest.$ac_objext \
3127 conftest$ac_exeext conftest.$ac_ext
3128fi
3129eval ac_res=\$$3
3130 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3131$as_echo "$ac_res" >&6; }
d0ac1c44 3132 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
8690e634
JK
3133
3134} # ac_fn_c_check_func
3135
d0ac1c44
SM
3136# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
3137# ---------------------------------------------
3138# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
3139# accordingly.
8986e351
TT
3140ac_fn_c_check_decl ()
3141{
5df4cba6
SM
3142 ac_save_ac_compile="$ac_compile"
3143 if test -n "$ac_compile_for_check_decl"; then
3144 ac_compile="$ac_compile_for_check_decl"
3145 fi
8986e351 3146 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
d0ac1c44
SM
3147 as_decl_name=`echo $2|sed 's/ *(.*//'`
3148 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
3149 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
3150$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
3151if eval \${$3+:} false; then :
8986e351
TT
3152 $as_echo_n "(cached) " >&6
3153else
3154 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3155/* end confdefs.h. */
3156$4
3157int
3158main ()
3159{
d0ac1c44
SM
3160#ifndef $as_decl_name
3161#ifdef __cplusplus
3162 (void) $as_decl_use;
3163#else
3164 (void) $as_decl_name;
3165#endif
8986e351
TT
3166#endif
3167
3168 ;
3169 return 0;
3170}
3171_ACEOF
3172if ac_fn_c_try_compile "$LINENO"; then :
3173 eval "$3=yes"
3174else
3175 eval "$3=no"
3176fi
3177rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3178fi
3179eval ac_res=\$$3
3180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3181$as_echo "$ac_res" >&6; }
d0ac1c44 3182 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
5df4cba6 3183 ac_compile="$ac_save_ac_compile"
8986e351
TT
3184
3185} # ac_fn_c_check_decl
3186
c971b7fa
PA
3187# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
3188# --------------------------------------------
3189# Tries to find the compile-time value of EXPR in a program that includes
3190# INCLUDES, setting VAR accordingly. Returns whether the value could be
3191# computed
3192ac_fn_c_compute_int ()
3193{
3194 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3195 if test "$cross_compiling" = yes; then
3196 # Depending upon the size, compute the lo and hi bounds.
3197cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3198/* end confdefs.h. */
3199$4
3200int
3201main ()
3202{
3203static int test_array [1 - 2 * !(($2) >= 0)];
d0ac1c44
SM
3204test_array [0] = 0;
3205return test_array [0];
c971b7fa
PA
3206
3207 ;
3208 return 0;
3209}
3210_ACEOF
3211if ac_fn_c_try_compile "$LINENO"; then :
3212 ac_lo=0 ac_mid=0
3213 while :; do
3214 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3215/* end confdefs.h. */
3216$4
3217int
3218main ()
3219{
3220static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3221test_array [0] = 0;
3222return test_array [0];
c971b7fa
PA
3223
3224 ;
3225 return 0;
3226}
3227_ACEOF
3228if ac_fn_c_try_compile "$LINENO"; then :
3229 ac_hi=$ac_mid; break
3230else
3231 as_fn_arith $ac_mid + 1 && ac_lo=$as_val
3232 if test $ac_lo -le $ac_mid; then
3233 ac_lo= ac_hi=
3234 break
3235 fi
3236 as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
3237fi
3238rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3239 done
3240else
3241 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3242/* end confdefs.h. */
3243$4
3244int
3245main ()
3246{
3247static int test_array [1 - 2 * !(($2) < 0)];
d0ac1c44
SM
3248test_array [0] = 0;
3249return test_array [0];
c971b7fa
PA
3250
3251 ;
3252 return 0;
3253}
3254_ACEOF
3255if ac_fn_c_try_compile "$LINENO"; then :
3256 ac_hi=-1 ac_mid=-1
3257 while :; do
3258 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3259/* end confdefs.h. */
3260$4
3261int
3262main ()
3263{
3264static int test_array [1 - 2 * !(($2) >= $ac_mid)];
d0ac1c44
SM
3265test_array [0] = 0;
3266return test_array [0];
c971b7fa
PA
3267
3268 ;
3269 return 0;
3270}
3271_ACEOF
3272if ac_fn_c_try_compile "$LINENO"; then :
3273 ac_lo=$ac_mid; break
3274else
3275 as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
3276 if test $ac_mid -le $ac_hi; then
3277 ac_lo= ac_hi=
3278 break
3279 fi
3280 as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
3281fi
3282rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3283 done
3284else
3285 ac_lo= ac_hi=
3286fi
3287rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3288fi
3289rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3290# Binary search between lo and hi bounds.
3291while test "x$ac_lo" != "x$ac_hi"; do
3292 as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
3293 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3294/* end confdefs.h. */
3295$4
3296int
3297main ()
3298{
3299static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3300test_array [0] = 0;
3301return test_array [0];
c971b7fa
PA
3302
3303 ;
3304 return 0;
3305}
3306_ACEOF
3307if ac_fn_c_try_compile "$LINENO"; then :
3308 ac_hi=$ac_mid
3309else
3310 as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
3311fi
3312rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3313done
3314case $ac_lo in #((
3315?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
3316'') ac_retval=1 ;;
3317esac
3318 else
3319 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3320/* end confdefs.h. */
3321$4
3322static long int longval () { return $2; }
3323static unsigned long int ulongval () { return $2; }
3324#include <stdio.h>
3325#include <stdlib.h>
3326int
3327main ()
3328{
3329
3330 FILE *f = fopen ("conftest.val", "w");
3331 if (! f)
3332 return 1;
3333 if (($2) < 0)
3334 {
3335 long int i = longval ();
3336 if (i != ($2))
3337 return 1;
3338 fprintf (f, "%ld", i);
3339 }
3340 else
3341 {
3342 unsigned long int i = ulongval ();
3343 if (i != ($2))
3344 return 1;
3345 fprintf (f, "%lu", i);
3346 }
3347 /* Do not output a trailing newline, as this causes \r\n confusion
3348 on some platforms. */
3349 return ferror (f) || fclose (f) != 0;
3350
3351 ;
3352 return 0;
3353}
3354_ACEOF
3355if ac_fn_c_try_run "$LINENO"; then :
3356 echo >>conftest.val; read $3 <conftest.val; ac_retval=0
3357else
3358 ac_retval=1
3359fi
3360rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3361 conftest.$ac_objext conftest.beam conftest.$ac_ext
3362rm -f conftest.val
3363
3364 fi
d0ac1c44
SM
3365 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3366 as_fn_set_status $ac_retval
c971b7fa
PA
3367
3368} # ac_fn_c_compute_int
725e2999
JB
3369
3370# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
3371# ----------------------------------------------------
3372# Tries to find if the field MEMBER exists in type AGGR, after including
3373# INCLUDES, setting cache variable VAR accordingly.
3374ac_fn_c_check_member ()
3375{
3376 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3377 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
3378$as_echo_n "checking for $2.$3... " >&6; }
3379if eval \${$4+:} false; then :
3380 $as_echo_n "(cached) " >&6
3381else
3382 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3383/* end confdefs.h. */
3384$5
3385int
3386main ()
3387{
3388static $2 ac_aggr;
3389if (ac_aggr.$3)
3390return 0;
3391 ;
3392 return 0;
3393}
3394_ACEOF
3395if ac_fn_c_try_compile "$LINENO"; then :
3396 eval "$4=yes"
3397else
3398 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3399/* end confdefs.h. */
3400$5
3401int
3402main ()
3403{
3404static $2 ac_aggr;
3405if (sizeof ac_aggr.$3)
3406return 0;
3407 ;
3408 return 0;
3409}
3410_ACEOF
3411if ac_fn_c_try_compile "$LINENO"; then :
3412 eval "$4=yes"
3413else
3414 eval "$4=no"
3415fi
3416rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3417fi
3418rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3419fi
3420eval ac_res=\$$4
3421 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3422$as_echo "$ac_res" >&6; }
3423 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3424
3425} # ac_fn_c_check_member
c971b7fa
PA
3426cat >config.log <<_ACEOF
3427This file contains any messages produced by compilers while
3428running configure, to aid debugging if configure makes a mistake.
3429
d0ac1c44
SM
3430It was created by libgnu $as_me UNUSED-VERSION, which was
3431generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
3432
3433 $ $0 $@
3434
3435_ACEOF
3436exec 5>>config.log
3437{
3438cat <<_ASUNAME
3439## --------- ##
3440## Platform. ##
3441## --------- ##
3442
3443hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
3444uname -m = `(uname -m) 2>/dev/null || echo unknown`
3445uname -r = `(uname -r) 2>/dev/null || echo unknown`
3446uname -s = `(uname -s) 2>/dev/null || echo unknown`
3447uname -v = `(uname -v) 2>/dev/null || echo unknown`
3448
3449/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
3450/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
3451
3452/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
3453/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
3454/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
3455/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
3456/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
3457/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
3458/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
3459
3460_ASUNAME
3461
3462as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3463for as_dir in $PATH
3464do
3465 IFS=$as_save_IFS
3466 test -z "$as_dir" && as_dir=.
3467 $as_echo "PATH: $as_dir"
3468 done
3469IFS=$as_save_IFS
3470
3471} >&5
3472
3473cat >&5 <<_ACEOF
3474
3475
3476## ----------- ##
3477## Core tests. ##
3478## ----------- ##
3479
3480_ACEOF
3481
3482
3483# Keep a trace of the command line.
3484# Strip out --no-create and --no-recursion so they do not pile up.
3485# Strip out --silent because we don't want to record it for future runs.
3486# Also quote any args containing shell meta-characters.
3487# Make two passes to allow for proper duplicate-argument suppression.
3488ac_configure_args=
3489ac_configure_args0=
3490ac_configure_args1=
3491ac_must_keep_next=false
3492for ac_pass in 1 2
3493do
3494 for ac_arg
3495 do
3496 case $ac_arg in
3497 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
3498 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
3499 | -silent | --silent | --silen | --sile | --sil)
3500 continue ;;
3501 *\'*)
3502 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
3503 esac
3504 case $ac_pass in
3505 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
3506 2)
3507 as_fn_append ac_configure_args1 " '$ac_arg'"
3508 if test $ac_must_keep_next = true; then
3509 ac_must_keep_next=false # Got value, back to normal.
3510 else
3511 case $ac_arg in
3512 *=* | --config-cache | -C | -disable-* | --disable-* \
3513 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
3514 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
3515 | -with-* | --with-* | -without-* | --without-* | --x)
3516 case "$ac_configure_args0 " in
3517 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
3518 esac
3519 ;;
3520 -* ) ac_must_keep_next=true ;;
3521 esac
3522 fi
3523 as_fn_append ac_configure_args " '$ac_arg'"
3524 ;;
3525 esac
3526 done
3527done
3528{ ac_configure_args0=; unset ac_configure_args0;}
3529{ ac_configure_args1=; unset ac_configure_args1;}
3530
3531# When interrupted or exit'd, cleanup temporary files, and complete
3532# config.log. We remove comments because anyway the quotes in there
3533# would cause problems or look ugly.
3534# WARNING: Use '\'' to represent an apostrophe within the trap.
3535# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
3536trap 'exit_status=$?
3537 # Save into config.log some information that might help in debugging.
3538 {
3539 echo
3540
d0ac1c44 3541 $as_echo "## ---------------- ##
c971b7fa 3542## Cache variables. ##
d0ac1c44 3543## ---------------- ##"
c971b7fa
PA
3544 echo
3545 # The following way of writing the cache mishandles newlines in values,
3546(
3547 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
3548 eval ac_val=\$$ac_var
3549 case $ac_val in #(
3550 *${as_nl}*)
3551 case $ac_var in #(
3552 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
3553$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
3554 esac
3555 case $ac_var in #(
3556 _ | IFS | as_nl) ;; #(
3557 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
3558 *) { eval $ac_var=; unset $ac_var;} ;;
3559 esac ;;
3560 esac
3561 done
3562 (set) 2>&1 |
3563 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
3564 *${as_nl}ac_space=\ *)
3565 sed -n \
3566 "s/'\''/'\''\\\\'\'''\''/g;
3567 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
3568 ;; #(
3569 *)
3570 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
3571 ;;
3572 esac |
3573 sort
3574)
3575 echo
3576
d0ac1c44 3577 $as_echo "## ----------------- ##
c971b7fa 3578## Output variables. ##
d0ac1c44 3579## ----------------- ##"
c971b7fa
PA
3580 echo
3581 for ac_var in $ac_subst_vars
3582 do
3583 eval ac_val=\$$ac_var
3584 case $ac_val in
3585 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3586 esac
3587 $as_echo "$ac_var='\''$ac_val'\''"
3588 done | sort
3589 echo
3590
3591 if test -n "$ac_subst_files"; then
d0ac1c44 3592 $as_echo "## ------------------- ##
c971b7fa 3593## File substitutions. ##
d0ac1c44 3594## ------------------- ##"
c971b7fa
PA
3595 echo
3596 for ac_var in $ac_subst_files
3597 do
3598 eval ac_val=\$$ac_var
3599 case $ac_val in
3600 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3601 esac
3602 $as_echo "$ac_var='\''$ac_val'\''"
3603 done | sort
3604 echo
3605 fi
3606
3607 if test -s confdefs.h; then
d0ac1c44 3608 $as_echo "## ----------- ##
c971b7fa 3609## confdefs.h. ##
d0ac1c44 3610## ----------- ##"
c971b7fa
PA
3611 echo
3612 cat confdefs.h
3613 echo
3614 fi
3615 test "$ac_signal" != 0 &&
3616 $as_echo "$as_me: caught signal $ac_signal"
3617 $as_echo "$as_me: exit $exit_status"
3618 } >&5
3619 rm -f core *.core core.conftest.* &&
3620 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
3621 exit $exit_status
3622' 0
3623for ac_signal in 1 2 13 15; do
3624 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
3625done
3626ac_signal=0
3627
3628# confdefs.h avoids OS command line length limits that DEFS can exceed.
3629rm -f -r conftest* confdefs.h
3630
3631$as_echo "/* confdefs.h */" > confdefs.h
3632
3633# Predefined preprocessor variables.
3634
3635cat >>confdefs.h <<_ACEOF
3636#define PACKAGE_NAME "$PACKAGE_NAME"
3637_ACEOF
3638
3639cat >>confdefs.h <<_ACEOF
3640#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
3641_ACEOF
3642
3643cat >>confdefs.h <<_ACEOF
3644#define PACKAGE_VERSION "$PACKAGE_VERSION"
3645_ACEOF
3646
3647cat >>confdefs.h <<_ACEOF
3648#define PACKAGE_STRING "$PACKAGE_STRING"
3649_ACEOF
3650
3651cat >>confdefs.h <<_ACEOF
3652#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
3653_ACEOF
3654
3655cat >>confdefs.h <<_ACEOF
3656#define PACKAGE_URL "$PACKAGE_URL"
3657_ACEOF
3658
3659
3660# Let the site file select an alternate cache file if it wants to.
3661# Prefer an explicitly selected file to automatically selected ones.
3662ac_site_file1=NONE
3663ac_site_file2=NONE
3664if test -n "$CONFIG_SITE"; then
d0ac1c44
SM
3665 # We do not want a PATH search for config.site.
3666 case $CONFIG_SITE in #((
3667 -*) ac_site_file1=./$CONFIG_SITE;;
3668 */*) ac_site_file1=$CONFIG_SITE;;
3669 *) ac_site_file1=./$CONFIG_SITE;;
3670 esac
c971b7fa
PA
3671elif test "x$prefix" != xNONE; then
3672 ac_site_file1=$prefix/share/config.site
3673 ac_site_file2=$prefix/etc/config.site
3674else
3675 ac_site_file1=$ac_default_prefix/share/config.site
3676 ac_site_file2=$ac_default_prefix/etc/config.site
3677fi
3678for ac_site_file in "$ac_site_file1" "$ac_site_file2"
3679do
3680 test "x$ac_site_file" = xNONE && continue
d0ac1c44 3681 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
c971b7fa
PA
3682 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
3683$as_echo "$as_me: loading site script $ac_site_file" >&6;}
3684 sed 's/^/| /' "$ac_site_file" >&5
d0ac1c44
SM
3685 . "$ac_site_file" \
3686 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3687$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3688as_fn_error $? "failed to load site script $ac_site_file
3689See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
3690 fi
3691done
3692
3693if test -r "$cache_file"; then
d0ac1c44
SM
3694 # Some versions of bash will fail to source /dev/null (special files
3695 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
3696 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
c971b7fa
PA
3697 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
3698$as_echo "$as_me: loading cache $cache_file" >&6;}
3699 case $cache_file in
3700 [\\/]* | ?:[\\/]* ) . "$cache_file";;
3701 *) . "./$cache_file";;
3702 esac
3703 fi
3704else
3705 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
3706$as_echo "$as_me: creating cache $cache_file" >&6;}
3707 >$cache_file
3708fi
3709
9c9d63b1
PM
3710as_fn_append ac_header_list " wchar.h"
3711as_fn_append ac_header_list " minix/config.h"
c0c3707f
CB
3712as_fn_append ac_header_list " arpa/inet.h"
3713as_fn_append ac_header_list " features.h"
3714as_fn_append ac_header_list " sys/socket.h"
698be2d8 3715as_fn_append ac_func_list " btowc"
c0c3707f 3716as_fn_append ac_func_list " canonicalize_file_name"
9c9d63b1 3717as_fn_append ac_func_list " faccessat"
c0c3707f
CB
3718as_fn_append ac_func_list " realpath"
3719as_fn_append ac_header_list " sys/param.h"
3720as_fn_append ac_header_list " unistd.h"
3721as_fn_append ac_func_list " _set_invalid_parameter_handler"
3722as_fn_append ac_func_list " fchdir"
3723as_fn_append ac_header_list " dirent.h"
3724as_fn_append ac_func_list " fcntl"
3725as_fn_append ac_func_list " symlink"
3726as_fn_append ac_func_list " fdopendir"
3727as_fn_append ac_func_list " mempcpy"
3728as_fn_append ac_header_list " fnmatch.h"
3729as_fn_append ac_func_list " fnmatch"
c0c3707f 3730as_fn_append ac_func_list " mbsrtowcs"
8690e634 3731gl_fnmatch_required=GNU
c0c3707f
CB
3732as_fn_append ac_header_list " sys/stat.h"
3733as_fn_append ac_func_list " fstatat"
c17253b9 3734as_fn_append ac_func_list " getdelim"
c0c3707f
CB
3735as_fn_append ac_func_list " getdtablesize"
3736as_fn_append ac_func_list " getlogin_r"
3737as_fn_append ac_func_list " getprogname"
3738as_fn_append ac_func_list " getexecname"
698be2d8 3739as_fn_append ac_func_list " getrandom"
c0c3707f
CB
3740as_fn_append ac_header_list " sys/time.h"
3741as_fn_append ac_func_list " gettimeofday"
3742as_fn_append ac_header_list " glob.h"
3743as_fn_append ac_func_list " glob"
3744as_fn_append ac_func_list " glob_pattern_p"
3745as_fn_append ac_func_list " getpwnam_r"
5df4cba6 3746as_fn_append ac_header_list " threads.h"
c0c3707f
CB
3747as_fn_append ac_header_list " netdb.h"
3748as_fn_append ac_header_list " netinet/in.h"
3749as_fn_append ac_header_list " limits.h"
c0c3707f 3750as_fn_append ac_header_list " inttypes.h"
9c9d63b1
PM
3751as_fn_append ac_header_list " sys/types.h"
3752as_fn_append ac_header_list " stdint.h"
698be2d8 3753as_fn_append ac_func_list " isblank"
5df4cba6 3754as_fn_append ac_header_list " xlocale.h"
c0c3707f
CB
3755as_fn_append ac_func_list " lstat"
3756as_fn_append ac_header_list " math.h"
3757as_fn_append ac_func_list " mbsinit"
3758as_fn_append ac_func_list " mbrtowc"
3759as_fn_append ac_header_list " sys/mman.h"
3760as_fn_append ac_func_list " mprotect"
3761as_fn_append ac_func_list " mkostemp"
3762as_fn_append ac_func_list " openat"
9c9d63b1
PM
3763as_fn_append ac_func_list " pipe"
3764as_fn_append ac_func_list " readlink"
c0c3707f
CB
3765as_fn_append ac_func_list " link"
3766as_fn_append ac_func_list " setenv"
c0c3707f
CB
3767as_fn_append ac_func_list " strerror_r"
3768as_fn_append ac_func_list " __xpg_strerror_r"
3769as_fn_append ac_func_list " catgets"
3770as_fn_append ac_func_list " snprintf"
698be2d8 3771as_fn_append ac_header_list " sys/random.h"
c0c3707f
CB
3772as_fn_append ac_header_list " sys/uio.h"
3773as_fn_append ac_func_list " localtime_r"
c0c3707f
CB
3774as_fn_append ac_header_list " crtdefs.h"
3775as_fn_append ac_func_list " iswcntrl"
698be2d8
CB
3776as_fn_append ac_header_list " wctype.h"
3777as_fn_append ac_func_list " wmempcpy"
c971b7fa
PA
3778# Check that the precious variables saved in the cache have kept the same
3779# value.
3780ac_cache_corrupted=false
3781for ac_var in $ac_precious_vars; do
3782 eval ac_old_set=\$ac_cv_env_${ac_var}_set
3783 eval ac_new_set=\$ac_env_${ac_var}_set
3784 eval ac_old_val=\$ac_cv_env_${ac_var}_value
3785 eval ac_new_val=\$ac_env_${ac_var}_value
3786 case $ac_old_set,$ac_new_set in
3787 set,)
3788 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
3789$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
3790 ac_cache_corrupted=: ;;
3791 ,set)
3792 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
3793$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
3794 ac_cache_corrupted=: ;;
3795 ,);;
3796 *)
3797 if test "x$ac_old_val" != "x$ac_new_val"; then
3798 # differences in whitespace do not lead to failure.
3799 ac_old_val_w=`echo x $ac_old_val`
3800 ac_new_val_w=`echo x $ac_new_val`
3801 if test "$ac_old_val_w" != "$ac_new_val_w"; then
3802 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
3803$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
3804 ac_cache_corrupted=:
3805 else
3806 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
3807$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
3808 eval $ac_var=\$ac_old_val
3809 fi
3810 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
3811$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
3812 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
3813$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
3814 fi;;
3815 esac
3816 # Pass precious variables to config.status.
3817 if test "$ac_new_set" = set; then
3818 case $ac_new_val in
3819 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
3820 *) ac_arg=$ac_var=$ac_new_val ;;
3821 esac
3822 case " $ac_configure_args " in
3823 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
3824 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
3825 esac
3826 fi
3827done
3828if $ac_cache_corrupted; then
3829 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3830$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3831 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
3832$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
d0ac1c44 3833 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
c971b7fa
PA
3834fi
3835## -------------------- ##
3836## Main body of script. ##
3837## -------------------- ##
3838
3839ac_ext=c
3840ac_cpp='$CPP $CPPFLAGS'
3841ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3842ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3843ac_compiler_gnu=$ac_cv_c_compiler_gnu
3844
3845
d0ac1c44 3846
73cc7272
TT
3847
3848
3849
c971b7fa
PA
3850ac_config_headers="$ac_config_headers config.h:config.in"
3851
3852
5abebf3c
CB
3853
3854
c971b7fa
PA
3855{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
3856$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
3857 # Check whether --enable-maintainer-mode was given.
3858if test "${enable_maintainer_mode+set}" = set; then :
3859 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
3860else
3861 USE_MAINTAINER_MODE=no
3862fi
3863
3864 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
3865$as_echo "$USE_MAINTAINER_MODE" >&6; }
3866 if test $USE_MAINTAINER_MODE = yes; then
3867 MAINTAINER_MODE_TRUE=
3868 MAINTAINER_MODE_FALSE='#'
3869else
3870 MAINTAINER_MODE_TRUE='#'
3871 MAINTAINER_MODE_FALSE=
3872fi
3873
3874 MAINT=$MAINTAINER_MODE_TRUE
3875
3876
3877
3878ac_ext=c
3879ac_cpp='$CPP $CPPFLAGS'
3880ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3881ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3882ac_compiler_gnu=$ac_cv_c_compiler_gnu
3883if test -n "$ac_tool_prefix"; then
3884 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3885set dummy ${ac_tool_prefix}gcc; ac_word=$2
3886{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3887$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3888if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3889 $as_echo_n "(cached) " >&6
3890else
3891 if test -n "$CC"; then
3892 ac_cv_prog_CC="$CC" # Let the user override the test.
3893else
3894as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3895for as_dir in $PATH
3896do
3897 IFS=$as_save_IFS
3898 test -z "$as_dir" && as_dir=.
3899 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3900 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3901 ac_cv_prog_CC="${ac_tool_prefix}gcc"
3902 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3903 break 2
3904 fi
3905done
3906 done
3907IFS=$as_save_IFS
3908
3909fi
3910fi
3911CC=$ac_cv_prog_CC
3912if test -n "$CC"; then
3913 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3914$as_echo "$CC" >&6; }
3915else
3916 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3917$as_echo "no" >&6; }
3918fi
3919
3920
3921fi
3922if test -z "$ac_cv_prog_CC"; then
3923 ac_ct_CC=$CC
3924 # Extract the first word of "gcc", so it can be a program name with args.
3925set dummy gcc; ac_word=$2
3926{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3927$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3928if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
3929 $as_echo_n "(cached) " >&6
3930else
3931 if test -n "$ac_ct_CC"; then
3932 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3933else
3934as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3935for as_dir in $PATH
3936do
3937 IFS=$as_save_IFS
3938 test -z "$as_dir" && as_dir=.
3939 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3940 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3941 ac_cv_prog_ac_ct_CC="gcc"
3942 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3943 break 2
3944 fi
3945done
3946 done
3947IFS=$as_save_IFS
3948
3949fi
3950fi
3951ac_ct_CC=$ac_cv_prog_ac_ct_CC
3952if test -n "$ac_ct_CC"; then
3953 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3954$as_echo "$ac_ct_CC" >&6; }
3955else
3956 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3957$as_echo "no" >&6; }
3958fi
3959
3960 if test "x$ac_ct_CC" = x; then
3961 CC=""
3962 else
3963 case $cross_compiling:$ac_tool_warned in
3964yes:)
3965{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3966$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3967ac_tool_warned=yes ;;
3968esac
3969 CC=$ac_ct_CC
3970 fi
3971else
3972 CC="$ac_cv_prog_CC"
3973fi
3974
3975if test -z "$CC"; then
3976 if test -n "$ac_tool_prefix"; then
3977 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3978set dummy ${ac_tool_prefix}cc; ac_word=$2
3979{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3980$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3981if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3982 $as_echo_n "(cached) " >&6
3983else
3984 if test -n "$CC"; then
3985 ac_cv_prog_CC="$CC" # Let the user override the test.
3986else
3987as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3988for as_dir in $PATH
3989do
3990 IFS=$as_save_IFS
3991 test -z "$as_dir" && as_dir=.
3992 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3993 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3994 ac_cv_prog_CC="${ac_tool_prefix}cc"
3995 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3996 break 2
3997 fi
3998done
3999 done
4000IFS=$as_save_IFS
4001
4002fi
4003fi
4004CC=$ac_cv_prog_CC
4005if test -n "$CC"; then
4006 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4007$as_echo "$CC" >&6; }
4008else
4009 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4010$as_echo "no" >&6; }
4011fi
4012
4013
4014 fi
4015fi
4016if test -z "$CC"; then
4017 # Extract the first word of "cc", so it can be a program name with args.
4018set dummy cc; ac_word=$2
4019{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4020$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4021if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
4022 $as_echo_n "(cached) " >&6
4023else
4024 if test -n "$CC"; then
4025 ac_cv_prog_CC="$CC" # Let the user override the test.
4026else
4027 ac_prog_rejected=no
4028as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4029for as_dir in $PATH
4030do
4031 IFS=$as_save_IFS
4032 test -z "$as_dir" && as_dir=.
4033 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4034 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4035 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
4036 ac_prog_rejected=yes
4037 continue
4038 fi
4039 ac_cv_prog_CC="cc"
4040 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4041 break 2
4042 fi
4043done
4044 done
4045IFS=$as_save_IFS
4046
4047if test $ac_prog_rejected = yes; then
4048 # We found a bogon in the path, so make sure we never use it.
4049 set dummy $ac_cv_prog_CC
4050 shift
4051 if test $# != 0; then
4052 # We chose a different compiler from the bogus one.
4053 # However, it has the same basename, so the bogon will be chosen
4054 # first if we set CC to just the basename; use the full file name.
4055 shift
4056 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
4057 fi
4058fi
4059fi
4060fi
4061CC=$ac_cv_prog_CC
4062if test -n "$CC"; then
4063 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4064$as_echo "$CC" >&6; }
4065else
4066 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4067$as_echo "no" >&6; }
4068fi
4069
4070
4071fi
4072if test -z "$CC"; then
4073 if test -n "$ac_tool_prefix"; then
4074 for ac_prog in cl.exe
4075 do
4076 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4077set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4078{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4079$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4080if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
4081 $as_echo_n "(cached) " >&6
4082else
4083 if test -n "$CC"; then
4084 ac_cv_prog_CC="$CC" # Let the user override the test.
4085else
4086as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4087for as_dir in $PATH
4088do
4089 IFS=$as_save_IFS
4090 test -z "$as_dir" && as_dir=.
4091 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4092 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4093 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
4094 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4095 break 2
4096 fi
4097done
4098 done
4099IFS=$as_save_IFS
4100
4101fi
4102fi
4103CC=$ac_cv_prog_CC
4104if test -n "$CC"; then
4105 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4106$as_echo "$CC" >&6; }
4107else
4108 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4109$as_echo "no" >&6; }
4110fi
4111
4112
4113 test -n "$CC" && break
4114 done
4115fi
4116if test -z "$CC"; then
4117 ac_ct_CC=$CC
4118 for ac_prog in cl.exe
4119do
4120 # Extract the first word of "$ac_prog", so it can be a program name with args.
4121set dummy $ac_prog; ac_word=$2
4122{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4123$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4124if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
4125 $as_echo_n "(cached) " >&6
4126else
4127 if test -n "$ac_ct_CC"; then
4128 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4129else
4130as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4131for as_dir in $PATH
4132do
4133 IFS=$as_save_IFS
4134 test -z "$as_dir" && as_dir=.
4135 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4136 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4137 ac_cv_prog_ac_ct_CC="$ac_prog"
4138 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4139 break 2
4140 fi
4141done
4142 done
4143IFS=$as_save_IFS
4144
4145fi
4146fi
4147ac_ct_CC=$ac_cv_prog_ac_ct_CC
4148if test -n "$ac_ct_CC"; then
4149 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4150$as_echo "$ac_ct_CC" >&6; }
4151else
4152 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4153$as_echo "no" >&6; }
4154fi
4155
4156
4157 test -n "$ac_ct_CC" && break
4158done
4159
4160 if test "x$ac_ct_CC" = x; then
4161 CC=""
4162 else
4163 case $cross_compiling:$ac_tool_warned in
4164yes:)
4165{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4166$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4167ac_tool_warned=yes ;;
4168esac
4169 CC=$ac_ct_CC
4170 fi
4171fi
4172
c0c3707f
CB
4173fi
4174if test -z "$CC"; then
4175 if test -n "$ac_tool_prefix"; then
4176 # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
4177set dummy ${ac_tool_prefix}clang; ac_word=$2
4178{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4179$as_echo_n "checking for $ac_word... " >&6; }
4180if ${ac_cv_prog_CC+:} false; then :
4181 $as_echo_n "(cached) " >&6
4182else
4183 if test -n "$CC"; then
4184 ac_cv_prog_CC="$CC" # Let the user override the test.
4185else
4186as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4187for as_dir in $PATH
4188do
4189 IFS=$as_save_IFS
4190 test -z "$as_dir" && as_dir=.
4191 for ac_exec_ext in '' $ac_executable_extensions; do
4192 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4193 ac_cv_prog_CC="${ac_tool_prefix}clang"
4194 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4195 break 2
4196 fi
4197done
4198 done
4199IFS=$as_save_IFS
4200
4201fi
4202fi
4203CC=$ac_cv_prog_CC
4204if test -n "$CC"; then
4205 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4206$as_echo "$CC" >&6; }
4207else
4208 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4209$as_echo "no" >&6; }
4210fi
4211
4212
4213fi
4214if test -z "$ac_cv_prog_CC"; then
4215 ac_ct_CC=$CC
4216 # Extract the first word of "clang", so it can be a program name with args.
4217set dummy clang; ac_word=$2
4218{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4219$as_echo_n "checking for $ac_word... " >&6; }
4220if ${ac_cv_prog_ac_ct_CC+:} false; then :
4221 $as_echo_n "(cached) " >&6
4222else
4223 if test -n "$ac_ct_CC"; then
4224 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4225else
4226as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4227for as_dir in $PATH
4228do
4229 IFS=$as_save_IFS
4230 test -z "$as_dir" && as_dir=.
4231 for ac_exec_ext in '' $ac_executable_extensions; do
4232 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4233 ac_cv_prog_ac_ct_CC="clang"
4234 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4235 break 2
4236 fi
4237done
4238 done
4239IFS=$as_save_IFS
4240
4241fi
4242fi
4243ac_ct_CC=$ac_cv_prog_ac_ct_CC
4244if test -n "$ac_ct_CC"; then
4245 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4246$as_echo "$ac_ct_CC" >&6; }
4247else
4248 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4249$as_echo "no" >&6; }
4250fi
4251
4252 if test "x$ac_ct_CC" = x; then
4253 CC=""
4254 else
4255 case $cross_compiling:$ac_tool_warned in
4256yes:)
4257{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4258$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4259ac_tool_warned=yes ;;
4260esac
4261 CC=$ac_ct_CC
4262 fi
4263else
4264 CC="$ac_cv_prog_CC"
4265fi
4266
c971b7fa
PA
4267fi
4268
4269
4270test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4271$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4272as_fn_error $? "no acceptable C compiler found in \$PATH
4273See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4274
4275# Provide some information about the compiler.
4276$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4277set X $ac_compile
4278ac_compiler=$2
c0c3707f 4279for ac_option in --version -v -V -qversion -version; do
c971b7fa
PA
4280 { { ac_try="$ac_compiler $ac_option >&5"
4281case "(($ac_try" in
4282 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4283 *) ac_try_echo=$ac_try;;
4284esac
4285eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4286$as_echo "$ac_try_echo"; } >&5
4287 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4288 ac_status=$?
4289 if test -s conftest.err; then
4290 sed '10a\
4291... rest of stderr output deleted ...
4292 10q' conftest.err >conftest.er1
4293 cat conftest.er1 >&5
c971b7fa 4294 fi
d0ac1c44 4295 rm -f conftest.er1 conftest.err
c971b7fa
PA
4296 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4297 test $ac_status = 0; }
4298done
4299
4300cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4301/* end confdefs.h. */
d0ac1c44 4302
c971b7fa
PA
4303int
4304main ()
4305{
c971b7fa
PA
4306
4307 ;
4308 return 0;
4309}
4310_ACEOF
4311ac_clean_files_save=$ac_clean_files
d0ac1c44 4312ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
c971b7fa
PA
4313# Try to create an executable without -o first, disregard a.out.
4314# It will help us diagnose broken compilers, and finding out an intuition
4315# of exeext.
d0ac1c44
SM
4316{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
4317$as_echo_n "checking whether the C compiler works... " >&6; }
c971b7fa
PA
4318ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
4319
4320# The possible output files:
4321ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
4322
4323ac_rmfiles=
4324for ac_file in $ac_files
4325do
4326 case $ac_file in
4327 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4328 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
4329 esac
4330done
4331rm -f $ac_rmfiles
4332
4333if { { ac_try="$ac_link_default"
4334case "(($ac_try" in
4335 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4336 *) ac_try_echo=$ac_try;;
4337esac
4338eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4339$as_echo "$ac_try_echo"; } >&5
4340 (eval "$ac_link_default") 2>&5
4341 ac_status=$?
4342 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4343 test $ac_status = 0; }; then :
4344 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
4345# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
4346# in a Makefile. We should not override ac_cv_exeext if it was cached,
4347# so that the user can short-circuit this test for compilers unknown to
4348# Autoconf.
4349for ac_file in $ac_files ''
4350do
4351 test -f "$ac_file" || continue
4352 case $ac_file in
4353 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
4354 ;;
4355 [ab].out )
4356 # We found the default executable, but exeext='' is most
4357 # certainly right.
4358 break;;
4359 *.* )
4360 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
4361 then :; else
4362 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4363 fi
4364 # We set ac_cv_exeext here because the later test for it is not
4365 # safe: cross compilers may not add the suffix if given an `-o'
4366 # argument, so we may need to know it at that point already.
4367 # Even if this section looks crufty: it has the advantage of
4368 # actually working.
4369 break;;
4370 * )
4371 break;;
4372 esac
4373done
4374test "$ac_cv_exeext" = no && ac_cv_exeext=
4375
4376else
4377 ac_file=''
4378fi
c971b7fa 4379if test -z "$ac_file"; then :
d0ac1c44
SM
4380 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4381$as_echo "no" >&6; }
4382$as_echo "$as_me: failed program was:" >&5
c971b7fa
PA
4383sed 's/^/| /' conftest.$ac_ext >&5
4384
4385{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4386$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4387as_fn_error 77 "C compiler cannot create executables
4388See \`config.log' for more details" "$LINENO" 5; }
4389else
4390 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4391$as_echo "yes" >&6; }
c971b7fa 4392fi
d0ac1c44
SM
4393{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
4394$as_echo_n "checking for C compiler default output file name... " >&6; }
4395{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
4396$as_echo "$ac_file" >&6; }
c971b7fa
PA
4397ac_exeext=$ac_cv_exeext
4398
d0ac1c44 4399rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
c971b7fa 4400ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4401{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
4402$as_echo_n "checking for suffix of executables... " >&6; }
4403if { { ac_try="$ac_link"
4404case "(($ac_try" in
4405 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4406 *) ac_try_echo=$ac_try;;
4407esac
4408eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4409$as_echo "$ac_try_echo"; } >&5
4410 (eval "$ac_link") 2>&5
4411 ac_status=$?
4412 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4413 test $ac_status = 0; }; then :
4414 # If both `conftest.exe' and `conftest' are `present' (well, observable)
4415# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
4416# work properly (i.e., refer to `conftest.exe'), while it won't with
4417# `rm'.
4418for ac_file in conftest.exe conftest conftest.*; do
4419 test -f "$ac_file" || continue
4420 case $ac_file in
4421 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4422 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4423 break;;
4424 * ) break;;
4425 esac
4426done
4427else
4428 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4429$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4430as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4431See \`config.log' for more details" "$LINENO" 5; }
c971b7fa 4432fi
d0ac1c44 4433rm -f conftest conftest$ac_cv_exeext
c971b7fa
PA
4434{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4435$as_echo "$ac_cv_exeext" >&6; }
4436
4437rm -f conftest.$ac_ext
4438EXEEXT=$ac_cv_exeext
4439ac_exeext=$EXEEXT
d0ac1c44
SM
4440cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4441/* end confdefs.h. */
4442#include <stdio.h>
4443int
4444main ()
4445{
4446FILE *f = fopen ("conftest.out", "w");
4447 return ferror (f) || fclose (f) != 0;
4448
4449 ;
4450 return 0;
4451}
4452_ACEOF
4453ac_clean_files="$ac_clean_files conftest.out"
4454# Check that the compiler produces executables we can run. If not, either
4455# the compiler is broken, or we cross compile.
4456{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4457$as_echo_n "checking whether we are cross compiling... " >&6; }
4458if test "$cross_compiling" != yes; then
4459 { { ac_try="$ac_link"
4460case "(($ac_try" in
4461 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4462 *) ac_try_echo=$ac_try;;
4463esac
4464eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4465$as_echo "$ac_try_echo"; } >&5
4466 (eval "$ac_link") 2>&5
4467 ac_status=$?
4468 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4469 test $ac_status = 0; }
4470 if { ac_try='./conftest$ac_cv_exeext'
4471 { { case "(($ac_try" in
4472 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4473 *) ac_try_echo=$ac_try;;
4474esac
4475eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4476$as_echo "$ac_try_echo"; } >&5
4477 (eval "$ac_try") 2>&5
4478 ac_status=$?
4479 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4480 test $ac_status = 0; }; }; then
4481 cross_compiling=no
4482 else
4483 if test "$cross_compiling" = maybe; then
4484 cross_compiling=yes
4485 else
4486 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4487$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4488as_fn_error $? "cannot run C compiled programs.
4489If you meant to cross compile, use \`--host'.
4490See \`config.log' for more details" "$LINENO" 5; }
4491 fi
4492 fi
4493fi
4494{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4495$as_echo "$cross_compiling" >&6; }
4496
4497rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4498ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4499{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4500$as_echo_n "checking for suffix of object files... " >&6; }
d0ac1c44 4501if ${ac_cv_objext+:} false; then :
c971b7fa
PA
4502 $as_echo_n "(cached) " >&6
4503else
4504 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4505/* end confdefs.h. */
4506
4507int
4508main ()
4509{
4510
4511 ;
4512 return 0;
4513}
4514_ACEOF
4515rm -f conftest.o conftest.obj
4516if { { ac_try="$ac_compile"
4517case "(($ac_try" in
4518 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4519 *) ac_try_echo=$ac_try;;
4520esac
4521eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4522$as_echo "$ac_try_echo"; } >&5
4523 (eval "$ac_compile") 2>&5
4524 ac_status=$?
4525 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4526 test $ac_status = 0; }; then :
4527 for ac_file in conftest.o conftest.obj conftest.*; do
4528 test -f "$ac_file" || continue;
4529 case $ac_file in
4530 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4531 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4532 break;;
4533 esac
4534done
4535else
4536 $as_echo "$as_me: failed program was:" >&5
4537sed 's/^/| /' conftest.$ac_ext >&5
4538
4539{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4540$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4541as_fn_error $? "cannot compute suffix of object files: cannot compile
4542See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4543fi
4544rm -f conftest.$ac_cv_objext conftest.$ac_ext
4545fi
4546{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4547$as_echo "$ac_cv_objext" >&6; }
4548OBJEXT=$ac_cv_objext
4549ac_objext=$OBJEXT
4550{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4551$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
d0ac1c44 4552if ${ac_cv_c_compiler_gnu+:} false; then :
c971b7fa
PA
4553 $as_echo_n "(cached) " >&6
4554else
4555 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4556/* end confdefs.h. */
4557
4558int
4559main ()
4560{
4561#ifndef __GNUC__
4562 choke me
4563#endif
4564
4565 ;
4566 return 0;
4567}
4568_ACEOF
4569if ac_fn_c_try_compile "$LINENO"; then :
4570 ac_compiler_gnu=yes
4571else
4572 ac_compiler_gnu=no
4573fi
4574rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4575ac_cv_c_compiler_gnu=$ac_compiler_gnu
4576
4577fi
4578{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4579$as_echo "$ac_cv_c_compiler_gnu" >&6; }
4580if test $ac_compiler_gnu = yes; then
4581 GCC=yes
4582else
4583 GCC=
4584fi
4585ac_test_CFLAGS=${CFLAGS+set}
4586ac_save_CFLAGS=$CFLAGS
4587{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4588$as_echo_n "checking whether $CC accepts -g... " >&6; }
d0ac1c44 4589if ${ac_cv_prog_cc_g+:} false; then :
c971b7fa
PA
4590 $as_echo_n "(cached) " >&6
4591else
4592 ac_save_c_werror_flag=$ac_c_werror_flag
4593 ac_c_werror_flag=yes
4594 ac_cv_prog_cc_g=no
4595 CFLAGS="-g"
4596 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4597/* end confdefs.h. */
4598
4599int
4600main ()
4601{
4602
4603 ;
4604 return 0;
4605}
4606_ACEOF
4607if ac_fn_c_try_compile "$LINENO"; then :
4608 ac_cv_prog_cc_g=yes
4609else
4610 CFLAGS=""
4611 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4612/* end confdefs.h. */
4613
4614int
4615main ()
4616{
4617
4618 ;
4619 return 0;
4620}
4621_ACEOF
4622if ac_fn_c_try_compile "$LINENO"; then :
4623
4624else
4625 ac_c_werror_flag=$ac_save_c_werror_flag
4626 CFLAGS="-g"
4627 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4628/* end confdefs.h. */
4629
4630int
4631main ()
4632{
4633
4634 ;
4635 return 0;
4636}
4637_ACEOF
4638if ac_fn_c_try_compile "$LINENO"; then :
4639 ac_cv_prog_cc_g=yes
4640fi
4641rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4642fi
4643rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4644fi
4645rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4646 ac_c_werror_flag=$ac_save_c_werror_flag
4647fi
4648{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4649$as_echo "$ac_cv_prog_cc_g" >&6; }
4650if test "$ac_test_CFLAGS" = set; then
4651 CFLAGS=$ac_save_CFLAGS
4652elif test $ac_cv_prog_cc_g = yes; then
4653 if test "$GCC" = yes; then
4654 CFLAGS="-g -O2"
4655 else
4656 CFLAGS="-g"
4657 fi
4658else
4659 if test "$GCC" = yes; then
4660 CFLAGS="-O2"
4661 else
4662 CFLAGS=
4663 fi
4664fi
c0c3707f
CB
4665{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
4666$as_echo_n "checking for $CC option to enable C11 features... " >&6; }
4667if ${ac_cv_prog_cc_c11+:} false; then :
c971b7fa
PA
4668 $as_echo_n "(cached) " >&6
4669else
c0c3707f 4670 ac_cv_prog_cc_c11=no
c971b7fa
PA
4671ac_save_CC=$CC
4672cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4673/* end confdefs.h. */
4674#include <stdarg.h>
c0c3707f
CB
4675#include <stdbool.h>
4676#include <stddef.h>
4677#include <stdlib.h>
4678#include <wchar.h>
c971b7fa 4679#include <stdio.h>
c0c3707f
CB
4680
4681// Check varargs macros. These examples are taken from C99 6.10.3.5.
4682#define debug(...) fprintf (stderr, __VA_ARGS__)
4683#define showlist(...) puts (#__VA_ARGS__)
4684#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4685static void
4686test_varargs_macros (void)
7a6dbc2f 4687{
c0c3707f
CB
4688 int x = 1234;
4689 int y = 5678;
4690 debug ("Flag");
4691 debug ("X = %d\n", x);
4692 showlist (The first, second, and third items.);
4693 report (x>y, "x is %d but y is %d", x, y);
c971b7fa 4694}
c0c3707f
CB
4695
4696// Check long long types.
4697#define BIG64 18446744073709551615ull
4698#define BIG32 4294967295ul
4699#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4700#if !BIG_OK
4701 your preprocessor is broken;
4702#endif
4703#if BIG_OK
4704#else
4705 your preprocessor is broken;
4706#endif
4707static long long int bignum = -9223372036854775807LL;
4708static unsigned long long int ubignum = BIG64;
4709
4710struct incomplete_array
7a6dbc2f 4711{
c0c3707f
CB
4712 int datasize;
4713 double data[];
4714};
4715
4716struct named_init {
4717 int number;
4718 const wchar_t *name;
4719 double average;
4720};
4721
4722typedef const char *ccp;
4723
4724static inline int
4725test_restrict (ccp restrict text)
4726{
4727 // See if C++-style comments work.
4728 // Iterate through items via the restricted pointer.
4729 // Also check for declarations in for loops.
4730 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4731 continue;
4732 return 0;
7a6dbc2f 4733}
7a6dbc2f 4734
c0c3707f
CB
4735// Check varargs and va_copy.
4736static bool
4737test_varargs (const char *format, ...)
4738{
4739 va_list args;
4740 va_start (args, format);
4741 va_list args_copy;
4742 va_copy (args_copy, args);
7a6dbc2f 4743
c0c3707f
CB
4744 const char *str = "";
4745 int number = 0;
4746 float fnumber = 0;
4747
4748 while (*format)
4749 {
4750 switch (*format++)
4751 {
4752 case 's': // string
4753 str = va_arg (args_copy, const char *);
4754 break;
4755 case 'd': // int
4756 number = va_arg (args_copy, int);
4757 break;
4758 case 'f': // float
4759 fnumber = va_arg (args_copy, double);
4760 break;
4761 default:
4762 break;
4763 }
4764 }
4765 va_end (args_copy);
4766 va_end (args);
4767
4768 return *str && number && fnumber;
4769}
4770// Check _Alignas.
4771char _Alignas (double) aligned_as_double;
4772char _Alignas (0) no_special_alignment;
4773extern char aligned_as_int;
4774char _Alignas (0) _Alignas (int) aligned_as_int;
4775
4776// Check _Alignof.
4777enum
4778{
4779 int_alignment = _Alignof (int),
4780 int_array_alignment = _Alignof (int[100]),
4781 char_alignment = _Alignof (char)
4782};
4783_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
4784
4785// Check _Noreturn.
4786int _Noreturn does_not_return (void) { for (;;) continue; }
4787
4788// Check _Static_assert.
4789struct test_static_assert
4790{
4791 int x;
4792 _Static_assert (sizeof (int) <= sizeof (long int),
4793 "_Static_assert does not work in struct");
4794 long int y;
4795};
4796
4797// Check UTF-8 literals.
4798#define u8 syntax error!
4799char const utf8_literal[] = u8"happens to be ASCII" "another string";
4800
4801// Check duplicate typedefs.
4802typedef long *long_ptr;
4803typedef long int *long_ptr;
4804typedef long_ptr long_ptr;
4805
4806// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
4807struct anonymous
4808{
4809 union {
4810 struct { int i; int j; };
4811 struct { int k; long int l; } w;
4812 };
4813 int m;
4814} v1;
c971b7fa 4815
c971b7fa
PA
4816int
4817main ()
4818{
c0c3707f
CB
4819
4820 // Check bool.
4821 _Bool success = false;
4822
4823 // Check restrict.
4824 if (test_restrict ("String literal") == 0)
4825 success = true;
4826 char *restrict newvar = "Another string";
4827
4828 // Check varargs.
4829 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4830 test_varargs_macros ();
4831
4832 // Check flexible array members.
4833 struct incomplete_array *ia =
4834 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4835 ia->datasize = 10;
4836 for (int i = 0; i < ia->datasize; ++i)
4837 ia->data[i] = i * 1.234;
4838
4839 // Check named initializers.
4840 struct named_init ni = {
4841 .number = 34,
4842 .name = L"Test wide string",
4843 .average = 543.34343,
4844 };
4845
4846 ni.number = 58;
4847
4848 int dynamic_array[ni.number];
4849 dynamic_array[ni.number - 1] = 543;
4850
4851 // work around unused variable warnings
4852 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4853 || dynamic_array[ni.number - 1] != 543);
4854
4855 v1.i = 2;
4856 v1.w.k = 5;
4857 _Static_assert ((offsetof (struct anonymous, i)
4858 == offsetof (struct anonymous, w.k)),
4859 "Anonymous union alignment botch");
4860
c971b7fa
PA
4861 ;
4862 return 0;
4863}
4864_ACEOF
c0c3707f 4865for ac_arg in '' -std=gnu11
c971b7fa
PA
4866do
4867 CC="$ac_save_CC $ac_arg"
4868 if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 4869 ac_cv_prog_cc_c11=$ac_arg
c971b7fa
PA
4870fi
4871rm -f core conftest.err conftest.$ac_objext
c0c3707f 4872 test "x$ac_cv_prog_cc_c11" != "xno" && break
c971b7fa
PA
4873done
4874rm -f conftest.$ac_ext
4875CC=$ac_save_CC
4876
4877fi
4878# AC_CACHE_VAL
c0c3707f
CB
4879ac_prog_cc_stdc_options=
4880case "x$ac_cv_prog_cc_c11" in
c971b7fa
PA
4881 x)
4882 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4883$as_echo "none needed" >&6; } ;;
4884 xno)
4885 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4886$as_echo "unsupported" >&6; } ;;
4887 *)
c0c3707f
CB
4888 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
4889 CC=$CC$ac_prog_cc_stdc_options
4890 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
4891$as_echo "$ac_cv_prog_cc_c11" >&6; } ;;
c971b7fa 4892esac
c0c3707f
CB
4893if test "x$ac_cv_prog_cc_c11" != xno; then :
4894 ac_prog_cc_stdc=c11
4895 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
4896else
4897 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
4898$as_echo_n "checking for $CC option to enable C99 features... " >&6; }
4899if ${ac_cv_prog_cc_c99+:} false; then :
4900 $as_echo_n "(cached) " >&6
4901else
4902 ac_cv_prog_cc_c99=no
4903ac_save_CC=$CC
4904cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4905/* end confdefs.h. */
4906#include <stdarg.h>
4907#include <stdbool.h>
4908#include <stddef.h>
4909#include <stdlib.h>
4910#include <wchar.h>
4911#include <stdio.h>
7a6dbc2f 4912
c0c3707f
CB
4913// Check varargs macros. These examples are taken from C99 6.10.3.5.
4914#define debug(...) fprintf (stderr, __VA_ARGS__)
4915#define showlist(...) puts (#__VA_ARGS__)
4916#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4917static void
4918test_varargs_macros (void)
4919{
4920 int x = 1234;
4921 int y = 5678;
4922 debug ("Flag");
4923 debug ("X = %d\n", x);
4924 showlist (The first, second, and third items.);
4925 report (x>y, "x is %d but y is %d", x, y);
4926}
7a6dbc2f 4927
c0c3707f
CB
4928// Check long long types.
4929#define BIG64 18446744073709551615ull
4930#define BIG32 4294967295ul
4931#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4932#if !BIG_OK
4933 your preprocessor is broken;
4934#endif
4935#if BIG_OK
4936#else
4937 your preprocessor is broken;
4938#endif
4939static long long int bignum = -9223372036854775807LL;
4940static unsigned long long int ubignum = BIG64;
7a6dbc2f 4941
c0c3707f
CB
4942struct incomplete_array
4943{
4944 int datasize;
4945 double data[];
4946};
7a6dbc2f 4947
c0c3707f
CB
4948struct named_init {
4949 int number;
4950 const wchar_t *name;
4951 double average;
4952};
7a6dbc2f 4953
c0c3707f 4954typedef const char *ccp;
7a6dbc2f 4955
c0c3707f
CB
4956static inline int
4957test_restrict (ccp restrict text)
4958{
4959 // See if C++-style comments work.
4960 // Iterate through items via the restricted pointer.
4961 // Also check for declarations in for loops.
4962 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4963 continue;
4964 return 0;
4965}
7a6dbc2f 4966
c0c3707f
CB
4967// Check varargs and va_copy.
4968static bool
4969test_varargs (const char *format, ...)
4970{
4971 va_list args;
4972 va_start (args, format);
4973 va_list args_copy;
4974 va_copy (args_copy, args);
4975
4976 const char *str = "";
4977 int number = 0;
4978 float fnumber = 0;
4979
4980 while (*format)
4981 {
4982 switch (*format++)
4983 {
4984 case 's': // string
4985 str = va_arg (args_copy, const char *);
4986 break;
4987 case 'd': // int
4988 number = va_arg (args_copy, int);
4989 break;
4990 case 'f': // float
4991 fnumber = va_arg (args_copy, double);
4992 break;
4993 default:
4994 break;
4995 }
4996 }
4997 va_end (args_copy);
4998 va_end (args);
4999
5000 return *str && number && fnumber;
5001}
5002int
5003main ()
5004{
5005
5006 // Check bool.
5007 _Bool success = false;
5008
5009 // Check restrict.
5010 if (test_restrict ("String literal") == 0)
5011 success = true;
5012 char *restrict newvar = "Another string";
5013
5014 // Check varargs.
5015 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
5016 test_varargs_macros ();
5017
5018 // Check flexible array members.
5019 struct incomplete_array *ia =
5020 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
5021 ia->datasize = 10;
5022 for (int i = 0; i < ia->datasize; ++i)
5023 ia->data[i] = i * 1.234;
5024
5025 // Check named initializers.
5026 struct named_init ni = {
5027 .number = 34,
5028 .name = L"Test wide string",
5029 .average = 543.34343,
5030 };
5031
5032 ni.number = 58;
5033
5034 int dynamic_array[ni.number];
5035 dynamic_array[ni.number - 1] = 543;
5036
5037 // work around unused variable warnings
5038 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
5039 || dynamic_array[ni.number - 1] != 543);
5040
5041 ;
5042 return 0;
5043}
5044_ACEOF
5045for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
5046do
5047 CC="$ac_save_CC $ac_arg"
5048 if ac_fn_c_try_compile "$LINENO"; then :
5049 ac_cv_prog_cc_c99=$ac_arg
5050fi
5051rm -f core conftest.err conftest.$ac_objext
5052 test "x$ac_cv_prog_cc_c99" != "xno" && break
5053done
5054rm -f conftest.$ac_ext
5055CC=$ac_save_CC
5056
5057fi
5058# AC_CACHE_VAL
5059ac_prog_cc_stdc_options=
5060case "x$ac_cv_prog_cc_c99" in
5061 x)
5062 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5063$as_echo "none needed" >&6; } ;;
5064 xno)
5065 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5066$as_echo "unsupported" >&6; } ;;
5067 *)
5068 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
5069 CC=$CC$ac_prog_cc_stdc_options
5070 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
5071$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
5072esac
5073if test "x$ac_cv_prog_cc_c99" != xno; then :
5074 ac_prog_cc_stdc=c99
5075 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
5076else
5077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
5078$as_echo_n "checking for $CC option to enable C89 features... " >&6; }
5079if ${ac_cv_prog_cc_c89+:} false; then :
d0ac1c44
SM
5080 $as_echo_n "(cached) " >&6
5081else
c0c3707f
CB
5082 ac_cv_prog_cc_c89=no
5083ac_save_CC=$CC
5084cat confdefs.h - <<_ACEOF >conftest.$ac_ext
d0ac1c44 5085/* end confdefs.h. */
c0c3707f
CB
5086#include <stdarg.h>
5087#include <stdio.h>
5088struct stat;
5089/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
5090struct buf { int x; };
5091FILE * (*rcsopen) (struct buf *, struct stat *, int);
5092static char *e (p, i)
5093 char **p;
5094 int i;
5095{
5096 return p[i];
5097}
5098static char *f (char * (*g) (char **, int), char **p, ...)
5099{
5100 char *s;
5101 va_list v;
5102 va_start (v,p);
5103 s = g (p, va_arg (v,int));
5104 va_end (v);
5105 return s;
5106}
5107
5108/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
5109 function prototypes and stuff, but not '\xHH' hex character constants.
5110 These don't provoke an error unfortunately, instead are silently treated
5111 as 'x'. The following induces an error, until -std is added to get
5112 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
5113 array size at least. It's necessary to write '\x00'==0 to get something
5114 that's true only with -std. */
5115int osf4_cc_array ['\x00' == 0 ? 1 : -1];
5116
5117/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
5118 inside strings and character constants. */
5119#define FOO(x) 'x'
5120int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
d0ac1c44 5121
c0c3707f
CB
5122int test (int i, double x);
5123struct s1 {int (*f) (int a);};
5124struct s2 {int (*f) (double a);};
5125int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
5126int argc;
5127char **argv;
d0ac1c44
SM
5128int
5129main ()
5130{
c0c3707f 5131return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
d0ac1c44
SM
5132 ;
5133 return 0;
5134}
5135_ACEOF
c0c3707f
CB
5136for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
5137 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
5138do
5139 CC="$ac_save_CC $ac_arg"
5140 if ac_fn_c_try_compile "$LINENO"; then :
5141 ac_cv_prog_cc_c89=$ac_arg
5142fi
5143rm -f core conftest.err conftest.$ac_objext
5144 test "x$ac_cv_prog_cc_c89" != "xno" && break
5145done
5146rm -f conftest.$ac_ext
5147CC=$ac_save_CC
5148
5149fi
5150# AC_CACHE_VAL
5151ac_prog_cc_stdc_options=
5152case "x$ac_cv_prog_cc_c89" in
5153 x)
5154 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5155$as_echo "none needed" >&6; } ;;
5156 xno)
5157 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5158$as_echo "unsupported" >&6; } ;;
5159 *)
5160 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
5161 CC=$CC$ac_prog_cc_stdc_options
5162 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
5163$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
5164esac
5165if test "x$ac_cv_prog_cc_c89" != xno; then :
5166 ac_prog_cc_stdc=c89
5167 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
5168else
5169 ac_prog_cc_stdc=no
5170 ac_cv_prog_cc_stdc=no
5171fi
5172
5173fi
5174
7a6dbc2f 5175fi
c0c3707f 5176
d0ac1c44
SM
5177ac_ext=c
5178ac_cpp='$CPP $CPPFLAGS'
5179ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5180ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5181ac_compiler_gnu=$ac_cv_c_compiler_gnu
5182
5183
5df4cba6
SM
5184 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
5185$as_echo_n "checking whether the compiler is clang... " >&6; }
5186if ${gl_cv_compiler_clang+:} false; then :
5187 $as_echo_n "(cached) " >&6
5188else
5189 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5190/* end confdefs.h. */
5191
5192 #ifdef __clang__
5193 barfbarf
5194 #endif
5195
5196int
5197main ()
5198{
5199
5200 ;
5201 return 0;
5202}
5203
5204_ACEOF
5205if ac_fn_c_try_compile "$LINENO"; then :
5206 gl_cv_compiler_clang=no
5207else
5208 gl_cv_compiler_clang=yes
5209fi
5210rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5211
5212fi
5213{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5
5214$as_echo "$gl_cv_compiler_clang" >&6; }
5215
5216
5217 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5
5218$as_echo_n "checking for compiler option needed when checking for declarations... " >&6; }
5219if ${gl_cv_compiler_check_decl_option+:} false; then :
5220 $as_echo_n "(cached) " >&6
5221else
5222 if test $gl_cv_compiler_clang = yes; then
5223 save_ac_compile="$ac_compile"
5224 ac_compile="$ac_compile -Werror=implicit-function-declaration"
5225 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5226/* end confdefs.h. */
5227
5228int
5229main ()
5230{
5231
5232 ;
5233 return 0;
5234}
5235_ACEOF
5236if ac_fn_c_try_compile "$LINENO"; then :
5237 gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'
5238else
5239 gl_cv_compiler_check_decl_option=none
5240fi
5241rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5242 ac_compile="$save_ac_compile"
5243 else
5244 gl_cv_compiler_check_decl_option=none
5245 fi
5246
5247fi
5248{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5
5249$as_echo "$gl_cv_compiler_check_decl_option" >&6; }
5250 if test "x$gl_cv_compiler_check_decl_option" != xnone; then
5251 ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
5252 else
5253 ac_compile_for_check_decl="$ac_compile"
5254 fi
5255
5256
5257
9c9d63b1 5258
c971b7fa
PA
5259ac_ext=c
5260ac_cpp='$CPP $CPPFLAGS'
5261ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5262ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5263ac_compiler_gnu=$ac_cv_c_compiler_gnu
5264{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5265$as_echo_n "checking how to run the C preprocessor... " >&6; }
5266# On Suns, sometimes $CPP names a directory.
5267if test -n "$CPP" && test -d "$CPP"; then
5268 CPP=
5269fi
5270if test -z "$CPP"; then
d0ac1c44 5271 if ${ac_cv_prog_CPP+:} false; then :
c971b7fa
PA
5272 $as_echo_n "(cached) " >&6
5273else
5274 # Double quotes because CPP needs to be expanded
5275 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5276 do
5277 ac_preproc_ok=false
5278for ac_c_preproc_warn_flag in '' yes
5279do
5280 # Use a header file that comes with gcc, so configuring glibc
5281 # with a fresh cross-compiler works.
5282 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5283 # <limits.h> exists even on freestanding compilers.
5284 # On the NeXT, cc -E runs the code through the compiler's parser,
5285 # not just through cpp. "Syntax error" is here to catch this case.
5286 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5287/* end confdefs.h. */
5288#ifdef __STDC__
5289# include <limits.h>
5290#else
5291# include <assert.h>
5292#endif
5293 Syntax error
5294_ACEOF
5295if ac_fn_c_try_cpp "$LINENO"; then :
5296
5297else
5298 # Broken: fails on valid input.
5299continue
5300fi
d0ac1c44 5301rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5302
5303 # OK, works on sane cases. Now check whether nonexistent headers
5304 # can be detected and how.
5305 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5306/* end confdefs.h. */
5307#include <ac_nonexistent.h>
5308_ACEOF
5309if ac_fn_c_try_cpp "$LINENO"; then :
5310 # Broken: success on invalid input.
5311continue
5312else
5313 # Passes both tests.
5314ac_preproc_ok=:
5315break
5316fi
d0ac1c44 5317rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5318
5319done
5320# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5321rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5322if $ac_preproc_ok; then :
5323 break
5324fi
5325
5326 done
5327 ac_cv_prog_CPP=$CPP
5328
5329fi
5330 CPP=$ac_cv_prog_CPP
5331else
5332 ac_cv_prog_CPP=$CPP
5333fi
5334{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5335$as_echo "$CPP" >&6; }
5336ac_preproc_ok=false
5337for ac_c_preproc_warn_flag in '' yes
5338do
5339 # Use a header file that comes with gcc, so configuring glibc
5340 # with a fresh cross-compiler works.
5341 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5342 # <limits.h> exists even on freestanding compilers.
5343 # On the NeXT, cc -E runs the code through the compiler's parser,
5344 # not just through cpp. "Syntax error" is here to catch this case.
5345 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5346/* end confdefs.h. */
5347#ifdef __STDC__
5348# include <limits.h>
5349#else
5350# include <assert.h>
5351#endif
5352 Syntax error
5353_ACEOF
5354if ac_fn_c_try_cpp "$LINENO"; then :
5355
5356else
5357 # Broken: fails on valid input.
5358continue
5359fi
d0ac1c44 5360rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5361
5362 # OK, works on sane cases. Now check whether nonexistent headers
5363 # can be detected and how.
5364 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5365/* end confdefs.h. */
5366#include <ac_nonexistent.h>
5367_ACEOF
5368if ac_fn_c_try_cpp "$LINENO"; then :
5369 # Broken: success on invalid input.
5370continue
5371else
5372 # Passes both tests.
5373ac_preproc_ok=:
5374break
5375fi
d0ac1c44 5376rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5377
5378done
5379# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5380rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5381if $ac_preproc_ok; then :
5382
5383else
5384 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5385$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
5386as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5387See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
5388fi
5389
5390ac_ext=c
5391ac_cpp='$CPP $CPPFLAGS'
5392ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5393ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5394ac_compiler_gnu=$ac_cv_c_compiler_gnu
5395
5396
5397{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
5398$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
d0ac1c44 5399if ${ac_cv_path_GREP+:} false; then :
c971b7fa
PA
5400 $as_echo_n "(cached) " >&6
5401else
5402 if test -z "$GREP"; then
5403 ac_path_GREP_found=false
5404 # Loop through the user's path and test for each of PROGNAME-LIST
5405 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5406for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5407do
5408 IFS=$as_save_IFS
5409 test -z "$as_dir" && as_dir=.
5410 for ac_prog in grep ggrep; do
5411 for ac_exec_ext in '' $ac_executable_extensions; do
5412 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5413 as_fn_executable_p "$ac_path_GREP" || continue
c971b7fa
PA
5414# Check for GNU ac_path_GREP and select it if it is found.
5415 # Check for GNU $ac_path_GREP
5416case `"$ac_path_GREP" --version 2>&1` in
5417*GNU*)
5418 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
5419*)
5420 ac_count=0
5421 $as_echo_n 0123456789 >"conftest.in"
5422 while :
5423 do
5424 cat "conftest.in" "conftest.in" >"conftest.tmp"
5425 mv "conftest.tmp" "conftest.in"
5426 cp "conftest.in" "conftest.nl"
5427 $as_echo 'GREP' >> "conftest.nl"
5428 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5429 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5430 as_fn_arith $ac_count + 1 && ac_count=$as_val
5431 if test $ac_count -gt ${ac_path_GREP_max-0}; then
5432 # Best one so far, save it but keep looking for a better one
5433 ac_cv_path_GREP="$ac_path_GREP"
5434 ac_path_GREP_max=$ac_count
5435 fi
5436 # 10*(2^10) chars as input seems more than enough
5437 test $ac_count -gt 10 && break
5438 done
5439 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5440esac
5441
5442 $ac_path_GREP_found && break 3
5443 done
5444 done
5445 done
5446IFS=$as_save_IFS
5447 if test -z "$ac_cv_path_GREP"; then
d0ac1c44 5448 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5449 fi
5450else
5451 ac_cv_path_GREP=$GREP
5452fi
5453
5454fi
5455{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
5456$as_echo "$ac_cv_path_GREP" >&6; }
5457 GREP="$ac_cv_path_GREP"
5458
5459
5460{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
5461$as_echo_n "checking for egrep... " >&6; }
d0ac1c44 5462if ${ac_cv_path_EGREP+:} false; then :
c971b7fa
PA
5463 $as_echo_n "(cached) " >&6
5464else
5465 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
5466 then ac_cv_path_EGREP="$GREP -E"
5467 else
5468 if test -z "$EGREP"; then
5469 ac_path_EGREP_found=false
5470 # Loop through the user's path and test for each of PROGNAME-LIST
5471 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5472for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5473do
5474 IFS=$as_save_IFS
5475 test -z "$as_dir" && as_dir=.
5476 for ac_prog in egrep; do
5477 for ac_exec_ext in '' $ac_executable_extensions; do
5478 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5479 as_fn_executable_p "$ac_path_EGREP" || continue
c971b7fa
PA
5480# Check for GNU ac_path_EGREP and select it if it is found.
5481 # Check for GNU $ac_path_EGREP
5482case `"$ac_path_EGREP" --version 2>&1` in
5483*GNU*)
5484 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
5485*)
5486 ac_count=0
5487 $as_echo_n 0123456789 >"conftest.in"
5488 while :
5489 do
5490 cat "conftest.in" "conftest.in" >"conftest.tmp"
5491 mv "conftest.tmp" "conftest.in"
5492 cp "conftest.in" "conftest.nl"
5493 $as_echo 'EGREP' >> "conftest.nl"
5494 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5495 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5496 as_fn_arith $ac_count + 1 && ac_count=$as_val
5497 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
5498 # Best one so far, save it but keep looking for a better one
5499 ac_cv_path_EGREP="$ac_path_EGREP"
5500 ac_path_EGREP_max=$ac_count
5501 fi
5502 # 10*(2^10) chars as input seems more than enough
5503 test $ac_count -gt 10 && break
5504 done
5505 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5506esac
5507
5508 $ac_path_EGREP_found && break 3
5509 done
5510 done
5511 done
5512IFS=$as_save_IFS
5513 if test -z "$ac_cv_path_EGREP"; then
d0ac1c44 5514 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5515 fi
5516else
5517 ac_cv_path_EGREP=$EGREP
5518fi
5519
5520 fi
5521fi
5522{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
5523$as_echo "$ac_cv_path_EGREP" >&6; }
5524 EGREP="$ac_cv_path_EGREP"
5525
5526
5527{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
5528$as_echo_n "checking for ANSI C header files... " >&6; }
d0ac1c44 5529if ${ac_cv_header_stdc+:} false; then :
c971b7fa
PA
5530 $as_echo_n "(cached) " >&6
5531else
5532 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5533/* end confdefs.h. */
5534#include <stdlib.h>
5535#include <stdarg.h>
5536#include <string.h>
5537#include <float.h>
5538
5539int
5540main ()
5541{
5542
5543 ;
5544 return 0;
5545}
5546_ACEOF
5547if ac_fn_c_try_compile "$LINENO"; then :
5548 ac_cv_header_stdc=yes
5549else
5550 ac_cv_header_stdc=no
5551fi
5552rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5553
5554if test $ac_cv_header_stdc = yes; then
5555 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5556 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5557/* end confdefs.h. */
5558#include <string.h>
5559
5560_ACEOF
5561if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5562 $EGREP "memchr" >/dev/null 2>&1; then :
5563
5564else
5565 ac_cv_header_stdc=no
5566fi
5567rm -f conftest*
5568
5569fi
5570
5571if test $ac_cv_header_stdc = yes; then
5572 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5573 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5574/* end confdefs.h. */
5575#include <stdlib.h>
5576
5577_ACEOF
5578if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5579 $EGREP "free" >/dev/null 2>&1; then :
5580
5581else
5582 ac_cv_header_stdc=no
5583fi
5584rm -f conftest*
5585
5586fi
5587
5588if test $ac_cv_header_stdc = yes; then
5589 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5590 if test "$cross_compiling" = yes; then :
5591 :
5592else
5593 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5594/* end confdefs.h. */
5595#include <ctype.h>
5596#include <stdlib.h>
5597#if ((' ' & 0x0FF) == 0x020)
5598# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5599# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5600#else
5601# define ISLOWER(c) \
5602 (('a' <= (c) && (c) <= 'i') \
5603 || ('j' <= (c) && (c) <= 'r') \
5604 || ('s' <= (c) && (c) <= 'z'))
5605# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
5606#endif
5607
5608#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5609int
5610main ()
5611{
5612 int i;
5613 for (i = 0; i < 256; i++)
5614 if (XOR (islower (i), ISLOWER (i))
5615 || toupper (i) != TOUPPER (i))
5616 return 2;
5617 return 0;
5618}
5619_ACEOF
5620if ac_fn_c_try_run "$LINENO"; then :
5621
5622else
5623 ac_cv_header_stdc=no
5624fi
5625rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5626 conftest.$ac_objext conftest.beam conftest.$ac_ext
5627fi
5628
5629fi
5630fi
5631{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
5632$as_echo "$ac_cv_header_stdc" >&6; }
5633if test $ac_cv_header_stdc = yes; then
5634
5635$as_echo "#define STDC_HEADERS 1" >>confdefs.h
5636
5637fi
5638
5639# On IRIX 5.3, sys/types and inttypes.h are conflicting.
5640for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
5641 inttypes.h stdint.h unistd.h
5642do :
5643 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5644ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5645"
d0ac1c44 5646if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
c971b7fa
PA
5647 cat >>confdefs.h <<_ACEOF
5648#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5649_ACEOF
5650
5651fi
5652
5653done
5654
5655
5656
c971b7fa
PA
5657
5658
9c9d63b1
PM
5659 for ac_header in $ac_header_list
5660do :
5661 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5662ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5663"
5664if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
5665 cat >>confdefs.h <<_ACEOF
5666#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5667_ACEOF
c971b7fa 5668
9c9d63b1
PM
5669fi
5670
5671done
c971b7fa
PA
5672
5673
c971b7fa
PA
5674
5675
c971b7fa 5676
c971b7fa 5677
c971b7fa 5678
c971b7fa
PA
5679
5680
5681 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
5682$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
d0ac1c44 5683if ${ac_cv_safe_to_define___extensions__+:} false; then :
c971b7fa
PA
5684 $as_echo_n "(cached) " >&6
5685else
5686 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5687/* end confdefs.h. */
5688
5689# define __EXTENSIONS__ 1
5690 $ac_includes_default
5691int
5692main ()
5693{
5694
5695 ;
5696 return 0;
5697}
5698_ACEOF
5699if ac_fn_c_try_compile "$LINENO"; then :
5700 ac_cv_safe_to_define___extensions__=yes
5701else
5702 ac_cv_safe_to_define___extensions__=no
5703fi
5704rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5705fi
5706{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
5707$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
c971b7fa 5708
4a626d0a
PA
5709 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
5710$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
d0ac1c44 5711if ${ac_cv_should_define__xopen_source+:} false; then :
4a626d0a
PA
5712 $as_echo_n "(cached) " >&6
5713else
5714 ac_cv_should_define__xopen_source=no
9c9d63b1
PM
5715 if test $ac_cv_header_wchar_h = yes; then :
5716 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4a626d0a
PA
5717/* end confdefs.h. */
5718
5719 #include <wchar.h>
5720 mbstate_t x;
5721int
5722main ()
5723{
5724
5725 ;
5726 return 0;
5727}
5728_ACEOF
5729if ac_fn_c_try_compile "$LINENO"; then :
5730
5731else
5732 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5733/* end confdefs.h. */
5734
9c9d63b1
PM
5735 #define _XOPEN_SOURCE 500
5736 #include <wchar.h>
5737 mbstate_t x;
4a626d0a
PA
5738int
5739main ()
5740{
5741
5742 ;
5743 return 0;
5744}
5745_ACEOF
5746if ac_fn_c_try_compile "$LINENO"; then :
5747 ac_cv_should_define__xopen_source=yes
5748fi
d0ac1c44
SM
5749rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5750fi
5751rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5752fi
9c9d63b1 5753fi
d0ac1c44
SM
5754{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
5755$as_echo "$ac_cv_should_define__xopen_source" >&6; }
9c9d63b1
PM
5756
5757 $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
5758
5759 $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
5760
5761 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
d0ac1c44 5762
c0c3707f
CB
5763 $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
5764
9c9d63b1
PM
5765 $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
5766
5767 $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h
5768
5769 $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
5770
5771 $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
5772
5773 $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
5774
5775 $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
5776
5777 $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
5778
5779 $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
5780
5781 $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
5782
5783 $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
5784
5785 $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
5786
5787 if test $ac_cv_header_minix_config_h = yes; then :
5788 MINIX=yes
5789 $as_echo "#define _MINIX 1" >>confdefs.h
5790
5791 $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
5792
5793 $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
5794
5795else
5796 MINIX=
5797fi
5798 if test $ac_cv_safe_to_define___extensions__ = yes; then :
5799 $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
5800
5801fi
5802 if test $ac_cv_should_define__xopen_source = yes; then :
5803 $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
5804
5805fi
d0ac1c44 5806
c8693053
RO
5807# Needs to run before gl_EARLY so it can override AC_SYS_LARGEFILE included
5808# there.
c0c3707f
CB
5809ac_aux_dir=
5810for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
5811 if test -f "$ac_dir/install-sh"; then
5812 ac_aux_dir=$ac_dir
5813 ac_install_sh="$ac_aux_dir/install-sh -c"
5814 break
5815 elif test -f "$ac_dir/install.sh"; then
5816 ac_aux_dir=$ac_dir
5817 ac_install_sh="$ac_aux_dir/install.sh -c"
5818 break
5819 elif test -f "$ac_dir/shtool"; then
5820 ac_aux_dir=$ac_dir
5821 ac_install_sh="$ac_aux_dir/shtool install -c"
5822 break
5823 fi
5824done
5825if test -z "$ac_aux_dir"; then
5826 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
5827fi
5828
5829# These three variables are undocumented and unsupported,
5830# and are intended to be withdrawn in a future Autoconf release.
5831# They can cause serious problems if a builder's source tree is in a directory
5832# whose full name contains unusual characters.
5833ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
5834ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
5835ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
5836
5837
4a626d0a
PA
5838# Make sure we can run config.sub.
5839$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
d0ac1c44 5840 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4a626d0a
PA
5841
5842{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
5843$as_echo_n "checking build system type... " >&6; }
d0ac1c44 5844if ${ac_cv_build+:} false; then :
4a626d0a
PA
5845 $as_echo_n "(cached) " >&6
5846else
5847 ac_build_alias=$build_alias
5848test "x$ac_build_alias" = x &&
5849 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
5850test "x$ac_build_alias" = x &&
d0ac1c44 5851 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4a626d0a 5852ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
d0ac1c44 5853 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4a626d0a
PA
5854
5855fi
5856{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
5857$as_echo "$ac_cv_build" >&6; }
5858case $ac_cv_build in
5859*-*-*) ;;
d0ac1c44 5860*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4a626d0a
PA
5861esac
5862build=$ac_cv_build
5863ac_save_IFS=$IFS; IFS='-'
5864set x $ac_cv_build
5865shift
5866build_cpu=$1
5867build_vendor=$2
5868shift; shift
5869# Remember, the first character of IFS is used to create $*,
5870# except with old shells:
5871build_os=$*
5872IFS=$ac_save_IFS
5873case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
5874
5875
5876{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
5877$as_echo_n "checking host system type... " >&6; }
d0ac1c44 5878if ${ac_cv_host+:} false; then :
4a626d0a
PA
5879 $as_echo_n "(cached) " >&6
5880else
5881 if test "x$host_alias" = x; then
5882 ac_cv_host=$ac_cv_build
5883else
5884 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
d0ac1c44 5885 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4a626d0a
PA
5886fi
5887
5888fi
5889{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
5890$as_echo "$ac_cv_host" >&6; }
5891case $ac_cv_host in
5892*-*-*) ;;
d0ac1c44 5893*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4a626d0a
PA
5894esac
5895host=$ac_cv_host
5896ac_save_IFS=$IFS; IFS='-'
5897set x $ac_cv_host
5898shift
5899host_cpu=$1
5900host_vendor=$2
5901shift; shift
5902# Remember, the first character of IFS is used to create $*,
5903# except with old shells:
5904host_os=$*
5905IFS=$ac_save_IFS
5906case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
5907
5908
c8693053
RO
5909{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
5910$as_echo_n "checking target system type... " >&6; }
5911if ${ac_cv_target+:} false; then :
5912 $as_echo_n "(cached) " >&6
5913else
5914 if test "x$target_alias" = x; then
5915 ac_cv_target=$ac_cv_host
5916else
5917 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
5918 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
5919fi
c971b7fa 5920
c8693053
RO
5921fi
5922{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
5923$as_echo "$ac_cv_target" >&6; }
5924case $ac_cv_target in
5925*-*-*) ;;
5926*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
5927esac
5928target=$ac_cv_target
5929ac_save_IFS=$IFS; IFS='-'
5930set x $ac_cv_target
5931shift
5932target_cpu=$1
5933target_vendor=$2
5934shift; shift
5935# Remember, the first character of IFS is used to create $*,
5936# except with old shells:
5937target_os=$*
5938IFS=$ac_save_IFS
5939case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
c971b7fa 5940
88b48903 5941
c8693053
RO
5942# The aliases save the names the user supplied, while $host etc.
5943# will get canonicalized.
5944test -n "$target_alias" &&
5945 test "$program_prefix$program_suffix$program_transform_name" = \
5946 NONENONEs,x,x, &&
5947 program_prefix=${target_alias}-
5948
5949# The tests for host and target for $enable_largefile require
5950# canonical names.
5951
5952
5953
5954# As the $enable_largefile decision depends on --enable-plugins we must set it
5955# even in directories otherwise not depending on the $plugins option.
5956
5957
5958 maybe_plugins=no
5959 for ac_header in dlfcn.h
5960do :
5961 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
5962"
5963if test "x$ac_cv_header_dlfcn_h" = xyes; then :
5964 cat >>confdefs.h <<_ACEOF
5965#define HAVE_DLFCN_H 1
5966_ACEOF
5967 maybe_plugins=yes
5968fi
5969
5970done
5971
5972 for ac_header in windows.h
5973do :
5974 ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
5975"
5976if test "x$ac_cv_header_windows_h" = xyes; then :
5977 cat >>confdefs.h <<_ACEOF
5978#define HAVE_WINDOWS_H 1
5979_ACEOF
5980 maybe_plugins=yes
5981fi
5982
5983done
5984
5985
5986 # Check whether --enable-plugins was given.
5987if test "${enable_plugins+set}" = set; then :
5988 enableval=$enable_plugins; case "${enableval}" in
5989 no) plugins=no ;;
5990 *) plugins=yes
5991 if test "$maybe_plugins" != "yes" ; then
5992 as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
5993 fi ;;
5994 esac
5995else
5996 plugins=$maybe_plugins
5997
5998fi
5999
6000 if test "$plugins" = "yes"; then
6001 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5
6002$as_echo_n "checking for library containing dlsym... " >&6; }
6003if ${ac_cv_search_dlsym+:} false; then :
6004 $as_echo_n "(cached) " >&6
6005else
6006 ac_func_search_save_LIBS=$LIBS
6007cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6008/* end confdefs.h. */
6009
6010/* Override any GCC internal prototype to avoid an error.
6011 Use char because int might match the return type of a GCC
6012 builtin and then its argument prototype would still apply. */
6013#ifdef __cplusplus
6014extern "C"
6015#endif
6016char dlsym ();
6017int
6018main ()
6019{
6020return dlsym ();
6021 ;
6022 return 0;
6023}
6024_ACEOF
6025for ac_lib in '' dl; do
6026 if test -z "$ac_lib"; then
6027 ac_res="none required"
6028 else
6029 ac_res=-l$ac_lib
6030 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6031 fi
6032 if ac_fn_c_try_link "$LINENO"; then :
6033 ac_cv_search_dlsym=$ac_res
6034fi
6035rm -f core conftest.err conftest.$ac_objext \
6036 conftest$ac_exeext
6037 if ${ac_cv_search_dlsym+:} false; then :
6038 break
6039fi
6040done
6041if ${ac_cv_search_dlsym+:} false; then :
6042
6043else
6044 ac_cv_search_dlsym=no
6045fi
6046rm conftest.$ac_ext
6047LIBS=$ac_func_search_save_LIBS
6048fi
6049{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5
6050$as_echo "$ac_cv_search_dlsym" >&6; }
6051ac_res=$ac_cv_search_dlsym
6052if test "$ac_res" != no; then :
6053 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6054
6055fi
6056
6057 fi
6058
6059
6060case "${host}" in
6061 sparc-*-solaris*|i?86-*-solaris*)
6062 # On native 32-bit Solaris/SPARC and x86, large-file and procfs support
6063 # were mutually exclusive until Solaris 11.3. Without procfs support,
6064 # the bfd/ elf module cannot provide certain routines such as
6065 # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user
6066 # explicitly requested large-file support through the
6067 # --enable-largefile switch, disable large-file support in favor of
6068 # procfs support.
6069 #
6070 # Check if <sys/procfs.h> is incompatible with large-file support.
6071 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6072/* end confdefs.h. */
6073#define _FILE_OFFSET_BITS 64
6074#define _STRUCTURED_PROC 1
6075#include <sys/procfs.h>
6076int
6077main ()
6078{
6079
6080 ;
6081 return 0;
6082}
6083_ACEOF
6084if ac_fn_c_try_compile "$LINENO"; then :
6085 acx_cv_procfs_lfs=yes
6086else
6087 acx_cv_procfs_lfs=no
6088fi
6089rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6090 #
6091 # Forcefully disable large-file support only if necessary, gdb is in
6092 # tree and enabled.
6093 if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \
6094 -a -d $srcdir/../gdb -a "$enable_gdb" != no; then
6095 : ${enable_largefile="no"}
6096 if test "$plugins" = yes; then
6097 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
6098plugin support disabled; require large-file support which is incompatible with GDB." >&5
6099$as_echo "$as_me: WARNING:
6100plugin support disabled; require large-file support which is incompatible with GDB." >&2;}
6101 plugins=no
88b48903 6102 fi
c8693053
RO
6103 fi
6104 #
6105 # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the
6106 # benefit of g++ 9+ which predefines it on Solaris.
6107 if test "$enable_largefile" = no; then
6108 LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS"
6109
6110 fi
6111 ;;
6112esac
88b48903 6113
2196f55f
YQ
6114# Check whether --enable-largefile was given.
6115if test "${enable_largefile+set}" = set; then :
6116 enableval=$enable_largefile;
6117fi
6118
6119if test "$enable_largefile" != no; then
6120
6121 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
6122$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
d0ac1c44 6123if ${ac_cv_sys_largefile_CC+:} false; then :
2196f55f
YQ
6124 $as_echo_n "(cached) " >&6
6125else
6126 ac_cv_sys_largefile_CC=no
6127 if test "$GCC" != yes; then
6128 ac_save_CC=$CC
6129 while :; do
6130 # IRIX 6.2 and later do not support large files by default,
6131 # so use the C compiler's -n32 option if that helps.
6132 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6133/* end confdefs.h. */
6134#include <sys/types.h>
6135 /* Check that off_t can represent 2**63 - 1 correctly.
6136 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6137 since some C++ compilers masquerading as C compilers
6138 incorrectly reject 9223372036854775807. */
9c9d63b1 6139#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6140 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6141 && LARGE_OFF_T % 2147483647 == 1)
6142 ? 1 : -1];
6143int
6144main ()
6145{
6146
6147 ;
6148 return 0;
6149}
6150_ACEOF
6151 if ac_fn_c_try_compile "$LINENO"; then :
6152 break
6153fi
6154rm -f core conftest.err conftest.$ac_objext
6155 CC="$CC -n32"
6156 if ac_fn_c_try_compile "$LINENO"; then :
6157 ac_cv_sys_largefile_CC=' -n32'; break
6158fi
6159rm -f core conftest.err conftest.$ac_objext
6160 break
6161 done
6162 CC=$ac_save_CC
6163 rm -f conftest.$ac_ext
6164 fi
6165fi
6166{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6167$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6168 if test "$ac_cv_sys_largefile_CC" != no; then
6169 CC=$CC$ac_cv_sys_largefile_CC
6170 fi
6171
6172 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6173$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
d0ac1c44 6174if ${ac_cv_sys_file_offset_bits+:} false; then :
2196f55f
YQ
6175 $as_echo_n "(cached) " >&6
6176else
6177 while :; do
6178 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6179/* end confdefs.h. */
6180#include <sys/types.h>
6181 /* Check that off_t can represent 2**63 - 1 correctly.
6182 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6183 since some C++ compilers masquerading as C compilers
6184 incorrectly reject 9223372036854775807. */
9c9d63b1 6185#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6186 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6187 && LARGE_OFF_T % 2147483647 == 1)
6188 ? 1 : -1];
6189int
6190main ()
6191{
6192
6193 ;
6194 return 0;
6195}
6196_ACEOF
6197if ac_fn_c_try_compile "$LINENO"; then :
6198 ac_cv_sys_file_offset_bits=no; break
6199fi
6200rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6201 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6202/* end confdefs.h. */
6203#define _FILE_OFFSET_BITS 64
6204#include <sys/types.h>
6205 /* Check that off_t can represent 2**63 - 1 correctly.
6206 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6207 since some C++ compilers masquerading as C compilers
6208 incorrectly reject 9223372036854775807. */
9c9d63b1 6209#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6210 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6211 && LARGE_OFF_T % 2147483647 == 1)
6212 ? 1 : -1];
6213int
6214main ()
6215{
6216
6217 ;
6218 return 0;
6219}
6220_ACEOF
6221if ac_fn_c_try_compile "$LINENO"; then :
6222 ac_cv_sys_file_offset_bits=64; break
6223fi
6224rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6225 ac_cv_sys_file_offset_bits=unknown
6226 break
6227done
6228fi
6229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6230$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6231case $ac_cv_sys_file_offset_bits in #(
6232 no | unknown) ;;
6233 *)
6234cat >>confdefs.h <<_ACEOF
6235#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6236_ACEOF
6237;;
6238esac
6239rm -rf conftest*
6240 if test $ac_cv_sys_file_offset_bits = unknown; then
6241 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6242$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
d0ac1c44 6243if ${ac_cv_sys_large_files+:} false; then :
2196f55f
YQ
6244 $as_echo_n "(cached) " >&6
6245else
6246 while :; do
6247 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6248/* end confdefs.h. */
6249#include <sys/types.h>
6250 /* Check that off_t can represent 2**63 - 1 correctly.
6251 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6252 since some C++ compilers masquerading as C compilers
6253 incorrectly reject 9223372036854775807. */
9c9d63b1 6254#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6255 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6256 && LARGE_OFF_T % 2147483647 == 1)
6257 ? 1 : -1];
6258int
6259main ()
6260{
6261
6262 ;
6263 return 0;
6264}
6265_ACEOF
6266if ac_fn_c_try_compile "$LINENO"; then :
6267 ac_cv_sys_large_files=no; break
6268fi
6269rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6270 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6271/* end confdefs.h. */
6272#define _LARGE_FILES 1
6273#include <sys/types.h>
6274 /* Check that off_t can represent 2**63 - 1 correctly.
6275 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6276 since some C++ compilers masquerading as C compilers
6277 incorrectly reject 9223372036854775807. */
9c9d63b1 6278#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6279 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6280 && LARGE_OFF_T % 2147483647 == 1)
6281 ? 1 : -1];
6282int
6283main ()
6284{
6285
6286 ;
6287 return 0;
6288}
6289_ACEOF
6290if ac_fn_c_try_compile "$LINENO"; then :
6291 ac_cv_sys_large_files=1; break
6292fi
6293rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6294 ac_cv_sys_large_files=unknown
6295 break
6296done
6297fi
6298{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6299$as_echo "$ac_cv_sys_large_files" >&6; }
6300case $ac_cv_sys_large_files in #(
6301 no | unknown) ;;
6302 *)
6303cat >>confdefs.h <<_ACEOF
6304#define _LARGE_FILES $ac_cv_sys_large_files
6305_ACEOF
6306;;
6307esac
6308rm -rf conftest*
6309 fi
2196f55f
YQ
6310fi
6311
88b48903
WN
6312
6313
5abebf3c
CB
6314
6315
6316
9c9d63b1
PM
6317 case "$host_os" in
6318 openbsd*)
6319
6320$as_echo "#define _ISOC11_SOURCE 1" >>confdefs.h
c0c3707f 6321
9c9d63b1
PM
6322 ;;
6323 esac
5abebf3c 6324
5abebf3c 6325
c0c3707f
CB
6326
6327
c8693053
RO
6328 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
6329$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
6330if ${gl_cv_c_amsterdam_compiler+:} false; then :
6331 $as_echo_n "(cached) " >&6
6332else
c0c3707f 6333
c8693053
RO
6334 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6335/* end confdefs.h. */
5abebf3c 6336
c8693053
RO
6337#ifdef __ACK__
6338Amsterdam
6339#endif
5abebf3c 6340
c8693053
RO
6341_ACEOF
6342if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6343 $EGREP "Amsterdam" >/dev/null 2>&1; then :
6344 gl_cv_c_amsterdam_compiler=yes
6345else
6346 gl_cv_c_amsterdam_compiler=no
6347fi
6348rm -f conftest*
5abebf3c
CB
6349
6350
c8693053
RO
6351fi
6352{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
6353$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
5abebf3c 6354
c8693053
RO
6355 if test $gl_cv_c_amsterdam_compiler = yes; then
6356 if test -z "$AR"; then
6357 AR='cc -c.a'
6358 fi
6359 if test -z "$ARFLAGS"; then
6360 ARFLAGS='-o'
6361 fi
6362 else
6363 :
6364 fi
c971b7fa 6365
c8693053
RO
6366 if test -n "$ac_tool_prefix"; then
6367 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6368set dummy ${ac_tool_prefix}ar; ac_word=$2
6369{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6370$as_echo_n "checking for $ac_word... " >&6; }
6371if ${ac_cv_prog_AR+:} false; then :
6372 $as_echo_n "(cached) " >&6
6373else
6374 if test -n "$AR"; then
6375 ac_cv_prog_AR="$AR" # Let the user override the test.
6376else
6377as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6378for as_dir in $PATH
6379do
6380 IFS=$as_save_IFS
6381 test -z "$as_dir" && as_dir=.
6382 for ac_exec_ext in '' $ac_executable_extensions; do
6383 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6384 ac_cv_prog_AR="${ac_tool_prefix}ar"
6385 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6386 break 2
6387 fi
6388done
6389 done
6390IFS=$as_save_IFS
c971b7fa 6391
c8693053
RO
6392fi
6393fi
6394AR=$ac_cv_prog_AR
6395if test -n "$AR"; then
6396 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
6397$as_echo "$AR" >&6; }
6398else
6399 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6400$as_echo "no" >&6; }
6401fi
c971b7fa 6402
c971b7fa 6403
c8693053
RO
6404fi
6405if test -z "$ac_cv_prog_AR"; then
6406 ac_ct_AR=$AR
6407 # Extract the first word of "ar", so it can be a program name with args.
6408set dummy ar; ac_word=$2
6409{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6410$as_echo_n "checking for $ac_word... " >&6; }
6411if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
6412 $as_echo_n "(cached) " >&6
6413else
c8693053
RO
6414 if test -n "$ac_ct_AR"; then
6415 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5e8754f9 6416else
c8693053
RO
6417as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6418for as_dir in $PATH
6419do
6420 IFS=$as_save_IFS
6421 test -z "$as_dir" && as_dir=.
6422 for ac_exec_ext in '' $ac_executable_extensions; do
6423 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6424 ac_cv_prog_ac_ct_AR="ar"
6425 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6426 break 2
6427 fi
6428done
6429 done
6430IFS=$as_save_IFS
7a6dbc2f 6431
c971b7fa 6432fi
c8693053
RO
6433fi
6434ac_ct_AR=$ac_cv_prog_ac_ct_AR
6435if test -n "$ac_ct_AR"; then
6436 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
6437$as_echo "$ac_ct_AR" >&6; }
6438else
6439 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6440$as_echo "no" >&6; }
6441fi
5e8754f9 6442
c8693053
RO
6443 if test "x$ac_ct_AR" = x; then
6444 AR="ar"
6445 else
6446 case $cross_compiling:$ac_tool_warned in
6447yes:)
6448{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6449$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6450ac_tool_warned=yes ;;
6451esac
6452 AR=$ac_ct_AR
6453 fi
6454else
6455 AR="$ac_cv_prog_AR"
6456fi
c0c3707f 6457
c8693053
RO
6458 if test -z "$ARFLAGS"; then
6459 ARFLAGS='cr'
6460 fi
7a6dbc2f 6461
7a6dbc2f 6462
c0c3707f 6463
c8693053
RO
6464 if test -z "$RANLIB"; then
6465 if test $gl_cv_c_amsterdam_compiler = yes; then
6466 RANLIB=':'
6467 else
6468 if test -n "$ac_tool_prefix"; then
6469 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6470set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6471{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6472$as_echo_n "checking for $ac_word... " >&6; }
6473if ${ac_cv_prog_RANLIB+:} false; then :
6474 $as_echo_n "(cached) " >&6
6475else
6476 if test -n "$RANLIB"; then
6477 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6478else
6479as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6480for as_dir in $PATH
6481do
6482 IFS=$as_save_IFS
6483 test -z "$as_dir" && as_dir=.
6484 for ac_exec_ext in '' $ac_executable_extensions; do
6485 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6486 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6487 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6488 break 2
6489 fi
5e8754f9 6490done
c8693053
RO
6491 done
6492IFS=$as_save_IFS
5e8754f9 6493
c971b7fa 6494fi
c8693053
RO
6495fi
6496RANLIB=$ac_cv_prog_RANLIB
6497if test -n "$RANLIB"; then
6498 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6499$as_echo "$RANLIB" >&6; }
c0c3707f 6500else
c8693053
RO
6501 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6502$as_echo "no" >&6; }
5e8754f9 6503fi
c0c3707f 6504
c8693053
RO
6505
6506fi
6507if test -z "$ac_cv_prog_RANLIB"; then
6508 ac_ct_RANLIB=$RANLIB
6509 # Extract the first word of "ranlib", so it can be a program name with args.
6510set dummy ranlib; ac_word=$2
6511{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6512$as_echo_n "checking for $ac_word... " >&6; }
6513if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
6514 $as_echo_n "(cached) " >&6
6515else
c8693053
RO
6516 if test -n "$ac_ct_RANLIB"; then
6517 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6518else
6519as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6520for as_dir in $PATH
6521do
6522 IFS=$as_save_IFS
6523 test -z "$as_dir" && as_dir=.
6524 for ac_exec_ext in '' $ac_executable_extensions; do
6525 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6526 ac_cv_prog_ac_ct_RANLIB="ranlib"
6527 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6528 break 2
5e8754f9
SDJ
6529 fi
6530done
c8693053
RO
6531 done
6532IFS=$as_save_IFS
5e8754f9
SDJ
6533
6534fi
6535fi
c8693053
RO
6536ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6537if test -n "$ac_ct_RANLIB"; then
6538 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6539$as_echo "$ac_ct_RANLIB" >&6; }
6540else
6541 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6542$as_echo "no" >&6; }
6543fi
c0c3707f 6544
c8693053
RO
6545 if test "x$ac_ct_RANLIB" = x; then
6546 RANLIB=":"
6547 else
6548 case $cross_compiling:$ac_tool_warned in
6549yes:)
6550{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6551$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6552ac_tool_warned=yes ;;
6553esac
6554 RANLIB=$ac_ct_RANLIB
6555 fi
6556else
6557 RANLIB="$ac_cv_prog_RANLIB"
5e8754f9
SDJ
6558fi
6559
c8693053 6560 fi
c0c3707f 6561 fi
5e8754f9 6562
5e8754f9 6563
5e8754f9 6564
5e8754f9
SDJ
6565
6566
5e8754f9 6567
c8693053
RO
6568 # IEEE behaviour is the default on all CPUs except Alpha and SH
6569 # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
6570 # and the GCC 4.1.2 manual).
6571 case "$host_cpu" in
6572 alpha*)
6573 # On Alpha systems, a compiler option provides the behaviour.
6574 # See the ieee(3) manual page, also available at
6575 # <https://backdrift.org/man/tru64/man3/ieee.3.html>
6576 if test -n "$GCC"; then
6577 # GCC has the option -mieee.
6578 # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
6579 CPPFLAGS="$CPPFLAGS -mieee"
6580 else
6581 # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
6582 # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
6583 CPPFLAGS="$CPPFLAGS -ieee"
6584 fi
6585 ;;
6586 sh*)
6587 if test -n "$GCC"; then
6588 # GCC has the option -mieee.
6589 CPPFLAGS="$CPPFLAGS -mieee"
6590 fi
6591 ;;
6592 esac
c0c3707f 6593
c971b7fa 6594
c971b7fa 6595
c8693053
RO
6596
6597
6598
6599
6600 # Check whether --enable-threads was given.
6601if test "${enable_threads+set}" = set; then :
6602 enableval=$enable_threads; gl_use_threads=$enableval
5e8754f9 6603else
c8693053
RO
6604 if test -n "$gl_use_threads_default"; then
6605 gl_use_threads="$gl_use_threads_default"
6606 else
6607 case "$host_os" in
6608 osf*) gl_use_threads=no ;;
6609 cygwin*)
6610 case `uname -r` in
6611 1.[0-5].*) gl_use_threads=no ;;
6612 *) gl_use_threads=yes ;;
6613 esac
6614 ;;
6615 mingw*)
6616 case "$gl_use_winpthreads_default" in
6617 yes) gl_use_threads=posix ;;
6618 no) gl_use_threads=windows ;;
6619 *) gl_use_threads=yes ;;
6620 esac
6621 ;;
6622 *) gl_use_threads=yes ;;
6623 esac
6624 fi
c971b7fa 6625
5e8754f9 6626fi
c0c3707f 6627
c8693053
RO
6628 if test "$gl_use_threads" = yes \
6629 || test "$gl_use_threads" = isoc \
6630 || test "$gl_use_threads" = posix \
6631 || test "$gl_use_threads" = isoc+posix; then
6632 # For using <threads.h> or <pthread.h>:
6633
6634
6635 if test -z "$gl_anythreadlib_early_done"; then
6636 case "$host_os" in
6637 osf*)
6638 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
6639 # groks <pthread.h>. cc also understands the flag -pthread, but
6640 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
6641 # 2. putting a flag into CPPFLAGS that has an effect on the linker
6642 # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
6643 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
6644 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
6645 ;;
6646 esac
6647 # Some systems optimize for single-threaded programs by default, and
6648 # need special flags to disable these optimizations. For example, the
6649 # definition of 'errno' in <errno.h>.
6650 case "$host_os" in
6651 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
6652 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
6653 esac
6654 gl_anythreadlib_early_done=done
5e8754f9 6655 fi
c0c3707f 6656
c8693053 6657 fi
c0c3707f 6658
c0c3707f 6659
c971b7fa 6660
c8693053
RO
6661 # Pre-early section.
6662
6663
6664
6665
6666 # Code from module absolute-header:
6667 # Code from module alloca:
6668 # Code from module alloca-opt:
6669 # Code from module arpa_inet:
6670 # Code from module assure:
6671 # Code from module at-internal:
698be2d8 6672 # Code from module attribute:
9c9d63b1 6673 # Code from module basename-lgpl:
698be2d8 6674 # Code from module btowc:
c8693053
RO
6675 # Code from module builtin-expect:
6676 # Code from module c99:
6677 # Code from module canonicalize-lgpl:
6678 # Code from module chdir:
6679 # Code from module chdir-long:
9c9d63b1 6680 # Code from module clock-time:
c8693053
RO
6681 # Code from module cloexec:
6682 # Code from module close:
6683 # Code from module closedir:
6684 # Code from module count-one-bits:
698be2d8 6685 # Code from module ctype:
c8693053
RO
6686 # Code from module d-ino:
6687 # Code from module d-type:
6688 # Code from module dirent:
6689 # Code from module dirfd:
6690 # Code from module dirname-lgpl:
c8693053
RO
6691 # Code from module double-slash-root:
6692 # Code from module dup:
6693 # Code from module dup2:
9c9d63b1 6694 # Code from module eloop-threshold:
c8693053
RO
6695 # Code from module environ:
6696 # Code from module errno:
6697 # Code from module error:
6698 # Code from module exitfail:
6699 # Code from module extensions:
6700 # Code from module extern-inline:
6701 # Code from module fchdir:
6702 # Code from module fcntl:
6703 # Code from module fcntl-h:
6704 # Code from module fd-hook:
6705 # Code from module fd-safer-flag:
6706 # Code from module fdopendir:
6707 # Code from module filename:
6708 # Code from module filenamecat-lgpl:
6709 # Code from module flexmember:
6710 # Code from module float:
6711 # Code from module fnmatch:
6712 # Code from module fnmatch-gnu:
6713 # Code from module fnmatch-h:
6714 # Code from module fpieee:
6715
6716 # Code from module fpucw:
9c9d63b1 6717 # Code from module free-posix:
c8693053
RO
6718 # Code from module frexp:
6719 # Code from module frexpl:
6720 # Code from module fstat:
6721 # Code from module fstatat:
4aaaa4e0 6722 # Code from module gendocs:
c8693053
RO
6723 # Code from module getcwd:
6724 # Code from module getcwd-lgpl:
c17253b9 6725 # Code from module getdelim:
c8693053 6726 # Code from module getdtablesize:
c17253b9 6727 # Code from module getline:
c8693053
RO
6728 # Code from module getlogin_r:
6729 # Code from module getprogname:
698be2d8 6730 # Code from module getrandom:
c8693053
RO
6731 # Code from module gettext-h:
6732 # Code from module gettimeofday:
0fa6376c 6733 # Code from module gitlog-to-changelog:
c8693053
RO
6734 # Code from module glob:
6735 # Code from module glob-h:
6736 # Code from module hard-locale:
9c9d63b1 6737 # Code from module idx:
c8693053
RO
6738 # Code from module include_next:
6739 # Code from module inet_ntop:
6740 # Code from module intprops:
6741 # Code from module inttypes:
6742 # Code from module inttypes-incomplete:
698be2d8 6743 # Code from module isblank:
c8693053
RO
6744 # Code from module isnand-nolibm:
6745 # Code from module isnanl-nolibm:
6746 # Code from module largefile:
6747
6748 # Code from module libc-config:
6749 # Code from module limits-h:
6750 # Code from module localcharset:
6751 # Code from module locale:
c8693053
RO
6752 # Code from module lock:
6753 # Code from module lstat:
6754 # Code from module malloc-posix:
6755 # Code from module malloca:
6756 # Code from module math:
6757 # Code from module mbrtowc:
6758 # Code from module mbsinit:
6759 # Code from module mbsrtowcs:
698be2d8 6760 # Code from module mbtowc:
c8693053
RO
6761 # Code from module memchr:
6762 # Code from module memmem:
6763 # Code from module memmem-simple:
6764 # Code from module mempcpy:
6765 # Code from module memrchr:
698be2d8 6766 # Code from module minmax:
c8693053
RO
6767 # Code from module mkdir:
6768 # Code from module mkdtemp:
6769 # Code from module mkostemp:
6770 # Code from module msvc-inval:
6771 # Code from module msvc-nothrow:
6772 # Code from module multiarch:
6773 # Code from module netinet_in:
6774 # Code from module nocrash:
6775 # Code from module open:
6776 # Code from module openat:
6777 # Code from module openat-die:
6778 # Code from module openat-h:
6779 # Code from module opendir:
6780 # Code from module pathmax:
9c9d63b1 6781 # Code from module pipe-posix:
c8693053
RO
6782 # Code from module rawmemchr:
6783 # Code from module readdir:
6784 # Code from module readlink:
6785 # Code from module realloc-posix:
6786 # Code from module rename:
6787 # Code from module rewinddir:
6788 # Code from module rmdir:
6789 # Code from module same-inode:
6790 # Code from module save-cwd:
6791 # Code from module scratch_buffer:
6792 # Code from module setenv:
6793 # Code from module setlocale-null:
6794 # Code from module signal-h:
6795 # Code from module snippet/_Noreturn:
6796 # Code from module snippet/arg-nonnull:
6797 # Code from module snippet/c++defs:
6798 # Code from module snippet/warn-on-use:
6799 # Code from module socklen:
6800 # Code from module ssize_t:
6801 # Code from module stat:
6802 # Code from module stat-time:
6803 # Code from module std-gnu11:
6804 # Code from module stdalign:
6805 # Code from module stdbool:
6806 # Code from module stddef:
6807 # Code from module stdint:
6808 # Code from module stdio:
6809 # Code from module stdlib:
6810 # Code from module strchrnul:
6811 # Code from module strdup-posix:
6812 # Code from module streq:
6813 # Code from module strerror:
6814 # Code from module strerror-override:
6815 # Code from module strerror_r-posix:
6816 # Code from module string:
698be2d8 6817 # Code from module strnlen:
c8693053
RO
6818 # Code from module strnlen1:
6819 # Code from module strstr:
6820 # Code from module strstr-simple:
6821 # Code from module strtok_r:
698be2d8 6822 # Code from module sys_random:
c8693053
RO
6823 # Code from module sys_socket:
6824 # Code from module sys_stat:
6825 # Code from module sys_time:
6826 # Code from module sys_types:
6827 # Code from module sys_uio:
6828 # Code from module tempname:
6829 # Code from module threadlib:
6830
6831
6832
6833 # Code from module time:
6834 # Code from module time_r:
6835 # Code from module unistd:
6836 # Code from module unistd-safer:
6837 # Code from module unsetenv:
6838 # Code from module update-copyright:
6839 # Code from module verify:
6840 # Code from module wchar:
6841 # Code from module wctype-h:
6842 # Code from module windows-mutex:
6843 # Code from module windows-once:
6844 # Code from module windows-recmutex:
6845 # Code from module windows-rwlock:
698be2d8
CB
6846 # Code from module wmemchr:
6847 # Code from module wmempcpy:
c8693053
RO
6848 # Code from module xalloc-oversized:
6849
6850
6851am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
c971b7fa
PA
6852
6853
c0c3707f
CB
6854ac_aux_dir=
6855for ac_dir in .. "$srcdir"/..; do
6856 if test -f "$ac_dir/install-sh"; then
6857 ac_aux_dir=$ac_dir
6858 ac_install_sh="$ac_aux_dir/install-sh -c"
6859 break
6860 elif test -f "$ac_dir/install.sh"; then
6861 ac_aux_dir=$ac_dir
6862 ac_install_sh="$ac_aux_dir/install.sh -c"
6863 break
6864 elif test -f "$ac_dir/shtool"; then
6865 ac_aux_dir=$ac_dir
6866 ac_install_sh="$ac_aux_dir/shtool install -c"
6867 break
6868 fi
6869done
6870if test -z "$ac_aux_dir"; then
6871 as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5
6872fi
6873
6874# These three variables are undocumented and unsupported,
6875# and are intended to be withdrawn in a future Autoconf release.
6876# They can cause serious problems if a builder's source tree is in a directory
6877# whose full name contains unusual characters.
6878ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
6879ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
6880ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
698be2d8 6891
9c9d63b1 6892
c0c3707f
CB
6893 # Check whether --enable-cross-guesses was given.
6894if test "${enable_cross_guesses+set}" = set; then :
6895 enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
6896 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
6897$as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
6898 enableval=conservative
6899 fi
6900 gl_cross_guesses="$enableval"
6901else
6902 gl_cross_guesses=conservative
6903fi
6904
6905 if test $gl_cross_guesses = risky; then
6906 gl_cross_guess_normal="guessing yes"
6907 gl_cross_guess_inverted="guessing no"
6908 else
6909 gl_cross_guess_normal="guessing no"
6910 gl_cross_guess_inverted="guessing yes"
6911 fi
6912 LIBC_FATAL_STDERR_=1
6913 export LIBC_FATAL_STDERR_
6914
5df4cba6 6915
c0c3707f
CB
6916ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
6917if test "x$ac_cv_type_size_t" = xyes; then :
6918
6919else
6920
6921cat >>confdefs.h <<_ACEOF
6922#define size_t unsigned int
6923_ACEOF
6924
6925fi
6926
6927# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
6928# for constant arguments. Useless!
6929{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
6930$as_echo_n "checking for working alloca.h... " >&6; }
6931if ${ac_cv_working_alloca_h+:} false; then :
6932 $as_echo_n "(cached) " >&6
6933else
6934 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6935/* end confdefs.h. */
6936#include <alloca.h>
5e8754f9
SDJ
6937int
6938main ()
6939{
c0c3707f
CB
6940char *p = (char *) alloca (2 * sizeof (int));
6941 if (p) return 0;
5e8754f9
SDJ
6942 ;
6943 return 0;
6944}
6945_ACEOF
c0c3707f
CB
6946if ac_fn_c_try_link "$LINENO"; then :
6947 ac_cv_working_alloca_h=yes
6948else
6949 ac_cv_working_alloca_h=no
5e8754f9 6950fi
c0c3707f
CB
6951rm -f core conftest.err conftest.$ac_objext \
6952 conftest$ac_exeext conftest.$ac_ext
5e8754f9 6953fi
c0c3707f
CB
6954{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
6955$as_echo "$ac_cv_working_alloca_h" >&6; }
6956if test $ac_cv_working_alloca_h = yes; then
c971b7fa 6957
c0c3707f 6958$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
c971b7fa 6959
c0c3707f 6960fi
d0ac1c44 6961
c0c3707f
CB
6962{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
6963$as_echo_n "checking for alloca... " >&6; }
6964if ${ac_cv_func_alloca_works+:} false; then :
5e8754f9
SDJ
6965 $as_echo_n "(cached) " >&6
6966else
6967 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6968/* end confdefs.h. */
c0c3707f
CB
6969#ifdef __GNUC__
6970# define alloca __builtin_alloca
6971#else
6972# ifdef _MSC_VER
6973# include <malloc.h>
6974# define alloca _alloca
6975# else
6976# ifdef HAVE_ALLOCA_H
6977# include <alloca.h>
6978# else
6979# ifdef _AIX
6980 #pragma alloca
6981# else
6982# ifndef alloca /* predefined by HP cc +Olibcalls */
6983void *alloca (size_t);
6984# endif
6985# endif
6986# endif
6987# endif
6988#endif
d0ac1c44 6989
5e8754f9
SDJ
6990int
6991main ()
6992{
c0c3707f
CB
6993char *p = (char *) alloca (1);
6994 if (p) return 0;
5e8754f9
SDJ
6995 ;
6996 return 0;
6997}
6998_ACEOF
c0c3707f
CB
6999if ac_fn_c_try_link "$LINENO"; then :
7000 ac_cv_func_alloca_works=yes
7001else
7002 ac_cv_func_alloca_works=no
5e8754f9 7003fi
c0c3707f
CB
7004rm -f core conftest.err conftest.$ac_objext \
7005 conftest$ac_exeext conftest.$ac_ext
7006fi
7007{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
7008$as_echo "$ac_cv_func_alloca_works" >&6; }
7a6dbc2f 7009
c0c3707f 7010if test $ac_cv_func_alloca_works = yes; then
7a6dbc2f 7011
c0c3707f 7012$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
7a6dbc2f 7013
5e8754f9 7014else
c0c3707f
CB
7015 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
7016# that cause trouble. Some versions do not even contain alloca or
7017# contain a buggy version. If you still want to use their alloca,
7018# use ar to extract alloca.o from them instead of compiling alloca.c.
c971b7fa
PA
7019
7020
7a6dbc2f 7021
73cc7272
TT
7022
7023
c0c3707f 7024ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
73cc7272 7025
c0c3707f 7026$as_echo "#define C_ALLOCA 1" >>confdefs.h
73cc7272
TT
7027
7028
c0c3707f
CB
7029{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
7030$as_echo_n "checking stack direction for C alloca... " >&6; }
7031if ${ac_cv_c_stack_direction+:} false; then :
73cc7272
TT
7032 $as_echo_n "(cached) " >&6
7033else
c0c3707f
CB
7034 if test "$cross_compiling" = yes; then :
7035 ac_cv_c_stack_direction=0
7036else
7037 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7038/* end confdefs.h. */
c0c3707f
CB
7039$ac_includes_default
7040int
7041find_stack_direction (int *addr, int depth)
7042{
7043 int dir, dummy = 0;
7044 if (! addr)
7045 addr = &dummy;
7046 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
7047 dir = depth ? find_stack_direction (addr, depth - 1) : 0;
7048 return dir + dummy;
7049}
73cc7272 7050
73cc7272 7051int
c0c3707f 7052main (int argc, char **argv)
73cc7272 7053{
c0c3707f 7054 return find_stack_direction (0, argc + !argv + 20) < 0;
73cc7272
TT
7055}
7056_ACEOF
c0c3707f
CB
7057if ac_fn_c_try_run "$LINENO"; then :
7058 ac_cv_c_stack_direction=1
7059else
7060 ac_cv_c_stack_direction=-1
73cc7272 7061fi
c0c3707f
CB
7062rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7063 conftest.$ac_objext conftest.beam conftest.$ac_ext
73cc7272 7064fi
73cc7272 7065
73cc7272 7066fi
9c9d63b1
PM
7067{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
7068$as_echo "$ac_cv_c_stack_direction" >&6; }
7069cat >>confdefs.h <<_ACEOF
7070#define STACK_DIRECTION $ac_cv_c_stack_direction
c0c3707f
CB
7071_ACEOF
7072
9c9d63b1 7073
73cc7272
TT
7074fi
7075
9c9d63b1
PM
7076
7077 GNULIB_INET_NTOP=0;
7078 GNULIB_INET_PTON=0;
7079 HAVE_DECL_INET_NTOP=1;
7080 HAVE_DECL_INET_PTON=1;
7081 REPLACE_INET_NTOP=0;
7082 REPLACE_INET_PTON=0;
73cc7272 7083
c0c3707f
CB
7084
7085
7086
7087
7088 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
7089$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
7090if ${gl_cv_have_include_next+:} false; then :
73cc7272
TT
7091 $as_echo_n "(cached) " >&6
7092else
c0c3707f
CB
7093 rm -rf conftestd1a conftestd1b conftestd2
7094 mkdir conftestd1a conftestd1b conftestd2
7095 cat <<EOF > conftestd1a/conftest.h
7096#define DEFINED_IN_CONFTESTD1
7097#include_next <conftest.h>
7098#ifdef DEFINED_IN_CONFTESTD2
7099int foo;
7100#else
7101#error "include_next doesn't work"
7102#endif
7103EOF
7104 cat <<EOF > conftestd1b/conftest.h
7105#define DEFINED_IN_CONFTESTD1
7106#include <stdio.h>
7107#include_next <conftest.h>
7108#ifdef DEFINED_IN_CONFTESTD2
7109int foo;
7110#else
7111#error "include_next doesn't work"
7112#endif
7113EOF
7114 cat <<EOF > conftestd2/conftest.h
7115#ifndef DEFINED_IN_CONFTESTD1
7116#error "include_next test doesn't work"
7117#endif
7118#define DEFINED_IN_CONFTESTD2
7119EOF
7120 gl_save_CPPFLAGS="$CPPFLAGS"
7121 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
7122 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7123/* end confdefs.h. */
c0c3707f 7124#include <conftest.h>
73cc7272 7125_ACEOF
c0c3707f
CB
7126if ac_fn_c_try_compile "$LINENO"; then :
7127 gl_cv_have_include_next=yes
7128else
7129 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
7130 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7131/* end confdefs.h. */
7132#include <conftest.h>
7133_ACEOF
7134if ac_fn_c_try_compile "$LINENO"; then :
7135 gl_cv_have_include_next=buggy
7136else
7137 gl_cv_have_include_next=no
73cc7272 7138fi
c0c3707f
CB
7139rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7140
73cc7272 7141fi
c0c3707f
CB
7142rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7143 CPPFLAGS="$gl_save_CPPFLAGS"
7144 rm -rf conftestd1a conftestd1b conftestd2
7145
73cc7272 7146fi
c0c3707f
CB
7147{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
7148$as_echo "$gl_cv_have_include_next" >&6; }
7149 PRAGMA_SYSTEM_HEADER=
7150 if test $gl_cv_have_include_next = yes; then
7151 INCLUDE_NEXT=include_next
7152 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7153 if test -n "$GCC"; then
7154 PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
7155 fi
7156 else
7157 if test $gl_cv_have_include_next = buggy; then
7158 INCLUDE_NEXT=include
7159 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7160 else
7161 INCLUDE_NEXT=include
7162 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
7163 fi
73cc7272
TT
7164 fi
7165
73cc7272 7166
73cc7272 7167
9c9d63b1
PM
7168
7169 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether source code line length is unlimited" >&5
7170$as_echo_n "checking whether source code line length is unlimited... " >&6; }
7171if ${gl_cv_source_line_length_unlimited+:} false; then :
73cc7272
TT
7172 $as_echo_n "(cached) " >&6
7173else
9c9d63b1 7174 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7175/* end confdefs.h. */
73cc7272 7176
c0c3707f
CB
7177#ifdef __TANDEM
7178choke me
7179#endif
73cc7272 7180
73cc7272 7181_ACEOF
c0c3707f
CB
7182if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7183 $EGREP "choke me" >/dev/null 2>&1; then :
9c9d63b1 7184 gl_cv_source_line_length_unlimited=no
c0c3707f 7185else
9c9d63b1 7186 gl_cv_source_line_length_unlimited=yes
73cc7272 7187fi
c0c3707f 7188rm -f conftest*
73cc7272 7189
73cc7272
TT
7190
7191fi
9c9d63b1
PM
7192{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_source_line_length_unlimited" >&5
7193$as_echo "$gl_cv_source_line_length_unlimited" >&6; }
7194 if test $gl_cv_source_line_length_unlimited = no; then
c0c3707f
CB
7195 PRAGMA_COLUMNS="#pragma COLUMNS 10000"
7196 else
7197 PRAGMA_COLUMNS=
7198 fi
73cc7272
TT
7199
7200
7201
73cc7272 7202
73cc7272
TT
7203
7204
c0c3707f
CB
7205 if test $ac_cv_header_features_h = yes; then
7206 HAVE_FEATURES_H=1
7207 else
7208 HAVE_FEATURES_H=0
7209 fi
73cc7272 7210
7a6dbc2f
SDJ
7211
7212
7213
7214
c0c3707f
CB
7215 if test $ac_cv_header_sys_socket_h = no; then
7216 for ac_header in ws2tcpip.h
7217do :
7218 ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
7219if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
7220 cat >>confdefs.h <<_ACEOF
7221#define HAVE_WS2TCPIP_H 1
7222_ACEOF
7a6dbc2f 7223
c0c3707f 7224fi
7a6dbc2f 7225
c0c3707f 7226done
7a6dbc2f 7227
c0c3707f 7228 fi
7a6dbc2f 7229
c0c3707f
CB
7230{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7231$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7232if test -z "$MKDIR_P"; then
7233 if ${ac_cv_path_mkdir+:} false; then :
7234 $as_echo_n "(cached) " >&6
5e8754f9 7235else
c0c3707f
CB
7236 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7237for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7238do
7239 IFS=$as_save_IFS
7240 test -z "$as_dir" && as_dir=.
7241 for ac_prog in mkdir gmkdir; do
7242 for ac_exec_ext in '' $ac_executable_extensions; do
7243 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7244 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7245 'mkdir (GNU coreutils) '* | \
7246 'mkdir (coreutils) '* | \
7247 'mkdir (fileutils) '4.1*)
7248 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7249 break 3;;
7250 esac
7251 done
7252 done
7253 done
7254IFS=$as_save_IFS
7a6dbc2f 7255
5e8754f9 7256fi
7a6dbc2f 7257
c0c3707f
CB
7258 test -d ./--version && rmdir ./--version
7259 if test "${ac_cv_path_mkdir+set}" = set; then
7260 MKDIR_P="$ac_cv_path_mkdir -p"
7261 else
7262 # As a last resort, use the slow shell script. Don't cache a
7263 # value for MKDIR_P within a source directory, because that will
7264 # break other packages using the cache if that directory is
7265 # removed, or if the value is a relative name.
7266 MKDIR_P="$ac_install_sh -d"
7267 fi
5e8754f9 7268fi
c0c3707f
CB
7269{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7270$as_echo "$MKDIR_P" >&6; }
7a6dbc2f 7271
5e8754f9 7272
698be2d8
CB
7273 GNULIB_BTOWC=0;
7274 GNULIB_WCTOB=0;
7275 GNULIB_MBSINIT=0;
7276 GNULIB_MBRTOWC=0;
7277 GNULIB_MBRLEN=0;
7278 GNULIB_MBSRTOWCS=0;
7279 GNULIB_MBSNRTOWCS=0;
7280 GNULIB_WCRTOMB=0;
7281 GNULIB_WCSRTOMBS=0;
7282 GNULIB_WCSNRTOMBS=0;
7283 GNULIB_WCWIDTH=0;
7284 GNULIB_WMEMCHR=0;
7285 GNULIB_WMEMCMP=0;
7286 GNULIB_WMEMCPY=0;
7287 GNULIB_WMEMMOVE=0;
7288 GNULIB_WMEMPCPY=0;
7289 GNULIB_WMEMSET=0;
7290 GNULIB_WCSLEN=0;
7291 GNULIB_WCSNLEN=0;
7292 GNULIB_WCSCPY=0;
7293 GNULIB_WCPCPY=0;
7294 GNULIB_WCSNCPY=0;
7295 GNULIB_WCPNCPY=0;
7296 GNULIB_WCSCAT=0;
7297 GNULIB_WCSNCAT=0;
7298 GNULIB_WCSCMP=0;
7299 GNULIB_WCSNCMP=0;
7300 GNULIB_WCSCASECMP=0;
7301 GNULIB_WCSNCASECMP=0;
7302 GNULIB_WCSCOLL=0;
7303 GNULIB_WCSXFRM=0;
7304 GNULIB_WCSDUP=0;
7305 GNULIB_WCSCHR=0;
7306 GNULIB_WCSRCHR=0;
7307 GNULIB_WCSCSPN=0;
7308 GNULIB_WCSSPN=0;
7309 GNULIB_WCSPBRK=0;
7310 GNULIB_WCSSTR=0;
7311 GNULIB_WCSTOK=0;
7312 GNULIB_WCSWIDTH=0;
7313 GNULIB_WCSFTIME=0;
9c9d63b1 7314 GNULIB_MDA_WCSDUP=1;
698be2d8
CB
7315 HAVE_BTOWC=1;
7316 HAVE_MBSINIT=1;
7317 HAVE_MBRTOWC=1;
7318 HAVE_MBRLEN=1;
7319 HAVE_MBSRTOWCS=1;
7320 HAVE_MBSNRTOWCS=1;
7321 HAVE_WCRTOMB=1;
7322 HAVE_WCSRTOMBS=1;
7323 HAVE_WCSNRTOMBS=1;
7324 HAVE_WMEMCHR=1;
7325 HAVE_WMEMCMP=1;
7326 HAVE_WMEMCPY=1;
7327 HAVE_WMEMMOVE=1;
7328 HAVE_WMEMPCPY=1;
7329 HAVE_WMEMSET=1;
7330 HAVE_WCSLEN=1;
7331 HAVE_WCSNLEN=1;
7332 HAVE_WCSCPY=1;
7333 HAVE_WCPCPY=1;
7334 HAVE_WCSNCPY=1;
7335 HAVE_WCPNCPY=1;
7336 HAVE_WCSCAT=1;
7337 HAVE_WCSNCAT=1;
7338 HAVE_WCSCMP=1;
7339 HAVE_WCSNCMP=1;
7340 HAVE_WCSCASECMP=1;
7341 HAVE_WCSNCASECMP=1;
7342 HAVE_WCSCOLL=1;
7343 HAVE_WCSXFRM=1;
7344 HAVE_WCSDUP=1;
7345 HAVE_WCSCHR=1;
7346 HAVE_WCSRCHR=1;
7347 HAVE_WCSCSPN=1;
7348 HAVE_WCSSPN=1;
7349 HAVE_WCSPBRK=1;
7350 HAVE_WCSSTR=1;
7351 HAVE_WCSTOK=1;
7352 HAVE_WCSWIDTH=1;
7353 HAVE_WCSFTIME=1;
7354 HAVE_DECL_WCTOB=1;
9c9d63b1 7355 HAVE_DECL_WCSDUP=1;
698be2d8
CB
7356 HAVE_DECL_WCWIDTH=1;
7357 REPLACE_MBSTATE_T=0;
7358 REPLACE_BTOWC=0;
7359 REPLACE_WCTOB=0;
7360 REPLACE_MBSINIT=0;
7361 REPLACE_MBRTOWC=0;
7362 REPLACE_MBRLEN=0;
7363 REPLACE_MBSRTOWCS=0;
7364 REPLACE_MBSNRTOWCS=0;
7365 REPLACE_WCRTOMB=0;
7366 REPLACE_WCSRTOMBS=0;
7367 REPLACE_WCSNRTOMBS=0;
7368 REPLACE_WCWIDTH=0;
7369 REPLACE_WCSWIDTH=0;
7370 REPLACE_WCSFTIME=0;
7371 REPLACE_WCSTOK=0;
7372
7373
9c9d63b1
PM
7374
7375 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
698be2d8
CB
7376$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
7377if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
7378 $as_echo_n "(cached) " >&6
7379else
7380 gl_cv_header_wchar_h_correct_inline=yes
9c9d63b1
PM
7381 case "$host_os" in
7382 *-gnu* | gnu*)
7383 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
698be2d8
CB
7384/* end confdefs.h. */
7385
9c9d63b1
PM
7386
7387 #define wcstod renamed_wcstod
7388 #include <wchar.h>
7389 extern int zero (void);
7390 int main () { return zero(); }
698be2d8
CB
7391
7392_ACEOF
9c9d63b1
PM
7393 save_ac_compile="$ac_compile"
7394 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
7395 if echo '#include "conftest.c"' >conftest1.c \
7396 && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
698be2d8
CB
7397 (eval $ac_compile) 2>&5
7398 ac_status=$?
7399 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7400 test $ac_status = 0; }; then
9c9d63b1 7401 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
698be2d8
CB
7402/* end confdefs.h. */
7403
9c9d63b1
PM
7404
7405 #define wcstod renamed_wcstod
7406 #include <wchar.h>
7407 int zero (void) { return 0; }
698be2d8
CB
7408
7409_ACEOF
9c9d63b1
PM
7410 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
7411 if echo '#include "conftest.c"' >conftest2.c \
7412 && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
698be2d8
CB
7413 (eval $ac_compile) 2>&5
7414 ac_status=$?
7415 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7416 test $ac_status = 0; }; then
9c9d63b1
PM
7417 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
7418 :
7419 else
7420 gl_cv_header_wchar_h_correct_inline=no
7421 fi
7422 fi
698be2d8 7423 fi
9c9d63b1
PM
7424 ac_compile="$save_ac_compile"
7425 rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
7426 ;;
7427 esac
698be2d8
CB
7428
7429fi
7430{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
7431$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
7432 if test $gl_cv_header_wchar_h_correct_inline = no; then
7433 as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
7434This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
7435C99 mode. You have four options:
7436 - Add the flag -fgnu89-inline to CC and reconfigure, or
7437 - Fix your include files, using parts of
7438 <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
7439 - Use a gcc version older than 4.3, or
7440 - Don't use the flags -std=c99 or -std=gnu99.
7441Configuration aborted." "$LINENO" 5
7442 fi
7443
7444
7445
7446
7447 for ac_func in $ac_func_list
7448do :
7449 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
7450ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
7451if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
7452 cat >>confdefs.h <<_ACEOF
7453#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
7454_ACEOF
7455
7456fi
7457done
7458
7459
7460
7461
7462 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
7463$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
7464if ${am_cv_langinfo_codeset+:} false; then :
7465 $as_echo_n "(cached) " >&6
7466else
7467 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7468/* end confdefs.h. */
7469#include <langinfo.h>
7470int
7471main ()
7472{
7473char* cs = nl_langinfo(CODESET); return !cs;
7474 ;
7475 return 0;
7476}
7477_ACEOF
7478if ac_fn_c_try_link "$LINENO"; then :
7479 am_cv_langinfo_codeset=yes
7480else
7481 am_cv_langinfo_codeset=no
7482fi
7483rm -f core conftest.err conftest.$ac_objext \
7484 conftest$ac_exeext conftest.$ac_ext
7485
7486fi
7487{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
7488$as_echo "$am_cv_langinfo_codeset" >&6; }
7489 if test $am_cv_langinfo_codeset = yes; then
7490
7491$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
7492
7493 fi
7494
7495
7496
7497
7498 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
7499$as_echo_n "checking for a traditional french locale... " >&6; }
7500if ${gt_cv_locale_fr+:} false; then :
7501 $as_echo_n "(cached) " >&6
7502else
7503
7504 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7505/* end confdefs.h. */
7506
7507#include <locale.h>
7508#include <time.h>
7509#if HAVE_LANGINFO_CODESET
7510# include <langinfo.h>
7511#endif
7512#include <stdlib.h>
7513#include <string.h>
7514struct tm t;
7515char buf[16];
7516int main () {
7517 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
7518 imitates locale dependent behaviour by looking at the environment
7519 variables, and all locales use the UTF-8 encoding. */
7520#if defined __BEOS__ || defined __HAIKU__
7521 return 1;
7522#else
7523 /* Check whether the given locale name is recognized by the system. */
7524# if defined _WIN32 && !defined __CYGWIN__
7525 /* On native Windows, setlocale(category, "") looks at the system settings,
7526 not at the environment variables. Also, when an encoding suffix such
7527 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
7528 category of the locale to "C". */
7529 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
7530 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
7531 return 1;
7532# else
7533 if (setlocale (LC_ALL, "") == NULL) return 1;
7534# endif
7535 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
7536 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
7537 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
7538 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
7539 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
7540 some unit tests fail.
7541 On MirBSD 10, when an unsupported locale is specified, setlocale()
7542 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
7543# if HAVE_LANGINFO_CODESET
7544 {
7545 const char *cs = nl_langinfo (CODESET);
7546 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
7547 || strcmp (cs, "UTF-8") == 0)
7548 return 1;
7549 }
7550# endif
7551# ifdef __CYGWIN__
7552 /* On Cygwin, avoid locale names without encoding suffix, because the
7553 locale_charset() function relies on the encoding suffix. Note that
7554 LC_ALL is set on the command line. */
7555 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
7556# endif
7557 /* Check whether in the abbreviation of the second month, the second
7558 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
7559 one byte long. This excludes the UTF-8 encoding. */
7560 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
7561 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
7562# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
7563 /* Check whether the decimal separator is a comma.
7564 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
7565 are nl_langinfo(RADIXCHAR) are both ".". */
7566 if (localeconv () ->decimal_point[0] != ',') return 1;
7567# endif
7568 return 0;
7569#endif
7570}
7571
7572_ACEOF
7573 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
7574 (eval $ac_link) 2>&5
7575 ac_status=$?
7576 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7577 test $ac_status = 0; } && test -s conftest$ac_exeext; then
7578 case "$host_os" in
7579 # Handle native Windows specially, because there setlocale() interprets
7580 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
7581 # "fr" or "fra" as "French" or "French_France.1252",
7582 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
7583 # "ja" as "Japanese" or "Japanese_Japan.932",
7584 # and similar.
7585 mingw*)
7586 # Test for the native Windows locale name.
7587 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7588 gt_cv_locale_fr=French_France.1252
7589 else
7590 # None found.
7591 gt_cv_locale_fr=none
7592 fi
7593 ;;
7594 *)
7595 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
7596 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
7597 # configure script would override the LC_ALL setting. Likewise for
7598 # LC_CTYPE, which is also set at the beginning of the configure script.
7599 # Test for the usual locale name.
7600 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7601 gt_cv_locale_fr=fr_FR
7602 else
7603 # Test for the locale name with explicit encoding suffix.
7604 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7605 gt_cv_locale_fr=fr_FR.ISO-8859-1
7606 else
7607 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
7608 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7609 gt_cv_locale_fr=fr_FR.ISO8859-1
7610 else
7611 # Test for the HP-UX locale name.
7612 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7613 gt_cv_locale_fr=fr_FR.iso88591
7614 else
7615 # Test for the Solaris 7 locale name.
7616 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7617 gt_cv_locale_fr=fr
7618 else
7619 # None found.
7620 gt_cv_locale_fr=none
7621 fi
7622 fi
7623 fi
7624 fi
7625 fi
7626 ;;
7627 esac
7628 fi
7629 rm -fr conftest*
7630
7631fi
7632{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
7633$as_echo "$gt_cv_locale_fr" >&6; }
7634 LOCALE_FR=$gt_cv_locale_fr
7635
7636
7637
7638 GNULIB__EXIT=0;
9c9d63b1 7639 GNULIB_ALIGNED_ALLOC=0;
698be2d8
CB
7640 GNULIB_ATOLL=0;
7641 GNULIB_CALLOC_POSIX=0;
7642 GNULIB_CANONICALIZE_FILE_NAME=0;
9c9d63b1 7643 GNULIB_FREE_POSIX=0;
698be2d8
CB
7644 GNULIB_GETLOADAVG=0;
7645 GNULIB_GETSUBOPT=0;
7646 GNULIB_GRANTPT=0;
7647 GNULIB_MALLOC_POSIX=0;
7648 GNULIB_MBTOWC=0;
7649 GNULIB_MKDTEMP=0;
7650 GNULIB_MKOSTEMP=0;
7651 GNULIB_MKOSTEMPS=0;
7652 GNULIB_MKSTEMP=0;
7653 GNULIB_MKSTEMPS=0;
9c9d63b1 7654 GNULIB_POSIX_MEMALIGN=0;
698be2d8
CB
7655 GNULIB_POSIX_OPENPT=0;
7656 GNULIB_PTSNAME=0;
7657 GNULIB_PTSNAME_R=0;
7658 GNULIB_PUTENV=0;
7659 GNULIB_QSORT_R=0;
7660 GNULIB_RANDOM=0;
7661 GNULIB_RANDOM_R=0;
7662 GNULIB_REALLOCARRAY=0;
7663 GNULIB_REALLOC_POSIX=0;
7664 GNULIB_REALPATH=0;
7665 GNULIB_RPMATCH=0;
7666 GNULIB_SECURE_GETENV=0;
7667 GNULIB_SETENV=0;
7668 GNULIB_STRTOD=0;
7669 GNULIB_STRTOLD=0;
7670 GNULIB_STRTOLL=0;
7671 GNULIB_STRTOULL=0;
7672 GNULIB_SYSTEM_POSIX=0;
7673 GNULIB_UNLOCKPT=0;
7674 GNULIB_UNSETENV=0;
7675 GNULIB_WCTOMB=0;
9c9d63b1
PM
7676 GNULIB_MDA_ECVT=1;
7677 GNULIB_MDA_FCVT=1;
7678 GNULIB_MDA_GCVT=1;
7679 GNULIB_MDA_MKTEMP=1;
7680 GNULIB_MDA_PUTENV=1;
698be2d8 7681 HAVE__EXIT=1;
9c9d63b1 7682 HAVE_ALIGNED_ALLOC=1;
698be2d8
CB
7683 HAVE_ATOLL=1;
7684 HAVE_CANONICALIZE_FILE_NAME=1;
9c9d63b1
PM
7685 HAVE_DECL_ECVT=1;
7686 HAVE_DECL_FCVT=1;
7687 HAVE_DECL_GCVT=1;
698be2d8
CB
7688 HAVE_DECL_GETLOADAVG=1;
7689 HAVE_GETSUBOPT=1;
7690 HAVE_GRANTPT=1;
7691 HAVE_INITSTATE=1;
7692 HAVE_DECL_INITSTATE=1;
7693 HAVE_MBTOWC=1;
7694 HAVE_MKDTEMP=1;
7695 HAVE_MKOSTEMP=1;
7696 HAVE_MKOSTEMPS=1;
7697 HAVE_MKSTEMP=1;
7698 HAVE_MKSTEMPS=1;
9c9d63b1 7699 HAVE_POSIX_MEMALIGN=1;
698be2d8
CB
7700 HAVE_POSIX_OPENPT=1;
7701 HAVE_PTSNAME=1;
7702 HAVE_PTSNAME_R=1;
c0c3707f
CB
7703 HAVE_QSORT_R=1;
7704 HAVE_RANDOM=1;
7705 HAVE_RANDOM_H=1;
7706 HAVE_RANDOM_R=1;
7707 HAVE_REALLOCARRAY=1;
7708 HAVE_REALPATH=1;
7709 HAVE_RPMATCH=1;
7710 HAVE_SECURE_GETENV=1;
7711 HAVE_SETENV=1;
7712 HAVE_DECL_SETENV=1;
7713 HAVE_SETSTATE=1;
7714 HAVE_DECL_SETSTATE=1;
7715 HAVE_STRTOD=1;
7716 HAVE_STRTOLD=1;
7717 HAVE_STRTOLL=1;
7718 HAVE_STRTOULL=1;
7719 HAVE_STRUCT_RANDOM_DATA=1;
7720 HAVE_SYS_LOADAVG_H=0;
7721 HAVE_UNLOCKPT=1;
7722 HAVE_DECL_UNSETENV=1;
9c9d63b1 7723 REPLACE_ALIGNED_ALLOC=0;
c0c3707f
CB
7724 REPLACE_CALLOC=0;
7725 REPLACE_CANONICALIZE_FILE_NAME=0;
9c9d63b1 7726 REPLACE_FREE=0;
c0c3707f
CB
7727 REPLACE_INITSTATE=0;
7728 REPLACE_MALLOC=0;
7729 REPLACE_MBTOWC=0;
7730 REPLACE_MKSTEMP=0;
9c9d63b1 7731 REPLACE_POSIX_MEMALIGN=0;
c0c3707f
CB
7732 REPLACE_PTSNAME=0;
7733 REPLACE_PTSNAME_R=0;
7734 REPLACE_PUTENV=0;
7735 REPLACE_QSORT_R=0;
7736 REPLACE_RANDOM=0;
7737 REPLACE_RANDOM_R=0;
7738 REPLACE_REALLOC=0;
7739 REPLACE_REALPATH=0;
7740 REPLACE_SETENV=0;
7741 REPLACE_SETSTATE=0;
7742 REPLACE_STRTOD=0;
7743 REPLACE_STRTOLD=0;
7744 REPLACE_UNSETENV=0;
7745 REPLACE_WCTOMB=0;
7a6dbc2f 7746
7a6dbc2f 7747
9c9d63b1
PM
7748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
7749$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
7750if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
7751 $as_echo_n "(cached) " >&6
7752else
7753 rm -f conftest.sym conftest.file
7754 echo >conftest.file
7755 if test "$cross_compiling" = yes; then :
7756 case "$host_os" in
7757 linux-* | linux)
7758 # Guess yes on Linux systems.
7759 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
7760 *-gnu* | gnu*)
7761 # Guess yes on glibc systems.
7762 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
7763 mingw*)
7764 # Guess no on native Windows.
7765 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
7766 *)
7767 # If we don't know, obey --enable-cross-guesses.
7768 gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
7769 esac
7770
7771else
7772 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7773/* end confdefs.h. */
7774$ac_includes_default
7775int
7776main ()
7777{
7778struct stat sbuf;
7779 if (symlink ("conftest.file", "conftest.sym") != 0)
7780 return 1;
7781 /* Linux will dereference the symlink and fail, as required by
7782 POSIX. That is better in the sense that it means we will not
7783 have to compile and use the lstat wrapper. */
7784 return lstat ("conftest.sym/", &sbuf) == 0;
7785
7786 ;
7787 return 0;
7788}
7789_ACEOF
7790if ac_fn_c_try_run "$LINENO"; then :
7791 gl_cv_func_lstat_dereferences_slashed_symlink=yes
7792else
7793 gl_cv_func_lstat_dereferences_slashed_symlink=no
7794fi
7795rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7796 conftest.$ac_objext conftest.beam conftest.$ac_ext
7797fi
7798
7799 rm -f conftest.sym conftest.file
7800
7801fi
7802{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
7803$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
7804 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
7805 *yes)
7806
7807cat >>confdefs.h <<_ACEOF
7808#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
7809_ACEOF
7810
7811 ;;
7812 esac
98399780 7813
98399780 7814
472fa5ee
SM
7815
7816
7817
7818
7819
c0c3707f
CB
7820 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
7821$as_echo_n "checking whether // is distinct from /... " >&6; }
7822if ${gl_cv_double_slash_root+:} false; then :
7823 $as_echo_n "(cached) " >&6
5e8754f9 7824else
c0c3707f
CB
7825 if test x"$cross_compiling" = xyes ; then
7826 # When cross-compiling, there is no way to tell whether // is special
7827 # short of a list of hosts. However, the only known hosts to date
7828 # that have a distinct // are Apollo DomainOS (too old to port to),
7829 # Cygwin, and z/OS. If anyone knows of another system for which // has
7830 # special semantics and is distinct from /, please report it to
7831 # <bug-gnulib@gnu.org>.
7832 case $host in
7833 *-cygwin | i370-ibm-openedition)
7834 gl_cv_double_slash_root=yes ;;
7835 *)
7836 # Be optimistic and assume that / and // are the same when we
7837 # don't know.
7838 gl_cv_double_slash_root='unknown, assuming no' ;;
7839 esac
7840 else
7841 set x `ls -di / // 2>/dev/null`
7842 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
7843 gl_cv_double_slash_root=no
7844 else
7845 gl_cv_double_slash_root=yes
7846 fi
7847 fi
5e8754f9 7848fi
c0c3707f
CB
7849{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
7850$as_echo "$gl_cv_double_slash_root" >&6; }
7851 if test "$gl_cv_double_slash_root" = yes; then
472fa5ee 7852
c0c3707f 7853$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
472fa5ee 7854
c0c3707f 7855 fi
472fa5ee
SM
7856
7857
472fa5ee 7858
c0c3707f
CB
7859
7860
7861 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
7862$as_echo_n "checking whether realpath works... " >&6; }
7863if ${gl_cv_func_realpath_works+:} false; then :
5e8754f9
SDJ
7864 $as_echo_n "(cached) " >&6
7865else
c0c3707f 7866
9c9d63b1 7867 rm -rf conftest.a conftest.d
c0c3707f
CB
7868 touch conftest.a
7869 mkdir conftest.d
7870 if test "$cross_compiling" = yes; then :
7871 case "$host_os" in
7872 # Guess yes on glibc systems.
7873 *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
7874 # Guess yes on musl systems.
7875 *-musl*) gl_cv_func_realpath_works="guessing yes" ;;
7876 # Guess no on native Windows.
7877 mingw*) gl_cv_func_realpath_works="guessing no" ;;
7878 # If we don't know, obey --enable-cross-guesses.
7879 *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
7880 esac
7881
5e8754f9
SDJ
7882else
7883 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7884/* end confdefs.h. */
c0c3707f
CB
7885
7886
7887
7888#include <stdlib.h>
7889#if defined __MACH__ && defined __APPLE__
7890/* Avoid a crash on Mac OS X. */
7891#include <mach/mach.h>
7892#include <mach/mach_error.h>
7893#include <mach/thread_status.h>
7894#include <mach/exception.h>
7895#include <mach/task.h>
7896#include <pthread.h>
7897/* The exception port on which our thread listens. */
7898static mach_port_t our_exception_port;
7899/* The main function of the thread listening for exceptions of type
7900 EXC_BAD_ACCESS. */
7901static void *
7902mach_exception_thread (void *arg)
5e8754f9 7903{
c0c3707f
CB
7904 /* Buffer for a message to be received. */
7905 struct {
7906 mach_msg_header_t head;
7907 mach_msg_body_t msgh_body;
7908 char data[1024];
7909 } msg;
7910 mach_msg_return_t retval;
7911 /* Wait for a message on the exception port. */
7912 retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
7913 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
7914 if (retval != MACH_MSG_SUCCESS)
7915 abort ();
7916 exit (1);
7917}
7918static void
7919nocrash_init (void)
7920{
7921 mach_port_t self = mach_task_self ();
7922 /* Allocate a port on which the thread shall listen for exceptions. */
7923 if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
7924 == KERN_SUCCESS) {
7925 /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
7926 if (mach_port_insert_right (self, our_exception_port, our_exception_port,
7927 MACH_MSG_TYPE_MAKE_SEND)
7928 == KERN_SUCCESS) {
7929 /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
7930 for us. */
7931 exception_mask_t mask = EXC_MASK_BAD_ACCESS;
7932 /* Create the thread listening on the exception port. */
7933 pthread_attr_t attr;
7934 pthread_t thread;
7935 if (pthread_attr_init (&attr) == 0
7936 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
7937 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
7938 pthread_attr_destroy (&attr);
7939 /* Replace the exception port info for these exceptions with our own.
7940 Note that we replace the exception port for the entire task, not only
7941 for a particular thread. This has the effect that when our exception
7942 port gets the message, the thread specific exception port has already
7943 been asked, and we don't need to bother about it.
7944 See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
7945 task_set_exception_ports (self, mask, our_exception_port,
7946 EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
7947 }
7948 }
7949 }
7950}
7951#elif defined _WIN32 && ! defined __CYGWIN__
7952/* Avoid a crash on native Windows. */
7953#define WIN32_LEAN_AND_MEAN
7954#include <windows.h>
7955#include <winerror.h>
7956static LONG WINAPI
7957exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
7958{
7959 switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
7960 {
7961 case EXCEPTION_ACCESS_VIOLATION:
7962 case EXCEPTION_IN_PAGE_ERROR:
7963 case EXCEPTION_STACK_OVERFLOW:
7964 case EXCEPTION_GUARD_PAGE:
7965 case EXCEPTION_PRIV_INSTRUCTION:
7966 case EXCEPTION_ILLEGAL_INSTRUCTION:
7967 case EXCEPTION_DATATYPE_MISALIGNMENT:
7968 case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
7969 case EXCEPTION_NONCONTINUABLE_EXCEPTION:
7970 exit (1);
7971 }
7972 return EXCEPTION_CONTINUE_SEARCH;
7973}
7974static void
7975nocrash_init (void)
7976{
7977 SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
7978}
7979#else
7980/* Avoid a crash on POSIX systems. */
7981#include <signal.h>
7982#include <unistd.h>
7983/* A POSIX signal handler. */
7984static void
7985exception_handler (int sig)
7986{
7987 _exit (1);
7988}
7989static void
7990nocrash_init (void)
7991{
7992#ifdef SIGSEGV
7993 signal (SIGSEGV, exception_handler);
7994#endif
7995#ifdef SIGBUS
7996 signal (SIGBUS, exception_handler);
7997#endif
5e8754f9 7998}
c0c3707f
CB
7999#endif
8000
8001 #include <stdlib.h>
8002 #include <string.h>
472fa5ee 8003
5e8754f9 8004int
c0c3707f 8005main ()
5e8754f9 8006{
c0c3707f
CB
8007
8008 int result = 0;
8009 {
8010 char *name = realpath ("conftest.a", NULL);
8011 if (!(name && *name == '/'))
8012 result |= 1;
8013 free (name);
8014 }
8015 {
8016 char *name = realpath ("conftest.b/../conftest.a", NULL);
8017 if (name != NULL)
8018 result |= 2;
8019 free (name);
8020 }
8021 {
8022 char *name = realpath ("conftest.a/", NULL);
8023 if (name != NULL)
8024 result |= 4;
8025 free (name);
8026 }
8027 {
8028 char *name1 = realpath (".", NULL);
8029 char *name2 = realpath ("conftest.d//./..", NULL);
8030 if (! name1 || ! name2 || strcmp (name1, name2))
8031 result |= 8;
8032 free (name1);
8033 free (name2);
8034 }
8035 return result;
8036
8037 ;
8038 return 0;
5e8754f9 8039}
c0c3707f 8040
5e8754f9
SDJ
8041_ACEOF
8042if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 8043 gl_cv_func_realpath_works=yes
5e8754f9 8044else
c0c3707f 8045 gl_cv_func_realpath_works=no
5e8754f9
SDJ
8046fi
8047rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8048 conftest.$ac_objext conftest.beam conftest.$ac_ext
8049fi
472fa5ee 8050
c0c3707f 8051 rm -rf conftest.a conftest.d
98399780 8052
5e8754f9 8053fi
c0c3707f
CB
8054{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
8055$as_echo "$gl_cv_func_realpath_works" >&6; }
8056 case "$gl_cv_func_realpath_works" in
8057 *yes)
98399780 8058
c0c3707f 8059$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
98399780 8060
c0c3707f
CB
8061 ;;
8062 esac
725e2999
JB
8063
8064
725e2999 8065
725e2999 8066
725e2999
JB
8067
8068
8069
8070
8071
9c9d63b1
PM
8072 case "$host_os" in
8073 mingw*) ;;
8074 *) for ac_func in getcwd
8075do :
8076 ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
8077if test "x$ac_cv_func_getcwd" = xyes; then :
8078 cat >>confdefs.h <<_ACEOF
8079#define HAVE_GETCWD 1
8080_ACEOF
8081
8082fi
8083done
8084 ;;
8085 esac
8086
8087
8088
8089
725e2999
JB
8090
8091
c0c3707f
CB
8092 GNULIB_ACCESS=0;
8093 GNULIB_CHDIR=0;
8094 GNULIB_CHOWN=0;
8095 GNULIB_CLOSE=0;
8096 GNULIB_COPY_FILE_RANGE=0;
8097 GNULIB_DUP=0;
8098 GNULIB_DUP2=0;
8099 GNULIB_DUP3=0;
8100 GNULIB_ENVIRON=0;
8101 GNULIB_EUIDACCESS=0;
9c9d63b1
PM
8102 GNULIB_EXECL=0;
8103 GNULIB_EXECLE=0;
8104 GNULIB_EXECLP=0;
8105 GNULIB_EXECV=0;
8106 GNULIB_EXECVE=0;
8107 GNULIB_EXECVP=0;
8108 GNULIB_EXECVPE=0;
c0c3707f
CB
8109 GNULIB_FACCESSAT=0;
8110 GNULIB_FCHDIR=0;
8111 GNULIB_FCHOWNAT=0;
8112 GNULIB_FDATASYNC=0;
8113 GNULIB_FSYNC=0;
8114 GNULIB_FTRUNCATE=0;
8115 GNULIB_GETCWD=0;
8116 GNULIB_GETDOMAINNAME=0;
8117 GNULIB_GETDTABLESIZE=0;
698be2d8 8118 GNULIB_GETENTROPY=0;
c0c3707f
CB
8119 GNULIB_GETGROUPS=0;
8120 GNULIB_GETHOSTNAME=0;
8121 GNULIB_GETLOGIN=0;
8122 GNULIB_GETLOGIN_R=0;
5df4cba6 8123 GNULIB_GETOPT_POSIX=0;
c0c3707f
CB
8124 GNULIB_GETPAGESIZE=0;
8125 GNULIB_GETPASS=0;
8126 GNULIB_GETUSERSHELL=0;
8127 GNULIB_GROUP_MEMBER=0;
8128 GNULIB_ISATTY=0;
8129 GNULIB_LCHOWN=0;
8130 GNULIB_LINK=0;
8131 GNULIB_LINKAT=0;
8132 GNULIB_LSEEK=0;
8133 GNULIB_PIPE=0;
8134 GNULIB_PIPE2=0;
8135 GNULIB_PREAD=0;
8136 GNULIB_PWRITE=0;
8137 GNULIB_READ=0;
8138 GNULIB_READLINK=0;
8139 GNULIB_READLINKAT=0;
8140 GNULIB_RMDIR=0;
8141 GNULIB_SETHOSTNAME=0;
8142 GNULIB_SLEEP=0;
8143 GNULIB_SYMLINK=0;
8144 GNULIB_SYMLINKAT=0;
8145 GNULIB_TRUNCATE=0;
8146 GNULIB_TTYNAME_R=0;
8147 GNULIB_UNISTD_H_NONBLOCKING=0;
8148 GNULIB_UNISTD_H_SIGPIPE=0;
8149 GNULIB_UNLINK=0;
8150 GNULIB_UNLINKAT=0;
8151 GNULIB_USLEEP=0;
8152 GNULIB_WRITE=0;
9c9d63b1
PM
8153 GNULIB_MDA_ACCESS=1;
8154 GNULIB_MDA_CHDIR=1;
8155 GNULIB_MDA_CLOSE=1;
8156 GNULIB_MDA_DUP=1;
8157 GNULIB_MDA_DUP2=1;
8158 GNULIB_MDA_EXECL=1;
8159 GNULIB_MDA_EXECLE=1;
8160 GNULIB_MDA_EXECLP=1;
8161 GNULIB_MDA_EXECV=1;
8162 GNULIB_MDA_EXECVE=1;
8163 GNULIB_MDA_EXECVP=1;
8164 GNULIB_MDA_EXECVPE=1;
8165 GNULIB_MDA_GETCWD=1;
8166 GNULIB_MDA_GETPID=1;
8167 GNULIB_MDA_ISATTY=1;
8168 GNULIB_MDA_LSEEK=1;
8169 GNULIB_MDA_READ=1;
8170 GNULIB_MDA_RMDIR=1;
8171 GNULIB_MDA_SWAB=1;
8172 GNULIB_MDA_UNLINK=1;
8173 GNULIB_MDA_WRITE=1;
c0c3707f
CB
8174 HAVE_CHOWN=1;
8175 HAVE_COPY_FILE_RANGE=1;
c0c3707f
CB
8176 HAVE_DUP3=1;
8177 HAVE_EUIDACCESS=1;
9c9d63b1 8178 HAVE_EXECVPE=1;
c0c3707f
CB
8179 HAVE_FACCESSAT=1;
8180 HAVE_FCHDIR=1;
8181 HAVE_FCHOWNAT=1;
8182 HAVE_FDATASYNC=1;
8183 HAVE_FSYNC=1;
8184 HAVE_FTRUNCATE=1;
8185 HAVE_GETDTABLESIZE=1;
698be2d8 8186 HAVE_GETENTROPY=1;
c0c3707f
CB
8187 HAVE_GETGROUPS=1;
8188 HAVE_GETHOSTNAME=1;
8189 HAVE_GETLOGIN=1;
8190 HAVE_GETPAGESIZE=1;
8191 HAVE_GETPASS=1;
8192 HAVE_GROUP_MEMBER=1;
8193 HAVE_LCHOWN=1;
8194 HAVE_LINK=1;
8195 HAVE_LINKAT=1;
8196 HAVE_PIPE=1;
8197 HAVE_PIPE2=1;
8198 HAVE_PREAD=1;
8199 HAVE_PWRITE=1;
8200 HAVE_READLINK=1;
8201 HAVE_READLINKAT=1;
8202 HAVE_SETHOSTNAME=1;
8203 HAVE_SLEEP=1;
8204 HAVE_SYMLINK=1;
8205 HAVE_SYMLINKAT=1;
8206 HAVE_UNLINKAT=1;
8207 HAVE_USLEEP=1;
8208 HAVE_DECL_ENVIRON=1;
9c9d63b1 8209 HAVE_DECL_EXECVPE=1;
c0c3707f
CB
8210 HAVE_DECL_FCHDIR=1;
8211 HAVE_DECL_FDATASYNC=1;
8212 HAVE_DECL_GETDOMAINNAME=1;
8213 HAVE_DECL_GETLOGIN=1;
8214 HAVE_DECL_GETLOGIN_R=1;
8215 HAVE_DECL_GETPAGESIZE=1;
8216 HAVE_DECL_GETUSERSHELL=1;
8217 HAVE_DECL_SETHOSTNAME=1;
8218 HAVE_DECL_TRUNCATE=1;
8219 HAVE_DECL_TTYNAME_R=1;
8220 HAVE_OS_H=0;
8221 HAVE_SYS_PARAM_H=0;
8222 REPLACE_ACCESS=0;
8223 REPLACE_CHOWN=0;
8224 REPLACE_CLOSE=0;
8225 REPLACE_DUP=0;
8226 REPLACE_DUP2=0;
9c9d63b1
PM
8227 REPLACE_EXECL=0;
8228 REPLACE_EXECLE=0;
8229 REPLACE_EXECLP=0;
8230 REPLACE_EXECV=0;
8231 REPLACE_EXECVE=0;
8232 REPLACE_EXECVP=0;
8233 REPLACE_EXECVPE=0;
c0c3707f
CB
8234 REPLACE_FACCESSAT=0;
8235 REPLACE_FCHOWNAT=0;
8236 REPLACE_FTRUNCATE=0;
8237 REPLACE_GETCWD=0;
8238 REPLACE_GETDOMAINNAME=0;
8239 REPLACE_GETDTABLESIZE=0;
8240 REPLACE_GETLOGIN_R=0;
8241 REPLACE_GETGROUPS=0;
8242 REPLACE_GETPAGESIZE=0;
8243 REPLACE_GETPASS=0;
8244 REPLACE_ISATTY=0;
8245 REPLACE_LCHOWN=0;
8246 REPLACE_LINK=0;
8247 REPLACE_LINKAT=0;
8248 REPLACE_LSEEK=0;
8249 REPLACE_PREAD=0;
8250 REPLACE_PWRITE=0;
8251 REPLACE_READ=0;
8252 REPLACE_READLINK=0;
8253 REPLACE_READLINKAT=0;
8254 REPLACE_RMDIR=0;
8255 REPLACE_SLEEP=0;
8256 REPLACE_SYMLINK=0;
8257 REPLACE_SYMLINKAT=0;
8258 REPLACE_TRUNCATE=0;
8259 REPLACE_TTYNAME_R=0;
8260 REPLACE_UNLINK=0;
8261 REPLACE_UNLINKAT=0;
8262 REPLACE_USLEEP=0;
8263 REPLACE_WRITE=0;
698be2d8 8264 UNISTD_H_HAVE_SYS_RANDOM_H=0;
c0c3707f
CB
8265 UNISTD_H_HAVE_WINSOCK2_H=0;
8266 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
725e2999 8267
725e2999 8268
725e2999
JB
8269
8270
8271
725e2999 8272
725e2999 8273
725e2999
JB
8274
8275
c0c3707f
CB
8276
8277
8278 if test $ac_cv_func__set_invalid_parameter_handler = yes; then
8279 HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
8280
8281$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
8282
725e2999 8283 else
c0c3707f 8284 HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
725e2999
JB
8285 fi
8286
8287
8288
8289
8290
c0c3707f
CB
8291 GNULIB_OPENDIR=0;
8292 GNULIB_READDIR=0;
8293 GNULIB_REWINDDIR=0;
8294 GNULIB_CLOSEDIR=0;
8295 GNULIB_DIRFD=0;
8296 GNULIB_FDOPENDIR=0;
8297 GNULIB_SCANDIR=0;
8298 GNULIB_ALPHASORT=0;
8299 HAVE_OPENDIR=1;
8300 HAVE_READDIR=1;
8301 HAVE_REWINDDIR=1;
8302 HAVE_CLOSEDIR=1;
8303 HAVE_DECL_DIRFD=1;
8304 HAVE_DECL_FDOPENDIR=1;
8305 HAVE_FDOPENDIR=1;
8306 HAVE_SCANDIR=1;
8307 HAVE_ALPHASORT=1;
8308 REPLACE_OPENDIR=0;
8309 REPLACE_CLOSEDIR=0;
8310 REPLACE_DIRFD=0;
8311 REPLACE_FDOPENDIR=0;
725e2999
JB
8312
8313
698be2d8
CB
8314 GNULIB_ISBLANK=0;
8315 HAVE_ISBLANK=1;
8316
8317
725e2999 8318
9c9d63b1
PM
8319gl_mda_defines='
8320#if defined _WIN32 && !defined __CYGWIN__
8321#define access _access
8322#define chdir _chdir
8323#define chmod _chmod
8324#define close _close
8325#define creat _creat
8326#define dup _dup
8327#define dup2 _dup2
8328#define ecvt _ecvt
8329#define execl _execl
8330#define execle _execle
8331#define execlp _execlp
8332#define execv _execv
8333#define execve _execve
8334#define execvp _execvp
8335#define execvpe _execvpe
8336#define fcloseall _fcloseall
8337#define fcvt _fcvt
8338#define fdopen _fdopen
8339#define fileno _fileno
8340#define gcvt _gcvt
8341#define getcwd _getcwd
8342#define getpid _getpid
8343#define getw _getw
8344#define isatty _isatty
8345#define j0 _j0
8346#define j1 _j1
8347#define jn _jn
8348#define lfind _lfind
8349#define lsearch _lsearch
8350#define lseek _lseek
8351#define memccpy _memccpy
8352#define mkdir _mkdir
8353#define mktemp _mktemp
8354#define open _open
8355#define putenv _putenv
8356#define putw _putw
8357#define read _read
8358#define rmdir _rmdir
8359#define strdup _strdup
8360#define swab _swab
8361#define tempnam _tempnam
8362#define tzset _tzset
8363#define umask _umask
8364#define unlink _unlink
8365#define utime _utime
8366#define wcsdup _wcsdup
8367#define write _write
8368#define y0 _y0
8369#define y1 _y1
8370#define yn _yn
8371#endif
8372'
8373
725e2999 8374
725e2999
JB
8375
8376
8377
8378
725e2999
JB
8379
8380
c0c3707f
CB
8381 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
8382$as_echo_n "checking if environ is properly declared... " >&6; }
8383if ${gt_cv_var_environ_declaration+:} false; then :
725e2999
JB
8384 $as_echo_n "(cached) " >&6
8385else
c0c3707f
CB
8386 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8387/* end confdefs.h. */
8388#if HAVE_UNISTD_H
8389 #include <unistd.h>
8390 #endif
8391 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
8392 #include <stdlib.h>
725e2999 8393
c0c3707f
CB
8394 extern struct { int foo; } environ;
8395int
8396main ()
8397{
8398environ.foo = 1;
8399 ;
8400 return 0;
8401}
8402_ACEOF
8403if ac_fn_c_try_compile "$LINENO"; then :
8404 gt_cv_var_environ_declaration=no
8405else
8406 gt_cv_var_environ_declaration=yes
725e2999 8407fi
c0c3707f
CB
8408rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8409fi
8410{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
8411$as_echo "$gt_cv_var_environ_declaration" >&6; }
8412 if test $gt_cv_var_environ_declaration = yes; then
8413
8414$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
725e2999 8415
725e2999 8416 fi
725e2999
JB
8417
8418
c0c3707f
CB
8419 if test $gt_cv_var_environ_declaration != yes; then
8420 HAVE_DECL_ENVIRON=0
8421 fi
6ec2e0f5
SDJ
8422
8423
8424
c0c3707f
CB
8425 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
8426$as_echo_n "checking for complete errno.h... " >&6; }
8427if ${gl_cv_header_errno_h_complete+:} false; then :
8428 $as_echo_n "(cached) " >&6
8429else
6ec2e0f5 8430
c0c3707f
CB
8431 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8432/* end confdefs.h. */
472fa5ee 8433
c0c3707f
CB
8434#include <errno.h>
8435#if !defined ETXTBSY
8436booboo
8437#endif
8438#if !defined ENOMSG
8439booboo
8440#endif
8441#if !defined EIDRM
8442booboo
8443#endif
8444#if !defined ENOLINK
8445booboo
8446#endif
8447#if !defined EPROTO
8448booboo
8449#endif
8450#if !defined EMULTIHOP
8451booboo
8452#endif
8453#if !defined EBADMSG
8454booboo
8455#endif
8456#if !defined EOVERFLOW
8457booboo
8458#endif
8459#if !defined ENOTSUP
8460booboo
8461#endif
8462#if !defined ENETRESET
8463booboo
8464#endif
8465#if !defined ECONNABORTED
8466booboo
8467#endif
8468#if !defined ESTALE
8469booboo
8470#endif
8471#if !defined EDQUOT
8472booboo
8473#endif
8474#if !defined ECANCELED
8475booboo
8476#endif
8477#if !defined EOWNERDEAD
8478booboo
8479#endif
8480#if !defined ENOTRECOVERABLE
8481booboo
8482#endif
8483#if !defined EILSEQ
8484booboo
8485#endif
472fa5ee 8486
c0c3707f
CB
8487_ACEOF
8488if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8489 $EGREP "booboo" >/dev/null 2>&1; then :
8490 gl_cv_header_errno_h_complete=no
8491else
8492 gl_cv_header_errno_h_complete=yes
5e8754f9 8493fi
c0c3707f 8494rm -f conftest*
472fa5ee
SM
8495
8496
c0c3707f
CB
8497fi
8498{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
8499$as_echo "$gl_cv_header_errno_h_complete" >&6; }
8500 if test $gl_cv_header_errno_h_complete = yes; then
8501 ERRNO_H=''
8502 else
472fa5ee
SM
8503
8504
8505
8506
8507
472fa5ee
SM
8508
8509
8510
c0c3707f
CB
8511 if test $gl_cv_have_include_next = yes; then
8512 gl_cv_next_errno_h='<'errno.h'>'
8513 else
8514 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
8515$as_echo_n "checking absolute name of <errno.h>... " >&6; }
8516if ${gl_cv_next_errno_h+:} false; then :
5e8754f9
SDJ
8517 $as_echo_n "(cached) " >&6
8518else
6ec2e0f5 8519
6ec2e0f5 8520
6ec2e0f5 8521
c0c3707f
CB
8522 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8523/* end confdefs.h. */
8524#include <errno.h>
8525_ACEOF
8526 case "$host_os" in
8527 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8528 *) gl_absname_cpp="$ac_cpp" ;;
8529 esac
6ec2e0f5 8530
c0c3707f
CB
8531 case "$host_os" in
8532 mingw*)
8533 gl_dirsep_regex='[/\\]'
8534 ;;
8535 *)
8536 gl_dirsep_regex='\/'
8537 ;;
8538 esac
8539 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
8540 gl_header_literal_regex=`echo 'errno.h' \
8541 | sed -e "$gl_make_literal_regex_sed"`
8542 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8543 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8544 s|^/[^/]|//&|
8545 p
8546 q
8547 }'
6ec2e0f5 8548
c0c3707f
CB
8549 gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
8550 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 8551
c0c3707f
CB
8552 gl_header=$gl_cv_absolute_errno_h
8553 gl_cv_next_errno_h='"'$gl_header'"'
6ec2e0f5
SDJ
8554
8555
c0c3707f
CB
8556fi
8557{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
8558$as_echo "$gl_cv_next_errno_h" >&6; }
8559 fi
8560 NEXT_ERRNO_H=$gl_cv_next_errno_h
6ec2e0f5 8561
c0c3707f
CB
8562 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8563 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8564 gl_next_as_first_directive='<'errno.h'>'
8565 else
8566 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8567 gl_next_as_first_directive=$gl_cv_next_errno_h
8568 fi
8569 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
6ec2e0f5 8570
472fa5ee
SM
8571
8572
8573
c0c3707f
CB
8574 ERRNO_H='errno.h'
8575 fi
472fa5ee 8576
c0c3707f
CB
8577 if test -n "$ERRNO_H"; then
8578 GL_GENERATE_ERRNO_H_TRUE=
8579 GL_GENERATE_ERRNO_H_FALSE='#'
5e8754f9 8580else
c0c3707f
CB
8581 GL_GENERATE_ERRNO_H_TRUE='#'
8582 GL_GENERATE_ERRNO_H_FALSE=
8583fi
472fa5ee
SM
8584
8585
c0c3707f
CB
8586 if test -n "$ERRNO_H"; then
8587 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
8588$as_echo_n "checking for EMULTIHOP value... " >&6; }
8589if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
8590 $as_echo_n "(cached) " >&6
5e8754f9 8591else
e26b6bb0 8592
c0c3707f
CB
8593 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8594/* end confdefs.h. */
e26b6bb0 8595
c0c3707f
CB
8596#include <errno.h>
8597#ifdef EMULTIHOP
8598yes
88b48903 8599#endif
88b48903 8600
c0c3707f
CB
8601_ACEOF
8602if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8603 $EGREP "yes" >/dev/null 2>&1; then :
8604 gl_cv_header_errno_h_EMULTIHOP=yes
8605else
8606 gl_cv_header_errno_h_EMULTIHOP=no
8607fi
8608rm -f conftest*
88b48903 8609
c0c3707f
CB
8610 if test $gl_cv_header_errno_h_EMULTIHOP = no; then
8611 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8612/* end confdefs.h. */
88b48903 8613
c0c3707f
CB
8614#define _XOPEN_SOURCE_EXTENDED 1
8615#include <errno.h>
8616#ifdef EMULTIHOP
8617yes
8618#endif
88b48903
WN
8619
8620_ACEOF
c0c3707f
CB
8621if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8622 $EGREP "yes" >/dev/null 2>&1; then :
8623 gl_cv_header_errno_h_EMULTIHOP=hidden
88b48903 8624fi
c0c3707f 8625rm -f conftest*
88b48903 8626
c0c3707f
CB
8627 if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
8628 if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
8629#define _XOPEN_SOURCE_EXTENDED 1
8630#include <errno.h>
8631/* The following two lines are a workaround against an autoconf-2.52 bug. */
8632#include <stdio.h>
8633#include <stdlib.h>
8634"; then :
88b48903
WN
8635
8636fi
88b48903 8637
c0c3707f
CB
8638 fi
8639 fi
88b48903 8640
c0c3707f
CB
8641fi
8642{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
8643$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
8644 case $gl_cv_header_errno_h_EMULTIHOP in
8645 yes | no)
8646 EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
8647 ;;
8648 *)
8649 EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
8650 ;;
8651 esac
88b48903 8652
e26b6bb0 8653
c0c3707f 8654 fi
e26b6bb0 8655
3d99e817 8656
c0c3707f
CB
8657 if test -n "$ERRNO_H"; then
8658 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
8659$as_echo_n "checking for ENOLINK value... " >&6; }
8660if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
8661 $as_echo_n "(cached) " >&6
8662else
472fa5ee 8663
c0c3707f
CB
8664 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8665/* end confdefs.h. */
472fa5ee 8666
c0c3707f
CB
8667#include <errno.h>
8668#ifdef ENOLINK
8669yes
8670#endif
472fa5ee 8671
c0c3707f
CB
8672_ACEOF
8673if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8674 $EGREP "yes" >/dev/null 2>&1; then :
8675 gl_cv_header_errno_h_ENOLINK=yes
8676else
8677 gl_cv_header_errno_h_ENOLINK=no
8678fi
8679rm -f conftest*
472fa5ee 8680
c0c3707f
CB
8681 if test $gl_cv_header_errno_h_ENOLINK = no; then
8682 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8683/* end confdefs.h. */
3d99e817 8684
c0c3707f
CB
8685#define _XOPEN_SOURCE_EXTENDED 1
8686#include <errno.h>
8687#ifdef ENOLINK
8688yes
8689#endif
3d99e817 8690
c0c3707f
CB
8691_ACEOF
8692if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8693 $EGREP "yes" >/dev/null 2>&1; then :
8694 gl_cv_header_errno_h_ENOLINK=hidden
8695fi
8696rm -f conftest*
3d99e817 8697
c0c3707f
CB
8698 if test $gl_cv_header_errno_h_ENOLINK = hidden; then
8699 if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
8700#define _XOPEN_SOURCE_EXTENDED 1
8701#include <errno.h>
8702/* The following two lines are a workaround against an autoconf-2.52 bug. */
8703#include <stdio.h>
8704#include <stdlib.h>
8705"; then :
3d99e817 8706
c0c3707f 8707fi
3d99e817 8708
c0c3707f
CB
8709 fi
8710 fi
3d99e817 8711
c0c3707f
CB
8712fi
8713{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
8714$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
8715 case $gl_cv_header_errno_h_ENOLINK in
8716 yes | no)
8717 ENOLINK_HIDDEN=0; ENOLINK_VALUE=
8718 ;;
8719 *)
8720 ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
8721 ;;
8722 esac
18848e28 8723
18848e28 8724
c0c3707f 8725 fi
18848e28 8726
18848e28 8727
c0c3707f
CB
8728 if test -n "$ERRNO_H"; then
8729 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
8730$as_echo_n "checking for EOVERFLOW value... " >&6; }
8731if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
8732 $as_echo_n "(cached) " >&6
8733else
18848e28 8734
c0c3707f
CB
8735 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8736/* end confdefs.h. */
18848e28 8737
c0c3707f
CB
8738#include <errno.h>
8739#ifdef EOVERFLOW
8740yes
8741#endif
18848e28 8742
c0c3707f
CB
8743_ACEOF
8744if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8745 $EGREP "yes" >/dev/null 2>&1; then :
8746 gl_cv_header_errno_h_EOVERFLOW=yes
8747else
8748 gl_cv_header_errno_h_EOVERFLOW=no
8749fi
8750rm -f conftest*
18848e28 8751
c0c3707f
CB
8752 if test $gl_cv_header_errno_h_EOVERFLOW = no; then
8753 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8754/* end confdefs.h. */
18848e28 8755
c0c3707f
CB
8756#define _XOPEN_SOURCE_EXTENDED 1
8757#include <errno.h>
8758#ifdef EOVERFLOW
8759yes
8760#endif
18848e28 8761
c0c3707f
CB
8762_ACEOF
8763if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8764 $EGREP "yes" >/dev/null 2>&1; then :
8765 gl_cv_header_errno_h_EOVERFLOW=hidden
8766fi
8767rm -f conftest*
18848e28 8768
c0c3707f
CB
8769 if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
8770 if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
8771#define _XOPEN_SOURCE_EXTENDED 1
8772#include <errno.h>
8773/* The following two lines are a workaround against an autoconf-2.52 bug. */
8774#include <stdio.h>
8775#include <stdlib.h>
8776"; then :
18848e28 8777
c0c3707f 8778fi
18848e28 8779
c0c3707f
CB
8780 fi
8781 fi
18848e28 8782
c0c3707f
CB
8783fi
8784{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
8785$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
8786 case $gl_cv_header_errno_h_EOVERFLOW in
8787 yes | no)
8788 EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
8789 ;;
8790 *)
8791 EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
8792 ;;
8793 esac
4a626d0a
PA
8794
8795
c0c3707f 8796 fi
18848e28 8797
4a626d0a 8798
c0c3707f
CB
8799ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
8800if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
8801 ac_have_decl=1
8802else
8803 ac_have_decl=0
8804fi
4a626d0a 8805
c0c3707f
CB
8806cat >>confdefs.h <<_ACEOF
8807#define HAVE_DECL_STRERROR_R $ac_have_decl
8808_ACEOF
4a626d0a 8809
c0c3707f
CB
8810for ac_func in strerror_r
8811do :
8812 ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
8813if test "x$ac_cv_func_strerror_r" = xyes; then :
8814 cat >>confdefs.h <<_ACEOF
8815#define HAVE_STRERROR_R 1
8816_ACEOF
4a626d0a 8817
c0c3707f
CB
8818fi
8819done
18848e28 8820
c0c3707f
CB
8821{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
8822$as_echo_n "checking whether strerror_r returns char *... " >&6; }
8823if ${ac_cv_func_strerror_r_char_p+:} false; then :
8824 $as_echo_n "(cached) " >&6
8825else
18848e28 8826
c0c3707f
CB
8827 ac_cv_func_strerror_r_char_p=no
8828 if test $ac_cv_have_decl_strerror_r = yes; then
8829 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8830/* end confdefs.h. */
8831$ac_includes_default
8832int
8833main ()
8834{
18848e28 8835
c0c3707f
CB
8836 char buf[100];
8837 char x = *strerror_r (0, buf, sizeof buf);
8838 char *p = strerror_r (0, buf, sizeof buf);
8839 return !p || x;
18848e28 8840
c0c3707f
CB
8841 ;
8842 return 0;
8843}
8844_ACEOF
8845if ac_fn_c_try_compile "$LINENO"; then :
8846 ac_cv_func_strerror_r_char_p=yes
8847fi
8848rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8849 else
8850 # strerror_r is not declared. Choose between
8851 # systems that have relatively inaccessible declarations for the
8852 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
8853 # former has a strerror_r that returns char*, while the latter
8854 # has a strerror_r that returns `int'.
8855 # This test should segfault on the DEC system.
8856 if test "$cross_compiling" = yes; then :
8857 :
8858else
8859 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8860/* end confdefs.h. */
8861$ac_includes_default
8862 extern char *strerror_r ();
8863int
8864main ()
8865{
8866char buf[100];
8867 char x = *strerror_r (0, buf, sizeof buf);
8868 return ! isalpha (x);
8869 ;
8870 return 0;
8871}
8872_ACEOF
8873if ac_fn_c_try_run "$LINENO"; then :
8874 ac_cv_func_strerror_r_char_p=yes
8875fi
8876rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8877 conftest.$ac_objext conftest.beam conftest.$ac_ext
8878fi
18848e28 8879
c0c3707f 8880 fi
18848e28 8881
c0c3707f
CB
8882fi
8883{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
8884$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
8885if test $ac_cv_func_strerror_r_char_p = yes; then
18848e28 8886
c0c3707f 8887$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
18848e28 8888
c0c3707f 8889fi
18848e28 8890
18848e28 8891
18848e28 8892
18848e28 8893
c0c3707f
CB
8894ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
8895if test "x$ac_cv_have_decl_fchdir" = xyes; then :
8896 ac_have_decl=1
8897else
8898 ac_have_decl=0
8899fi
18848e28 8900
c0c3707f
CB
8901cat >>confdefs.h <<_ACEOF
8902#define HAVE_DECL_FCHDIR $ac_have_decl
8903_ACEOF
18848e28 8904
18848e28 8905
c0c3707f
CB
8906 GNULIB_CREAT=0;
8907 GNULIB_FCNTL=0;
8908 GNULIB_NONBLOCKING=0;
8909 GNULIB_OPEN=0;
8910 GNULIB_OPENAT=0;
9c9d63b1
PM
8911 GNULIB_MDA_CREAT=1;
8912 GNULIB_MDA_OPEN=1;
c0c3707f
CB
8913 HAVE_FCNTL=1;
8914 HAVE_OPENAT=1;
8915 REPLACE_CREAT=0;
8916 REPLACE_FCNTL=0;
8917 REPLACE_OPEN=0;
8918 REPLACE_OPENAT=0;
18848e28 8919
18848e28 8920
18848e28 8921
18848e28
GF
8922
8923
18848e28
GF
8924
8925
18848e28 8926
18848e28 8927
18848e28 8928
c0c3707f
CB
8929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
8930$as_echo_n "checking for working fcntl.h... " >&6; }
8931if ${gl_cv_header_working_fcntl_h+:} false; then :
8932 $as_echo_n "(cached) " >&6
8933else
8934 if test "$cross_compiling" = yes; then :
8935 case "$host_os" in
8936 # Guess 'no' on native Windows.
8937 mingw*) gl_cv_header_working_fcntl_h='no' ;;
8938 *) gl_cv_header_working_fcntl_h=cross-compiling ;;
8939 esac
18848e28 8940
c0c3707f
CB
8941else
8942 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8943/* end confdefs.h. */
8944#include <sys/types.h>
8945 #include <sys/stat.h>
8946 #if HAVE_UNISTD_H
8947 # include <unistd.h>
8948 #else /* on Windows with MSVC */
8949 # include <io.h>
8950 # include <stdlib.h>
8951 # defined sleep(n) _sleep ((n) * 1000)
8952 #endif
8953 #include <fcntl.h>
9c9d63b1
PM
8954
8955
8956$gl_mda_defines
8957
c0c3707f
CB
8958 #ifndef O_NOATIME
8959 #define O_NOATIME 0
8960 #endif
8961 #ifndef O_NOFOLLOW
8962 #define O_NOFOLLOW 0
8963 #endif
8964 static int const constants[] =
8965 {
8966 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
8967 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
8968 };
18848e28 8969
c0c3707f
CB
8970int
8971main ()
8972{
18848e28 8973
c0c3707f
CB
8974 int result = !constants;
8975 #if HAVE_SYMLINK
8976 {
8977 static char const sym[] = "conftest.sym";
8978 if (symlink ("/dev/null", sym) != 0)
8979 result |= 2;
8980 else
8981 {
8982 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
8983 if (fd >= 0)
8984 {
8985 close (fd);
8986 result |= 4;
8987 }
8988 }
8989 if (unlink (sym) != 0 || symlink (".", sym) != 0)
8990 result |= 2;
8991 else
8992 {
8993 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
8994 if (fd >= 0)
8995 {
8996 close (fd);
8997 result |= 4;
8998 }
8999 }
9000 unlink (sym);
9001 }
9002 #endif
9003 {
9004 static char const file[] = "confdefs.h";
9005 int fd = open (file, O_RDONLY | O_NOATIME);
9006 if (fd < 0)
9007 result |= 8;
9008 else
9009 {
9010 struct stat st0;
9011 if (fstat (fd, &st0) != 0)
9012 result |= 16;
9013 else
9014 {
9015 char c;
9016 sleep (1);
9017 if (read (fd, &c, 1) != 1)
9018 result |= 24;
9019 else
9020 {
9021 if (close (fd) != 0)
9022 result |= 32;
9023 else
9024 {
9025 struct stat st1;
9026 if (stat (file, &st1) != 0)
9027 result |= 40;
9028 else
9029 if (st0.st_atime != st1.st_atime)
9030 result |= 64;
9031 }
9032 }
9033 }
9034 }
9035 }
9036 return result;
9037 ;
9038 return 0;
9039}
9040_ACEOF
9041if ac_fn_c_try_run "$LINENO"; then :
9042 gl_cv_header_working_fcntl_h=yes
9043else
9044 case $? in #(
9045 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
9046 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
9047 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
9048 *) gl_cv_header_working_fcntl_h='no';;
9049 esac
9050fi
9051rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9052 conftest.$ac_objext conftest.beam conftest.$ac_ext
9053fi
18848e28 9054
18848e28 9055
c0c3707f
CB
9056fi
9057{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
9058$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
18848e28 9059
c0c3707f
CB
9060 case $gl_cv_header_working_fcntl_h in #(
9061 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
9062 *) ac_val=1;;
9063 esac
18848e28 9064
c0c3707f
CB
9065cat >>confdefs.h <<_ACEOF
9066#define HAVE_WORKING_O_NOATIME $ac_val
9067_ACEOF
18848e28
GF
9068
9069
c0c3707f
CB
9070 case $gl_cv_header_working_fcntl_h in #(
9071 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
9072 *) ac_val=1;;
9073 esac
18848e28 9074
c0c3707f
CB
9075cat >>confdefs.h <<_ACEOF
9076#define HAVE_WORKING_O_NOFOLLOW $ac_val
9077_ACEOF
18848e28 9078
63ce7108 9079
9c9d63b1
PM
9080
9081 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default
9082"
c0c3707f 9083if test "x$ac_cv_type_pid_t" = xyes; then :
63ce7108 9084
c0c3707f 9085else
9c9d63b1
PM
9086 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9087/* end confdefs.h. */
9088
9089 #if defined _WIN64 && !defined __CYGWIN__
9090 LLP64
9091 #endif
9092
9093int
9094main ()
9095{
9096
9097 ;
9098 return 0;
9099}
9100
9101_ACEOF
9102if ac_fn_c_try_compile "$LINENO"; then :
9103 gl_pid_type='int'
9104else
9105 gl_pid_type='__int64'
9106fi
9107rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63ce7108 9108
c0c3707f 9109cat >>confdefs.h <<_ACEOF
9c9d63b1 9110#define pid_t $gl_pid_type
c0c3707f 9111_ACEOF
63ce7108 9112
9c9d63b1 9113
c0c3707f 9114fi
63ce7108 9115
9c9d63b1 9116
c0c3707f
CB
9117ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
9118if test "x$ac_cv_type_mode_t" = xyes; then :
63ce7108 9119
c0c3707f 9120else
63ce7108 9121
c0c3707f
CB
9122cat >>confdefs.h <<_ACEOF
9123#define mode_t int
9124_ACEOF
63ce7108 9125
c0c3707f 9126fi
63ce7108 9127
472fa5ee
SM
9128
9129
9130
9131
9132
c0c3707f
CB
9133 GNULIB_FNMATCH=0;
9134 HAVE_FNMATCH=1;
9135 REPLACE_FNMATCH=0;
472fa5ee
SM
9136
9137
9138
9139
9140
9141
472fa5ee
SM
9142
9143
472fa5ee
SM
9144
9145
9146
9147
9148
9149
9150
9151
7a6dbc2f 9152 if test $gl_cv_have_include_next = yes; then
c0c3707f 9153 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
7a6dbc2f 9154 else
c0c3707f
CB
9155 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5
9156$as_echo_n "checking absolute name of <fnmatch.h>... " >&6; }
9157if ${gl_cv_next_fnmatch_h+:} false; then :
7a6dbc2f
SDJ
9158 $as_echo_n "(cached) " >&6
9159else
472fa5ee 9160
c0c3707f
CB
9161 if test $ac_cv_header_fnmatch_h = yes; then
9162
9163
472fa5ee
SM
9164
9165
7a6dbc2f
SDJ
9166 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9167/* end confdefs.h. */
c0c3707f 9168#include <fnmatch.h>
7a6dbc2f
SDJ
9169_ACEOF
9170 case "$host_os" in
9171 aix*) gl_absname_cpp="$ac_cpp -C" ;;
9172 *) gl_absname_cpp="$ac_cpp" ;;
9173 esac
472fa5ee 9174
7a6dbc2f
SDJ
9175 case "$host_os" in
9176 mingw*)
9177 gl_dirsep_regex='[/\\]'
9178 ;;
9179 *)
9180 gl_dirsep_regex='\/'
9181 ;;
9182 esac
9183 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 9184 gl_header_literal_regex=`echo 'fnmatch.h' \
7a6dbc2f
SDJ
9185 | sed -e "$gl_make_literal_regex_sed"`
9186 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
9187 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
9188 s|^/[^/]|//&|
9189 p
9190 q
9191 }'
9192
c0c3707f 9193 gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
7a6dbc2f
SDJ
9194 sed -n "$gl_absolute_header_sed"`
9195
c0c3707f
CB
9196 gl_header=$gl_cv_absolute_fnmatch_h
9197 gl_cv_next_fnmatch_h='"'$gl_header'"'
9198 else
9199 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
9200 fi
7a6dbc2f
SDJ
9201
9202
9203fi
c0c3707f
CB
9204{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5
9205$as_echo "$gl_cv_next_fnmatch_h" >&6; }
7a6dbc2f 9206 fi
c0c3707f 9207 NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h
7a6dbc2f
SDJ
9208
9209 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
9210 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 9211 gl_next_as_first_directive='<'fnmatch.h'>'
7a6dbc2f
SDJ
9212 else
9213 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 9214 gl_next_as_first_directive=$gl_cv_next_fnmatch_h
7a6dbc2f 9215 fi
c0c3707f 9216 NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive
7a6dbc2f
SDJ
9217
9218
9219
9220
7a6dbc2f 9221
7a6dbc2f
SDJ
9222
9223
c0c3707f
CB
9224 if test $ac_cv_header_fnmatch_h = yes; then
9225 HAVE_FNMATCH_H=1
9226 else
9227 HAVE_FNMATCH_H=0
9228 fi
7a6dbc2f
SDJ
9229
9230
c0c3707f
CB
9231 FNMATCH_H=''
9232 if false; then
9233 FNMATCH_H=fnmatch.h
9234 else
9235 if test $ac_cv_header_fnmatch_h != yes; then
9236 FNMATCH_H=fnmatch.h
9237 fi
9238 fi
7a6dbc2f 9239
c0c3707f
CB
9240
9241 if test -n "$FNMATCH_H"; then
9242 GL_GENERATE_FNMATCH_H_TRUE=
9243 GL_GENERATE_FNMATCH_H_FALSE='#'
7a6dbc2f 9244else
c0c3707f
CB
9245 GL_GENERATE_FNMATCH_H_TRUE='#'
9246 GL_GENERATE_FNMATCH_H_FALSE=
7a6dbc2f 9247fi
7a6dbc2f 9248
7a6dbc2f 9249
7a6dbc2f 9250
7a6dbc2f
SDJ
9251
9252
9253
9254
9255
9256
9257
c0c3707f
CB
9258 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
9259$as_echo_n "checking for mbstate_t... " >&6; }
9260if ${ac_cv_type_mbstate_t+:} false; then :
5e8754f9
SDJ
9261 $as_echo_n "(cached) " >&6
9262else
c0c3707f 9263 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 9264/* end confdefs.h. */
c0c3707f 9265$ac_includes_default
9c9d63b1 9266 #include <wchar.h>
c0c3707f
CB
9267int
9268main ()
9269{
9270mbstate_t x; return sizeof x;
9271 ;
9272 return 0;
9273}
5e8754f9 9274_ACEOF
c0c3707f
CB
9275if ac_fn_c_try_compile "$LINENO"; then :
9276 ac_cv_type_mbstate_t=yes
5e8754f9 9277else
c0c3707f 9278 ac_cv_type_mbstate_t=no
5e8754f9 9279fi
c0c3707f
CB
9280rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9281fi
9282{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
9283$as_echo "$ac_cv_type_mbstate_t" >&6; }
9284 if test $ac_cv_type_mbstate_t = yes; then
5e8754f9 9285
c0c3707f 9286$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
5e8754f9 9287
c0c3707f 9288 else
5e8754f9 9289
c0c3707f 9290$as_echo "#define mbstate_t int" >>confdefs.h
5e8754f9 9291
c0c3707f 9292 fi
5e8754f9
SDJ
9293
9294
9295
9296
5e8754f9
SDJ
9297 GNULIB_ACOSF=0;
9298 GNULIB_ACOSL=0;
9299 GNULIB_ASINF=0;
9300 GNULIB_ASINL=0;
9301 GNULIB_ATANF=0;
9302 GNULIB_ATANL=0;
9303 GNULIB_ATAN2F=0;
9304 GNULIB_CBRT=0;
9305 GNULIB_CBRTF=0;
9306 GNULIB_CBRTL=0;
9307 GNULIB_CEIL=0;
9308 GNULIB_CEILF=0;
9309 GNULIB_CEILL=0;
9310 GNULIB_COPYSIGN=0;
9311 GNULIB_COPYSIGNF=0;
9312 GNULIB_COPYSIGNL=0;
9313 GNULIB_COSF=0;
9314 GNULIB_COSL=0;
9315 GNULIB_COSHF=0;
9316 GNULIB_EXPF=0;
9317 GNULIB_EXPL=0;
9318 GNULIB_EXP2=0;
9319 GNULIB_EXP2F=0;
9320 GNULIB_EXP2L=0;
9321 GNULIB_EXPM1=0;
9322 GNULIB_EXPM1F=0;
9323 GNULIB_EXPM1L=0;
9324 GNULIB_FABSF=0;
9325 GNULIB_FABSL=0;
9326 GNULIB_FLOOR=0;
9327 GNULIB_FLOORF=0;
9328 GNULIB_FLOORL=0;
9329 GNULIB_FMA=0;
9330 GNULIB_FMAF=0;
9331 GNULIB_FMAL=0;
9332 GNULIB_FMOD=0;
9333 GNULIB_FMODF=0;
9334 GNULIB_FMODL=0;
9335 GNULIB_FREXPF=0;
9336 GNULIB_FREXP=0;
9337 GNULIB_FREXPL=0;
9338 GNULIB_HYPOT=0;
9339 GNULIB_HYPOTF=0;
9340 GNULIB_HYPOTL=0;
9341 GNULIB_ILOGB=0;
9342 GNULIB_ILOGBF=0;
9343 GNULIB_ILOGBL=0;
9344 GNULIB_ISFINITE=0;
9345 GNULIB_ISINF=0;
9346 GNULIB_ISNAN=0;
9347 GNULIB_ISNANF=0;
9348 GNULIB_ISNAND=0;
9349 GNULIB_ISNANL=0;
9350 GNULIB_LDEXPF=0;
9351 GNULIB_LDEXPL=0;
9352 GNULIB_LOG=0;
9353 GNULIB_LOGF=0;
9354 GNULIB_LOGL=0;
9355 GNULIB_LOG10=0;
9356 GNULIB_LOG10F=0;
9357 GNULIB_LOG10L=0;
9358 GNULIB_LOG1P=0;
9359 GNULIB_LOG1PF=0;
9360 GNULIB_LOG1PL=0;
9361 GNULIB_LOG2=0;
9362 GNULIB_LOG2F=0;
9363 GNULIB_LOG2L=0;
9364 GNULIB_LOGB=0;
9365 GNULIB_LOGBF=0;
9366 GNULIB_LOGBL=0;
9367 GNULIB_MODF=0;
9368 GNULIB_MODFF=0;
9369 GNULIB_MODFL=0;
9370 GNULIB_POWF=0;
9371 GNULIB_REMAINDER=0;
9372 GNULIB_REMAINDERF=0;
9373 GNULIB_REMAINDERL=0;
9374 GNULIB_RINT=0;
9375 GNULIB_RINTF=0;
9376 GNULIB_RINTL=0;
9377 GNULIB_ROUND=0;
9378 GNULIB_ROUNDF=0;
9379 GNULIB_ROUNDL=0;
9380 GNULIB_SIGNBIT=0;
9381 GNULIB_SINF=0;
9382 GNULIB_SINL=0;
9383 GNULIB_SINHF=0;
9384 GNULIB_SQRTF=0;
9385 GNULIB_SQRTL=0;
9386 GNULIB_TANF=0;
9387 GNULIB_TANL=0;
9388 GNULIB_TANHF=0;
9389 GNULIB_TRUNC=0;
9390 GNULIB_TRUNCF=0;
9391 GNULIB_TRUNCL=0;
9c9d63b1
PM
9392 GNULIB_MDA_J0=1;
9393 GNULIB_MDA_J1=1;
9394 GNULIB_MDA_JN=1;
9395 GNULIB_MDA_Y0=1;
9396 GNULIB_MDA_Y1=1;
9397 GNULIB_MDA_YN=1;
5e8754f9
SDJ
9398 HAVE_ACOSF=1;
9399 HAVE_ACOSL=1;
9400 HAVE_ASINF=1;
9401 HAVE_ASINL=1;
9402 HAVE_ATANF=1;
9403 HAVE_ATANL=1;
9404 HAVE_ATAN2F=1;
9405 HAVE_CBRT=1;
9406 HAVE_CBRTF=1;
9407 HAVE_CBRTL=1;
9408 HAVE_COPYSIGN=1;
9409 HAVE_COPYSIGNL=1;
9410 HAVE_COSF=1;
9411 HAVE_COSL=1;
9412 HAVE_COSHF=1;
9413 HAVE_EXPF=1;
9414 HAVE_EXPL=1;
9415 HAVE_EXPM1=1;
9416 HAVE_EXPM1F=1;
9417 HAVE_FABSF=1;
9418 HAVE_FABSL=1;
9419 HAVE_FMA=1;
9420 HAVE_FMAF=1;
9421 HAVE_FMAL=1;
9422 HAVE_FMODF=1;
9423 HAVE_FMODL=1;
9424 HAVE_FREXPF=1;
9425 HAVE_HYPOTF=1;
9426 HAVE_HYPOTL=1;
9427 HAVE_ILOGB=1;
9428 HAVE_ILOGBF=1;
9429 HAVE_ILOGBL=1;
9430 HAVE_ISNANF=1;
9431 HAVE_ISNAND=1;
9432 HAVE_ISNANL=1;
9433 HAVE_LDEXPF=1;
9434 HAVE_LOGF=1;
9435 HAVE_LOGL=1;
9436 HAVE_LOG10F=1;
9437 HAVE_LOG10L=1;
9438 HAVE_LOG1P=1;
9439 HAVE_LOG1PF=1;
9440 HAVE_LOG1PL=1;
9441 HAVE_LOGBF=1;
9442 HAVE_LOGBL=1;
9443 HAVE_MODFF=1;
9444 HAVE_MODFL=1;
9445 HAVE_POWF=1;
9446 HAVE_REMAINDER=1;
9447 HAVE_REMAINDERF=1;
9448 HAVE_RINT=1;
9449 HAVE_RINTL=1;
9450 HAVE_SINF=1;
9451 HAVE_SINL=1;
9452 HAVE_SINHF=1;
9453 HAVE_SQRTF=1;
9454 HAVE_SQRTL=1;
9455 HAVE_TANF=1;
9456 HAVE_TANL=1;
9457 HAVE_TANHF=1;
9458 HAVE_DECL_ACOSL=1;
9459 HAVE_DECL_ASINL=1;
9460 HAVE_DECL_ATANL=1;
9461 HAVE_DECL_CBRTF=1;
9462 HAVE_DECL_CBRTL=1;
9463 HAVE_DECL_CEILF=1;
9464 HAVE_DECL_CEILL=1;
9465 HAVE_DECL_COPYSIGNF=1;
9466 HAVE_DECL_COSL=1;
9467 HAVE_DECL_EXPL=1;
9468 HAVE_DECL_EXP2=1;
9469 HAVE_DECL_EXP2F=1;
9470 HAVE_DECL_EXP2L=1;
9471 HAVE_DECL_EXPM1L=1;
9472 HAVE_DECL_FLOORF=1;
9473 HAVE_DECL_FLOORL=1;
9474 HAVE_DECL_FREXPL=1;
9475 HAVE_DECL_LDEXPL=1;
9476 HAVE_DECL_LOGL=1;
9477 HAVE_DECL_LOG10L=1;
9478 HAVE_DECL_LOG2=1;
9479 HAVE_DECL_LOG2F=1;
9480 HAVE_DECL_LOG2L=1;
9481 HAVE_DECL_LOGB=1;
9482 HAVE_DECL_REMAINDER=1;
9483 HAVE_DECL_REMAINDERL=1;
9484 HAVE_DECL_RINTF=1;
9485 HAVE_DECL_ROUND=1;
9486 HAVE_DECL_ROUNDF=1;
9487 HAVE_DECL_ROUNDL=1;
9488 HAVE_DECL_SINL=1;
9489 HAVE_DECL_SQRTL=1;
9490 HAVE_DECL_TANL=1;
9491 HAVE_DECL_TRUNC=1;
9492 HAVE_DECL_TRUNCF=1;
9493 HAVE_DECL_TRUNCL=1;
c0c3707f
CB
9494 REPLACE_ACOSF=0;
9495 REPLACE_ASINF=0;
9496 REPLACE_ATANF=0;
9497 REPLACE_ATAN2F=0;
5e8754f9
SDJ
9498 REPLACE_CBRTF=0;
9499 REPLACE_CBRTL=0;
9500 REPLACE_CEIL=0;
9501 REPLACE_CEILF=0;
9502 REPLACE_CEILL=0;
c0c3707f
CB
9503 REPLACE_COSF=0;
9504 REPLACE_COSHF=0;
9505 REPLACE_EXPF=0;
9506 REPLACE_EXPL=0;
5e8754f9
SDJ
9507 REPLACE_EXPM1=0;
9508 REPLACE_EXPM1F=0;
c0c3707f 9509 REPLACE_EXPM1L=0;
5e8754f9
SDJ
9510 REPLACE_EXP2=0;
9511 REPLACE_EXP2L=0;
9512 REPLACE_FABSL=0;
9513 REPLACE_FLOOR=0;
9514 REPLACE_FLOORF=0;
9515 REPLACE_FLOORL=0;
9516 REPLACE_FMA=0;
9517 REPLACE_FMAF=0;
9518 REPLACE_FMAL=0;
9519 REPLACE_FMOD=0;
9520 REPLACE_FMODF=0;
9521 REPLACE_FMODL=0;
9522 REPLACE_FREXPF=0;
9523 REPLACE_FREXP=0;
9524 REPLACE_FREXPL=0;
9525 REPLACE_HUGE_VAL=0;
9526 REPLACE_HYPOT=0;
9527 REPLACE_HYPOTF=0;
9528 REPLACE_HYPOTL=0;
9529 REPLACE_ILOGB=0;
9530 REPLACE_ILOGBF=0;
c0c3707f 9531 REPLACE_ILOGBL=0;
5e8754f9
SDJ
9532 REPLACE_ISFINITE=0;
9533 REPLACE_ISINF=0;
9534 REPLACE_ISNAN=0;
9535 REPLACE_LDEXPL=0;
9536 REPLACE_LOG=0;
9537 REPLACE_LOGF=0;
9538 REPLACE_LOGL=0;
9539 REPLACE_LOG10=0;
9540 REPLACE_LOG10F=0;
9541 REPLACE_LOG10L=0;
9542 REPLACE_LOG1P=0;
9543 REPLACE_LOG1PF=0;
9544 REPLACE_LOG1PL=0;
9545 REPLACE_LOG2=0;
9546 REPLACE_LOG2F=0;
9547 REPLACE_LOG2L=0;
9548 REPLACE_LOGB=0;
9549 REPLACE_LOGBF=0;
9550 REPLACE_LOGBL=0;
9551 REPLACE_MODF=0;
9552 REPLACE_MODFF=0;
9553 REPLACE_MODFL=0;
9554 REPLACE_NAN=0;
9555 REPLACE_REMAINDER=0;
9556 REPLACE_REMAINDERF=0;
9557 REPLACE_REMAINDERL=0;
c0c3707f 9558 REPLACE_RINTL=0;
5e8754f9 9559 REPLACE_ROUND=0;
c0c3707f
CB
9560 REPLACE_ROUNDF=0;
9561 REPLACE_ROUNDL=0;
9562 REPLACE_SIGNBIT=0;
9c9d63b1 9563 REPLACE_SIGNBIT_USING_BUILTINS=0;
c0c3707f
CB
9564 REPLACE_SINF=0;
9565 REPLACE_SINHF=0;
9566 REPLACE_SQRTF=0;
9567 REPLACE_SQRTL=0;
9568 REPLACE_TANF=0;
9569 REPLACE_TANHF=0;
9570 REPLACE_TRUNC=0;
9571 REPLACE_TRUNCF=0;
9572 REPLACE_TRUNCL=0;
49e4877c 9573
49e4877c 9574
c0c3707f
CB
9575 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
9576$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
9577if ${gl_cv_func_frexp_no_libm+:} false; then :
9578 $as_echo_n "(cached) " >&6
9579else
8690e634 9580
c0c3707f
CB
9581 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9582/* end confdefs.h. */
9583#include <math.h>
9584 double x;
9585int
9586main ()
9587{
9588int e; return frexp (x, &e) > 0;
9589 ;
9590 return 0;
9591}
9592_ACEOF
9593if ac_fn_c_try_link "$LINENO"; then :
9594 gl_cv_func_frexp_no_libm=yes
9595else
9596 gl_cv_func_frexp_no_libm=no
9597fi
9598rm -f core conftest.err conftest.$ac_objext \
9599 conftest$ac_exeext conftest.$ac_ext
8690e634 9600
c0c3707f
CB
9601fi
9602{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
9603$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
8690e634 9604
c0c3707f
CB
9605ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
9606if test "x$ac_cv_have_decl_alarm" = xyes; then :
9607 ac_have_decl=1
9608else
9609 ac_have_decl=0
9610fi
472fa5ee 9611
c0c3707f
CB
9612cat >>confdefs.h <<_ACEOF
9613#define HAVE_DECL_ALARM $ac_have_decl
9614_ACEOF
472fa5ee
SM
9615
9616
9617
9618
c0c3707f
CB
9619 FREXP_LIBM=
9620 if test $gl_cv_func_frexp_no_libm = no; then
9621 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5
9622$as_echo_n "checking whether frexp() can be used with libm... " >&6; }
9623if ${gl_cv_func_frexp_in_libm+:} false; then :
9624 $as_echo_n "(cached) " >&6
9625else
8690e634 9626
c0c3707f
CB
9627 save_LIBS="$LIBS"
9628 LIBS="$LIBS -lm"
9629 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9630/* end confdefs.h. */
9631#include <math.h>
9632 double x;
9633int
9634main ()
9635{
9636int e; return frexp (x, &e) > 0;
9637 ;
9638 return 0;
9639}
9640_ACEOF
9641if ac_fn_c_try_link "$LINENO"; then :
9642 gl_cv_func_frexp_in_libm=yes
9643else
9644 gl_cv_func_frexp_in_libm=no
9645fi
9646rm -f core conftest.err conftest.$ac_objext \
9647 conftest$ac_exeext conftest.$ac_ext
9648 LIBS="$save_LIBS"
8690e634 9649
c0c3707f
CB
9650fi
9651{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5
9652$as_echo "$gl_cv_func_frexp_in_libm" >&6; }
9653 if test $gl_cv_func_frexp_in_libm = yes; then
9654 FREXP_LIBM=-lm
9655 fi
6ec2e0f5 9656 fi
c0c3707f
CB
9657 if test $gl_cv_func_frexp_no_libm = yes \
9658 || test $gl_cv_func_frexp_in_libm = yes; then
9659 save_LIBS="$LIBS"
9660 LIBS="$LIBS $FREXP_LIBM"
8690e634
JK
9661
9662
8690e634 9663
c0c3707f
CB
9664 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
9665$as_echo_n "checking whether frexp works... " >&6; }
9666if ${gl_cv_func_frexp_works+:} false; then :
9667 $as_echo_n "(cached) " >&6
9668else
8690e634 9669
c0c3707f
CB
9670 if test "$cross_compiling" = yes; then :
9671 case "$host_os" in
9672 netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
9673 mingw*) # Guess yes with MSVC, no with mingw.
9674 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9675/* end confdefs.h. */
8690e634 9676
c0c3707f
CB
9677#ifdef _MSC_VER
9678 Good
9679#endif
8690e634 9680
c0c3707f
CB
9681_ACEOF
9682if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9683 $EGREP "Good" >/dev/null 2>&1; then :
9684 gl_cv_func_frexp_works="guessing yes"
9685else
9686 gl_cv_func_frexp_works="guessing no"
9687fi
9688rm -f conftest*
8690e634 9689
c0c3707f
CB
9690 ;;
9691 *) gl_cv_func_frexp_works="guessing yes" ;;
9692 esac
8690e634 9693
c0c3707f
CB
9694else
9695 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9696/* end confdefs.h. */
8690e634 9697
c0c3707f
CB
9698#include <float.h>
9699#include <math.h>
9700#include <string.h>
9701#if HAVE_DECL_ALARM
9702# include <signal.h>
9703# include <unistd.h>
9704#endif
9705/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
9706 ICC 10.0 has a bug when optimizing the expression -zero.
9707 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
9708 to PowerPC on Mac OS X 10.5. */
9709#if defined __hpux || defined __sgi || defined __ICC
9710static double
9711compute_minus_zero (void)
9712{
9713 return -DBL_MIN * DBL_MIN;
9714}
9715# define minus_zero compute_minus_zero ()
9716#else
9717double minus_zero = -0.0;
9718#endif
9719int main()
9720{
9721 int result = 0;
9722 int i;
9723 volatile double x;
9724 double zero = 0.0;
9725#if HAVE_DECL_ALARM
9726 /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
9727 number. Let the test fail in this case. */
9728 signal (SIGALRM, SIG_DFL);
9729 alarm (5);
9730#endif
9731 /* Test on denormalized numbers. */
9732 for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
9733 ;
9734 if (x > 0.0)
9735 {
9736 int exp;
9737 double y = frexp (x, &exp);
9738 /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
9739 On NetBSD: y = 0.75. Correct: y = 0.5. */
9740 if (y != 0.5)
9741 result |= 1;
9742 }
9743 /* Test on infinite numbers. */
9744 x = 1.0 / zero;
9745 {
9746 int exp;
9747 double y = frexp (x, &exp);
9748 if (y != x)
9749 result |= 2;
9750 }
9751 /* Test on negative zero. */
9752 x = minus_zero;
9753 {
9754 int exp;
9755 double y = frexp (x, &exp);
9756 if (memcmp (&y, &x, sizeof x))
9757 result |= 4;
9758 }
9759 return result;
9760}
9761_ACEOF
9762if ac_fn_c_try_run "$LINENO"; then :
9763 gl_cv_func_frexp_works=yes
9764else
9765 gl_cv_func_frexp_works=no
9766fi
9767rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9768 conftest.$ac_objext conftest.beam conftest.$ac_ext
9769fi
472fa5ee
SM
9770
9771
c0c3707f
CB
9772fi
9773{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
9774$as_echo "$gl_cv_func_frexp_works" >&6; }
472fa5ee 9775
c0c3707f
CB
9776 LIBS="$save_LIBS"
9777 case "$gl_cv_func_frexp_works" in
9778 *yes) gl_func_frexp=yes ;;
9779 *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
9780 esac
9781 else
9782 gl_func_frexp=no
9783 fi
9784 if test $gl_func_frexp = yes; then
472fa5ee 9785
c0c3707f 9786$as_echo "#define HAVE_FREXP 1" >>confdefs.h
472fa5ee 9787
c0c3707f 9788 fi
8690e634 9789
6ec2e0f5
SDJ
9790
9791
c0c3707f
CB
9792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
9793$as_echo_n "checking whether long double and double are the same... " >&6; }
9794if ${gl_cv_long_double_equals_double+:} false; then :
8690e634
JK
9795 $as_echo_n "(cached) " >&6
9796else
c0c3707f
CB
9797 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9798/* end confdefs.h. */
9799#include <float.h>
9800int
9801main ()
9802{
9803typedef int check[sizeof (long double) == sizeof (double)
9804 && LDBL_MANT_DIG == DBL_MANT_DIG
9805 && LDBL_MAX_EXP == DBL_MAX_EXP
9806 && LDBL_MIN_EXP == DBL_MIN_EXP
9807 ? 1 : -1];
8690e634 9808
c0c3707f
CB
9809 ;
9810 return 0;
9811}
9812_ACEOF
9813if ac_fn_c_try_compile "$LINENO"; then :
9814 gl_cv_long_double_equals_double=yes
9815else
9816 gl_cv_long_double_equals_double=no
9817fi
9818rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9819
c0c3707f
CB
9820fi
9821{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
9822$as_echo "$gl_cv_long_double_equals_double" >&6; }
9823 if test $gl_cv_long_double_equals_double = yes; then
8690e634 9824
c0c3707f 9825$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
6ec2e0f5 9826
c0c3707f
CB
9827 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
9828 else
9829 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
9830 fi
8690e634 9831
6ec2e0f5 9832
6ec2e0f5 9833
6ec2e0f5
SDJ
9834
9835
6ec2e0f5 9836
8690e634
JK
9837
9838
c0c3707f
CB
9839 ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
9840"
9841if test "x$ac_cv_have_decl_frexpl" = xyes; then :
8690e634 9842
c0c3707f
CB
9843else
9844 HAVE_DECL_FREXPL=0
9845fi
8690e634 9846
6ec2e0f5 9847
c0c3707f
CB
9848 FREXPL_LIBM=
9849 if test $HAVE_DECL_FREXPL = 1; then
6ec2e0f5 9850
c0c3707f
CB
9851 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
9852$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
9853if ${gl_cv_func_frexpl_no_libm+:} false; then :
8690e634
JK
9854 $as_echo_n "(cached) " >&6
9855else
c0c3707f
CB
9856
9857 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9858/* end confdefs.h. */
c0c3707f
CB
9859#include <math.h>
9860 long double x;
9861int
9862main ()
9863{
9864int e; return frexpl (x, &e) > 0;
9865 ;
9866 return 0;
9867}
9868_ACEOF
9869if ac_fn_c_try_link "$LINENO"; then :
9870 gl_cv_func_frexpl_no_libm=yes
9871else
9872 gl_cv_func_frexpl_no_libm=no
9873fi
9874rm -f core conftest.err conftest.$ac_objext \
9875 conftest$ac_exeext conftest.$ac_ext
8690e634 9876
c0c3707f
CB
9877fi
9878{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
9879$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
6ec2e0f5 9880
c0c3707f
CB
9881 if test $gl_cv_func_frexpl_no_libm = no; then
9882 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5
9883$as_echo_n "checking whether frexpl() can be used with libm... " >&6; }
9884if ${gl_cv_func_frexpl_in_libm+:} false; then :
9885 $as_echo_n "(cached) " >&6
9886else
6ec2e0f5 9887
c0c3707f
CB
9888 save_LIBS="$LIBS"
9889 LIBS="$LIBS -lm"
9890 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9891/* end confdefs.h. */
9892#include <math.h>
9893 long double x;
9894int
9895main ()
9896{
9897int e; return frexpl (x, &e) > 0;
9898 ;
9899 return 0;
9900}
9901_ACEOF
9902if ac_fn_c_try_link "$LINENO"; then :
9903 gl_cv_func_frexpl_in_libm=yes
9904else
9905 gl_cv_func_frexpl_in_libm=no
9906fi
9907rm -f core conftest.err conftest.$ac_objext \
9908 conftest$ac_exeext conftest.$ac_ext
9909 LIBS="$save_LIBS"
6ec2e0f5 9910
c0c3707f
CB
9911fi
9912{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5
9913$as_echo "$gl_cv_func_frexpl_in_libm" >&6; }
9914 if test $gl_cv_func_frexpl_in_libm = yes; then
9915 FREXPL_LIBM=-lm
9916 fi
9917 fi
9918 if test $gl_cv_func_frexpl_no_libm = yes \
9919 || test $gl_cv_func_frexpl_in_libm = yes; then
9920 save_LIBS="$LIBS"
9921 LIBS="$LIBS $FREXPL_LIBM"
8690e634 9922
8690e634 9923
c0c3707f
CB
9924 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
9925$as_echo_n "checking whether frexpl works... " >&6; }
9926if ${gl_cv_func_frexpl_works+:} false; then :
9927 $as_echo_n "(cached) " >&6
9928else
8690e634 9929
c0c3707f 9930 if test "$cross_compiling" = yes; then :
8690e634 9931
c0c3707f
CB
9932 case "$host_os" in
9933 aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
9934 gl_cv_func_frexpl_works="guessing no";;
9935 *) gl_cv_func_frexpl_works="guessing yes";;
9936 esac
8690e634 9937
c0c3707f
CB
9938else
9939 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9940/* end confdefs.h. */
8690e634 9941
c0c3707f
CB
9942#include <float.h>
9943#include <math.h>
9944/* Override the values of <float.h>, like done in float.in.h. */
9945#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
9946# undef LDBL_MIN_EXP
9947# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9948#endif
c0c3707f
CB
9949#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
9950# undef LDBL_MIN_EXP
9951# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9952#endif
c0c3707f
CB
9953#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
9954# undef LDBL_MIN_EXP
9955# define LDBL_MIN_EXP DBL_MIN_EXP
6ec2e0f5 9956#endif
c0c3707f
CB
9957#if defined __sgi && (LDBL_MANT_DIG >= 106)
9958# if defined __GNUC__
9959# undef LDBL_MIN_EXP
9960# define LDBL_MIN_EXP DBL_MIN_EXP
9961# endif
6ec2e0f5 9962#endif
c0c3707f
CB
9963extern
9964#ifdef __cplusplus
9965"C"
9966#endif
9967long double frexpl (long double, int *);
9c9d63b1 9968long double zero = 0.0L;
c0c3707f 9969int main()
8690e634 9970{
c0c3707f
CB
9971 int result = 0;
9972 volatile long double x;
9973 /* Test on finite numbers that fails on AIX 5.1. */
9974 x = 16.0L;
9975 {
9976 int exp = -9999;
9977 frexpl (x, &exp);
9978 if (exp != 5)
9979 result |= 1;
9980 }
9981 /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
9982 function returns an invalid (incorrectly normalized) value: it returns
9983 y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
9984 but the correct result is
9985 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
9986 x = 1.01L;
9987 {
9988 int exp = -9999;
9989 long double y = frexpl (x, &exp);
9990 if (!(exp == 1 && y == 0.505L))
9991 result |= 2;
9992 }
9993 /* Test on large finite numbers. This fails on BeOS at i = 16322, while
9994 LDBL_MAX_EXP = 16384.
9995 In the loop end test, we test x against Infinity, rather than comparing
9996 i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
9997 {
9998 int i;
9999 for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
10000 {
10001 int exp = -9999;
10002 frexpl (x, &exp);
10003 if (exp != i)
10004 {
10005 result |= 4;
10006 break;
10007 }
10008 }
10009 }
10010 /* Test on denormalized numbers. */
10011 {
10012 int i;
10013 for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
10014 ;
10015 if (x > 0.0L)
10016 {
10017 int exp;
10018 long double y = frexpl (x, &exp);
10019 /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
10020 exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
10021 if (exp != LDBL_MIN_EXP - 1)
10022 result |= 8;
10023 }
10024 }
10025 /* Test on infinite numbers. */
9c9d63b1
PM
10026 /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */
10027 x = 1.0L / zero;
c0c3707f
CB
10028 {
10029 int exp;
10030 long double y = frexpl (x, &exp);
10031 if (y != x)
10032 result |= 16;
10033 }
10034 return result;
8690e634
JK
10035}
10036_ACEOF
c0c3707f
CB
10037if ac_fn_c_try_run "$LINENO"; then :
10038 gl_cv_func_frexpl_works=yes
6ec2e0f5 10039else
c0c3707f
CB
10040 gl_cv_func_frexpl_works=no
10041fi
10042rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10043 conftest.$ac_objext conftest.beam conftest.$ac_ext
10044fi
8690e634 10045
8690e634 10046
c0c3707f
CB
10047fi
10048{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
10049$as_echo "$gl_cv_func_frexpl_works" >&6; }
8690e634 10050
c0c3707f
CB
10051 LIBS="$save_LIBS"
10052 case "$gl_cv_func_frexpl_works" in
10053 *yes) gl_func_frexpl=yes ;;
10054 *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
10055 esac
10056 else
10057 gl_func_frexpl=no
10058 fi
10059 if test $gl_func_frexpl = yes; then
8690e634 10060
c0c3707f 10061$as_echo "#define HAVE_FREXPL 1" >>confdefs.h
8690e634 10062
c0c3707f
CB
10063 fi
10064 fi
10065 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
10066 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
8690e634 10067
c0c3707f
CB
10068 FREXPL_LIBM="$FREXP_LIBM"
10069 else
10070 FREXPL_LIBM=
10071 fi
10072 fi
6ec2e0f5 10073
6ec2e0f5 10074
6ec2e0f5 10075
c0c3707f
CB
10076 GNULIB_FCHMODAT=0;
10077 GNULIB_FSTAT=0;
10078 GNULIB_FSTATAT=0;
10079 GNULIB_FUTIMENS=0;
9c9d63b1 10080 GNULIB_GETUMASK=0;
c0c3707f
CB
10081 GNULIB_LCHMOD=0;
10082 GNULIB_LSTAT=0;
9c9d63b1 10083 GNULIB_MKDIR=0;
c0c3707f
CB
10084 GNULIB_MKDIRAT=0;
10085 GNULIB_MKFIFO=0;
10086 GNULIB_MKFIFOAT=0;
10087 GNULIB_MKNOD=0;
10088 GNULIB_MKNODAT=0;
10089 GNULIB_STAT=0;
10090 GNULIB_UTIMENSAT=0;
10091 GNULIB_OVERRIDES_STRUCT_STAT=0;
9c9d63b1
PM
10092 GNULIB_MDA_CHMOD=1;
10093 GNULIB_MDA_MKDIR=1;
10094 GNULIB_MDA_UMASK=1;
c0c3707f
CB
10095 HAVE_FCHMODAT=1;
10096 HAVE_FSTATAT=1;
10097 HAVE_FUTIMENS=1;
9c9d63b1 10098 HAVE_GETUMASK=1;
c0c3707f
CB
10099 HAVE_LCHMOD=1;
10100 HAVE_LSTAT=1;
10101 HAVE_MKDIRAT=1;
10102 HAVE_MKFIFO=1;
10103 HAVE_MKFIFOAT=1;
10104 HAVE_MKNOD=1;
10105 HAVE_MKNODAT=1;
10106 HAVE_UTIMENSAT=1;
5df4cba6 10107 REPLACE_FCHMODAT=0;
c0c3707f
CB
10108 REPLACE_FSTAT=0;
10109 REPLACE_FSTATAT=0;
10110 REPLACE_FUTIMENS=0;
10111 REPLACE_LSTAT=0;
10112 REPLACE_MKDIR=0;
10113 REPLACE_MKFIFO=0;
9c9d63b1 10114 REPLACE_MKFIFOAT=0;
c0c3707f 10115 REPLACE_MKNOD=0;
9c9d63b1 10116 REPLACE_MKNODAT=0;
c0c3707f
CB
10117 REPLACE_STAT=0;
10118 REPLACE_UTIMENSAT=0;
10119
10120{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
10121$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
10122if ${ac_cv_header_stat_broken+:} false; then :
10123 $as_echo_n "(cached) " >&6
10124else
10125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10126/* end confdefs.h. */
10127#include <sys/types.h>
10128#include <sys/stat.h>
10129
10130#if defined S_ISBLK && defined S_IFDIR
10131extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
10132#endif
10133
10134#if defined S_ISBLK && defined S_IFCHR
10135extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
10136#endif
10137
10138#if defined S_ISLNK && defined S_IFREG
10139extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
10140#endif
8690e634 10141
c0c3707f
CB
10142#if defined S_ISSOCK && defined S_IFREG
10143extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
10144#endif
8690e634 10145
c0c3707f
CB
10146_ACEOF
10147if ac_fn_c_try_compile "$LINENO"; then :
10148 ac_cv_header_stat_broken=no
10149else
10150 ac_cv_header_stat_broken=yes
6ec2e0f5
SDJ
10151fi
10152rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 10153fi
c0c3707f
CB
10154{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
10155$as_echo "$ac_cv_header_stat_broken" >&6; }
10156if test $ac_cv_header_stat_broken = yes; then
8690e634 10157
c0c3707f 10158$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
49e4877c 10159
c0c3707f 10160fi
49e4877c
PA
10161
10162
10163
10164
8690e634 10165
c0c3707f
CB
10166 case "$host_os" in
10167 mingw*)
10168 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
10169$as_echo_n "checking for 64-bit off_t... " >&6; }
10170if ${gl_cv_type_off_t_64+:} false; then :
10171 $as_echo_n "(cached) " >&6
10172else
10173 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10174/* end confdefs.h. */
10175#include <sys/types.h>
10176 int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
8690e634 10177
6ec2e0f5
SDJ
10178int
10179main ()
10180{
8690e634 10181
6ec2e0f5
SDJ
10182 ;
10183 return 0;
10184}
10185_ACEOF
10186if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
10187 gl_cv_type_off_t_64=yes
10188else
10189 gl_cv_type_off_t_64=no
6ec2e0f5
SDJ
10190fi
10191rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 10192
c0c3707f
CB
10193fi
10194{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
10195$as_echo "$gl_cv_type_off_t_64" >&6; }
10196 if test $gl_cv_type_off_t_64 = no; then
10197 WINDOWS_64_BIT_OFF_T=1
10198 else
10199 WINDOWS_64_BIT_OFF_T=0
10200 fi
10201 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
10202$as_echo_n "checking for 64-bit st_size... " >&6; }
10203if ${gl_cv_member_st_size_64+:} false; then :
6ec2e0f5
SDJ
10204 $as_echo_n "(cached) " >&6
10205else
c0c3707f 10206 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10207/* end confdefs.h. */
c0c3707f
CB
10208#include <sys/types.h>
10209 struct stat buf;
10210 int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
8690e634 10211
6ec2e0f5
SDJ
10212int
10213main ()
10214{
8690e634 10215
6ec2e0f5
SDJ
10216 ;
10217 return 0;
10218}
10219_ACEOF
10220if ac_fn_c_try_compile "$LINENO"; then :
698be2d8
CB
10221 gl_cv_member_st_size_64=yes
10222else
10223 gl_cv_member_st_size_64=no
10224fi
10225rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10226
10227fi
10228{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
10229$as_echo "$gl_cv_member_st_size_64" >&6; }
10230 if test $gl_cv_member_st_size_64 = no; then
10231 WINDOWS_64_BIT_ST_SIZE=1
10232 else
10233 WINDOWS_64_BIT_ST_SIZE=0
10234 fi
10235 ;;
10236 *)
10237 WINDOWS_64_BIT_OFF_T=0
10238 WINDOWS_64_BIT_ST_SIZE=0
10239 ;;
10240 esac
10241
10242{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
10243$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
10244if ${ac_cv_c_restrict+:} false; then :
10245 $as_echo_n "(cached) " >&6
10246else
10247 ac_cv_c_restrict=no
9c9d63b1
PM
10248 # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
10249 # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
10250 # Put 'restrict' last, because C++ lacks it.
10251 for ac_kw in __restrict__ __restrict _Restrict restrict; do
698be2d8
CB
10252 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10253/* end confdefs.h. */
10254typedef int *int_ptr;
10255 int foo (int_ptr $ac_kw ip) { return ip[0]; }
10256 int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
10257 int bar (int ip[$ac_kw]) { return ip[0]; }
10258
10259int
10260main ()
10261{
10262int s[1];
10263 int *$ac_kw t = s;
10264 t[0] = 0;
10265 return foo (t) + bar (t);
10266
10267 ;
10268 return 0;
10269}
10270_ACEOF
10271if ac_fn_c_try_compile "$LINENO"; then :
10272 ac_cv_c_restrict=$ac_kw
6ec2e0f5
SDJ
10273fi
10274rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
698be2d8
CB
10275 test "$ac_cv_c_restrict" != no && break
10276 done
8690e634 10277
6ec2e0f5 10278fi
698be2d8
CB
10279{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
10280$as_echo "$ac_cv_c_restrict" >&6; }
10281
10282 case $ac_cv_c_restrict in
10283 restrict) ;;
10284 no) $as_echo "#define restrict /**/" >>confdefs.h
10285 ;;
10286 *) cat >>confdefs.h <<_ACEOF
10287#define restrict $ac_cv_c_restrict
10288_ACEOF
10289 ;;
10290 esac
8690e634
JK
10291
10292
10293
10294
10295
10296
c0c3707f
CB
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306 if test $gl_cv_have_include_next = yes; then
10307 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
10308 else
10309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
10310$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
10311if ${gl_cv_next_sys_stat_h+:} false; then :
8690e634
JK
10312 $as_echo_n "(cached) " >&6
10313else
10314
c0c3707f 10315 if test $ac_cv_header_sys_stat_h = yes; then
4a626d0a
PA
10316
10317
4a626d0a 10318
c0c3707f
CB
10319
10320 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10321/* end confdefs.h. */
10322#include <sys/stat.h>
6ec2e0f5 10323_ACEOF
c0c3707f
CB
10324 case "$host_os" in
10325 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10326 *) gl_absname_cpp="$ac_cpp" ;;
10327 esac
10328
10329 case "$host_os" in
10330 mingw*)
10331 gl_dirsep_regex='[/\\]'
10332 ;;
10333 *)
10334 gl_dirsep_regex='\/'
10335 ;;
10336 esac
10337 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10338 gl_header_literal_regex=`echo 'sys/stat.h' \
10339 | sed -e "$gl_make_literal_regex_sed"`
10340 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10341 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10342 s|^/[^/]|//&|
10343 p
10344 q
10345 }'
10346
10347 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10348 sed -n "$gl_absolute_header_sed"`
10349
10350 gl_header=$gl_cv_absolute_sys_stat_h
10351 gl_cv_next_sys_stat_h='"'$gl_header'"'
10352 else
10353 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
10354 fi
10355
10356
10357fi
10358{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
10359$as_echo "$gl_cv_next_sys_stat_h" >&6; }
10360 fi
10361 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
10362
10363 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10364 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10365 gl_next_as_first_directive='<'sys/stat.h'>'
10366 else
10367 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10368 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
10369 fi
10370 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
10371
10372
10373
10374
10375
10376
10377
10378
10379 WINDOWS_STAT_TIMESPEC=0
10380
10381
10382
10383
4a626d0a 10384
4a626d0a 10385
8690e634
JK
10386
10387
c0c3707f
CB
10388 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
10389 #include <sys/stat.h>
10390"
10391if test "x$ac_cv_type_nlink_t" = xyes; then :
8690e634 10392
6ec2e0f5 10393else
8690e634 10394
c0c3707f 10395$as_echo "#define nlink_t int" >>confdefs.h
6ec2e0f5 10396
6ec2e0f5 10397fi
8690e634
JK
10398
10399
10400
10401
10402
10403
10404
698be2d8
CB
10405
10406
6ec2e0f5 10407
9c9d63b1
PM
10408 case "$host_os" in
10409 mingw*)
10410 for ac_header in sdkddkver.h
10411do :
10412 ac_fn_c_check_header_mongrel "$LINENO" "sdkddkver.h" "ac_cv_header_sdkddkver_h" "$ac_includes_default"
10413if test "x$ac_cv_header_sdkddkver_h" = xyes; then :
10414 cat >>confdefs.h <<_ACEOF
10415#define HAVE_SDKDDKVER_H 1
8690e634 10416_ACEOF
6ec2e0f5 10417
8690e634 10418fi
c0c3707f 10419
9c9d63b1 10420done
8690e634 10421
c0c3707f
CB
10422 ;;
10423 esac
8690e634 10424
8690e634 10425
8690e634 10426
8690e634 10427
c0c3707f
CB
10428
10429 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
10430$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
10431if ${gl_cv_func_getcwd_null+:} false; then :
8690e634
JK
10432 $as_echo_n "(cached) " >&6
10433else
c0c3707f
CB
10434 if test "$cross_compiling" = yes; then :
10435 case "$host_os" in
10436 # Guess yes on glibc systems.
10437 *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
10438 # Guess yes on musl systems.
10439 *-musl*) gl_cv_func_getcwd_null="guessing yes";;
10440 # Guess yes on Cygwin.
10441 cygwin*) gl_cv_func_getcwd_null="guessing yes";;
10442 # If we don't know, obey --enable-cross-guesses.
10443 *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
10444 esac
10445
10446else
10447 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
10448/* end confdefs.h. */
10449
c0c3707f
CB
10450# include <stdlib.h>
10451# if HAVE_UNISTD_H
10452# include <unistd.h>
10453# else /* on Windows with MSVC */
10454# include <direct.h>
10455# endif
9c9d63b1
PM
10456
10457
10458$gl_mda_defines
10459
c0c3707f
CB
10460# ifndef getcwd
10461 char *getcwd ();
10462# endif
8690e634
JK
10463
10464int
10465main ()
10466{
10467
c0c3707f 10468#if defined _WIN32 && ! defined __CYGWIN__
9c9d63b1 10469/* mingw cwd does not start with '/', but _getcwd does allocate.
c0c3707f
CB
10470 However, mingw fails to honor non-zero size. */
10471#else
10472 if (chdir ("/") != 0)
10473 return 1;
10474 else
10475 {
10476 char *f = getcwd (NULL, 0);
10477 if (! f)
10478 return 2;
10479 if (f[0] != '/')
10480 { free (f); return 3; }
10481 if (f[1] != '\0')
10482 { free (f); return 4; }
10483 free (f);
10484 return 0;
10485 }
10486#endif
10487
8690e634
JK
10488 ;
10489 return 0;
10490}
10491_ACEOF
c0c3707f
CB
10492if ac_fn_c_try_run "$LINENO"; then :
10493 gl_cv_func_getcwd_null=yes
10494else
10495 gl_cv_func_getcwd_null=no
8690e634 10496fi
c0c3707f
CB
10497rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10498 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 10499fi
8690e634 10500
c0c3707f
CB
10501fi
10502{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
10503$as_echo "$gl_cv_func_getcwd_null" >&6; }
8690e634 10504
6ec2e0f5 10505
c0c3707f
CB
10506 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
10507$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
10508if ${gl_cv_func_getcwd_posix_signature+:} false; then :
8690e634
JK
10509 $as_echo_n "(cached) " >&6
10510else
c0c3707f 10511 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 10512/* end confdefs.h. */
c0c3707f 10513#include <unistd.h>
9c9d63b1
PM
10514
10515
10516$gl_mda_defines
10517
88b48903
WN
10518int
10519main ()
10520{
c0c3707f
CB
10521extern
10522 #ifdef __cplusplus
10523 "C"
10524 #endif
10525 char *getcwd (char *, size_t);
88b48903
WN
10526
10527 ;
10528 return 0;
10529}
c0c3707f 10530
88b48903
WN
10531_ACEOF
10532if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
10533 gl_cv_func_getcwd_posix_signature=yes
10534else
10535 gl_cv_func_getcwd_posix_signature=no
8690e634 10536fi
88b48903 10537rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 10538
c0c3707f
CB
10539fi
10540{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
10541$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
8690e634 10542
c0c3707f
CB
10543ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
10544if test "x$ac_cv_have_decl_getcwd" = xyes; then :
10545 ac_have_decl=1
10546else
10547 ac_have_decl=0
10548fi
8690e634 10549
c0c3707f
CB
10550cat >>confdefs.h <<_ACEOF
10551#define HAVE_DECL_GETCWD $ac_have_decl
10552_ACEOF
8690e634
JK
10553
10554
c17253b9
MF
10555 GNULIB_DPRINTF=0;
10556 GNULIB_FCLOSE=0;
10557 GNULIB_FDOPEN=0;
10558 GNULIB_FFLUSH=0;
10559 GNULIB_FGETC=0;
10560 GNULIB_FGETS=0;
10561 GNULIB_FOPEN=0;
10562 GNULIB_FPRINTF=0;
10563 GNULIB_FPRINTF_POSIX=0;
10564 GNULIB_FPURGE=0;
10565 GNULIB_FPUTC=0;
10566 GNULIB_FPUTS=0;
10567 GNULIB_FREAD=0;
10568 GNULIB_FREOPEN=0;
10569 GNULIB_FSCANF=0;
10570 GNULIB_FSEEK=0;
10571 GNULIB_FSEEKO=0;
10572 GNULIB_FTELL=0;
10573 GNULIB_FTELLO=0;
10574 GNULIB_FWRITE=0;
10575 GNULIB_GETC=0;
10576 GNULIB_GETCHAR=0;
10577 GNULIB_GETDELIM=0;
10578 GNULIB_GETLINE=0;
10579 GNULIB_OBSTACK_PRINTF=0;
10580 GNULIB_OBSTACK_PRINTF_POSIX=0;
10581 GNULIB_PCLOSE=0;
10582 GNULIB_PERROR=0;
10583 GNULIB_POPEN=0;
10584 GNULIB_PRINTF=0;
10585 GNULIB_PRINTF_POSIX=0;
10586 GNULIB_PUTC=0;
10587 GNULIB_PUTCHAR=0;
10588 GNULIB_PUTS=0;
10589 GNULIB_REMOVE=0;
10590 GNULIB_RENAME=0;
10591 GNULIB_RENAMEAT=0;
10592 GNULIB_SCANF=0;
10593 GNULIB_SNPRINTF=0;
10594 GNULIB_SPRINTF_POSIX=0;
10595 GNULIB_STDIO_H_NONBLOCKING=0;
10596 GNULIB_STDIO_H_SIGPIPE=0;
10597 GNULIB_TMPFILE=0;
10598 GNULIB_VASPRINTF=0;
10599 GNULIB_VFSCANF=0;
10600 GNULIB_VSCANF=0;
10601 GNULIB_VDPRINTF=0;
10602 GNULIB_VFPRINTF=0;
10603 GNULIB_VFPRINTF_POSIX=0;
10604 GNULIB_VPRINTF=0;
10605 GNULIB_VPRINTF_POSIX=0;
10606 GNULIB_VSNPRINTF=0;
10607 GNULIB_VSPRINTF_POSIX=0;
10608 GNULIB_MDA_FCLOSEALL=1;
10609 GNULIB_MDA_FDOPEN=1;
10610 GNULIB_MDA_FILENO=1;
10611 GNULIB_MDA_GETW=1;
10612 GNULIB_MDA_PUTW=1;
10613 GNULIB_MDA_TEMPNAM=1;
10614 HAVE_DECL_FCLOSEALL=1;
10615 HAVE_DECL_FPURGE=1;
10616 HAVE_DECL_FSEEKO=1;
10617 HAVE_DECL_FTELLO=1;
10618 HAVE_DECL_GETDELIM=1;
10619 HAVE_DECL_GETLINE=1;
10620 HAVE_DECL_OBSTACK_PRINTF=1;
10621 HAVE_DECL_SNPRINTF=1;
10622 HAVE_DECL_VSNPRINTF=1;
10623 HAVE_DPRINTF=1;
10624 HAVE_FSEEKO=1;
10625 HAVE_FTELLO=1;
10626 HAVE_PCLOSE=1;
10627 HAVE_POPEN=1;
10628 HAVE_RENAMEAT=1;
10629 HAVE_VASPRINTF=1;
10630 HAVE_VDPRINTF=1;
10631 REPLACE_DPRINTF=0;
10632 REPLACE_FCLOSE=0;
10633 REPLACE_FDOPEN=0;
10634 REPLACE_FFLUSH=0;
10635 REPLACE_FOPEN=0;
10636 REPLACE_FPRINTF=0;
10637 REPLACE_FPURGE=0;
10638 REPLACE_FREOPEN=0;
10639 REPLACE_FSEEK=0;
10640 REPLACE_FSEEKO=0;
10641 REPLACE_FTELL=0;
10642 REPLACE_FTELLO=0;
10643 REPLACE_GETDELIM=0;
10644 REPLACE_GETLINE=0;
10645 REPLACE_OBSTACK_PRINTF=0;
10646 REPLACE_PERROR=0;
10647 REPLACE_POPEN=0;
10648 REPLACE_PRINTF=0;
10649 REPLACE_REMOVE=0;
10650 REPLACE_RENAME=0;
10651 REPLACE_RENAMEAT=0;
10652 REPLACE_SNPRINTF=0;
10653 REPLACE_SPRINTF=0;
10654 REPLACE_STDIO_READ_FUNCS=0;
10655 REPLACE_STDIO_WRITE_FUNCS=0;
10656 REPLACE_TMPFILE=0;
10657 REPLACE_VASPRINTF=0;
10658 REPLACE_VDPRINTF=0;
10659 REPLACE_VFPRINTF=0;
10660 REPLACE_VPRINTF=0;
10661 REPLACE_VSNPRINTF=0;
10662 REPLACE_VSPRINTF=0;
10663
10664ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" "$ac_includes_default"
10665if test "x$ac_cv_have_decl_getdelim" = xyes; then :
10666 ac_have_decl=1
10667else
10668 ac_have_decl=0
10669fi
10670
10671cat >>confdefs.h <<_ACEOF
10672#define HAVE_DECL_GETDELIM $ac_have_decl
10673_ACEOF
10674
10675
10676
10677
10678
10679ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
10680if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
10681 ac_have_decl=1
10682else
10683 ac_have_decl=0
10684fi
10685
10686cat >>confdefs.h <<_ACEOF
10687#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
10688_ACEOF
10689
10690ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" "$ac_includes_default"
10691if test "x$ac_cv_have_decl_getline" = xyes; then :
10692 ac_have_decl=1
10693else
10694 ac_have_decl=0
10695fi
10696
10697cat >>confdefs.h <<_ACEOF
10698#define HAVE_DECL_GETLINE $ac_have_decl
10699_ACEOF
10700
10701ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default"
10702if test "x$ac_cv_have_decl_getlogin_r" = xyes; then :
10703 ac_have_decl=1
10704else
10705 ac_have_decl=0
10706fi
10707
10708cat >>confdefs.h <<_ACEOF
10709#define HAVE_DECL_GETLOGIN_R $ac_have_decl
10710_ACEOF
10711
10712
10713
10714ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default"
10715if test "x$ac_cv_have_decl_getlogin" = xyes; then :
10716 ac_have_decl=1
10717else
10718 ac_have_decl=0
10719fi
10720
10721cat >>confdefs.h <<_ACEOF
10722#define HAVE_DECL_GETLOGIN $ac_have_decl
10723_ACEOF
10724
10725
10726
10727 case $host_os in
10728 mingw*)
c0c3707f
CB
10729 LIB_GETLOGIN='-ladvapi32' ;;
10730 *)
10731 LIB_GETLOGIN= ;;
10732 esac
6ec2e0f5 10733
472fa5ee
SM
10734
10735
10736
6ec2e0f5
SDJ
10737
10738
10739
698be2d8
CB
10740 GNULIB_GETRANDOM=0;
10741 HAVE_GETRANDOM=1;
10742 REPLACE_GETRANDOM=0;
10743
10744
10745
10746
c0c3707f
CB
10747 GNULIB_GETTIMEOFDAY=0;
10748 HAVE_GETTIMEOFDAY=1;
10749 HAVE_STRUCT_TIMEVAL=1;
10750 HAVE_SYS_TIME_H=1;
10751 REPLACE_GETTIMEOFDAY=0;
10752 REPLACE_STRUCT_TIMEVAL=0;
472fa5ee 10753
472fa5ee 10754
6ec2e0f5
SDJ
10755
10756
10757
10758
10759
10760
472fa5ee
SM
10761
10762
10763
6ec2e0f5
SDJ
10764
10765
10766
10767
10768
10769 if test $gl_cv_have_include_next = yes; then
c0c3707f 10770 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10771 else
c0c3707f
CB
10772 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
10773$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
10774if ${gl_cv_next_sys_time_h+:} false; then :
6ec2e0f5 10775 $as_echo_n "(cached) " >&6
88b48903 10776else
8690e634 10777
c0c3707f 10778 if test $ac_cv_header_sys_time_h = yes; then
8690e634
JK
10779
10780
8690e634
JK
10781
10782
6ec2e0f5
SDJ
10783 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10784/* end confdefs.h. */
c0c3707f 10785#include <sys/time.h>
88b48903 10786_ACEOF
6ec2e0f5
SDJ
10787 case "$host_os" in
10788 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10789 *) gl_absname_cpp="$ac_cpp" ;;
10790 esac
8690e634 10791
6ec2e0f5
SDJ
10792 case "$host_os" in
10793 mingw*)
10794 gl_dirsep_regex='[/\\]'
10795 ;;
10796 *)
10797 gl_dirsep_regex='\/'
88b48903
WN
10798 ;;
10799 esac
6ec2e0f5 10800 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 10801 gl_header_literal_regex=`echo 'sys/time.h' \
6ec2e0f5
SDJ
10802 | sed -e "$gl_make_literal_regex_sed"`
10803 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10804 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10805 s|^/[^/]|//&|
10806 p
10807 q
10808 }'
8690e634 10809
c0c3707f 10810 gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5 10811 sed -n "$gl_absolute_header_sed"`
8690e634 10812
c0c3707f
CB
10813 gl_header=$gl_cv_absolute_sys_time_h
10814 gl_cv_next_sys_time_h='"'$gl_header'"'
6ec2e0f5 10815 else
c0c3707f 10816 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10817 fi
88b48903 10818
88b48903 10819
88b48903 10820fi
c0c3707f
CB
10821{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
10822$as_echo "$gl_cv_next_sys_time_h" >&6; }
6ec2e0f5 10823 fi
c0c3707f 10824 NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
88b48903 10825
6ec2e0f5
SDJ
10826 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10827 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 10828 gl_next_as_first_directive='<'sys/time.h'>'
6ec2e0f5
SDJ
10829 else
10830 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f
CB
10831 gl_next_as_first_directive=$gl_cv_next_sys_time_h
10832 fi
10833 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
6ec2e0f5 10834
6ec2e0f5
SDJ
10835
10836
10837
6ec2e0f5 10838
c0c3707f
CB
10839 if test $ac_cv_header_sys_time_h != yes; then
10840 HAVE_SYS_TIME_H=0
10841 fi
6ec2e0f5 10842
6ec2e0f5 10843
6ec2e0f5 10844
6ec2e0f5 10845
6ec2e0f5 10846
c0c3707f
CB
10847 if test $ac_cv_header_sys_socket_h != yes; then
10848 for ac_header in winsock2.h
10849do :
10850 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10851if test "x$ac_cv_header_winsock2_h" = xyes; then :
10852 cat >>confdefs.h <<_ACEOF
10853#define HAVE_WINSOCK2_H 1
6ec2e0f5 10854_ACEOF
6ec2e0f5 10855
6ec2e0f5 10856fi
6ec2e0f5 10857
c0c3707f 10858done
6ec2e0f5 10859
c0c3707f
CB
10860 fi
10861 if test "$ac_cv_header_winsock2_h" = yes; then
10862 HAVE_WINSOCK2_H=1
10863 UNISTD_H_HAVE_WINSOCK2_H=1
10864 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
10865 else
10866 HAVE_WINSOCK2_H=0
10867 fi
10868
10869
10870 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
10871$as_echo_n "checking for struct timeval... " >&6; }
10872if ${gl_cv_sys_struct_timeval+:} false; then :
10873 $as_echo_n "(cached) " >&6
10874else
10875 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10876/* end confdefs.h. */
c0c3707f
CB
10877#if HAVE_SYS_TIME_H
10878 #include <sys/time.h>
10879 #endif
10880 #include <time.h>
10881 #if HAVE_WINSOCK2_H
10882 # include <winsock2.h>
10883 #endif
6ec2e0f5
SDJ
10884
10885int
10886main ()
10887{
c0c3707f 10888static struct timeval x; x.tv_sec = x.tv_usec;
6ec2e0f5
SDJ
10889 ;
10890 return 0;
10891}
10892_ACEOF
10893if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10894 gl_cv_sys_struct_timeval=yes
6ec2e0f5 10895else
c0c3707f 10896 gl_cv_sys_struct_timeval=no
6ec2e0f5
SDJ
10897fi
10898rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903 10899
c0c3707f
CB
10900fi
10901{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
10902$as_echo "$gl_cv_sys_struct_timeval" >&6; }
10903 if test $gl_cv_sys_struct_timeval != yes; then
10904 HAVE_STRUCT_TIMEVAL=0
10905 else
10906 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
10907$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
10908if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
10909 $as_echo_n "(cached) " >&6
10910else
10911 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88b48903 10912/* end confdefs.h. */
c0c3707f
CB
10913#if HAVE_SYS_TIME_H
10914 #include <sys/time.h>
10915 #endif
10916 #include <time.h>
10917 #if HAVE_WINSOCK2_H
10918 # include <winsock2.h>
10919 #endif
88b48903
WN
10920
10921int
10922main ()
10923{
c0c3707f
CB
10924static struct timeval x;
10925 typedef int verify_tv_sec_type[
10926 sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
10927 ];
88b48903
WN
10928
10929 ;
10930 return 0;
10931}
10932_ACEOF
10933if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10934 gl_cv_sys_struct_timeval_tv_sec=yes
88b48903 10935else
c0c3707f 10936 gl_cv_sys_struct_timeval_tv_sec=no
88b48903
WN
10937fi
10938rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10939
88b48903 10940fi
c0c3707f
CB
10941{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
10942$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
10943 if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
10944 REPLACE_STRUCT_TIMEVAL=1
88b48903 10945 fi
c0c3707f 10946 fi
88b48903 10947
c0c3707f
CB
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
c0c3707f
CB
10958 GNULIB_GLOB=0;
10959 HAVE_GLOB=1;
10960 HAVE_GLOB_PATTERN_P=1;
10961 REPLACE_GLOB=0;
10962 REPLACE_GLOB_PATTERN_P=0;
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980 if test $gl_cv_have_include_next = yes; then
10981 gl_cv_next_glob_h='<'glob.h'>'
10982 else
10983 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5
10984$as_echo_n "checking absolute name of <glob.h>... " >&6; }
10985if ${gl_cv_next_glob_h+:} false; then :
10986 $as_echo_n "(cached) " >&6
88b48903 10987else
c0c3707f
CB
10988
10989 if test $ac_cv_header_glob_h = yes; then
10990
10991
10992
10993
88b48903
WN
10994 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10995/* end confdefs.h. */
c0c3707f
CB
10996#include <glob.h>
10997_ACEOF
10998 case "$host_os" in
10999 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11000 *) gl_absname_cpp="$ac_cpp" ;;
11001 esac
88b48903 11002
c0c3707f
CB
11003 case "$host_os" in
11004 mingw*)
11005 gl_dirsep_regex='[/\\]'
11006 ;;
11007 *)
11008 gl_dirsep_regex='\/'
11009 ;;
11010 esac
11011 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11012 gl_header_literal_regex=`echo 'glob.h' \
11013 | sed -e "$gl_make_literal_regex_sed"`
11014 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11015 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11016 s|^/[^/]|//&|
11017 p
11018 q
11019 }'
11020
11021 gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11022 sed -n "$gl_absolute_header_sed"`
11023
11024 gl_header=$gl_cv_absolute_glob_h
11025 gl_cv_next_glob_h='"'$gl_header'"'
11026 else
11027 gl_cv_next_glob_h='<'glob.h'>'
11028 fi
88b48903 11029
88b48903 11030
88b48903 11031fi
c0c3707f
CB
11032{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5
11033$as_echo "$gl_cv_next_glob_h" >&6; }
11034 fi
11035 NEXT_GLOB_H=$gl_cv_next_glob_h
88b48903 11036
c0c3707f
CB
11037 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11038 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11039 gl_next_as_first_directive='<'glob.h'>'
11040 else
11041 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11042 gl_next_as_first_directive=$gl_cv_next_glob_h
11043 fi
11044 NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive
88b48903 11045
88b48903
WN
11046
11047
11048
2196f55f 11049
c0c3707f
CB
11050 if test $ac_cv_header_glob_h = yes; then
11051 HAVE_GLOB_H=1
11052 else
11053 HAVE_GLOB_H=0
11054 fi
2196f55f 11055
6ec2e0f5 11056
c0c3707f
CB
11057 GLOB_H=''
11058 if false; then
11059 GLOB_H=glob.h
11060 else
11061 if test $ac_cv_header_glob_h != yes; then
11062 GLOB_H=glob.h
11063 fi
11064 fi
11065
11066
11067 if test -n "$GLOB_H"; then
11068 GL_GENERATE_GLOB_H_TRUE=
11069 GL_GENERATE_GLOB_H_FALSE='#'
88b48903 11070else
c0c3707f
CB
11071 GL_GENERATE_GLOB_H_TRUE='#'
11072 GL_GENERATE_GLOB_H_FALSE=
6ec2e0f5
SDJ
11073fi
11074
88b48903 11075
88b48903 11076
88b48903 11077
88b48903
WN
11078
11079
11080
11081
11082
11083
11084
11085
8690e634 11086
c0c3707f
CB
11087
11088
c0c3707f 11089
5df4cba6
SM
11090 if test -z "$gl_pthreadlib_body_done"; then
11091 gl_pthread_api=no
11092 LIBPTHREAD=
11093 LIBPMULTITHREAD=
11094 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
11095 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
11096 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
11097if test "x$ac_cv_header_pthread_h" = xyes; then :
11098 gl_have_pthread_h=yes
c0c3707f 11099else
5df4cba6
SM
11100 gl_have_pthread_h=no
11101fi
c0c3707f 11102
5df4cba6
SM
11103
11104 if test "$gl_have_pthread_h" = yes; then
11105 # Other possible tests:
11106 # -lpthreads (FSU threads, PCthreads)
11107 # -lgthreads
11108 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
11109 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
11110 # the second one only in libpthread, and lock.c needs it.
11111 #
11112 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
11113 # needs -pthread for some reason. See:
11114 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
11115 save_LIBS=$LIBS
11116 for gl_pthread in '' '-pthread'; do
11117 LIBS="$LIBS $gl_pthread"
11118 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11119/* end confdefs.h. */
5df4cba6
SM
11120#include <pthread.h>
11121 pthread_mutex_t m;
11122 pthread_mutexattr_t ma;
11123
8690e634
JK
11124int
11125main ()
11126{
5df4cba6
SM
11127pthread_mutex_lock (&m);
11128 pthread_mutexattr_init (&ma);
8690e634
JK
11129 ;
11130 return 0;
11131}
11132_ACEOF
5df4cba6
SM
11133if ac_fn_c_try_link "$LINENO"; then :
11134 gl_pthread_api=yes
11135 LIBPTHREAD=$gl_pthread
11136 LIBPMULTITHREAD=$gl_pthread
c0c3707f 11137fi
5df4cba6
SM
11138rm -f core conftest.err conftest.$ac_objext \
11139 conftest$ac_exeext conftest.$ac_ext
11140 LIBS=$save_LIBS
11141 test $gl_pthread_api = yes && break
11142 done
6ec2e0f5 11143
5df4cba6
SM
11144 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
11145 # since it is defined as a macro on OSF/1.)
11146 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
11147 # The program links fine without libpthread. But it may actually
11148 # need to link with libpthread in order to create multiple threads.
11149 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
11150$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
11151if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
11152 $as_echo_n "(cached) " >&6
11153else
5df4cba6
SM
11154 ac_check_lib_save_LIBS=$LIBS
11155LIBS="-lpthread $LIBS"
11156cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11157/* end confdefs.h. */
5df4cba6
SM
11158
11159/* Override any GCC internal prototype to avoid an error.
11160 Use char because int might match the return type of a GCC
11161 builtin and then its argument prototype would still apply. */
11162#ifdef __cplusplus
11163extern "C"
11164#endif
11165char pthread_kill ();
6ec2e0f5
SDJ
11166int
11167main ()
11168{
5df4cba6 11169return pthread_kill ();
6ec2e0f5
SDJ
11170 ;
11171 return 0;
11172}
11173_ACEOF
5df4cba6
SM
11174if ac_fn_c_try_link "$LINENO"; then :
11175 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 11176else
5df4cba6 11177 ac_cv_lib_pthread_pthread_kill=no
8690e634 11178fi
5df4cba6
SM
11179rm -f core conftest.err conftest.$ac_objext \
11180 conftest$ac_exeext conftest.$ac_ext
11181LIBS=$ac_check_lib_save_LIBS
11182fi
11183{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
11184$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
11185if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
11186 LIBPMULTITHREAD=-lpthread
11187 # On Solaris and HP-UX, most pthread functions exist also in libc.
11188 # Therefore pthread_in_use() needs to actually try to create a
11189 # thread: pthread_create from libc will fail, whereas
11190 # pthread_create will actually create a thread.
11191 # On Solaris 10 or newer, this test is no longer needed, because
11192 # libc contains the fully functional pthread functions.
11193 case "$host_os" in
11194 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
11195
11196$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
11197
11198 esac
c0c3707f 11199
6ec2e0f5 11200fi
8690e634 11201
5df4cba6
SM
11202 elif test $gl_pthread_api != yes; then
11203 # Some library is needed. Try libpthread and libc_r.
11204 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
11205$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
11206if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
11207 $as_echo_n "(cached) " >&6
11208else
11209 ac_check_lib_save_LIBS=$LIBS
11210LIBS="-lpthread $LIBS"
11211cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11212/* end confdefs.h. */
c0c3707f 11213
5df4cba6
SM
11214/* Override any GCC internal prototype to avoid an error.
11215 Use char because int might match the return type of a GCC
11216 builtin and then its argument prototype would still apply. */
11217#ifdef __cplusplus
11218extern "C"
11219#endif
11220char pthread_kill ();
11221int
11222main ()
11223{
11224return pthread_kill ();
11225 ;
11226 return 0;
11227}
11228_ACEOF
11229if ac_fn_c_try_link "$LINENO"; then :
11230 ac_cv_lib_pthread_pthread_kill=yes
11231else
11232 ac_cv_lib_pthread_pthread_kill=no
11233fi
11234rm -f core conftest.err conftest.$ac_objext \
11235 conftest$ac_exeext conftest.$ac_ext
11236LIBS=$ac_check_lib_save_LIBS
11237fi
11238{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
11239$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
11240if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
11241 gl_pthread_api=yes
11242 LIBPTHREAD=-lpthread
11243 LIBPMULTITHREAD=-lpthread
11244fi
c0c3707f 11245
5df4cba6
SM
11246 if test $gl_pthread_api != yes; then
11247 # For FreeBSD 4.
11248 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
11249$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
11250if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
11251 $as_echo_n "(cached) " >&6
11252else
11253 ac_check_lib_save_LIBS=$LIBS
11254LIBS="-lc_r $LIBS"
11255cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11256/* end confdefs.h. */
c0c3707f 11257
5df4cba6
SM
11258/* Override any GCC internal prototype to avoid an error.
11259 Use char because int might match the return type of a GCC
11260 builtin and then its argument prototype would still apply. */
11261#ifdef __cplusplus
11262extern "C"
11263#endif
11264char pthread_kill ();
11265int
11266main ()
11267{
11268return pthread_kill ();
11269 ;
11270 return 0;
11271}
11272_ACEOF
11273if ac_fn_c_try_link "$LINENO"; then :
11274 ac_cv_lib_c_r_pthread_kill=yes
11275else
11276 ac_cv_lib_c_r_pthread_kill=no
11277fi
11278rm -f core conftest.err conftest.$ac_objext \
11279 conftest$ac_exeext conftest.$ac_ext
11280LIBS=$ac_check_lib_save_LIBS
11281fi
11282{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
11283$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
11284if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
11285 gl_pthread_api=yes
11286 LIBPTHREAD=-lc_r
11287 LIBPMULTITHREAD=-lc_r
11288fi
c0c3707f 11289
5df4cba6
SM
11290 fi
11291 fi
11292 fi
11293 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
11294$as_echo_n "checking whether POSIX threads API is available... " >&6; }
11295 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
11296$as_echo "$gl_pthread_api" >&6; }
c0c3707f
CB
11297
11298
5df4cba6 11299 if test $gl_pthread_api = yes; then
c0c3707f 11300
5df4cba6 11301$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
c0c3707f 11302
5df4cba6 11303 fi
c0c3707f 11304
5df4cba6
SM
11305 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11306/* end confdefs.h. */
11307#include <sched.h>
11308int
11309main ()
11310{
11311sched_yield ();
11312 ;
11313 return 0;
11314}
11315_ACEOF
11316if ac_fn_c_try_link "$LINENO"; then :
11317 LIB_SCHED_YIELD=
c0c3707f 11318
5df4cba6
SM
11319else
11320 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
11321$as_echo_n "checking for sched_yield in -lrt... " >&6; }
11322if ${ac_cv_lib_rt_sched_yield+:} false; then :
c0c3707f 11323 $as_echo_n "(cached) " >&6
6ec2e0f5 11324else
5df4cba6
SM
11325 ac_check_lib_save_LIBS=$LIBS
11326LIBS="-lrt $LIBS"
11327cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 11328/* end confdefs.h. */
6ec2e0f5 11329
5df4cba6
SM
11330/* Override any GCC internal prototype to avoid an error.
11331 Use char because int might match the return type of a GCC
11332 builtin and then its argument prototype would still apply. */
11333#ifdef __cplusplus
11334extern "C"
11335#endif
11336char sched_yield ();
11337int
11338main ()
11339{
11340return sched_yield ();
11341 ;
11342 return 0;
11343}
11344_ACEOF
11345if ac_fn_c_try_link "$LINENO"; then :
11346 ac_cv_lib_rt_sched_yield=yes
11347else
11348 ac_cv_lib_rt_sched_yield=no
11349fi
11350rm -f core conftest.err conftest.$ac_objext \
11351 conftest$ac_exeext conftest.$ac_ext
11352LIBS=$ac_check_lib_save_LIBS
11353fi
11354{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
11355$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
11356if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
11357 LIB_SCHED_YIELD=-lrt
11358else
11359 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
11360$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
11361if ${ac_cv_lib_posix4_sched_yield+:} false; then :
11362 $as_echo_n "(cached) " >&6
11363else
11364 ac_check_lib_save_LIBS=$LIBS
11365LIBS="-lposix4 $LIBS"
11366cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11367/* end confdefs.h. */
6ec2e0f5 11368
5df4cba6
SM
11369/* Override any GCC internal prototype to avoid an error.
11370 Use char because int might match the return type of a GCC
11371 builtin and then its argument prototype would still apply. */
11372#ifdef __cplusplus
11373extern "C"
11374#endif
11375char sched_yield ();
11376int
11377main ()
11378{
11379return sched_yield ();
11380 ;
11381 return 0;
11382}
11383_ACEOF
11384if ac_fn_c_try_link "$LINENO"; then :
11385 ac_cv_lib_posix4_sched_yield=yes
11386else
11387 ac_cv_lib_posix4_sched_yield=no
11388fi
11389rm -f core conftest.err conftest.$ac_objext \
11390 conftest$ac_exeext conftest.$ac_ext
11391LIBS=$ac_check_lib_save_LIBS
11392fi
11393{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
11394$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
11395if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
11396 LIB_SCHED_YIELD=-lposix4
6ec2e0f5 11397fi
8690e634 11398
5df4cba6 11399fi
8690e634 11400
8690e634 11401
5df4cba6
SM
11402fi
11403rm -f core conftest.err conftest.$ac_objext \
11404 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5
SDJ
11405
11406
5df4cba6 11407 gl_pthreadlib_body_done=done
c0c3707f 11408 fi
6ec2e0f5 11409
6ec2e0f5 11410
8690e634
JK
11411
11412
472fa5ee 11413
c0c3707f 11414
c0c3707f 11415
c0c3707f 11416
c0c3707f 11417
5df4cba6
SM
11418 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
11419$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
11420if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
11421 $as_echo_n "(cached) " >&6
11422else
11423 case "$host_os" in
11424 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
11425 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
11426 gl_cv_func_setlocale_null_all_mtsafe=no ;;
11427 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
11428 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
11429 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
11430 # If we don't know, obey --enable-cross-guesses.
11431 *)
11432 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
11433 esac
c0c3707f 11434
5e8754f9 11435fi
5df4cba6
SM
11436{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
11437$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
11438 case "$host_os" in
11439 mingw*) ;;
11440 *)
11441 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
11442 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
11443 fi
11444 ;;
11445 esac
11446 case "$gl_cv_func_setlocale_null_all_mtsafe" in
11447 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
11448 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
11449 esac
5e8754f9
SDJ
11450
11451cat >>confdefs.h <<_ACEOF
5df4cba6 11452#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
5e8754f9
SDJ
11453_ACEOF
11454
11455
5df4cba6
SM
11456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
11457$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
11458if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
11459 $as_echo_n "(cached) " >&6
11460else
11461 case "$host_os" in
11462 # Guess no on OpenBSD, AIX.
11463 openbsd* | aix*)
11464 gl_cv_func_setlocale_null_one_mtsafe=no ;;
11465 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
11466 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
11467 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
11468 # If we don't know, obey --enable-cross-guesses.
11469 *)
11470 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
11471 esac
5abebf3c 11472
5df4cba6
SM
11473fi
11474{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
11475$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
11476 case "$host_os" in
11477 mingw*) ;;
11478 *)
11479 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
11480 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
11481 fi
11482 ;;
11483 esac
11484 case "$gl_cv_func_setlocale_null_one_mtsafe" in
11485 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
11486 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
11487 esac
5abebf3c 11488
c0c3707f 11489cat >>confdefs.h <<_ACEOF
5df4cba6 11490#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
5abebf3c 11491_ACEOF
c0c3707f
CB
11492
11493
5df4cba6
SM
11494 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
11495 case "$host_os" in
11496 mingw*) LIB_SETLOCALE_NULL= ;;
11497 *)
11498
11499
11500 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
11501$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
11502if ${gl_cv_have_weak+:} false; then :
11503 $as_echo_n "(cached) " >&6
5abebf3c 11504else
5df4cba6
SM
11505 gl_cv_have_weak=no
11506 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11507/* end confdefs.h. */
11508extern void xyzzy ();
11509#pragma weak xyzzy
11510int
11511main ()
11512{
11513xyzzy();
11514 ;
11515 return 0;
11516}
11517_ACEOF
11518if ac_fn_c_try_link "$LINENO"; then :
11519 gl_cv_have_weak=maybe
5abebf3c 11520fi
5df4cba6
SM
11521rm -f core conftest.err conftest.$ac_objext \
11522 conftest$ac_exeext conftest.$ac_ext
11523 if test $gl_cv_have_weak = maybe; then
11524 if test "$cross_compiling" = yes; then :
11525 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11526/* end confdefs.h. */
11527#ifdef __ELF__
11528 Extensible Linking Format
11529 #endif
c0c3707f 11530
5df4cba6
SM
11531_ACEOF
11532if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11533 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
11534 gl_cv_have_weak="guessing yes"
11535else
11536 gl_cv_have_weak="guessing no"
11537fi
11538rm -f conftest*
5abebf3c
CB
11539
11540
5df4cba6
SM
11541else
11542 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11543/* end confdefs.h. */
5abebf3c 11544
5df4cba6
SM
11545#include <stdio.h>
11546#pragma weak fputs
11547int main ()
11548{
11549 return (fputs == NULL);
11550}
c0c3707f 11551_ACEOF
5df4cba6
SM
11552if ac_fn_c_try_run "$LINENO"; then :
11553 gl_cv_have_weak=yes
11554else
11555 gl_cv_have_weak=no
11556fi
11557rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11558 conftest.$ac_objext conftest.beam conftest.$ac_ext
11559fi
11560
11561 fi
11562 case " $LDFLAGS " in
11563 *" -static "*) gl_cv_have_weak=no ;;
11564 esac
11565 case "$gl_cv_have_weak" in
11566 *yes)
11567 case "$host_os" in
11568 freebsd* | dragonfly*)
11569 : > conftest1.c
11570 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
11571 cat <<EOF > conftest2.c
11572#include <pthread.h>
11573#pragma weak pthread_mutexattr_gettype
11574int main ()
11575{
11576 return (pthread_mutexattr_gettype != NULL);
11577}
11578EOF
11579 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
11580 || gl_cv_have_weak=no
11581 rm -f conftest1.c libempty.so conftest2.c conftest
11582 ;;
11583 esac
11584 ;;
11585 esac
5abebf3c 11586
c0c3707f 11587fi
5df4cba6
SM
11588{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
11589$as_echo "$gl_cv_have_weak" >&6; }
11590 case "$gl_cv_have_weak" in
11591 *yes)
5abebf3c 11592
5df4cba6 11593$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
5abebf3c 11594
5df4cba6
SM
11595 ;;
11596 esac
11597
11598 case "$gl_cv_have_weak" in
11599 *yes) LIB_SETLOCALE_NULL= ;;
11600 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
11601 esac
11602 ;;
11603 esac
5abebf3c 11604 else
5df4cba6 11605 LIB_SETLOCALE_NULL=
5abebf3c 11606 fi
5abebf3c
CB
11607
11608
11609
5abebf3c 11610
5abebf3c 11611
5df4cba6
SM
11612 GNULIB_SOCKET=0;
11613 GNULIB_CONNECT=0;
11614 GNULIB_ACCEPT=0;
11615 GNULIB_BIND=0;
11616 GNULIB_GETPEERNAME=0;
11617 GNULIB_GETSOCKNAME=0;
11618 GNULIB_GETSOCKOPT=0;
11619 GNULIB_LISTEN=0;
11620 GNULIB_RECV=0;
11621 GNULIB_SEND=0;
11622 GNULIB_RECVFROM=0;
11623 GNULIB_SENDTO=0;
11624 GNULIB_SETSOCKOPT=0;
11625 GNULIB_SHUTDOWN=0;
11626 GNULIB_ACCEPT4=0;
11627 HAVE_STRUCT_SOCKADDR_STORAGE=1;
11628 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
11629
11630 HAVE_SA_FAMILY_T=1;
11631 HAVE_ACCEPT4=1;
c0c3707f
CB
11632
11633
11634
11635
11636
5df4cba6
SM
11637 case "$host_os" in
11638 osf*)
c0c3707f 11639
5df4cba6 11640$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
c0c3707f 11641
5df4cba6
SM
11642 ;;
11643 esac
c0c3707f 11644
5df4cba6
SM
11645 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
11646$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
11647if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
5abebf3c
CB
11648 $as_echo_n "(cached) " >&6
11649else
5df4cba6
SM
11650
11651 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11652/* end confdefs.h. */
c0c3707f 11653#include <sys/socket.h>
c0c3707f
CB
11654int
11655main ()
11656{
5df4cba6 11657
c0c3707f
CB
11658 ;
11659 return 0;
11660}
11661_ACEOF
11662if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11663 gl_cv_header_sys_socket_h_selfcontained=yes
5abebf3c 11664else
5df4cba6 11665 gl_cv_header_sys_socket_h_selfcontained=no
5abebf3c 11666fi
c0c3707f 11667rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11668
5df4cba6
SM
11669fi
11670{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
11671$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
11672 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
11673 for ac_func in shutdown
11674do :
11675 ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
11676if test "x$ac_cv_func_shutdown" = xyes; then :
11677 cat >>confdefs.h <<_ACEOF
11678#define HAVE_SHUTDOWN 1
11679_ACEOF
c0c3707f 11680
5df4cba6
SM
11681fi
11682done
c0c3707f 11683
5df4cba6
SM
11684 if test $ac_cv_func_shutdown = yes; then
11685 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
11686$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
11687if ${gl_cv_header_sys_socket_h_shut+:} false; then :
5abebf3c
CB
11688 $as_echo_n "(cached) " >&6
11689else
5df4cba6
SM
11690
11691 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11692/* end confdefs.h. */
c0c3707f 11693#include <sys/socket.h>
c0c3707f
CB
11694int
11695main ()
11696{
5df4cba6 11697int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
c0c3707f
CB
11698 ;
11699 return 0;
11700}
11701_ACEOF
11702if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11703 gl_cv_header_sys_socket_h_shut=yes
c0c3707f 11704else
5df4cba6 11705 gl_cv_header_sys_socket_h_shut=no
c0c3707f
CB
11706fi
11707rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11708
5df4cba6
SM
11709fi
11710{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
11711$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
11712 if test $gl_cv_header_sys_socket_h_shut = no; then
11713 SYS_SOCKET_H='sys/socket.h'
11714 fi
11715 fi
c0c3707f 11716 fi
5df4cba6 11717 # We need to check for ws2tcpip.h now.
5abebf3c 11718
5abebf3c 11719
5abebf3c 11720
5abebf3c
CB
11721
11722
11723
11724
c0c3707f
CB
11725
11726
11727
11728
11729 if test $gl_cv_have_include_next = yes; then
5df4cba6 11730 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11731 else
5df4cba6
SM
11732 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
11733$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
11734if ${gl_cv_next_sys_socket_h+:} false; then :
5abebf3c
CB
11735 $as_echo_n "(cached) " >&6
11736else
5abebf3c 11737
5df4cba6 11738 if test $ac_cv_header_sys_socket_h = yes; then
5abebf3c 11739
5abebf3c
CB
11740
11741
c0c3707f
CB
11742
11743 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11744/* end confdefs.h. */
5df4cba6 11745#include <sys/socket.h>
c0c3707f
CB
11746_ACEOF
11747 case "$host_os" in
11748 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11749 *) gl_absname_cpp="$ac_cpp" ;;
11750 esac
11751
11752 case "$host_os" in
11753 mingw*)
11754 gl_dirsep_regex='[/\\]'
5abebf3c
CB
11755 ;;
11756 *)
c0c3707f 11757 gl_dirsep_regex='\/'
5abebf3c
CB
11758 ;;
11759 esac
c0c3707f 11760 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
5df4cba6 11761 gl_header_literal_regex=`echo 'sys/socket.h' \
c0c3707f
CB
11762 | sed -e "$gl_make_literal_regex_sed"`
11763 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11764 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11765 s|^/[^/]|//&|
11766 p
11767 q
11768 }'
5abebf3c 11769
5df4cba6 11770 gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
c0c3707f 11771 sed -n "$gl_absolute_header_sed"`
5abebf3c 11772
5df4cba6
SM
11773 gl_header=$gl_cv_absolute_sys_socket_h
11774 gl_cv_next_sys_socket_h='"'$gl_header'"'
c0c3707f 11775 else
5df4cba6 11776 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11777 fi
5abebf3c 11778
5abebf3c 11779
5abebf3c 11780fi
5df4cba6
SM
11781{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
11782$as_echo "$gl_cv_next_sys_socket_h" >&6; }
c0c3707f 11783 fi
5df4cba6 11784 NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
c0c3707f
CB
11785
11786 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11787 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
5df4cba6 11788 gl_next_as_first_directive='<'sys/socket.h'>'
c0c3707f
CB
11789 else
11790 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
5df4cba6 11791 gl_next_as_first_directive=$gl_cv_next_sys_socket_h
c0c3707f 11792 fi
5df4cba6 11793 NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
5abebf3c
CB
11794
11795
c0c3707f
CB
11796
11797
5df4cba6
SM
11798 if test $ac_cv_header_sys_socket_h = yes; then
11799 HAVE_SYS_SOCKET_H=1
11800 else
11801 HAVE_SYS_SOCKET_H=0
11802 fi
c0c3707f 11803
5abebf3c 11804
c0c3707f 11805
5df4cba6
SM
11806 if test $ac_cv_header_sys_socket_h = yes; then
11807 HAVE_WS2TCPIP_H=0
11808 else
11809 if test $ac_cv_header_ws2tcpip_h = yes; then
11810 HAVE_WS2TCPIP_H=1
11811 else
11812 HAVE_WS2TCPIP_H=0
11813 fi
11814 fi
11815
11816
11817
11818 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
11819 /* sys/types.h is not needed according to POSIX, but the
11820 sys/socket.h in i386-unknown-freebsd4.10 and
11821 powerpc-apple-darwin5.5 required it. */
11822#include <sys/types.h>
11823#ifdef HAVE_SYS_SOCKET_H
11824#include <sys/socket.h>
11825#endif
11826#ifdef HAVE_WS2TCPIP_H
11827#include <ws2tcpip.h>
11828#endif
11829
11830"
11831if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
11832
11833cat >>confdefs.h <<_ACEOF
11834#define HAVE_STRUCT_SOCKADDR_STORAGE 1
5abebf3c 11835_ACEOF
5df4cba6
SM
11836
11837
5abebf3c 11838fi
5df4cba6
SM
11839ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
11840 /* sys/types.h is not needed according to POSIX, but the
11841 sys/socket.h in i386-unknown-freebsd4.10 and
11842 powerpc-apple-darwin5.5 required it. */
11843#include <sys/types.h>
11844#ifdef HAVE_SYS_SOCKET_H
11845#include <sys/socket.h>
11846#endif
11847#ifdef HAVE_WS2TCPIP_H
11848#include <ws2tcpip.h>
11849#endif
11850
11851"
11852if test "x$ac_cv_type_sa_family_t" = xyes; then :
11853
11854cat >>confdefs.h <<_ACEOF
11855#define HAVE_SA_FAMILY_T 1
11856_ACEOF
11857
11858
5abebf3c 11859fi
5df4cba6
SM
11860
11861 if test $ac_cv_type_struct_sockaddr_storage = no; then
11862 HAVE_STRUCT_SOCKADDR_STORAGE=0
11863 fi
11864 if test $ac_cv_type_sa_family_t = no; then
11865 HAVE_SA_FAMILY_T=0
c0c3707f 11866 fi
5df4cba6
SM
11867 if test $ac_cv_type_struct_sockaddr_storage != no; then
11868 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
11869 #ifdef HAVE_SYS_SOCKET_H
11870 #include <sys/socket.h>
11871 #endif
11872 #ifdef HAVE_WS2TCPIP_H
11873 #include <ws2tcpip.h>
11874 #endif
11875
11876"
11877if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
11878
11879cat >>confdefs.h <<_ACEOF
11880#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
11881_ACEOF
11882
5abebf3c 11883
5abebf3c 11884else
5df4cba6 11885 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
5abebf3c
CB
11886fi
11887
5df4cba6
SM
11888 fi
11889 if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
11890 || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
11891 SYS_SOCKET_H='sys/socket.h'
11892 fi
5abebf3c 11893
5abebf3c 11894
5df4cba6
SM
11895
11896
11897 if test $ac_cv_header_sys_socket_h != yes; then
11898 for ac_header in winsock2.h
11899do :
11900 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
11901if test "x$ac_cv_header_winsock2_h" = xyes; then :
11902 cat >>confdefs.h <<_ACEOF
11903#define HAVE_WINSOCK2_H 1
11904_ACEOF
11905
11906fi
11907
11908done
11909
11910 fi
11911 if test "$ac_cv_header_winsock2_h" = yes; then
11912 HAVE_WINSOCK2_H=1
11913 UNISTD_H_HAVE_WINSOCK2_H=1
11914 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
11915 else
11916 HAVE_WINSOCK2_H=0
11917 fi
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
698be2d8
CB
11931
11932
5df4cba6
SM
11933 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
11934$as_echo_n "checking for IPv4 sockets... " >&6; }
11935if ${gl_cv_socket_ipv4+:} false; then :
5abebf3c
CB
11936 $as_echo_n "(cached) " >&6
11937else
c0c3707f 11938 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11939/* end confdefs.h. */
5df4cba6
SM
11940#include <sys/types.h>
11941#ifdef HAVE_SYS_SOCKET_H
11942#include <sys/socket.h>
11943#endif
11944#ifdef HAVE_NETINET_IN_H
11945#include <netinet/in.h>
11946#endif
11947#ifdef HAVE_WINSOCK2_H
11948#include <winsock2.h>
11949#endif
5abebf3c
CB
11950int
11951main ()
11952{
5df4cba6
SM
11953int x = AF_INET; struct in_addr y; struct sockaddr_in z;
11954 if (&x && &y && &z) return 0;
5abebf3c
CB
11955 ;
11956 return 0;
11957}
11958_ACEOF
c0c3707f 11959if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11960 gl_cv_socket_ipv4=yes
5abebf3c 11961else
5df4cba6 11962 gl_cv_socket_ipv4=no
5abebf3c 11963fi
c0c3707f 11964rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11965fi
5df4cba6
SM
11966{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
11967$as_echo "$gl_cv_socket_ipv4" >&6; }
11968 if test $gl_cv_socket_ipv4 = yes; then
5abebf3c 11969
5df4cba6 11970$as_echo "#define HAVE_IPV4 1" >>confdefs.h
5abebf3c 11971
5df4cba6 11972 fi
5abebf3c 11973
5df4cba6
SM
11974 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
11975$as_echo_n "checking for IPv6 sockets... " >&6; }
11976if ${gl_cv_socket_ipv6+:} false; then :
5abebf3c
CB
11977 $as_echo_n "(cached) " >&6
11978else
c0c3707f 11979 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11980/* end confdefs.h. */
5df4cba6
SM
11981#include <sys/types.h>
11982#ifdef HAVE_SYS_SOCKET_H
11983#include <sys/socket.h>
5abebf3c 11984#endif
5df4cba6
SM
11985#ifdef HAVE_NETINET_IN_H
11986#include <netinet/in.h>
11987#endif
11988#ifdef HAVE_WINSOCK2_H
11989#include <winsock2.h>
11990#endif
11991#ifdef HAVE_WS2TCPIP_H
11992#include <ws2tcpip.h>
11993#endif
11994int
11995main ()
11996{
11997int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
11998 if (&x && &y && &z) return 0;
11999 ;
12000 return 0;
12001}
12002_ACEOF
12003if ac_fn_c_try_compile "$LINENO"; then :
12004 gl_cv_socket_ipv6=yes
12005else
12006 gl_cv_socket_ipv6=no
12007fi
12008rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12009fi
12010{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
12011$as_echo "$gl_cv_socket_ipv6" >&6; }
12012 if test $gl_cv_socket_ipv6 = yes; then
12013
12014$as_echo "#define HAVE_IPV6 1" >>confdefs.h
12015
12016 fi
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030 if test $gl_cv_have_include_next = yes; then
12031 gl_cv_next_limits_h='<'limits.h'>'
12032 else
12033 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
12034$as_echo_n "checking absolute name of <limits.h>... " >&6; }
12035if ${gl_cv_next_limits_h+:} false; then :
12036 $as_echo_n "(cached) " >&6
12037else
12038
12039 if test $ac_cv_header_limits_h = yes; then
12040
12041
12042
12043
12044 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12045/* end confdefs.h. */
12046#include <limits.h>
12047_ACEOF
12048 case "$host_os" in
12049 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12050 *) gl_absname_cpp="$ac_cpp" ;;
12051 esac
12052
12053 case "$host_os" in
12054 mingw*)
12055 gl_dirsep_regex='[/\\]'
12056 ;;
12057 *)
12058 gl_dirsep_regex='\/'
12059 ;;
12060 esac
12061 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12062 gl_header_literal_regex=`echo 'limits.h' \
12063 | sed -e "$gl_make_literal_regex_sed"`
12064 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12065 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12066 s|^/[^/]|//&|
12067 p
12068 q
12069 }'
12070
12071 gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12072 sed -n "$gl_absolute_header_sed"`
12073
12074 gl_header=$gl_cv_absolute_limits_h
12075 gl_cv_next_limits_h='"'$gl_header'"'
12076 else
12077 gl_cv_next_limits_h='<'limits.h'>'
12078 fi
12079
12080
12081fi
12082{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
12083$as_echo "$gl_cv_next_limits_h" >&6; }
12084 fi
12085 NEXT_LIMITS_H=$gl_cv_next_limits_h
12086
12087 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12088 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12089 gl_next_as_first_directive='<'limits.h'>'
12090 else
12091 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12092 gl_next_as_first_directive=$gl_cv_next_limits_h
12093 fi
12094 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
12095
12096
12097
12098
12099
12100 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
12101$as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
12102if ${gl_cv_header_limits_width+:} false; then :
12103 $as_echo_n "(cached) " >&6
12104else
12105 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12106/* end confdefs.h. */
12107#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
12108 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
12109 #endif
12110 #include <limits.h>
12111 long long llm = LLONG_MAX;
12112 int wb = WORD_BIT;
12113 int ullw = ULLONG_WIDTH;
c0c3707f 12114
5abebf3c
CB
12115int
12116main ()
12117{
c0c3707f 12118
5abebf3c
CB
12119 ;
12120 return 0;
12121}
12122_ACEOF
c0c3707f 12123if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 12124 gl_cv_header_limits_width=yes
5abebf3c 12125else
5df4cba6 12126 gl_cv_header_limits_width=no
5abebf3c 12127fi
c0c3707f 12128rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 12129fi
5df4cba6
SM
12130{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
12131$as_echo "$gl_cv_header_limits_width" >&6; }
12132 if test "$gl_cv_header_limits_width" = yes; then
12133 LIMITS_H=
c0c3707f 12134 else
5df4cba6 12135 LIMITS_H=limits.h
c0c3707f 12136 fi
5abebf3c 12137
5df4cba6
SM
12138 if test -n "$LIMITS_H"; then
12139 GL_GENERATE_LIMITS_H_TRUE=
12140 GL_GENERATE_LIMITS_H_FALSE='#'
12141else
12142 GL_GENERATE_LIMITS_H_TRUE='#'
12143 GL_GENERATE_LIMITS_H_FALSE=
12144fi
c0c3707f
CB
12145
12146
5abebf3c 12147
5df4cba6
SM
12148 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
12149$as_echo_n "checking for wint_t... " >&6; }
12150if ${gt_cv_c_wint_t+:} false; then :
c0c3707f 12151 $as_echo_n "(cached) " >&6
c0c3707f
CB
12152else
12153 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 12154/* end confdefs.h. */
5df4cba6
SM
12155#include <wchar.h>
12156 wint_t foo = (wchar_t)'\0';
5abebf3c
CB
12157int
12158main ()
12159{
5df4cba6 12160
5abebf3c
CB
12161 ;
12162 return 0;
12163}
12164_ACEOF
5df4cba6
SM
12165if ac_fn_c_try_compile "$LINENO"; then :
12166 gt_cv_c_wint_t=yes
c0c3707f 12167else
5df4cba6 12168 gt_cv_c_wint_t=no
c0c3707f 12169fi
5df4cba6 12170rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 12171fi
5df4cba6
SM
12172{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
12173$as_echo "$gt_cv_c_wint_t" >&6; }
12174 if test $gt_cv_c_wint_t = yes; then
5abebf3c 12175
5df4cba6 12176$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
5abebf3c
CB
12177
12178
9c9d63b1
PM
12179 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is large enough" >&5
12180$as_echo_n "checking whether wint_t is large enough... " >&6; }
12181if ${gl_cv_type_wint_t_large_enough+:} false; then :
5df4cba6
SM
12182 $as_echo_n "(cached) " >&6
12183else
12184 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12185/* end confdefs.h. */
5df4cba6 12186#include <wchar.h>
9c9d63b1 12187 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
5df4cba6
SM
12188
12189int
12190main ()
12191{
12192
12193 ;
12194 return 0;
12195}
12196_ACEOF
12197if ac_fn_c_try_compile "$LINENO"; then :
9c9d63b1 12198 gl_cv_type_wint_t_large_enough=yes
5df4cba6 12199else
9c9d63b1 12200 gl_cv_type_wint_t_large_enough=no
5df4cba6
SM
12201fi
12202rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12203fi
9c9d63b1
PM
12204{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_large_enough" >&5
12205$as_echo "$gl_cv_type_wint_t_large_enough" >&6; }
12206 if test $gl_cv_type_wint_t_large_enough = no; then
5df4cba6
SM
12207 GNULIB_OVERRIDES_WINT_T=1
12208 else
12209 GNULIB_OVERRIDES_WINT_T=0
12210 fi
12211 else
12212 GNULIB_OVERRIDES_WINT_T=0
c0c3707f 12213 fi
5abebf3c 12214
5abebf3c
CB
12215
12216
12217
12218
12219
5df4cba6 12220
9c9d63b1
PM
12221
12222
12223 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler produces multi-arch binaries" >&5
12224$as_echo_n "checking whether the compiler produces multi-arch binaries... " >&6; }
12225if ${gl_cv_c_multiarch+:} false; then :
12226 $as_echo_n "(cached) " >&6
12227else
12228 gl_cv_c_multiarch=no
12229 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f
CB
12230/* end confdefs.h. */
12231#ifndef __APPLE_CC__
9c9d63b1
PM
12232 not a universal capable compiler
12233 #endif
12234 typedef int dummy;
5abebf3c 12235
c0c3707f
CB
12236_ACEOF
12237if ac_fn_c_try_compile "$LINENO"; then :
5abebf3c 12238
9c9d63b1
PM
12239 arch=
12240 prev=
12241 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
12242 if test -n "$prev"; then
12243 case $word in
12244 i?86 | x86_64 | ppc | ppc64 | arm | arm64)
12245 if test -z "$arch" || test "$arch" = "$word"; then
12246 arch="$word"
12247 else
12248 gl_cv_c_multiarch=yes
12249 fi
12250 ;;
12251 esac
12252 prev=
12253 else
12254 if test "x$word" = "x-arch"; then
12255 prev=arch
12256 fi
12257 fi
12258 done
5abebf3c 12259
c0c3707f
CB
12260fi
12261rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1
PM
12262
12263fi
12264{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_multiarch" >&5
12265$as_echo "$gl_cv_c_multiarch" >&6; }
c0c3707f
CB
12266 if test $gl_cv_c_multiarch = yes; then
12267 APPLE_UNIVERSAL_BUILD=1
12268 else
12269 APPLE_UNIVERSAL_BUILD=0
12270 fi
5abebf3c 12271
5abebf3c 12272
5abebf3c 12273
5abebf3c
CB
12274
12275
5abebf3c 12276
5abebf3c 12277
5abebf3c 12278
5df4cba6 12279$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 12280
5abebf3c 12281
5df4cba6 12282$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 12283
c0c3707f
CB
12284
12285
12286 if test $ac_cv_header_wchar_h = yes; then
12287 HAVE_WCHAR_H=1
12288 else
12289 HAVE_WCHAR_H=0
5abebf3c 12290 fi
c0c3707f
CB
12291
12292
9c9d63b1
PM
12293
12294 if test $ac_cv_header_inttypes_h = yes; then
c0c3707f
CB
12295 HAVE_INTTYPES_H=1
12296 else
12297 HAVE_INTTYPES_H=0
5abebf3c
CB
12298 fi
12299
12300
9c9d63b1
PM
12301
12302 if test $ac_cv_header_sys_types_h = yes; then
c0c3707f
CB
12303 HAVE_SYS_TYPES_H=1
12304 else
12305 HAVE_SYS_TYPES_H=0
12306 fi
12307
5abebf3c
CB
12308
12309
12310
12311
5abebf3c 12312
5abebf3c 12313
5abebf3c 12314
5abebf3c 12315
5abebf3c
CB
12316
12317
c0c3707f
CB
12318 if test $gl_cv_have_include_next = yes; then
12319 gl_cv_next_stdint_h='<'stdint.h'>'
12320 else
12321 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
12322$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
12323if ${gl_cv_next_stdint_h+:} false; then :
12324 $as_echo_n "(cached) " >&6
12325else
5abebf3c 12326
c0c3707f 12327 if test $ac_cv_header_stdint_h = yes; then
5abebf3c 12328
5abebf3c
CB
12329
12330
12331
c0c3707f 12332 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 12333/* end confdefs.h. */
c0c3707f 12334#include <stdint.h>
5abebf3c 12335_ACEOF
c0c3707f
CB
12336 case "$host_os" in
12337 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12338 *) gl_absname_cpp="$ac_cpp" ;;
12339 esac
5abebf3c 12340
c0c3707f
CB
12341 case "$host_os" in
12342 mingw*)
12343 gl_dirsep_regex='[/\\]'
12344 ;;
12345 *)
12346 gl_dirsep_regex='\/'
12347 ;;
12348 esac
12349 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12350 gl_header_literal_regex=`echo 'stdint.h' \
12351 | sed -e "$gl_make_literal_regex_sed"`
12352 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12353 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12354 s|^/[^/]|//&|
12355 p
12356 q
12357 }'
5abebf3c 12358
c0c3707f
CB
12359 gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12360 sed -n "$gl_absolute_header_sed"`
5abebf3c 12361
c0c3707f
CB
12362 gl_header=$gl_cv_absolute_stdint_h
12363 gl_cv_next_stdint_h='"'$gl_header'"'
12364 else
12365 gl_cv_next_stdint_h='<'stdint.h'>'
12366 fi
5abebf3c 12367
5abebf3c 12368
c0c3707f
CB
12369fi
12370{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
12371$as_echo "$gl_cv_next_stdint_h" >&6; }
12372 fi
12373 NEXT_STDINT_H=$gl_cv_next_stdint_h
5abebf3c 12374
c0c3707f
CB
12375 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12376 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12377 gl_next_as_first_directive='<'stdint.h'>'
12378 else
12379 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12380 gl_next_as_first_directive=$gl_cv_next_stdint_h
12381 fi
12382 NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
5abebf3c 12383
5e8754f9 12384
5e8754f9 12385
5e8754f9 12386
c0c3707f
CB
12387 if test $ac_cv_header_stdint_h = yes; then
12388 HAVE_STDINT_H=1
12389 else
12390 HAVE_STDINT_H=0
12391 fi
5e8754f9
SDJ
12392
12393
c0c3707f
CB
12394 if test $ac_cv_header_stdint_h = yes; then
12395 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
12396$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
12397if ${gl_cv_header_working_stdint_h+:} false; then :
12398 $as_echo_n "(cached) " >&6
12399else
12400 gl_cv_header_working_stdint_h=no
12401 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12402/* end confdefs.h. */
5e8754f9 12403
5e8754f9 12404
c0c3707f
CB
12405#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12406#define __STDC_CONSTANT_MACROS 1
12407#define __STDC_LIMIT_MACROS 1
12408#include <stdint.h>
12409/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
12410#if !(defined WCHAR_MIN && defined WCHAR_MAX)
12411#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
12412#endif
5e8754f9
SDJ
12413
12414
c0c3707f
CB
12415 #include <stddef.h>
12416 #include <signal.h>
12417 #if HAVE_WCHAR_H
c0c3707f
CB
12418 # include <wchar.h>
12419 #endif
f45c62c4
YQ
12420
12421
c0c3707f
CB
12422#ifdef INT8_MAX
12423int8_t a1 = INT8_MAX;
12424int8_t a1min = INT8_MIN;
12425#endif
12426#ifdef INT16_MAX
12427int16_t a2 = INT16_MAX;
12428int16_t a2min = INT16_MIN;
12429#endif
12430#ifdef INT32_MAX
12431int32_t a3 = INT32_MAX;
12432int32_t a3min = INT32_MIN;
12433#endif
12434#ifdef INT64_MAX
12435int64_t a4 = INT64_MAX;
12436int64_t a4min = INT64_MIN;
12437#endif
12438#ifdef UINT8_MAX
12439uint8_t b1 = UINT8_MAX;
12440#else
12441typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
12442#endif
12443#ifdef UINT16_MAX
12444uint16_t b2 = UINT16_MAX;
12445#endif
12446#ifdef UINT32_MAX
12447uint32_t b3 = UINT32_MAX;
12448#endif
12449#ifdef UINT64_MAX
12450uint64_t b4 = UINT64_MAX;
12451#endif
12452int_least8_t c1 = INT8_C (0x7f);
12453int_least8_t c1max = INT_LEAST8_MAX;
12454int_least8_t c1min = INT_LEAST8_MIN;
12455int_least16_t c2 = INT16_C (0x7fff);
12456int_least16_t c2max = INT_LEAST16_MAX;
12457int_least16_t c2min = INT_LEAST16_MIN;
12458int_least32_t c3 = INT32_C (0x7fffffff);
12459int_least32_t c3max = INT_LEAST32_MAX;
12460int_least32_t c3min = INT_LEAST32_MIN;
12461int_least64_t c4 = INT64_C (0x7fffffffffffffff);
12462int_least64_t c4max = INT_LEAST64_MAX;
12463int_least64_t c4min = INT_LEAST64_MIN;
12464uint_least8_t d1 = UINT8_C (0xff);
12465uint_least8_t d1max = UINT_LEAST8_MAX;
12466uint_least16_t d2 = UINT16_C (0xffff);
12467uint_least16_t d2max = UINT_LEAST16_MAX;
12468uint_least32_t d3 = UINT32_C (0xffffffff);
12469uint_least32_t d3max = UINT_LEAST32_MAX;
12470uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
12471uint_least64_t d4max = UINT_LEAST64_MAX;
12472int_fast8_t e1 = INT_FAST8_MAX;
12473int_fast8_t e1min = INT_FAST8_MIN;
12474int_fast16_t e2 = INT_FAST16_MAX;
12475int_fast16_t e2min = INT_FAST16_MIN;
12476int_fast32_t e3 = INT_FAST32_MAX;
12477int_fast32_t e3min = INT_FAST32_MIN;
12478int_fast64_t e4 = INT_FAST64_MAX;
12479int_fast64_t e4min = INT_FAST64_MIN;
12480uint_fast8_t f1 = UINT_FAST8_MAX;
12481uint_fast16_t f2 = UINT_FAST16_MAX;
12482uint_fast32_t f3 = UINT_FAST32_MAX;
12483uint_fast64_t f4 = UINT_FAST64_MAX;
12484#ifdef INTPTR_MAX
12485intptr_t g = INTPTR_MAX;
12486intptr_t gmin = INTPTR_MIN;
12487#endif
12488#ifdef UINTPTR_MAX
12489uintptr_t h = UINTPTR_MAX;
12490#endif
12491intmax_t i = INTMAX_MAX;
12492uintmax_t j = UINTMAX_MAX;
472fa5ee 12493
c0c3707f
CB
12494/* Check that SIZE_MAX has the correct type, if possible. */
12495#if 201112 <= __STDC_VERSION__
12496int k = _Generic (SIZE_MAX, size_t: 0);
9c9d63b1 12497#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
c0c3707f
CB
12498 || (0x5110 <= __SUNPRO_C && !__STDC__))
12499extern size_t k;
12500extern __typeof__ (SIZE_MAX) k;
12501#endif
472fa5ee 12502
c0c3707f
CB
12503#include <limits.h> /* for CHAR_BIT */
12504#define TYPE_MINIMUM(t) \
12505 ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
12506#define TYPE_MAXIMUM(t) \
12507 ((t) ((t) 0 < (t) -1 \
12508 ? (t) -1 \
12509 : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
12510struct s {
12511 int check_PTRDIFF:
12512 PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
12513 && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
12514 ? 1 : -1;
12515 /* Detect bug in FreeBSD 6.0 / ia64. */
12516 int check_SIG_ATOMIC:
12517 SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
12518 && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
12519 ? 1 : -1;
12520 int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
12521 int check_WCHAR:
12522 WCHAR_MIN == TYPE_MINIMUM (wchar_t)
12523 && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
12524 ? 1 : -1;
12525 /* Detect bug in mingw. */
12526 int check_WINT:
12527 WINT_MIN == TYPE_MINIMUM (wint_t)
12528 && WINT_MAX == TYPE_MAXIMUM (wint_t)
12529 ? 1 : -1;
472fa5ee 12530
c0c3707f
CB
12531 /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
12532 int check_UINT8_C:
12533 (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
12534 int check_UINT16_C:
12535 (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
f45c62c4 12536
c0c3707f
CB
12537 /* Detect bugs in OpenBSD 3.9 stdint.h. */
12538#ifdef UINT8_MAX
12539 int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
12540#endif
12541#ifdef UINT16_MAX
12542 int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
12543#endif
12544#ifdef UINT32_MAX
12545 int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
12546#endif
12547#ifdef UINT64_MAX
12548 int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
12549#endif
12550 int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
12551 int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
12552 int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
12553 int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
12554 int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
12555 int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
12556 int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
12557 int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
12558 int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
12559 int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
12560 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
12561};
6ec2e0f5 12562
f45c62c4
YQ
12563int
12564main ()
12565{
f45c62c4
YQ
12566
12567 ;
12568 return 0;
12569}
12570_ACEOF
6ec2e0f5 12571if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 12572 if test "$cross_compiling" = yes; then :
6a29c58e 12573 case "$host_os" in
c0c3707f
CB
12574 # Guess yes on native Windows.
12575 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
12576 # In general, assume it works.
12577 *) gl_cv_header_working_stdint_h="guessing yes" ;;
12578 esac
6a29c58e 12579
98399780
YQ
12580else
12581 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12582/* end confdefs.h. */
98399780
YQ
12583
12584
c0c3707f
CB
12585#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12586#define __STDC_CONSTANT_MACROS 1
12587#define __STDC_LIMIT_MACROS 1
12588#include <stdint.h>
98399780 12589
88b48903 12590
c0c3707f
CB
12591 #include <stddef.h>
12592 #include <signal.h>
12593 #if HAVE_WCHAR_H
c0c3707f
CB
12594 # include <wchar.h>
12595 #endif
88b48903 12596
472fa5ee 12597
c0c3707f
CB
12598#include <stdio.h>
12599#include <string.h>
12600#define MVAL(macro) MVAL1(macro)
12601#define MVAL1(expression) #expression
12602static const char *macro_values[] =
12603 {
12604#ifdef INT8_MAX
12605 MVAL (INT8_MAX),
12606#endif
12607#ifdef INT16_MAX
12608 MVAL (INT16_MAX),
12609#endif
12610#ifdef INT32_MAX
12611 MVAL (INT32_MAX),
12612#endif
12613#ifdef INT64_MAX
12614 MVAL (INT64_MAX),
12615#endif
12616#ifdef UINT8_MAX
12617 MVAL (UINT8_MAX),
12618#endif
12619#ifdef UINT16_MAX
12620 MVAL (UINT16_MAX),
12621#endif
12622#ifdef UINT32_MAX
12623 MVAL (UINT32_MAX),
12624#endif
12625#ifdef UINT64_MAX
12626 MVAL (UINT64_MAX),
12627#endif
12628 NULL
12629 };
472fa5ee 12630
c0c3707f
CB
12631int
12632main ()
12633{
472fa5ee 12634
c0c3707f
CB
12635 const char **mv;
12636 for (mv = macro_values; *mv != NULL; mv++)
12637 {
12638 const char *value = *mv;
12639 /* Test whether it looks like a cast expression. */
12640 if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
12641 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
12642 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
12643 || strncmp (value, "((int)"/*)*/, 6) == 0
12644 || strncmp (value, "((signed short)"/*)*/, 15) == 0
12645 || strncmp (value, "((signed char)"/*)*/, 14) == 0)
12646 return mv - macro_values + 1;
12647 }
12648 return 0;
12649
12650 ;
12651 return 0;
12652}
12653_ACEOF
12654if ac_fn_c_try_run "$LINENO"; then :
12655 gl_cv_header_working_stdint_h=yes
12656fi
12657rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12658 conftest.$ac_objext conftest.beam conftest.$ac_ext
12659fi
12660
12661
12662fi
12663rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 12664
c0c3707f
CB
12665fi
12666{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
12667$as_echo "$gl_cv_header_working_stdint_h" >&6; }
12668 fi
8690e634 12669
c0c3707f
CB
12670 HAVE_C99_STDINT_H=0
12671 HAVE_SYS_BITYPES_H=0
12672 HAVE_SYS_INTTYPES_H=0
12673 STDINT_H=stdint.h
12674 case "$gl_cv_header_working_stdint_h" in
12675 *yes)
12676 HAVE_C99_STDINT_H=1
9c9d63b1
PM
12677 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h works without ISO C predefines" >&5
12678$as_echo_n "checking whether stdint.h works without ISO C predefines... " >&6; }
12679if ${gl_cv_header_stdint_without_STDC_macros+:} false; then :
c0c3707f
CB
12680 $as_echo_n "(cached) " >&6
12681else
9c9d63b1 12682 gl_cv_header_stdint_without_STDC_macros=no
c0c3707f
CB
12683 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12684/* end confdefs.h. */
8690e634
JK
12685
12686
c0c3707f
CB
12687#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12688#include <stdint.h>
8690e634
JK
12689
12690
c0c3707f
CB
12691 #include <stddef.h>
12692 #include <signal.h>
12693 #if HAVE_WCHAR_H
c0c3707f
CB
12694 # include <wchar.h>
12695 #endif
8690e634
JK
12696
12697
c0c3707f
CB
12698intmax_t im = INTMAX_MAX;
12699int32_t i32 = INT32_C (0x7fffffff);
472fa5ee 12700
c0c3707f
CB
12701int
12702main ()
12703{
472fa5ee 12704
c0c3707f
CB
12705 ;
12706 return 0;
12707}
12708_ACEOF
12709if ac_fn_c_try_compile "$LINENO"; then :
9c9d63b1 12710 gl_cv_header_stdint_without_STDC_macros=yes
c0c3707f
CB
12711fi
12712rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1 12713
c0c3707f 12714fi
9c9d63b1
PM
12715{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_without_STDC_macros" >&5
12716$as_echo "$gl_cv_header_stdint_without_STDC_macros" >&6; }
472fa5ee 12717
9c9d63b1 12718 if test $gl_cv_header_stdint_without_STDC_macros = no; then
472fa5ee 12719
c0c3707f 12720$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
472fa5ee
SM
12721
12722
c0c3707f
CB
12723$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
12724
12725 fi
12726 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
12727$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
12728if ${gl_cv_header_stdint_width+:} false; then :
8690e634
JK
12729 $as_echo_n "(cached) " >&6
12730else
c0c3707f
CB
12731 gl_cv_header_stdint_width=no
12732 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12733/* end confdefs.h. */
12734
c0c3707f
CB
12735 /* Work if build is not clean. */
12736 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
12737 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
12738 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
12739 #endif
12740 #include <stdint.h>
12741
c0c3707f
CB
12742 #include <stddef.h>
12743 #include <signal.h>
12744 #if HAVE_WCHAR_H
c0c3707f
CB
12745 # include <wchar.h>
12746 #endif
12747
12748 int iw = UINTMAX_WIDTH;
12749
12750int
12751main ()
8690e634 12752{
c0c3707f
CB
12753
12754 ;
8690e634
JK
12755 return 0;
12756}
8690e634 12757_ACEOF
c0c3707f
CB
12758if ac_fn_c_try_compile "$LINENO"; then :
12759 gl_cv_header_stdint_width=yes
12760fi
12761rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12762fi
12763{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
12764$as_echo "$gl_cv_header_stdint_width" >&6; }
12765 if test "$gl_cv_header_stdint_width" = yes; then
12766 STDINT_H=
12767 fi
12768 ;;
12769 *)
12770 for ac_header in sys/inttypes.h sys/bitypes.h
12771do :
12772 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12773ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
12774if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12775 cat >>confdefs.h <<_ACEOF
12776#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12777_ACEOF
12778
12779fi
12780
12781done
12782
12783 if test $ac_cv_header_sys_inttypes_h = yes; then
12784 HAVE_SYS_INTTYPES_H=1
12785 fi
12786 if test $ac_cv_header_sys_bitypes_h = yes; then
12787 HAVE_SYS_BITYPES_H=1
12788 fi
12789
12790
12791 if test $APPLE_UNIVERSAL_BUILD = 0; then
12792
12793
12794 for gltype in ptrdiff_t size_t ; do
12795 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12796$as_echo_n "checking for bit size of $gltype... " >&6; }
12797if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
12798 $as_echo_n "(cached) " >&6
12799else
12800 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
c0c3707f
CB
12801 #include <stddef.h>
12802 #include <signal.h>
12803 #if HAVE_WCHAR_H
c0c3707f
CB
12804 # include <wchar.h>
12805 #endif
12806
12807#include <limits.h>"; then :
12808
12809else
12810 result=unknown
12811fi
12812
12813 eval gl_cv_bitsizeof_${gltype}=\$result
12814
12815fi
12816eval ac_res=\$gl_cv_bitsizeof_${gltype}
12817 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12818$as_echo "$ac_res" >&6; }
12819 eval result=\$gl_cv_bitsizeof_${gltype}
12820 if test $result = unknown; then
12821 result=0
8690e634 12822 fi
c0c3707f
CB
12823 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12824 cat >>confdefs.h <<_ACEOF
12825#define BITSIZEOF_${GLTYPE} $result
12826_ACEOF
8690e634 12827
c0c3707f
CB
12828 eval BITSIZEOF_${GLTYPE}=\$result
12829 done
8690e634
JK
12830
12831
c0c3707f 12832 fi
8690e634
JK
12833
12834
c0c3707f
CB
12835 for gltype in sig_atomic_t wchar_t wint_t ; do
12836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12837$as_echo_n "checking for bit size of $gltype... " >&6; }
12838if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
8690e634
JK
12839 $as_echo_n "(cached) " >&6
12840else
c0c3707f 12841 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
c0c3707f
CB
12842 #include <stddef.h>
12843 #include <signal.h>
12844 #if HAVE_WCHAR_H
c0c3707f
CB
12845 # include <wchar.h>
12846 #endif
8690e634 12847
c0c3707f 12848#include <limits.h>"; then :
8690e634 12849
c0c3707f
CB
12850else
12851 result=unknown
12852fi
8690e634 12853
c0c3707f 12854 eval gl_cv_bitsizeof_${gltype}=\$result
8690e634
JK
12855
12856fi
c0c3707f
CB
12857eval ac_res=\$gl_cv_bitsizeof_${gltype}
12858 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12859$as_echo "$ac_res" >&6; }
12860 eval result=\$gl_cv_bitsizeof_${gltype}
12861 if test $result = unknown; then
12862 result=0
12863 fi
12864 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12865 cat >>confdefs.h <<_ACEOF
12866#define BITSIZEOF_${GLTYPE} $result
12867_ACEOF
12868
12869 eval BITSIZEOF_${GLTYPE}=\$result
12870 done
8690e634
JK
12871
12872
12873
12874
c0c3707f
CB
12875 for gltype in sig_atomic_t wchar_t wint_t ; do
12876 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
12877$as_echo_n "checking whether $gltype is signed... " >&6; }
12878if eval \${gl_cv_type_${gltype}_signed+:} false; then :
8690e634
JK
12879 $as_echo_n "(cached) " >&6
12880else
c0c3707f 12881 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12882/* end confdefs.h. */
12883
c0c3707f
CB
12884 #include <stddef.h>
12885 #include <signal.h>
12886 #if HAVE_WCHAR_H
c0c3707f
CB
12887 # include <wchar.h>
12888 #endif
12889
12890 int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
12891int
12892main ()
12893{
12894
12895 ;
8690e634
JK
12896 return 0;
12897}
c0c3707f
CB
12898_ACEOF
12899if ac_fn_c_try_compile "$LINENO"; then :
12900 result=yes
12901else
12902 result=no
12903fi
12904rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12905 eval gl_cv_type_${gltype}_signed=\$result
8690e634 12906
c0c3707f
CB
12907fi
12908eval ac_res=\$gl_cv_type_${gltype}_signed
12909 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12910$as_echo "$ac_res" >&6; }
12911 eval result=\$gl_cv_type_${gltype}_signed
12912 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12913 if test "$result" = yes; then
12914 cat >>confdefs.h <<_ACEOF
12915#define HAVE_SIGNED_${GLTYPE} 1
8690e634 12916_ACEOF
c0c3707f
CB
12917
12918 eval HAVE_SIGNED_${GLTYPE}=1
12919 else
12920 eval HAVE_SIGNED_${GLTYPE}=0
8690e634 12921 fi
c0c3707f
CB
12922 done
12923
12924
12925 gl_cv_type_ptrdiff_t_signed=yes
12926 gl_cv_type_size_t_signed=no
12927 if test $APPLE_UNIVERSAL_BUILD = 0; then
12928
12929
12930 for gltype in ptrdiff_t size_t ; do
12931 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12932$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
12933if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
12934 $as_echo_n "(cached) " >&6
12935else
12936 eval gl_cv_type_${gltype}_suffix=no
12937 eval result=\$gl_cv_type_${gltype}_signed
12938 if test "$result" = yes; then
12939 glsufu=
12940 else
12941 glsufu=u
12942 fi
12943 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
12944 case $glsuf in
12945 '') gltype1='int';;
12946 l) gltype1='long int';;
12947 ll) gltype1='long long int';;
12948 i64) gltype1='__int64';;
12949 u) gltype1='unsigned int';;
12950 ul) gltype1='unsigned long int';;
12951 ull) gltype1='unsigned long long int';;
12952 ui64)gltype1='unsigned __int64';;
12953 esac
12954 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12955/* end confdefs.h. */
12956
c0c3707f
CB
12957 #include <stddef.h>
12958 #include <signal.h>
12959 #if HAVE_WCHAR_H
c0c3707f
CB
12960 # include <wchar.h>
12961 #endif
8690e634 12962
c0c3707f
CB
12963 extern $gltype foo;
12964 extern $gltype1 foo;
12965int
12966main ()
12967{
12968
12969 ;
12970 return 0;
12971}
12972_ACEOF
12973if ac_fn_c_try_compile "$LINENO"; then :
12974 eval gl_cv_type_${gltype}_suffix=\$glsuf
8690e634 12975fi
c0c3707f
CB
12976rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12977 eval result=\$gl_cv_type_${gltype}_suffix
12978 test "$result" != no && break
12979 done
12980fi
12981eval ac_res=\$gl_cv_type_${gltype}_suffix
12982 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12983$as_echo "$ac_res" >&6; }
12984 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12985 eval result=\$gl_cv_type_${gltype}_suffix
12986 test "$result" = no && result=
12987 eval ${GLTYPE}_SUFFIX=\$result
12988 cat >>confdefs.h <<_ACEOF
12989#define ${GLTYPE}_SUFFIX $result
12990_ACEOF
8690e634 12991
c0c3707f 12992 done
8690e634
JK
12993
12994
c0c3707f 12995 fi
8690e634
JK
12996
12997
c0c3707f
CB
12998 for gltype in sig_atomic_t wchar_t wint_t ; do
12999 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
13000$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
13001if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
8690e634
JK
13002 $as_echo_n "(cached) " >&6
13003else
c0c3707f
CB
13004 eval gl_cv_type_${gltype}_suffix=no
13005 eval result=\$gl_cv_type_${gltype}_signed
13006 if test "$result" = yes; then
13007 glsufu=
13008 else
13009 glsufu=u
13010 fi
13011 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
13012 case $glsuf in
13013 '') gltype1='int';;
13014 l) gltype1='long int';;
13015 ll) gltype1='long long int';;
13016 i64) gltype1='__int64';;
13017 u) gltype1='unsigned int';;
13018 ul) gltype1='unsigned long int';;
13019 ull) gltype1='unsigned long long int';;
13020 ui64)gltype1='unsigned __int64';;
13021 esac
13022 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
13023/* end confdefs.h. */
13024
c0c3707f
CB
13025 #include <stddef.h>
13026 #include <signal.h>
13027 #if HAVE_WCHAR_H
c0c3707f
CB
13028 # include <wchar.h>
13029 #endif
13030
13031 extern $gltype foo;
13032 extern $gltype1 foo;
13033int
13034main ()
13035{
13036
13037 ;
5e8754f9 13038 return 0;
8690e634 13039}
c0c3707f
CB
13040_ACEOF
13041if ac_fn_c_try_compile "$LINENO"; then :
13042 eval gl_cv_type_${gltype}_suffix=\$glsuf
13043fi
13044rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13045 eval result=\$gl_cv_type_${gltype}_suffix
13046 test "$result" != no && break
13047 done
13048fi
13049eval ac_res=\$gl_cv_type_${gltype}_suffix
13050 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
13051$as_echo "$ac_res" >&6; }
13052 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
13053 eval result=\$gl_cv_type_${gltype}_suffix
13054 test "$result" = no && result=
13055 eval ${GLTYPE}_SUFFIX=\$result
13056 cat >>confdefs.h <<_ACEOF
13057#define ${GLTYPE}_SUFFIX $result
13058_ACEOF
13059
13060 done
13061
13062
13063
13064 if test $GNULIB_OVERRIDES_WINT_T = 1; then
13065 BITSIZEOF_WINT_T=32
13066 fi
13067
13068 ;;
13069 esac
8690e634 13070
8690e634 13071
c0c3707f
CB
13072
13073 LIMITS_H='limits.h'
13074 if test -n "$LIMITS_H"; then
13075 GL_GENERATE_LIMITS_H_TRUE=
13076 GL_GENERATE_LIMITS_H_FALSE='#'
13077else
13078 GL_GENERATE_LIMITS_H_TRUE='#'
13079 GL_GENERATE_LIMITS_H_FALSE=
8690e634 13080fi
6ec2e0f5
SDJ
13081
13082
13083
13084
13085
13086
13087
c0c3707f
CB
13088 if test -n "$STDINT_H"; then
13089 GL_GENERATE_STDINT_H_TRUE=
13090 GL_GENERATE_STDINT_H_FALSE='#'
13091else
13092 GL_GENERATE_STDINT_H_TRUE='#'
13093 GL_GENERATE_STDINT_H_FALSE=
13094fi
472fa5ee
SM
13095
13096
13097
c0c3707f
CB
13098 GNULIB_IMAXABS=0;
13099 GNULIB_IMAXDIV=0;
13100 GNULIB_STRTOIMAX=0;
13101 GNULIB_STRTOUMAX=0;
13102 HAVE_DECL_IMAXABS=1;
13103 HAVE_DECL_IMAXDIV=1;
13104 HAVE_DECL_STRTOIMAX=1;
13105 HAVE_DECL_STRTOUMAX=1;
13106 HAVE_IMAXDIV_T=1;
13107 REPLACE_STRTOIMAX=0;
13108 REPLACE_STRTOUMAX=0;
13109 INT32_MAX_LT_INTMAX_MAX=1;
13110 INT64_MAX_EQ_LONG_MAX='defined _LP64';
c0c3707f
CB
13111 PRIPTR_PREFIX=__PRIPTR_PREFIX;
13112 UINT32_MAX_LT_UINTMAX_MAX=1;
13113 UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
472fa5ee 13114
6ec2e0f5
SDJ
13115
13116
13117
13118
13119
6ec2e0f5
SDJ
13120
13121
6ec2e0f5 13122
6ec2e0f5 13123
6ec2e0f5 13124
6ec2e0f5 13125
6ec2e0f5 13126
c0c3707f
CB
13127
13128
13129 if test $gl_cv_have_include_next = yes; then
13130 gl_cv_next_inttypes_h='<'inttypes.h'>'
13131 else
13132 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
13133$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
13134if ${gl_cv_next_inttypes_h+:} false; then :
13135 $as_echo_n "(cached) " >&6
13136else
13137
13138 if test $ac_cv_header_inttypes_h = yes; then
13139
13140
13141
13142
13143 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13144/* end confdefs.h. */
13145#include <inttypes.h>
6ec2e0f5 13146_ACEOF
c0c3707f
CB
13147 case "$host_os" in
13148 aix*) gl_absname_cpp="$ac_cpp -C" ;;
13149 *) gl_absname_cpp="$ac_cpp" ;;
13150 esac
6ec2e0f5 13151
c0c3707f
CB
13152 case "$host_os" in
13153 mingw*)
13154 gl_dirsep_regex='[/\\]'
13155 ;;
13156 *)
13157 gl_dirsep_regex='\/'
13158 ;;
13159 esac
13160 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13161 gl_header_literal_regex=`echo 'inttypes.h' \
13162 | sed -e "$gl_make_literal_regex_sed"`
13163 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13164 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13165 s|^/[^/]|//&|
13166 p
13167 q
13168 }'
6ec2e0f5 13169
c0c3707f
CB
13170 gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13171 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 13172
c0c3707f
CB
13173 gl_header=$gl_cv_absolute_inttypes_h
13174 gl_cv_next_inttypes_h='"'$gl_header'"'
13175 else
13176 gl_cv_next_inttypes_h='<'inttypes.h'>'
13177 fi
6ec2e0f5 13178
6ec2e0f5 13179
c0c3707f
CB
13180fi
13181{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
13182$as_echo "$gl_cv_next_inttypes_h" >&6; }
13183 fi
13184 NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
6ec2e0f5 13185
c0c3707f
CB
13186 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13187 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13188 gl_next_as_first_directive='<'inttypes.h'>'
13189 else
13190 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13191 gl_next_as_first_directive=$gl_cv_next_inttypes_h
13192 fi
13193 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
6ec2e0f5 13194
472fa5ee
SM
13195
13196
13197
13198
13199
13200
472fa5ee
SM
13201
13202
13203
13204
6ec2e0f5 13205
698be2d8
CB
13206
13207
698be2d8
CB
13208
13209
5df4cba6
SM
13210 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
13211$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
13212if ${gl_cv_cc_double_expbit0+:} false; then :
13213 $as_echo_n "(cached) " >&6
13214else
13215
13216 if test "$cross_compiling" = yes; then :
13217
13218 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13219/* end confdefs.h. */
13220
13221#if defined arm || defined __arm || defined __arm__
13222 mixed_endianness
13223#endif
13224
13225_ACEOF
13226if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13227 $EGREP "mixed_endianness" >/dev/null 2>&1; then :
13228 gl_cv_cc_double_expbit0="unknown"
13229else
13230
13231 :
13232if ${ac_cv_c_bigendian+:} false; then :
13233 $as_echo_n "(cached) " >&6
13234else
13235 ac_cv_c_bigendian=unknown
13236 # See if we're dealing with a universal compiler.
13237 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13238/* end confdefs.h. */
13239#ifndef __APPLE_CC__
13240 not a universal capable compiler
13241 #endif
13242 typedef int dummy;
13243
13244_ACEOF
13245if ac_fn_c_try_compile "$LINENO"; then :
13246
13247 # Check for potential -arch flags. It is not universal unless
13248 # there are at least two -arch flags with different values.
13249 ac_arch=
13250 ac_prev=
13251 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13252 if test -n "$ac_prev"; then
13253 case $ac_word in
13254 i?86 | x86_64 | ppc | ppc64)
13255 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13256 ac_arch=$ac_word
13257 else
13258 ac_cv_c_bigendian=universal
13259 break
13260 fi
13261 ;;
13262 esac
13263 ac_prev=
13264 elif test "x$ac_word" = "x-arch"; then
13265 ac_prev=arch
13266 fi
13267 done
13268fi
13269rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13270 if test $ac_cv_c_bigendian = unknown; then
13271 # See if sys/param.h defines the BYTE_ORDER macro.
13272 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13273/* end confdefs.h. */
13274#include <sys/types.h>
13275 #include <sys/param.h>
13276
13277int
13278main ()
13279{
13280#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13281 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13282 && LITTLE_ENDIAN)
13283 bogus endian macros
13284 #endif
13285
13286 ;
13287 return 0;
13288}
13289_ACEOF
13290if ac_fn_c_try_compile "$LINENO"; then :
13291 # It does; now see whether it defined to BIG_ENDIAN or not.
13292 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13293/* end confdefs.h. */
13294#include <sys/types.h>
13295 #include <sys/param.h>
13296
13297int
13298main ()
13299{
13300#if BYTE_ORDER != BIG_ENDIAN
13301 not big endian
13302 #endif
13303
13304 ;
13305 return 0;
13306}
13307_ACEOF
13308if ac_fn_c_try_compile "$LINENO"; then :
13309 ac_cv_c_bigendian=yes
13310else
13311 ac_cv_c_bigendian=no
13312fi
13313rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13314fi
13315rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13316 fi
13317 if test $ac_cv_c_bigendian = unknown; then
13318 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13319 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13320/* end confdefs.h. */
13321#include <limits.h>
13322
13323int
13324main ()
13325{
13326#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13327 bogus endian macros
13328 #endif
13329
13330 ;
13331 return 0;
13332}
13333_ACEOF
13334if ac_fn_c_try_compile "$LINENO"; then :
13335 # It does; now see whether it defined to _BIG_ENDIAN or not.
13336 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13337/* end confdefs.h. */
13338#include <limits.h>
13339
13340int
13341main ()
13342{
13343#ifndef _BIG_ENDIAN
13344 not big endian
13345 #endif
13346
13347 ;
13348 return 0;
13349}
13350_ACEOF
13351if ac_fn_c_try_compile "$LINENO"; then :
13352 ac_cv_c_bigendian=yes
13353else
13354 ac_cv_c_bigendian=no
13355fi
13356rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13357fi
13358rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13359 fi
13360 if test $ac_cv_c_bigendian = unknown; then
13361 # Compile a test program.
13362 if test "$cross_compiling" = yes; then :
13363 # Try to guess by grepping values from an object file.
13364 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13365/* end confdefs.h. */
13366short int ascii_mm[] =
13367 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13368 short int ascii_ii[] =
13369 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13370 int use_ascii (int i) {
13371 return ascii_mm[i] + ascii_ii[i];
13372 }
13373 short int ebcdic_ii[] =
13374 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13375 short int ebcdic_mm[] =
13376 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13377 int use_ebcdic (int i) {
13378 return ebcdic_mm[i] + ebcdic_ii[i];
13379 }
13380 extern int foo;
13381
13382int
13383main ()
13384{
13385return use_ascii (foo) == use_ebcdic (foo);
13386 ;
13387 return 0;
13388}
13389_ACEOF
13390if ac_fn_c_try_compile "$LINENO"; then :
13391 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13392 ac_cv_c_bigendian=yes
13393 fi
13394 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13395 if test "$ac_cv_c_bigendian" = unknown; then
13396 ac_cv_c_bigendian=no
13397 else
13398 # finding both strings is unlikely to happen, but who knows?
13399 ac_cv_c_bigendian=unknown
13400 fi
13401 fi
13402fi
13403rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13404else
13405 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13406/* end confdefs.h. */
13407$ac_includes_default
13408int
13409main ()
13410{
13411
13412 /* Are we little or big endian? From Harbison&Steele. */
13413 union
13414 {
13415 long int l;
13416 char c[sizeof (long int)];
13417 } u;
13418 u.l = 1;
13419 return u.c[sizeof (long int) - 1] == 1;
13420
13421 ;
13422 return 0;
13423}
13424_ACEOF
13425if ac_fn_c_try_run "$LINENO"; then :
13426 ac_cv_c_bigendian=no
13427else
13428 ac_cv_c_bigendian=yes
13429fi
13430rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13431 conftest.$ac_objext conftest.beam conftest.$ac_ext
13432fi
13433
13434 fi
13435fi
13436:
13437 case $ac_cv_c_bigendian in #(
13438 yes)
13439 gl_cv_cc_double_expbit0="word 0 bit 20";; #(
13440 no)
13441 gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
13442 universal)
13443
13444$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13445
13446 ;; #(
13447 *)
13448 gl_cv_cc_double_expbit0="unknown" ;;
13449 esac
13450
13451
13452fi
13453rm -f conftest*
13454
13455
13456else
13457 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13458/* end confdefs.h. */
13459
13460#include <float.h>
13461#include <stddef.h>
13462#include <stdio.h>
13463#include <string.h>
13464#define NWORDS \
13465 ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
13466typedef union { double value; unsigned int word[NWORDS]; } memory_double;
13467static unsigned int ored_words[NWORDS];
13468static unsigned int anded_words[NWORDS];
13469static void add_to_ored_words (double x)
13470{
13471 memory_double m;
13472 size_t i;
13473 /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
13474 memset (&m, 0, sizeof (memory_double));
13475 m.value = x;
13476 for (i = 0; i < NWORDS; i++)
13477 {
13478 ored_words[i] |= m.word[i];
13479 anded_words[i] &= m.word[i];
13480 }
13481}
13482int main ()
13483{
13484 size_t j;
13485 FILE *fp = fopen ("conftest.out", "w");
13486 if (fp == NULL)
13487 return 1;
13488 for (j = 0; j < NWORDS; j++)
13489 anded_words[j] = ~ (unsigned int) 0;
13490 add_to_ored_words (0.25);
13491 add_to_ored_words (0.5);
13492 add_to_ored_words (1.0);
13493 add_to_ored_words (2.0);
13494 add_to_ored_words (4.0);
13495 /* Remove bits that are common (e.g. if representation of the first mantissa
13496 bit is explicit). */
13497 for (j = 0; j < NWORDS; j++)
13498 ored_words[j] &= ~anded_words[j];
13499 /* Now find the nonzero word. */
13500 for (j = 0; j < NWORDS; j++)
13501 if (ored_words[j] != 0)
13502 break;
13503 if (j < NWORDS)
13504 {
13505 size_t i;
13506 for (i = j + 1; i < NWORDS; i++)
13507 if (ored_words[i] != 0)
13508 {
13509 fprintf (fp, "unknown");
13510 return (fclose (fp) != 0);
13511 }
13512 for (i = 0; ; i++)
13513 if ((ored_words[j] >> i) & 1)
13514 {
13515 fprintf (fp, "word %d bit %d", (int) j, (int) i);
13516 return (fclose (fp) != 0);
13517 }
13518 }
13519 fprintf (fp, "unknown");
13520 return (fclose (fp) != 0);
13521}
13522
13523_ACEOF
13524if ac_fn_c_try_run "$LINENO"; then :
13525 gl_cv_cc_double_expbit0=`cat conftest.out`
13526else
13527 gl_cv_cc_double_expbit0="unknown"
6ec2e0f5 13528fi
5df4cba6
SM
13529rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13530 conftest.$ac_objext conftest.beam conftest.$ac_ext
13531fi
13532
13533 rm -f conftest.out
6ec2e0f5
SDJ
13534
13535fi
5df4cba6
SM
13536{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
13537$as_echo "$gl_cv_cc_double_expbit0" >&6; }
13538 case "$gl_cv_cc_double_expbit0" in
13539 word*bit*)
13540 word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
13541 bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
6ec2e0f5
SDJ
13542
13543cat >>confdefs.h <<_ACEOF
5df4cba6 13544#define DBL_EXPBIT0_WORD $word
6ec2e0f5
SDJ
13545_ACEOF
13546
c0c3707f 13547
5df4cba6
SM
13548cat >>confdefs.h <<_ACEOF
13549#define DBL_EXPBIT0_BIT $bit
13550_ACEOF
6ec2e0f5 13551
5df4cba6
SM
13552 ;;
13553 esac
6ec2e0f5 13554
6ec2e0f5 13555
5df4cba6
SM
13556 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
13557$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
c0c3707f
CB
13558if ${ac_cv_c_bigendian+:} false; then :
13559 $as_echo_n "(cached) " >&6
6ec2e0f5 13560else
c0c3707f
CB
13561 ac_cv_c_bigendian=unknown
13562 # See if we're dealing with a universal compiler.
13563 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13564/* end confdefs.h. */
c0c3707f
CB
13565#ifndef __APPLE_CC__
13566 not a universal capable compiler
13567 #endif
13568 typedef int dummy;
6ec2e0f5 13569
c0c3707f
CB
13570_ACEOF
13571if ac_fn_c_try_compile "$LINENO"; then :
13572
13573 # Check for potential -arch flags. It is not universal unless
13574 # there are at least two -arch flags with different values.
13575 ac_arch=
13576 ac_prev=
13577 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13578 if test -n "$ac_prev"; then
13579 case $ac_word in
13580 i?86 | x86_64 | ppc | ppc64)
13581 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13582 ac_arch=$ac_word
13583 else
13584 ac_cv_c_bigendian=universal
13585 break
13586 fi
13587 ;;
13588 esac
13589 ac_prev=
13590 elif test "x$ac_word" = "x-arch"; then
13591 ac_prev=arch
13592 fi
13593 done
13594fi
13595rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13596 if test $ac_cv_c_bigendian = unknown; then
13597 # See if sys/param.h defines the BYTE_ORDER macro.
13598 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13599/* end confdefs.h. */
13600#include <sys/types.h>
13601 #include <sys/param.h>
6ec2e0f5
SDJ
13602
13603int
13604main ()
13605{
c0c3707f
CB
13606#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13607 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13608 && LITTLE_ENDIAN)
13609 bogus endian macros
13610 #endif
6ec2e0f5 13611
c0c3707f
CB
13612 ;
13613 return 0;
13614}
13615_ACEOF
13616if ac_fn_c_try_compile "$LINENO"; then :
13617 # It does; now see whether it defined to BIG_ENDIAN or not.
13618 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13619/* end confdefs.h. */
13620#include <sys/types.h>
13621 #include <sys/param.h>
13622
13623int
13624main ()
13625{
13626#if BYTE_ORDER != BIG_ENDIAN
13627 not big endian
13628 #endif
6ec2e0f5
SDJ
13629
13630 ;
13631 return 0;
13632}
13633_ACEOF
c0c3707f
CB
13634if ac_fn_c_try_compile "$LINENO"; then :
13635 ac_cv_c_bigendian=yes
6ec2e0f5 13636else
c0c3707f 13637 ac_cv_c_bigendian=no
6ec2e0f5 13638fi
c0c3707f 13639rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13640fi
c0c3707f
CB
13641rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13642 fi
13643 if test $ac_cv_c_bigendian = unknown; then
13644 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13645 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13646/* end confdefs.h. */
13647#include <limits.h>
472fa5ee 13648
c0c3707f
CB
13649int
13650main ()
13651{
13652#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13653 bogus endian macros
13654 #endif
6ec2e0f5 13655
c0c3707f
CB
13656 ;
13657 return 0;
13658}
6ec2e0f5 13659_ACEOF
c0c3707f
CB
13660if ac_fn_c_try_compile "$LINENO"; then :
13661 # It does; now see whether it defined to _BIG_ENDIAN or not.
13662 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13663/* end confdefs.h. */
c0c3707f
CB
13664#include <limits.h>
13665
6ec2e0f5
SDJ
13666int
13667main ()
13668{
5df4cba6
SM
13669#ifndef _BIG_ENDIAN
13670 not big endian
13671 #endif
13672
13673 ;
13674 return 0;
13675}
13676_ACEOF
13677if ac_fn_c_try_compile "$LINENO"; then :
13678 ac_cv_c_bigendian=yes
13679else
13680 ac_cv_c_bigendian=no
13681fi
13682rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13683fi
13684rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13685 fi
13686 if test $ac_cv_c_bigendian = unknown; then
13687 # Compile a test program.
13688 if test "$cross_compiling" = yes; then :
13689 # Try to guess by grepping values from an object file.
13690 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13691/* end confdefs.h. */
13692short int ascii_mm[] =
13693 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13694 short int ascii_ii[] =
13695 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13696 int use_ascii (int i) {
13697 return ascii_mm[i] + ascii_ii[i];
13698 }
13699 short int ebcdic_ii[] =
13700 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13701 short int ebcdic_mm[] =
13702 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13703 int use_ebcdic (int i) {
13704 return ebcdic_mm[i] + ebcdic_ii[i];
13705 }
13706 extern int foo;
13707
13708int
13709main ()
13710{
13711return use_ascii (foo) == use_ebcdic (foo);
13712 ;
13713 return 0;
13714}
13715_ACEOF
13716if ac_fn_c_try_compile "$LINENO"; then :
13717 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13718 ac_cv_c_bigendian=yes
13719 fi
13720 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13721 if test "$ac_cv_c_bigendian" = unknown; then
13722 ac_cv_c_bigendian=no
13723 else
13724 # finding both strings is unlikely to happen, but who knows?
13725 ac_cv_c_bigendian=unknown
13726 fi
13727 fi
13728fi
13729rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13730else
13731 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13732/* end confdefs.h. */
13733$ac_includes_default
13734int
13735main ()
13736{
13737
13738 /* Are we little or big endian? From Harbison&Steele. */
13739 union
13740 {
13741 long int l;
13742 char c[sizeof (long int)];
13743 } u;
13744 u.l = 1;
13745 return u.c[sizeof (long int) - 1] == 1;
13746
13747 ;
13748 return 0;
13749}
13750_ACEOF
13751if ac_fn_c_try_run "$LINENO"; then :
13752 ac_cv_c_bigendian=no
13753else
13754 ac_cv_c_bigendian=yes
13755fi
13756rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13757 conftest.$ac_objext conftest.beam conftest.$ac_ext
13758fi
13759
13760 fi
13761fi
13762{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
13763$as_echo "$ac_cv_c_bigendian" >&6; }
13764 case $ac_cv_c_bigendian in #(
13765 yes)
13766 $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
13767;; #(
13768 no)
13769 ;; #(
13770 universal)
13771
13772$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13773
13774 ;; #(
13775 *)
13776 as_fn_error $? "unknown endianness
13777 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
13778 esac
13779
13780
13781
5df4cba6
SM
13782 GNULIB_LOCALECONV=0;
13783 GNULIB_SETLOCALE=0;
13784 GNULIB_SETLOCALE_NULL=0;
13785 GNULIB_DUPLOCALE=0;
13786 GNULIB_LOCALENAME=0;
13787 HAVE_NEWLOCALE=1;
13788 HAVE_DUPLOCALE=1;
13789 HAVE_FREELOCALE=1;
13790 REPLACE_LOCALECONV=0;
13791 REPLACE_SETLOCALE=0;
13792 REPLACE_NEWLOCALE=0;
13793 REPLACE_DUPLOCALE=0;
13794 REPLACE_FREELOCALE=0;
13795 REPLACE_STRUCT_LCONV=0;
13796
13797
13798 REPLACE_NULL=0;
13799 HAVE_MAX_ALIGN_T=1;
13800 HAVE_WCHAR_T=1;
13801
13802
13803 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
13804$as_echo_n "checking for wchar_t... " >&6; }
13805if ${gt_cv_c_wchar_t+:} false; then :
13806 $as_echo_n "(cached) " >&6
13807else
13808 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13809/* end confdefs.h. */
13810#include <stddef.h>
13811 wchar_t foo = (wchar_t)'\0';
13812int
13813main ()
13814{
13815
13816 ;
13817 return 0;
13818}
13819_ACEOF
13820if ac_fn_c_try_compile "$LINENO"; then :
13821 gt_cv_c_wchar_t=yes
13822else
13823 gt_cv_c_wchar_t=no
13824fi
13825rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13826fi
13827{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
13828$as_echo "$gt_cv_c_wchar_t" >&6; }
13829 if test $gt_cv_c_wchar_t = yes; then
13830
13831$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
13832
13833 fi
13834
13835
13836
13837
9c9d63b1
PM
13838
13839
13840
5df4cba6
SM
13841 STDDEF_H=
13842
13843 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
13844$as_echo_n "checking for good max_align_t... " >&6; }
13845if ${gl_cv_type_max_align_t+:} false; then :
13846 $as_echo_n "(cached) " >&6
13847else
13848 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13849/* end confdefs.h. */
13850#include <stddef.h>
13851 unsigned int s = sizeof (max_align_t);
9c9d63b1 13852 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
5df4cba6
SM
13853 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
13854 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
13855 #endif
9c9d63b1
PM
13856 typedef struct { char a; max_align_t b; } max_helper;
13857 typedef struct { char a; long b; } long_helper;
13858 typedef struct { char a; double b; } double_helper;
13859 typedef struct { char a; long double b; } long_double_helper;
13860 int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
13861 int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
13862 int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
5df4cba6
SM
13863
13864int
13865main ()
13866{
c0c3707f 13867
6ec2e0f5
SDJ
13868 ;
13869 return 0;
13870}
13871_ACEOF
13872if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 13873 gl_cv_type_max_align_t=yes
6ec2e0f5 13874else
5df4cba6 13875 gl_cv_type_max_align_t=no
6ec2e0f5 13876fi
c0c3707f 13877rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13878
c0c3707f 13879fi
5df4cba6
SM
13880{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
13881$as_echo "$gl_cv_type_max_align_t" >&6; }
13882 if test $gl_cv_type_max_align_t = no; then
13883 HAVE_MAX_ALIGN_T=0
13884 STDDEF_H=stddef.h
13885 fi
13886
13887 if test $gt_cv_c_wchar_t = no; then
13888 HAVE_WCHAR_T=0
13889 STDDEF_H=stddef.h
13890 fi
13891
13892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
13893$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
13894if ${gl_cv_decl_null_works+:} false; then :
13895 $as_echo_n "(cached) " >&6
c0c3707f
CB
13896else
13897 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13898/* end confdefs.h. */
5df4cba6
SM
13899#include <stddef.h>
13900 int test[2 * (sizeof NULL == sizeof (void *)) -1];
13901
c0c3707f
CB
13902int
13903main ()
13904{
6ec2e0f5 13905
c0c3707f
CB
13906 ;
13907 return 0;
13908}
13909_ACEOF
5df4cba6
SM
13910if ac_fn_c_try_compile "$LINENO"; then :
13911 gl_cv_decl_null_works=yes
c0c3707f 13912else
5df4cba6 13913 gl_cv_decl_null_works=no
c0c3707f 13914fi
5df4cba6 13915rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 13916fi
5df4cba6
SM
13917{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
13918$as_echo "$gl_cv_decl_null_works" >&6; }
13919 if test $gl_cv_decl_null_works = no; then
13920 REPLACE_NULL=1
13921 STDDEF_H=stddef.h
13922 fi
6ec2e0f5 13923
5df4cba6
SM
13924
13925 if test -n "$STDDEF_H"; then
13926 GL_GENERATE_STDDEF_H_TRUE=
13927 GL_GENERATE_STDDEF_H_FALSE='#'
13928else
13929 GL_GENERATE_STDDEF_H_TRUE='#'
13930 GL_GENERATE_STDDEF_H_FALSE=
c0c3707f 13931fi
6ec2e0f5 13932
5df4cba6 13933 if test -n "$STDDEF_H"; then
6ec2e0f5 13934
472fa5ee
SM
13935
13936
5e8754f9
SDJ
13937
13938
5df4cba6
SM
13939
13940
13941
13942 if test $gl_cv_have_include_next = yes; then
13943 gl_cv_next_stddef_h='<'stddef.h'>'
13944 else
13945 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
13946$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
13947if ${gl_cv_next_stddef_h+:} false; then :
13948 $as_echo_n "(cached) " >&6
c0c3707f 13949else
5df4cba6
SM
13950
13951
13952
c0c3707f
CB
13953 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13954/* end confdefs.h. */
c0c3707f 13955#include <stddef.h>
c0c3707f 13956_ACEOF
5df4cba6
SM
13957 case "$host_os" in
13958 aix*) gl_absname_cpp="$ac_cpp -C" ;;
13959 *) gl_absname_cpp="$ac_cpp" ;;
13960 esac
13961
13962 case "$host_os" in
13963 mingw*)
13964 gl_dirsep_regex='[/\\]'
13965 ;;
13966 *)
13967 gl_dirsep_regex='\/'
13968 ;;
13969 esac
13970 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13971 gl_header_literal_regex=`echo 'stddef.h' \
13972 | sed -e "$gl_make_literal_regex_sed"`
13973 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13974 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13975 s|^/[^/]|//&|
13976 p
13977 q
13978 }'
13979
13980 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13981 sed -n "$gl_absolute_header_sed"`
13982
13983 gl_header=$gl_cv_absolute_stddef_h
13984 gl_cv_next_stddef_h='"'$gl_header'"'
5e8754f9
SDJ
13985
13986
c0c3707f 13987fi
5df4cba6
SM
13988{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
13989$as_echo "$gl_cv_next_stddef_h" >&6; }
13990 fi
13991 NEXT_STDDEF_H=$gl_cv_next_stddef_h
13992
13993 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13994 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13995 gl_next_as_first_directive='<'stddef.h'>'
13996 else
13997 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13998 gl_next_as_first_directive=$gl_cv_next_stddef_h
13999 fi
14000 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
5e8754f9
SDJ
14001
14002
14003
14004
5df4cba6 14005 fi
5e8754f9
SDJ
14006
14007
14008
14009
14010
14011
5df4cba6
SM
14012 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
14013$as_echo_n "checking whether locale.h defines locale_t... " >&6; }
14014if ${gl_cv_header_locale_has_locale_t+:} false; then :
14015 $as_echo_n "(cached) " >&6
14016else
14017 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14018/* end confdefs.h. */
5df4cba6
SM
14019#include <locale.h>
14020 locale_t x;
c0c3707f
CB
14021int
14022main ()
14023{
5e8754f9 14024
c0c3707f
CB
14025 ;
14026 return 0;
14027}
14028_ACEOF
14029if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 14030 gl_cv_header_locale_has_locale_t=yes
c0c3707f 14031else
5df4cba6 14032 gl_cv_header_locale_has_locale_t=no
c0c3707f
CB
14033fi
14034rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 14035
c0c3707f 14036fi
5df4cba6
SM
14037{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
14038$as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
14039
14040
14041 if test $ac_cv_header_xlocale_h = yes; then
14042 HAVE_XLOCALE_H=1
14043 if test $gl_cv_header_locale_has_locale_t = yes; then
14044 gl_cv_header_locale_h_needs_xlocale_h=no
14045 else
14046 gl_cv_header_locale_h_needs_xlocale_h=yes
c0c3707f 14047 fi
5df4cba6
SM
14048 HAVE_LOCALE_T=1
14049 else
14050 HAVE_XLOCALE_H=0
14051 gl_cv_header_locale_h_needs_xlocale_h=no
14052 if test $gl_cv_header_locale_has_locale_t = yes; then
14053 HAVE_LOCALE_T=1
14054 else
14055 HAVE_LOCALE_T=0
14056 fi
14057 fi
14058
14059
5e8754f9 14060
5df4cba6
SM
14061
14062 gl_threads_api=none
14063 LIBTHREAD=
14064 LTLIBTHREAD=
14065 LIBMULTITHREAD=
14066 LTLIBMULTITHREAD=
14067 if test "$gl_use_threads" != no; then
14068
14069
14070 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
14071$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
14072if ${gl_cv_have_weak+:} false; then :
14073 $as_echo_n "(cached) " >&6
14074else
14075 gl_cv_have_weak=no
14076 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14077/* end confdefs.h. */
14078extern void xyzzy ();
14079#pragma weak xyzzy
c0c3707f
CB
14080int
14081main ()
14082{
5df4cba6 14083xyzzy();
c0c3707f
CB
14084 ;
14085 return 0;
14086}
14087_ACEOF
5df4cba6
SM
14088if ac_fn_c_try_link "$LINENO"; then :
14089 gl_cv_have_weak=maybe
14090fi
14091rm -f core conftest.err conftest.$ac_objext \
14092 conftest$ac_exeext conftest.$ac_ext
14093 if test $gl_cv_have_weak = maybe; then
14094 if test "$cross_compiling" = yes; then :
14095 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14096/* end confdefs.h. */
5df4cba6
SM
14097#ifdef __ELF__
14098 Extensible Linking Format
14099 #endif
5e8754f9 14100
5df4cba6
SM
14101_ACEOF
14102if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14103 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
14104 gl_cv_have_weak="guessing yes"
14105else
14106 gl_cv_have_weak="guessing no"
14107fi
14108rm -f conftest*
5e8754f9 14109
5df4cba6
SM
14110
14111else
14112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14113/* end confdefs.h. */
14114
14115#include <stdio.h>
14116#pragma weak fputs
14117int main ()
14118{
14119 return (fputs == NULL);
c0c3707f
CB
14120}
14121_ACEOF
5df4cba6
SM
14122if ac_fn_c_try_run "$LINENO"; then :
14123 gl_cv_have_weak=yes
c0c3707f 14124else
5df4cba6 14125 gl_cv_have_weak=no
c0c3707f 14126fi
5df4cba6
SM
14127rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14128 conftest.$ac_objext conftest.beam conftest.$ac_ext
c0c3707f 14129fi
5df4cba6
SM
14130
14131 fi
14132 case " $LDFLAGS " in
14133 *" -static "*) gl_cv_have_weak=no ;;
14134 esac
14135 case "$gl_cv_have_weak" in
14136 *yes)
14137 case "$host_os" in
14138 freebsd* | dragonfly*)
14139 : > conftest1.c
14140 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
14141 cat <<EOF > conftest2.c
14142#include <pthread.h>
14143#pragma weak pthread_mutexattr_gettype
14144int main ()
14145{
14146 return (pthread_mutexattr_gettype != NULL);
14147}
14148EOF
14149 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
14150 || gl_cv_have_weak=no
14151 rm -f conftest1.c libempty.so conftest2.c conftest
14152 ;;
14153 esac
14154 ;;
14155 esac
14156
14157fi
14158{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
14159$as_echo "$gl_cv_have_weak" >&6; }
14160 case "$gl_cv_have_weak" in
14161 *yes)
14162
14163$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
14164
14165 ;;
14166 esac
14167
14168 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
14169
14170 :
c0c3707f 14171 fi
5df4cba6
SM
14172 if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
14173
14174 gl_have_isoc_threads="$ac_cv_header_threads_h"
14175 fi
14176 if test "$gl_use_threads" = yes \
14177 || test "$gl_use_threads" = posix \
14178 || test "$gl_use_threads" = isoc+posix; then
14179
14180
14181 if test -z "$gl_pthreadlib_body_done"; then
14182 gl_pthread_api=no
14183 LIBPTHREAD=
14184 LIBPMULTITHREAD=
14185 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
14186 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
14187 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
14188if test "x$ac_cv_header_pthread_h" = xyes; then :
14189 gl_have_pthread_h=yes
14190else
14191 gl_have_pthread_h=no
14192fi
14193
14194
14195 if test "$gl_have_pthread_h" = yes; then
14196 # Other possible tests:
14197 # -lpthreads (FSU threads, PCthreads)
14198 # -lgthreads
14199 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
14200 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
14201 # the second one only in libpthread, and lock.c needs it.
14202 #
14203 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
14204 # needs -pthread for some reason. See:
14205 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
14206 save_LIBS=$LIBS
14207 for gl_pthread in '' '-pthread'; do
14208 LIBS="$LIBS $gl_pthread"
14209 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14210/* end confdefs.h. */
14211#include <pthread.h>
14212 pthread_mutex_t m;
14213 pthread_mutexattr_t ma;
5e8754f9 14214
c0c3707f
CB
14215int
14216main ()
14217{
5df4cba6
SM
14218pthread_mutex_lock (&m);
14219 pthread_mutexattr_init (&ma);
c0c3707f
CB
14220 ;
14221 return 0;
14222}
14223_ACEOF
5df4cba6
SM
14224if ac_fn_c_try_link "$LINENO"; then :
14225 gl_pthread_api=yes
14226 LIBPTHREAD=$gl_pthread
14227 LIBPMULTITHREAD=$gl_pthread
c0c3707f 14228fi
5df4cba6
SM
14229rm -f core conftest.err conftest.$ac_objext \
14230 conftest$ac_exeext conftest.$ac_ext
14231 LIBS=$save_LIBS
14232 test $gl_pthread_api = yes && break
14233 done
14234
14235 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
14236 # since it is defined as a macro on OSF/1.)
14237 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
14238 # The program links fine without libpthread. But it may actually
14239 # need to link with libpthread in order to create multiple threads.
14240 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14241$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14242if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
14243 $as_echo_n "(cached) " >&6
c0c3707f 14244else
5df4cba6
SM
14245 ac_check_lib_save_LIBS=$LIBS
14246LIBS="-lpthread $LIBS"
14247cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14248/* end confdefs.h. */
5df4cba6
SM
14249
14250/* Override any GCC internal prototype to avoid an error.
14251 Use char because int might match the return type of a GCC
14252 builtin and then its argument prototype would still apply. */
14253#ifdef __cplusplus
14254extern "C"
14255#endif
14256char pthread_kill ();
c0c3707f
CB
14257int
14258main ()
14259{
5df4cba6 14260return pthread_kill ();
c0c3707f
CB
14261 ;
14262 return 0;
14263}
14264_ACEOF
5df4cba6
SM
14265if ac_fn_c_try_link "$LINENO"; then :
14266 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 14267else
5df4cba6 14268 ac_cv_lib_pthread_pthread_kill=no
6ec2e0f5 14269fi
5df4cba6
SM
14270rm -f core conftest.err conftest.$ac_objext \
14271 conftest$ac_exeext conftest.$ac_ext
14272LIBS=$ac_check_lib_save_LIBS
c0c3707f 14273fi
5df4cba6
SM
14274{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14275$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14276if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14277 LIBPMULTITHREAD=-lpthread
14278 # On Solaris and HP-UX, most pthread functions exist also in libc.
14279 # Therefore pthread_in_use() needs to actually try to create a
14280 # thread: pthread_create from libc will fail, whereas
14281 # pthread_create will actually create a thread.
14282 # On Solaris 10 or newer, this test is no longer needed, because
14283 # libc contains the fully functional pthread functions.
14284 case "$host_os" in
14285 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
472fa5ee 14286
5df4cba6 14287$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
472fa5ee 14288
5df4cba6 14289 esac
472fa5ee 14290
5df4cba6 14291fi
472fa5ee 14292
5df4cba6
SM
14293 elif test $gl_pthread_api != yes; then
14294 # Some library is needed. Try libpthread and libc_r.
14295 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14296$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14297if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
14298 $as_echo_n "(cached) " >&6
14299else
5df4cba6
SM
14300 ac_check_lib_save_LIBS=$LIBS
14301LIBS="-lpthread $LIBS"
14302cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14303/* end confdefs.h. */
5df4cba6
SM
14304
14305/* Override any GCC internal prototype to avoid an error.
14306 Use char because int might match the return type of a GCC
14307 builtin and then its argument prototype would still apply. */
14308#ifdef __cplusplus
14309extern "C"
14310#endif
14311char pthread_kill ();
c0c3707f
CB
14312int
14313main ()
14314{
5df4cba6 14315return pthread_kill ();
c0c3707f
CB
14316 ;
14317 return 0;
14318}
14319_ACEOF
14320if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14321 ac_cv_lib_pthread_pthread_kill=yes
c0c3707f 14322else
5df4cba6 14323 ac_cv_lib_pthread_pthread_kill=no
c0c3707f
CB
14324fi
14325rm -f core conftest.err conftest.$ac_objext \
14326 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14327LIBS=$ac_check_lib_save_LIBS
14328fi
14329{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14330$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14331if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14332 gl_pthread_api=yes
14333 LIBPTHREAD=-lpthread
14334 LIBPMULTITHREAD=-lpthread
c0c3707f 14335fi
472fa5ee 14336
5df4cba6
SM
14337 if test $gl_pthread_api != yes; then
14338 # For FreeBSD 4.
14339 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14340$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14341if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14342 $as_echo_n "(cached) " >&6
14343else
14344 ac_check_lib_save_LIBS=$LIBS
14345LIBS="-lc_r $LIBS"
14346cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14347/* end confdefs.h. */
472fa5ee 14348
5df4cba6
SM
14349/* Override any GCC internal prototype to avoid an error.
14350 Use char because int might match the return type of a GCC
14351 builtin and then its argument prototype would still apply. */
14352#ifdef __cplusplus
14353extern "C"
14354#endif
14355char pthread_kill ();
14356int
14357main ()
14358{
14359return pthread_kill ();
14360 ;
14361 return 0;
14362}
14363_ACEOF
14364if ac_fn_c_try_link "$LINENO"; then :
14365 ac_cv_lib_c_r_pthread_kill=yes
14366else
14367 ac_cv_lib_c_r_pthread_kill=no
14368fi
14369rm -f core conftest.err conftest.$ac_objext \
14370 conftest$ac_exeext conftest.$ac_ext
14371LIBS=$ac_check_lib_save_LIBS
14372fi
14373{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14374$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14375if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14376 gl_pthread_api=yes
14377 LIBPTHREAD=-lc_r
14378 LIBPMULTITHREAD=-lc_r
14379fi
6ec2e0f5 14380
5df4cba6
SM
14381 fi
14382 fi
14383 fi
14384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14385$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14386 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14387$as_echo "$gl_pthread_api" >&6; }
472fa5ee
SM
14388
14389
5df4cba6 14390 if test $gl_pthread_api = yes; then
472fa5ee 14391
5df4cba6 14392$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
472fa5ee 14393
5df4cba6 14394 fi
472fa5ee 14395
5df4cba6 14396 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14397/* end confdefs.h. */
5df4cba6 14398#include <sched.h>
c0c3707f
CB
14399int
14400main ()
14401{
5df4cba6 14402sched_yield ();
c0c3707f
CB
14403 ;
14404 return 0;
14405}
14406_ACEOF
14407if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14408 LIB_SCHED_YIELD=
6ec2e0f5 14409
c0c3707f 14410else
5df4cba6
SM
14411 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14412$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14413if ${ac_cv_lib_rt_sched_yield+:} false; then :
14414 $as_echo_n "(cached) " >&6
c0c3707f 14415else
5df4cba6
SM
14416 ac_check_lib_save_LIBS=$LIBS
14417LIBS="-lrt $LIBS"
14418cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14419/* end confdefs.h. */
6ec2e0f5 14420
5df4cba6
SM
14421/* Override any GCC internal prototype to avoid an error.
14422 Use char because int might match the return type of a GCC
14423 builtin and then its argument prototype would still apply. */
14424#ifdef __cplusplus
14425extern "C"
14426#endif
14427char sched_yield ();
14428int
14429main ()
c0c3707f 14430{
5df4cba6
SM
14431return sched_yield ();
14432 ;
14433 return 0;
c0c3707f 14434}
6ec2e0f5 14435_ACEOF
5df4cba6
SM
14436if ac_fn_c_try_link "$LINENO"; then :
14437 ac_cv_lib_rt_sched_yield=yes
c0c3707f 14438else
5df4cba6 14439 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14440fi
5df4cba6
SM
14441rm -f core conftest.err conftest.$ac_objext \
14442 conftest$ac_exeext conftest.$ac_ext
14443LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14444fi
5df4cba6
SM
14445{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14446$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14447if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14448 LIB_SCHED_YIELD=-lrt
14449else
14450 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14451$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14452if ${ac_cv_lib_posix4_sched_yield+:} false; then :
14453 $as_echo_n "(cached) " >&6
14454else
14455 ac_check_lib_save_LIBS=$LIBS
14456LIBS="-lposix4 $LIBS"
14457cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14458/* end confdefs.h. */
6ec2e0f5 14459
5df4cba6
SM
14460/* Override any GCC internal prototype to avoid an error.
14461 Use char because int might match the return type of a GCC
14462 builtin and then its argument prototype would still apply. */
14463#ifdef __cplusplus
14464extern "C"
14465#endif
14466char sched_yield ();
c0c3707f
CB
14467int
14468main ()
14469{
5df4cba6 14470return sched_yield ();
c0c3707f
CB
14471 ;
14472 return 0;
14473}
14474_ACEOF
14475if ac_fn_c_try_link "$LINENO"; then :
5df4cba6
SM
14476 ac_cv_lib_posix4_sched_yield=yes
14477else
14478 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14479fi
14480rm -f core conftest.err conftest.$ac_objext \
14481 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14482LIBS=$ac_check_lib_save_LIBS
14483fi
14484{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14485$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14486if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14487 LIB_SCHED_YIELD=-lposix4
14488fi
14489
14490fi
14491
14492
14493fi
14494rm -f core conftest.err conftest.$ac_objext \
14495 conftest$ac_exeext conftest.$ac_ext
14496
14497
14498 gl_pthreadlib_body_done=done
14499 fi
14500
14501 LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
14502 LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
14503 if test $gl_pthread_api = yes; then
14504 if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
14505 gl_threads_api='isoc+posix'
14506
14507$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
14508
14509 LIBTHREAD= LTLIBTHREAD=
14510 else
14511 gl_threads_api=posix
14512
14513$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
14514
14515 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
14516 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
14517
14518$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
14519
14520 LIBTHREAD= LTLIBTHREAD=
9c9d63b1
PM
14521 else
14522 case "$host_os" in
14523 freebsd* | dragonfly*)
14524 if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
14525
14526$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
14527
14528 fi
14529 ;;
14530 esac
5df4cba6
SM
14531 fi
14532 fi
14533 fi
c0c3707f
CB
14534 fi
14535 fi
5df4cba6
SM
14536 if test $gl_threads_api = none; then
14537 if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
14538
14539
14540
14541 if test -z "$gl_stdthreadlib_body_done"; then
14542
14543
14544 case "$host_os" in
14545 mingw*)
14546 LIBSTDTHREAD=
14547 ;;
14548 *)
c0c3707f
CB
14549
14550
5df4cba6 14551 if test -z "$gl_pthreadlib_body_done"; then
c0c3707f
CB
14552 gl_pthread_api=no
14553 LIBPTHREAD=
14554 LIBPMULTITHREAD=
14555 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
14556 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
14557 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
14558if test "x$ac_cv_header_pthread_h" = xyes; then :
14559 gl_have_pthread_h=yes
14560else
14561 gl_have_pthread_h=no
14562fi
6ec2e0f5 14563
6ec2e0f5 14564
c0c3707f
CB
14565 if test "$gl_have_pthread_h" = yes; then
14566 # Other possible tests:
14567 # -lpthreads (FSU threads, PCthreads)
14568 # -lgthreads
14569 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
14570 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
14571 # the second one only in libpthread, and lock.c needs it.
14572 #
14573 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
14574 # needs -pthread for some reason. See:
14575 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
14576 save_LIBS=$LIBS
14577 for gl_pthread in '' '-pthread'; do
14578 LIBS="$LIBS $gl_pthread"
14579 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14580/* end confdefs.h. */
14581#include <pthread.h>
14582 pthread_mutex_t m;
14583 pthread_mutexattr_t ma;
6ec2e0f5 14584
c0c3707f
CB
14585int
14586main ()
14587{
14588pthread_mutex_lock (&m);
14589 pthread_mutexattr_init (&ma);
14590 ;
14591 return 0;
14592}
6ec2e0f5 14593_ACEOF
c0c3707f
CB
14594if ac_fn_c_try_link "$LINENO"; then :
14595 gl_pthread_api=yes
14596 LIBPTHREAD=$gl_pthread
14597 LIBPMULTITHREAD=$gl_pthread
6ec2e0f5 14598fi
c0c3707f
CB
14599rm -f core conftest.err conftest.$ac_objext \
14600 conftest$ac_exeext conftest.$ac_ext
14601 LIBS=$save_LIBS
14602 test $gl_pthread_api = yes && break
14603 done
6ec2e0f5 14604
c0c3707f
CB
14605 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
14606 # since it is defined as a macro on OSF/1.)
14607 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
14608 # The program links fine without libpthread. But it may actually
14609 # need to link with libpthread in order to create multiple threads.
14610 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14611$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14612if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
14613 $as_echo_n "(cached) " >&6
14614else
c0c3707f 14615 ac_check_lib_save_LIBS=$LIBS
5df4cba6
SM
14616LIBS="-lpthread $LIBS"
14617cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14618/* end confdefs.h. */
14619
14620/* Override any GCC internal prototype to avoid an error.
14621 Use char because int might match the return type of a GCC
14622 builtin and then its argument prototype would still apply. */
14623#ifdef __cplusplus
14624extern "C"
14625#endif
14626char pthread_kill ();
14627int
14628main ()
14629{
14630return pthread_kill ();
14631 ;
14632 return 0;
14633}
14634_ACEOF
14635if ac_fn_c_try_link "$LINENO"; then :
14636 ac_cv_lib_pthread_pthread_kill=yes
14637else
14638 ac_cv_lib_pthread_pthread_kill=no
14639fi
14640rm -f core conftest.err conftest.$ac_objext \
14641 conftest$ac_exeext conftest.$ac_ext
14642LIBS=$ac_check_lib_save_LIBS
14643fi
14644{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14645$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14646if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14647 LIBPMULTITHREAD=-lpthread
14648 # On Solaris and HP-UX, most pthread functions exist also in libc.
14649 # Therefore pthread_in_use() needs to actually try to create a
14650 # thread: pthread_create from libc will fail, whereas
14651 # pthread_create will actually create a thread.
14652 # On Solaris 10 or newer, this test is no longer needed, because
14653 # libc contains the fully functional pthread functions.
14654 case "$host_os" in
14655 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
14656
14657$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
14658
14659 esac
14660
14661fi
14662
14663 elif test $gl_pthread_api != yes; then
14664 # Some library is needed. Try libpthread and libc_r.
14665 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14666$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14667if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
14668 $as_echo_n "(cached) " >&6
14669else
14670 ac_check_lib_save_LIBS=$LIBS
14671LIBS="-lpthread $LIBS"
14672cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14673/* end confdefs.h. */
14674
14675/* Override any GCC internal prototype to avoid an error.
14676 Use char because int might match the return type of a GCC
14677 builtin and then its argument prototype would still apply. */
14678#ifdef __cplusplus
14679extern "C"
14680#endif
14681char pthread_kill ();
14682int
14683main ()
14684{
14685return pthread_kill ();
14686 ;
14687 return 0;
14688}
14689_ACEOF
14690if ac_fn_c_try_link "$LINENO"; then :
14691 ac_cv_lib_pthread_pthread_kill=yes
14692else
14693 ac_cv_lib_pthread_pthread_kill=no
14694fi
14695rm -f core conftest.err conftest.$ac_objext \
14696 conftest$ac_exeext conftest.$ac_ext
14697LIBS=$ac_check_lib_save_LIBS
14698fi
14699{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14700$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14701if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14702 gl_pthread_api=yes
14703 LIBPTHREAD=-lpthread
14704 LIBPMULTITHREAD=-lpthread
14705fi
14706
14707 if test $gl_pthread_api != yes; then
14708 # For FreeBSD 4.
14709 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14710$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14711if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14712 $as_echo_n "(cached) " >&6
14713else
14714 ac_check_lib_save_LIBS=$LIBS
14715LIBS="-lc_r $LIBS"
14716cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14717/* end confdefs.h. */
14718
14719/* Override any GCC internal prototype to avoid an error.
14720 Use char because int might match the return type of a GCC
14721 builtin and then its argument prototype would still apply. */
14722#ifdef __cplusplus
14723extern "C"
14724#endif
14725char pthread_kill ();
14726int
14727main ()
14728{
14729return pthread_kill ();
14730 ;
14731 return 0;
14732}
14733_ACEOF
14734if ac_fn_c_try_link "$LINENO"; then :
14735 ac_cv_lib_c_r_pthread_kill=yes
14736else
14737 ac_cv_lib_c_r_pthread_kill=no
14738fi
14739rm -f core conftest.err conftest.$ac_objext \
14740 conftest$ac_exeext conftest.$ac_ext
14741LIBS=$ac_check_lib_save_LIBS
14742fi
14743{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14744$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14745if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14746 gl_pthread_api=yes
14747 LIBPTHREAD=-lc_r
14748 LIBPMULTITHREAD=-lc_r
14749fi
14750
14751 fi
14752 fi
14753 fi
14754 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14755$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14756 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14757$as_echo "$gl_pthread_api" >&6; }
14758
14759
14760 if test $gl_pthread_api = yes; then
14761
14762$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
14763
14764 fi
14765
14766 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14767/* end confdefs.h. */
14768#include <sched.h>
14769int
14770main ()
14771{
14772sched_yield ();
14773 ;
14774 return 0;
14775}
14776_ACEOF
14777if ac_fn_c_try_link "$LINENO"; then :
14778 LIB_SCHED_YIELD=
14779
14780else
14781 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14782$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14783if ${ac_cv_lib_rt_sched_yield+:} false; then :
14784 $as_echo_n "(cached) " >&6
14785else
14786 ac_check_lib_save_LIBS=$LIBS
14787LIBS="-lrt $LIBS"
c0c3707f 14788cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14789/* end confdefs.h. */
6ec2e0f5 14790
c0c3707f
CB
14791/* Override any GCC internal prototype to avoid an error.
14792 Use char because int might match the return type of a GCC
14793 builtin and then its argument prototype would still apply. */
14794#ifdef __cplusplus
14795extern "C"
14796#endif
5df4cba6 14797char sched_yield ();
c0c3707f
CB
14798int
14799main ()
14800{
5df4cba6 14801return sched_yield ();
c0c3707f
CB
14802 ;
14803 return 0;
14804}
6ec2e0f5 14805_ACEOF
c0c3707f 14806if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14807 ac_cv_lib_rt_sched_yield=yes
6ec2e0f5 14808else
5df4cba6 14809 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14810fi
c0c3707f
CB
14811rm -f core conftest.err conftest.$ac_objext \
14812 conftest$ac_exeext conftest.$ac_ext
14813LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14814fi
5df4cba6
SM
14815{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14816$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14817if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14818 LIB_SCHED_YIELD=-lrt
14819else
14820 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14821$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14822if ${ac_cv_lib_posix4_sched_yield+:} false; then :
6ec2e0f5
SDJ
14823 $as_echo_n "(cached) " >&6
14824else
c0c3707f 14825 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14826LIBS="-lposix4 $LIBS"
c0c3707f 14827cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
14828/* end confdefs.h. */
14829
c0c3707f
CB
14830/* Override any GCC internal prototype to avoid an error.
14831 Use char because int might match the return type of a GCC
14832 builtin and then its argument prototype would still apply. */
14833#ifdef __cplusplus
14834extern "C"
14835#endif
5df4cba6 14836char sched_yield ();
6ec2e0f5
SDJ
14837int
14838main ()
14839{
5df4cba6 14840return sched_yield ();
c0c3707f
CB
14841 ;
14842 return 0;
14843}
14844_ACEOF
14845if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14846 ac_cv_lib_posix4_sched_yield=yes
c0c3707f 14847else
5df4cba6 14848 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14849fi
14850rm -f core conftest.err conftest.$ac_objext \
14851 conftest$ac_exeext conftest.$ac_ext
14852LIBS=$ac_check_lib_save_LIBS
14853fi
5df4cba6
SM
14854{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14855$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14856if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14857 LIB_SCHED_YIELD=-lposix4
c0c3707f 14858fi
6ec2e0f5 14859
5df4cba6
SM
14860fi
14861
14862
14863fi
14864rm -f core conftest.err conftest.$ac_objext \
14865 conftest$ac_exeext conftest.$ac_ext
14866
14867
14868 gl_pthreadlib_body_done=done
14869 fi
14870
14871 if test $ac_cv_header_threads_h = yes; then
14872 for ac_func in thrd_create
14873do :
14874 ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create"
14875if test "x$ac_cv_func_thrd_create" = xyes; then :
14876 cat >>confdefs.h <<_ACEOF
14877#define HAVE_THRD_CREATE 1
14878_ACEOF
14879
14880fi
14881done
14882
14883 if test $ac_cv_func_thrd_create = yes; then
14884 LIBSTDTHREAD=
14885 else
14886 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5
14887$as_echo_n "checking for thrd_create in -lstdthreads... " >&6; }
14888if ${ac_cv_lib_stdthreads_thrd_create+:} false; then :
c0c3707f
CB
14889 $as_echo_n "(cached) " >&6
14890else
14891 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14892LIBS="-lstdthreads $LIBS"
c0c3707f
CB
14893cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14894/* end confdefs.h. */
6ec2e0f5 14895
c0c3707f
CB
14896/* Override any GCC internal prototype to avoid an error.
14897 Use char because int might match the return type of a GCC
14898 builtin and then its argument prototype would still apply. */
14899#ifdef __cplusplus
14900extern "C"
14901#endif
5df4cba6 14902char thrd_create ();
c0c3707f
CB
14903int
14904main ()
14905{
5df4cba6 14906return thrd_create ();
6ec2e0f5
SDJ
14907 ;
14908 return 0;
14909}
14910_ACEOF
c0c3707f 14911if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14912 ac_cv_lib_stdthreads_thrd_create=yes
6ec2e0f5 14913else
5df4cba6 14914 ac_cv_lib_stdthreads_thrd_create=no
6ec2e0f5 14915fi
c0c3707f
CB
14916rm -f core conftest.err conftest.$ac_objext \
14917 conftest$ac_exeext conftest.$ac_ext
14918LIBS=$ac_check_lib_save_LIBS
14919fi
5df4cba6
SM
14920{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5
14921$as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; }
14922if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then :
6ec2e0f5 14923
5df4cba6 14924 LIBSTDTHREAD='-lstdthreads -lpthread'
6ec2e0f5 14925
5df4cba6 14926else
6ec2e0f5 14927
5df4cba6 14928 LIBSTDTHREAD="$LIBPMULTITHREAD"
6ec2e0f5 14929
5df4cba6 14930fi
6ec2e0f5 14931
5df4cba6 14932 fi
c0c3707f 14933 else
5df4cba6
SM
14934 LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
14935 fi
14936 ;;
14937 esac
c0c3707f 14938
c0c3707f 14939
5df4cba6
SM
14940 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5
14941$as_echo_n "checking whether ISO C threads API is available... " >&6; }
14942 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5
14943$as_echo "$ac_cv_header_threads_h" >&6; }
14944 gl_stdthreadlib_body_done=done
14945 fi
c0c3707f 14946
5df4cba6
SM
14947 LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
14948 LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
c0c3707f
CB
14949 gl_threads_api=isoc
14950
14951$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
14952
14953 fi
14954 fi
14955 if test $gl_threads_api = none; then
14956 case "$gl_use_threads" in
14957 yes | windows | win32) # The 'win32' is for backward compatibility.
14958 if { case "$host_os" in
14959 mingw*) true;;
14960 *) false;;
14961 esac
14962 }; then
14963 gl_threads_api=windows
14964
14965$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
14966
14967 fi
14968 ;;
14969 esac
14970 fi
14971 fi
14972 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
14973$as_echo_n "checking for multithread API to use... " >&6; }
14974 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
14975$as_echo "$gl_threads_api" >&6; }
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
14989$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
14990if ${gl_cv_func_malloc_posix+:} false; then :
6ec2e0f5
SDJ
14991 $as_echo_n "(cached) " >&6
14992else
c0c3707f
CB
14993
14994 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14995/* end confdefs.h. */
c0c3707f 14996
6ec2e0f5
SDJ
14997int
14998main ()
14999{
c0c3707f
CB
15000#if defined _WIN32 && ! defined __CYGWIN__
15001 choke me
15002 #endif
6ec2e0f5
SDJ
15003
15004 ;
15005 return 0;
15006}
15007_ACEOF
15008if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 15009 gl_cv_func_malloc_posix=yes
6ec2e0f5 15010else
c0c3707f 15011 gl_cv_func_malloc_posix=no
6ec2e0f5
SDJ
15012fi
15013rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
472fa5ee 15014
c0c3707f
CB
15015fi
15016{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
15017$as_echo "$gl_cv_func_malloc_posix" >&6; }
472fa5ee
SM
15018
15019
6ec2e0f5 15020
9c9d63b1 15021 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
c0c3707f
CB
15022$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
15023if ${ac_cv_func_malloc_0_nonnull+:} false; then :
6ec2e0f5
SDJ
15024 $as_echo_n "(cached) " >&6
15025else
15026 if test "$cross_compiling" = yes; then :
15027 case "$host_os" in
c0c3707f
CB
15028 # Guess yes on platforms where we know the result.
15029 *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
15030 | hpux* | solaris* | cygwin* | mingw*)
15031 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
15032 # If we don't know, obey --enable-cross-guesses.
15033 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
15034 esac
6ec2e0f5
SDJ
15035
15036else
15037 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15038/* end confdefs.h. */
9c9d63b1 15039#include <stdlib.h>
6ec2e0f5
SDJ
15040
15041int
15042main ()
15043{
c0c3707f
CB
15044char *p = malloc (0);
15045 int result = !p;
15046 free (p);
15047 return result;
6ec2e0f5
SDJ
15048 ;
15049 return 0;
698be2d8
CB
15050}
15051
15052_ACEOF
15053if ac_fn_c_try_run "$LINENO"; then :
15054 ac_cv_func_malloc_0_nonnull=yes
15055else
15056 ac_cv_func_malloc_0_nonnull=no
15057fi
15058rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15059 conftest.$ac_objext conftest.beam conftest.$ac_ext
15060fi
15061
15062
15063fi
15064{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
15065$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
15066 case "$ac_cv_func_malloc_0_nonnull" in
15067 *yes)
15068 gl_cv_func_malloc_0_nonnull=1
15069 ;;
15070 *)
15071 gl_cv_func_malloc_0_nonnull=0
15072 ;;
15073 esac
15074
15075
15076cat >>confdefs.h <<_ACEOF
15077#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
15078_ACEOF
15079
15080
15081
c0c3707f
CB
15082
15083
6ec2e0f5
SDJ
15084
15085
15086
15087
15088
15089
c0c3707f
CB
15090 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
15091$as_echo_n "checking for a traditional japanese locale... " >&6; }
15092if ${gt_cv_locale_ja+:} false; then :
15093 $as_echo_n "(cached) " >&6
15094else
15095
15096 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15097/* end confdefs.h. */
6ec2e0f5 15098
c0c3707f
CB
15099#include <locale.h>
15100#include <time.h>
15101#if HAVE_LANGINFO_CODESET
15102# include <langinfo.h>
15103#endif
15104#include <stdlib.h>
15105#include <string.h>
15106struct tm t;
15107char buf[16];
15108int main ()
15109{
15110 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15111 imitates locale dependent behaviour by looking at the environment
15112 variables, and all locales use the UTF-8 encoding. */
15113#if defined __BEOS__ || defined __HAIKU__
15114 return 1;
15115#else
15116 /* Check whether the given locale name is recognized by the system. */
15117# if defined _WIN32 && !defined __CYGWIN__
15118 /* On native Windows, setlocale(category, "") looks at the system settings,
15119 not at the environment variables. Also, when an encoding suffix such
15120 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15121 category of the locale to "C". */
15122 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15123 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15124 return 1;
15125# else
15126 if (setlocale (LC_ALL, "") == NULL) return 1;
15127# endif
15128 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15129 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15130 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15131 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15132 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15133 some unit tests fail.
15134 On MirBSD 10, when an unsupported locale is specified, setlocale()
15135 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
15136# if HAVE_LANGINFO_CODESET
15137 {
15138 const char *cs = nl_langinfo (CODESET);
15139 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15140 || strcmp (cs, "UTF-8") == 0)
15141 return 1;
15142 }
15143# endif
15144# ifdef __CYGWIN__
15145 /* On Cygwin, avoid locale names without encoding suffix, because the
15146 locale_charset() function relies on the encoding suffix. Note that
15147 LC_ALL is set on the command line. */
15148 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15149# endif
15150 /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
15151 on Cygwin 1.5.x. */
15152 if (MB_CUR_MAX == 1)
15153 return 1;
15154 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
15155 This excludes the UTF-8 encoding (except on MirBSD). */
15156 {
15157 const char *p;
15158 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15159 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
15160 for (p = buf; *p != '\0'; p++)
15161 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
15162 return 1;
15163 }
15164 return 0;
15165#endif
15166}
6ec2e0f5 15167
c0c3707f
CB
15168_ACEOF
15169 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15170 (eval $ac_link) 2>&5
15171 ac_status=$?
15172 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15173 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15174 case "$host_os" in
15175 # Handle native Windows specially, because there setlocale() interprets
15176 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15177 # "fr" or "fra" as "French" or "French_France.1252",
15178 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15179 # "ja" as "Japanese" or "Japanese_Japan.932",
15180 # and similar.
15181 mingw*)
15182 # Note that on native Windows, the Japanese locale is
15183 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
15184 # cannot use it here.
15185 gt_cv_locale_ja=none
15186 ;;
15187 *)
15188 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15189 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15190 # configure script would override the LC_ALL setting. Likewise for
15191 # LC_CTYPE, which is also set at the beginning of the configure script.
15192 # Test for the AIX locale name.
15193 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15194 gt_cv_locale_ja=ja_JP
15195 else
15196 # Test for the locale name with explicit encoding suffix.
15197 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15198 gt_cv_locale_ja=ja_JP.EUC-JP
15199 else
15200 # Test for the HP-UX, OSF/1, NetBSD locale name.
15201 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15202 gt_cv_locale_ja=ja_JP.eucJP
15203 else
15204 # Test for the IRIX, FreeBSD locale name.
15205 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15206 gt_cv_locale_ja=ja_JP.EUC
15207 else
15208 # Test for the Solaris 7 locale name.
15209 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15210 gt_cv_locale_ja=ja
15211 else
15212 # Special test for NetBSD 1.6.
15213 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
15214 gt_cv_locale_ja=ja_JP.eucJP
15215 else
15216 # None found.
15217 gt_cv_locale_ja=none
15218 fi
15219 fi
15220 fi
15221 fi
15222 fi
15223 fi
15224 ;;
15225 esac
15226 fi
15227 rm -fr conftest*
5abebf3c
CB
15228
15229fi
c0c3707f
CB
15230{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
15231$as_echo "$gt_cv_locale_ja" >&6; }
15232 LOCALE_JA=$gt_cv_locale_ja
5abebf3c 15233
5abebf3c 15234
5abebf3c 15235
5abebf3c 15236
c0c3707f
CB
15237 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
15238$as_echo_n "checking for a french Unicode locale... " >&6; }
15239if ${gt_cv_locale_fr_utf8+:} false; then :
5abebf3c
CB
15240 $as_echo_n "(cached) " >&6
15241else
5abebf3c 15242
c0c3707f 15243 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 15244/* end confdefs.h. */
5abebf3c 15245
c0c3707f
CB
15246#include <locale.h>
15247#include <time.h>
15248#if HAVE_LANGINFO_CODESET
15249# include <langinfo.h>
15250#endif
15251#include <stdlib.h>
15252#include <string.h>
15253struct tm t;
15254char buf[16];
15255int main () {
15256 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15257 imitates locale dependent behaviour by looking at the environment
15258 variables, and all locales use the UTF-8 encoding. */
15259#if !(defined __BEOS__ || defined __HAIKU__)
15260 /* Check whether the given locale name is recognized by the system. */
15261# if defined _WIN32 && !defined __CYGWIN__
15262 /* On native Windows, setlocale(category, "") looks at the system settings,
15263 not at the environment variables. Also, when an encoding suffix such
15264 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15265 category of the locale to "C". */
15266 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15267 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15268 return 1;
15269# else
15270 if (setlocale (LC_ALL, "") == NULL) return 1;
15271# endif
15272 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15273 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15274 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15275 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15276 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15277 some unit tests fail. */
15278# if HAVE_LANGINFO_CODESET
15279 {
15280 const char *cs = nl_langinfo (CODESET);
15281 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
15282 return 1;
15283 }
15284# endif
15285# ifdef __CYGWIN__
15286 /* On Cygwin, avoid locale names without encoding suffix, because the
15287 locale_charset() function relies on the encoding suffix. Note that
15288 LC_ALL is set on the command line. */
15289 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15290# endif
15291 /* Check whether in the abbreviation of the second month, the second
15292 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
15293 two bytes long, with UTF-8 encoding. */
15294 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15295 if (strftime (buf, sizeof (buf), "%b", &t) < 4
15296 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
15297 return 1;
15298#endif
15299#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
15300 /* Check whether the decimal separator is a comma.
15301 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
15302 are nl_langinfo(RADIXCHAR) are both ".". */
15303 if (localeconv () ->decimal_point[0] != ',') return 1;
15304#endif
5abebf3c
CB
15305 return 0;
15306}
5abebf3c 15307
c0c3707f
CB
15308_ACEOF
15309 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15310 (eval $ac_link) 2>&5
15311 ac_status=$?
15312 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15313 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15314 case "$host_os" in
15315 # Handle native Windows specially, because there setlocale() interprets
15316 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15317 # "fr" or "fra" as "French" or "French_France.1252",
15318 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15319 # "ja" as "Japanese" or "Japanese_Japan.932",
15320 # and similar.
15321 mingw*)
15322 # Test for the hypothetical native Windows locale name.
15323 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15324 gt_cv_locale_fr_utf8=French_France.65001
15325 else
15326 # None found.
15327 gt_cv_locale_fr_utf8=none
15328 fi
15329 ;;
15330 *)
15331 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15332 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15333 # configure script would override the LC_ALL setting. Likewise for
15334 # LC_CTYPE, which is also set at the beginning of the configure script.
15335 # Test for the usual locale name.
15336 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15337 gt_cv_locale_fr_utf8=fr_FR
15338 else
15339 # Test for the locale name with explicit encoding suffix.
15340 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15341 gt_cv_locale_fr_utf8=fr_FR.UTF-8
15342 else
15343 # Test for the Solaris 7 locale name.
15344 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15345 gt_cv_locale_fr_utf8=fr.UTF-8
15346 else
15347 # None found.
15348 gt_cv_locale_fr_utf8=none
15349 fi
15350 fi
15351 fi
15352 ;;
15353 esac
15354 fi
15355 rm -fr conftest*
5abebf3c
CB
15356
15357fi
c0c3707f
CB
15358{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
15359$as_echo "$gt_cv_locale_fr_utf8" >&6; }
15360 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
5abebf3c
CB
15361
15362
15363
15364
15365
c0c3707f
CB
15366 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
15367$as_echo_n "checking for a transitional chinese locale... " >&6; }
15368if ${gt_cv_locale_zh_CN+:} false; then :
5abebf3c
CB
15369 $as_echo_n "(cached) " >&6
15370else
5abebf3c 15371
c0c3707f 15372 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 15373/* end confdefs.h. */
5abebf3c 15374
c0c3707f
CB
15375#include <locale.h>
15376#include <stdlib.h>
15377#include <time.h>
15378#if HAVE_LANGINFO_CODESET
15379# include <langinfo.h>
15380#endif
15381#include <stdlib.h>
15382#include <string.h>
15383struct tm t;
15384char buf[16];
15385int main ()
5abebf3c 15386{
c0c3707f
CB
15387 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15388 imitates locale dependent behaviour by looking at the environment
15389 variables, and all locales use the UTF-8 encoding. */
15390#if defined __BEOS__ || defined __HAIKU__
15391 return 1;
15392#else
15393 /* Check whether the given locale name is recognized by the system. */
15394# if defined _WIN32 && !defined __CYGWIN__
15395 /* On native Windows, setlocale(category, "") looks at the system settings,
15396 not at the environment variables. Also, when an encoding suffix such
15397 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15398 category of the locale to "C". */
15399 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15400 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15401 return 1;
15402# else
15403 if (setlocale (LC_ALL, "") == NULL) return 1;
15404# endif
15405 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15406 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15407 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15408 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15409 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15410 some unit tests fail.
15411 On MirBSD 10, when an unsupported locale is specified, setlocale()
15412 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
15413# if HAVE_LANGINFO_CODESET
15414 {
15415 const char *cs = nl_langinfo (CODESET);
15416 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15417 || strcmp (cs, "UTF-8") == 0)
15418 return 1;
15419 }
15420# endif
15421# ifdef __CYGWIN__
15422 /* On Cygwin, avoid locale names without encoding suffix, because the
15423 locale_charset() function relies on the encoding suffix. Note that
15424 LC_ALL is set on the command line. */
15425 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15426# endif
15427 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
15428 This excludes the UTF-8 encoding (except on MirBSD). */
15429 {
15430 const char *p;
15431 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15432 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
15433 for (p = buf; *p != '\0'; p++)
15434 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
15435 return 1;
15436 }
15437 /* Check whether a typical GB18030 multibyte sequence is recognized as a
15438 single wide character. This excludes the GB2312 and GBK encodings. */
15439 if (mblen ("\203\062\332\066", 5) != 4)
15440 return 1;
5abebf3c 15441 return 0;
c0c3707f 15442#endif
5abebf3c 15443}
c0c3707f 15444
5abebf3c 15445_ACEOF
c0c3707f
CB
15446 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15447 (eval $ac_link) 2>&5
15448 ac_status=$?
15449 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15450 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15451 case "$host_os" in
15452 # Handle native Windows specially, because there setlocale() interprets
15453 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15454 # "fr" or "fra" as "French" or "French_France.1252",
15455 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15456 # "ja" as "Japanese" or "Japanese_Japan.932",
15457 # and similar.
15458 mingw*)
15459 # Test for the hypothetical native Windows locale name.
15460 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15461 gt_cv_locale_zh_CN=Chinese_China.54936
15462 else
15463 # None found.
15464 gt_cv_locale_zh_CN=none
15465 fi
15466 ;;
15467 solaris2.8)
15468 # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
15469 # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
15470 # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
15471 gt_cv_locale_zh_CN=none
15472 ;;
15473 *)
15474 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15475 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15476 # configure script would override the LC_ALL setting. Likewise for
15477 # LC_CTYPE, which is also set at the beginning of the configure script.
15478 # Test for the locale name without encoding suffix.
15479 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15480 gt_cv_locale_zh_CN=zh_CN
15481 else
15482 # Test for the locale name with explicit encoding suffix.
15483 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15484 gt_cv_locale_zh_CN=zh_CN.GB18030
15485 else
15486 # None found.
15487 gt_cv_locale_zh_CN=none
15488 fi
15489 fi
15490 ;;
15491 esac
15492 else
15493 # If there was a link error, due to mblen(), the system is so old that
15494 # it certainly doesn't have a chinese locale.
15495 gt_cv_locale_zh_CN=none
15496 fi
15497 rm -fr conftest*
15498
5abebf3c 15499fi
c0c3707f
CB
15500{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
15501$as_echo "$gt_cv_locale_zh_CN" >&6; }
15502 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
15503
15504
15505{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
15506$as_echo_n "checking for inline... " >&6; }
15507if ${ac_cv_c_inline+:} false; then :
15508 $as_echo_n "(cached) " >&6
15509else
15510 ac_cv_c_inline=no
15511for ac_kw in inline __inline__ __inline; do
15512 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15513/* end confdefs.h. */
15514#ifndef __cplusplus
15515typedef int foo_t;
15516static $ac_kw foo_t static_foo () {return 0; }
15517$ac_kw foo_t foo () {return 0; }
15518#endif
5abebf3c 15519
c0c3707f
CB
15520_ACEOF
15521if ac_fn_c_try_compile "$LINENO"; then :
15522 ac_cv_c_inline=$ac_kw
15523fi
15524rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15525 test "$ac_cv_c_inline" != no && break
15526done
5abebf3c
CB
15527
15528fi
c0c3707f
CB
15529{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
15530$as_echo "$ac_cv_c_inline" >&6; }
5abebf3c 15531
c0c3707f
CB
15532case $ac_cv_c_inline in
15533 inline | yes) ;;
15534 *)
15535 case $ac_cv_c_inline in
15536 no) ac_val=;;
15537 *) ac_val=$ac_cv_c_inline;;
15538 esac
15539 cat >>confdefs.h <<_ACEOF
15540#ifndef __cplusplus
15541#define inline $ac_val
15542#endif
15543_ACEOF
15544 ;;
15545esac
5abebf3c
CB
15546
15547
15548
15549
5abebf3c
CB
15550
15551
c0c3707f
CB
15552 GNULIB_EXPLICIT_BZERO=0;
15553 GNULIB_FFSL=0;
15554 GNULIB_FFSLL=0;
15555 GNULIB_MEMCHR=0;
15556 GNULIB_MEMMEM=0;
15557 GNULIB_MEMPCPY=0;
15558 GNULIB_MEMRCHR=0;
15559 GNULIB_RAWMEMCHR=0;
15560 GNULIB_STPCPY=0;
15561 GNULIB_STPNCPY=0;
15562 GNULIB_STRCHRNUL=0;
15563 GNULIB_STRDUP=0;
15564 GNULIB_STRNCAT=0;
15565 GNULIB_STRNDUP=0;
15566 GNULIB_STRNLEN=0;
15567 GNULIB_STRPBRK=0;
15568 GNULIB_STRSEP=0;
15569 GNULIB_STRSTR=0;
15570 GNULIB_STRCASESTR=0;
15571 GNULIB_STRTOK_R=0;
15572 GNULIB_MBSLEN=0;
15573 GNULIB_MBSNLEN=0;
15574 GNULIB_MBSCHR=0;
15575 GNULIB_MBSRCHR=0;
15576 GNULIB_MBSSTR=0;
15577 GNULIB_MBSCASECMP=0;
15578 GNULIB_MBSNCASECMP=0;
15579 GNULIB_MBSPCASECMP=0;
15580 GNULIB_MBSCASESTR=0;
15581 GNULIB_MBSCSPN=0;
15582 GNULIB_MBSPBRK=0;
15583 GNULIB_MBSSPN=0;
15584 GNULIB_MBSSEP=0;
15585 GNULIB_MBSTOK_R=0;
15586 GNULIB_STRERROR=0;
15587 GNULIB_STRERROR_R=0;
9c9d63b1
PM
15588 GNULIB_STRERRORNAME_NP=0;
15589 GNULIB_SIGABBREV_NP=0;
15590 GNULIB_SIGDESCR_NP=0;
c0c3707f
CB
15591 GNULIB_STRSIGNAL=0;
15592 GNULIB_STRVERSCMP=0;
15593 HAVE_MBSLEN=0;
9c9d63b1
PM
15594 GNULIB_MDA_MEMCCPY=1;
15595 GNULIB_MDA_STRDUP=1;
c0c3707f
CB
15596 HAVE_EXPLICIT_BZERO=1;
15597 HAVE_FFSL=1;
15598 HAVE_FFSLL=1;
c0c3707f
CB
15599 HAVE_DECL_MEMMEM=1;
15600 HAVE_MEMPCPY=1;
15601 HAVE_DECL_MEMRCHR=1;
15602 HAVE_RAWMEMCHR=1;
15603 HAVE_STPCPY=1;
15604 HAVE_STPNCPY=1;
15605 HAVE_STRCHRNUL=1;
15606 HAVE_DECL_STRDUP=1;
15607 HAVE_DECL_STRNDUP=1;
15608 HAVE_DECL_STRNLEN=1;
15609 HAVE_STRPBRK=1;
15610 HAVE_STRSEP=1;
15611 HAVE_STRCASESTR=1;
15612 HAVE_DECL_STRTOK_R=1;
15613 HAVE_DECL_STRERROR_R=1;
9c9d63b1
PM
15614 HAVE_STRERRORNAME_NP=1;
15615 HAVE_SIGABBREV_NP=1;
15616 HAVE_SIGDESCR_NP=1;
c0c3707f
CB
15617 HAVE_DECL_STRSIGNAL=1;
15618 HAVE_STRVERSCMP=1;
9c9d63b1 15619 REPLACE_FFSLL=0;
c0c3707f
CB
15620 REPLACE_MEMCHR=0;
15621 REPLACE_MEMMEM=0;
15622 REPLACE_STPNCPY=0;
15623 REPLACE_STRCHRNUL=0;
15624 REPLACE_STRDUP=0;
15625 REPLACE_STRNCAT=0;
15626 REPLACE_STRNDUP=0;
15627 REPLACE_STRNLEN=0;
15628 REPLACE_STRSTR=0;
15629 REPLACE_STRCASESTR=0;
15630 REPLACE_STRTOK_R=0;
15631 REPLACE_STRERROR=0;
15632 REPLACE_STRERROR_R=0;
9c9d63b1 15633 REPLACE_STRERRORNAME_NP=0;
c0c3707f
CB
15634 REPLACE_STRSIGNAL=0;
15635 UNDEFINE_STRTOK_R=0;
5abebf3c
CB
15636
15637
15638
15639
6ec2e0f5
SDJ
15640
15641
c0c3707f
CB
15642 # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
15643 # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
15644 # irrelevant for anonymous mappings.
15645 ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
15646if test "x$ac_cv_func_mmap" = xyes; then :
15647 gl_have_mmap=yes
6ec2e0f5 15648else
c0c3707f
CB
15649 gl_have_mmap=no
15650fi
6ec2e0f5
SDJ
15651
15652
c0c3707f
CB
15653 # Try to allow MAP_ANONYMOUS.
15654 gl_have_mmap_anonymous=no
15655 if test $gl_have_mmap = yes; then
15656 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
15657$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
15658 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15659/* end confdefs.h. */
6ec2e0f5 15660
c0c3707f
CB
15661#include <sys/mman.h>
15662#ifdef MAP_ANONYMOUS
15663 I cannot identify this map
15664#endif
6ec2e0f5 15665
c0c3707f
CB
15666_ACEOF
15667if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15668 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
15669 gl_have_mmap_anonymous=yes
6ec2e0f5 15670fi
c0c3707f 15671rm -f conftest*
6ec2e0f5 15672
c0c3707f
CB
15673 if test $gl_have_mmap_anonymous != yes; then
15674 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15675/* end confdefs.h. */
6ec2e0f5 15676
c0c3707f
CB
15677#include <sys/mman.h>
15678#ifdef MAP_ANON
15679 I cannot identify this map
15680#endif
6ec2e0f5 15681
c0c3707f
CB
15682_ACEOF
15683if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15684 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
6ec2e0f5 15685
c0c3707f 15686$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
5e8754f9 15687
c0c3707f 15688 gl_have_mmap_anonymous=yes
5e8754f9 15689fi
c0c3707f
CB
15690rm -f conftest*
15691
15692 fi
15693 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
15694$as_echo "$gl_have_mmap_anonymous" >&6; }
15695 if test $gl_have_mmap_anonymous = yes; then
6ec2e0f5 15696
c0c3707f 15697$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
6ec2e0f5 15698
c0c3707f
CB
15699 fi
15700 fi
6ec2e0f5
SDJ
15701
15702
15703
15704
6ec2e0f5 15705
9c9d63b1
PM
15706 # Detect platform-specific bugs in some versions of glibc:
15707 # memchr should not dereference anything with length 0
15708 # https://bugzilla.redhat.com/show_bug.cgi?id=499689
15709 # memchr should not dereference overestimated length after a match
15710 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
15711 # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
15712 # memchr should cast the second argument to 'unsigned char'.
15713 # This bug exists in Android 4.3.
15714 # Assume that memchr works on platforms that lack mprotect.
15715 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
c0c3707f
CB
15716$as_echo_n "checking whether memchr works... " >&6; }
15717if ${gl_cv_func_memchr_works+:} false; then :
15718 $as_echo_n "(cached) " >&6
6ec2e0f5 15719else
c0c3707f
CB
15720 if test "$cross_compiling" = yes; then :
15721 case "$host_os" in
9c9d63b1
PM
15722 # Guess no on Android.
15723 linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
15724 # Guess yes on native Windows.
15725 mingw*) gl_cv_func_memchr_works="guessing yes" ;;
15726 # If we don't know, obey --enable-cross-guesses.
15727 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
15728 esac
6ec2e0f5
SDJ
15729
15730else
15731 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15732/* end confdefs.h. */
15733
c0c3707f
CB
15734#include <string.h>
15735#if HAVE_SYS_MMAN_H
15736# include <fcntl.h>
15737# include <unistd.h>
15738# include <sys/types.h>
15739# include <sys/mman.h>
15740# ifndef MAP_FILE
15741# define MAP_FILE 0
15742# endif
15743#endif
6ec2e0f5
SDJ
15744
15745int
15746main ()
15747{
c0c3707f
CB
15748
15749 int result = 0;
15750 char *fence = NULL;
15751#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
15752# if HAVE_MAP_ANONYMOUS
15753 const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
15754 const int fd = -1;
15755# else /* !HAVE_MAP_ANONYMOUS */
15756 const int flags = MAP_FILE | MAP_PRIVATE;
15757 int fd = open ("/dev/zero", O_RDONLY, 0666);
15758 if (fd >= 0)
15759# endif
15760 {
15761 int pagesize = getpagesize ();
15762 char *two_pages =
15763 (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
15764 flags, fd, 0);
15765 if (two_pages != (char *)(-1)
15766 && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
15767 fence = two_pages + pagesize;
15768 }
15769#endif
15770 if (fence)
15771 {
9c9d63b1 15772 /* Test against bugs on glibc systems. */
c0c3707f
CB
15773 if (memchr (fence, 0, 0))
15774 result |= 1;
15775 strcpy (fence - 9, "12345678");
15776 if (memchr (fence - 9, 0, 79) != fence - 1)
15777 result |= 2;
15778 if (memchr (fence - 1, 0, 3) != fence - 1)
15779 result |= 4;
9c9d63b1
PM
15780 /* Test against bug on AIX 7.2. */
15781 if (memchr (fence - 4, '6', 16) != fence - 4)
15782 result |= 8;
c0c3707f
CB
15783 }
15784 /* Test against bug on Android 4.3. */
15785 {
15786 char input[3];
15787 input[0] = 'a';
15788 input[1] = 'b';
15789 input[2] = 'c';
15790 if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
9c9d63b1 15791 result |= 16;
c0c3707f
CB
15792 }
15793 return result;
6ec2e0f5
SDJ
15794
15795 ;
15796 return 0;
15797}
15798_ACEOF
15799if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 15800 gl_cv_func_memchr_works=yes
6ec2e0f5 15801else
c0c3707f 15802 gl_cv_func_memchr_works=no
6ec2e0f5
SDJ
15803fi
15804rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15805 conftest.$ac_objext conftest.beam conftest.$ac_ext
15806fi
15807
15808
15809fi
c0c3707f
CB
15810{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
15811$as_echo "$gl_cv_func_memchr_works" >&6; }
9c9d63b1
PM
15812 case "$gl_cv_func_memchr_works" in
15813 *yes) ;;
15814 *) REPLACE_MEMCHR=1 ;;
15815 esac
6ec2e0f5 15816
c0c3707f
CB
15817ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default"
15818if test "x$ac_cv_have_decl_memmem" = xyes; then :
6ec2e0f5
SDJ
15819 ac_have_decl=1
15820else
15821 ac_have_decl=0
15822fi
15823
15824cat >>confdefs.h <<_ACEOF
c0c3707f 15825#define HAVE_DECL_MEMMEM $ac_have_decl
6ec2e0f5
SDJ
15826_ACEOF
15827
472fa5ee 15828
6ec2e0f5
SDJ
15829
15830
15831
c0c3707f
CB
15832 for ac_func in memmem
15833do :
15834 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
15835if test "x$ac_cv_func_memmem" = xyes; then :
15836 cat >>confdefs.h <<_ACEOF
15837#define HAVE_MEMMEM 1
15838_ACEOF
6ec2e0f5 15839
c0c3707f
CB
15840fi
15841done
6ec2e0f5 15842
c0c3707f
CB
15843 if test $ac_cv_func_memmem = yes; then
15844 HAVE_MEMMEM=1
15845 else
15846 HAVE_MEMMEM=0
15847 fi
6ec2e0f5 15848
c0c3707f
CB
15849 if test $ac_cv_have_decl_memmem = no; then
15850 HAVE_DECL_MEMMEM=0
15851 else
15852 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
15853$as_echo_n "checking whether memmem works... " >&6; }
15854if ${gl_cv_func_memmem_works_always+:} false; then :
6ec2e0f5
SDJ
15855 $as_echo_n "(cached) " >&6
15856else
c0c3707f
CB
15857 if test "$cross_compiling" = yes; then :
15858 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15859/* end confdefs.h. */
472fa5ee 15860
c0c3707f
CB
15861#ifdef __GNU_LIBRARY__
15862 #include <features.h>
15863 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
15864 || __GLIBC_MINOR__ > 12)) \
15865 || (__GLIBC__ > 2)) \
15866 || defined __UCLIBC__
15867 Lucky user
15868 #endif
15869#elif defined __CYGWIN__
15870 #include <cygwin/version.h>
15871 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
15872 Lucky user
15873 #endif
15874#else
15875 Lucky user
15876#endif
472fa5ee 15877
c0c3707f
CB
15878_ACEOF
15879if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15880 $EGREP "Lucky user" >/dev/null 2>&1; then :
15881 gl_cv_func_memmem_works_always="guessing yes"
15882else
15883 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
15884fi
15885rm -f conftest*
472fa5ee
SM
15886
15887
6ec2e0f5
SDJ
15888else
15889 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15890/* end confdefs.h. */
c0c3707f
CB
15891
15892#include <string.h> /* for memmem */
15893#define P "_EF_BF_BD"
15894#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
15895#define NEEDLE P P P P P
6ec2e0f5
SDJ
15896
15897int
15898main ()
15899{
c0c3707f 15900
698be2d8
CB
15901 int result = 0;
15902 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
15903 result |= 1;
15904 /* Check for empty needle behavior. */
15905 {
15906 const char *haystack = "AAA";
15907 if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
15908 result |= 2;
15909 }
15910 return result;
15911
15912 ;
15913 return 0;
15914}
15915_ACEOF
15916if ac_fn_c_try_run "$LINENO"; then :
15917 gl_cv_func_memmem_works_always=yes
15918else
15919 gl_cv_func_memmem_works_always=no
15920fi
15921rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15922 conftest.$ac_objext conftest.beam conftest.$ac_ext
15923fi
15924
15925
15926fi
15927{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
15928$as_echo "$gl_cv_func_memmem_works_always" >&6; }
15929 case "$gl_cv_func_memmem_works_always" in
15930 *yes) ;;
15931 *)
15932 REPLACE_MEMMEM=1
15933 ;;
15934 esac
15935 fi
15936 :
15937
15938ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
15939if test "x$ac_cv_have_decl_memrchr" = xyes; then :
15940 ac_have_decl=1
15941else
15942 ac_have_decl=0
15943fi
15944
15945cat >>confdefs.h <<_ACEOF
15946#define HAVE_DECL_MEMRCHR $ac_have_decl
15947_ACEOF
15948
15949
15950
15951
15952
15953 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5
15954$as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; }
15955if ${gl_cv_minmax_in_limits_h+:} false; then :
15956 $as_echo_n "(cached) " >&6
15957else
15958 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15959/* end confdefs.h. */
15960#include <limits.h>
15961 int x = MIN (42, 17);
15962int
15963main ()
15964{
15965
15966 ;
15967 return 0;
15968}
15969_ACEOF
15970if ac_fn_c_try_compile "$LINENO"; then :
15971 gl_cv_minmax_in_limits_h=yes
15972else
15973 gl_cv_minmax_in_limits_h=no
15974fi
15975rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15976fi
15977{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5
15978$as_echo "$gl_cv_minmax_in_limits_h" >&6; }
15979 if test $gl_cv_minmax_in_limits_h = yes; then
15980
15981$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h
15982
15983 fi
15984
15985
15986
15987
15988
15989
15990 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5
15991$as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; }
15992if ${gl_cv_minmax_in_sys_param_h+:} false; then :
15993 $as_echo_n "(cached) " >&6
15994else
15995 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15996/* end confdefs.h. */
15997#include <sys/param.h>
15998 int x = MIN (42, 17);
15999int
16000main ()
16001{
16002
6ec2e0f5
SDJ
16003 ;
16004 return 0;
16005}
16006_ACEOF
698be2d8
CB
16007if ac_fn_c_try_compile "$LINENO"; then :
16008 gl_cv_minmax_in_sys_param_h=yes
6ec2e0f5 16009else
698be2d8 16010 gl_cv_minmax_in_sys_param_h=no
6ec2e0f5 16011fi
698be2d8 16012rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 16013fi
698be2d8
CB
16014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5
16015$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; }
16016 if test $gl_cv_minmax_in_sys_param_h = yes; then
6ec2e0f5 16017
698be2d8 16018$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
c0c3707f 16019
c0c3707f 16020 fi
c0c3707f 16021
c0c3707f 16022
698be2d8 16023
c0c3707f
CB
16024
16025
16026
16027
16028
16029
16030
16031 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
16032$as_echo_n "checking for O_CLOEXEC... " >&6; }
16033if ${gl_cv_macro_O_CLOEXEC+:} false; then :
6ec2e0f5
SDJ
16034 $as_echo_n "(cached) " >&6
16035else
16036 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16037/* end confdefs.h. */
c0c3707f
CB
16038#include <fcntl.h>
16039 #ifndef O_CLOEXEC
16040 choke me;
16041 #endif
6ec2e0f5
SDJ
16042
16043int
16044main ()
16045{
c0c3707f 16046return O_CLOEXEC;
6ec2e0f5
SDJ
16047 ;
16048 return 0;
16049}
16050_ACEOF
16051if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 16052 gl_cv_macro_O_CLOEXEC=yes
6ec2e0f5 16053else
c0c3707f 16054 gl_cv_macro_O_CLOEXEC=no
6ec2e0f5
SDJ
16055fi
16056rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16057fi
c0c3707f
CB
16058{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
16059$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
16060
16061
16062
16063 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
16064$as_echo_n "checking for promoted mode_t type... " >&6; }
16065if ${gl_cv_promoted_mode_t+:} false; then :
6ec2e0f5
SDJ
16066 $as_echo_n "(cached) " >&6
16067else
6ec2e0f5 16068
c0c3707f
CB
16069 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16070/* end confdefs.h. */
16071#include <sys/types.h>
6ec2e0f5
SDJ
16072int
16073main ()
16074{
c0c3707f 16075typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
6ec2e0f5
SDJ
16076 ;
16077 return 0;
16078}
16079_ACEOF
16080if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 16081 gl_cv_promoted_mode_t='int'
6ec2e0f5 16082else
c0c3707f 16083 gl_cv_promoted_mode_t='mode_t'
6ec2e0f5
SDJ
16084fi
16085rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 16086
6ec2e0f5 16087fi
c0c3707f
CB
16088{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
16089$as_echo "$gl_cv_promoted_mode_t" >&6; }
6ec2e0f5 16090
c0c3707f
CB
16091cat >>confdefs.h <<_ACEOF
16092#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
6ec2e0f5 16093_ACEOF
c0c3707f
CB
16094
16095
16096
16097
16098
9c9d63b1
PM
16099
16100
16101
16102
c0c3707f
CB
16103
16104ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
16105if test "x$ac_cv_have_decl_setenv" = xyes; then :
16106 ac_have_decl=1
6ec2e0f5 16107else
c0c3707f 16108 ac_have_decl=0
6ec2e0f5 16109fi
c0c3707f
CB
16110
16111cat >>confdefs.h <<_ACEOF
16112#define HAVE_DECL_SETENV $ac_have_decl
16113_ACEOF
16114
16115
16116
16117
16118
16119
16120 if test $ac_cv_have_decl_setenv = no; then
16121 HAVE_DECL_SETENV=0
6ec2e0f5
SDJ
16122 fi
16123
16124
16125
16126
16127
c0c3707f
CB
16128 for ac_header in search.h
16129do :
16130 ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
16131if test "x$ac_cv_header_search_h" = xyes; then :
16132 cat >>confdefs.h <<_ACEOF
16133#define HAVE_SEARCH_H 1
16134_ACEOF
6ec2e0f5 16135
c0c3707f 16136fi
6ec2e0f5 16137
c0c3707f 16138done
6ec2e0f5 16139
c0c3707f
CB
16140 for ac_func in tsearch
16141do :
16142 ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
16143if test "x$ac_cv_func_tsearch" = xyes; then :
16144 cat >>confdefs.h <<_ACEOF
16145#define HAVE_TSEARCH 1
16146_ACEOF
6ec2e0f5 16147
c0c3707f
CB
16148fi
16149done
6ec2e0f5
SDJ
16150
16151
16152
16153
c0c3707f
CB
16154 GNULIB_PTHREAD_SIGMASK=0;
16155 GNULIB_RAISE=0;
16156 GNULIB_SIGNAL_H_SIGPIPE=0;
16157 GNULIB_SIGPROCMASK=0;
16158 GNULIB_SIGACTION=0;
16159 HAVE_POSIX_SIGNALBLOCKING=1;
16160 HAVE_PTHREAD_SIGMASK=1;
16161 HAVE_RAISE=1;
16162 HAVE_SIGSET_T=1;
16163 HAVE_SIGINFO_T=1;
16164 HAVE_SIGACTION=1;
16165 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
6ec2e0f5 16166
c0c3707f 16167 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
6ec2e0f5 16168
c0c3707f
CB
16169 HAVE_SIGHANDLER_T=1;
16170 REPLACE_PTHREAD_SIGMASK=0;
16171 REPLACE_RAISE=0;
6ec2e0f5 16172
6ec2e0f5 16173
c0c3707f
CB
16174 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
16175 #include <signal.h>
16176 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
16177 #include <sys/types.h>
16178
16179"
16180if test "x$ac_cv_type_sigset_t" = xyes; then :
16181
16182cat >>confdefs.h <<_ACEOF
16183#define HAVE_SIGSET_T 1
16184_ACEOF
16185
16186gl_cv_type_sigset_t=yes
16187else
16188 gl_cv_type_sigset_t=no
16189fi
6ec2e0f5 16190
c0c3707f
CB
16191 if test $gl_cv_type_sigset_t != yes; then
16192 HAVE_SIGSET_T=0
16193 fi
6ec2e0f5 16194
c0c3707f
CB
16195{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
16196$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
16197if ${ac_cv_type_uid_t+:} false; then :
16198 $as_echo_n "(cached) " >&6
16199else
6ec2e0f5
SDJ
16200 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16201/* end confdefs.h. */
c0c3707f
CB
16202#include <sys/types.h>
16203
6ec2e0f5 16204_ACEOF
c0c3707f
CB
16205if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16206 $EGREP "uid_t" >/dev/null 2>&1; then :
16207 ac_cv_type_uid_t=yes
16208else
16209 ac_cv_type_uid_t=no
16210fi
16211rm -f conftest*
6ec2e0f5 16212
c0c3707f
CB
16213fi
16214{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
16215$as_echo "$ac_cv_type_uid_t" >&6; }
16216if test $ac_cv_type_uid_t = no; then
6ec2e0f5 16217
c0c3707f 16218$as_echo "#define uid_t int" >>confdefs.h
6ec2e0f5 16219
6ec2e0f5 16220
c0c3707f 16221$as_echo "#define gid_t int" >>confdefs.h
6ec2e0f5
SDJ
16222
16223fi
6ec2e0f5 16224
c0c3707f
CB
16225{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
16226$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
16227if ${ac_cv_header_stdbool_h+:} false; then :
16228 $as_echo_n "(cached) " >&6
16229else
16230 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16231/* end confdefs.h. */
16232
16233 #include <stdbool.h>
16234
16235 #ifdef __cplusplus
16236 typedef bool Bool;
16237 #else
16238 typedef _Bool Bool;
16239 #ifndef bool
16240 "error: bool is not defined"
16241 #endif
16242 #ifndef false
16243 "error: false is not defined"
16244 #endif
16245 #if false
16246 "error: false is not 0"
16247 #endif
16248 #ifndef true
16249 "error: true is not defined"
16250 #endif
16251 #if true != 1
16252 "error: true is not 1"
16253 #endif
16254 #endif
16255
16256 #ifndef __bool_true_false_are_defined
16257 "error: __bool_true_false_are_defined is not defined"
16258 #endif
16259
16260 struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
16261
16262 char a[true == 1 ? 1 : -1];
16263 char b[false == 0 ? 1 : -1];
16264 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
16265 char d[(bool) 0.5 == true ? 1 : -1];
16266 /* See body of main program for 'e'. */
16267 char f[(Bool) 0.0 == false ? 1 : -1];
16268 char g[true];
16269 char h[sizeof (Bool)];
16270 char i[sizeof s.t];
16271 enum { j = false, k = true, l = false * true, m = true * 256 };
16272 /* The following fails for
16273 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
16274 Bool n[m];
16275 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
16276 char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
16277 /* Catch a bug in an HP-UX C compiler. See
16278 https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
16279 https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
16280 */
16281 Bool q = true;
16282 Bool *pq = &q;
16283 bool *qq = &q;
6ec2e0f5 16284
c0c3707f
CB
16285int
16286main ()
16287{
6ec2e0f5 16288
c0c3707f
CB
16289 bool e = &s;
16290 *pq |= q; *pq |= ! q;
16291 *qq |= q; *qq |= ! q;
16292 /* Refer to every declared value, to avoid compiler optimizations. */
16293 return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
16294 + !m + !n + !o + !p + !q + !pq + !qq);
6ec2e0f5 16295
c0c3707f
CB
16296 ;
16297 return 0;
16298}
16299_ACEOF
16300if ac_fn_c_try_compile "$LINENO"; then :
16301 ac_cv_header_stdbool_h=yes
16302else
16303 ac_cv_header_stdbool_h=no
16304fi
16305rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16306fi
16307{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
16308$as_echo "$ac_cv_header_stdbool_h" >&6; }
16309 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
16310if test "x$ac_cv_type__Bool" = xyes; then :
6ec2e0f5 16311
c0c3707f
CB
16312cat >>confdefs.h <<_ACEOF
16313#define HAVE__BOOL 1
16314_ACEOF
6ec2e0f5
SDJ
16315
16316
c0c3707f 16317fi
6ec2e0f5
SDJ
16318
16319
9c9d63b1
PM
16320ac_fn_c_check_decl "$LINENO" "fcloseall" "ac_cv_have_decl_fcloseall" "$ac_includes_default"
16321if test "x$ac_cv_have_decl_fcloseall" = xyes; then :
16322 ac_have_decl=1
16323else
16324 ac_have_decl=0
16325fi
16326
16327cat >>confdefs.h <<_ACEOF
16328#define HAVE_DECL_FCLOSEALL $ac_have_decl
16329_ACEOF
16330
16331ac_fn_c_check_decl "$LINENO" "ecvt" "ac_cv_have_decl_ecvt" "$ac_includes_default"
16332if test "x$ac_cv_have_decl_ecvt" = xyes; then :
16333 ac_have_decl=1
16334else
16335 ac_have_decl=0
16336fi
16337
16338cat >>confdefs.h <<_ACEOF
16339#define HAVE_DECL_ECVT $ac_have_decl
16340_ACEOF
16341
16342ac_fn_c_check_decl "$LINENO" "fcvt" "ac_cv_have_decl_fcvt" "$ac_includes_default"
16343if test "x$ac_cv_have_decl_fcvt" = xyes; then :
16344 ac_have_decl=1
16345else
16346 ac_have_decl=0
16347fi
16348
16349cat >>confdefs.h <<_ACEOF
16350#define HAVE_DECL_FCVT $ac_have_decl
16351_ACEOF
16352
16353ac_fn_c_check_decl "$LINENO" "gcvt" "ac_cv_have_decl_gcvt" "$ac_includes_default"
16354if test "x$ac_cv_have_decl_gcvt" = xyes; then :
16355 ac_have_decl=1
16356else
16357 ac_have_decl=0
16358fi
472fa5ee 16359
9c9d63b1
PM
16360cat >>confdefs.h <<_ACEOF
16361#define HAVE_DECL_GCVT $ac_have_decl
16362_ACEOF
f8e27d88 16363
c0c3707f
CB
16364ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
16365if test "x$ac_cv_have_decl_strdup" = xyes; then :
6ec2e0f5
SDJ
16366 ac_have_decl=1
16367else
16368 ac_have_decl=0
16369fi
16370
16371cat >>confdefs.h <<_ACEOF
c0c3707f 16372#define HAVE_DECL_STRDUP $ac_have_decl
6ec2e0f5
SDJ
16373_ACEOF
16374
16375
c0c3707f
CB
16376 REPLACE_STRERROR_0=0
16377 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
16378$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
16379if ${gl_cv_func_strerror_0_works+:} false; then :
6ec2e0f5
SDJ
16380 $as_echo_n "(cached) " >&6
16381else
c0c3707f
CB
16382 if test "$cross_compiling" = yes; then :
16383 case "$host_os" in
16384 # Guess yes on glibc systems.
16385 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
16386 # Guess yes on musl systems.
16387 *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
16388 # Guess yes on native Windows.
16389 mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
16390 # If we don't know, obey --enable-cross-guesses.
16391 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
16392 esac
6ec2e0f5 16393
5e8754f9
SDJ
16394else
16395 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16396/* end confdefs.h. */
c0c3707f
CB
16397#include <string.h>
16398 #include <errno.h>
6ec2e0f5 16399
5e8754f9
SDJ
16400int
16401main ()
16402{
c0c3707f
CB
16403int result = 0;
16404 char *str;
16405 errno = 0;
16406 str = strerror (0);
16407 if (!*str) result |= 1;
16408 if (errno) result |= 2;
16409 if (strstr (str, "nknown") || strstr (str, "ndefined"))
16410 result |= 4;
16411 return result;
5e8754f9
SDJ
16412 ;
16413 return 0;
16414}
16415_ACEOF
c0c3707f
CB
16416if ac_fn_c_try_run "$LINENO"; then :
16417 gl_cv_func_strerror_0_works=yes
5e8754f9 16418else
c0c3707f 16419 gl_cv_func_strerror_0_works=no
5e8754f9 16420fi
c0c3707f
CB
16421rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16422 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 16423fi
6ec2e0f5 16424
6ec2e0f5 16425
c0c3707f
CB
16426fi
16427{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
16428$as_echo "$gl_cv_func_strerror_0_works" >&6; }
16429 case "$gl_cv_func_strerror_0_works" in
16430 *yes) ;;
16431 *)
16432 REPLACE_STRERROR_0=1
6ec2e0f5 16433
c0c3707f 16434$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
6ec2e0f5 16435
c0c3707f
CB
16436 ;;
16437 esac
6ec2e0f5
SDJ
16438
16439
16440
16441
472fa5ee
SM
16442
16443
16444
725e2999 16445
725e2999
JB
16446
16447
c0c3707f
CB
16448 if test $ac_cv_func_strerror_r = yes; then
16449 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
16450 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
16451$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
16452if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
16453 $as_echo_n "(cached) " >&6
16454else
16455 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16456/* end confdefs.h. */
16457#include <string.h>
16458 int strerror_r (int, char *, size_t);
725e2999 16459
c0c3707f
CB
16460int
16461main ()
16462{
725e2999 16463
c0c3707f
CB
16464 ;
16465 return 0;
16466}
16467_ACEOF
16468if ac_fn_c_try_compile "$LINENO"; then :
16469 gl_cv_func_strerror_r_posix_signature=yes
16470else
16471 gl_cv_func_strerror_r_posix_signature=no
16472fi
16473rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
725e2999 16474
c0c3707f
CB
16475fi
16476{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
16477$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
16478 if test $gl_cv_func_strerror_r_posix_signature = yes; then
16479 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
16480$as_echo_n "checking whether strerror_r works... " >&6; }
16481if ${gl_cv_func_strerror_r_works+:} false; then :
16482 $as_echo_n "(cached) " >&6
16483else
16484 if test "$cross_compiling" = yes; then :
725e2999 16485
c0c3707f
CB
16486 case "$host_os" in
16487 # Guess no on AIX.
16488 aix*) gl_cv_func_strerror_r_works="guessing no";;
16489 # Guess no on HP-UX.
16490 hpux*) gl_cv_func_strerror_r_works="guessing no";;
16491 # Guess no on BSD variants.
16492 *bsd*) gl_cv_func_strerror_r_works="guessing no";;
16493 # Guess yes otherwise.
16494 *) gl_cv_func_strerror_r_works="guessing yes";;
16495 esac
725e2999 16496
c0c3707f
CB
16497else
16498 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16499/* end confdefs.h. */
16500#include <errno.h>
16501 #include <string.h>
725e2999 16502
c0c3707f
CB
16503int
16504main ()
16505{
16506int result = 0;
16507 char buf[79];
16508 if (strerror_r (EACCES, buf, 0) < 0)
16509 result |= 1;
16510 errno = 0;
16511 if (strerror_r (EACCES, buf, sizeof buf) != 0)
16512 result |= 2;
16513 strcpy (buf, "Unknown");
16514 if (strerror_r (0, buf, sizeof buf) != 0)
16515 result |= 4;
16516 if (errno)
16517 result |= 8;
16518 if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
16519 result |= 0x10;
16520 errno = 0;
16521 *buf = 0;
16522 if (strerror_r (-3, buf, sizeof buf) < 0)
16523 result |= 0x20;
16524 if (errno)
16525 result |= 0x40;
16526 if (!*buf)
16527 result |= 0x80;
16528 return result;
725e2999 16529
c0c3707f
CB
16530 ;
16531 return 0;
16532}
16533_ACEOF
16534if ac_fn_c_try_run "$LINENO"; then :
16535 gl_cv_func_strerror_r_works=yes
16536else
16537 gl_cv_func_strerror_r_works=no
16538fi
16539rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16540 conftest.$ac_objext conftest.beam conftest.$ac_ext
16541fi
725e2999
JB
16542
16543
c0c3707f
CB
16544fi
16545{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16546$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16547 else
725e2999 16548
c0c3707f
CB
16549 if test $ac_cv_func___xpg_strerror_r = yes; then
16550 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
16551$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
16552if ${gl_cv_func_strerror_r_works+:} false; then :
725e2999
JB
16553 $as_echo_n "(cached) " >&6
16554else
c0c3707f
CB
16555 if test "$cross_compiling" = yes; then :
16556 gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
725e2999 16557
c0c3707f
CB
16558else
16559 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
725e2999 16560/* end confdefs.h. */
c0c3707f
CB
16561#include <errno.h>
16562 #include <string.h>
16563 extern
16564 #ifdef __cplusplus
16565 "C"
16566 #endif
16567 int __xpg_strerror_r(int, char *, size_t);
725e2999 16568
c0c3707f
CB
16569int
16570main ()
16571{
16572int result = 0;
16573 char buf[256] = "^";
16574 char copy[256];
16575 char *str = strerror (-1);
16576 strcpy (copy, str);
16577 if (__xpg_strerror_r (-2, buf, 1) == 0)
16578 result |= 1;
16579 if (*buf)
16580 result |= 2;
16581 __xpg_strerror_r (-2, buf, 256);
16582 if (strcmp (str, copy))
16583 result |= 4;
16584 return result;
725e2999 16585
c0c3707f
CB
16586 ;
16587 return 0;
16588}
725e2999 16589_ACEOF
c0c3707f
CB
16590if ac_fn_c_try_run "$LINENO"; then :
16591 gl_cv_func_strerror_r_works=yes
725e2999 16592else
c0c3707f 16593 gl_cv_func_strerror_r_works=no
725e2999 16594fi
c0c3707f
CB
16595rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16596 conftest.$ac_objext conftest.beam conftest.$ac_ext
725e2999 16597fi
725e2999 16598
725e2999 16599
c0c3707f
CB
16600fi
16601{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16602$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16603 fi
16604 fi
725e2999 16605 fi
725e2999
JB
16606 fi
16607
c0c3707f
CB
16608ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
16609if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
16610 ac_have_decl=1
725e2999 16611else
c0c3707f 16612 ac_have_decl=0
725e2999
JB
16613fi
16614
c0c3707f
CB
16615cat >>confdefs.h <<_ACEOF
16616#define HAVE_DECL_STRERROR_R $ac_have_decl
16617_ACEOF
725e2999
JB
16618
16619
16620
16621
16622
725e2999
JB
16623
16624
16625
725e2999
JB
16626
16627
16628
16629
16630
16631
16632
725e2999 16633 if test $gl_cv_have_include_next = yes; then
c0c3707f 16634 gl_cv_next_string_h='<'string.h'>'
725e2999 16635 else
c0c3707f
CB
16636 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
16637$as_echo_n "checking absolute name of <string.h>... " >&6; }
16638if ${gl_cv_next_string_h+:} false; then :
725e2999
JB
16639 $as_echo_n "(cached) " >&6
16640else
16641
725e2999
JB
16642
16643
16644 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16645/* end confdefs.h. */
c0c3707f 16646#include <string.h>
725e2999
JB
16647_ACEOF
16648 case "$host_os" in
16649 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16650 *) gl_absname_cpp="$ac_cpp" ;;
16651 esac
16652
16653 case "$host_os" in
16654 mingw*)
16655 gl_dirsep_regex='[/\\]'
16656 ;;
16657 *)
16658 gl_dirsep_regex='\/'
16659 ;;
16660 esac
16661 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 16662 gl_header_literal_regex=`echo 'string.h' \
725e2999
JB
16663 | sed -e "$gl_make_literal_regex_sed"`
16664 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16665 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16666 s|^/[^/]|//&|
16667 p
16668 q
16669 }'
6ec2e0f5 16670
c0c3707f 16671 gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
725e2999 16672 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16673
c0c3707f
CB
16674 gl_header=$gl_cv_absolute_string_h
16675 gl_cv_next_string_h='"'$gl_header'"'
6ec2e0f5
SDJ
16676
16677
725e2999 16678fi
c0c3707f
CB
16679{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
16680$as_echo "$gl_cv_next_string_h" >&6; }
725e2999 16681 fi
c0c3707f 16682 NEXT_STRING_H=$gl_cv_next_string_h
6ec2e0f5 16683
725e2999
JB
16684 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16685 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 16686 gl_next_as_first_directive='<'string.h'>'
725e2999
JB
16687 else
16688 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 16689 gl_next_as_first_directive=$gl_cv_next_string_h
725e2999 16690 fi
c0c3707f
CB
16691 NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
16692
16693
16694
6ec2e0f5
SDJ
16695
16696
16697
16698
16699
6ec2e0f5
SDJ
16700
16701
6ec2e0f5 16702
698be2d8
CB
16703ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
16704if test "x$ac_cv_have_decl_strnlen" = xyes; then :
16705 ac_have_decl=1
16706else
16707 ac_have_decl=0
16708fi
16709
16710cat >>confdefs.h <<_ACEOF
16711#define HAVE_DECL_STRNLEN $ac_have_decl
16712_ACEOF
16713
16714
16715
c0c3707f 16716
9c9d63b1 16717 if test $REPLACE_MEMCHR = 1; then
c0c3707f
CB
16718 REPLACE_STRSTR=1
16719 else
16720 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
16721$as_echo_n "checking whether strstr works... " >&6; }
16722if ${gl_cv_func_strstr_works_always+:} false; then :
6ec2e0f5
SDJ
16723 $as_echo_n "(cached) " >&6
16724else
c0c3707f
CB
16725 if test "$cross_compiling" = yes; then :
16726 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
16727/* end confdefs.h. */
16728
c0c3707f
CB
16729#ifdef __GNU_LIBRARY__
16730 #include <features.h>
16731 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
16732 || defined __UCLIBC__
16733 Lucky user
16734 #endif
16735#elif defined __CYGWIN__
16736 #include <cygwin/version.h>
16737 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
16738 Lucky user
16739 #endif
16740#else
16741 Lucky user
6ec2e0f5 16742#endif
c0c3707f
CB
16743
16744_ACEOF
16745if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16746 $EGREP "Lucky user" >/dev/null 2>&1; then :
16747 gl_cv_func_strstr_works_always="guessing yes"
16748else
16749 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
16750fi
16751rm -f conftest*
16752
16753
16754else
16755 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16756/* end confdefs.h. */
16757
16758#include <string.h> /* for strstr */
16759#ifdef __GNU_LIBRARY__
16760 #include <features.h>
16761 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
16762 Unlucky user
16763 #endif
725e2999 16764#endif
c0c3707f
CB
16765#define P "_EF_BF_BD"
16766#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
16767#define NEEDLE P P P P P
6ec2e0f5 16768
725e2999
JB
16769int
16770main ()
16771{
c0c3707f
CB
16772return !!strstr (HAYSTACK, NEEDLE);
16773
725e2999
JB
16774 ;
16775 return 0;
16776}
6ec2e0f5 16777_ACEOF
c0c3707f
CB
16778if ac_fn_c_try_run "$LINENO"; then :
16779 gl_cv_func_strstr_works_always=yes
6ec2e0f5 16780else
c0c3707f 16781 gl_cv_func_strstr_works_always=no
6ec2e0f5 16782fi
c0c3707f
CB
16783rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16784 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 16785fi
6ec2e0f5
SDJ
16786
16787
c0c3707f
CB
16788fi
16789{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
16790$as_echo "$gl_cv_func_strstr_works_always" >&6; }
16791 case "$gl_cv_func_strstr_works_always" in
16792 *yes) ;;
16793 *)
16794 REPLACE_STRSTR=1
16795 ;;
16796 esac
16797 fi
6ec2e0f5 16798
c0c3707f
CB
16799ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default"
16800if test "x$ac_cv_have_decl_strtok_r" = xyes; then :
16801 ac_have_decl=1
16802else
16803 ac_have_decl=0
16804fi
6ec2e0f5 16805
c0c3707f
CB
16806cat >>confdefs.h <<_ACEOF
16807#define HAVE_DECL_STRTOK_R $ac_have_decl
16808_ACEOF
6ec2e0f5
SDJ
16809
16810
16811
16812
6ec2e0f5
SDJ
16813
16814
16815
16816
16817
16818
16819
698be2d8
CB
16820
16821
c0c3707f 16822$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
6ec2e0f5 16823
6ec2e0f5
SDJ
16824
16825
16826
16827
16828
6ec2e0f5
SDJ
16829
16830
16831
16832
16833
c0c3707f
CB
16834 if test $gl_cv_have_include_next = yes; then
16835 gl_cv_next_sys_types_h='<'sys/types.h'>'
16836 else
16837 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
16838$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
16839if ${gl_cv_next_sys_types_h+:} false; then :
6ec2e0f5
SDJ
16840 $as_echo_n "(cached) " >&6
16841else
6ec2e0f5 16842
6ec2e0f5 16843
c0c3707f
CB
16844
16845 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16846/* end confdefs.h. */
16847#include <sys/types.h>
6ec2e0f5 16848_ACEOF
c0c3707f
CB
16849 case "$host_os" in
16850 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16851 *) gl_absname_cpp="$ac_cpp" ;;
16852 esac
6ec2e0f5 16853
c0c3707f
CB
16854 case "$host_os" in
16855 mingw*)
16856 gl_dirsep_regex='[/\\]'
16857 ;;
16858 *)
16859 gl_dirsep_regex='\/'
16860 ;;
16861 esac
16862 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16863 gl_header_literal_regex=`echo 'sys/types.h' \
16864 | sed -e "$gl_make_literal_regex_sed"`
16865 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16866 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16867 s|^/[^/]|//&|
16868 p
16869 q
16870 }'
6ec2e0f5 16871
c0c3707f
CB
16872 gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16873 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16874
c0c3707f
CB
16875 gl_header=$gl_cv_absolute_sys_types_h
16876 gl_cv_next_sys_types_h='"'$gl_header'"'
6ec2e0f5
SDJ
16877
16878
c0c3707f
CB
16879fi
16880{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
16881$as_echo "$gl_cv_next_sys_types_h" >&6; }
16882 fi
16883 NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
6ec2e0f5 16884
c0c3707f
CB
16885 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16886 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16887 gl_next_as_first_directive='<'sys/types.h'>'
16888 else
16889 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16890 gl_next_as_first_directive=$gl_cv_next_sys_types_h
16891 fi
16892 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
16893
16894
16895
16896
6ec2e0f5 16897
6ec2e0f5
SDJ
16898
16899
6ec2e0f5
SDJ
16900
16901
16902
16903
16904
c0c3707f 16905 WINDOWS_STAT_INODES=0
6ec2e0f5
SDJ
16906
16907
16908
16909
16910
472fa5ee
SM
16911
16912
16913
9c9d63b1
PM
16914 GNULIB_CTIME=0;
16915 GNULIB_MKTIME=0;
16916 GNULIB_LOCALTIME=0;
16917 GNULIB_NANOSLEEP=0;
16918 GNULIB_STRFTIME=0;
16919 GNULIB_STRPTIME=0;
16920 GNULIB_TIMEGM=0;
16921 GNULIB_TIMESPEC_GET=0;
16922 GNULIB_TIME_R=0;
16923 GNULIB_TIME_RZ=0;
16924 GNULIB_TZSET=0;
16925 GNULIB_MDA_TZSET=1;
16926 HAVE_DECL_LOCALTIME_R=1;
16927 HAVE_NANOSLEEP=1;
16928 HAVE_STRPTIME=1;
16929 HAVE_TIMEGM=1;
16930 HAVE_TIMESPEC_GET=1;
16931 HAVE_TIMEZONE_T=0;
16932 REPLACE_CTIME=GNULIB_PORTCHECK;
16933 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
16934 REPLACE_MKTIME=GNULIB_PORTCHECK;
16935 REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
16936 REPLACE_STRFTIME=GNULIB_PORTCHECK;
16937 REPLACE_TIMEGM=GNULIB_PORTCHECK;
16938 REPLACE_TZSET=GNULIB_PORTCHECK;
16939
16940 : ${GNULIB_GETTIMEOFDAY=0};
16941 REPLACE_GMTIME=0;
16942 REPLACE_LOCALTIME=0;
16943
16944
472fa5ee 16945
c0c3707f
CB
16946 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
16947$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
16948if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
16949 $as_echo_n "(cached) " >&6
16950else
16951 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16952/* end confdefs.h. */
16953#include <time.h>
472fa5ee 16954
c0c3707f
CB
16955int
16956main ()
16957{
16958static struct timespec x; x.tv_sec = x.tv_nsec;
16959 ;
16960 return 0;
16961}
6ec2e0f5 16962_ACEOF
c0c3707f
CB
16963if ac_fn_c_try_compile "$LINENO"; then :
16964 gl_cv_sys_struct_timespec_in_time_h=yes
16965else
16966 gl_cv_sys_struct_timespec_in_time_h=no
6ec2e0f5 16967fi
c0c3707f
CB
16968rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16969fi
16970{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
16971$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
6ec2e0f5 16972
c0c3707f
CB
16973 TIME_H_DEFINES_STRUCT_TIMESPEC=0
16974 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
16975 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
16976 UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
16977 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
16978 TIME_H_DEFINES_STRUCT_TIMESPEC=1
6ec2e0f5 16979 else
c0c3707f
CB
16980 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
16981$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
16982if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
16983 $as_echo_n "(cached) " >&6
16984else
16985 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16986/* end confdefs.h. */
16987#include <sys/time.h>
472fa5ee 16988
c0c3707f
CB
16989int
16990main ()
16991{
16992static struct timespec x; x.tv_sec = x.tv_nsec;
16993 ;
16994 return 0;
16995}
16996_ACEOF
16997if ac_fn_c_try_compile "$LINENO"; then :
16998 gl_cv_sys_struct_timespec_in_sys_time_h=yes
16999else
17000 gl_cv_sys_struct_timespec_in_sys_time_h=no
17001fi
17002rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17003fi
17004{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
17005$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
17006 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
17007 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
17008 else
17009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
17010$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
17011if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
17012 $as_echo_n "(cached) " >&6
17013else
17014 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17015/* end confdefs.h. */
17016#include <pthread.h>
472fa5ee 17017
c0c3707f
CB
17018int
17019main ()
17020{
17021static struct timespec x; x.tv_sec = x.tv_nsec;
17022 ;
17023 return 0;
17024}
17025_ACEOF
17026if ac_fn_c_try_compile "$LINENO"; then :
17027 gl_cv_sys_struct_timespec_in_pthread_h=yes
17028else
17029 gl_cv_sys_struct_timespec_in_pthread_h=no
17030fi
17031rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17032fi
17033{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
17034$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
17035 if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
17036 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
17037 else
17038 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
17039$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
17040if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
17041 $as_echo_n "(cached) " >&6
17042else
17043 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17044/* end confdefs.h. */
17045#include <unistd.h>
6ec2e0f5 17046
c0c3707f
CB
17047int
17048main ()
17049{
17050static struct timespec x; x.tv_sec = x.tv_nsec;
17051 ;
17052 return 0;
17053}
17054_ACEOF
17055if ac_fn_c_try_compile "$LINENO"; then :
17056 gl_cv_sys_struct_timespec_in_unistd_h=yes
17057else
17058 gl_cv_sys_struct_timespec_in_unistd_h=no
17059fi
17060rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17061fi
17062{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
17063$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
17064 if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
17065 UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
17066 fi
6ec2e0f5
SDJ
17067 fi
17068 fi
c0c3707f 17069 fi
6ec2e0f5
SDJ
17070
17071
17072
17073
17074
17075
6ec2e0f5 17076
6ec2e0f5
SDJ
17077
17078
17079
17080
17081
6ec2e0f5
SDJ
17082
17083
17084
17085
c0c3707f
CB
17086 if test $gl_cv_have_include_next = yes; then
17087 gl_cv_next_time_h='<'time.h'>'
17088 else
17089 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
17090$as_echo_n "checking absolute name of <time.h>... " >&6; }
17091if ${gl_cv_next_time_h+:} false; then :
17092 $as_echo_n "(cached) " >&6
17093else
6ec2e0f5 17094
6ec2e0f5
SDJ
17095
17096
c0c3707f
CB
17097 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17098/* end confdefs.h. */
17099#include <time.h>
17100_ACEOF
17101 case "$host_os" in
17102 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17103 *) gl_absname_cpp="$ac_cpp" ;;
17104 esac
6ec2e0f5 17105
c0c3707f
CB
17106 case "$host_os" in
17107 mingw*)
17108 gl_dirsep_regex='[/\\]'
17109 ;;
17110 *)
17111 gl_dirsep_regex='\/'
17112 ;;
17113 esac
17114 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17115 gl_header_literal_regex=`echo 'time.h' \
17116 | sed -e "$gl_make_literal_regex_sed"`
17117 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17118 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17119 s|^/[^/]|//&|
17120 p
17121 q
17122 }'
6ec2e0f5 17123
c0c3707f
CB
17124 gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17125 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 17126
c0c3707f
CB
17127 gl_header=$gl_cv_absolute_time_h
17128 gl_cv_next_time_h='"'$gl_header'"'
6ec2e0f5 17129
6ec2e0f5
SDJ
17130
17131fi
c0c3707f
CB
17132{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
17133$as_echo "$gl_cv_next_time_h" >&6; }
17134 fi
17135 NEXT_TIME_H=$gl_cv_next_time_h
6ec2e0f5 17136
c0c3707f
CB
17137 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17138 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17139 gl_next_as_first_directive='<'time.h'>'
17140 else
17141 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17142 gl_next_as_first_directive=$gl_cv_next_time_h
17143 fi
17144 NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
6ec2e0f5 17145
472fa5ee
SM
17146
17147
17148
17149
17150
6ec2e0f5 17151
6ec2e0f5 17152
9c9d63b1
PM
17153 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME_UTC in <time.h>" >&5
17154$as_echo_n "checking for TIME_UTC in <time.h>... " >&6; }
17155if ${gl_cv_time_h_has_TIME_UTC+:} false; then :
17156 $as_echo_n "(cached) " >&6
17157else
17158 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17159/* end confdefs.h. */
17160#include <time.h>
17161
17162int
17163main ()
17164{
17165static int x = TIME_UTC; x++;
17166 ;
17167 return 0;
17168}
17169_ACEOF
17170if ac_fn_c_try_compile "$LINENO"; then :
17171 gl_cv_time_h_has_TIME_UTC=yes
17172else
17173 gl_cv_time_h_has_TIME_UTC=no
17174fi
17175rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17176fi
17177{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_h_has_TIME_UTC" >&5
17178$as_echo "$gl_cv_time_h_has_TIME_UTC" >&6; }
17179 if test $gl_cv_time_h_has_TIME_UTC = yes; then
17180 TIME_H_DEFINES_TIME_UTC=1
17181 else
17182 TIME_H_DEFINES_TIME_UTC=0
17183 fi
17184
17185
6ec2e0f5 17186
6ec2e0f5 17187
9c9d63b1
PM
17188ac_fn_c_check_decl "$LINENO" "execvpe" "ac_cv_have_decl_execvpe" "$ac_includes_default"
17189if test "x$ac_cv_have_decl_execvpe" = xyes; then :
17190 ac_have_decl=1
17191else
17192 ac_have_decl=0
17193fi
698be2d8 17194
9c9d63b1
PM
17195cat >>confdefs.h <<_ACEOF
17196#define HAVE_DECL_EXECVPE $ac_have_decl
17197_ACEOF
698be2d8 17198
c0c3707f
CB
17199ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
17200if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
17201 ac_have_decl=1
17202else
17203 ac_have_decl=0
17204fi
6ec2e0f5 17205
c0c3707f
CB
17206cat >>confdefs.h <<_ACEOF
17207#define HAVE_DECL_UNSETENV $ac_have_decl
17208_ACEOF
6ec2e0f5
SDJ
17209
17210
6ec2e0f5
SDJ
17211
17212
17213
c0c3707f
CB
17214 if test $ac_cv_header_crtdefs_h = yes; then
17215 HAVE_CRTDEFS_H=1
17216 else
17217 HAVE_CRTDEFS_H=0
5e8754f9 17218 fi
5e8754f9 17219
5e8754f9 17220
5e8754f9 17221
c0c3707f 17222 GNULIB_ISWBLANK=0;
5df4cba6
SM
17223 GNULIB_ISWDIGIT=0;
17224 GNULIB_ISWXDIGIT=0;
c0c3707f
CB
17225 GNULIB_WCTYPE=0;
17226 GNULIB_ISWCTYPE=0;
17227 GNULIB_WCTRANS=0;
17228 GNULIB_TOWCTRANS=0;
17229 HAVE_ISWBLANK=1;
17230 HAVE_WCTYPE_T=1;
17231 HAVE_WCTRANS_T=1;
17232 REPLACE_ISWBLANK=0;
5df4cba6
SM
17233 REPLACE_ISWDIGIT=0;
17234 REPLACE_ISWXDIGIT=0;
5e8754f9 17235
5e8754f9 17236
5e8754f9 17237
5e8754f9 17238
698be2d8
CB
17239
17240
17241
17242
c0c3707f
CB
17243 if false; then
17244 GL_COND_LIBTOOL_TRUE=
17245 GL_COND_LIBTOOL_FALSE='#'
17246else
17247 GL_COND_LIBTOOL_TRUE='#'
17248 GL_COND_LIBTOOL_FALSE=
17249fi
5e8754f9 17250
c0c3707f
CB
17251 gl_cond_libtool=false
17252 gl_libdeps=
17253 gl_ltlibdeps=
17254 gl_m4_base='import/m4'
5e8754f9 17255
5e8754f9
SDJ
17256
17257
6ec2e0f5 17258
6ec2e0f5 17259
6ec2e0f5 17260
6ec2e0f5 17261
6ec2e0f5 17262
6ec2e0f5 17263
5df4cba6 17264
c0c3707f
CB
17265 gl_source_base='import'
17266
6ec2e0f5 17267
c0c3707f
CB
17268 if test $ac_cv_func_alloca_works = no; then
17269 :
17270 fi
6ec2e0f5 17271
c0c3707f
CB
17272 # Define an additional variable used in the Makefile substitution.
17273 if test $ac_cv_working_alloca_h = yes; then
17274 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
17275$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
17276if ${gl_cv_rpl_alloca+:} false; then :
6ec2e0f5
SDJ
17277 $as_echo_n "(cached) " >&6
17278else
c0c3707f
CB
17279
17280 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
17281/* end confdefs.h. */
17282
c0c3707f
CB
17283#if defined __GNUC__ || defined _AIX || defined _MSC_VER
17284 Need own alloca
17285#endif
6ec2e0f5 17286
6ec2e0f5 17287_ACEOF
c0c3707f
CB
17288if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17289 $EGREP "Need own alloca" >/dev/null 2>&1; then :
17290 gl_cv_rpl_alloca=yes
6ec2e0f5 17291else
c0c3707f 17292 gl_cv_rpl_alloca=no
6ec2e0f5 17293fi
c0c3707f 17294rm -f conftest*
6ec2e0f5
SDJ
17295
17296
17297fi
c0c3707f
CB
17298{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
17299$as_echo "$gl_cv_rpl_alloca" >&6; }
17300 if test $gl_cv_rpl_alloca = yes; then
6ec2e0f5 17301
c0c3707f 17302$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
6ec2e0f5 17303
c0c3707f
CB
17304 ALLOCA_H=alloca.h
17305 else
17306 ALLOCA_H=
17307 fi
17308 else
17309 ALLOCA_H=alloca.h
17310 fi
6ec2e0f5 17311
c0c3707f
CB
17312 if test -n "$ALLOCA_H"; then
17313 GL_GENERATE_ALLOCA_H_TRUE=
17314 GL_GENERATE_ALLOCA_H_FALSE='#'
17315else
17316 GL_GENERATE_ALLOCA_H_TRUE='#'
17317 GL_GENERATE_ALLOCA_H_FALSE=
17318fi
6ec2e0f5
SDJ
17319
17320
c0c3707f
CB
17321 if test $ac_cv_working_alloca_h = yes; then
17322 HAVE_ALLOCA_H=1
17323 else
17324 HAVE_ALLOCA_H=0
17325 fi
6ec2e0f5
SDJ
17326
17327
17328
17329
17330
17331
c0c3707f
CB
17332 if test $ac_cv_header_arpa_inet_h = yes; then
17333 HAVE_ARPA_INET_H=1
17334 else
17335 HAVE_ARPA_INET_H=0
17336 fi
6ec2e0f5
SDJ
17337
17338
472fa5ee
SM
17339
17340
17341
17342
17343
6ec2e0f5
SDJ
17344
17345
17346
17347 if test $gl_cv_have_include_next = yes; then
c0c3707f 17348 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5 17349 else
c0c3707f
CB
17350 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
17351$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
17352if ${gl_cv_next_arpa_inet_h+:} false; then :
6ec2e0f5
SDJ
17353 $as_echo_n "(cached) " >&6
17354else
17355
c0c3707f 17356 if test $ac_cv_header_arpa_inet_h = yes; then
6ec2e0f5
SDJ
17357
17358
17359
17360
17361 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17362/* end confdefs.h. */
c0c3707f 17363#include <arpa/inet.h>
6ec2e0f5
SDJ
17364_ACEOF
17365 case "$host_os" in
17366 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17367 *) gl_absname_cpp="$ac_cpp" ;;
17368 esac
17369
17370 case "$host_os" in
17371 mingw*)
17372 gl_dirsep_regex='[/\\]'
17373 ;;
17374 *)
17375 gl_dirsep_regex='\/'
17376 ;;
17377 esac
17378 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 17379 gl_header_literal_regex=`echo 'arpa/inet.h' \
6ec2e0f5
SDJ
17380 | sed -e "$gl_make_literal_regex_sed"`
17381 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17382 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17383 s|^/[^/]|//&|
17384 p
17385 q
17386 }'
17387
c0c3707f 17388 gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5
SDJ
17389 sed -n "$gl_absolute_header_sed"`
17390
c0c3707f
CB
17391 gl_header=$gl_cv_absolute_arpa_inet_h
17392 gl_cv_next_arpa_inet_h='"'$gl_header'"'
6ec2e0f5 17393 else
c0c3707f 17394 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5
SDJ
17395 fi
17396
c0c3707f 17397
6ec2e0f5 17398fi
c0c3707f
CB
17399{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
17400$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
17401 fi
17402 NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
6ec2e0f5 17403
c0c3707f
CB
17404 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17405 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17406 gl_next_as_first_directive='<'arpa/inet.h'>'
17407 else
17408 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17409 gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
17410 fi
17411 NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
17412
17413
6ec2e0f5 17414
6ec2e0f5 17415
6ec2e0f5
SDJ
17416
17417
6ec2e0f5
SDJ
17418
17419
17420
c0c3707f
CB
17421 if test $ac_cv_header_sys_socket_h = yes; then
17422 HAVE_WS2TCPIP_H=0
17423 else
17424 if test $ac_cv_header_ws2tcpip_h = yes; then
17425 HAVE_WS2TCPIP_H=1
17426 else
17427 HAVE_WS2TCPIP_H=0
17428 fi
17429 fi
17430
17431
6ec2e0f5
SDJ
17432
17433
6ec2e0f5
SDJ
17434
17435
17436
17437
17438
698be2d8
CB
17439
17440
17441
17442
17443
17444
17445 if test $ac_cv_func_btowc = no; then
17446 HAVE_BTOWC=0
17447 else
17448
17449
17450
17451
17452 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
17453$as_echo_n "checking whether btowc(0) is correct... " >&6; }
17454if ${gl_cv_func_btowc_nul+:} false; then :
17455 $as_echo_n "(cached) " >&6
17456else
17457
17458 if test "$cross_compiling" = yes; then :
17459
17460 case "$host_os" in
17461 # Guess no on Cygwin.
17462 cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
17463 # Guess yes on native Windows.
17464 mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
17465 # Guess yes otherwise.
17466 *) gl_cv_func_btowc_nul="guessing yes" ;;
17467 esac
17468
17469else
17470 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17471/* end confdefs.h. */
17472
698be2d8
CB
17473#include <wchar.h>
17474int main ()
17475{
17476 if (btowc ('\0') != 0)
17477 return 1;
17478 return 0;
17479}
17480_ACEOF
17481if ac_fn_c_try_run "$LINENO"; then :
17482 gl_cv_func_btowc_nul=yes
17483else
17484 gl_cv_func_btowc_nul=no
17485fi
17486rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17487 conftest.$ac_objext conftest.beam conftest.$ac_ext
17488fi
17489
17490
17491fi
17492{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
17493$as_echo "$gl_cv_func_btowc_nul" >&6; }
17494
17495 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
17496$as_echo_n "checking whether btowc(EOF) is correct... " >&6; }
17497if ${gl_cv_func_btowc_eof+:} false; then :
17498 $as_echo_n "(cached) " >&6
17499else
17500
17501 case "$host_os" in
17502 # Guess no on IRIX.
17503 irix*) gl_cv_func_btowc_eof="guessing no" ;;
17504 # Guess yes on native Windows.
17505 mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
17506 # Guess yes otherwise.
17507 *) gl_cv_func_btowc_eof="guessing yes" ;;
17508 esac
17509 if test $LOCALE_FR != none; then
17510 if test "$cross_compiling" = yes; then :
17511 :
17512else
17513 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17514/* end confdefs.h. */
17515
17516#include <locale.h>
698be2d8 17517#include <stdio.h>
698be2d8
CB
17518#include <wchar.h>
17519int main ()
17520{
17521 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
17522 {
17523 if (btowc (EOF) != WEOF)
17524 return 1;
17525 }
17526 return 0;
17527}
17528_ACEOF
17529if ac_fn_c_try_run "$LINENO"; then :
17530 gl_cv_func_btowc_eof=yes
17531else
17532 gl_cv_func_btowc_eof=no
17533fi
17534rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17535 conftest.$ac_objext conftest.beam conftest.$ac_ext
17536fi
17537
17538 fi
17539
17540fi
17541{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
17542$as_echo "$gl_cv_func_btowc_eof" >&6; }
17543
17544 case "$gl_cv_func_btowc_nul" in
17545 *yes) ;;
17546 *) REPLACE_BTOWC=1 ;;
17547 esac
17548 case "$gl_cv_func_btowc_eof" in
17549 *yes) ;;
17550 *) REPLACE_BTOWC=1 ;;
17551 esac
17552 fi
17553
17554 if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
17555
17556
17557
17558
17559
17560
17561
17562
17563 gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext"
17564
17565
17566 :
17567
17568 fi
17569
17570
17571
17572
17573
17574 GNULIB_BTOWC=1
17575
17576
17577
17578
17579
17580$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
17581
17582
17583
17584
c0c3707f
CB
17585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
17586$as_echo_n "checking for __builtin_expect... " >&6; }
17587if ${gl_cv___builtin_expect+:} false; then :
6ec2e0f5
SDJ
17588 $as_echo_n "(cached) " >&6
17589else
c0c3707f
CB
17590 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17591/* end confdefs.h. */
17592
17593 int
17594 main (int argc, char **argv)
17595 {
17596 argc = __builtin_expect (argc, 100);
17597 return argv[argc != 100][0];
17598 }
17599_ACEOF
17600if ac_fn_c_try_link "$LINENO"; then :
17601 gl_cv___builtin_expect=yes
17602else
17603 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17604/* end confdefs.h. */
17605
17606 #include <builtins.h>
17607 int
17608 main (int argc, char **argv)
17609 {
17610 argc = __builtin_expect (argc, 100);
17611 return argv[argc != 100][0];
17612 }
17613_ACEOF
17614if ac_fn_c_try_link "$LINENO"; then :
17615 gl_cv___builtin_expect="in <builtins.h>"
17616else
17617 gl_cv___builtin_expect=no
6ec2e0f5 17618fi
c0c3707f
CB
17619rm -f core conftest.err conftest.$ac_objext \
17620 conftest$ac_exeext conftest.$ac_ext
17621fi
17622rm -f core conftest.err conftest.$ac_objext \
17623 conftest$ac_exeext conftest.$ac_ext
17624fi
17625{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
17626$as_echo "$gl_cv___builtin_expect" >&6; }
17627 if test "$gl_cv___builtin_expect" = yes; then
17628 $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
8690e634 17629
c0c3707f
CB
17630 elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
17631 $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
8690e634 17632
6ec2e0f5 17633 fi
8690e634
JK
17634
17635
17636
17637
c0c3707f
CB
17638
17639 if test $ac_cv_func_canonicalize_file_name = no; then
17640 HAVE_CANONICALIZE_FILE_NAME=0
17641 if test $ac_cv_func_realpath = no; then
17642 HAVE_REALPATH=0
17643 else
17644 case "$gl_cv_func_realpath_works" in
17645 *yes) ;;
17646 *) REPLACE_REALPATH=1 ;;
17647 esac
17648 fi
17649 else
17650 case "$gl_cv_func_realpath_works" in
17651 *yes)
17652 ;;
17653 *)
17654 REPLACE_CANONICALIZE_FILE_NAME=1
17655 REPLACE_REALPATH=1
17656 ;;
17657 esac
5e8754f9 17658 fi
8690e634 17659
c0c3707f 17660 if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
8690e634
JK
17661
17662
17663
472fa5ee
SM
17664
17665
17666
17667
17668
c0c3707f
CB
17669 gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
17670
6ec2e0f5 17671 fi
8690e634
JK
17672
17673
c0c3707f
CB
17674cat >>confdefs.h <<_ACEOF
17675#define GNULIB_CANONICALIZE_LGPL 1
17676_ACEOF
8690e634 17677
8690e634 17678
8690e634 17679
8690e634 17680
8690e634 17681
8690e634 17682
8690e634 17683
c0c3707f 17684 GNULIB_CANONICALIZE_FILE_NAME=1
8690e634 17685
8690e634 17686
8690e634 17687
6ec2e0f5
SDJ
17688
17689
c0c3707f 17690$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
6ec2e0f5 17691
6ec2e0f5 17692
8690e634
JK
17693
17694
8690e634
JK
17695
17696
17697
17698
c0c3707f 17699 GNULIB_REALPATH=1
6ec2e0f5
SDJ
17700
17701
17702
17703
6ec2e0f5 17704
c0c3707f 17705$as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
6ec2e0f5
SDJ
17706
17707
17708
17709
17710
17711
17712
6ec2e0f5 17713
c0c3707f 17714 GNULIB_CHDIR=1
6ec2e0f5 17715
8690e634 17716
8690e634 17717
6ec2e0f5 17718
6ec2e0f5 17719
c0c3707f
CB
17720$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
17721
17722
17723
17724
17725
9c9d63b1
PM
17726 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system supports file names of any length" >&5
17727$as_echo_n "checking whether this system supports file names of any length... " >&6; }
17728if ${gl_cv_have_unlimited_file_name_length+:} false; then :
c0c3707f 17729 $as_echo_n "(cached) " >&6
8690e634 17730else
c0c3707f
CB
17731 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17732/* end confdefs.h. */
8690e634 17733
c0c3707f
CB
17734/* Arrange to define PATH_MAX, like "pathmax.h" does. */
17735#if HAVE_UNISTD_H
17736# include <unistd.h>
17737#endif
17738#include <limits.h>
17739#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
17740# include <sys/param.h>
17741#endif
17742#if !defined PATH_MAX && defined MAXPATHLEN
17743# define PATH_MAX MAXPATHLEN
17744#endif
17745#ifdef __hpux
17746# undef PATH_MAX
17747# define PATH_MAX 1024
17748#endif
17749#if defined _WIN32 && ! defined __CYGWIN__
17750# undef PATH_MAX
17751# define PATH_MAX 260
17752#endif
6ec2e0f5 17753
c0c3707f
CB
17754#ifdef PATH_MAX
17755have_arbitrary_file_name_length_limit
17756#endif
6ec2e0f5 17757_ACEOF
c0c3707f
CB
17758if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17759 $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then :
9c9d63b1
PM
17760 gl_cv_have_unlimited_file_name_length=no
17761else
17762 gl_cv_have_unlimited_file_name_length=yes
17763fi
17764rm -f conftest*
17765
17766fi
17767{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_unlimited_file_name_length" >&5
17768$as_echo "$gl_cv_have_unlimited_file_name_length" >&6; }
17769
17770 if test $gl_cv_have_unlimited_file_name_length = no; then
17771
17772
17773
17774
17775
17776
17777
17778
17779 gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext"
17780
17781 :
17782 fi
17783
17784
17785
17786 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
17787 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
17788
17789 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
17790 # programs in the package would end up linked with that potentially-shared
17791 # library, inducing unnecessary run-time overhead.
17792 LIB_CLOCK_GETTIME=
17793
17794 gl_saved_libs=$LIBS
17795 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
17796$as_echo_n "checking for library containing clock_gettime... " >&6; }
17797if ${ac_cv_search_clock_gettime+:} false; then :
17798 $as_echo_n "(cached) " >&6
c0c3707f 17799else
9c9d63b1
PM
17800 ac_func_search_save_LIBS=$LIBS
17801cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17802/* end confdefs.h. */
17803
17804/* Override any GCC internal prototype to avoid an error.
17805 Use char because int might match the return type of a GCC
17806 builtin and then its argument prototype would still apply. */
17807#ifdef __cplusplus
17808extern "C"
17809#endif
17810char clock_gettime ();
17811int
17812main ()
17813{
17814return clock_gettime ();
17815 ;
17816 return 0;
17817}
17818_ACEOF
17819for ac_lib in '' rt posix4; do
17820 if test -z "$ac_lib"; then
17821 ac_res="none required"
17822 else
17823 ac_res=-l$ac_lib
17824 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
17825 fi
17826 if ac_fn_c_try_link "$LINENO"; then :
17827 ac_cv_search_clock_gettime=$ac_res
17828fi
17829rm -f core conftest.err conftest.$ac_objext \
17830 conftest$ac_exeext
17831 if ${ac_cv_search_clock_gettime+:} false; then :
17832 break
c0c3707f 17833fi
9c9d63b1
PM
17834done
17835if ${ac_cv_search_clock_gettime+:} false; then :
6ec2e0f5 17836
9c9d63b1
PM
17837else
17838 ac_cv_search_clock_gettime=no
17839fi
17840rm conftest.$ac_ext
17841LIBS=$ac_func_search_save_LIBS
17842fi
17843{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
17844$as_echo "$ac_cv_search_clock_gettime" >&6; }
17845ac_res=$ac_cv_search_clock_gettime
17846if test "$ac_res" != no; then :
17847 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
17848 test "$ac_cv_search_clock_gettime" = "none required" ||
17849 LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
6ec2e0f5 17850fi
472fa5ee 17851
9c9d63b1
PM
17852 for ac_func in clock_gettime clock_settime
17853do :
17854 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
17855ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
17856if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
17857 cat >>confdefs.h <<_ACEOF
17858#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
17859_ACEOF
472fa5ee 17860
9c9d63b1
PM
17861fi
17862done
472fa5ee 17863
9c9d63b1 17864 LIBS=$gl_saved_libs
472fa5ee 17865
8690e634 17866
8690e634 17867
c0c3707f 17868$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
8690e634
JK
17869
17870
17871
17872
17873
8690e634 17874
c0c3707f
CB
17875 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
17876 REPLACE_CLOSE=1
17877 fi
8690e634 17878
6ec2e0f5
SDJ
17879
17880
6ec2e0f5
SDJ
17881
17882
8690e634 17883
c0c3707f
CB
17884 if test $ac_cv_header_sys_socket_h != yes; then
17885 for ac_header in winsock2.h
17886do :
17887 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
17888if test "x$ac_cv_header_winsock2_h" = xyes; then :
17889 cat >>confdefs.h <<_ACEOF
17890#define HAVE_WINSOCK2_H 1
17891_ACEOF
8690e634 17892
c0c3707f 17893fi
8690e634 17894
c0c3707f 17895done
8690e634 17896
c0c3707f
CB
17897 fi
17898 if test "$ac_cv_header_winsock2_h" = yes; then
17899 HAVE_WINSOCK2_H=1
17900 UNISTD_H_HAVE_WINSOCK2_H=1
17901 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
17902 else
17903 HAVE_WINSOCK2_H=0
17904 fi
8690e634 17905
6ec2e0f5 17906
c0c3707f
CB
17907 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
17908 REPLACE_CLOSE=1
17909 fi
6ec2e0f5
SDJ
17910
17911
c0c3707f 17912 if test $REPLACE_CLOSE = 0; then
6ec2e0f5
SDJ
17913
17914
6ec2e0f5 17915
c0c3707f
CB
17916 if test $ac_cv_func_fchdir = no; then
17917 HAVE_FCHDIR=0
17918 fi
6ec2e0f5 17919
c0c3707f
CB
17920 if test $HAVE_FCHDIR = 0; then
17921 REPLACE_CLOSE=1
17922 fi
17923 fi
6ec2e0f5
SDJ
17924
17925
c0c3707f 17926 if test $REPLACE_CLOSE = 1; then
6ec2e0f5
SDJ
17927
17928
17929
17930
17931
6ec2e0f5
SDJ
17932
17933
17934
c0c3707f 17935 gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
6ec2e0f5 17936
c0c3707f 17937 fi
6ec2e0f5 17938
6ec2e0f5
SDJ
17939
17940
17941
17942
c0c3707f 17943 GNULIB_CLOSE=1
6ec2e0f5 17944
6ec2e0f5 17945
6ec2e0f5
SDJ
17946
17947
17948
c0c3707f 17949$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
6ec2e0f5
SDJ
17950
17951
17952
17953
17954
c0c3707f
CB
17955
17956 for ac_func in closedir
17957do :
17958 ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
17959if test "x$ac_cv_func_closedir" = xyes; then :
17960 cat >>confdefs.h <<_ACEOF
17961#define HAVE_CLOSEDIR 1
17962_ACEOF
17963
17964fi
17965done
17966
17967 if test $ac_cv_func_closedir = no; then
17968 HAVE_CLOSEDIR=0
17969 fi
6ec2e0f5 17970
8690e634
JK
17971
17972
8690e634 17973
c0c3707f
CB
17974 if test $ac_cv_func_fchdir = no; then
17975 HAVE_FCHDIR=0
6ec2e0f5 17976 fi
6a29c58e 17977
c0c3707f
CB
17978 if test $HAVE_FCHDIR = 0; then
17979 if test $HAVE_CLOSEDIR = 1; then
17980 REPLACE_CLOSEDIR=1
17981 fi
17982 fi
6a29c58e 17983
c0c3707f
CB
17984 case $host_os,$HAVE_CLOSEDIR in
17985 os2*,1)
17986 REPLACE_CLOSEDIR=1;;
17987 esac
d0ac1c44 17988
c0c3707f 17989 if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
d0ac1c44
SM
17990
17991
d0ac1c44
SM
17992
17993
6a29c58e
YQ
17994
17995
3d99e817 17996
6ec2e0f5 17997
c0c3707f 17998 gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
6ec2e0f5 17999
6ec2e0f5
SDJ
18000 fi
18001
18002
6ec2e0f5
SDJ
18003
18004
3d99e817 18005
c0c3707f 18006 GNULIB_CLOSEDIR=1
3d99e817
AK
18007
18008
18009
18010
18011
c0c3707f 18012$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
3d99e817
AK
18013
18014
18015
698be2d8
CB
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027 if test $gl_cv_have_include_next = yes; then
18028 gl_cv_next_ctype_h='<'ctype.h'>'
18029 else
18030 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5
18031$as_echo_n "checking absolute name of <ctype.h>... " >&6; }
18032if ${gl_cv_next_ctype_h+:} false; then :
18033 $as_echo_n "(cached) " >&6
18034else
18035
18036
18037
18038 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18039/* end confdefs.h. */
18040#include <ctype.h>
18041_ACEOF
18042 case "$host_os" in
18043 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18044 *) gl_absname_cpp="$ac_cpp" ;;
18045 esac
18046
18047 case "$host_os" in
18048 mingw*)
18049 gl_dirsep_regex='[/\\]'
18050 ;;
18051 *)
18052 gl_dirsep_regex='\/'
18053 ;;
18054 esac
18055 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18056 gl_header_literal_regex=`echo 'ctype.h' \
18057 | sed -e "$gl_make_literal_regex_sed"`
18058 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18059 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18060 s|^/[^/]|//&|
18061 p
18062 q
18063 }'
18064
18065 gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18066 sed -n "$gl_absolute_header_sed"`
18067
18068 gl_header=$gl_cv_absolute_ctype_h
18069 gl_cv_next_ctype_h='"'$gl_header'"'
18070
18071
18072fi
18073{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5
18074$as_echo "$gl_cv_next_ctype_h" >&6; }
18075 fi
18076 NEXT_CTYPE_H=$gl_cv_next_ctype_h
18077
18078 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18079 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18080 gl_next_as_first_directive='<'ctype.h'>'
18081 else
18082 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18083 gl_next_as_first_directive=$gl_cv_next_ctype_h
18084 fi
18085 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive
18086
18087
18088
18089
18090
18091
18092
18093
18094
c0c3707f
CB
18095 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
18096$as_echo_n "checking for d_ino member in directory struct... " >&6; }
18097if ${gl_cv_struct_dirent_d_ino+:} false; then :
6ec2e0f5
SDJ
18098 $as_echo_n "(cached) " >&6
18099else
18100 if test "$cross_compiling" = yes; then :
18101 case "$host_os" in
c0c3707f
CB
18102 # Guess yes on glibc systems with Linux kernel.
18103 linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
18104 # Guess yes on musl systems with Linux kernel.
18105 linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
18106 # Guess no on native Windows.
18107 mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
18108 # If we don't know, obey --enable-cross-guesses.
18109 *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
18110 esac
3d99e817 18111
6ec2e0f5
SDJ
18112else
18113 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18114/* end confdefs.h. */
c0c3707f
CB
18115#include <sys/types.h>
18116 #include <sys/stat.h>
18117 #include <dirent.h>
3d99e817 18118
6ec2e0f5
SDJ
18119int
18120main ()
18121{
c0c3707f
CB
18122DIR *dp = opendir (".");
18123 struct dirent *e;
18124 struct stat st;
18125 if (! dp)
18126 return 1;
18127 e = readdir (dp);
18128 if (! e)
18129 { closedir (dp); return 2; }
18130 if (lstat (e->d_name, &st) != 0)
18131 { closedir (dp); return 3; }
18132 if (e->d_ino != st.st_ino)
18133 { closedir (dp); return 4; }
18134 closedir (dp);
18135 return 0;
18136
6ec2e0f5
SDJ
18137 ;
18138 return 0;
18139}
3d99e817 18140_ACEOF
6ec2e0f5 18141if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
18142 gl_cv_struct_dirent_d_ino=yes
18143else
18144 gl_cv_struct_dirent_d_ino=no
18145fi
18146rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18147 conftest.$ac_objext conftest.beam conftest.$ac_ext
18148fi
18149
18150fi
18151{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
18152$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
18153 case "$gl_cv_struct_dirent_d_ino" in
18154 *yes)
18155
18156$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
18157
18158 ;;
18159 esac
18160
18161
18162 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5
18163$as_echo_n "checking for d_type member in directory struct... " >&6; }
18164if ${gl_cv_struct_dirent_d_type+:} false; then :
18165 $as_echo_n "(cached) " >&6
18166else
18167 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18168/* end confdefs.h. */
18169
18170#include <sys/types.h>
18171#include <dirent.h>
18172
18173int
18174main ()
18175{
18176struct dirent dp; dp.d_type = 0;
18177 ;
18178 return 0;
18179}
18180_ACEOF
18181if ac_fn_c_try_link "$LINENO"; then :
18182 gl_cv_struct_dirent_d_type=yes
6ec2e0f5 18183else
c0c3707f 18184 gl_cv_struct_dirent_d_type=no
3d99e817 18185fi
c0c3707f
CB
18186rm -f core conftest.err conftest.$ac_objext \
18187 conftest$ac_exeext conftest.$ac_ext
3d99e817 18188
3d99e817 18189
c0c3707f
CB
18190fi
18191{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5
18192$as_echo "$gl_cv_struct_dirent_d_type" >&6; }
18193 if test $gl_cv_struct_dirent_d_type = yes; then
3d99e817 18194
c0c3707f 18195$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
3d99e817 18196
c0c3707f 18197 fi
3d99e817 18198
0750520d 18199
0750520d 18200
0750520d 18201
0750520d
PA
18202
18203
0750520d 18204
0750520d 18205
0750520d 18206
0750520d 18207
0750520d 18208
0750520d 18209
0750520d 18210
0750520d 18211
c0c3707f
CB
18212 if test $gl_cv_have_include_next = yes; then
18213 gl_cv_next_dirent_h='<'dirent.h'>'
18214 else
18215 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
18216$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
18217if ${gl_cv_next_dirent_h+:} false; then :
18218 $as_echo_n "(cached) " >&6
18219else
0750520d 18220
c0c3707f 18221 if test $ac_cv_header_dirent_h = yes; then
6ec2e0f5 18222
472fa5ee
SM
18223
18224
18225
c0c3707f
CB
18226 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18227/* end confdefs.h. */
18228#include <dirent.h>
18229_ACEOF
18230 case "$host_os" in
18231 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18232 *) gl_absname_cpp="$ac_cpp" ;;
18233 esac
472fa5ee 18234
c0c3707f
CB
18235 case "$host_os" in
18236 mingw*)
18237 gl_dirsep_regex='[/\\]'
18238 ;;
18239 *)
18240 gl_dirsep_regex='\/'
18241 ;;
18242 esac
18243 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18244 gl_header_literal_regex=`echo 'dirent.h' \
18245 | sed -e "$gl_make_literal_regex_sed"`
18246 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18247 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18248 s|^/[^/]|//&|
18249 p
18250 q
18251 }'
472fa5ee 18252
c0c3707f
CB
18253 gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18254 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 18255
c0c3707f
CB
18256 gl_header=$gl_cv_absolute_dirent_h
18257 gl_cv_next_dirent_h='"'$gl_header'"'
18258 else
18259 gl_cv_next_dirent_h='<'dirent.h'>'
18260 fi
6ec2e0f5
SDJ
18261
18262
c0c3707f
CB
18263fi
18264{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
18265$as_echo "$gl_cv_next_dirent_h" >&6; }
18266 fi
18267 NEXT_DIRENT_H=$gl_cv_next_dirent_h
472fa5ee 18268
c0c3707f
CB
18269 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18270 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18271 gl_next_as_first_directive='<'dirent.h'>'
18272 else
18273 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18274 gl_next_as_first_directive=$gl_cv_next_dirent_h
18275 fi
18276 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
472fa5ee
SM
18277
18278
18279
18280
c0c3707f
CB
18281 if test $ac_cv_header_dirent_h = yes; then
18282 HAVE_DIRENT_H=1
6ec2e0f5 18283 else
c0c3707f 18284 HAVE_DIRENT_H=0
6ec2e0f5
SDJ
18285 fi
18286
6ec2e0f5 18287
0750520d 18288
0750520d 18289
0750520d 18290
472fa5ee
SM
18291
18292
18293
18294
18295
0750520d 18296
c0c3707f
CB
18297 for ac_func in dirfd
18298do :
18299 ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
18300if test "x$ac_cv_func_dirfd" = xyes; then :
18301 cat >>confdefs.h <<_ACEOF
18302#define HAVE_DIRFD 1
18303_ACEOF
0750520d 18304
c0c3707f
CB
18305fi
18306done
0750520d 18307
c0c3707f
CB
18308 ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
18309 #include <dirent.h>
18310"
18311if test "x$ac_cv_have_decl_dirfd" = xyes; then :
18312 ac_have_decl=1
8690e634 18313else
c0c3707f
CB
18314 ac_have_decl=0
18315fi
8690e634 18316
c0c3707f
CB
18317cat >>confdefs.h <<_ACEOF
18318#define HAVE_DECL_DIRFD $ac_have_decl
18319_ACEOF
49e4877c 18320
c0c3707f
CB
18321 if test $ac_cv_have_decl_dirfd = no; then
18322 HAVE_DECL_DIRFD=0
18323 fi
8690e634 18324
c0c3707f
CB
18325 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
18326$as_echo_n "checking whether dirfd is a macro... " >&6; }
18327if ${gl_cv_func_dirfd_macro+:} false; then :
18328 $as_echo_n "(cached) " >&6
18329else
6ec2e0f5
SDJ
18330 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18331/* end confdefs.h. */
8690e634 18332
c0c3707f
CB
18333#include <sys/types.h>
18334#include <dirent.h>
18335#ifdef dirfd
18336 dirent_header_defines_dirfd
6ec2e0f5 18337#endif
8690e634 18338_ACEOF
c0c3707f
CB
18339if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18340 $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
18341 gl_cv_func_dirfd_macro=yes
6ec2e0f5 18342else
c0c3707f 18343 gl_cv_func_dirfd_macro=no
6ec2e0f5 18344fi
c0c3707f 18345rm -f conftest*
472fa5ee 18346
c0c3707f
CB
18347fi
18348{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
18349$as_echo "$gl_cv_func_dirfd_macro" >&6; }
472fa5ee 18350
c0c3707f
CB
18351 # Use the replacement if we have no function or macro with that name,
18352 # or if OS/2 kLIBC whose dirfd() does not work.
18353 # Replace only if the system declares dirfd already.
18354 case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
18355 no,no,*,yes | *,*,os2*,yes)
18356 REPLACE_DIRFD=1
472fa5ee 18357
c0c3707f
CB
18358$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
18359;;
18360 esac
472fa5ee 18361
c0c3707f
CB
18362 if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
18363 || test $REPLACE_DIRFD = 1; then
6ec2e0f5 18364
6ec2e0f5
SDJ
18365
18366
18367
18368
472fa5ee
SM
18369
18370
18371
c0c3707f 18372 gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
472fa5ee
SM
18373
18374
c0c3707f
CB
18375 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
18376$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
18377if ${gl_cv_sys_dir_fd_member_name+:} false; then :
18378 $as_echo_n "(cached) " >&6
18379else
6ec2e0f5 18380
c0c3707f
CB
18381 dirfd_save_CFLAGS=$CFLAGS
18382 for ac_expr in d_fd dd_fd; do
6ec2e0f5 18383
c0c3707f
CB
18384 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
18385 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18386/* end confdefs.h. */
6ec2e0f5 18387
c0c3707f
CB
18388 #include <sys/types.h>
18389 #include <dirent.h>
18390int
18391main ()
18392{
18393DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
18394 ;
18395 return 0;
18396}
18397_ACEOF
18398if ac_fn_c_try_compile "$LINENO"; then :
18399 dir_fd_found=yes
6ec2e0f5 18400
c0c3707f
CB
18401fi
18402rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18403 CFLAGS=$dirfd_save_CFLAGS
18404 test "$dir_fd_found" = yes && break
18405 done
18406 test "$dir_fd_found" = yes || ac_expr=no_such_member
472fa5ee 18407
c0c3707f 18408 gl_cv_sys_dir_fd_member_name=$ac_expr
472fa5ee
SM
18409
18410
c0c3707f
CB
18411fi
18412{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
18413$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
18414 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
472fa5ee 18415
c0c3707f
CB
18416cat >>confdefs.h <<_ACEOF
18417#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
18418_ACEOF
472fa5ee 18419
6ec2e0f5
SDJ
18420 fi
18421
6ec2e0f5 18422
c0c3707f 18423 fi
6ec2e0f5
SDJ
18424
18425
18426
18427
18428
c0c3707f 18429 GNULIB_DIRFD=1
6ec2e0f5
SDJ
18430
18431
18432
6ec2e0f5 18433
8690e634 18434
c0c3707f 18435$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
8690e634
JK
18436
18437
8690e634
JK
18438
18439
18440
c0c3707f
CB
18441 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
18442$as_echo_n "checking whether // is distinct from /... " >&6; }
18443if ${gl_cv_double_slash_root+:} false; then :
18444 $as_echo_n "(cached) " >&6
18445else
18446 if test x"$cross_compiling" = xyes ; then
18447 # When cross-compiling, there is no way to tell whether // is special
18448 # short of a list of hosts. However, the only known hosts to date
18449 # that have a distinct // are Apollo DomainOS (too old to port to),
18450 # Cygwin, and z/OS. If anyone knows of another system for which // has
18451 # special semantics and is distinct from /, please report it to
18452 # <bug-gnulib@gnu.org>.
18453 case $host in
18454 *-cygwin | i370-ibm-openedition)
18455 gl_cv_double_slash_root=yes ;;
18456 *)
18457 # Be optimistic and assume that / and // are the same when we
18458 # don't know.
18459 gl_cv_double_slash_root='unknown, assuming no' ;;
18460 esac
18461 else
18462 set x `ls -di / // 2>/dev/null`
18463 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
18464 gl_cv_double_slash_root=no
18465 else
18466 gl_cv_double_slash_root=yes
18467 fi
18468 fi
18469fi
18470{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
18471$as_echo "$gl_cv_double_slash_root" >&6; }
18472 if test "$gl_cv_double_slash_root" = yes; then
6ec2e0f5 18473
c0c3707f 18474$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
8690e634 18475
c0c3707f 18476 fi
8690e634 18477
63ce7108
TT
18478
18479
18480
18481
c0c3707f
CB
18482 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
18483 REPLACE_DUP=1
18484 fi
8690e634
JK
18485
18486
18487
18488
18489
c0c3707f
CB
18490 if test $ac_cv_func_fchdir = no; then
18491 HAVE_FCHDIR=0
18492 fi
8690e634 18493
c0c3707f
CB
18494 if test $HAVE_FCHDIR = 0; then
18495 REPLACE_DUP=1
18496 fi
8690e634 18497
c0c3707f
CB
18498 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
18499$as_echo_n "checking whether dup works... " >&6; }
18500if ${gl_cv_func_dup_works+:} false; then :
8690e634
JK
18501 $as_echo_n "(cached) " >&6
18502else
c0c3707f
CB
18503 if test "$cross_compiling" = yes; then :
18504 case "$host_os" in
18505 # Guess no on native Windows.
18506 mingw*) gl_cv_func_dup_works="guessing no" ;;
18507 *) gl_cv_func_dup_works="guessing yes" ;;
18508 esac
8690e634 18509
c0c3707f 18510else
4a626d0a 18511 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 18512/* end confdefs.h. */
c0c3707f
CB
18513#include <unistd.h>
18514 #include <fcntl.h>
18515 #include <errno.h>
9c9d63b1
PM
18516
18517
18518$gl_mda_defines
18519
c0c3707f
CB
18520int
18521main ()
18522{
18523/* On OS/2 kLIBC, dup does not work on a directory fd. */
18524 int fd = open (".", O_RDONLY);
18525 return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
8690e634 18526
c0c3707f
CB
18527 ;
18528 return 0;
18529}
8690e634 18530
c0c3707f
CB
18531_ACEOF
18532if ac_fn_c_try_run "$LINENO"; then :
18533 gl_cv_func_dup_works=yes
18534else
18535 gl_cv_func_dup_works=no
18536fi
18537rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18538 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 18539fi
8690e634 18540
8690e634 18541
c0c3707f
CB
18542fi
18543{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
18544$as_echo "$gl_cv_func_dup_works" >&6; }
18545 case "$gl_cv_func_dup_works" in
18546 *yes) ;;
18547 *)
18548 REPLACE_DUP=1
18549 ;;
18550 esac
8690e634 18551
c0c3707f 18552 if test $REPLACE_DUP = 1; then
8690e634
JK
18553
18554
18555
18556
6ec2e0f5
SDJ
18557
18558
18559
18560
c0c3707f 18561 gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
8690e634 18562
c0c3707f
CB
18563 :
18564 fi
8690e634 18565
5e8754f9 18566
8690e634
JK
18567
18568
8839a007 18569
c0c3707f 18570 GNULIB_DUP=1
63ce7108 18571
63ce7108 18572
63ce7108 18573
6ec2e0f5 18574
6ec2e0f5 18575
c0c3707f 18576$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
6ec2e0f5 18577
63ce7108
TT
18578
18579
472fa5ee
SM
18580
18581
18582
9c9d63b1 18583 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
c0c3707f
CB
18584$as_echo_n "checking whether dup2 works... " >&6; }
18585if ${gl_cv_func_dup2_works+:} false; then :
6ec2e0f5
SDJ
18586 $as_echo_n "(cached) " >&6
18587else
18588 if test "$cross_compiling" = yes; then :
18589 case "$host_os" in
9c9d63b1
PM
18590 mingw*) # on this platform, dup2 always returns 0 for success
18591 gl_cv_func_dup2_works="guessing no" ;;
18592 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
18593 gl_cv_func_dup2_works="guessing no" ;;
18594 aix* | freebsd*)
18595 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
18596 # not EBADF.
18597 gl_cv_func_dup2_works="guessing no" ;;
18598 haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
18599 gl_cv_func_dup2_works="guessing no" ;;
18600 *-android*) # implemented using dup3(), which fails if oldfd == newfd
18601 gl_cv_func_dup2_works="guessing no" ;;
18602 os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
18603 gl_cv_func_dup2_works="guessing no" ;;
18604 *) gl_cv_func_dup2_works="guessing yes" ;;
18605 esac
63ce7108
TT
18606else
18607 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18608/* end confdefs.h. */
18609
9c9d63b1
PM
18610 #include <errno.h>
18611 #include <fcntl.h>
18612 #include <limits.h>
18613 #include <sys/resource.h>
18614 #include <unistd.h>
18615
18616
18617$gl_mda_defines
18618
18619 #ifndef RLIM_SAVED_CUR
18620 # define RLIM_SAVED_CUR RLIM_INFINITY
18621 #endif
18622 #ifndef RLIM_SAVED_MAX
18623 # define RLIM_SAVED_MAX RLIM_INFINITY
18624 #endif
63ce7108
TT
18625
18626int
18627main ()
18628{
6ec2e0f5 18629int result = 0;
9c9d63b1
PM
18630 int bad_fd = INT_MAX;
18631 struct rlimit rlim;
18632 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18633 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18634 && rlim.rlim_cur != RLIM_INFINITY
18635 && rlim.rlim_cur != RLIM_SAVED_MAX
18636 && rlim.rlim_cur != RLIM_SAVED_CUR)
18637 bad_fd = rlim.rlim_cur;
18638 #ifdef FD_CLOEXEC
18639 if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
18640 result |= 1;
18641 #endif
18642 if (dup2 (1, 1) != 1)
18643 result |= 2;
18644 #ifdef FD_CLOEXEC
18645 if (fcntl (1, F_GETFD) != FD_CLOEXEC)
18646 result |= 4;
18647 #endif
18648 close (0);
18649 if (dup2 (0, 0) != -1)
18650 result |= 8;
18651 /* Many gnulib modules require POSIX conformance of EBADF. */
18652 if (dup2 (2, bad_fd) == -1 && errno != EBADF)
18653 result |= 16;
18654 /* Flush out some cygwin core dumps. */
18655 if (dup2 (2, -1) != -1 || errno != EBADF)
18656 result |= 32;
18657 dup2 (2, 255);
18658 dup2 (2, 256);
18659 /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
18660 {
18661 int fd = open (".", O_RDONLY);
18662 if (fd == -1)
18663 result |= 64;
18664 else if (dup2 (fd, fd + 1) == -1)
18665 result |= 128;
18666 close (fd);
18667 }
18668 return result;
63ce7108
TT
18669 ;
18670 return 0;
18671}
c0c3707f 18672
63ce7108
TT
18673_ACEOF
18674if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 18675 gl_cv_func_dup2_works=yes
63ce7108 18676else
c0c3707f 18677 gl_cv_func_dup2_works=no
63ce7108
TT
18678fi
18679rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18680 conftest.$ac_objext conftest.beam conftest.$ac_ext
18681fi
18682
c0c3707f 18683
63ce7108 18684fi
c0c3707f
CB
18685{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
18686$as_echo "$gl_cv_func_dup2_works" >&6; }
9c9d63b1
PM
18687 case "$gl_cv_func_dup2_works" in
18688 *yes) ;;
18689 *)
18690 REPLACE_DUP2=1
18691 for ac_func in setdtablesize
c0c3707f
CB
18692do :
18693 ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
18694if test "x$ac_cv_func_setdtablesize" = xyes; then :
18695 cat >>confdefs.h <<_ACEOF
18696#define HAVE_SETDTABLESIZE 1
18697_ACEOF
18698
18699fi
18700done
18701
9c9d63b1
PM
18702 ;;
18703 esac
63ce7108 18704
09607c9e
TT
18705
18706
18707
c0c3707f
CB
18708 if test $ac_cv_func_fchdir = no; then
18709 HAVE_FCHDIR=0
18710 fi
4a626d0a 18711
c0c3707f 18712 if test $HAVE_FCHDIR = 0; then
9c9d63b1 18713 REPLACE_DUP2=1
c0c3707f 18714 fi
4a626d0a
PA
18715
18716
9c9d63b1 18717 if test $REPLACE_DUP2 = 1; then
4a626d0a
PA
18718
18719
18720
18721
18722
18723
4a626d0a 18724
4a626d0a 18725
c0c3707f 18726 gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
4a626d0a
PA
18727
18728
c0c3707f 18729 fi
4a626d0a
PA
18730
18731
18732
18733
18734
c0c3707f 18735 GNULIB_DUP2=1
4a626d0a
PA
18736
18737
18738
18739
09607c9e 18740
c0c3707f 18741$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
09607c9e
TT
18742
18743
472fa5ee
SM
18744
18745
18746
18747
18748
09607c9e 18749
6ec2e0f5 18750
c0c3707f 18751 GNULIB_ENVIRON=1
6ec2e0f5 18752
09607c9e 18753
09607c9e 18754
6ec2e0f5
SDJ
18755
18756
c0c3707f 18757$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
6ec2e0f5
SDJ
18758
18759
6ec2e0f5 18760
5e8754f9 18761
6ec2e0f5 18762
c0c3707f
CB
18763 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
18764$as_echo_n "checking for error_at_line... " >&6; }
18765if ${ac_cv_lib_error_at_line+:} false; then :
09607c9e 18766 $as_echo_n "(cached) " >&6
4a626d0a
PA
18767else
18768 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18769/* end confdefs.h. */
c0c3707f
CB
18770#include <error.h>
18771int
18772main ()
18773{
18774error_at_line (0, 0, "", 0, "an error occurred");
18775 ;
4a626d0a
PA
18776 return 0;
18777}
18778_ACEOF
c0c3707f
CB
18779if ac_fn_c_try_link "$LINENO"; then :
18780 ac_cv_lib_error_at_line=yes
4a626d0a 18781else
c0c3707f 18782 ac_cv_lib_error_at_line=no
6ec2e0f5 18783fi
c0c3707f
CB
18784rm -f core conftest.err conftest.$ac_objext \
18785 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5 18786fi
c0c3707f
CB
18787{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
18788$as_echo "$ac_cv_lib_error_at_line" >&6; }
09607c9e 18789
c0c3707f 18790 if test $ac_cv_lib_error_at_line = no; then
09607c9e
TT
18791
18792
18793
18794
18795
18796
18797
18798
c0c3707f 18799 gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
09607c9e 18800
4a626d0a 18801
09607c9e 18802
c0c3707f 18803 :
4a626d0a 18804
c0c3707f 18805 fi
4a626d0a 18806
4a626d0a 18807
09607c9e 18808
09607c9e 18809
09607c9e
TT
18810
18811
09607c9e 18812
c0c3707f
CB
18813 if test $ac_cv_have_decl_fchdir = no; then
18814 HAVE_DECL_FCHDIR=0
18815 fi
09607c9e
TT
18816
18817
c0c3707f 18818 if test $HAVE_FCHDIR = 0; then
09607c9e
TT
18819
18820
18821
c0c3707f
CB
18822
18823
18824
18825
18826
18827 gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
18828
18829 :
18830
18831$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
18832
18833 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
18834$as_echo_n "checking whether open can visit directories... " >&6; }
18835if ${gl_cv_func_open_directory_works+:} false; then :
18836 $as_echo_n "(cached) " >&6
3d99e817 18837else
c0c3707f
CB
18838 if test "$cross_compiling" = yes; then :
18839 case "$host_os" in
9c9d63b1
PM
18840 # Guess yes on Linux systems.
18841 linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
18842 # Guess yes on glibc systems.
18843 *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
18844 # Guess no on native Windows.
18845 mingw*) gl_cv_func_open_directory_works="guessing no" ;;
18846 # If we don't know, obey --enable-cross-guesses.
18847 *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
18848 esac
c0c3707f
CB
18849
18850else
18851 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18852/* end confdefs.h. */
18853#include <fcntl.h>
18854
9c9d63b1
PM
18855
18856$gl_mda_defines
18857
c0c3707f
CB
18858int
18859main ()
18860{
18861return open(".", O_RDONLY) < 0;
18862 ;
18863 return 0;
18864}
18865_ACEOF
18866if ac_fn_c_try_run "$LINENO"; then :
18867 gl_cv_func_open_directory_works=yes
18868else
18869 gl_cv_func_open_directory_works=no
18870fi
18871rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18872 conftest.$ac_objext conftest.beam conftest.$ac_ext
3d99e817
AK
18873fi
18874
c0c3707f
CB
18875fi
18876{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
18877$as_echo "$gl_cv_func_open_directory_works" >&6; }
18878 case "$gl_cv_func_open_directory_works" in
18879 *yes) ;;
18880 *)
3d99e817 18881
c0c3707f 18882$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
09607c9e 18883
c0c3707f
CB
18884 ;;
18885 esac
18886 fi
8690e634 18887
8690e634 18888
8690e634 18889
8690e634 18890
8690e634 18891
6ec2e0f5 18892
c0c3707f 18893 GNULIB_FCHDIR=1
6ec2e0f5
SDJ
18894
18895
6ec2e0f5 18896
8690e634
JK
18897
18898
c0c3707f 18899$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
8690e634
JK
18900
18901
18902
6ec2e0f5
SDJ
18903
18904
18905
6ec2e0f5 18906
8690e634 18907
c0c3707f 18908 if test $ac_cv_func_fcntl = no; then
8690e634
JK
18909
18910
6ec2e0f5 18911
c0c3707f
CB
18912 if test $ac_cv_func_fcntl = no; then
18913 HAVE_FCNTL=0
18914 else
18915 REPLACE_FCNTL=1
18916 fi
5e8754f9 18917
c0c3707f
CB
18918 else
18919 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
18920$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
18921if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
8690e634 18922 $as_echo_n "(cached) " >&6
6ec2e0f5 18923else
c0c3707f
CB
18924 if test "$cross_compiling" = yes; then :
18925 case $host_os in
18926 aix* | cygwin* | haiku*)
18927 gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
18928 *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
18929 esac
18930else
18931 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18932/* end confdefs.h. */
18933#include <errno.h>
18934 #include <fcntl.h>
18935 #include <limits.h>
18936 #include <sys/resource.h>
18937 #include <unistd.h>
9c9d63b1
PM
18938
18939
18940$gl_mda_defines
18941
c0c3707f
CB
18942 #ifndef RLIM_SAVED_CUR
18943 # define RLIM_SAVED_CUR RLIM_INFINITY
18944 #endif
18945 #ifndef RLIM_SAVED_MAX
18946 # define RLIM_SAVED_MAX RLIM_INFINITY
18947 #endif
18948
18949int
18950main ()
18951{
18952int result = 0;
18953 int bad_fd = INT_MAX;
18954 struct rlimit rlim;
18955 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18956 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18957 && rlim.rlim_cur != RLIM_INFINITY
18958 && rlim.rlim_cur != RLIM_SAVED_MAX
18959 && rlim.rlim_cur != RLIM_SAVED_CUR)
18960 bad_fd = rlim.rlim_cur;
18961 if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
18962 if (errno != EINVAL) result |= 2;
18963 if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
18964 if (errno != EINVAL) result |= 8;
18965 /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
18966 {
18967 int fd;
18968 fd = open (".", O_RDONLY);
18969 if (fd == -1)
18970 result |= 16;
18971 else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
18972 result |= 32;
18973
18974 close (fd);
18975 }
18976 return result;
18977 ;
18978 return 0;
18979}
18980_ACEOF
18981if ac_fn_c_try_run "$LINENO"; then :
18982 gl_cv_func_fcntl_f_dupfd_works=yes
18983else
18984 gl_cv_func_fcntl_f_dupfd_works=no
18985fi
18986rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18987 conftest.$ac_objext conftest.beam conftest.$ac_ext
18988fi
18989
18990fi
18991{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
18992$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
18993 case $gl_cv_func_fcntl_f_dupfd_works in
18994 *yes) ;;
18995 *)
18996
18997
18998 if test $ac_cv_func_fcntl = no; then
18999 HAVE_FCNTL=0
19000 else
19001 REPLACE_FCNTL=1
19002 fi
19003
19004
19005$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
19006 ;;
19007 esac
19008
9c9d63b1 19009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
c0c3707f
CB
19010$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
19011if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
19012 $as_echo_n "(cached) " >&6
9c9d63b1
PM
19013else
19014 if test "$cross_compiling" = yes; then :
19015 case "$host_os" in
19016 # Guess no on NetBSD.
19017 netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
19018 *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
19019 esac
19020
8690e634
JK
19021else
19022 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19023/* end confdefs.h. */
c0c3707f 19024#include <fcntl.h>
9c9d63b1
PM
19025 #include <unistd.h>
19026 int main (int argc, char *argv[])
19027 {
19028 if (argc == 1)
19029 /* parent process */
19030 {
19031 if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
19032 return 1;
19033 return execl ("./conftest", "./conftest", "child", NULL);
19034 }
19035 else
19036 /* child process */
19037 return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
19038 }
c0c3707f 19039
c0c3707f 19040
c0c3707f 19041_ACEOF
9c9d63b1 19042if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
19043 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19044/* end confdefs.h. */
19045
19046#ifdef __linux__
19047/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
19048 it to support the semantics on older kernels that failed with EINVAL. */
19049choke me
19050#endif
8690e634 19051
8690e634
JK
19052int
19053main ()
19054{
19055
19056 ;
19057 return 0;
19058}
19059_ACEOF
c0c3707f
CB
19060if ac_fn_c_try_compile "$LINENO"; then :
19061 gl_cv_func_fcntl_f_dupfd_cloexec=yes
8690e634 19062else
c0c3707f 19063 gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
8690e634 19064fi
c0c3707f 19065rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1 19066
c0c3707f
CB
19067else
19068 gl_cv_func_fcntl_f_dupfd_cloexec=no
19069fi
9c9d63b1
PM
19070rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19071 conftest.$ac_objext conftest.beam conftest.$ac_ext
19072fi
19073
19074
8690e634 19075fi
c0c3707f
CB
19076{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
19077$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
9c9d63b1
PM
19078 case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
19079 *yes) ;;
19080 *)
8690e634 19081
c0c3707f
CB
19082
19083 if test $ac_cv_func_fcntl = no; then
19084 HAVE_FCNTL=0
5e8754f9 19085 else
c0c3707f
CB
19086 REPLACE_FCNTL=1
19087 fi
19088
9c9d63b1
PM
19089 ;;
19090 esac
8690e634
JK
19091 fi
19092
19093
8690e634 19094
8690e634 19095
c0c3707f
CB
19096 if test $ac_cv_func_fchdir = no; then
19097 HAVE_FCHDIR=0
19098 fi
6ec2e0f5 19099
c0c3707f 19100 if test $HAVE_FCHDIR = 0; then
6ec2e0f5
SDJ
19101
19102
19103
c0c3707f
CB
19104 if test $ac_cv_func_fcntl = no; then
19105 HAVE_FCNTL=0
19106 else
19107 REPLACE_FCNTL=1
19108 fi
6ec2e0f5 19109
c0c3707f 19110 fi
6ec2e0f5
SDJ
19111
19112
c0c3707f 19113 if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
6ec2e0f5 19114
6ec2e0f5
SDJ
19115
19116
5e8754f9
SDJ
19117
19118
8690e634 19119
8690e634
JK
19120
19121
c0c3707f 19122 gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
472fa5ee 19123
c0c3707f 19124 fi
472fa5ee
SM
19125
19126
19127
19128
19129
c0c3707f 19130 GNULIB_FCNTL=1
472fa5ee
SM
19131
19132
19133
19134
19135
c0c3707f 19136$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
472fa5ee
SM
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
c0c3707f
CB
19151 if test $gl_cv_have_include_next = yes; then
19152 gl_cv_next_fcntl_h='<'fcntl.h'>'
19153 else
19154 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
19155$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
19156if ${gl_cv_next_fcntl_h+:} false; then :
19157 $as_echo_n "(cached) " >&6
19158else
472fa5ee
SM
19159
19160
472fa5ee 19161
c0c3707f
CB
19162 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19163/* end confdefs.h. */
19164#include <fcntl.h>
19165_ACEOF
19166 case "$host_os" in
19167 aix*) gl_absname_cpp="$ac_cpp -C" ;;
19168 *) gl_absname_cpp="$ac_cpp" ;;
19169 esac
472fa5ee 19170
c0c3707f
CB
19171 case "$host_os" in
19172 mingw*)
19173 gl_dirsep_regex='[/\\]'
19174 ;;
19175 *)
19176 gl_dirsep_regex='\/'
19177 ;;
19178 esac
19179 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
19180 gl_header_literal_regex=`echo 'fcntl.h' \
19181 | sed -e "$gl_make_literal_regex_sed"`
19182 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
19183 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
19184 s|^/[^/]|//&|
19185 p
19186 q
19187 }'
472fa5ee 19188
c0c3707f
CB
19189 gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
19190 sed -n "$gl_absolute_header_sed"`
472fa5ee 19191
c0c3707f
CB
19192 gl_header=$gl_cv_absolute_fcntl_h
19193 gl_cv_next_fcntl_h='"'$gl_header'"'
8690e634
JK
19194
19195
c0c3707f
CB
19196fi
19197{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
19198$as_echo "$gl_cv_next_fcntl_h" >&6; }
19199 fi
19200 NEXT_FCNTL_H=$gl_cv_next_fcntl_h
8690e634 19201
c0c3707f
CB
19202 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
19203 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
19204 gl_next_as_first_directive='<'fcntl.h'>'
19205 else
19206 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
19207 gl_next_as_first_directive=$gl_cv_next_fcntl_h
19208 fi
19209 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
8690e634
JK
19210
19211
19212
19213
5e8754f9
SDJ
19214
19215
19216
19217
472fa5ee
SM
19218
19219
19220
19221
19222
19223
19224
5e8754f9 19225cat >>confdefs.h <<_ACEOF
c0c3707f 19226#define GNULIB_FD_SAFER_FLAG 1
5e8754f9 19227_ACEOF
472fa5ee
SM
19228
19229
c0c3707f
CB
19230
19231
19232
19233
19234
19235 ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
19236#include <dirent.h>
19237
5e8754f9 19238"
c0c3707f 19239if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
5e8754f9
SDJ
19240 ac_have_decl=1
19241else
19242 ac_have_decl=0
19243fi
472fa5ee 19244
5e8754f9 19245cat >>confdefs.h <<_ACEOF
c0c3707f 19246#define HAVE_DECL_FDOPENDIR $ac_have_decl
5e8754f9 19247_ACEOF
c0c3707f 19248if test $ac_have_decl = 1; then :
472fa5ee 19249
c0c3707f
CB
19250else
19251 HAVE_DECL_FDOPENDIR=0
19252fi
472fa5ee
SM
19253
19254
c0c3707f
CB
19255 if test $ac_cv_func_fdopendir = no; then
19256 HAVE_FDOPENDIR=0
19257 else
19258 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
19259$as_echo_n "checking whether fdopendir works... " >&6; }
19260if ${gl_cv_func_fdopendir_works+:} false; then :
19261 $as_echo_n "(cached) " >&6
19262else
19263 if test "$cross_compiling" = yes; then :
19264 case "$host_os" in
19265 # Guess yes on glibc systems.
19266 *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
19267 # Guess yes on musl systems.
19268 *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
19269 # If we don't know, obey --enable-cross-guesses.
19270 *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
19271 esac
472fa5ee 19272
c0c3707f
CB
19273else
19274 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19275/* end confdefs.h. */
472fa5ee 19276
c0c3707f
CB
19277#include <dirent.h>
19278#include <fcntl.h>
19279#include <unistd.h>
9c9d63b1
PM
19280
19281
19282$gl_mda_defines
19283
c0c3707f
CB
19284#if !HAVE_DECL_FDOPENDIR
19285extern
19286# ifdef __cplusplus
19287"C"
19288# endif
19289DIR *fdopendir (int);
19290#endif
472fa5ee 19291
c0c3707f
CB
19292int
19293main ()
19294{
19295int result = 0;
9c9d63b1
PM
19296 int fd = open ("conftest.c", O_RDONLY);
19297 if (fd < 0) result |= 1;
19298 if (fdopendir (fd)) result |= 2;
19299 if (close (fd)) result |= 4;
19300 return result;
19301
c0c3707f
CB
19302 ;
19303 return 0;
19304}
19305_ACEOF
19306if ac_fn_c_try_run "$LINENO"; then :
19307 gl_cv_func_fdopendir_works=yes
19308else
19309 gl_cv_func_fdopendir_works=no
19310fi
19311rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19312 conftest.$ac_objext conftest.beam conftest.$ac_ext
19313fi
472fa5ee 19314
c0c3707f
CB
19315fi
19316{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
19317$as_echo "$gl_cv_func_fdopendir_works" >&6; }
19318 case "$gl_cv_func_fdopendir_works" in
19319 *yes) ;;
19320 *)
19321 REPLACE_FDOPENDIR=1
19322 ;;
19323 esac
19324 fi
472fa5ee 19325
c0c3707f 19326 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
472fa5ee
SM
19327
19328
19329
19330
19331
98399780 19332
5e8754f9
SDJ
19333
19334
c0c3707f 19335 gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
5e8754f9 19336
c0c3707f 19337 fi
5e8754f9
SDJ
19338
19339
19340
19341
19342
c0c3707f 19343 GNULIB_FDOPENDIR=1
5e8754f9
SDJ
19344
19345
19346
19347
19348
c0c3707f 19349$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
5e8754f9
SDJ
19350
19351
5e8754f9
SDJ
19352
19353
19354
c0c3707f
CB
19355cat >>confdefs.h <<_ACEOF
19356#define GNULIB_FDOPENDIR 1
19357_ACEOF
5e8754f9
SDJ
19358
19359
19360
5e8754f9
SDJ
19361
19362
19363
c0c3707f
CB
19364 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
19365$as_echo_n "checking for flexible array member... " >&6; }
19366if ${ac_cv_c_flexmember+:} false; then :
5e8754f9 19367 $as_echo_n "(cached) " >&6
6ec2e0f5 19368else
c0c3707f 19369 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 19370/* end confdefs.h. */
c0c3707f
CB
19371#include <stdlib.h>
19372 #include <stdio.h>
19373 #include <stddef.h>
19374 struct m { struct m *next, **list; char name[]; };
19375 struct s { struct s *p; struct m *m; int n; double d[]; };
5e8754f9
SDJ
19376int
19377main ()
19378{
c0c3707f
CB
19379int m = getchar ();
19380 size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
19381 nbytes += sizeof (struct s) - 1;
19382 nbytes -= nbytes % sizeof (struct s);
19383 struct s *p = malloc (nbytes);
19384 p->p = p;
19385 p->m = NULL;
19386 p->d[0] = 0.0;
19387 return p->d != (double *) NULL;
5e8754f9
SDJ
19388 ;
19389 return 0;
19390}
7a6dbc2f 19391_ACEOF
c0c3707f
CB
19392if ac_fn_c_try_compile "$LINENO"; then :
19393 ac_cv_c_flexmember=yes
5e8754f9 19394else
c0c3707f 19395 ac_cv_c_flexmember=no
5e8754f9 19396fi
c0c3707f 19397rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5e8754f9 19398fi
c0c3707f
CB
19399{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
19400$as_echo "$ac_cv_c_flexmember" >&6; }
19401 if test $ac_cv_c_flexmember = yes; then
19402
19403$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
5e8754f9 19404
c0c3707f
CB
19405 else
19406 $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
98399780 19407
c0c3707f 19408 fi
98399780 19409
472fa5ee
SM
19410
19411
19412
c0c3707f
CB
19413 FLOAT_H=
19414 REPLACE_FLOAT_LDBL=0
19415 case "$host_os" in
19416 aix* | beos* | openbsd* | mirbsd* | irix*)
19417 FLOAT_H=float.h
19418 ;;
19419 freebsd* | dragonfly*)
19420 case "$host_cpu" in
19421 i[34567]86 )
19422 FLOAT_H=float.h
19423 ;;
19424 x86_64 )
19425 # On x86_64 systems, the C compiler may still be generating
19426 # 32-bit code.
19427 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19428/* end confdefs.h. */
19429#if defined __LP64__ || defined __x86_64__ || defined __amd64__
19430 int ok;
19431 #else
19432 error fail
19433 #endif
472fa5ee 19434
c0c3707f
CB
19435_ACEOF
19436if ac_fn_c_try_compile "$LINENO"; then :
472fa5ee 19437
c0c3707f
CB
19438else
19439 FLOAT_H=float.h
19440fi
19441rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19442 ;;
19443 esac
19444 ;;
19445 linux*)
19446 case "$host_cpu" in
19447 powerpc*)
19448 FLOAT_H=float.h
19449 ;;
19450 esac
19451 ;;
19452 esac
19453 case "$host_os" in
19454 aix* | freebsd* | dragonfly* | linux*)
19455 if test -n "$FLOAT_H"; then
19456 REPLACE_FLOAT_LDBL=1
19457 fi
19458 ;;
19459 esac
19460
19461 REPLACE_ITOLD=0
19462 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
19463$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
19464if ${gl_cv_func_itold_works+:} false; then :
5e8754f9
SDJ
19465 $as_echo_n "(cached) " >&6
19466else
19467
19468 if test "$cross_compiling" = yes; then :
c0c3707f
CB
19469 case "$host" in
19470 sparc*-*-linux*)
19471 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19472/* end confdefs.h. */
19473#if defined __LP64__ || defined __arch64__
19474 int ok;
19475 #else
19476 error fail
19477 #endif
19478
19479_ACEOF
19480if ac_fn_c_try_compile "$LINENO"; then :
19481 gl_cv_func_itold_works="guessing no"
19482else
19483 gl_cv_func_itold_works="guessing yes"
19484fi
19485rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19486 ;;
19487 # Guess yes on native Windows.
19488 mingw*) gl_cv_func_itold_works="guessing yes" ;;
19489 *) gl_cv_func_itold_works="guessing yes" ;;
5e8754f9
SDJ
19490 esac
19491
19492else
19493 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19494/* end confdefs.h. */
19495
c0c3707f
CB
19496int i = -1;
19497volatile long double ld;
19498int main ()
5e8754f9 19499{
c0c3707f
CB
19500 ld += i * 1.0L;
19501 if (ld > 0)
19502 return 1;
19503 return 0;
5e8754f9
SDJ
19504}
19505_ACEOF
19506if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 19507 gl_cv_func_itold_works=yes
5e8754f9 19508else
c0c3707f 19509 gl_cv_func_itold_works=no
5e8754f9
SDJ
19510fi
19511rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19512 conftest.$ac_objext conftest.beam conftest.$ac_ext
19513fi
19514
98399780 19515
5e8754f9 19516fi
c0c3707f
CB
19517{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
19518$as_echo "$gl_cv_func_itold_works" >&6; }
19519 case "$gl_cv_func_itold_works" in
19520 *no)
19521 REPLACE_ITOLD=1
19522 FLOAT_H=float.h
19523 ;;
19524 esac
98399780 19525
c0c3707f 19526 if test -n "$FLOAT_H"; then
98399780
YQ
19527
19528
19529
19530
6a29c58e
YQ
19531
19532
19533
19534
c0c3707f
CB
19535 if test $gl_cv_have_include_next = yes; then
19536 gl_cv_next_float_h='<'float.h'>'
19537 else
19538 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
19539$as_echo_n "checking absolute name of <float.h>... " >&6; }
19540if ${gl_cv_next_float_h+:} false; then :
19541 $as_echo_n "(cached) " >&6
19542else
19543
19544
19545
19546 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19547/* end confdefs.h. */
19548#include <float.h>
19549_ACEOF
19550 case "$host_os" in
19551 aix*) gl_absname_cpp="$ac_cpp -C" ;;
19552 *) gl_absname_cpp="$ac_cpp" ;;
19553 esac
19554
19555 case "$host_os" in
19556 mingw*)
19557 gl_dirsep_regex='[/\\]'
19558 ;;
19559 *)
19560 gl_dirsep_regex='\/'
19561 ;;
19562 esac
19563 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
19564 gl_header_literal_regex=`echo 'float.h' \
19565 | sed -e "$gl_make_literal_regex_sed"`
19566 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
19567 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
19568 s|^/[^/]|//&|
19569 p
19570 q
19571 }'
19572
19573 gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
19574 sed -n "$gl_absolute_header_sed"`
19575
19576 gl_header=$gl_cv_absolute_float_h
19577 gl_cv_next_float_h='"'$gl_header'"'
19578
19579
19580fi
19581{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
19582$as_echo "$gl_cv_next_float_h" >&6; }
19583 fi
19584 NEXT_FLOAT_H=$gl_cv_next_float_h
19585
19586 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
19587 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
19588 gl_next_as_first_directive='<'float.h'>'
19589 else
19590 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
19591 gl_next_as_first_directive=$gl_cv_next_float_h
19592 fi
19593 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
19594
19595
19596
6a29c58e 19597
c0c3707f 19598 fi
6a29c58e 19599
c0c3707f
CB
19600 if test -n "$FLOAT_H"; then
19601 GL_GENERATE_FLOAT_H_TRUE=
19602 GL_GENERATE_FLOAT_H_FALSE='#'
19603else
19604 GL_GENERATE_FLOAT_H_TRUE='#'
19605 GL_GENERATE_FLOAT_H_FALSE=
19606fi
6a29c58e
YQ
19607
19608
8690e634 19609
c0c3707f 19610 if test $REPLACE_FLOAT_LDBL = 1; then
8690e634 19611
8690e634 19612
8690e634 19613
8690e634 19614
8690e634 19615
8690e634 19616
8690e634 19617
4a626d0a 19618
c0c3707f 19619 gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
8690e634 19620
c0c3707f
CB
19621 fi
19622 if test $REPLACE_ITOLD = 1; then
8690e634
JK
19623
19624
19625
19626
19627
19628
63ce7108 19629
e26b6bb0 19630
c0c3707f 19631 gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
e26b6bb0 19632
c0c3707f 19633 fi
e26b6bb0
TT
19634
19635
19636
19637
c0c3707f
CB
19638 gl_fnmatch_required_lowercase=`
19639 echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
19640 `
e26b6bb0 19641
c0c3707f
CB
19642 if test $ac_cv_func_fnmatch = no; then
19643 HAVE_FNMATCH=0
19644 else
19645 gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
19646 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
19647$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; }
19648if eval \${$gl_fnmatch_cache_var+:} false; then :
5e8754f9
SDJ
19649 $as_echo_n "(cached) " >&6
19650else
c0c3707f
CB
19651 if test $gl_fnmatch_required = GNU; then
19652 gl_fnmatch_gnu_start=
19653 gl_fnmatch_gnu_end=
19654 else
19655 gl_fnmatch_gnu_start='#if 0'
19656 gl_fnmatch_gnu_end='#endif'
19657 fi
19658 if test "$cross_compiling" = yes; then :
19659 case "$host_os" in
19660 # Guess yes on musl systems.
19661 *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
19662 # Guess no otherwise, even on glibc systems.
19663 *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
19664 esac
e26b6bb0 19665
c0c3707f
CB
19666else
19667 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 19668/* end confdefs.h. */
c0c3707f
CB
19669#include <fnmatch.h>
19670 static int
19671 y (char const *pattern, char const *string, int flags)
19672 {
19673 return fnmatch (pattern, string, flags) == 0;
19674 }
19675 static int
19676 n (char const *pattern, char const *string, int flags)
19677 {
19678 return fnmatch (pattern, string, flags) == FNM_NOMATCH;
19679 }
19680
5e8754f9
SDJ
19681int
19682main ()
19683{
c0c3707f
CB
19684char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
19685 char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
19686 static char const A_1[] = { 'A' - 1, 0 };
19687 static char const A01[] = { 'A' + 1, 0 };
19688 static char const a_1[] = { 'a' - 1, 0 };
19689 static char const a01[] = { 'a' + 1, 0 };
19690 static char const bs_1[] = { '\\\\' - 1, 0 };
19691 static char const bs01[] = { '\\\\' + 1, 0 };
19692 int result = 0;
19693 if (!n ("a*", "", 0))
19694 return 1;
19695 if (!y ("a*", "abc", 0))
19696 return 1;
19697 if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
19698 return 1;
19699 if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
19700 return 2;
19701 if (!y ("a\\\\bc", "abc", 0))
19702 return 3;
19703 if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
19704 return 3;
19705 if (!y ("*x", ".x", 0))
19706 return 4;
19707 if (!n ("*x", ".x", FNM_PERIOD))
19708 return 4;
19709 if (!y (Apat, "\\\\", 0))
19710 return 5;
19711 if (!y (Apat, "A", 0))
19712 return 5;
19713 if (!y (apat, "\\\\", 0))
19714 return 5;
19715 if (!y (apat, "a", 0))
19716 return 5;
19717 if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
19718 return 5;
19719 if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
19720 return 5;
19721 if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
19722 return 5;
19723 if (!(y (apat, a01, 0) == ('a' < '\\\\')))
19724 return 5;
19725 if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
19726 return 5;
19727 if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
19728 return 5;
19729 if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
19730 return 5;
19731 if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
19732 return 5;
19733 $gl_fnmatch_gnu_start
19734 if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
19735 result |= 8;
19736 if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
19737 result |= 16;
19738 if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
19739 result |= 32;
19740 if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
19741 result |= 64;
19742 if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
19743 result |= 64;
19744 if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
19745 result |= 64;
19746 $gl_fnmatch_gnu_end
19747 return result;
19748
5e8754f9
SDJ
19749 ;
19750 return 0;
19751}
19752_ACEOF
c0c3707f
CB
19753if ac_fn_c_try_run "$LINENO"; then :
19754 eval "$gl_fnmatch_cache_var=yes"
5e8754f9 19755else
c0c3707f
CB
19756 eval "$gl_fnmatch_cache_var=no"
19757fi
19758rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19759 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 19760fi
c0c3707f 19761
e26b6bb0 19762
5e8754f9 19763fi
c0c3707f
CB
19764eval ac_res=\$$gl_fnmatch_cache_var
19765 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
19766$as_echo "$ac_res" >&6; }
19767 eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
19768 case "$gl_fnmatch_result" in
19769 *yes) ;;
19770 *) REPLACE_FNMATCH=1 ;;
19771 esac
19772 fi
19773 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
e26b6bb0 19774
e26b6bb0 19775
c0c3707f
CB
19776 FNMATCH_H='fnmatch.h'
19777 if test -n "$FNMATCH_H"; then
19778 GL_GENERATE_FNMATCH_H_TRUE=
19779 GL_GENERATE_FNMATCH_H_FALSE='#'
5e8754f9 19780else
c0c3707f
CB
19781 GL_GENERATE_FNMATCH_H_TRUE='#'
19782 GL_GENERATE_FNMATCH_H_FALSE=
5e8754f9 19783fi
e26b6bb0 19784
18848e28 19785
c0c3707f 19786 fi
18848e28 19787
c0c3707f 19788 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18848e28 19789
18848e28 19790
18848e28 19791
c0c3707f
CB
19792
19793
19794
19795
19796
19797 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19798
19799
19800
c0c3707f
CB
19801
19802
19803 fi
19804
19805
19806
19807
19808
19809 GNULIB_FNMATCH=1
19810
19811
19812
19813
19814
19815$as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h
19816
19817
19818
19819
19820
19821
19822
19823
19824 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
19825
19826
19827
19828
19829
19830
19831
19832
19833 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19834
19835
19836
18848e28 19837
18848e28 19838
5e8754f9 19839 fi
18848e28 19840
18848e28 19841
c0c3707f
CB
19842cat >>confdefs.h <<_ACEOF
19843#define GNULIB_FNMATCH_GNU 1
19844_ACEOF
18848e28 19845
18848e28 19846
18848e28 19847
18848e28 19848
9c9d63b1
PM
19849
19850
19851 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether free is known to preserve errno" >&5
19852$as_echo_n "checking whether free is known to preserve errno... " >&6; }
19853if ${gl_cv_func_free_preserves_errno+:} false; then :
19854 $as_echo_n "(cached) " >&6
19855else
19856 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19857/* end confdefs.h. */
19858#include <stdlib.h>
19859
19860int
19861main ()
19862{
19863#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
19864 #elif defined __OpenBSD__
19865 #elif defined __sun
19866 #else
19867 #error "'free' is not known to preserve errno"
19868 #endif
19869
19870 ;
19871 return 0;
19872}
19873_ACEOF
19874if ac_fn_c_try_compile "$LINENO"; then :
19875 gl_cv_func_free_preserves_errno=yes
19876else
19877 gl_cv_func_free_preserves_errno=no
19878fi
19879rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19880
19881fi
19882{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_free_preserves_errno" >&5
19883$as_echo "$gl_cv_func_free_preserves_errno" >&6; }
19884
19885 case $gl_cv_func_free_preserves_errno in
19886 *yes) ;;
19887 *) REPLACE_FREE=1 ;;
19888 esac
19889
19890 if test $REPLACE_FREE = 1; then
19891
19892
19893
19894
19895
19896
19897
19898
19899 gl_LIBOBJS="$gl_LIBOBJS free.$ac_objext"
19900
19901 :
19902 fi
19903
19904
19905
19906
19907
19908 GNULIB_FREE_POSIX=1
19909
19910
19911
19912
19913
19914$as_echo "#define GNULIB_TEST_FREE_POSIX 1" >>confdefs.h
19915
19916
19917
19918
c0c3707f
CB
19919 if test $gl_func_frexp != yes; then
19920
19921
18848e28
GF
19922
19923
18848e28 19924
18848e28 19925
18848e28 19926
c0c3707f
CB
19927
19928 gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
18848e28
GF
19929
19930 fi
19931
19932
19933
19934
19935
c0c3707f 19936 GNULIB_FREXP=1
18848e28
GF
19937
19938
19939
19940
19941
c0c3707f 19942$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
18848e28
GF
19943
19944
19945
19946
c0c3707f
CB
19947 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
19948
19949
19950
18848e28
GF
19951
19952
19953
5e8754f9
SDJ
19954
19955
c0c3707f
CB
19956 gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
19957
5e8754f9 19958 fi
18848e28 19959
6a29c58e 19960
6a29c58e 19961
6a29c58e 19962
6ec2e0f5 19963
c0c3707f
CB
19964 GNULIB_FREXPL=1
19965
19966
19967
19968
19969
19970$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
19971
19972
19973
19974
19975
19976
19977
19978 case "$host_os" in
19979 mingw* | solaris*)
19980 REPLACE_FSTAT=1
19981 ;;
19982 esac
472fa5ee
SM
19983
19984
19985
19986
19987
6ec2e0f5
SDJ
19988 if test $ac_cv_func_fchdir = no; then
19989 HAVE_FCHDIR=0
6a29c58e
YQ
19990 fi
19991
6ec2e0f5
SDJ
19992 if test $HAVE_FCHDIR = 0; then
19993 case "$gl_cv_func_open_directory_works" in
19994 *yes) ;;
19995 *)
19996 REPLACE_FSTAT=1
19997 ;;
19998 esac
19999 fi
6a29c58e
YQ
20000
20001
6ec2e0f5 20002 if test $REPLACE_FSTAT = 1; then
6a29c58e 20003
3d99e817
AK
20004
20005
20006
3d99e817
AK
20007
20008
20009
20010
6ec2e0f5 20011 gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
3d99e817 20012
c0c3707f
CB
20013 case "$host_os" in
20014 mingw*)
3d99e817
AK
20015
20016
20017
20018
20019
20020
49e4877c 20021
49e4877c 20022
c0c3707f 20023 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
49e4877c 20024
c0c3707f
CB
20025 ;;
20026 esac
49e4877c
PA
20027
20028
9c9d63b1 20029
c0c3707f
CB
20030 :
20031
20032 fi
6a29c58e
YQ
20033
20034
88b48903 20035
8690e634 20036
a512b375 20037
c0c3707f
CB
20038 GNULIB_FSTAT=1
20039
20040
20041
20042
20043
20044$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
20045
20046
88b48903 20047
88b48903 20048
472fa5ee
SM
20049
20050
20051
20052
20053
6ec2e0f5
SDJ
20054
20055 if test $ac_cv_func_fstatat = no; then
20056 HAVE_FSTATAT=0
20057 else
20058 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
20059$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
d0ac1c44 20060if ${gl_cv_func_fstatat_zero_flag+:} false; then :
6ec2e0f5
SDJ
20061 $as_echo_n "(cached) " >&6
20062else
20063 if test "$cross_compiling" = yes; then :
20064 case "$host_os" in
20065 aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
20066 *) gl_cv_func_fstatat_zero_flag="guessing yes";;
20067 esac
88b48903 20068
8690e634
JK
20069else
20070 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20071/* end confdefs.h. */
8690e634 20072
6ec2e0f5
SDJ
20073 #include <fcntl.h>
20074 #include <sys/stat.h>
20075 int
20076 main (void)
20077 {
20078 struct stat a;
20079 return fstatat (AT_FDCWD, ".", &a, 0) != 0;
20080 }
20081
88b48903
WN
20082_ACEOF
20083if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20084 gl_cv_func_fstatat_zero_flag=yes
88b48903 20085else
6ec2e0f5 20086 gl_cv_func_fstatat_zero_flag=no
88b48903
WN
20087fi
20088rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20089 conftest.$ac_objext conftest.beam conftest.$ac_ext
20090fi
20091
20092
20093fi
6ec2e0f5
SDJ
20094{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
20095$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
88b48903 20096
6ec2e0f5
SDJ
20097 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
20098 *yes+*yes) ;;
c0c3707f
CB
20099 *) REPLACE_FSTATAT=1 ;;
20100 esac
20101
20102 case $host_os in
20103 solaris*)
20104 REPLACE_FSTATAT=1 ;;
20105 esac
20106
20107 case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
20108 1,*yes)
88b48903 20109
6ec2e0f5 20110$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
88b48903 20111
7a6dbc2f 20112 ;;
6ec2e0f5
SDJ
20113 esac
20114 fi
88b48903 20115
6ec2e0f5 20116 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
88b48903
WN
20117
20118
20119
20120
20121
88b48903 20122
4a626d0a
PA
20123
20124
6ec2e0f5
SDJ
20125 gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
20126
20127 fi
20128
20129
20130
4a626d0a 20131
6ec2e0f5
SDJ
20132
20133 GNULIB_FSTATAT=1
20134
20135
20136
20137
20138
20139$as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
20140
20141
20142
20143
20144
20145
20146
20147
20148 gl_abort_bug=no
4a626d0a
PA
20149 case "$host_os" in
20150 mingw*)
6ec2e0f5 20151 gl_cv_func_getcwd_path_max=yes
4a626d0a
PA
20152 ;;
20153 *)
88b48903 20154
88b48903 20155
88b48903
WN
20156
20157
88b48903 20158
6ec2e0f5
SDJ
20159 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
20160$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
d0ac1c44 20161if ${gl_cv_func_getcwd_path_max+:} false; then :
6ec2e0f5
SDJ
20162 $as_echo_n "(cached) " >&6
20163else
20164 # Arrange for deletion of the temporary directory this test creates.
20165 ac_clean_files="$ac_clean_files confdir3"
20166 if test "$cross_compiling" = yes; then :
b567ca63 20167 # Cross-compilation guesses:
c0c3707f
CB
20168 case "$host_os" in
20169 aix*) # On AIX, it has the AIX bug.
20170 gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
20171 gnu*) # On Hurd, it is 'yes'.
20172 gl_cv_func_getcwd_path_max='guessing yes' ;;
20173 linux* | kfreebsd*)
20174 # On older Linux+glibc it's 'no, but it is partly working',
20175 # on newer Linux+glibc it's 'yes'.
20176 # On Linux+musl libc, it's 'no, but it is partly working'.
20177 # On kFreeBSD+glibc, it's 'no, but it is partly working'.
20178 gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
20179 *) # If we don't know, obey --enable-cross-guesses.
20180 gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
20181 esac
b567ca63 20182
6ec2e0f5
SDJ
20183else
20184 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20185/* end confdefs.h. */
88b48903 20186
6ec2e0f5
SDJ
20187#include <errno.h>
20188#include <stdlib.h>
20189#if HAVE_UNISTD_H
20190# include <unistd.h>
20191#else
20192# include <direct.h>
20193#endif
20194#include <string.h>
20195#include <limits.h>
20196#include <sys/stat.h>
20197#include <sys/types.h>
20198#include <fcntl.h>
88b48903
WN
20199
20200
6ec2e0f5
SDJ
20201/* Arrange to define PATH_MAX, like "pathmax.h" does. */
20202#if HAVE_UNISTD_H
20203# include <unistd.h>
20204#endif
20205#include <limits.h>
20206#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
20207# include <sys/param.h>
20208#endif
20209#if !defined PATH_MAX && defined MAXPATHLEN
20210# define PATH_MAX MAXPATHLEN
20211#endif
20212#ifdef __hpux
20213# undef PATH_MAX
20214# define PATH_MAX 1024
20215#endif
c0c3707f 20216#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
20217# undef PATH_MAX
20218# define PATH_MAX 260
20219#endif
88b48903 20220
88b48903 20221
6ec2e0f5
SDJ
20222#ifndef AT_FDCWD
20223# define AT_FDCWD 0
20224#endif
20225#ifdef ENAMETOOLONG
20226# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
20227#else
20228# define is_ENAMETOOLONG(x) 0
20229#endif
88b48903 20230
6ec2e0f5
SDJ
20231/* Use the getcwd function, not any macro. */
20232#undef getcwd
88b48903 20233
9c9d63b1
PM
20234
20235
20236$gl_mda_defines
20237
88b48903 20238
6ec2e0f5
SDJ
20239#ifndef S_IRWXU
20240# define S_IRWXU 0700
20241#endif
88b48903 20242
6ec2e0f5
SDJ
20243/* The length of this name must be 8. */
20244#define DIR_NAME "confdir3"
20245#define DIR_NAME_LEN 8
20246#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
88b48903 20247
6ec2e0f5
SDJ
20248/* The length of "../". */
20249#define DOTDOTSLASH_LEN 3
88b48903 20250
6ec2e0f5
SDJ
20251/* Leftover bytes in the buffer, to work around library or OS bugs. */
20252#define BUF_SLOP 20
88b48903 20253
6ec2e0f5
SDJ
20254int
20255main ()
20256{
20257#ifndef PATH_MAX
20258 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
20259 at least not on a local file system. And if we were to start worrying
20260 about remote file systems, we'd have to enable the wrapper function
20261 all of the time, just to be safe. That's not worth the cost. */
20262 exit (0);
20263#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
20264 - DIR_NAME_SIZE - BUF_SLOP) \
20265 <= PATH_MAX)
20266 /* FIXME: Assuming there's a system for which this is true,
20267 this should be done in a compile test. */
20268 exit (0);
20269#else
20270 char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
20271 + DIR_NAME_SIZE + BUF_SLOP];
20272 char *cwd = getcwd (buf, PATH_MAX);
20273 size_t initial_cwd_len;
20274 size_t cwd_len;
20275 int fail = 0;
20276 size_t n_chdirs = 0;
88b48903 20277
6ec2e0f5
SDJ
20278 if (cwd == NULL)
20279 exit (10);
88b48903 20280
6ec2e0f5 20281 cwd_len = initial_cwd_len = strlen (cwd);
88b48903 20282
6ec2e0f5
SDJ
20283 while (1)
20284 {
20285 size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
20286 char *c = NULL;
20287
20288 cwd_len += DIR_NAME_SIZE;
20289 /* If mkdir or chdir fails, it could be that this system cannot create
20290 any file with an absolute name longer than PATH_MAX, such as cygwin.
20291 If so, leave fail as 0, because the current working directory can't
c0c3707f
CB
20292 be too long for getcwd if it can't even be created. On Linux with
20293 the 9p file system, mkdir fails with error EINVAL when cwd_len gets
20294 too long; ignore this failure because the getcwd() system call
20295 produces good results whereas the gnulib substitute calls getdents64
20296 which fails with error EPROTO.
20297 For other errors, be pessimistic and consider that as a failure,
20298 too. */
6ec2e0f5
SDJ
20299 if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
20300 {
20301 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
c0c3707f
CB
20302 #ifdef __linux__
20303 if (! (errno == EINVAL))
20304 #endif
20305 fail = 20;
6ec2e0f5
SDJ
20306 break;
20307 }
88b48903 20308
6ec2e0f5
SDJ
20309 if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
20310 {
20311 struct stat sb;
88b48903 20312
6ec2e0f5
SDJ
20313 c = getcwd (buf, PATH_MAX);
20314 if (!c && errno == ENOENT)
20315 {
20316 fail = 11;
20317 break;
20318 }
20319 if (c)
20320 {
20321 fail = 31;
20322 break;
20323 }
20324 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
20325 {
20326 fail = 21;
20327 break;
20328 }
88b48903 20329
6ec2e0f5
SDJ
20330 /* Our replacement needs to be able to stat() long ../../paths,
20331 so generate a path larger than PATH_MAX to check,
20332 avoiding the replacement if we can't stat(). */
20333 c = getcwd (buf, cwd_len + 1);
20334 if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
20335 {
20336 fail = 32;
20337 break;
20338 }
20339 }
88b48903 20340
6ec2e0f5
SDJ
20341 if (dotdot_max <= cwd_len - initial_cwd_len)
20342 {
20343 if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
20344 break;
20345 c = getcwd (buf, cwd_len + 1);
20346 if (!c)
20347 {
20348 if (! (errno == ERANGE || errno == ENOENT
20349 || is_ENAMETOOLONG (errno)))
20350 {
20351 fail = 22;
20352 break;
20353 }
20354 if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
20355 {
20356 fail = 12;
20357 break;
20358 }
20359 }
20360 }
88b48903 20361
6ec2e0f5
SDJ
20362 if (c && strlen (c) != cwd_len)
20363 {
20364 fail = 23;
20365 break;
20366 }
20367 ++n_chdirs;
20368 }
88b48903 20369
6ec2e0f5
SDJ
20370 /* Leaving behind such a deep directory is not polite.
20371 So clean up here, right away, even though the driving
20372 shell script would also clean up. */
20373 {
20374 size_t i;
88b48903 20375
6ec2e0f5
SDJ
20376 /* Try rmdir first, in case the chdir failed. */
20377 rmdir (DIR_NAME);
20378 for (i = 0; i <= n_chdirs; i++)
20379 {
20380 if (chdir ("..") < 0)
20381 break;
20382 if (rmdir (DIR_NAME) != 0)
20383 break;
20384 }
20385 }
88b48903 20386
6ec2e0f5
SDJ
20387 exit (fail);
20388#endif
20389}
88b48903 20390
6ec2e0f5
SDJ
20391_ACEOF
20392if ac_fn_c_try_run "$LINENO"; then :
20393 gl_cv_func_getcwd_path_max=yes
20394else
20395 case $? in
c0c3707f
CB
20396 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
20397 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
20398 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
20399 *) gl_cv_func_getcwd_path_max=no;;
20400 esac
6ec2e0f5
SDJ
20401fi
20402rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20403 conftest.$ac_objext conftest.beam conftest.$ac_ext
20404fi
88b48903 20405
88b48903 20406
6ec2e0f5
SDJ
20407fi
20408{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
20409$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
88b48903 20410
6ec2e0f5
SDJ
20411 case "$gl_cv_func_getcwd_null" in
20412 *yes)
88b48903
WN
20413
20414
472fa5ee
SM
20415
20416
20417
472fa5ee 20418
c0c3707f
CB
20419 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
20420$as_echo_n "checking for getpagesize... " >&6; }
20421if ${gl_cv_func_getpagesize+:} false; then :
20422 $as_echo_n "(cached) " >&6
20423else
20424 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20425/* end confdefs.h. */
20426#include <unistd.h>
20427int
20428main ()
20429{
20430return getpagesize();
20431 ;
20432 return 0;
20433}
472fa5ee 20434
c0c3707f
CB
20435_ACEOF
20436if ac_fn_c_try_link "$LINENO"; then :
20437 gl_cv_func_getpagesize=yes
20438else
20439 gl_cv_func_getpagesize=no
20440fi
20441rm -f core conftest.err conftest.$ac_objext \
20442 conftest$ac_exeext conftest.$ac_ext
472fa5ee 20443
c0c3707f
CB
20444fi
20445{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
20446$as_echo "$gl_cv_func_getpagesize" >&6; }
88b48903 20447
c0c3707f 20448 if test $gl_cv_func_getpagesize = yes; then
88b48903 20449
c0c3707f 20450cat >>confdefs.h <<_ACEOF
7a6dbc2f
SDJ
20451#define HAVE_GETPAGESIZE 1
20452_ACEOF
20453
c0c3707f 20454 fi
6ec2e0f5 20455
9c9d63b1
PM
20456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd succeeds when 4k < cwd_length < 16k" >&5
20457$as_echo_n "checking whether getcwd succeeds when 4k < cwd_length < 16k... " >&6; }
20458if ${gl_cv_func_getcwd_succeeds_beyond_4k+:} false; then :
88b48903
WN
20459 $as_echo_n "(cached) " >&6
20460else
6ec2e0f5
SDJ
20461 # Remove any remnants of a previous test.
20462 rm -rf confdir-14B---
20463 # Arrange for deletion of the temporary directory this test creates.
20464 ac_clean_files="$ac_clean_files confdir-14B---"
20465 if test "$cross_compiling" = yes; then :
c0c3707f 20466 case "$host_os" in
9c9d63b1
PM
20467 # Guess yes on musl systems.
20468 *-musl*) gl_cv_func_getcwd_succeeds_beyond_4k="guessing yes" ;;
20469 # Guess no otherwise, even on glibc systems.
20470 *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no"
c0c3707f
CB
20471 esac
20472
88b48903
WN
20473else
20474 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20475/* end confdefs.h. */
6ec2e0f5
SDJ
20476
20477#include <errno.h>
20478#include <stdlib.h>
20479#if HAVE_UNISTD_H
20480# include <unistd.h>
20481#else /* on Windows with MSVC */
20482# include <direct.h>
20483#endif
20484#include <string.h>
20485#include <sys/stat.h>
20486
20487
20488/* Arrange to define PATH_MAX, like "pathmax.h" does. */
20489#if HAVE_UNISTD_H
20490# include <unistd.h>
20491#endif
20492#include <limits.h>
20493#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
20494# include <sys/param.h>
20495#endif
20496#if !defined PATH_MAX && defined MAXPATHLEN
20497# define PATH_MAX MAXPATHLEN
20498#endif
20499#ifdef __hpux
20500# undef PATH_MAX
20501# define PATH_MAX 1024
20502#endif
c0c3707f 20503#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
20504# undef PATH_MAX
20505# define PATH_MAX 260
20506#endif
20507
20508
9c9d63b1
PM
20509
20510$gl_mda_defines
20511
6ec2e0f5
SDJ
20512
20513#ifndef S_IRWXU
20514# define S_IRWXU 0700
20515#endif
20516
20517/* FIXME: skip the run-test altogether on systems without getpagesize. */
20518#if ! HAVE_GETPAGESIZE
20519# define getpagesize() 0
20520#endif
20521
20522/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
20523 the 16kB pagesize on ia64 linux. Those conditions make the code below
20524 trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
20525#define TARGET_LEN (5 * 1024)
88b48903
WN
20526
20527int
20528main ()
20529{
6ec2e0f5
SDJ
20530 char *cwd;
20531 size_t initial_cwd_len;
20532 int fail = 0;
20533
20534 /* The bug is triggered when PATH_MAX < getpagesize (), so skip
20535 this relatively expensive and invasive test if that's not true. */
20536#ifdef PATH_MAX
20537 int bug_possible = PATH_MAX < getpagesize ();
20538#else
20539 int bug_possible = 0;
20540#endif
20541 if (! bug_possible)
20542 return 0;
8690e634 20543
6ec2e0f5
SDJ
20544 cwd = getcwd (NULL, 0);
20545 if (cwd == NULL)
20546 return 2;
20547
20548 initial_cwd_len = strlen (cwd);
20549 free (cwd);
20550
20551 if (1)
20552 {
20553 static char const dir_name[] = "confdir-14B---";
20554 size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
20555 / sizeof dir_name);
20556 size_t d;
20557 for (d = 0; d < desired_depth; d++)
20558 {
20559 if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
20560 {
20561 if (! (errno == ERANGE || errno == ENAMETOOLONG
20562 || errno == ENOENT))
20563 fail = 3; /* Unable to construct deep hierarchy. */
20564 break;
20565 }
20566 }
20567
20568 /* If libc has the bug in question, this invocation of getcwd
20569 results in a failed assertion. */
20570 cwd = getcwd (NULL, 0);
20571 if (cwd == NULL)
20572 fail = 4; /* getcwd didn't assert, but it failed for a long name
20573 where the answer could have been learned. */
20574 free (cwd);
20575
20576 /* Call rmdir first, in case the above chdir failed. */
20577 rmdir (dir_name);
20578 while (0 < d--)
20579 {
20580 if (chdir ("..") < 0)
20581 {
20582 fail = 5;
20583 break;
20584 }
20585 rmdir (dir_name);
20586 }
20587 }
20588
20589 return fail;
8690e634 20590}
6ec2e0f5 20591
8690e634
JK
20592_ACEOF
20593if ac_fn_c_try_run "$LINENO"; then :
9c9d63b1 20594 gl_cv_func_getcwd_succeeds_beyond_4k=yes
8690e634 20595else
c0c3707f
CB
20596 ret=$?
20597 if test $ret -ge 128 || test $ret = 4; then
9c9d63b1 20598 gl_cv_func_getcwd_succeeds_beyond_4k=no
c0c3707f 20599 else
9c9d63b1 20600 gl_cv_func_getcwd_succeeds_beyond_4k=yes
c0c3707f
CB
20601 fi
20602
8690e634
JK
20603fi
20604rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20605 conftest.$ac_objext conftest.beam conftest.$ac_ext
20606fi
20607
20608
20609fi
9c9d63b1
PM
20610{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_succeeds_beyond_4k" >&5
20611$as_echo "$gl_cv_func_getcwd_succeeds_beyond_4k" >&6; }
20612 case "$gl_cv_func_getcwd_succeeds_beyond_4k" in
20613 *no)
c0c3707f
CB
20614 gl_abort_bug=yes
20615 ;;
20616 *)
20617
20618 ;;
20619 esac
6ec2e0f5
SDJ
20620
20621 ;;
20622 esac
20623 ;;
20624 esac
20625 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 20626 *"no" | *"no, it has the AIX bug") ;;
6ec2e0f5
SDJ
20627 *)
20628
20629$as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
20630
20631 ;;
20632 esac
20633 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 20634 *"no, but it is partly working")
6ec2e0f5
SDJ
20635
20636$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
20637
20638 ;;
c0c3707f 20639 *"yes, but with shorter paths")
6ec2e0f5
SDJ
20640
20641$as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
20642
20643 ;;
20644 esac
20645
20646 if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
20647 || test $gl_cv_func_getcwd_posix_signature != yes \
20648 || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
20649 || test $gl_abort_bug = yes; then
20650 REPLACE_GETCWD=1
8690e634
JK
20651 fi
20652
6ec2e0f5 20653 if test $REPLACE_GETCWD = 1; then
8690e634
JK
20654
20655
8690e634
JK
20656
20657
20658
20659
20660
20661
6ec2e0f5 20662 gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
8690e634
JK
20663
20664
8690e634
JK
20665
20666
6ec2e0f5
SDJ
20667 :
20668
20669 fi
20670
8690e634
JK
20671
20672cat >>confdefs.h <<_ACEOF
6ec2e0f5 20673#define GNULIB_GETCWD 1
8690e634
JK
20674_ACEOF
20675
20676
8690e634 20677
8690e634
JK
20678
20679
c971b7fa 20680
c971b7fa 20681
6ec2e0f5
SDJ
20682 GNULIB_GETCWD=1
20683
20684
20685
20686
20687
20688$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
20689
c971b7fa 20690
c971b7fa 20691
c971b7fa 20692
c971b7fa 20693
c971b7fa 20694
c971b7fa 20695
c971b7fa 20696
6ec2e0f5
SDJ
20697 case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
20698 *yes,yes) ;;
20699 *)
20700 REPLACE_GETCWD=1
20701 ;;
20702 esac
c971b7fa 20703
6ec2e0f5 20704 if test $REPLACE_GETCWD = 1; then
c971b7fa 20705
c971b7fa
PA
20706
20707
c971b7fa
PA
20708
20709
c971b7fa 20710
c971b7fa 20711
c971b7fa 20712
6ec2e0f5 20713 gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
c971b7fa 20714
6ec2e0f5 20715 fi
c971b7fa 20716
c971b7fa 20717
c971b7fa 20718
c971b7fa 20719
8690e634 20720
6ec2e0f5 20721 GNULIB_GETCWD=1
c971b7fa 20722
88b48903
WN
20723
20724
20725
88b48903 20726
6ec2e0f5 20727$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
88b48903 20728
88b48903
WN
20729
20730
20731
6ec2e0f5
SDJ
20732
20733
20734
20735
c17253b9
MF
20736
20737
20738
20739 if test $ac_cv_func_getdelim = yes; then
20740 HAVE_GETDELIM=1
20741 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getdelim function" >&5
20742$as_echo_n "checking for working getdelim function... " >&6; }
20743if ${gl_cv_func_working_getdelim+:} false; then :
20744 $as_echo_n "(cached) " >&6
20745else
20746 echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
20747 if test "$cross_compiling" = yes; then :
20748 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20749/* end confdefs.h. */
20750
20751#include <features.h>
20752#ifdef __GNU_LIBRARY__
20753 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
20754 Lucky GNU user
20755 #endif
20756#endif
20757
20758_ACEOF
20759if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20760 $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
20761 gl_cv_func_working_getdelim="guessing yes"
20762else
20763 case "$host_os" in
20764 *-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
20765 *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
20766 esac
20767
20768fi
20769rm -f conftest*
20770
20771
20772else
20773 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20774/* end confdefs.h. */
20775
20776# include <stdio.h>
20777# include <stdlib.h>
20778# include <string.h>
20779 int main ()
20780 {
20781 FILE *in = fopen ("./conftest.data", "r");
20782 if (!in)
20783 return 1;
20784 {
20785 /* Test result for a NULL buffer and a zero size.
20786 Based on a test program from Karl Heuer. */
20787 char *line = NULL;
20788 size_t siz = 0;
20789 int len = getdelim (&line, &siz, '\n', in);
20790 if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
20791 { free (line); fclose (in); return 2; }
20792 free (line);
20793 }
20794 {
20795 /* Test result for a NULL buffer and a non-zero size.
20796 This crashes on FreeBSD 8.0. */
20797 char *line = NULL;
20798 size_t siz = (size_t)(~0) / 4;
20799 if (getdelim (&line, &siz, '\n', in) == -1)
20800 { fclose (in); return 3; }
20801 free (line);
20802 }
20803 fclose (in);
20804 return 0;
20805 }
20806
20807_ACEOF
20808if ac_fn_c_try_run "$LINENO"; then :
20809 gl_cv_func_working_getdelim=yes
20810else
20811 gl_cv_func_working_getdelim=no
20812fi
20813rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20814 conftest.$ac_objext conftest.beam conftest.$ac_ext
20815fi
20816
20817
20818fi
20819{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_getdelim" >&5
20820$as_echo "$gl_cv_func_working_getdelim" >&6; }
20821 case "$gl_cv_func_working_getdelim" in
20822 *yes) ;;
20823 *) REPLACE_GETDELIM=1 ;;
20824 esac
20825 else
20826 HAVE_GETDELIM=0
20827 fi
20828
20829 if test $ac_cv_have_decl_getdelim = no; then
20830 HAVE_DECL_GETDELIM=0
20831 fi
20832
20833 if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then
20834
20835
20836
20837
20838
20839
20840
20841
20842 gl_LIBOBJS="$gl_LIBOBJS getdelim.$ac_objext"
20843
20844
20845 for ac_func in flockfile funlockfile
20846do :
20847 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
20848ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
20849if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
20850 cat >>confdefs.h <<_ACEOF
20851#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
20852_ACEOF
20853
20854fi
20855done
20856
20857 ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
20858if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then :
20859 ac_have_decl=1
20860else
20861 ac_have_decl=0
20862fi
20863
20864cat >>confdefs.h <<_ACEOF
20865#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
20866_ACEOF
20867
20868
20869 fi
20870
20871
20872
20873
20874
20875 GNULIB_GETDELIM=1
20876
20877
20878
20879
20880
20881$as_echo "#define GNULIB_TEST_GETDELIM 1" >>confdefs.h
20882
20883
20884
20885
20886
20887
20888
20889
6ec2e0f5
SDJ
20890 if test $ac_cv_func_getdtablesize = yes &&
20891 test $ac_cv_have_decl_getdtablesize = yes; then
6ec2e0f5
SDJ
20892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
20893$as_echo_n "checking whether getdtablesize works... " >&6; }
d0ac1c44 20894if ${gl_cv_func_getdtablesize_works+:} false; then :
88b48903
WN
20895 $as_echo_n "(cached) " >&6
20896else
c0c3707f
CB
20897 case "$host_os" in
20898 vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
20899 *)
20900 if test "$cross_compiling" = yes; then :
88b48903 20901 case "$host_os" in
c0c3707f
CB
20902 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
20903 gl_cv_func_getdtablesize_works="guessing no" ;;
20904 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
20905 esac
20906
88b48903
WN
20907else
20908 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20909/* end confdefs.h. */
20910
c0c3707f 20911 #include <unistd.h>
9c9d63b1
PM
20912
20913
20914$gl_mda_defines
20915
20916
6ec2e0f5
SDJ
20917int
20918main ()
88b48903 20919{
6ec2e0f5 20920int size = getdtablesize();
9c9d63b1
PM
20921 if (dup2 (0, getdtablesize()) != -1)
20922 return 1;
20923 if (size != getdtablesize())
20924 return 2;
6ec2e0f5
SDJ
20925
20926 ;
20927 return 0;
88b48903
WN
20928}
20929_ACEOF
20930if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20931 gl_cv_func_getdtablesize_works=yes
88b48903 20932else
6ec2e0f5 20933 gl_cv_func_getdtablesize_works=no
88b48903
WN
20934fi
20935rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20936 conftest.$ac_objext conftest.beam conftest.$ac_ext
20937fi
20938
c0c3707f
CB
20939 ;;
20940 esac
88b48903
WN
20941
20942fi
6ec2e0f5
SDJ
20943{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
20944$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
20945 case "$gl_cv_func_getdtablesize_works" in
c0c3707f 20946 *yes | "no (limitation)") ;;
6ec2e0f5 20947 *) REPLACE_GETDTABLESIZE=1 ;;
88b48903
WN
20948 esac
20949 else
6ec2e0f5 20950 HAVE_GETDTABLESIZE=0
88b48903
WN
20951 fi
20952
6ec2e0f5 20953 if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
88b48903
WN
20954
20955
20956
20957
20958
20959
20960
20961
6ec2e0f5 20962 gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
88b48903 20963
6ec2e0f5 20964 :
88b48903
WN
20965 fi
20966
20967
20968
20969
20970
6ec2e0f5 20971 GNULIB_GETDTABLESIZE=1
88b48903
WN
20972
20973
20974
88b48903 20975
88b48903 20976
6ec2e0f5 20977$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
88b48903 20978
88b48903 20979
88b48903 20980
88b48903 20981
88b48903 20982
88b48903 20983
88b48903 20984
88b48903
WN
20985
20986
c17253b9
MF
20987
20988 gl_getline_needs_run_time_check=no
20989 ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline"
20990if test "x$ac_cv_func_getline" = xyes; then :
20991 gl_getline_needs_run_time_check=yes
20992else
20993 am_cv_func_working_getline=no
20994fi
20995
20996 if test $gl_getline_needs_run_time_check = yes; then
20997 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getline function" >&5
20998$as_echo_n "checking for working getline function... " >&6; }
20999if ${am_cv_func_working_getline+:} false; then :
21000 $as_echo_n "(cached) " >&6
21001else
21002 echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
21003 if test "$cross_compiling" = yes; then :
21004 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21005/* end confdefs.h. */
21006
21007#include <features.h>
21008#ifdef __GNU_LIBRARY__
21009 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
21010 Lucky GNU user
21011 #endif
21012#endif
21013
21014_ACEOF
21015if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21016 $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
21017 am_cv_func_working_getline="guessing yes"
21018else
21019 case "$host_os" in
21020 *-musl*) am_cv_func_working_getline="guessing yes" ;;
21021 *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
21022 esac
21023
21024fi
21025rm -f conftest*
21026
21027
21028else
21029 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21030/* end confdefs.h. */
21031
21032# include <stdio.h>
21033# include <stdlib.h>
21034# include <string.h>
21035 int main ()
21036 {
21037 FILE *in = fopen ("./conftest.data", "r");
21038 if (!in)
21039 return 1;
21040 {
21041 /* Test result for a NULL buffer and a zero size.
21042 Based on a test program from Karl Heuer. */
21043 char *line = NULL;
21044 size_t siz = 0;
21045 int len = getline (&line, &siz, in);
21046 if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
21047 { free (line); fclose (in); return 2; }
21048 free (line);
21049 }
21050 {
21051 /* Test result for a NULL buffer and a non-zero size.
21052 This crashes on FreeBSD 8.0. */
21053 char *line = NULL;
21054 size_t siz = (size_t)(~0) / 4;
21055 if (getline (&line, &siz, in) == -1)
21056 { fclose (in); return 3; }
21057 free (line);
21058 }
21059 fclose (in);
21060 return 0;
21061 }
21062
21063_ACEOF
21064if ac_fn_c_try_run "$LINENO"; then :
21065 am_cv_func_working_getline=yes
21066else
21067 am_cv_func_working_getline=no
21068fi
21069rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21070 conftest.$ac_objext conftest.beam conftest.$ac_ext
21071fi
21072
21073
21074fi
21075{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_working_getline" >&5
21076$as_echo "$am_cv_func_working_getline" >&6; }
21077 fi
21078
21079 if test $ac_cv_have_decl_getline = no; then
21080 HAVE_DECL_GETLINE=0
21081 fi
21082
21083 case "$am_cv_func_working_getline" in
21084 *yes) ;;
21085 *)
21086 REPLACE_GETLINE=1
21087 ;;
21088 esac
21089
21090 if test $REPLACE_GETLINE = 1; then
21091
21092
21093
21094
21095
21096
21097
21098
21099 gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext"
21100
21101
21102 :
21103
21104 fi
21105
21106
21107
21108
21109
21110 GNULIB_GETLINE=1
21111
21112
21113
21114
21115
21116$as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h
21117
21118
21119
21120
21121
21122
21123
21124
21125
6ec2e0f5
SDJ
21126 if test $ac_cv_have_decl_getlogin_r = no; then
21127 HAVE_DECL_GETLOGIN_R=0
21128 fi
88b48903 21129
88b48903 21130
6ec2e0f5
SDJ
21131 if test $ac_cv_func_getlogin_r = no; then
21132 HAVE_GETLOGIN_R=0
21133 else
21134 HAVE_GETLOGIN_R=1
21135
21136 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5
21137$as_echo_n "checking whether getlogin_r works with small buffers... " >&6; }
d0ac1c44 21138if ${gl_cv_func_getlogin_r_works+:} false; then :
6ec2e0f5
SDJ
21139 $as_echo_n "(cached) " >&6
21140else
88b48903 21141
6ec2e0f5 21142 case "$host_os" in
c0c3707f
CB
21143 # Guess no on Mac OS X, OSF/1.
21144 darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;;
21145 # Guess yes otherwise.
21146 *) gl_cv_func_getlogin_r_works="guessing yes" ;;
6ec2e0f5
SDJ
21147 esac
21148 if test "$cross_compiling" = yes; then :
21149 :
88b48903
WN
21150else
21151 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21152/* end confdefs.h. */
21153
6ec2e0f5 21154#include <stddef.h>
c0c3707f 21155#include <string.h>
6ec2e0f5
SDJ
21156#include <unistd.h>
21157#if !HAVE_DECL_GETLOGIN_R
88b48903 21158extern
6ec2e0f5 21159# ifdef __cplusplus
88b48903 21160"C"
6ec2e0f5
SDJ
21161# endif
21162int getlogin_r (char *, size_t);
88b48903 21163#endif
6ec2e0f5
SDJ
21164int
21165main (void)
88b48903
WN
21166{
21167 int result = 0;
6ec2e0f5
SDJ
21168 char buf[100];
21169
21170 if (getlogin_r (buf, 0) == 0)
c0c3707f 21171 result |= 1;
6ec2e0f5 21172 if (getlogin_r (buf, 1) == 0)
c0c3707f
CB
21173 result |= 2;
21174 if (getlogin_r (buf, 100) == 0)
21175 {
21176 size_t n = strlen (buf);
21177 if (getlogin_r (buf, n) == 0)
21178 result |= 4;
21179 }
88b48903
WN
21180 return result;
21181}
21182_ACEOF
21183if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 21184 gl_cv_func_getlogin_r_works=yes
88b48903 21185else
c0c3707f 21186 gl_cv_func_getlogin_r_works=no
88b48903
WN
21187fi
21188rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21189 conftest.$ac_objext conftest.beam conftest.$ac_ext
21190fi
21191
21192
4a626d0a 21193fi
6ec2e0f5
SDJ
21194{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5
21195$as_echo "$gl_cv_func_getlogin_r_works" >&6; }
21196 case "$gl_cv_func_getlogin_r_works" in
21197 *yes) ;;
21198 *) REPLACE_GETLOGIN_R=1 ;;
21199 esac
21200 fi
21201
21202 if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then
21203
21204
21205
21206
21207
21208
21209
21210
21211 gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext"
4a626d0a 21212
4a626d0a 21213
4a626d0a 21214
4a626d0a 21215
4a626d0a
PA
21216 fi
21217
21218
4a626d0a
PA
21219
21220
21221
6ec2e0f5 21222 GNULIB_GETLOGIN_R=1
4a626d0a
PA
21223
21224
21225
21226
21227
6ec2e0f5 21228$as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h
4a626d0a 21229
4a626d0a
PA
21230
21231
21232
21233
472fa5ee 21234
4a626d0a 21235
6ec2e0f5
SDJ
21236 ac_found=0
21237 ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
21238"
d0ac1c44 21239if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
6ec2e0f5
SDJ
21240 ac_have_decl=1
21241else
21242 ac_have_decl=0
21243fi
21244
21245cat >>confdefs.h <<_ACEOF
21246#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
21247_ACEOF
21248if test $ac_have_decl = 1; then :
21249 ac_found=1
21250fi
21251
21252 ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
21253"
d0ac1c44 21254if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
6ec2e0f5
SDJ
21255 ac_have_decl=1
21256else
21257 ac_have_decl=0
21258fi
21259
21260cat >>confdefs.h <<_ACEOF
21261#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
21262_ACEOF
21263if test $ac_have_decl = 1; then :
21264 ac_found=1
21265fi
4a626d0a 21266
6ec2e0f5
SDJ
21267 ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
21268"
d0ac1c44 21269if test "x$ac_cv_have_decl___argv" = xyes; then :
6ec2e0f5
SDJ
21270 ac_have_decl=1
21271else
21272 ac_have_decl=0
21273fi
4a626d0a 21274
6ec2e0f5
SDJ
21275cat >>confdefs.h <<_ACEOF
21276#define HAVE_DECL___ARGV $ac_have_decl
21277_ACEOF
21278if test $ac_have_decl = 1; then :
21279 ac_found=1
21280fi
4a626d0a
PA
21281
21282
6ec2e0f5
SDJ
21283 # Incur the cost of this test only if none of the above worked.
21284 if test $ac_found = 0; then
21285 # On OpenBSD 5.1, using the global __progname variable appears to be
21286 # the only way to implement getprogname.
21287 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
21288$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
d0ac1c44 21289if ${gl_cv_var___progname+:} false; then :
6ec2e0f5
SDJ
21290 $as_echo_n "(cached) " >&6
21291else
4a626d0a 21292
6ec2e0f5
SDJ
21293 gl_cv_var___progname=
21294 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21295/* end confdefs.h. */
21296extern char *__progname;
21297int
21298main ()
21299{
21300return *__progname;
21301
21302 ;
21303 return 0;
21304}
21305_ACEOF
21306if ac_fn_c_try_link "$LINENO"; then :
21307 gl_cv_var___progname=yes
21308
21309fi
21310rm -f core conftest.err conftest.$ac_objext \
21311 conftest$ac_exeext conftest.$ac_ext
21312
21313
21314fi
21315{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
21316$as_echo "$gl_cv_var___progname" >&6; }
21317 if test "$gl_cv_var___progname" = yes; then
21318
21319$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
21320
21321 fi
21322 fi
4a626d0a
PA
21323
21324
21325
21326
21327
698be2d8
CB
21328 if test "$ac_cv_func_getrandom" != yes; then
21329 HAVE_GETRANDOM=0
21330 else
21331 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getrandom is compatible with its GNU+BSD signature" >&5
21332$as_echo_n "checking whether getrandom is compatible with its GNU+BSD signature... " >&6; }
21333if ${gl_cv_func_getrandom_ok+:} false; then :
21334 $as_echo_n "(cached) " >&6
21335else
21336 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21337/* end confdefs.h. */
9c9d63b1
PM
21338/* Additional includes are needed before <sys/random.h> on uClibc
21339 and Mac OS X. */
698be2d8
CB
21340 #include <sys/types.h>
21341 #include <stdlib.h>
21342 #include <sys/random.h>
21343 ssize_t getrandom (void *, size_t, unsigned int);
21344
21345int
21346main ()
21347{
21348
21349 ;
21350 return 0;
21351}
21352
21353_ACEOF
21354if ac_fn_c_try_compile "$LINENO"; then :
21355 gl_cv_func_getrandom_ok=yes
21356else
21357 gl_cv_func_getrandom_ok=no
21358fi
21359rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21360
21361fi
21362{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getrandom_ok" >&5
21363$as_echo "$gl_cv_func_getrandom_ok" >&6; }
21364 if test $gl_cv_func_getrandom_ok = no; then
21365 REPLACE_GETRANDOM=1
21366 fi
21367 fi
21368
21369 case "$host_os" in
21370 mingw*)
21371 for ac_header in bcrypt.h
21372do :
9c9d63b1
PM
21373 ac_fn_c_check_header_compile "$LINENO" "bcrypt.h" "ac_cv_header_bcrypt_h" "#include <windows.h>
21374
21375"
698be2d8
CB
21376if test "x$ac_cv_header_bcrypt_h" = xyes; then :
21377 cat >>confdefs.h <<_ACEOF
21378#define HAVE_BCRYPT_H 1
21379_ACEOF
21380
21381fi
21382
21383done
21384
21385 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the bcrypt library is guaranteed to be present" >&5
21386$as_echo_n "checking whether the bcrypt library is guaranteed to be present... " >&6; }
21387if ${gl_cv_lib_assume_bcrypt+:} false; then :
21388 $as_echo_n "(cached) " >&6
21389else
21390 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21391/* end confdefs.h. */
21392#include <windows.h>
21393int
21394main ()
21395{
21396#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
21397 cannot assume it
21398 #endif
21399
21400 ;
21401 return 0;
21402}
21403
21404_ACEOF
21405if ac_fn_c_try_compile "$LINENO"; then :
21406 gl_cv_lib_assume_bcrypt=yes
21407else
21408 gl_cv_lib_assume_bcrypt=no
21409fi
21410rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21411
21412fi
21413{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_assume_bcrypt" >&5
21414$as_echo "$gl_cv_lib_assume_bcrypt" >&6; }
21415 if test $gl_cv_lib_assume_bcrypt = yes; then
21416
21417$as_echo "#define HAVE_LIB_BCRYPT 1" >>confdefs.h
21418
21419 LIB_GETRANDOM='-lbcrypt'
21420 else
21421 LIB_GETRANDOM='-ladvapi32'
21422 fi
21423 ;;
21424 *)
21425 LIB_GETRANDOM= ;;
21426 esac
21427
21428
21429 if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
21430
21431
21432
21433
21434
21435
21436
21437
21438 gl_LIBOBJS="$gl_LIBOBJS getrandom.$ac_objext"
21439
21440 fi
21441
21442
21443
21444
21445
21446 GNULIB_GETRANDOM=1
21447
21448
21449
21450
21451
21452$as_echo "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.h
21453
21454
21455
21456
21457
21458
21459
4a626d0a
PA
21460
21461
21462
472fa5ee 21463
4a626d0a
PA
21464
21465 gl_gettimeofday_timezone=void
21466 if test $ac_cv_func_gettimeofday != yes; then
21467 HAVE_GETTIMEOFDAY=0
21468 else
4a626d0a
PA
21469 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
21470$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
d0ac1c44 21471if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
4a626d0a
PA
21472 $as_echo_n "(cached) " >&6
21473else
21474 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21475/* end confdefs.h. */
21476#include <sys/time.h>
21477 struct timeval c;
21478 int gettimeofday (struct timeval *restrict, void *restrict);
21479
21480int
21481main ()
21482{
21483/* glibc uses struct timezone * rather than the POSIX void *
21484 if _GNU_SOURCE is defined. However, since the only portable
21485 use of gettimeofday uses NULL as the second parameter, and
21486 since the glibc definition is actually more typesafe, it is
21487 not worth wrapping this to get a compliant signature. */
21488 int (*f) (struct timeval *restrict, void *restrict)
21489 = gettimeofday;
21490 int x = f (&c, 0);
21491 return !(x | c.tv_sec | c.tv_usec);
21492
21493 ;
21494 return 0;
21495}
21496_ACEOF
21497if ac_fn_c_try_compile "$LINENO"; then :
21498 gl_cv_func_gettimeofday_posix_signature=yes
21499else
21500 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21501/* end confdefs.h. */
21502#include <sys/time.h>
21503int gettimeofday (struct timeval *restrict, struct timezone *restrict);
21504
21505int
21506main ()
21507{
21508
21509 ;
21510 return 0;
21511}
21512_ACEOF
21513if ac_fn_c_try_compile "$LINENO"; then :
21514 gl_cv_func_gettimeofday_posix_signature=almost
21515else
21516 gl_cv_func_gettimeofday_posix_signature=no
21517fi
21518rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21519fi
21520rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21521fi
21522{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
21523$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
21524 if test $gl_cv_func_gettimeofday_posix_signature = almost; then
21525 gl_gettimeofday_timezone='struct timezone'
21526 elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
21527 REPLACE_GETTIMEOFDAY=1
21528 fi
21529 if test $REPLACE_STRUCT_TIMEVAL = 1; then
21530 REPLACE_GETTIMEOFDAY=1
21531 fi
c0c3707f
CB
21532 case "$host_os" in
21533 mingw*) REPLACE_GETTIMEOFDAY=1 ;;
21534 esac
4a626d0a
PA
21535 fi
21536
21537cat >>confdefs.h <<_ACEOF
c0c3707f
CB
21538#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
21539_ACEOF
88b48903
WN
21540
21541
c0c3707f 21542 if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
88b48903 21543
6ec2e0f5 21544
6ec2e0f5 21545
6ec2e0f5 21546
6ec2e0f5 21547
6ec2e0f5
SDJ
21548
21549
6ec2e0f5 21550
c0c3707f 21551 gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
6ec2e0f5 21552
c0c3707f 21553 :
5e8754f9 21554 fi
6ec2e0f5
SDJ
21555
21556
21557
6ec2e0f5
SDJ
21558
21559
5e8754f9 21560 GNULIB_GETTIMEOFDAY=1
6ec2e0f5
SDJ
21561
21562
21563
7a6dbc2f
SDJ
21564
21565
5e8754f9 21566$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
6ec2e0f5
SDJ
21567
21568
21569
6ec2e0f5 21570
6ec2e0f5 21571
6ec2e0f5
SDJ
21572
21573
c0c3707f
CB
21574 if test $ac_cv_func_glob = no; then
21575 HAVE_GLOB=0
21576 else
21577
21578 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5
21579$as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; }
21580if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then :
6ec2e0f5
SDJ
21581 $as_echo_n "(cached) " >&6
21582else
21583 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21584/* end confdefs.h. */
21585#include <gnu-versions.h>
c0c3707f 21586char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];
6ec2e0f5
SDJ
21587_ACEOF
21588if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 21589 gl_cv_gnu_glob_interface_version_1_2=yes
6ec2e0f5 21590else
c0c3707f 21591 gl_cv_gnu_glob_interface_version_1_2=no
6ec2e0f5
SDJ
21592fi
21593rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21594fi
c0c3707f
CB
21595{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5
21596$as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; }
21597 if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then
21598 REPLACE_GLOB=1
6ec2e0f5 21599 fi
6ec2e0f5 21600
c0c3707f
CB
21601 if test $REPLACE_GLOB = 0; then
21602 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5
6ec2e0f5 21603$as_echo_n "checking whether glob lists broken symlinks... " >&6; }
d0ac1c44 21604if ${gl_cv_glob_lists_symlinks+:} false; then :
6ec2e0f5
SDJ
21605 $as_echo_n "(cached) " >&6
21606else
c0c3707f
CB
21607 if test $cross_compiling != yes; then
21608 if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
21609 gl_cv_glob_lists_symlinks=maybe
21610 else
21611 # If we can't make a symlink, then we cannot test this issue. Be
21612 # pessimistic about this.
21613 gl_cv_glob_lists_symlinks=no
21614 fi
21615 if test $gl_cv_glob_lists_symlinks = maybe; then
21616 if test "$cross_compiling" = yes; then :
21617 :
5e8754f9 21618
6ec2e0f5
SDJ
21619else
21620 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21621/* end confdefs.h. */
6ec2e0f5 21622#include <stddef.h>
c0c3707f 21623 #include <glob.h>
6ec2e0f5
SDJ
21624int
21625main ()
21626{
21627glob_t found;
c0c3707f
CB
21628 if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
21629 return 1;
698be2d8 21630 globfree (&found);
c0c3707f 21631
6ec2e0f5
SDJ
21632 ;
21633 return 0;
21634}
4a626d0a 21635_ACEOF
6ec2e0f5
SDJ
21636if ac_fn_c_try_run "$LINENO"; then :
21637 gl_cv_glob_lists_symlinks=yes
21638else
21639 gl_cv_glob_lists_symlinks=no
21640fi
21641rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21642 conftest.$ac_objext conftest.beam conftest.$ac_ext
21643fi
88b48903 21644
c0c3707f
CB
21645 fi
21646 rm -f conf$$-globtest
21647 else
21648 gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
21649 fi
21650
4a626d0a 21651fi
6ec2e0f5
SDJ
21652{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5
21653$as_echo "$gl_cv_glob_lists_symlinks" >&6; }
c0c3707f
CB
21654 case "$gl_cv_glob_lists_symlinks" in
21655 *yes) ;;
21656 *) REPLACE_GLOB=1 ;;
21657 esac
21658 fi
21659
21660 fi
88b48903 21661
c0c3707f
CB
21662 if test $ac_cv_func_glob_pattern_p = no; then
21663 HAVE_GLOB_PATTERN_P=0
21664 else
21665 if test $REPLACE_GLOB = 1; then
21666 REPLACE_GLOB_PATTERN_P=1
6ec2e0f5
SDJ
21667 fi
21668 fi
4a626d0a 21669
c0c3707f 21670 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
4a626d0a 21671
88b48903 21672
c0c3707f 21673 GLOB_H='glob.h'
6ec2e0f5
SDJ
21674 if test -n "$GLOB_H"; then
21675 GL_GENERATE_GLOB_H_TRUE=
21676 GL_GENERATE_GLOB_H_FALSE='#'
21677else
21678 GL_GENERATE_GLOB_H_TRUE='#'
21679 GL_GENERATE_GLOB_H_FALSE=
21680fi
88b48903 21681
88b48903 21682
c0c3707f
CB
21683 fi
21684
21685 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
472fa5ee
SM
21686
21687
21688
21689
21690
21691
21692
21693
21694 gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext"
21695
21696
21697
7a6dbc2f
SDJ
21698
21699
21700
472fa5ee 21701
472fa5ee 21702
88b48903 21703
c0c3707f 21704 gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext"
88b48903
WN
21705
21706
21707
725e2999
JB
21708
21709
21710
c0c3707f
CB
21711 fi
21712 if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then
21713
725e2999
JB
21714
21715
21716
21717
21718
21719
21720
c0c3707f 21721 gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext"
725e2999
JB
21722
21723 fi
21724
725e2999
JB
21725
21726
21727
21728
c0c3707f
CB
21729 GNULIB_GLOB=1
21730
21731
21732
21733
21734
21735$as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h
21736
21737
725e2999
JB
21738
21739
21740
5df4cba6
SM
21741 LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
21742
21743
725e2999 21744
725e2999
JB
21745
21746
21747
21748
725e2999 21749
c0c3707f
CB
21750 HAVE_INET_NTOP=1
21751 INET_NTOP_LIB=
725e2999
JB
21752
21753
21754
21755
21756 if test $ac_cv_header_sys_socket_h != yes; then
21757 for ac_header in winsock2.h
21758do :
21759 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
21760if test "x$ac_cv_header_winsock2_h" = xyes; then :
21761 cat >>confdefs.h <<_ACEOF
21762#define HAVE_WINSOCK2_H 1
21763_ACEOF
21764
21765fi
21766
21767done
21768
21769 fi
21770 if test "$ac_cv_header_winsock2_h" = yes; then
21771 HAVE_WINSOCK2_H=1
21772 UNISTD_H_HAVE_WINSOCK2_H=1
21773 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
21774 else
21775 HAVE_WINSOCK2_H=0
21776 fi
21777
21778
21779 if test $HAVE_WINSOCK2_H = 1; then
c0c3707f 21780 REPLACE_INET_NTOP=1
725e2999
JB
21781 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
21782"
21783if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
21784 ac_have_decl=1
21785else
21786 ac_have_decl=0
21787fi
21788
21789cat >>confdefs.h <<_ACEOF
21790#define HAVE_DECL_INET_NTOP $ac_have_decl
21791_ACEOF
21792
21793 if test $ac_cv_have_decl_inet_ntop = yes; then
725e2999
JB
21794 INET_NTOP_LIB="-lws2_32"
21795 else
21796 HAVE_DECL_INET_NTOP=0
725e2999
JB
21797 fi
21798 else
21799 gl_save_LIBS=$LIBS
21800 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
21801$as_echo_n "checking for library containing inet_ntop... " >&6; }
21802if ${ac_cv_search_inet_ntop+:} false; then :
21803 $as_echo_n "(cached) " >&6
21804else
21805 ac_func_search_save_LIBS=$LIBS
21806cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21807/* end confdefs.h. */
21808
21809/* Override any GCC internal prototype to avoid an error.
21810 Use char because int might match the return type of a GCC
21811 builtin and then its argument prototype would still apply. */
21812#ifdef __cplusplus
21813extern "C"
21814#endif
21815char inet_ntop ();
21816int
21817main ()
21818{
21819return inet_ntop ();
21820 ;
21821 return 0;
21822}
21823_ACEOF
c0c3707f 21824for ac_lib in '' nsl resolv network; do
725e2999
JB
21825 if test -z "$ac_lib"; then
21826 ac_res="none required"
21827 else
21828 ac_res=-l$ac_lib
21829 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
21830 fi
21831 if ac_fn_c_try_link "$LINENO"; then :
21832 ac_cv_search_inet_ntop=$ac_res
21833fi
21834rm -f core conftest.err conftest.$ac_objext \
21835 conftest$ac_exeext
21836 if ${ac_cv_search_inet_ntop+:} false; then :
21837 break
21838fi
21839done
21840if ${ac_cv_search_inet_ntop+:} false; then :
21841
21842else
21843 ac_cv_search_inet_ntop=no
21844fi
21845rm conftest.$ac_ext
21846LIBS=$ac_func_search_save_LIBS
21847fi
21848{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
21849$as_echo "$ac_cv_search_inet_ntop" >&6; }
21850ac_res=$ac_cv_search_inet_ntop
21851if test "$ac_res" != no; then :
21852 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
21853
21854else
21855 for ac_func in inet_ntop
21856do :
21857 ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
21858if test "x$ac_cv_func_inet_ntop" = xyes; then :
21859 cat >>confdefs.h <<_ACEOF
21860#define HAVE_INET_NTOP 1
21861_ACEOF
21862
21863fi
21864done
21865
21866 if test $ac_cv_func_inet_ntop = no; then
21867 HAVE_INET_NTOP=0
21868 fi
21869
21870fi
21871
21872 LIBS=$gl_save_LIBS
21873
21874 if test "$ac_cv_search_inet_ntop" != "no" \
21875 && test "$ac_cv_search_inet_ntop" != "none required"; then
21876 INET_NTOP_LIB="$ac_cv_search_inet_ntop"
21877 fi
21878
21879
725e2999
JB
21880 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
21881 #if HAVE_NETDB_H
21882 # include <netdb.h>
21883 #endif
21884
21885"
21886if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
21887 ac_have_decl=1
21888else
21889 ac_have_decl=0
21890fi
21891
21892cat >>confdefs.h <<_ACEOF
21893#define HAVE_DECL_INET_NTOP $ac_have_decl
21894_ACEOF
21895
21896 if test $ac_cv_have_decl_inet_ntop = no; then
21897 HAVE_DECL_INET_NTOP=0
21898 fi
21899 fi
21900
21901
21902 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
21903
21904
21905
21906
21907
21908
21909
7a6dbc2f 21910
725e2999 21911 gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext"
7a6dbc2f
SDJ
21912
21913
21914
7a6dbc2f 21915
725e2999 21916 fi
7a6dbc2f
SDJ
21917
21918
21919
21920
7a6dbc2f 21921
725e2999
JB
21922 GNULIB_INET_NTOP=1
21923
7a6dbc2f
SDJ
21924
21925
49e4877c
PA
21926
21927
88b48903
WN
21928
21929
88b48903
WN
21930 PRIPTR_PREFIX=
21931 if test -n "$STDINT_H"; then
9c9d63b1
PM
21932 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21933/* end confdefs.h. */
21934
21935 #ifdef _WIN64
21936 LLP64
21937 #endif
21938
21939int
21940main ()
21941{
21942
21943 ;
21944 return 0;
21945}
21946
21947_ACEOF
21948if ac_fn_c_try_compile "$LINENO"; then :
21949 PRIPTR_PREFIX='"l"'
21950else
21951 PRIPTR_PREFIX='"ll"'
21952fi
21953rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903
WN
21954 else
21955 for glpfx in '' l ll I64; do
21956 case $glpfx in
21957 '') gltype1='int';;
21958 l) gltype1='long int';;
21959 ll) gltype1='long long int';;
21960 I64) gltype1='__int64';;
21961 esac
21962 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21963/* end confdefs.h. */
21964#include <stdint.h>
21965 extern intptr_t foo;
21966 extern $gltype1 foo;
21967int
21968main ()
21969{
21970
21971 ;
21972 return 0;
21973}
21974_ACEOF
21975if ac_fn_c_try_compile "$LINENO"; then :
21976 PRIPTR_PREFIX='"'$glpfx'"'
21977fi
21978rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21979 test -n "$PRIPTR_PREFIX" && break
21980 done
21981 fi
21982
21983
21984
21985 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
21986$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
d0ac1c44 21987if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
88b48903
WN
21988 $as_echo_n "(cached) " >&6
21989else
21990 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21991/* end confdefs.h. */
21992/* Work also in C++ mode. */
21993 #define __STDC_LIMIT_MACROS 1
21994
21995 /* Work if build is not clean. */
21996 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21997
21998 #include <limits.h>
21999 #if HAVE_STDINT_H
22000 #include <stdint.h>
22001 #endif
22002
22003 #if defined INT32_MAX && defined INTMAX_MAX
22004 #define CONDITION (INT32_MAX < INTMAX_MAX)
88b48903 22005 #else
5df4cba6 22006 #define CONDITION (sizeof (int) < sizeof (long long int))
88b48903
WN
22007 #endif
22008 int test[CONDITION ? 1 : -1];
22009int
22010main ()
22011{
22012
22013 ;
22014 return 0;
22015}
22016_ACEOF
22017if ac_fn_c_try_compile "$LINENO"; then :
22018 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
22019else
22020 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
22021fi
22022rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22023fi
22024{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
22025$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
22026 if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
22027 INT32_MAX_LT_INTMAX_MAX=1;
22028 else
22029 INT32_MAX_LT_INTMAX_MAX=0;
22030 fi
22031
22032
22033 if test $APPLE_UNIVERSAL_BUILD = 0; then
22034
22035 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
22036$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
d0ac1c44 22037if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
88b48903
WN
22038 $as_echo_n "(cached) " >&6
22039else
22040 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22041/* end confdefs.h. */
22042/* Work also in C++ mode. */
22043 #define __STDC_LIMIT_MACROS 1
22044
22045 /* Work if build is not clean. */
22046 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
22047
22048 #include <limits.h>
22049 #if HAVE_STDINT_H
22050 #include <stdint.h>
22051 #endif
22052
22053 #if defined INT64_MAX
22054 #define CONDITION (INT64_MAX == LONG_MAX)
88b48903 22055 #else
5df4cba6 22056 #define CONDITION (sizeof (long long int) == sizeof (long int))
88b48903
WN
22057 #endif
22058 int test[CONDITION ? 1 : -1];
22059int
22060main ()
22061{
22062
22063 ;
22064 return 0;
22065}
22066_ACEOF
22067if ac_fn_c_try_compile "$LINENO"; then :
22068 gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
22069else
22070 gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
22071fi
22072rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22073fi
22074{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
22075$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
22076 if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
22077 INT64_MAX_EQ_LONG_MAX=1;
22078 else
22079 INT64_MAX_EQ_LONG_MAX=0;
22080 fi
22081
22082
22083 else
22084 INT64_MAX_EQ_LONG_MAX=-1
22085 fi
22086
22087 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
22088$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
d0ac1c44 22089if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
88b48903
WN
22090 $as_echo_n "(cached) " >&6
22091else
22092 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22093/* end confdefs.h. */
22094/* Work also in C++ mode. */
22095 #define __STDC_LIMIT_MACROS 1
22096
22097 /* Work if build is not clean. */
22098 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
22099
22100 #include <limits.h>
22101 #if HAVE_STDINT_H
22102 #include <stdint.h>
22103 #endif
22104
22105 #if defined UINT32_MAX && defined UINTMAX_MAX
22106 #define CONDITION (UINT32_MAX < UINTMAX_MAX)
88b48903 22107 #else
5df4cba6 22108 #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
88b48903
WN
22109 #endif
22110 int test[CONDITION ? 1 : -1];
22111int
22112main ()
22113{
22114
22115 ;
22116 return 0;
22117}
22118_ACEOF
22119if ac_fn_c_try_compile "$LINENO"; then :
22120 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
22121else
22122 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
22123fi
22124rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22125fi
22126{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
22127$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
22128 if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
22129 UINT32_MAX_LT_UINTMAX_MAX=1;
22130 else
22131 UINT32_MAX_LT_UINTMAX_MAX=0;
22132 fi
22133
22134
22135 if test $APPLE_UNIVERSAL_BUILD = 0; then
22136
22137 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
22138$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
d0ac1c44 22139if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
88b48903
WN
22140 $as_echo_n "(cached) " >&6
22141else
22142 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22143/* end confdefs.h. */
22144/* Work also in C++ mode. */
22145 #define __STDC_LIMIT_MACROS 1
22146
22147 /* Work if build is not clean. */
22148 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
22149
22150 #include <limits.h>
22151 #if HAVE_STDINT_H
22152 #include <stdint.h>
22153 #endif
22154
22155 #if defined UINT64_MAX
22156 #define CONDITION (UINT64_MAX == ULONG_MAX)
88b48903 22157 #else
5df4cba6 22158 #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
88b48903
WN
22159 #endif
22160 int test[CONDITION ? 1 : -1];
22161int
22162main ()
22163{
22164
22165 ;
22166 return 0;
22167}
22168_ACEOF
22169if ac_fn_c_try_compile "$LINENO"; then :
22170 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
22171else
22172 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
22173fi
22174rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22175fi
22176{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
22177$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
22178 if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
22179 UINT64_MAX_EQ_ULONG_MAX=1;
22180 else
22181 UINT64_MAX_EQ_ULONG_MAX=0;
22182 fi
22183
22184
22185 else
22186 UINT64_MAX_EQ_ULONG_MAX=-1
22187 fi
22188
22189
22190
22191
22192
698be2d8
CB
22193
22194
22195
22196 if test $ac_cv_func_isblank = no; then
22197 HAVE_ISBLANK=0
22198 fi
22199
22200 if test $HAVE_ISBLANK = 0; then
22201
22202
22203
22204
22205
22206
22207
22208
22209 gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext"
22210
22211 fi
22212
22213
22214cat >>confdefs.h <<_ACEOF
22215#define GNULIB_ISBLANK 1
22216_ACEOF
22217
22218
22219
22220
22221
22222
22223
22224 GNULIB_ISBLANK=1
22225
22226
22227
22228
22229
22230
88b48903
WN
22231 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
22232$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
d0ac1c44 22233if ${gl_cv_func_isnand_no_libm+:} false; then :
88b48903
WN
22234 $as_echo_n "(cached) " >&6
22235else
22236
22237 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22238/* end confdefs.h. */
22239#include <math.h>
9c9d63b1 22240 #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903
WN
22241 # undef isnand
22242 # define isnand(x) __builtin_isnan ((double)(x))
22243 #else
22244 # undef isnand
22245 # define isnand(x) isnan ((double)(x))
22246 #endif
22247 double x;
22248int
22249main ()
22250{
22251return isnand (x);
22252 ;
22253 return 0;
22254}
22255_ACEOF
22256if ac_fn_c_try_link "$LINENO"; then :
22257 gl_cv_func_isnand_no_libm=yes
22258else
22259 gl_cv_func_isnand_no_libm=no
22260fi
22261rm -f core conftest.err conftest.$ac_objext \
22262 conftest$ac_exeext conftest.$ac_ext
22263
22264fi
22265{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
22266$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
22267
22268 gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
22269 if test $gl_cv_func_isnand_no_libm = yes; then
22270
22271$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
22272
22273 fi
22274
22275 if test $gl_func_isnand_no_libm != yes; then
22276
22277
22278
22279
22280
22281
22282
22283
22284 gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
22285
22286
22287
22288
22289 fi
22290
22291
22292 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
22293$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
d0ac1c44 22294if ${gl_cv_func_isnanl_no_libm+:} false; then :
88b48903
WN
22295 $as_echo_n "(cached) " >&6
22296else
22297
22298 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22299/* end confdefs.h. */
22300#include <math.h>
9c9d63b1 22301 #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903 22302 # undef isnanl
9c9d63b1 22303 # define isnanl(x) __builtin_isnan ((long double)(x))
88b48903
WN
22304 #elif defined isnan
22305 # undef isnanl
22306 # define isnanl(x) isnan ((long double)(x))
22307 #endif
22308 long double x;
22309int
22310main ()
22311{
22312return isnanl (x);
22313 ;
22314 return 0;
22315}
22316_ACEOF
22317if ac_fn_c_try_link "$LINENO"; then :
22318 gl_cv_func_isnanl_no_libm=yes
22319else
22320 gl_cv_func_isnanl_no_libm=no
22321fi
22322rm -f core conftest.err conftest.$ac_objext \
22323 conftest$ac_exeext conftest.$ac_ext
22324
22325fi
22326{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
22327$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
22328
22329 gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
22330 if test $gl_func_isnanl_no_libm = yes; then
22331
22332
22333
22334
22335 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
22336$as_echo_n "checking whether isnanl works... " >&6; }
d0ac1c44 22337if ${gl_cv_func_isnanl_works+:} false; then :
88b48903
WN
22338 $as_echo_n "(cached) " >&6
22339else
22340
22341 if test "$cross_compiling" = yes; then :
c0c3707f
CB
22342 case "$host_os" in
22343 mingw*) # Guess yes on mingw, no on MSVC.
22344 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22345/* end confdefs.h. */
22346
22347#ifdef __MINGW32__
22348 Known
22349#endif
22350
22351_ACEOF
22352if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22353 $EGREP "Known" >/dev/null 2>&1; then :
4a626d0a 22354 gl_cv_func_isnanl_works="guessing yes"
c0c3707f
CB
22355else
22356 gl_cv_func_isnanl_works="guessing no"
22357fi
22358rm -f conftest*
22359
22360 ;;
22361 *) gl_cv_func_isnanl_works="guessing yes" ;;
22362 esac
22363
88b48903
WN
22364else
22365 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22366/* end confdefs.h. */
22367
22368#include <float.h>
22369#include <limits.h>
22370#include <math.h>
9c9d63b1 22371#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903 22372# undef isnanl
9c9d63b1 22373# define isnanl(x) __builtin_isnan ((long double)(x))
88b48903
WN
22374#elif defined isnan
22375# undef isnanl
22376# define isnanl(x) isnan ((long double)(x))
22377#endif
22378#define NWORDS \
22379 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
22380typedef union { unsigned int word[NWORDS]; long double value; }
22381 memory_long_double;
22382/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
22383 runtime type conversion. */
22384#ifdef __sgi
22385static long double NaNl ()
22386{
22387 double zero = 0.0;
22388 return zero / zero;
22389}
22390#else
22391# define NaNl() (0.0L / 0.0L)
22392#endif
22393int main ()
22394{
22395 int result = 0;
22396
22397 if (!isnanl (NaNl ()))
22398 result |= 1;
22399
22400 {
22401 memory_long_double m;
22402 unsigned int i;
22403
22404 /* The isnanl function should be immune against changes in the sign bit and
22405 in the mantissa bits. The xor operation twiddles a bit that can only be
22406 a sign bit or a mantissa bit (since the exponent never extends to
22407 bit 31). */
22408 m.value = NaNl ();
22409 m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
22410 for (i = 0; i < NWORDS; i++)
22411 m.word[i] |= 1;
22412 if (!isnanl (m.value))
22413 result |= 1;
22414 }
22415
22416#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
22417/* Representation of an 80-bit 'long double' as an initializer for a sequence
22418 of 'unsigned int' words. */
22419# ifdef WORDS_BIGENDIAN
22420# define LDBL80_WORDS(exponent,manthi,mantlo) \
22421 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
4a626d0a 22422 ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
88b48903
WN
22423 (unsigned int) (mantlo) << 16 \
22424 }
22425# else
22426# define LDBL80_WORDS(exponent,manthi,mantlo) \
22427 { mantlo, manthi, exponent }
22428# endif
22429 { /* Quiet NaN. */
22430 static memory_long_double x =
22431 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
22432 if (!isnanl (x.value))
22433 result |= 2;
22434 }
22435 {
22436 /* Signalling NaN. */
22437 static memory_long_double x =
22438 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
22439 if (!isnanl (x.value))
22440 result |= 2;
22441 }
4a626d0a 22442 /* isnanl should return something even for noncanonical values. */
88b48903
WN
22443 { /* Pseudo-NaN. */
22444 static memory_long_double x =
22445 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
4a626d0a 22446 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22447 result |= 4;
22448 }
22449 { /* Pseudo-Infinity. */
22450 static memory_long_double x =
22451 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
4a626d0a 22452 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22453 result |= 8;
22454 }
22455 { /* Pseudo-Zero. */
22456 static memory_long_double x =
22457 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
4a626d0a 22458 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22459 result |= 16;
22460 }
22461 { /* Unnormalized number. */
22462 static memory_long_double x =
22463 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
4a626d0a 22464 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22465 result |= 32;
22466 }
22467 { /* Pseudo-Denormal. */
22468 static memory_long_double x =
22469 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
4a626d0a 22470 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22471 result |= 64;
22472 }
22473#endif
22474
22475 return result;
22476}
22477_ACEOF
22478if ac_fn_c_try_run "$LINENO"; then :
22479 gl_cv_func_isnanl_works=yes
22480else
22481 gl_cv_func_isnanl_works=no
22482fi
22483rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22484 conftest.$ac_objext conftest.beam conftest.$ac_ext
22485fi
22486
22487
22488fi
22489{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
22490$as_echo "$gl_cv_func_isnanl_works" >&6; }
22491
22492 case "$gl_cv_func_isnanl_works" in
22493 *yes) ;;
22494 *) gl_func_isnanl_no_libm=no ;;
22495 esac
22496 fi
22497 if test $gl_func_isnanl_no_libm = yes; then
22498
22499$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
22500
22501 fi
22502
22503 if test $gl_func_isnanl_no_libm != yes; then
22504
22505
22506
22507
22508
22509
22510
22511
22512 gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext"
22513
22514
22515
22516
c0c3707f 22517 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
88b48903 22518$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
d0ac1c44 22519if ${gl_cv_cc_long_double_expbit0+:} false; then :
88b48903
WN
22520 $as_echo_n "(cached) " >&6
22521else
22522
22523 if test "$cross_compiling" = yes; then :
22524
22525 gl_cv_cc_long_double_expbit0="unknown"
c0c3707f
CB
22526 case "$host_os" in
22527 mingw*) # On native Windows (little-endian), we know the result
22528 # in two cases: mingw, MSVC.
22529 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22530/* end confdefs.h. */
22531
22532#ifdef __MINGW32__
22533 Known
22534#endif
22535
22536_ACEOF
22537if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22538 $EGREP "Known" >/dev/null 2>&1; then :
22539 gl_cv_cc_long_double_expbit0="word 2 bit 0"
22540fi
22541rm -f conftest*
22542
22543 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22544/* end confdefs.h. */
22545
22546#ifdef _MSC_VER
22547 Known
22548#endif
22549
22550_ACEOF
22551if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22552 $EGREP "Known" >/dev/null 2>&1; then :
22553 gl_cv_cc_long_double_expbit0="word 1 bit 20"
22554fi
22555rm -f conftest*
22556
22557 ;;
22558 esac
88b48903
WN
22559
22560else
22561 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22562/* end confdefs.h. */
22563
22564#include <float.h>
22565#include <stddef.h>
22566#include <stdio.h>
22567#include <string.h>
22568#define NWORDS \
22569 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
22570typedef union { long double value; unsigned int word[NWORDS]; }
22571 memory_long_double;
22572static unsigned int ored_words[NWORDS];
22573static unsigned int anded_words[NWORDS];
698be2d8 22574static void add_to_ored_words (long double *x)
88b48903
WN
22575{
22576 memory_long_double m;
22577 size_t i;
22578 /* Clear it first, in case
22579 sizeof (long double) < sizeof (memory_long_double). */
22580 memset (&m, 0, sizeof (memory_long_double));
698be2d8 22581 m.value = *x;
88b48903
WN
22582 for (i = 0; i < NWORDS; i++)
22583 {
22584 ored_words[i] |= m.word[i];
22585 anded_words[i] &= m.word[i];
22586 }
22587}
22588int main ()
22589{
698be2d8 22590 static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
88b48903
WN
22591 size_t j;
22592 FILE *fp = fopen ("conftest.out", "w");
22593 if (fp == NULL)
22594 return 1;
22595 for (j = 0; j < NWORDS; j++)
22596 anded_words[j] = ~ (unsigned int) 0;
698be2d8
CB
22597 for (j = 0; j < 5; j++)
22598 add_to_ored_words (&samples[j]);
88b48903
WN
22599 /* Remove bits that are common (e.g. if representation of the first mantissa
22600 bit is explicit). */
22601 for (j = 0; j < NWORDS; j++)
22602 ored_words[j] &= ~anded_words[j];
22603 /* Now find the nonzero word. */
22604 for (j = 0; j < NWORDS; j++)
22605 if (ored_words[j] != 0)
22606 break;
22607 if (j < NWORDS)
22608 {
22609 size_t i;
22610 for (i = j + 1; i < NWORDS; i++)
22611 if (ored_words[i] != 0)
22612 {
22613 fprintf (fp, "unknown");
22614 return (fclose (fp) != 0);
22615 }
22616 for (i = 0; ; i++)
22617 if ((ored_words[j] >> i) & 1)
22618 {
22619 fprintf (fp, "word %d bit %d", (int) j, (int) i);
22620 return (fclose (fp) != 0);
22621 }
22622 }
22623 fprintf (fp, "unknown");
22624 return (fclose (fp) != 0);
22625}
22626
22627_ACEOF
22628if ac_fn_c_try_run "$LINENO"; then :
22629 gl_cv_cc_long_double_expbit0=`cat conftest.out`
22630else
22631 gl_cv_cc_long_double_expbit0="unknown"
22632fi
22633rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22634 conftest.$ac_objext conftest.beam conftest.$ac_ext
22635fi
22636
22637 rm -f conftest.out
22638
22639fi
22640{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
22641$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
22642 case "$gl_cv_cc_long_double_expbit0" in
22643 word*bit*)
22644 word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
22645 bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
22646
22647cat >>confdefs.h <<_ACEOF
22648#define LDBL_EXPBIT0_WORD $word
22649_ACEOF
22650
22651
22652cat >>confdefs.h <<_ACEOF
22653#define LDBL_EXPBIT0_BIT $bit
22654_ACEOF
22655
22656 ;;
22657 esac
22658
22659
22660
22661 fi
22662
22663
5df4cba6
SM
22664 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
22665$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; }
22666if ${gl_cv_c___inline+:} false; then :
22667 $as_echo_n "(cached) " >&6
22668else
22669 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22670/* end confdefs.h. */
22671typedef int foo_t;
22672 static __inline foo_t foo (void) { return 0; }
22673int
22674main ()
22675{
22676return foo ();
22677 ;
22678 return 0;
22679}
22680_ACEOF
22681if ac_fn_c_try_compile "$LINENO"; then :
22682 gl_cv_c___inline=yes
22683else
22684 gl_cv_c___inline=no
22685fi
22686rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22687fi
22688{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
22689$as_echo "$gl_cv_c___inline" >&6; }
22690 if test $gl_cv_c___inline = yes; then
22691
22692$as_echo "#define HAVE___INLINE 1" >>confdefs.h
22693
22694 fi
22695
22696
22697
22698
22699
22700 LOCALCHARSET_TESTS_ENVIRONMENT=
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712 case "$host_os" in
22713 solaris*)
22714
22715$as_echo "#define _LCONV_C99 1" >>confdefs.h
22716
22717 ;;
22718 esac
22719
22720 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
22721$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; }
22722if ${gl_cv_header_locale_h_posix2001+:} false; then :
22723 $as_echo_n "(cached) " >&6
22724else
22725 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22726/* end confdefs.h. */
22727#include <locale.h>
22728 int x = LC_MESSAGES;
22729 int y = sizeof (((struct lconv *) 0)->decimal_point);
22730int
22731main ()
22732{
22733
22734 ;
22735 return 0;
22736}
22737_ACEOF
22738if ac_fn_c_try_compile "$LINENO"; then :
22739 gl_cv_header_locale_h_posix2001=yes
22740else
22741 gl_cv_header_locale_h_posix2001=no
22742fi
22743rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22744fi
22745{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
22746$as_echo "$gl_cv_header_locale_h_posix2001" >&6; }
22747
22748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
22749$as_echo_n "checking whether struct lconv is properly defined... " >&6; }
22750if ${gl_cv_sys_struct_lconv_ok+:} false; then :
c0c3707f
CB
22751 $as_echo_n "(cached) " >&6
22752else
22753 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22754/* end confdefs.h. */
5df4cba6
SM
22755#include <locale.h>
22756 struct lconv l;
22757 int x = sizeof (l.decimal_point);
22758 int y = sizeof (l.int_p_cs_precedes);
c0c3707f
CB
22759int
22760main ()
22761{
5df4cba6 22762
c0c3707f
CB
22763 ;
22764 return 0;
22765}
22766_ACEOF
22767if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 22768 gl_cv_sys_struct_lconv_ok=yes
c0c3707f 22769else
5df4cba6 22770 gl_cv_sys_struct_lconv_ok=no
c0c3707f
CB
22771fi
22772rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 22773
c0c3707f 22774fi
5df4cba6
SM
22775{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
22776$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
22777 if test $gl_cv_sys_struct_lconv_ok = no; then
22778 case "$host_os" in
22779 mingw*)
22780 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22781/* end confdefs.h. */
c0c3707f 22782
5df4cba6
SM
22783#ifdef _MSC_VER
22784 Special
22785#endif
22786
22787_ACEOF
22788if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22789 $EGREP "Special" >/dev/null 2>&1; then :
22790
22791else
22792 REPLACE_STRUCT_LCONV=1
22793fi
22794rm -f conftest*
c0c3707f 22795
5df4cba6
SM
22796 ;;
22797 *) REPLACE_STRUCT_LCONV=1 ;;
22798 esac
c0c3707f 22799 fi
88b48903
WN
22800
22801
88b48903
WN
22802
22803
472fa5ee 22804
5df4cba6
SM
22805
22806
22807
22808
22809 if test $gl_cv_have_include_next = yes; then
22810 gl_cv_next_locale_h='<'locale.h'>'
22811 else
22812 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
22813$as_echo_n "checking absolute name of <locale.h>... " >&6; }
22814if ${gl_cv_next_locale_h+:} false; then :
22815 $as_echo_n "(cached) " >&6
22816else
22817
22818
22819
22820 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22821/* end confdefs.h. */
22822#include <locale.h>
22823_ACEOF
22824 case "$host_os" in
22825 aix*) gl_absname_cpp="$ac_cpp -C" ;;
22826 *) gl_absname_cpp="$ac_cpp" ;;
22827 esac
22828
22829 case "$host_os" in
22830 mingw*)
22831 gl_dirsep_regex='[/\\]'
22832 ;;
22833 *)
22834 gl_dirsep_regex='\/'
22835 ;;
22836 esac
22837 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
22838 gl_header_literal_regex=`echo 'locale.h' \
22839 | sed -e "$gl_make_literal_regex_sed"`
22840 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
22841 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
22842 s|^/[^/]|//&|
22843 p
22844 q
22845 }'
22846
22847 gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
22848 sed -n "$gl_absolute_header_sed"`
22849
22850 gl_header=$gl_cv_absolute_locale_h
22851 gl_cv_next_locale_h='"'$gl_header'"'
22852
22853
22854fi
22855{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
22856$as_echo "$gl_cv_next_locale_h" >&6; }
22857 fi
22858 NEXT_LOCALE_H=$gl_cv_next_locale_h
22859
22860 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
22861 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
22862 gl_next_as_first_directive='<'locale.h'>'
22863 else
22864 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
22865 gl_next_as_first_directive=$gl_cv_next_locale_h
22866 fi
22867 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
22868
22869
22870
22871
22872
22873
22874
22875
472fa5ee
SM
22876
22877
22878
5abebf3c
CB
22879 if test "$gl_threads_api" = posix; then
22880 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
22881 # pthread_rwlock_* functions.
c0c3707f 22882 has_rwlock=false
5abebf3c
CB
22883 ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
22884"
22885if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
c0c3707f 22886 has_rwlock=true
5abebf3c
CB
22887
22888$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
22889
22890fi
22891
c0c3707f
CB
22892 if $has_rwlock; then
22893
22894
22895 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
22896$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
22897if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
22898 $as_echo_n "(cached) " >&6
22899else
22900 save_LIBS="$LIBS"
22901 LIBS="$LIBS $LIBMULTITHREAD"
22902 if test "$cross_compiling" = yes; then :
22903 case "$host_os" in
22904 # Guess no on glibc systems.
22905 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22906 # Guess no on musl systems.
22907 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22908 # Guess no on bionic systems.
22909 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22910 # Guess yes on native Windows with the mingw-w64 winpthreads library.
22911 # Guess no on native Windows with the gnulib windows-rwlock module.
22912 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
22913 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
22914 else
22915 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
22916 fi
22917 ;;
22918 # If we don't know, obey --enable-cross-guesses.
22919 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
22920 esac
22921
22922else
22923 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22924/* end confdefs.h. */
22925
22926#include <errno.h>
22927#include <pthread.h>
22928#include <stdlib.h>
22929#include <unistd.h>
22930
22931#define SUCCEED() exit (0)
22932#define FAILURE() exit (1)
22933#define UNEXPECTED(n) (exit (10 + (n)))
22934
22935/* The main thread creates the waiting writer and the requesting reader threads
22936 in the default way; this guarantees that they have the same priority.
22937 We can reuse the main thread as first reader thread. */
22938
22939static pthread_rwlock_t lock;
22940static pthread_t reader1;
22941static pthread_t writer;
22942static pthread_t reader2;
22943static pthread_t timer;
22944/* Used to pass control from writer to reader2 and from reader2 to timer,
22945 as in a relay race.
22946 Passing control from one running thread to another running thread
22947 is most likely faster than to create the second thread. */
22948static pthread_mutex_t baton;
22949
22950static void *
22951timer_func (void *ignored)
22952{
22953 /* Step 13 (can be before or after step 12):
22954 The timer thread takes the baton, then waits a moment to make sure
22955 it can tell whether the second reader thread is blocked at step 12. */
22956 if (pthread_mutex_lock (&baton))
22957 UNEXPECTED (13);
22958 usleep (100000);
22959 /* By the time we get here, it's clear that the second reader thread is
22960 blocked at step 12. This is the desired behaviour. */
22961 SUCCEED ();
22962}
22963
22964static void *
22965reader2_func (void *ignored)
22966{
22967 int err;
22968
22969 /* Step 8 (can be before or after step 7):
22970 The second reader thread takes the baton, then waits a moment to make sure
22971 the writer thread has reached step 7. */
22972 if (pthread_mutex_lock (&baton))
22973 UNEXPECTED (8);
22974 usleep (100000);
22975 /* Step 9: The second reader thread requests the lock. */
22976 err = pthread_rwlock_tryrdlock (&lock);
22977 if (err == 0)
22978 FAILURE ();
22979 else if (err != EBUSY)
22980 UNEXPECTED (9);
22981 /* Step 10: Launch a timer, to test whether the next call blocks. */
22982 if (pthread_create (&timer, NULL, timer_func, NULL))
22983 UNEXPECTED (10);
22984 /* Step 11: Release the baton. */
22985 if (pthread_mutex_unlock (&baton))
22986 UNEXPECTED (11);
22987 /* Step 12: The second reader thread requests the lock. */
22988 err = pthread_rwlock_rdlock (&lock);
22989 if (err == 0)
22990 FAILURE ();
22991 else
22992 UNEXPECTED (12);
22993}
22994
22995static void *
22996writer_func (void *ignored)
22997{
22998 /* Step 4: Take the baton, so that the second reader thread does not go ahead
22999 too early. */
23000 if (pthread_mutex_lock (&baton))
23001 UNEXPECTED (4);
23002 /* Step 5: Create the second reader thread. */
23003 if (pthread_create (&reader2, NULL, reader2_func, NULL))
23004 UNEXPECTED (5);
23005 /* Step 6: Release the baton. */
23006 if (pthread_mutex_unlock (&baton))
23007 UNEXPECTED (6);
23008 /* Step 7: The writer thread requests the lock. */
23009 if (pthread_rwlock_wrlock (&lock))
23010 UNEXPECTED (7);
23011 return NULL;
23012}
23013
23014int
23015main ()
23016{
23017 reader1 = pthread_self ();
23018
23019 /* Step 1: The main thread initializes the lock and the baton. */
23020 if (pthread_rwlock_init (&lock, NULL))
23021 UNEXPECTED (1);
23022 if (pthread_mutex_init (&baton, NULL))
23023 UNEXPECTED (1);
23024 /* Step 2: The main thread acquires the lock as a reader. */
23025 if (pthread_rwlock_rdlock (&lock))
23026 UNEXPECTED (2);
23027 /* Step 3: Create the writer thread. */
23028 if (pthread_create (&writer, NULL, writer_func, NULL))
23029 UNEXPECTED (3);
23030 /* Job done. Go to sleep. */
23031 for (;;)
23032 {
23033 sleep (1);
23034 }
23035}
23036
23037_ACEOF
23038if ac_fn_c_try_run "$LINENO"; then :
23039 gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
23040else
23041 gl_cv_pthread_rwlock_rdlock_prefer_writer=no
23042fi
23043rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23044 conftest.$ac_objext conftest.beam conftest.$ac_ext
23045fi
23046
23047 LIBS="$save_LIBS"
23048
23049fi
23050{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
23051$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
23052 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
23053 *yes)
23054
23055$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
23056
23057 ;;
23058 esac
23059
23060 fi
5abebf3c
CB
23061 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
23062 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23063/* end confdefs.h. */
23064
23065 #include <pthread.h>
23066int
23067main ()
23068{
23069
23070#if __FreeBSD__ == 4
23071error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
23072#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
23073 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
23074error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
23075#else
23076int x = (int)PTHREAD_MUTEX_RECURSIVE;
23077return !x;
23078#endif
23079
23080 ;
23081 return 0;
23082}
23083_ACEOF
23084if ac_fn_c_try_compile "$LINENO"; then :
23085
23086$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
23087
23088fi
23089rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23090 fi
23091 :
23092
23093
23094
23095cat >>confdefs.h <<_ACEOF
23096#define GNULIB_LOCK 1
23097_ACEOF
23098
23099
23100
23101
88b48903 23102
472fa5ee 23103
f45c62c4
YQ
23104 if test $ac_cv_func_lstat = yes; then
23105
c0c3707f
CB
23106 case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
23107 solaris* | *no)
f45c62c4
YQ
23108 REPLACE_LSTAT=1
23109 ;;
23110 esac
23111 else
23112 HAVE_LSTAT=0
23113 fi
23114
23115 if test $REPLACE_LSTAT = 1; then
23116
23117
23118
23119
23120
23121
23122
23123
23124 gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
23125
23126 :
23127 fi
23128
23129
23130
23131
23132
23133 GNULIB_LSTAT=1
23134
23135
23136
23137
23138
23139$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
23140
23141
23142
23143
23144
23145
6a29c58e
YQ
23146 if test $gl_cv_func_malloc_posix = yes; then
23147
23148$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
23149
23150 else
23151 REPLACE_MALLOC=1
23152 fi
23153
23154 if test $REPLACE_MALLOC = 1; then
23155
23156
23157
23158
23159
23160
23161
23162
23163 gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
23164
23165 fi
23166
23167
23168
23169
23170
23171 GNULIB_MALLOC_POSIX=1
23172
23173
23174
23175
23176
23177$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
23178
23179
23180
23181
23182
23183
88b48903
WN
23184
23185
23186
23187
23188
88b48903 23189
c971b7fa 23190
c971b7fa 23191
98399780
YQ
23192
23193
23194
88b48903
WN
23195 if test $gl_cv_have_include_next = yes; then
23196 gl_cv_next_math_h='<'math.h'>'
23197 else
23198 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
23199$as_echo_n "checking absolute name of <math.h>... " >&6; }
d0ac1c44 23200if ${gl_cv_next_math_h+:} false; then :
88b48903
WN
23201 $as_echo_n "(cached) " >&6
23202else
c971b7fa 23203
88b48903 23204 if test $ac_cv_header_math_h = yes; then
c971b7fa
PA
23205
23206
4a626d0a
PA
23207
23208
23209 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 23210/* end confdefs.h. */
88b48903 23211#include <math.h>
8690e634 23212_ACEOF
4a626d0a
PA
23213 case "$host_os" in
23214 aix*) gl_absname_cpp="$ac_cpp -C" ;;
23215 *) gl_absname_cpp="$ac_cpp" ;;
23216 esac
23217
23218 case "$host_os" in
23219 mingw*)
23220 gl_dirsep_regex='[/\\]'
23221 ;;
23222 *)
23223 gl_dirsep_regex='\/'
23224 ;;
23225 esac
23226 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
23227 gl_header_literal_regex=`echo 'math.h' \
23228 | sed -e "$gl_make_literal_regex_sed"`
23229 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
23230 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
23231 s|^/[^/]|//&|
23232 p
23233 q
23234 }'
23235
23236 gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
23237 sed -n "$gl_absolute_header_sed"`
23238
23239 gl_header=$gl_cv_absolute_math_h
23240 gl_cv_next_math_h='"'$gl_header'"'
88b48903
WN
23241 else
23242 gl_cv_next_math_h='<'math.h'>'
23243 fi
8690e634 23244
c971b7fa 23245
88b48903
WN
23246fi
23247{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
23248$as_echo "$gl_cv_next_math_h" >&6; }
23249 fi
23250 NEXT_MATH_H=$gl_cv_next_math_h
c971b7fa 23251
88b48903
WN
23252 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
23253 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
23254 gl_next_as_first_directive='<'math.h'>'
23255 else
23256 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
23257 gl_next_as_first_directive=$gl_cv_next_math_h
23258 fi
23259 NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
8690e634 23260
c971b7fa 23261
c971b7fa
PA
23262
23263
c971b7fa 23264
88b48903
WN
23265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
23266$as_echo_n "checking whether NAN macro works... " >&6; }
d0ac1c44 23267if ${gl_cv_header_math_nan_works+:} false; then :
c971b7fa
PA
23268 $as_echo_n "(cached) " >&6
23269else
8690e634
JK
23270 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23271/* end confdefs.h. */
88b48903 23272#include <math.h>
c971b7fa
PA
23273int
23274main ()
23275{
88b48903
WN
23276/* Solaris 10 has a broken definition of NAN. Other platforms
23277 fail to provide NAN, or provide it only in C99 mode; this
23278 test only needs to fail when NAN is provided but wrong. */
23279 float f = 1.0f;
23280#ifdef NAN
23281 f = NAN;
23282#endif
23283 return f == 0;
c971b7fa
PA
23284 ;
23285 return 0;
23286}
23287_ACEOF
23288if ac_fn_c_try_compile "$LINENO"; then :
88b48903 23289 gl_cv_header_math_nan_works=yes
8690e634 23290else
88b48903 23291 gl_cv_header_math_nan_works=no
c971b7fa
PA
23292fi
23293rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 23294fi
88b48903
WN
23295{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
23296$as_echo "$gl_cv_header_math_nan_works" >&6; }
23297 if test $gl_cv_header_math_nan_works = no; then
23298 REPLACE_NAN=1
c971b7fa 23299 fi
88b48903
WN
23300 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
23301$as_echo_n "checking whether HUGE_VAL works... " >&6; }
d0ac1c44 23302if ${gl_cv_header_math_huge_val_works+:} false; then :
c971b7fa
PA
23303 $as_echo_n "(cached) " >&6
23304else
8690e634 23305 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 23306/* end confdefs.h. */
88b48903 23307#include <math.h>
c971b7fa
PA
23308int
23309main ()
23310{
88b48903
WN
23311/* Solaris 10 has a broken definition of HUGE_VAL. */
23312 double d = HUGE_VAL;
23313 return d == 0;
c971b7fa
PA
23314 ;
23315 return 0;
23316}
23317_ACEOF
23318if ac_fn_c_try_compile "$LINENO"; then :
88b48903 23319 gl_cv_header_math_huge_val_works=yes
8690e634 23320else
88b48903 23321 gl_cv_header_math_huge_val_works=no
c971b7fa
PA
23322fi
23323rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 23324fi
88b48903
WN
23325{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
23326$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
23327 if test $gl_cv_header_math_huge_val_works = no; then
23328 REPLACE_HUGE_VAL=1
8690e634 23329 fi
c971b7fa 23330
c971b7fa 23331
c971b7fa
PA
23332
23333
23334
23335
23336
23337
c971b7fa 23338
c971b7fa 23339
c971b7fa 23340
c971b7fa
PA
23341
23342
c971b7fa 23343
472fa5ee 23344
5df4cba6
SM
23345
23346
23347
23348 if case "$host_os" in
23349 mingw*) true ;;
23350 *) test $ac_cv_func_mbsinit = yes ;;
23351 esac \
23352 && test $ac_cv_func_mbrtowc = yes; then
472fa5ee
SM
23353
23354
23355
23356
c0c3707f
CB
23357 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
23358$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
23359if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
23360 $as_echo_n "(cached) " >&6
23361else
472fa5ee 23362
c0c3707f
CB
23363 case "$host_os" in
23364 # Guess no on AIX and OSF/1.
23365 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
23366 # Guess yes otherwise.
23367 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
23368 esac
23369 if test $LOCALE_JA != none; then
23370 if test "$cross_compiling" = yes; then :
472fa5ee 23371 :
c0c3707f
CB
23372else
23373 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23374/* end confdefs.h. */
472fa5ee 23375
c0c3707f
CB
23376#include <locale.h>
23377#include <string.h>
c0c3707f
CB
23378#include <wchar.h>
23379int main ()
23380{
23381 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23382 {
23383 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23384 mbstate_t state;
23385 wchar_t wc;
472fa5ee 23386
c0c3707f
CB
23387 memset (&state, '\0', sizeof (mbstate_t));
23388 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23389 if (mbsinit (&state))
23390 return 2;
23391 }
23392 return 0;
23393}
23394_ACEOF
23395if ac_fn_c_try_run "$LINENO"; then :
23396 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 23397else
c0c3707f
CB
23398 gl_cv_func_mbrtowc_incomplete_state=no
23399fi
23400rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23401 conftest.$ac_objext conftest.beam conftest.$ac_ext
23402fi
8690e634 23403
c0c3707f
CB
23404 else
23405 if test $LOCALE_FR_UTF8 != none; then
23406 if test "$cross_compiling" = yes; then :
8690e634
JK
23407 :
23408else
c971b7fa
PA
23409 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23410/* end confdefs.h. */
c971b7fa 23411
8690e634
JK
23412#include <locale.h>
23413#include <string.h>
8690e634
JK
23414#include <wchar.h>
23415int main ()
c971b7fa 23416{
c0c3707f 23417 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
8690e634 23418 {
c0c3707f 23419 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
8690e634
JK
23420 mbstate_t state;
23421 wchar_t wc;
23422
23423 memset (&state, '\0', sizeof (mbstate_t));
23424 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23425 if (mbsinit (&state))
c0c3707f 23426 return 2;
8690e634 23427 }
c971b7fa
PA
23428 return 0;
23429}
23430_ACEOF
8690e634
JK
23431if ac_fn_c_try_run "$LINENO"; then :
23432 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 23433else
8690e634 23434 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa 23435fi
8690e634
JK
23436rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23437 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 23438fi
c971b7fa 23439
c0c3707f 23440 fi
8690e634 23441 fi
c971b7fa 23442
8690e634
JK
23443fi
23444{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
23445$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa 23446
c971b7fa 23447
c971b7fa 23448
c971b7fa 23449
8690e634
JK
23450 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
23451$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 23452if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
23453 $as_echo_n "(cached) " >&6
23454else
23455
8690e634
JK
23456 case "$host_os" in
23457 # Guess no on Solaris 8.
23458 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
23459 # Guess yes otherwise.
23460 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
23461 esac
23462 if test $LOCALE_ZH_CN != none; then
23463 if test "$cross_compiling" = yes; then :
23464 :
23465else
23466 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
23467/* end confdefs.h. */
23468
8690e634
JK
23469#include <locale.h>
23470#include <stdlib.h>
23471#include <string.h>
8690e634
JK
23472#include <wchar.h>
23473int main ()
c971b7fa 23474{
8690e634
JK
23475 /* This fails on Solaris 8:
23476 mbrtowc returns 2, and sets wc to 0x00F0.
23477 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
23478 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23479 {
23480 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
23481 mbstate_t state;
23482 wchar_t wc;
23483
23484 memset (&state, '\0', sizeof (mbstate_t));
23485 if (mbrtowc (&wc, input + 3, 6, &state) != 4
23486 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 23487 return 2;
8690e634 23488 }
c971b7fa
PA
23489 return 0;
23490}
23491_ACEOF
8690e634
JK
23492if ac_fn_c_try_run "$LINENO"; then :
23493 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 23494else
8690e634 23495 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 23496fi
8690e634
JK
23497rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23498 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 23499fi
c971b7fa 23500
8690e634 23501 fi
c971b7fa 23502
8690e634
JK
23503fi
23504{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
23505$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
23506
23507 REPLACE_MBSTATE_T=0
23508 case "$gl_cv_func_mbrtowc_incomplete_state" in
23509 *yes) ;;
23510 *) REPLACE_MBSTATE_T=1 ;;
23511 esac
23512 case "$gl_cv_func_mbrtowc_sanitycheck" in
23513 *yes) ;;
23514 *) REPLACE_MBSTATE_T=1 ;;
23515 esac
c971b7fa 23516 else
8690e634 23517 REPLACE_MBSTATE_T=1
c971b7fa
PA
23518 fi
23519
23520
23521
8690e634
JK
23522 if test $ac_cv_func_mbrtowc = no; then
23523 HAVE_MBRTOWC=0
23524 ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
9c9d63b1 23525 #include <wchar.h>
c971b7fa 23526
8690e634 23527"
d0ac1c44 23528if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
8690e634
JK
23529 ac_have_decl=1
23530else
23531 ac_have_decl=0
c971b7fa 23532fi
c971b7fa 23533
8690e634
JK
23534cat >>confdefs.h <<_ACEOF
23535#define HAVE_DECL_MBRTOWC $ac_have_decl
23536_ACEOF
c971b7fa 23537
8690e634
JK
23538 if test $ac_cv_have_decl_mbrtowc = yes; then
23539 REPLACE_MBRTOWC=1
23540 fi
23541 else
23542 if test $REPLACE_MBSTATE_T = 1; then
23543 REPLACE_MBRTOWC=1
23544 else
c971b7fa
PA
23545
23546
23547
8690e634
JK
23548 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
23549$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
d0ac1c44 23550if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
8690e634 23551 $as_echo_n "(cached) " >&6
c971b7fa 23552else
c971b7fa 23553
8690e634
JK
23554 case "$host_os" in
23555 # Guess no on Solaris.
23556 solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
23557 # Guess yes otherwise.
23558 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
23559 esac
23560 if test $LOCALE_FR_UTF8 != none; then
23561 if test "$cross_compiling" = yes; then :
23562 :
23563else
23564 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
23565/* end confdefs.h. */
23566
8690e634
JK
23567#include <locale.h>
23568#include <stdlib.h>
23569#include <string.h>
8690e634
JK
23570#include <wchar.h>
23571int main ()
23572{
23573 int result = 0;
23574
23575 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23576 {
23577 char input[] = "\303\237er";
23578 mbstate_t state;
23579 wchar_t wc;
23580 size_t ret;
23581
23582 memset (&state, '\0', sizeof (mbstate_t));
23583 wc = (wchar_t) 0xBADFACE;
23584 ret = mbrtowc (&wc, input, 5, &state);
23585 if (ret != 2)
23586 result |= 1;
23587 if (!mbsinit (&state))
23588 result |= 2;
c971b7fa 23589
8690e634
JK
23590 memset (&state, '\0', sizeof (mbstate_t));
23591 ret = mbrtowc (NULL, input, 5, &state);
23592 if (ret != 2) /* Solaris 7 fails here: ret is -1. */
23593 result |= 4;
23594 if (!mbsinit (&state))
23595 result |= 8;
23596 }
23597 return result;
23598}
c971b7fa 23599_ACEOF
8690e634
JK
23600if ac_fn_c_try_run "$LINENO"; then :
23601 gl_cv_func_mbrtowc_null_arg1=yes
23602else
23603 gl_cv_func_mbrtowc_null_arg1=no
23604fi
23605rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23606 conftest.$ac_objext conftest.beam conftest.$ac_ext
23607fi
c971b7fa 23608
8690e634 23609 fi
c971b7fa 23610
c971b7fa 23611fi
8690e634
JK
23612{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
23613$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
c971b7fa 23614
c971b7fa 23615
c971b7fa 23616
c971b7fa 23617
8690e634
JK
23618 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
23619$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
d0ac1c44 23620if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
8690e634
JK
23621 $as_echo_n "(cached) " >&6
23622else
c971b7fa 23623
8690e634
JK
23624 case "$host_os" in
23625 # Guess no on OSF/1.
23626 osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
23627 # Guess yes otherwise.
23628 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
23629 esac
23630 if test $LOCALE_FR_UTF8 != none; then
23631 if test "$cross_compiling" = yes; then :
c971b7fa 23632 :
8690e634
JK
23633else
23634 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23635/* end confdefs.h. */
23636
23637#include <locale.h>
23638#include <string.h>
8690e634
JK
23639#include <wchar.h>
23640int main ()
23641{
23642 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23643 {
23644 mbstate_t state;
23645 wchar_t wc;
23646 int ret;
23647
23648 memset (&state, '\0', sizeof (mbstate_t));
23649 wc = (wchar_t) 0xBADFACE;
23650 mbrtowc (&wc, NULL, 5, &state);
23651 /* Check that wc was not modified. */
23652 if (wc != (wchar_t) 0xBADFACE)
c0c3707f 23653 return 2;
8690e634
JK
23654 }
23655 return 0;
23656}
23657_ACEOF
23658if ac_fn_c_try_run "$LINENO"; then :
23659 gl_cv_func_mbrtowc_null_arg2=yes
23660else
23661 gl_cv_func_mbrtowc_null_arg2=no
23662fi
23663rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23664 conftest.$ac_objext conftest.beam conftest.$ac_ext
23665fi
23666
23667 fi
23668
23669fi
23670{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
23671$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
c971b7fa
PA
23672
23673
23674
23675
23676
23677
8690e634
JK
23678 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
23679$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
d0ac1c44 23680if ${gl_cv_func_mbrtowc_retval+:} false; then :
8690e634
JK
23681 $as_echo_n "(cached) " >&6
23682else
23683
23684 case "$host_os" in
23685 # Guess no on HP-UX, Solaris, native Windows.
23686 hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
23687 # Guess yes otherwise.
23688 *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
23689 esac
23690 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
23691 || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
23692 if test "$cross_compiling" = yes; then :
c971b7fa 23693 :
8690e634
JK
23694else
23695 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23696/* end confdefs.h. */
c971b7fa 23697
8690e634
JK
23698#include <locale.h>
23699#include <string.h>
8690e634
JK
23700#include <wchar.h>
23701int main ()
23702{
23703 int result = 0;
23704 int found_some_locale = 0;
23705 /* This fails on Solaris. */
23706 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23707 {
23708 char input[] = "B\303\274\303\237er"; /* "Büßer" */
23709 mbstate_t state;
23710 wchar_t wc;
23711
23712 memset (&state, '\0', sizeof (mbstate_t));
23713 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23714 {
23715 input[1] = '\0';
23716 if (mbrtowc (&wc, input + 2, 5, &state) != 1)
23717 result |= 1;
23718 }
23719 found_some_locale = 1;
23720 }
23721 /* This fails on HP-UX 11.11. */
23722 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23723 {
23724 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23725 mbstate_t state;
23726 wchar_t wc;
23727
23728 memset (&state, '\0', sizeof (mbstate_t));
23729 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23730 {
23731 input[1] = '\0';
23732 if (mbrtowc (&wc, input + 2, 5, &state) != 2)
23733 result |= 2;
23734 }
23735 found_some_locale = 1;
23736 }
5df4cba6
SM
23737 /* This fails on native Windows. */
23738 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
23739 {
23740 char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
23741 mbstate_t state;
23742 wchar_t wc;
23743
23744 memset (&state, '\0', sizeof (mbstate_t));
23745 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23746 {
23747 input[3] = '\0';
23748 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23749 result |= 4;
23750 }
23751 found_some_locale = 1;
23752 }
23753 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
23754 {
23755 char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
23756 mbstate_t state;
23757 wchar_t wc;
23758
23759 memset (&state, '\0', sizeof (mbstate_t));
23760 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23761 {
23762 input[3] = '\0';
23763 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23764 result |= 8;
23765 }
23766 found_some_locale = 1;
23767 }
23768 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
23769 {
23770 char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
23771 mbstate_t state;
23772 wchar_t wc;
23773
23774 memset (&state, '\0', sizeof (mbstate_t));
23775 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23776 {
23777 input[3] = '\0';
23778 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23779 result |= 16;
23780 }
23781 found_some_locale = 1;
23782 }
23783 return (found_some_locale ? result : 77);
23784}
23785_ACEOF
23786if ac_fn_c_try_run "$LINENO"; then :
23787 gl_cv_func_mbrtowc_retval=yes
23788else
23789 if test $? != 77; then
23790 gl_cv_func_mbrtowc_retval=no
23791 fi
23792
23793fi
23794rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23795 conftest.$ac_objext conftest.beam conftest.$ac_ext
23796fi
23797
23798 fi
23799
23800fi
23801{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
23802$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
23803
23804
23805
23806
23807 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
23808$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
23809if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
23810 $as_echo_n "(cached) " >&6
23811else
23812
23813 case "$host_os" in
23814 # Guess no on Solaris 8 and 9.
23815 solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
23816 # Guess yes otherwise.
23817 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
23818 esac
23819 if test $LOCALE_ZH_CN != none; then
23820 if test "$cross_compiling" = yes; then :
23821 :
23822else
23823 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23824/* end confdefs.h. */
23825
23826#include <locale.h>
23827#include <string.h>
5df4cba6
SM
23828#include <wchar.h>
23829int main ()
23830{
23831 /* This fails on Solaris 8 and 9. */
23832 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23833 {
23834 mbstate_t state;
23835 wchar_t wc;
23836
23837 memset (&state, '\0', sizeof (mbstate_t));
23838 if (mbrtowc (&wc, "", 1, &state) != 0)
23839 return 2;
23840 }
23841 return 0;
23842}
23843_ACEOF
23844if ac_fn_c_try_run "$LINENO"; then :
23845 gl_cv_func_mbrtowc_nul_retval=yes
23846else
23847 gl_cv_func_mbrtowc_nul_retval=no
23848fi
23849rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23850 conftest.$ac_objext conftest.beam conftest.$ac_ext
23851fi
23852
23853 fi
23854
23855fi
23856{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
23857$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
23858
23859
23860
23861 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5
23862$as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; }
23863if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then :
23864 $as_echo_n "(cached) " >&6
23865else
23866
23867 case "$host_os" in
23868 # Guess yes on native Windows.
23869 mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
23870 *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
23871 esac
23872 case "$host_os" in
23873 mingw*)
23874 if test "$cross_compiling" = yes; then :
23875 :
23876else
23877 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23878/* end confdefs.h. */
23879
23880#include <locale.h>
23881#include <string.h>
5df4cba6
SM
23882#include <wchar.h>
23883int main ()
23884{
23885 int result = 0;
23886 if (setlocale (LC_ALL, "French_France.65001") != NULL)
23887 {
23888 wchar_t wc = (wchar_t) 0xBADFACE;
23889 mbstate_t state;
23890
23891 memset (&state, '\0', sizeof (mbstate_t));
23892 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
23893 && wc != (wchar_t) 0xBADFACE)
23894 result |= 1;
23895 }
8690e634
JK
23896 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
23897 {
5df4cba6 23898 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23899 mbstate_t state;
8690e634
JK
23900
23901 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23902 if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
23903 && wc != (wchar_t) 0xBADFACE)
23904 result |= 2;
8690e634
JK
23905 }
23906 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
23907 {
5df4cba6 23908 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23909 mbstate_t state;
8690e634
JK
23910
23911 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23912 if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
23913 && wc != (wchar_t) 0xBADFACE)
23914 result |= 4;
8690e634
JK
23915 }
23916 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
23917 {
5df4cba6 23918 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23919 mbstate_t state;
8690e634
JK
23920
23921 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23922 if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
23923 && wc != (wchar_t) 0xBADFACE)
23924 result |= 8;
8690e634 23925 }
5df4cba6 23926 return result;
8690e634
JK
23927}
23928_ACEOF
23929if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23930 gl_cv_func_mbrtowc_stores_incomplete=no
8690e634 23931else
5df4cba6 23932 gl_cv_func_mbrtowc_stores_incomplete=yes
8690e634
JK
23933fi
23934rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23935 conftest.$ac_objext conftest.beam conftest.$ac_ext
23936fi
c971b7fa 23937
5df4cba6
SM
23938 ;;
23939 *)
8690e634 23940
5df4cba6
SM
23941 if test $LOCALE_FR_UTF8 != none; then
23942 if test "$cross_compiling" = yes; then :
8690e634 23943 :
c971b7fa
PA
23944else
23945 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23946/* end confdefs.h. */
23947
8690e634 23948#include <locale.h>
c971b7fa 23949#include <string.h>
8690e634
JK
23950#include <wchar.h>
23951int main ()
c971b7fa 23952{
5df4cba6 23953 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
c971b7fa 23954 {
5df4cba6 23955 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23956 mbstate_t state;
c971b7fa 23957
8690e634 23958 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23959 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
23960 && wc != (wchar_t) 0xBADFACE)
23961 return 1;
8690e634 23962 }
c971b7fa
PA
23963 return 0;
23964}
23965_ACEOF
23966if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23967 gl_cv_func_mbrtowc_stores_incomplete=no
c971b7fa 23968else
5df4cba6 23969 gl_cv_func_mbrtowc_stores_incomplete=yes
c971b7fa
PA
23970fi
23971rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23972 conftest.$ac_objext conftest.beam conftest.$ac_ext
23973fi
23974
5df4cba6
SM
23975 fi
23976 ;;
23977 esac
8690e634 23978
c971b7fa 23979fi
5df4cba6
SM
23980{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5
23981$as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; }
8690e634 23982
4a626d0a
PA
23983
23984
23985 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
23986$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
d0ac1c44 23987if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
4a626d0a
PA
23988 $as_echo_n "(cached) " >&6
23989else
23990
23991 case "$host_os" in
c0c3707f
CB
23992 # Guess no on AIX and glibc systems.
23993 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
23994 # Guess yes on native Windows.
23995 mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
23996 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
4a626d0a
PA
23997 esac
23998 if test "$cross_compiling" = yes; then :
23999 :
24000else
24001 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24002/* end confdefs.h. */
24003
24004 #include <wchar.h>
24005 static wchar_t wc;
24006 static mbstate_t mbs;
24007 int
24008 main (void)
24009 {
49e4877c 24010 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
4a626d0a
PA
24011 }
24012_ACEOF
24013if ac_fn_c_try_run "$LINENO"; then :
4a626d0a 24014 gl_cv_func_mbrtowc_empty_input=yes
49e4877c
PA
24015else
24016 gl_cv_func_mbrtowc_empty_input=no
4a626d0a
PA
24017fi
24018rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24019 conftest.$ac_objext conftest.beam conftest.$ac_ext
24020fi
24021
24022
24023fi
24024{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
24025$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
24026
49e4877c 24027
c0c3707f 24028 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
49e4877c 24029$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
5df4cba6 24030if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then :
49e4877c
PA
24031 $as_echo_n "(cached) " >&6
24032else
24033
5df4cba6 24034 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
49e4877c
PA
24035
24036 if test "$cross_compiling" = yes; then :
c0c3707f
CB
24037 case "$host_os" in
24038 # Guess yes on native Windows.
5df4cba6 24039 mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
c0c3707f
CB
24040 esac
24041
49e4877c
PA
24042else
24043 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24044/* end confdefs.h. */
24045#include <limits.h>
24046 #include <locale.h>
24047 #include <wchar.h>
24048
24049int
24050main ()
24051{
24052
24053 int i;
24054 char *locale = setlocale (LC_ALL, "C");
24055 if (! locale)
c0c3707f 24056 return 2;
49e4877c
PA
24057 for (i = CHAR_MIN; i <= CHAR_MAX; i++)
24058 {
24059 char c = i;
24060 wchar_t wc;
24061 mbstate_t mbs = { 0, };
24062 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
24063 if (1 < ss)
c0c3707f 24064 return 3;
49e4877c
PA
24065 }
24066 return 0;
24067
6ec2e0f5
SDJ
24068 ;
24069 return 0;
24070}
24071_ACEOF
24072if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 24073 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes
6ec2e0f5 24074else
5df4cba6 24075 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no
6ec2e0f5
SDJ
24076fi
24077rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24078 conftest.$ac_objext conftest.beam conftest.$ac_ext
24079fi
24080
c0c3707f 24081
6ec2e0f5 24082fi
5df4cba6
SM
24083{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5
24084$as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; }
6ec2e0f5
SDJ
24085
24086 case "$gl_cv_func_mbrtowc_null_arg1" in
24087 *yes) ;;
24088 *)
24089$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
24090
24091 REPLACE_MBRTOWC=1
24092 ;;
24093 esac
24094 case "$gl_cv_func_mbrtowc_null_arg2" in
24095 *yes) ;;
24096 *)
24097$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
24098
24099 REPLACE_MBRTOWC=1
24100 ;;
24101 esac
24102 case "$gl_cv_func_mbrtowc_retval" in
24103 *yes) ;;
24104 *)
24105$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
24106
24107 REPLACE_MBRTOWC=1
24108 ;;
24109 esac
24110 case "$gl_cv_func_mbrtowc_nul_retval" in
24111 *yes) ;;
24112 *)
24113$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
24114
5df4cba6
SM
24115 REPLACE_MBRTOWC=1
24116 ;;
24117 esac
24118 case "$gl_cv_func_mbrtowc_stores_incomplete" in
24119 *no) ;;
24120 *)
24121$as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h
24122
24123 REPLACE_MBRTOWC=1
24124 ;;
24125 esac
24126 case "$gl_cv_func_mbrtowc_empty_input" in
24127 *yes) ;;
24128 *)
24129$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
24130
24131 REPLACE_MBRTOWC=1
24132 ;;
24133 esac
24134 case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
24135 *yes) ;;
24136 *)
24137$as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
24138
24139 REPLACE_MBRTOWC=1
24140 ;;
24141 esac
24142 fi
24143 fi
24144 if test $REPLACE_MBSTATE_T = 1; then
24145 case "$host_os" in
24146 mingw*) LIB_MBRTOWC= ;;
24147 *)
24148
24149
24150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
24151$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
24152if ${gl_cv_have_weak+:} false; then :
24153 $as_echo_n "(cached) " >&6
24154else
24155 gl_cv_have_weak=no
24156 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24157/* end confdefs.h. */
24158extern void xyzzy ();
24159#pragma weak xyzzy
24160int
24161main ()
24162{
24163xyzzy();
24164 ;
24165 return 0;
24166}
24167_ACEOF
24168if ac_fn_c_try_link "$LINENO"; then :
24169 gl_cv_have_weak=maybe
24170fi
24171rm -f core conftest.err conftest.$ac_objext \
24172 conftest$ac_exeext conftest.$ac_ext
24173 if test $gl_cv_have_weak = maybe; then
24174 if test "$cross_compiling" = yes; then :
24175 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24176/* end confdefs.h. */
24177#ifdef __ELF__
24178 Extensible Linking Format
24179 #endif
24180
24181_ACEOF
24182if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24183 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
24184 gl_cv_have_weak="guessing yes"
24185else
24186 gl_cv_have_weak="guessing no"
24187fi
24188rm -f conftest*
24189
24190
24191else
24192 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24193/* end confdefs.h. */
24194
24195#include <stdio.h>
24196#pragma weak fputs
24197int main ()
24198{
24199 return (fputs == NULL);
24200}
24201_ACEOF
24202if ac_fn_c_try_run "$LINENO"; then :
24203 gl_cv_have_weak=yes
24204else
24205 gl_cv_have_weak=no
24206fi
24207rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24208 conftest.$ac_objext conftest.beam conftest.$ac_ext
24209fi
24210
24211 fi
24212 case " $LDFLAGS " in
24213 *" -static "*) gl_cv_have_weak=no ;;
24214 esac
24215 case "$gl_cv_have_weak" in
24216 *yes)
24217 case "$host_os" in
24218 freebsd* | dragonfly*)
24219 : > conftest1.c
24220 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
24221 cat <<EOF > conftest2.c
24222#include <pthread.h>
24223#pragma weak pthread_mutexattr_gettype
24224int main ()
24225{
24226 return (pthread_mutexattr_gettype != NULL);
24227}
24228EOF
24229 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
24230 || gl_cv_have_weak=no
24231 rm -f conftest1.c libempty.so conftest2.c conftest
24232 ;;
24233 esac
24234 ;;
24235 esac
24236
24237fi
24238{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
24239$as_echo "$gl_cv_have_weak" >&6; }
24240 case "$gl_cv_have_weak" in
24241 *yes)
24242
24243$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
24244
24245 ;;
24246 esac
24247
24248 case "$gl_cv_have_weak" in
24249 *yes) LIB_MBRTOWC= ;;
24250 *) LIB_MBRTOWC="$LIBPTHREAD" ;;
24251 esac
24252 ;;
24253 esac
24254 else
24255 LIB_MBRTOWC=
24256 fi
24257
24258
24259 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
24260
24261
24262
24263
24264
24265
24266
24267
24268 gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
24269
24270 if test $REPLACE_MBSTATE_T = 1; then
24271
24272
24273
24274
24275
24276
24277
24278
24279 gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext"
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289 gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext"
24290
24291
24292
24293
24294 CFLAG_VISIBILITY=
24295 HAVE_VISIBILITY=0
24296 if test -n "$GCC"; then
24297 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
24298$as_echo_n "checking whether the -Werror option is usable... " >&6; }
24299if ${gl_cv_cc_vis_werror+:} false; then :
24300 $as_echo_n "(cached) " >&6
24301else
24302 gl_save_CFLAGS="$CFLAGS"
24303 CFLAGS="$CFLAGS -Werror"
24304 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24305/* end confdefs.h. */
24306
24307int
24308main ()
24309{
24310
24311 ;
24312 return 0;
24313}
24314_ACEOF
24315if ac_fn_c_try_compile "$LINENO"; then :
24316 gl_cv_cc_vis_werror=yes
24317else
24318 gl_cv_cc_vis_werror=no
24319fi
24320rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24321 CFLAGS="$gl_save_CFLAGS"
24322
24323fi
24324{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
24325$as_echo "$gl_cv_cc_vis_werror" >&6; }
24326 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
24327$as_echo_n "checking for simple visibility declarations... " >&6; }
24328if ${gl_cv_cc_visibility+:} false; then :
24329 $as_echo_n "(cached) " >&6
24330else
24331 gl_save_CFLAGS="$CFLAGS"
24332 CFLAGS="$CFLAGS -fvisibility=hidden"
24333 if test $gl_cv_cc_vis_werror = yes; then
24334 CFLAGS="$CFLAGS -Werror"
24335 fi
24336 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24337/* end confdefs.h. */
24338extern __attribute__((__visibility__("hidden"))) int hiddenvar;
24339 extern __attribute__((__visibility__("default"))) int exportedvar;
24340 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
24341 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
24342 void dummyfunc (void) {}
24343
24344int
24345main ()
24346{
6ec2e0f5 24347
5df4cba6
SM
24348 ;
24349 return 0;
24350}
24351_ACEOF
24352if ac_fn_c_try_compile "$LINENO"; then :
24353 gl_cv_cc_visibility=yes
24354else
24355 gl_cv_cc_visibility=no
24356fi
24357rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24358 CFLAGS="$gl_save_CFLAGS"
6ec2e0f5 24359
5df4cba6
SM
24360fi
24361{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
24362$as_echo "$gl_cv_cc_visibility" >&6; }
24363 if test $gl_cv_cc_visibility = yes; then
24364 CFLAG_VISIBILITY="-fvisibility=hidden"
24365 HAVE_VISIBILITY=1
6ec2e0f5
SDJ
24366 fi
24367 fi
24368
6ec2e0f5
SDJ
24369
24370
5df4cba6
SM
24371cat >>confdefs.h <<_ACEOF
24372#define HAVE_VISIBILITY $HAVE_VISIBILITY
24373_ACEOF
6ec2e0f5
SDJ
24374
24375
6ec2e0f5 24376
5df4cba6 24377 fi
6ec2e0f5 24378
c0c3707f 24379
6ec2e0f5
SDJ
24380 :
24381
24382 fi
24383
24384
24385
24386
24387
24388 GNULIB_MBRTOWC=1
24389
24390
24391
24392
24393
24394$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
5df4cba6
SM
24409
24410 if case "$host_os" in
24411 mingw*) true ;;
24412 *) test $ac_cv_func_mbsinit = yes ;;
24413 esac \
24414 && test $ac_cv_func_mbrtowc = yes; then
6ec2e0f5
SDJ
24415
24416
24417
c0c3707f 24418
6ec2e0f5
SDJ
24419 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
24420$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 24421if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
6ec2e0f5
SDJ
24422 $as_echo_n "(cached) " >&6
24423else
24424
24425 case "$host_os" in
24426 # Guess no on AIX and OSF/1.
24427 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
24428 # Guess yes otherwise.
24429 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
24430 esac
24431 if test $LOCALE_JA != none; then
24432 if test "$cross_compiling" = yes; then :
24433 :
24434else
24435 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24436/* end confdefs.h. */
24437
24438#include <locale.h>
24439#include <string.h>
6ec2e0f5
SDJ
24440#include <wchar.h>
24441int main ()
24442{
24443 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
24444 {
24445 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
24446 mbstate_t state;
24447 wchar_t wc;
24448
24449 memset (&state, '\0', sizeof (mbstate_t));
24450 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24451 if (mbsinit (&state))
c0c3707f
CB
24452 return 2;
24453 }
24454 return 0;
24455}
24456_ACEOF
24457if ac_fn_c_try_run "$LINENO"; then :
24458 gl_cv_func_mbrtowc_incomplete_state=yes
24459else
24460 gl_cv_func_mbrtowc_incomplete_state=no
24461fi
24462rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24463 conftest.$ac_objext conftest.beam conftest.$ac_ext
24464fi
24465
24466 else
24467 if test $LOCALE_FR_UTF8 != none; then
24468 if test "$cross_compiling" = yes; then :
24469 :
24470else
24471 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24472/* end confdefs.h. */
24473
24474#include <locale.h>
24475#include <string.h>
c0c3707f
CB
24476#include <wchar.h>
24477int main ()
24478{
24479 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24480 {
24481 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
24482 mbstate_t state;
24483 wchar_t wc;
24484
24485 memset (&state, '\0', sizeof (mbstate_t));
24486 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24487 if (mbsinit (&state))
24488 return 2;
6ec2e0f5
SDJ
24489 }
24490 return 0;
24491}
24492_ACEOF
24493if ac_fn_c_try_run "$LINENO"; then :
24494 gl_cv_func_mbrtowc_incomplete_state=yes
24495else
24496 gl_cv_func_mbrtowc_incomplete_state=no
24497fi
24498rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24499 conftest.$ac_objext conftest.beam conftest.$ac_ext
24500fi
24501
c0c3707f 24502 fi
6ec2e0f5
SDJ
24503 fi
24504
24505fi
24506{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
24507$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
24508
24509
24510
24511
24512 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
24513$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 24514if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
6ec2e0f5
SDJ
24515 $as_echo_n "(cached) " >&6
24516else
24517
24518 case "$host_os" in
24519 # Guess no on Solaris 8.
24520 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
24521 # Guess yes otherwise.
24522 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
24523 esac
24524 if test $LOCALE_ZH_CN != none; then
24525 if test "$cross_compiling" = yes; then :
24526 :
24527else
24528 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24529/* end confdefs.h. */
24530
24531#include <locale.h>
24532#include <stdlib.h>
24533#include <string.h>
6ec2e0f5
SDJ
24534#include <wchar.h>
24535int main ()
24536{
24537 /* This fails on Solaris 8:
24538 mbrtowc returns 2, and sets wc to 0x00F0.
24539 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
24540 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24541 {
24542 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
24543 mbstate_t state;
24544 wchar_t wc;
24545
24546 memset (&state, '\0', sizeof (mbstate_t));
24547 if (mbrtowc (&wc, input + 3, 6, &state) != 4
24548 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 24549 return 2;
6ec2e0f5 24550 }
49e4877c
PA
24551 return 0;
24552}
24553_ACEOF
24554if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24555 gl_cv_func_mbrtowc_sanitycheck=yes
49e4877c 24556else
6ec2e0f5 24557 gl_cv_func_mbrtowc_sanitycheck=no
49e4877c
PA
24558fi
24559rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24560 conftest.$ac_objext conftest.beam conftest.$ac_ext
24561fi
24562
6ec2e0f5
SDJ
24563 fi
24564
49e4877c 24565fi
6ec2e0f5
SDJ
24566{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
24567$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
49e4877c 24568
6ec2e0f5
SDJ
24569 REPLACE_MBSTATE_T=0
24570 case "$gl_cv_func_mbrtowc_incomplete_state" in
24571 *yes) ;;
24572 *) REPLACE_MBSTATE_T=1 ;;
24573 esac
24574 case "$gl_cv_func_mbrtowc_sanitycheck" in
24575 *yes) ;;
24576 *) REPLACE_MBSTATE_T=1 ;;
24577 esac
24578 else
24579 REPLACE_MBSTATE_T=1
24580 fi
8690e634 24581
8690e634 24582
8690e634 24583
6ec2e0f5
SDJ
24584 if test $ac_cv_func_mbsinit = no; then
24585 HAVE_MBSINIT=0
24586 ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
9c9d63b1 24587 #include <wchar.h>
8690e634 24588
6ec2e0f5 24589"
d0ac1c44 24590if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
6ec2e0f5
SDJ
24591 ac_have_decl=1
24592else
24593 ac_have_decl=0
24594fi
4a626d0a 24595
6ec2e0f5
SDJ
24596cat >>confdefs.h <<_ACEOF
24597#define HAVE_DECL_MBSINIT $ac_have_decl
24598_ACEOF
49e4877c 24599
6ec2e0f5
SDJ
24600 if test $ac_cv_have_decl_mbsinit = yes; then
24601 REPLACE_MBSINIT=1
24602 fi
24603 else
24604 if test $REPLACE_MBSTATE_T = 1; then
24605 REPLACE_MBSINIT=1
24606 else
24607 case "$host_os" in
24608 mingw*) REPLACE_MBSINIT=1 ;;
8690e634 24609 esac
c971b7fa
PA
24610 fi
24611 fi
24612
6ec2e0f5 24613 if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
c971b7fa 24614
c971b7fa 24615
c971b7fa
PA
24616
24617
24618
24619
24620
24621
6ec2e0f5 24622 gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
8690e634
JK
24623
24624
24625 :
c971b7fa 24626
a512b375 24627 fi
c971b7fa 24628
8690e634
JK
24629
24630
24631
24632
6ec2e0f5 24633 GNULIB_MBSINIT=1
8690e634
JK
24634
24635
24636
24637
8690e634 24638
6ec2e0f5 24639$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
8690e634
JK
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
c971b7fa 24651
c971b7fa 24652
5df4cba6
SM
24653
24654 if case "$host_os" in
24655 mingw*) true ;;
24656 *) test $ac_cv_func_mbsinit = yes ;;
24657 esac \
24658 && test $ac_cv_func_mbrtowc = yes; then
c971b7fa 24659
8690e634
JK
24660
24661
c0c3707f 24662
8690e634
JK
24663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
24664$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 24665if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
8690e634
JK
24666 $as_echo_n "(cached) " >&6
24667else
24668
24669 case "$host_os" in
24670 # Guess no on AIX and OSF/1.
24671 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
24672 # Guess yes otherwise.
24673 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
24674 esac
24675 if test $LOCALE_JA != none; then
24676 if test "$cross_compiling" = yes; then :
24677 :
c971b7fa
PA
24678else
24679 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24680/* end confdefs.h. */
24681
8690e634
JK
24682#include <locale.h>
24683#include <string.h>
8690e634
JK
24684#include <wchar.h>
24685int main ()
c971b7fa 24686{
8690e634 24687 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
c971b7fa 24688 {
8690e634
JK
24689 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
24690 mbstate_t state;
24691 wchar_t wc;
24692
24693 memset (&state, '\0', sizeof (mbstate_t));
24694 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24695 if (mbsinit (&state))
c0c3707f
CB
24696 return 2;
24697 }
24698 return 0;
24699}
24700_ACEOF
24701if ac_fn_c_try_run "$LINENO"; then :
24702 gl_cv_func_mbrtowc_incomplete_state=yes
24703else
24704 gl_cv_func_mbrtowc_incomplete_state=no
24705fi
24706rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24707 conftest.$ac_objext conftest.beam conftest.$ac_ext
24708fi
24709
24710 else
24711 if test $LOCALE_FR_UTF8 != none; then
24712 if test "$cross_compiling" = yes; then :
24713 :
24714else
24715 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24716/* end confdefs.h. */
24717
24718#include <locale.h>
24719#include <string.h>
c0c3707f
CB
24720#include <wchar.h>
24721int main ()
24722{
24723 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24724 {
24725 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
24726 mbstate_t state;
24727 wchar_t wc;
24728
24729 memset (&state, '\0', sizeof (mbstate_t));
24730 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24731 if (mbsinit (&state))
24732 return 2;
c971b7fa 24733 }
c971b7fa
PA
24734 return 0;
24735}
24736_ACEOF
24737if ac_fn_c_try_run "$LINENO"; then :
8690e634 24738 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 24739else
8690e634 24740 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa
PA
24741fi
24742rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24743 conftest.$ac_objext conftest.beam conftest.$ac_ext
24744fi
24745
c0c3707f 24746 fi
8690e634 24747 fi
c971b7fa
PA
24748
24749fi
8690e634
JK
24750{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
24751$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa
PA
24752
24753
c971b7fa
PA
24754
24755
8690e634
JK
24756 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
24757$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 24758if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
24759 $as_echo_n "(cached) " >&6
24760else
8690e634
JK
24761
24762 case "$host_os" in
24763 # Guess no on Solaris 8.
24764 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
24765 # Guess yes otherwise.
24766 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
24767 esac
24768 if test $LOCALE_ZH_CN != none; then
24769 if test "$cross_compiling" = yes; then :
24770 :
24771else
c971b7fa
PA
24772 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24773/* end confdefs.h. */
8690e634
JK
24774
24775#include <locale.h>
24776#include <stdlib.h>
24777#include <string.h>
8690e634
JK
24778#include <wchar.h>
24779int main ()
c971b7fa 24780{
8690e634
JK
24781 /* This fails on Solaris 8:
24782 mbrtowc returns 2, and sets wc to 0x00F0.
24783 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
24784 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24785 {
24786 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
24787 mbstate_t state;
24788 wchar_t wc;
24789
24790 memset (&state, '\0', sizeof (mbstate_t));
24791 if (mbrtowc (&wc, input + 3, 6, &state) != 4
24792 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 24793 return 2;
8690e634 24794 }
c971b7fa
PA
24795 return 0;
24796}
24797_ACEOF
8690e634
JK
24798if ac_fn_c_try_run "$LINENO"; then :
24799 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 24800else
8690e634 24801 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 24802fi
8690e634
JK
24803rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24804 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24805fi
c971b7fa 24806
8690e634
JK
24807 fi
24808
24809fi
24810{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
24811$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
c971b7fa 24812
8690e634
JK
24813 REPLACE_MBSTATE_T=0
24814 case "$gl_cv_func_mbrtowc_incomplete_state" in
24815 *yes) ;;
24816 *) REPLACE_MBSTATE_T=1 ;;
24817 esac
24818 case "$gl_cv_func_mbrtowc_sanitycheck" in
24819 *yes) ;;
24820 *) REPLACE_MBSTATE_T=1 ;;
24821 esac
24822 else
24823 REPLACE_MBSTATE_T=1
c971b7fa
PA
24824 fi
24825
c971b7fa 24826
8690e634 24827
6ec2e0f5
SDJ
24828 if test $ac_cv_func_mbsrtowcs = no; then
24829 HAVE_MBSRTOWCS=0
24830 ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
9c9d63b1 24831 #include <wchar.h>
8690e634
JK
24832
24833"
d0ac1c44 24834if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then :
8690e634
JK
24835 ac_have_decl=1
24836else
24837 ac_have_decl=0
c971b7fa 24838fi
c971b7fa 24839
8690e634 24840cat >>confdefs.h <<_ACEOF
6ec2e0f5 24841#define HAVE_DECL_MBSRTOWCS $ac_have_decl
c971b7fa 24842_ACEOF
c971b7fa 24843
6ec2e0f5
SDJ
24844 if test $ac_cv_have_decl_mbsrtowcs = yes; then
24845 REPLACE_MBSRTOWCS=1
8690e634
JK
24846 fi
24847 else
24848 if test $REPLACE_MBSTATE_T = 1; then
6ec2e0f5 24849 REPLACE_MBSRTOWCS=1
8690e634 24850 else
6ec2e0f5
SDJ
24851
24852
24853
24854
24855
24856
24857 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
24858$as_echo_n "checking whether mbsrtowcs works... " >&6; }
d0ac1c44 24859if ${gl_cv_func_mbsrtowcs_works+:} false; then :
6ec2e0f5
SDJ
24860 $as_echo_n "(cached) " >&6
24861else
24862
24863 case "$host_os" in
24864 # Guess no on HP-UX, Solaris, mingw.
24865 hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
24866 # Guess yes otherwise.
24867 *) gl_cv_func_mbsrtowcs_works="guessing yes" ;;
24868 esac
24869 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
24870 if test "$cross_compiling" = yes; then :
24871 :
24872else
24873 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24874/* end confdefs.h. */
24875
24876#include <locale.h>
24877#include <string.h>
6ec2e0f5
SDJ
24878#include <wchar.h>
24879int main ()
24880{
24881 int result = 0;
24882 /* Test whether the function supports a NULL destination argument.
24883 This fails on native Windows. */
24884 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
24885 {
24886 const char input[] = "\337er";
24887 const char *src = input;
24888 mbstate_t state;
24889
24890 memset (&state, '\0', sizeof (mbstate_t));
24891 if (mbsrtowcs (NULL, &src, 1, &state) != 3
24892 || src != input)
24893 result |= 1;
24894 }
24895 /* Test whether the function works when started with a conversion state
24896 in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
24897 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24898 {
24899 const char input[] = "B\303\274\303\237er";
24900 mbstate_t state;
24901
24902 memset (&state, '\0', sizeof (mbstate_t));
24903 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24904 if (!mbsinit (&state))
24905 {
24906 const char *src = input + 2;
24907 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24908 result |= 2;
24909 }
24910 }
24911 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
24912 {
24913 const char input[] = "<\306\374\313\334\270\354>";
24914 mbstate_t state;
24915
24916 memset (&state, '\0', sizeof (mbstate_t));
24917 if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
24918 if (!mbsinit (&state))
24919 {
24920 const char *src = input + 4;
24921 if (mbsrtowcs (NULL, &src, 10, &state) != 3)
24922 result |= 4;
24923 }
24924 }
24925 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24926 {
24927 const char input[] = "B\250\271\201\060\211\070er";
24928 mbstate_t state;
24929
24930 memset (&state, '\0', sizeof (mbstate_t));
24931 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24932 if (!mbsinit (&state))
24933 {
24934 const char *src = input + 2;
24935 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24936 result |= 8;
24937 }
24938 }
24939 return result;
24940}
24941_ACEOF
24942if ac_fn_c_try_run "$LINENO"; then :
24943 gl_cv_func_mbsrtowcs_works=yes
24944else
24945 gl_cv_func_mbsrtowcs_works=no
24946fi
24947rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24948 conftest.$ac_objext conftest.beam conftest.$ac_ext
24949fi
24950
24951 fi
24952
24953fi
24954{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
24955$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
24956
24957 case "$gl_cv_func_mbsrtowcs_works" in
24958 *yes) ;;
24959 *) REPLACE_MBSRTOWCS=1 ;;
8690e634
JK
24960 esac
24961 fi
24962 fi
c971b7fa 24963
6ec2e0f5 24964 if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
c971b7fa
PA
24965
24966
24967
24968
24969
24970
24971
24972
698be2d8
CB
24973 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
24984
24985
24986 :
24987
24988 fi
24989
24990
24991
24992
24993
24994 GNULIB_MBSRTOWCS=1
24995
24996
24997
24998
24999
25000$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
25001
25002
25003
25004
25005
25006
25007 for ac_func in mbtowc
25008do :
25009 ac_fn_c_check_func "$LINENO" "mbtowc" "ac_cv_func_mbtowc"
25010if test "x$ac_cv_func_mbtowc" = xyes; then :
25011 cat >>confdefs.h <<_ACEOF
25012#define HAVE_MBTOWC 1
25013_ACEOF
25014
25015fi
25016done
25017
25018 if test $ac_cv_func_mbtowc = no; then
25019 HAVE_MBTOWC=0
25020 else
25021 if false; then
25022 REPLACE_MBTOWC=1
25023 fi
25024 fi
6ec2e0f5 25025
698be2d8 25026 if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
6ec2e0f5
SDJ
25027
25028
25029
25030
25031
25032
25033
25034
698be2d8 25035 gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext"
c971b7fa
PA
25036
25037
8690e634 25038 :
c971b7fa 25039
a512b375 25040 fi
c971b7fa 25041
c971b7fa 25042
c971b7fa 25043
c971b7fa
PA
25044
25045
698be2d8 25046 GNULIB_MBTOWC=1
c971b7fa 25047
c971b7fa
PA
25048
25049
25050
25051
698be2d8 25052$as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
c971b7fa
PA
25053
25054
c971b7fa 25055
c971b7fa 25056
9c9d63b1 25057 if test $REPLACE_MEMCHR = 1; then
c971b7fa
PA
25058
25059
25060
c971b7fa 25061
c971b7fa
PA
25062
25063
25064
25065
6ec2e0f5 25066 gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
8690e634 25067
c971b7fa 25068
6ec2e0f5
SDJ
25069 for ac_header in bp-sym.h
25070do :
25071 ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
d0ac1c44 25072if test "x$ac_cv_header_bp_sym_h" = xyes; then :
6ec2e0f5
SDJ
25073 cat >>confdefs.h <<_ACEOF
25074#define HAVE_BP_SYM_H 1
25075_ACEOF
c971b7fa 25076
6ec2e0f5 25077fi
c971b7fa 25078
6ec2e0f5
SDJ
25079done
25080
25081
25082 fi
25083
25084
25085
25086
25087
25088 GNULIB_MEMCHR=1
25089
25090
25091
25092
25093
25094$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
25095
25096
25097
25098
25099
25100 if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
25101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5
25102$as_echo_n "checking whether memmem works in linear time... " >&6; }
d0ac1c44 25103if ${gl_cv_func_memmem_works_fast+:} false; then :
8690e634
JK
25104 $as_echo_n "(cached) " >&6
25105else
6ec2e0f5
SDJ
25106 if test "$cross_compiling" = yes; then :
25107 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25108/* end confdefs.h. */
25109
25110#include <features.h>
25111#ifdef __GNU_LIBRARY__
25112 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
25113 && !defined __UCLIBC__
25114 Lucky user
25115 #endif
25116#endif
25117#ifdef __CYGWIN__
25118 #include <cygwin/version.h>
25119 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
25120 Lucky user
25121 #endif
25122#endif
25123
25124_ACEOF
25125if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25126 $EGREP "Lucky user" >/dev/null 2>&1; then :
25127 gl_cv_func_memmem_works_fast="guessing yes"
25128else
c0c3707f 25129 gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"
6ec2e0f5
SDJ
25130fi
25131rm -f conftest*
25132
c971b7fa 25133
8690e634
JK
25134else
25135 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 25136/* end confdefs.h. */
c971b7fa 25137
6ec2e0f5
SDJ
25138#include <signal.h> /* for signal */
25139#include <string.h> /* for memmem */
25140#include <stdlib.h> /* for malloc */
25141#include <unistd.h> /* for alarm */
25142static void quit (int sig) { _exit (sig + 128); }
25143
25144int
25145main ()
8690e634 25146{
8690e634 25147
6ec2e0f5
SDJ
25148 int result = 0;
25149 size_t m = 1000000;
25150 char *haystack = (char *) malloc (2 * m + 1);
25151 char *needle = (char *) malloc (m + 1);
25152 /* Failure to compile this test due to missing alarm is okay,
25153 since all such platforms (mingw) also lack memmem. */
25154 signal (SIGALRM, quit);
25155 alarm (5);
25156 /* Check for quadratic performance. */
25157 if (haystack && needle)
25158 {
25159 memset (haystack, 'A', 2 * m);
25160 haystack[2 * m] = 'B';
25161 memset (needle, 'A', m);
25162 needle[m] = 'B';
25163 if (!memmem (haystack, 2 * m + 1, needle, m + 1))
25164 result |= 1;
25165 }
c0c3707f
CB
25166 /* Free allocated memory, in case some sanitizer is watching. */
25167 free (haystack);
25168 free (needle);
6ec2e0f5
SDJ
25169 return result;
25170
25171 ;
c971b7fa
PA
25172 return 0;
25173}
25174_ACEOF
8690e634 25175if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 25176 gl_cv_func_memmem_works_fast=yes
8690e634 25177else
6ec2e0f5 25178 gl_cv_func_memmem_works_fast=no
8690e634
JK
25179fi
25180rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25181 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 25182fi
c971b7fa
PA
25183
25184
8690e634 25185fi
6ec2e0f5
SDJ
25186{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5
25187$as_echo "$gl_cv_func_memmem_works_fast" >&6; }
25188 case "$gl_cv_func_memmem_works_fast" in
25189 *yes) ;;
25190 *)
25191 REPLACE_MEMMEM=1
25192 ;;
25193 esac
25194 fi
c971b7fa 25195
6ec2e0f5 25196 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
8690e634
JK
25197
25198
25199
6ec2e0f5
SDJ
25200
25201
25202
25203
25204
25205 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
25206
25207 fi
25208
25209
25210
25211
25212 for ac_func in memmem
25213do :
25214 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
d0ac1c44 25215if test "x$ac_cv_func_memmem" = xyes; then :
6ec2e0f5
SDJ
25216 cat >>confdefs.h <<_ACEOF
25217#define HAVE_MEMMEM 1
25218_ACEOF
25219
25220fi
25221done
25222
25223 if test $ac_cv_func_memmem = yes; then
25224 HAVE_MEMMEM=1
25225 else
25226 HAVE_MEMMEM=0
25227 fi
25228
25229 if test $ac_cv_have_decl_memmem = no; then
25230 HAVE_DECL_MEMMEM=0
25231 else
25232 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
25233$as_echo_n "checking whether memmem works... " >&6; }
d0ac1c44 25234if ${gl_cv_func_memmem_works_always+:} false; then :
c971b7fa
PA
25235 $as_echo_n "(cached) " >&6
25236else
6ec2e0f5
SDJ
25237 if test "$cross_compiling" = yes; then :
25238 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25239/* end confdefs.h. */
25240
25241#ifdef __GNU_LIBRARY__
25242 #include <features.h>
25243 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
25244 || __GLIBC_MINOR__ > 12)) \
25245 || (__GLIBC__ > 2)) \
25246 || defined __UCLIBC__
25247 Lucky user
25248 #endif
25249#elif defined __CYGWIN__
25250 #include <cygwin/version.h>
25251 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
25252 Lucky user
25253 #endif
25254#else
25255 Lucky user
25256#endif
25257
25258_ACEOF
25259if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25260 $EGREP "Lucky user" >/dev/null 2>&1; then :
25261 gl_cv_func_memmem_works_always="guessing yes"
25262else
c0c3707f 25263 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
6ec2e0f5
SDJ
25264fi
25265rm -f conftest*
25266
8690e634 25267
8690e634 25268else
c971b7fa
PA
25269 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25270/* end confdefs.h. */
c971b7fa 25271
6ec2e0f5
SDJ
25272#include <string.h> /* for memmem */
25273#define P "_EF_BF_BD"
25274#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
25275#define NEEDLE P P P P P
25276
25277int
25278main ()
c971b7fa 25279{
8690e634 25280
6ec2e0f5
SDJ
25281 int result = 0;
25282 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
25283 result |= 1;
25284 /* Check for empty needle behavior. */
25285 {
25286 const char *haystack = "AAA";
698be2d8 25287 if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
6ec2e0f5 25288 result |= 2;
8690e634 25289 }
6ec2e0f5
SDJ
25290 return result;
25291
25292 ;
c971b7fa
PA
25293 return 0;
25294}
25295_ACEOF
8690e634 25296if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 25297 gl_cv_func_memmem_works_always=yes
c971b7fa 25298else
6ec2e0f5 25299 gl_cv_func_memmem_works_always=no
c971b7fa 25300fi
8690e634
JK
25301rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25302 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 25303fi
8690e634 25304
8690e634
JK
25305
25306fi
6ec2e0f5
SDJ
25307{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
25308$as_echo "$gl_cv_func_memmem_works_always" >&6; }
25309 case "$gl_cv_func_memmem_works_always" in
8690e634 25310 *yes) ;;
6ec2e0f5
SDJ
25311 *)
25312 REPLACE_MEMMEM=1
25313 ;;
8690e634 25314 esac
c971b7fa 25315 fi
6ec2e0f5 25316 :
c971b7fa 25317
6ec2e0f5 25318 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
c971b7fa 25319
c971b7fa 25320
8690e634 25321
c971b7fa 25322
6ec2e0f5
SDJ
25323
25324
25325
25326
25327 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
25328
25329 fi
25330
25331
25332
25333
25334
25335 GNULIB_MEMMEM=1
25336
25337
25338
25339
25340
25341$as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351 for ac_func in mempcpy
25352do :
25353 ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
d0ac1c44 25354if test "x$ac_cv_func_mempcpy" = xyes; then :
6ec2e0f5
SDJ
25355 cat >>confdefs.h <<_ACEOF
25356#define HAVE_MEMPCPY 1
8690e634 25357_ACEOF
c971b7fa 25358
6ec2e0f5
SDJ
25359fi
25360done
c971b7fa 25361
6ec2e0f5
SDJ
25362 if test $ac_cv_func_mempcpy = no; then
25363 HAVE_MEMPCPY=0
25364 fi
8690e634 25365
6ec2e0f5 25366 if test $HAVE_MEMPCPY = 0; then
8690e634
JK
25367
25368
25369
25370
8690e634 25371
6ec2e0f5
SDJ
25372
25373
25374
25375 gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
25376
25377
8690e634 25378 :
c971b7fa 25379
6ec2e0f5 25380 fi
c971b7fa 25381
8690e634 25382
8690e634 25383
8690e634 25384
6ec2e0f5
SDJ
25385
25386 GNULIB_MEMPCPY=1
25387
25388
25389
25390
25391
25392$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
25393
25394
25395
25396
25397
25398
25399
25400
25401 if test $ac_cv_have_decl_memrchr = no; then
25402 HAVE_DECL_MEMRCHR=0
25403 fi
25404
25405 for ac_func in memrchr
25406do :
25407 ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
d0ac1c44 25408if test "x$ac_cv_func_memrchr" = xyes; then :
6ec2e0f5
SDJ
25409 cat >>confdefs.h <<_ACEOF
25410#define HAVE_MEMRCHR 1
c971b7fa 25411_ACEOF
6ec2e0f5 25412
c971b7fa 25413fi
6ec2e0f5 25414done
8690e634 25415
8690e634 25416
6ec2e0f5 25417 if test $ac_cv_func_memrchr = no; then
8690e634 25418
6ec2e0f5
SDJ
25419
25420
25421
25422
25423
25424
25425
25426 gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
25427
25428 :
c971b7fa
PA
25429 fi
25430
25431
c971b7fa 25432
c971b7fa 25433
c971b7fa 25434
6ec2e0f5
SDJ
25435 GNULIB_MEMRCHR=1
25436
25437
25438
25439
25440
25441$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
25442
25443
25444
25445
2d8adcbd 25446
698be2d8
CB
25447
25448
25449
8a99096f
SM
25450 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
25451$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
25452if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then :
25453 $as_echo_n "(cached) " >&6
25454else
25455 rm -rf conftest.dir
9c9d63b1 25456 if test "$cross_compiling" = yes; then :
8a99096f 25457 case "$host_os" in
9c9d63b1
PM
25458 # Guess yes on Linux systems.
25459 linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
25460 # Guess yes on glibc systems.
25461 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
25462 # Guess yes on MSVC, no on mingw.
25463 mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f
CB
25464/* end confdefs.h. */
25465
25466#ifdef _MSC_VER
25467 Known
25468#endif
25469
25470_ACEOF
25471if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25472 $EGREP "Known" >/dev/null 2>&1; then :
25473 gl_cv_func_mkdir_trailing_slash_works="guessing yes"
25474else
25475 gl_cv_func_mkdir_trailing_slash_works="guessing no"
25476fi
25477rm -f conftest*
25478
9c9d63b1
PM
25479 ;;
25480 # If we don't know, obey --enable-cross-guesses.
25481 *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
25482 esac
8a99096f
SM
25483
25484else
25485 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25486/* end confdefs.h. */
25487
9c9d63b1
PM
25488 #include <sys/types.h>
25489 #include <sys/stat.h>
25490
25491
25492$gl_mda_defines
8a99096f
SM
25493
25494int
25495main ()
25496{
25497return mkdir ("conftest.dir/", 0700);
25498 ;
25499 return 0;
25500}
25501_ACEOF
25502if ac_fn_c_try_run "$LINENO"; then :
25503 gl_cv_func_mkdir_trailing_slash_works=yes
25504else
25505 gl_cv_func_mkdir_trailing_slash_works=no
25506fi
25507rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25508 conftest.$ac_objext conftest.beam conftest.$ac_ext
25509fi
25510
9c9d63b1 25511 rm -rf conftest.dir
8a99096f
SM
25512
25513fi
25514{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
25515$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
25516 case "$gl_cv_func_mkdir_trailing_slash_works" in
25517 *yes) ;;
25518 *)
25519 REPLACE_MKDIR=1
25520 ;;
25521 esac
25522
25523 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
25524$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
25525if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then :
25526 $as_echo_n "(cached) " >&6
25527else
25528 rm -rf conftest.dir
9c9d63b1 25529 if test "$cross_compiling" = yes; then :
8a99096f 25530 case "$host_os" in
9c9d63b1
PM
25531 # Guess yes on glibc systems.
25532 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
25533 # Guess yes on musl systems.
25534 *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
25535 # Guess no on native Windows.
25536 mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
25537 # If we don't know, obey --enable-cross-guesses.
25538 *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
25539 esac
8a99096f
SM
25540
25541else
25542 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25543/* end confdefs.h. */
25544
9c9d63b1
PM
25545 #include <sys/types.h>
25546 #include <sys/stat.h>
25547
25548
25549$gl_mda_defines
8a99096f
SM
25550
25551int
25552main ()
25553{
25554return !mkdir ("conftest.dir/./", 0700);
25555 ;
25556 return 0;
25557}
25558_ACEOF
25559if ac_fn_c_try_run "$LINENO"; then :
25560 gl_cv_func_mkdir_trailing_dot_works=yes
25561else
25562 gl_cv_func_mkdir_trailing_dot_works=no
25563fi
25564rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25565 conftest.$ac_objext conftest.beam conftest.$ac_ext
25566fi
25567
9c9d63b1 25568 rm -rf conftest.dir
8a99096f
SM
25569
25570
25571fi
25572{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
25573$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
25574 case "$gl_cv_func_mkdir_trailing_dot_works" in
25575 *yes) ;;
25576 *)
25577 REPLACE_MKDIR=1
25578
25579$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
25580
25581 ;;
25582 esac
25583
25584 if test $REPLACE_MKDIR = 1; then
25585
25586
25587
25588
25589
25590
25591
25592
25593 gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
25594
25595 fi
25596
25597
9c9d63b1
PM
25598
25599
25600
25601 GNULIB_MKDIR=1
25602
25603
25604
25605
25606
25607$as_echo "#define GNULIB_TEST_MKDIR 1" >>confdefs.h
25608
25609
25610
25611
25612
e8d8cce6
SM
25613 for ac_func in mkdtemp
25614do :
25615 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
25616if test "x$ac_cv_func_mkdtemp" = xyes; then :
25617 cat >>confdefs.h <<_ACEOF
25618#define HAVE_MKDTEMP 1
25619_ACEOF
25620
25621fi
25622done
25623
25624 if test $ac_cv_func_mkdtemp = no; then
25625 HAVE_MKDTEMP=0
25626 fi
25627
25628 if test $HAVE_MKDTEMP = 0; then
25629
25630
25631
25632
25633
25634
25635
25636
25637 gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext"
25638
25639 :
25640
25641 fi
25642
25643
25644
25645
25646
25647 GNULIB_MKDTEMP=1
25648
25649
25650
25651
25652
25653$as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
25654
25655
25656
25657
25658
2d8adcbd
MM
25659
25660
b3279b60
TT
25661
25662
b3279b60
TT
25663 if test $ac_cv_func_mkostemp != yes; then
25664 HAVE_MKOSTEMP=0
25665 fi
2d8adcbd 25666
b3279b60 25667 if test $HAVE_MKOSTEMP = 0; then
2d8adcbd 25668
2d8adcbd 25669
2d8adcbd 25670
2d8adcbd 25671
2d8adcbd
MM
25672
25673
25674
25675
b3279b60 25676 gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
2d8adcbd
MM
25677
25678
25679
b3279b60 25680 fi
2d8adcbd 25681
2d8adcbd 25682
b3279b60
TT
25683cat >>confdefs.h <<_ACEOF
25684#define GNULIB_MKOSTEMP 1
25685_ACEOF
2d8adcbd
MM
25686
25687
2d8adcbd
MM
25688
25689
25690
25691
25692
b3279b60 25693 GNULIB_MKOSTEMP=1
2d8adcbd
MM
25694
25695
25696
25697
25698
b3279b60 25699$as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h
2d8adcbd
MM
25700
25701
25702
25703
6ec2e0f5
SDJ
25704 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
25705
25706
25707
c971b7fa 25708
c971b7fa 25709
c971b7fa
PA
25710
25711
8690e634 25712
6ec2e0f5 25713 gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
8690e634 25714
6ec2e0f5 25715 fi
8690e634 25716
6ec2e0f5 25717 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
8690e634
JK
25718
25719
25720
25721
25722
25723
8690e634
JK
25724
25725
6ec2e0f5 25726 gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
8690e634 25727
a512b375 25728 fi
8690e634
JK
25729
25730
c0c3707f
CB
25731cat >>confdefs.h <<_ACEOF
25732#define GNULIB_MSVC_NOTHROW 1
25733_ACEOF
25734
25735
25736
25737
725e2999
JB
25738 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
25739$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
25740if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
25741 $as_echo_n "(cached) " >&6
25742else
25743
25744 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25745/* end confdefs.h. */
25746#include <netinet/in.h>
25747int
25748main ()
25749{
25750
25751 ;
25752 return 0;
25753}
25754_ACEOF
25755if ac_fn_c_try_compile "$LINENO"; then :
25756 gl_cv_header_netinet_in_h_selfcontained=yes
25757else
25758 gl_cv_header_netinet_in_h_selfcontained=no
25759fi
25760rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25761
25762fi
25763{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
25764$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
25765 if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
25766 NETINET_IN_H=''
25767 else
25768 NETINET_IN_H='netinet/in.h'
25769 for ac_header in netinet/in.h
25770do :
25771 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
25772if test "x$ac_cv_header_netinet_in_h" = xyes; then :
25773 cat >>confdefs.h <<_ACEOF
25774#define HAVE_NETINET_IN_H 1
25775_ACEOF
25776
25777fi
25778
25779done
25780
25781
25782
25783
25784
25785
25786
725e2999
JB
25787
25788
25789
25790 if test $gl_cv_have_include_next = yes; then
25791 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
25792 else
25793 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
25794$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
25795if ${gl_cv_next_netinet_in_h+:} false; then :
25796 $as_echo_n "(cached) " >&6
25797else
25798
25799 if test $ac_cv_header_netinet_in_h = yes; then
25800
25801
25802
25803
25804 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25805/* end confdefs.h. */
25806#include <netinet/in.h>
25807_ACEOF
25808 case "$host_os" in
25809 aix*) gl_absname_cpp="$ac_cpp -C" ;;
25810 *) gl_absname_cpp="$ac_cpp" ;;
25811 esac
25812
25813 case "$host_os" in
25814 mingw*)
25815 gl_dirsep_regex='[/\\]'
25816 ;;
25817 *)
25818 gl_dirsep_regex='\/'
25819 ;;
25820 esac
25821 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
25822 gl_header_literal_regex=`echo 'netinet/in.h' \
25823 | sed -e "$gl_make_literal_regex_sed"`
25824 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
25825 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
25826 s|^/[^/]|//&|
25827 p
25828 q
25829 }'
25830
25831 gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
25832 sed -n "$gl_absolute_header_sed"`
25833
25834 gl_header=$gl_cv_absolute_netinet_in_h
25835 gl_cv_next_netinet_in_h='"'$gl_header'"'
25836 else
25837 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
25838 fi
25839
25840
25841fi
25842{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
25843$as_echo "$gl_cv_next_netinet_in_h" >&6; }
25844 fi
25845 NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
25846
25847 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
25848 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
25849 gl_next_as_first_directive='<'netinet/in.h'>'
25850 else
25851 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
25852 gl_next_as_first_directive=$gl_cv_next_netinet_in_h
25853 fi
25854 NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
25855
25856
25857
25858
25859 if test $ac_cv_header_netinet_in_h = yes; then
25860 HAVE_NETINET_IN_H=1
25861 else
25862 HAVE_NETINET_IN_H=0
25863 fi
25864
25865 fi
25866
25867 if test -n "$NETINET_IN_H"; then
25868 GL_GENERATE_NETINET_IN_H_TRUE=
25869 GL_GENERATE_NETINET_IN_H_FALSE='#'
25870else
25871 GL_GENERATE_NETINET_IN_H_TRUE='#'
25872 GL_GENERATE_NETINET_IN_H_FALSE=
25873fi
25874
25875
25876
25877
8690e634 25878
c0c3707f 25879
6ec2e0f5
SDJ
25880 case "$host_os" in
25881 mingw* | pw*)
25882 REPLACE_OPEN=1
25883 ;;
25884 *)
25885
c0c3707f
CB
25886 if test "$gl_cv_macro_O_CLOEXEC" != yes; then
25887 REPLACE_OPEN=1
25888 fi
472fa5ee
SM
25889
25890
c0c3707f 25891 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
6ec2e0f5 25892$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
d0ac1c44 25893if ${gl_cv_func_open_slash+:} false; then :
6ec2e0f5
SDJ
25894 $as_echo_n "(cached) " >&6
25895else
25896 # Assume that if we have lstat, we can also check symlinks.
c0c3707f
CB
25897 if test $ac_cv_func_lstat = yes; then
25898 touch conftest.tmp
25899 ln -s conftest.tmp conftest.lnk
25900 fi
25901 if test "$cross_compiling" = yes; then :
8690e634 25902
c0c3707f
CB
25903 case "$host_os" in
25904 freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
25905 gl_cv_func_open_slash="guessing no" ;;
25906 *)
25907 gl_cv_func_open_slash="guessing yes" ;;
25908 esac
8690e634 25909
6ec2e0f5
SDJ
25910else
25911 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25912/* end confdefs.h. */
25913
25914#include <fcntl.h>
25915#if HAVE_UNISTD_H
25916# include <unistd.h>
25917#endif
9c9d63b1
PM
25918
25919
25920$gl_mda_defines
25921
6ec2e0f5
SDJ
25922int main ()
25923{
25924 int result = 0;
25925#if HAVE_LSTAT
25926 if (open ("conftest.lnk/", O_RDONLY) != -1)
25927 result |= 1;
25928#endif
25929 if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
25930 result |= 2;
25931 return result;
25932}
25933_ACEOF
25934if ac_fn_c_try_run "$LINENO"; then :
25935 gl_cv_func_open_slash=yes
25936else
25937 gl_cv_func_open_slash=no
25938fi
25939rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25940 conftest.$ac_objext conftest.beam conftest.$ac_ext
25941fi
8690e634 25942
c0c3707f 25943 rm -f conftest.sl conftest.tmp conftest.lnk
8690e634 25944
6ec2e0f5
SDJ
25945fi
25946{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
25947$as_echo "$gl_cv_func_open_slash" >&6; }
c0c3707f
CB
25948 case "$gl_cv_func_open_slash" in
25949 *no)
8690e634 25950
6ec2e0f5 25951$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
8690e634 25952
6ec2e0f5
SDJ
25953 ;;
25954 esac
8690e634 25955
c0c3707f
CB
25956 case "$gl_cv_func_open_slash" in
25957 *no)
25958 REPLACE_OPEN=1
25959 ;;
25960 esac
25961 ;;
25962 esac
472fa5ee 25963
c0c3707f 25964 if test $REPLACE_OPEN = 0; then
472fa5ee
SM
25965
25966
25967
6ec2e0f5
SDJ
25968 if test $ac_cv_func_fchdir = no; then
25969 HAVE_FCHDIR=0
25970 fi
c971b7fa 25971
6ec2e0f5
SDJ
25972 if test $HAVE_FCHDIR = 0; then
25973 REPLACE_OPEN=1
25974 fi
25975 fi
c971b7fa
PA
25976
25977
25978
6ec2e0f5 25979 if test $REPLACE_OPEN = 1; then
c971b7fa
PA
25980
25981
25982
25983
25984
c971b7fa
PA
25985
25986
c971b7fa 25987
6ec2e0f5 25988 gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
c971b7fa 25989
c971b7fa
PA
25990
25991
6ec2e0f5
SDJ
25992 :
25993
a512b375 25994 fi
c971b7fa
PA
25995
25996
25997
25998
25999
6ec2e0f5 26000 GNULIB_OPEN=1
c971b7fa
PA
26001
26002
26003
26004
26005
6ec2e0f5 26006$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
c971b7fa
PA
26007
26008
26009
26010
26011
c971b7fa 26012
c971b7fa 26013
472fa5ee 26014
63ce7108 26015
c0c3707f
CB
26016 case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
26017 yes+*yes+yes)
6ec2e0f5
SDJ
26018 ;;
26019 yes+*)
c0c3707f 26020 # Solaris 10 lacks O_CLOEXEC.
6ec2e0f5
SDJ
26021 # Solaris 9 has *at functions, but uniformly mishandles trailing
26022 # slash in all of them.
26023 REPLACE_OPENAT=1
26024 ;;
26025 *)
26026 HAVE_OPENAT=0
26027 ;;
26028 esac
63ce7108 26029
6ec2e0f5 26030 if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
63ce7108 26031
63ce7108 26032
63ce7108 26033
63ce7108 26034
63ce7108
TT
26035
26036
63ce7108 26037
63ce7108 26038
6ec2e0f5 26039 gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
63ce7108
TT
26040
26041
26042
6ec2e0f5 26043 :
63ce7108 26044
6ec2e0f5 26045 fi
63ce7108
TT
26046
26047
6ec2e0f5
SDJ
26048cat >>confdefs.h <<_ACEOF
26049#define GNULIB_OPENAT 1
26050_ACEOF
63ce7108 26051
63ce7108 26052
63ce7108
TT
26053
26054
26055
26056
6ec2e0f5 26057 GNULIB_OPENAT=1
63ce7108 26058
63ce7108 26059
63ce7108 26060
63ce7108 26061
63ce7108 26062
6ec2e0f5 26063$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
63ce7108
TT
26064
26065
63ce7108 26066
63ce7108 26067
63ce7108 26068
63ce7108 26069
6ec2e0f5
SDJ
26070 for ac_func in opendir
26071do :
26072 ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
d0ac1c44 26073if test "x$ac_cv_func_opendir" = xyes; then :
6ec2e0f5
SDJ
26074 cat >>confdefs.h <<_ACEOF
26075#define HAVE_OPENDIR 1
63ce7108 26076_ACEOF
6ec2e0f5 26077
63ce7108 26078fi
6ec2e0f5 26079done
63ce7108 26080
6ec2e0f5
SDJ
26081 if test $ac_cv_func_opendir = no; then
26082 HAVE_OPENDIR=0
26083 fi
63ce7108 26084
6ec2e0f5
SDJ
26085
26086
26087
26088 if test $ac_cv_func_fchdir = no; then
26089 HAVE_FCHDIR=0
63ce7108 26090 fi
63ce7108 26091
6ec2e0f5
SDJ
26092 if test $HAVE_FCHDIR = 0; then
26093 if test $HAVE_OPENDIR = 1; then
26094 REPLACE_OPENDIR=1
26095 fi
26096 fi
26097
26098 case $host_os,$HAVE_OPENDIR in
26099 os2*,1)
26100 REPLACE_OPENDIR=1;;
26101 esac
26102
26103 if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
63ce7108
TT
26104
26105
26106
26107
26108
26109
26110
26111
6ec2e0f5 26112 gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
63ce7108
TT
26113
26114 fi
26115
26116
26117
26118
26119
6ec2e0f5 26120 GNULIB_OPENDIR=1
63ce7108
TT
26121
26122
26123
26124
63ce7108 26125
6ec2e0f5 26126$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
63ce7108
TT
26127
26128
26129
26130
26131
26132
26133
2196f55f
YQ
26134
26135
8424cc97 26136
9c9d63b1
PM
26137 if test $ac_cv_func_pipe != yes; then
26138 HAVE_PIPE=0
26139 fi
26140
26141 if test $HAVE_PIPE = 0; then
26142
26143
26144
26145
26146
26147
26148
26149
26150 gl_LIBOBJS="$gl_LIBOBJS pipe.$ac_objext"
26151
26152 fi
26153
26154
26155
26156
26157
26158 GNULIB_PIPE=1
26159
26160
26161
26162
26163
26164$as_echo "#define GNULIB_TEST_PIPE 1" >>confdefs.h
26165
26166
26167
26168
26169
26170
26171
8424cc97
SM
26172 for ac_func in rawmemchr
26173do :
26174 ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
d0ac1c44 26175if test "x$ac_cv_func_rawmemchr" = xyes; then :
8424cc97
SM
26176 cat >>confdefs.h <<_ACEOF
26177#define HAVE_RAWMEMCHR 1
26178_ACEOF
26179
26180fi
26181done
26182
26183 if test $ac_cv_func_rawmemchr = no; then
26184 HAVE_RAWMEMCHR=0
26185 fi
26186
26187 if test $HAVE_RAWMEMCHR = 0; then
26188
26189
26190
26191
26192
26193
26194
26195
26196 gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
26197
26198 :
26199 fi
26200
26201
26202
26203
26204
26205 GNULIB_RAWMEMCHR=1
26206
26207
26208
26209
26210
26211$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
26212
26213
26214
26215
26216
26217
6ec2e0f5
SDJ
26218 for ac_func in readdir
26219do :
26220 ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
d0ac1c44 26221if test "x$ac_cv_func_readdir" = xyes; then :
6ec2e0f5
SDJ
26222 cat >>confdefs.h <<_ACEOF
26223#define HAVE_READDIR 1
26224_ACEOF
26225
26226fi
26227done
26228
26229 if test $ac_cv_func_readdir = no; then
26230 HAVE_READDIR=0
26231 fi
26232
26233 if test $HAVE_READDIR = 0; then
26234
26235
26236
26237
26238
26239
26240
26241
26242 gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
26243
26244 fi
26245
26246
26247
26248
26249
26250 GNULIB_READDIR=1
26251
26252
26253
26254
26255
26256$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
26257
26258
26259
26260
26261
26262
2196f55f
YQ
26263 if test $ac_cv_func_readlink = no; then
26264 HAVE_READLINK=0
26265 else
26266 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
26267$as_echo_n "checking whether readlink signature is correct... " >&6; }
d0ac1c44 26268if ${gl_cv_decl_readlink_works+:} false; then :
2196f55f
YQ
26269 $as_echo_n "(cached) " >&6
26270else
26271 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26272/* end confdefs.h. */
26273#include <unistd.h>
26274 /* Cause compilation failure if original declaration has wrong type. */
26275 ssize_t readlink (const char *, char *, size_t);
26276int
26277main ()
26278{
26279
26280 ;
26281 return 0;
26282}
26283_ACEOF
26284if ac_fn_c_try_compile "$LINENO"; then :
26285 gl_cv_decl_readlink_works=yes
26286else
26287 gl_cv_decl_readlink_works=no
26288fi
26289rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26290fi
26291{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
26292$as_echo "$gl_cv_decl_readlink_works" >&6; }
26293 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
26294$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
9c9d63b1 26295if ${gl_cv_func_readlink_trailing_slash+:} false; then :
2196f55f
YQ
26296 $as_echo_n "(cached) " >&6
26297else
26298 # We have readlink, so assume ln -s works.
26299 ln -s conftest.no-such conftest.link
26300 ln -s conftest.link conftest.lnk2
26301 if test "$cross_compiling" = yes; then :
26302 case "$host_os" in
9c9d63b1
PM
26303 # Guess yes on Linux or glibc systems.
26304 linux-* | linux | *-gnu* | gnu*)
26305 gl_cv_func_readlink_trailing_slash="guessing yes" ;;
26306 # Guess no on AIX or HP-UX.
26307 aix* | hpux*)
26308 gl_cv_func_readlink_trailing_slash="guessing no" ;;
26309 # If we don't know, obey --enable-cross-guesses.
26310 *)
26311 gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;;
2196f55f
YQ
26312 esac
26313
26314else
26315 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26316/* end confdefs.h. */
26317#include <unistd.h>
26318
26319int
26320main ()
26321{
26322char buf[20];
26323 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
26324 ;
26325 return 0;
26326}
26327_ACEOF
26328if ac_fn_c_try_run "$LINENO"; then :
9c9d63b1 26329 gl_cv_func_readlink_trailing_slash=yes
2196f55f 26330else
9c9d63b1 26331 gl_cv_func_readlink_trailing_slash=no
2196f55f
YQ
26332fi
26333rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26334 conftest.$ac_objext conftest.beam conftest.$ac_ext
26335fi
26336
26337 rm -f conftest.link conftest.lnk2
26338fi
9c9d63b1
PM
26339{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_trailing_slash" >&5
26340$as_echo "$gl_cv_func_readlink_trailing_slash" >&6; }
26341 case "$gl_cv_func_readlink_trailing_slash" in
2196f55f
YQ
26342 *yes)
26343 if test "$gl_cv_decl_readlink_works" != yes; then
26344 REPLACE_READLINK=1
26345 fi
26346 ;;
26347 *)
26348
26349$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
26350
26351 REPLACE_READLINK=1
26352 ;;
26353 esac
9c9d63b1
PM
26354
26355 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink truncates results correctly" >&5
26356$as_echo_n "checking whether readlink truncates results correctly... " >&6; }
26357if ${gl_cv_func_readlink_truncate+:} false; then :
26358 $as_echo_n "(cached) " >&6
26359else
26360 # We have readlink, so assume ln -s works.
26361 ln -s ab conftest.link
26362 if test "$cross_compiling" = yes; then :
26363 case "$host_os" in
26364 # Guess yes on Linux or glibc systems.
26365 linux-* | linux | *-gnu* | gnu*)
26366 gl_cv_func_readlink_truncate="guessing yes" ;;
26367 # Guess no on AIX or HP-UX.
26368 aix* | hpux*)
26369 gl_cv_func_readlink_truncate="guessing no" ;;
26370 # If we don't know, obey --enable-cross-guesses.
26371 *)
26372 gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;;
26373 esac
26374
26375else
26376 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26377/* end confdefs.h. */
26378#include <unistd.h>
26379
26380int
26381main ()
26382{
26383char c;
26384 return readlink ("conftest.link", &c, 1) != 1;
26385 ;
26386 return 0;
26387}
26388_ACEOF
26389if ac_fn_c_try_run "$LINENO"; then :
26390 gl_cv_func_readlink_truncate=yes
26391else
26392 gl_cv_func_readlink_truncate=no
26393fi
26394rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26395 conftest.$ac_objext conftest.beam conftest.$ac_ext
26396fi
26397
26398 rm -f conftest.link conftest.lnk2
26399fi
26400{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_truncate" >&5
26401$as_echo "$gl_cv_func_readlink_truncate" >&6; }
26402 case $gl_cv_func_readlink_truncate in
26403 *yes)
26404 if test "$gl_cv_decl_readlink_works" != yes; then
26405 REPLACE_READLINK=1
26406 fi
26407 ;;
26408 *)
26409
26410$as_echo "#define READLINK_TRUNCATE_BUG 1" >>confdefs.h
26411
26412 REPLACE_READLINK=1
26413 ;;
26414 esac
2196f55f
YQ
26415 fi
26416
26417 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
26418
26419
26420
26421
26422
26423
26424
26425
26426 gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
26427
26428
26429 :
26430
26431 fi
26432
26433
26434
26435
26436
26437 GNULIB_READLINK=1
26438
26439
26440
26441
26442
26443$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
26444
26445
26446
26447
6a29c58e
YQ
26448
26449
6ec2e0f5
SDJ
26450 if test $gl_cv_func_malloc_posix = yes; then
26451
26452$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
26453
26454 else
26455 REPLACE_REALLOC=1
26456 fi
26457
26458 if test $REPLACE_REALLOC = 1; then
26459
26460
26461
26462
26463
26464
26465
26466
26467 gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
26468
26469 fi
26470
26471
26472
26473
26474
26475 GNULIB_REALLOC_POSIX=1
26476
26477
26478
26479
26480
26481$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
26482
26483
26484
26485
26486
26487
6a29c58e
YQ
26488
26489
26490 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
26491$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
d0ac1c44 26492if ${gl_cv_func_rename_slash_dst_works+:} false; then :
6a29c58e
YQ
26493 $as_echo_n "(cached) " >&6
26494else
26495 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
26496 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 26497 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26498 # Assume that if we have lstat, we can also check symlinks.
26499 if test $ac_cv_func_lstat = yes; then
26500 ln -s conftest.f conftest.lnk
26501 fi
26502 if test "$cross_compiling" = yes; then :
26503 case "$host_os" in
c0c3707f
CB
26504 # Guess yes on Linux systems.
26505 linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
26506 # Guess yes on glibc systems.
26507 *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
26508 # Guess no on native Windows.
26509 mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
26510 # If we don't know, obey --enable-cross-guesses.
26511 *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26512 esac
26513
26514else
26515 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26516/* end confdefs.h. */
26517
26518# include <stdio.h>
26519# include <stdlib.h>
26520
26521int
26522main ()
26523{
26524int result = 0;
26525 if (rename ("conftest.f1", "conftest.f2/") == 0)
26526 result |= 1;
26527 if (rename ("conftest.d1", "conftest.d2/") != 0)
26528 result |= 2;
26529#if HAVE_LSTAT
26530 if (rename ("conftest.f", "conftest.lnk/") == 0)
26531 result |= 4;
26532#endif
26533 return result;
26534
26535 ;
26536 return 0;
26537}
26538_ACEOF
26539if ac_fn_c_try_run "$LINENO"; then :
26540 gl_cv_func_rename_slash_dst_works=yes
26541else
26542 gl_cv_func_rename_slash_dst_works=no
26543fi
26544rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26545 conftest.$ac_objext conftest.beam conftest.$ac_ext
26546fi
26547
26548 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
26549
26550fi
26551{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
26552$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
26553 case "$gl_cv_func_rename_slash_dst_works" in
26554 *yes) ;;
26555 *)
26556 REPLACE_RENAME=1
26557
26558$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
26559
26560 ;;
26561 esac
26562
26563 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
26564$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
d0ac1c44 26565if ${gl_cv_func_rename_slash_src_works+:} false; then :
6a29c58e
YQ
26566 $as_echo_n "(cached) " >&6
26567else
26568 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
26569 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 26570 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26571 # Assume that if we have lstat, we can also check symlinks.
26572 if test $ac_cv_func_lstat = yes; then
26573 ln -s conftest.f conftest.lnk
26574 fi
26575 if test "$cross_compiling" = yes; then :
26576 case "$host_os" in
c0c3707f
CB
26577 # Guess yes on Linux systems.
26578 linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26579 # Guess yes on glibc systems.
26580 *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26581 # Guess yes on native Windows.
26582 mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26583 # If we don't know, obey --enable-cross-guesses.
26584 *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26585 esac
26586
26587else
26588 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26589/* end confdefs.h. */
26590
26591# include <stdio.h>
26592# include <stdlib.h>
26593
26594int
26595main ()
26596{
26597int result = 0;
26598 if (rename ("conftest.f1/", "conftest.d3") == 0)
26599 result |= 1;
26600 if (rename ("conftest.d1/", "conftest.d2") != 0)
26601 result |= 2;
26602#if HAVE_LSTAT
26603 if (rename ("conftest.lnk/", "conftest.f") == 0)
26604 result |= 4;
26605#endif
26606 return result;
26607
26608 ;
26609 return 0;
26610}
26611_ACEOF
26612if ac_fn_c_try_run "$LINENO"; then :
26613 gl_cv_func_rename_slash_src_works=yes
26614else
26615 gl_cv_func_rename_slash_src_works=no
26616fi
26617rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26618 conftest.$ac_objext conftest.beam conftest.$ac_ext
26619fi
26620
26621 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
26622
26623fi
26624{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
26625$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
26626 case "$gl_cv_func_rename_slash_src_works" in
26627 *yes) ;;
26628 *)
26629 REPLACE_RENAME=1
26630
26631$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
26632
26633 ;;
26634 esac
26635
26636
26637 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
26638$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
d0ac1c44 26639if ${gl_cv_func_rename_link_works+:} false; then :
6a29c58e
YQ
26640 $as_echo_n "(cached) " >&6
26641else
26642 if test $ac_cv_func_link = yes; then
c0c3707f
CB
26643 if test $cross_compiling != yes; then
26644 rm -rf conftest.f conftest.f1 conftest.f2
26645 if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
26646 set x `ls -i conftest.f conftest.f1` && test "" = ""; then
26647 if test "$cross_compiling" = yes; then :
26648 :
6a29c58e
YQ
26649
26650else
26651 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26652/* end confdefs.h. */
26653
c0c3707f
CB
26654# include <errno.h>
26655# include <stdio.h>
26656# include <stdlib.h>
26657# include <unistd.h>
6a29c58e 26658
9c9d63b1
PM
26659
26660$gl_mda_defines
26661
6a29c58e
YQ
26662int
26663main ()
26664{
26665int result = 0;
c0c3707f
CB
26666 if (rename ("conftest.f", "conftest.f1"))
26667 result |= 1;
26668 if (unlink ("conftest.f1"))
26669 result |= 2;
26670
26671 /* Allow either the POSIX-required behavior, where the
26672 previous rename kept conftest.f, or the (better) NetBSD
26673 behavior, where it removed conftest.f. */
26674 if (rename ("conftest.f", "conftest.f") != 0
26675 && errno != ENOENT)
26676 result |= 4;
26677
26678 if (rename ("conftest.f1", "conftest.f1") == 0)
26679 result |= 8;
26680 if (rename ("conftest.f2", "conftest.f2") != 0)
26681 result |= 16;
26682 return result;
6a29c58e
YQ
26683
26684 ;
26685 return 0;
26686}
26687_ACEOF
26688if ac_fn_c_try_run "$LINENO"; then :
26689 gl_cv_func_rename_link_works=yes
26690else
26691 gl_cv_func_rename_link_works=no
26692fi
26693rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26694 conftest.$ac_objext conftest.beam conftest.$ac_ext
26695fi
26696
c0c3707f
CB
26697 else
26698 gl_cv_func_rename_link_works="guessing no"
26699 fi
26700 rm -rf conftest.f conftest.f1 conftest.f2
6a29c58e 26701 else
c0c3707f
CB
26702 case "$host_os" in
26703 # Guess yes on Linux systems.
26704 linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
26705 # Guess yes on glibc systems.
26706 *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
26707 # Guess yes on native Windows.
26708 mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
26709 # If we don't know, obey --enable-cross-guesses.
26710 *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
26711 esac
6a29c58e 26712 fi
6a29c58e
YQ
26713 else
26714 gl_cv_func_rename_link_works=yes
26715 fi
26716
26717fi
26718{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
26719$as_echo "$gl_cv_func_rename_link_works" >&6; }
26720 case "$gl_cv_func_rename_link_works" in
26721 *yes) ;;
26722 *)
26723 REPLACE_RENAME=1
26724
26725$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
26726
26727 ;;
26728 esac
26729
26730 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
26731$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
d0ac1c44 26732if ${gl_cv_func_rename_dest_works+:} false; then :
6a29c58e
YQ
26733 $as_echo_n "(cached) " >&6
26734else
26735 rm -rf conftest.f conftest.d1 conftest.d2
26736 touch conftest.f && mkdir conftest.d1 conftest.d2 ||
d0ac1c44 26737 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26738 if test "$cross_compiling" = yes; then :
26739 case "$host_os" in
c0c3707f
CB
26740 # Guess yes on Linux systems.
26741 linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
26742 # Guess yes on glibc systems.
26743 *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
26744 # Guess no on native Windows.
26745 mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
26746 # If we don't know, obey --enable-cross-guesses.
26747 *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26748 esac
26749
26750else
26751 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26752/* end confdefs.h. */
26753
26754# include <stdio.h>
26755# include <stdlib.h>
26756
26757int
26758main ()
26759{
26760int result = 0;
26761 if (rename ("conftest.d1", "conftest.d2") != 0)
26762 result |= 1;
26763 if (rename ("conftest.d2", "conftest.f") == 0)
26764 result |= 2;
26765 return result;
26766
26767 ;
26768 return 0;
26769}
26770_ACEOF
26771if ac_fn_c_try_run "$LINENO"; then :
26772 gl_cv_func_rename_dest_works=yes
26773else
26774 gl_cv_func_rename_dest_works=no
26775fi
26776rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26777 conftest.$ac_objext conftest.beam conftest.$ac_ext
26778fi
26779
26780 rm -rf conftest.f conftest.d1 conftest.d2
26781
26782fi
26783{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
26784$as_echo "$gl_cv_func_rename_dest_works" >&6; }
26785 case "$gl_cv_func_rename_dest_works" in
26786 *yes) ;;
26787 *)
26788 REPLACE_RENAME=1
26789
26790$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
26791
26792 ;;
26793 esac
26794
26795 if test $REPLACE_RENAME = 1; then
26796
26797
26798
26799
26800
26801
26802
26803
26804 gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext"
26805
26806 fi
26807
26808
26809
26810
26811
26812 GNULIB_RENAME=1
26813
26814
26815
26816
26817
26818$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
26819
26820
26821
26822
26823
26824
6ec2e0f5
SDJ
26825 for ac_func in rewinddir
26826do :
26827 ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
d0ac1c44 26828if test "x$ac_cv_func_rewinddir" = xyes; then :
6ec2e0f5
SDJ
26829 cat >>confdefs.h <<_ACEOF
26830#define HAVE_REWINDDIR 1
26831_ACEOF
26832
26833fi
26834done
26835
26836 if test $ac_cv_func_rewinddir = no; then
26837 HAVE_REWINDDIR=0
26838 fi
26839
26840 if test $HAVE_REWINDDIR = 0; then
26841
26842
26843
26844
26845
26846
26847
26848
26849 gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext"
26850
26851 fi
26852
26853
26854
26855
26856
26857 GNULIB_REWINDDIR=1
26858
26859
26860
26861
26862
26863$as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
26864
26865
26866
26867
26868
26869
6a29c58e
YQ
26870 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
26871$as_echo_n "checking whether rmdir works... " >&6; }
d0ac1c44 26872if ${gl_cv_func_rmdir_works+:} false; then :
6a29c58e
YQ
26873 $as_echo_n "(cached) " >&6
26874else
26875 mkdir conftest.dir
26876 touch conftest.file
26877 if test "$cross_compiling" = yes; then :
26878 case "$host_os" in
c0c3707f
CB
26879 # Guess yes on Linux systems.
26880 linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
26881 # Guess yes on glibc systems.
26882 *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
26883 # Guess no on native Windows.
26884 mingw*) gl_cv_func_rmdir_works="guessing no" ;;
26885 # If we don't know, obey --enable-cross-guesses.
26886 *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26887 esac
26888
26889else
26890 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26891/* end confdefs.h. */
26892#include <stdio.h>
26893 #include <errno.h>
26894 #if HAVE_UNISTD_H
26895 # include <unistd.h>
26896 #else /* on Windows with MSVC */
26897 # include <direct.h>
26898 #endif
26899
9c9d63b1
PM
26900
26901$gl_mda_defines
26902
6a29c58e
YQ
26903int
26904main ()
26905{
26906int result = 0;
9c9d63b1
PM
26907 if (!rmdir ("conftest.file/"))
26908 result |= 1;
26909 else if (errno != ENOTDIR)
26910 result |= 2;
26911 if (!rmdir ("conftest.dir/./"))
26912 result |= 4;
26913 return result;
6a29c58e
YQ
26914
26915 ;
26916 return 0;
26917}
26918_ACEOF
26919if ac_fn_c_try_run "$LINENO"; then :
26920 gl_cv_func_rmdir_works=yes
26921else
26922 gl_cv_func_rmdir_works=no
26923fi
26924rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26925 conftest.$ac_objext conftest.beam conftest.$ac_ext
26926fi
26927
26928 rm -rf conftest.dir conftest.file
26929fi
26930{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
26931$as_echo "$gl_cv_func_rmdir_works" >&6; }
26932 case "$gl_cv_func_rmdir_works" in
26933 *yes) ;;
26934 *)
26935 REPLACE_RMDIR=1
26936 ;;
26937 esac
26938
26939 if test $REPLACE_RMDIR = 1; then
26940
26941
26942
26943
26944
26945
26946
26947
26948 gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
26949
26950 fi
26951
26952
26953
26954
26955
26956 GNULIB_RMDIR=1
26957
26958
26959
26960
26961
26962$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
26963
26964
26965
26966
0750520d 26967
5e8754f9
SDJ
26968
26969
26970
3d99e817
AK
26971 if test $ac_cv_func_setenv = no; then
26972 HAVE_SETENV=0
26973 else
26974 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
26975$as_echo_n "checking whether setenv validates arguments... " >&6; }
d0ac1c44 26976if ${gl_cv_func_setenv_works+:} false; then :
3d99e817
AK
26977 $as_echo_n "(cached) " >&6
26978else
26979 if test "$cross_compiling" = yes; then :
26980 case "$host_os" in
c0c3707f
CB
26981 # Guess yes on glibc systems.
26982 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
26983 # Guess yes on musl systems.
26984 *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
26985 # If we don't know, obey --enable-cross-guesses.
26986 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
26987 esac
26988
26989else
26990 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26991/* end confdefs.h. */
26992
26993 #include <stdlib.h>
26994 #include <errno.h>
26995 #include <string.h>
26996
26997int
26998main ()
26999{
27000
27001 int result = 0;
27002 {
27003 if (setenv ("", "", 0) != -1)
27004 result |= 1;
27005 else if (errno != EINVAL)
27006 result |= 2;
27007 }
27008 {
27009 if (setenv ("a", "=", 1) != 0)
27010 result |= 4;
27011 else if (strcmp (getenv ("a"), "=") != 0)
27012 result |= 8;
27013 }
27014 return result;
27015
27016 ;
27017 return 0;
27018}
27019_ACEOF
27020if ac_fn_c_try_run "$LINENO"; then :
27021 gl_cv_func_setenv_works=yes
27022else
27023 gl_cv_func_setenv_works=no
27024fi
27025rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27026 conftest.$ac_objext conftest.beam conftest.$ac_ext
27027fi
27028
27029fi
27030{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
27031$as_echo "$gl_cv_func_setenv_works" >&6; }
27032 case "$gl_cv_func_setenv_works" in
27033 *yes) ;;
27034 *)
27035 REPLACE_SETENV=1
27036 ;;
27037 esac
27038 fi
27039
27040 if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
27041
27042
27043
27044
27045
27046
27047
27048
27049 gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
27050
27051 fi
27052
27053
27054
27055
27056
27057 GNULIB_SETENV=1
27058
27059
27060
27061
27062
27063$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
27064
27065
27066
27067
27068
0750520d
PA
27069
27070
27071
5df4cba6
SM
27072 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
27073$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
27074if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
27075 $as_echo_n "(cached) " >&6
27076else
27077 case "$host_os" in
27078 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
27079 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
27080 gl_cv_func_setlocale_null_all_mtsafe=no ;;
27081 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
27082 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
27083 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
27084 # If we don't know, obey --enable-cross-guesses.
27085 *)
27086 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
27087 esac
27088
27089fi
27090{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
27091$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
27092 case "$host_os" in
27093 mingw*) ;;
27094 *)
27095 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
27096 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
27097 fi
27098 ;;
27099 esac
27100 case "$gl_cv_func_setlocale_null_all_mtsafe" in
27101 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
27102 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
27103 esac
27104
27105cat >>confdefs.h <<_ACEOF
27106#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
27107_ACEOF
27108
27109
27110 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
27111$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
27112if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
27113 $as_echo_n "(cached) " >&6
27114else
27115 case "$host_os" in
27116 # Guess no on OpenBSD, AIX.
27117 openbsd* | aix*)
27118 gl_cv_func_setlocale_null_one_mtsafe=no ;;
27119 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
27120 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
27121 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
27122 # If we don't know, obey --enable-cross-guesses.
27123 *)
27124 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
27125 esac
27126
27127fi
27128{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
27129$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
27130 case "$host_os" in
27131 mingw*) ;;
27132 *)
27133 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
27134 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
27135 fi
27136 ;;
27137 esac
27138 case "$gl_cv_func_setlocale_null_one_mtsafe" in
27139 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
27140 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
27141 esac
27142
27143cat >>confdefs.h <<_ACEOF
27144#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
27145_ACEOF
27146
27147
27148 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
27149 case "$host_os" in
27150 mingw*) LIB_SETLOCALE_NULL= ;;
27151 *)
27152
27153
27154 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
27155$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
27156if ${gl_cv_have_weak+:} false; then :
27157 $as_echo_n "(cached) " >&6
27158else
27159 gl_cv_have_weak=no
27160 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27161/* end confdefs.h. */
27162extern void xyzzy ();
27163#pragma weak xyzzy
27164int
27165main ()
27166{
27167xyzzy();
27168 ;
27169 return 0;
27170}
27171_ACEOF
27172if ac_fn_c_try_link "$LINENO"; then :
27173 gl_cv_have_weak=maybe
27174fi
27175rm -f core conftest.err conftest.$ac_objext \
27176 conftest$ac_exeext conftest.$ac_ext
27177 if test $gl_cv_have_weak = maybe; then
27178 if test "$cross_compiling" = yes; then :
27179 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27180/* end confdefs.h. */
27181#ifdef __ELF__
27182 Extensible Linking Format
27183 #endif
27184
27185_ACEOF
27186if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
27187 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
27188 gl_cv_have_weak="guessing yes"
27189else
27190 gl_cv_have_weak="guessing no"
27191fi
27192rm -f conftest*
27193
27194
27195else
27196 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27197/* end confdefs.h. */
27198
27199#include <stdio.h>
27200#pragma weak fputs
27201int main ()
27202{
27203 return (fputs == NULL);
27204}
27205_ACEOF
27206if ac_fn_c_try_run "$LINENO"; then :
27207 gl_cv_have_weak=yes
27208else
27209 gl_cv_have_weak=no
27210fi
27211rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27212 conftest.$ac_objext conftest.beam conftest.$ac_ext
27213fi
27214
27215 fi
27216 case " $LDFLAGS " in
27217 *" -static "*) gl_cv_have_weak=no ;;
27218 esac
27219 case "$gl_cv_have_weak" in
27220 *yes)
27221 case "$host_os" in
27222 freebsd* | dragonfly*)
27223 : > conftest1.c
27224 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
27225 cat <<EOF > conftest2.c
27226#include <pthread.h>
27227#pragma weak pthread_mutexattr_gettype
27228int main ()
27229{
27230 return (pthread_mutexattr_gettype != NULL);
27231}
27232EOF
27233 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
27234 || gl_cv_have_weak=no
27235 rm -f conftest1.c libempty.so conftest2.c conftest
27236 ;;
27237 esac
27238 ;;
27239 esac
27240
27241fi
27242{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
27243$as_echo "$gl_cv_have_weak" >&6; }
27244 case "$gl_cv_have_weak" in
27245 *yes)
27246
27247$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
27248
27249 ;;
27250 esac
27251
27252 case "$gl_cv_have_weak" in
27253 *yes) LIB_SETLOCALE_NULL= ;;
27254 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
27255 esac
27256 ;;
27257 esac
27258 else
27259 LIB_SETLOCALE_NULL=
27260 fi
27261
27262
27263 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
27264
27265
27266
27267
27268
27269
27270
27271
27272 gl_LIBOBJS="$gl_LIBOBJS setlocale-lock.$ac_objext"
27273
27274
27275
27276
27277 CFLAG_VISIBILITY=
27278 HAVE_VISIBILITY=0
27279 if test -n "$GCC"; then
27280 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
27281$as_echo_n "checking whether the -Werror option is usable... " >&6; }
27282if ${gl_cv_cc_vis_werror+:} false; then :
27283 $as_echo_n "(cached) " >&6
27284else
27285 gl_save_CFLAGS="$CFLAGS"
27286 CFLAGS="$CFLAGS -Werror"
27287 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27288/* end confdefs.h. */
27289
27290int
27291main ()
27292{
27293
27294 ;
27295 return 0;
27296}
27297_ACEOF
27298if ac_fn_c_try_compile "$LINENO"; then :
27299 gl_cv_cc_vis_werror=yes
27300else
27301 gl_cv_cc_vis_werror=no
27302fi
27303rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27304 CFLAGS="$gl_save_CFLAGS"
27305
27306fi
27307{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
27308$as_echo "$gl_cv_cc_vis_werror" >&6; }
27309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
27310$as_echo_n "checking for simple visibility declarations... " >&6; }
27311if ${gl_cv_cc_visibility+:} false; then :
27312 $as_echo_n "(cached) " >&6
27313else
27314 gl_save_CFLAGS="$CFLAGS"
27315 CFLAGS="$CFLAGS -fvisibility=hidden"
27316 if test $gl_cv_cc_vis_werror = yes; then
27317 CFLAGS="$CFLAGS -Werror"
27318 fi
27319 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27320/* end confdefs.h. */
27321extern __attribute__((__visibility__("hidden"))) int hiddenvar;
27322 extern __attribute__((__visibility__("default"))) int exportedvar;
27323 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
27324 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
27325 void dummyfunc (void) {}
27326
27327int
27328main ()
27329{
27330
27331 ;
27332 return 0;
27333}
27334_ACEOF
27335if ac_fn_c_try_compile "$LINENO"; then :
27336 gl_cv_cc_visibility=yes
27337else
27338 gl_cv_cc_visibility=no
27339fi
27340rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27341 CFLAGS="$gl_save_CFLAGS"
27342
27343fi
27344{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
27345$as_echo "$gl_cv_cc_visibility" >&6; }
27346 if test $gl_cv_cc_visibility = yes; then
27347 CFLAG_VISIBILITY="-fvisibility=hidden"
27348 HAVE_VISIBILITY=1
27349 fi
27350 fi
27351
27352
27353
27354cat >>confdefs.h <<_ACEOF
27355#define HAVE_VISIBILITY $HAVE_VISIBILITY
27356_ACEOF
27357
27358
27359
27360 fi
27361
27362
27363
27364
27365
27366 GNULIB_SETLOCALE_NULL=1
27367
27368
27369
27370
27371
27372$as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h
27373
27374
27375
27376
27377
27378
27379
27380
0750520d
PA
27381
27382
27383
27384
27385
27386
27387 if test $gl_cv_have_include_next = yes; then
27388 gl_cv_next_signal_h='<'signal.h'>'
27389 else
27390 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
27391$as_echo_n "checking absolute name of <signal.h>... " >&6; }
d0ac1c44 27392if ${gl_cv_next_signal_h+:} false; then :
0750520d
PA
27393 $as_echo_n "(cached) " >&6
27394else
27395
27396
27397
27398 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27399/* end confdefs.h. */
27400#include <signal.h>
27401_ACEOF
27402 case "$host_os" in
27403 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27404 *) gl_absname_cpp="$ac_cpp" ;;
27405 esac
27406
27407 case "$host_os" in
27408 mingw*)
27409 gl_dirsep_regex='[/\\]'
27410 ;;
27411 *)
27412 gl_dirsep_regex='\/'
27413 ;;
27414 esac
27415 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27416 gl_header_literal_regex=`echo 'signal.h' \
27417 | sed -e "$gl_make_literal_regex_sed"`
27418 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27419 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27420 s|^/[^/]|//&|
27421 p
27422 q
27423 }'
27424
27425 gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27426 sed -n "$gl_absolute_header_sed"`
27427
27428 gl_header=$gl_cv_absolute_signal_h
27429 gl_cv_next_signal_h='"'$gl_header'"'
27430
27431
27432fi
27433{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
27434$as_echo "$gl_cv_next_signal_h" >&6; }
27435 fi
27436 NEXT_SIGNAL_H=$gl_cv_next_signal_h
27437
27438 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27439 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27440 gl_next_as_first_directive='<'signal.h'>'
27441 else
27442 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27443 gl_next_as_first_directive=$gl_cv_next_signal_h
27444 fi
27445 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
27446
27447
27448
27449
27450
27451# AIX declares sig_atomic_t to already include volatile, and C89 compilers
27452# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
27453 ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
27454#include <signal.h>
27455
27456"
d0ac1c44 27457if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
0750520d
PA
27458
27459else
27460 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
27461fi
27462
27463
27464
27465
27466
27467
27468
27469 ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
27470#include <signal.h>
27471
27472"
d0ac1c44 27473if test "x$ac_cv_type_sighandler_t" = xyes; then :
0750520d
PA
27474
27475else
27476 HAVE_SIGHANDLER_T=0
27477fi
27478
27479
27480
0750520d 27481
0750520d
PA
27482
27483
698be2d8
CB
27484
27485
725e2999
JB
27486 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
27487/* <sys/types.h> is not needed according to POSIX, but the
27488 <sys/socket.h> in i386-unknown-freebsd4.10 and
27489 powerpc-apple-darwin5.5 required it. */
27490#include <sys/types.h>
27491#if HAVE_SYS_SOCKET_H
27492# include <sys/socket.h>
27493#elif HAVE_WS2TCPIP_H
27494# include <ws2tcpip.h>
27495#endif
27496
27497"
27498if test "x$ac_cv_type_socklen_t" = xyes; then :
27499
27500else
27501 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
27502$as_echo_n "checking for socklen_t equivalent... " >&6; }
c0c3707f 27503if ${gl_cv_socklen_t_equiv+:} false; then :
725e2999
JB
27504 $as_echo_n "(cached) " >&6
27505else
27506 # Systems have either "struct sockaddr *" or
27507 # "void *" as the second argument to getpeername
27508 gl_cv_socklen_t_equiv=
27509 for arg2 in "struct sockaddr" void; do
27510 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
27511 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27512/* end confdefs.h. */
27513#include <sys/types.h>
27514 #include <sys/socket.h>
27515
27516 int getpeername (int, $arg2 *, $t *);
27517int
27518main ()
27519{
27520$t len;
27521 getpeername (0, 0, &len);
27522 ;
27523 return 0;
27524}
27525_ACEOF
27526if ac_fn_c_try_compile "$LINENO"; then :
27527 gl_cv_socklen_t_equiv="$t"
27528fi
27529rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27530 test "$gl_cv_socklen_t_equiv" != "" && break
27531 done
27532 test "$gl_cv_socklen_t_equiv" != "" && break
27533 done
c0c3707f
CB
27534 if test "$gl_cv_socklen_t_equiv" = ""; then
27535 as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
27536 fi
725e2999
JB
27537
27538fi
c0c3707f 27539{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
725e2999
JB
27540$as_echo "$gl_cv_socklen_t_equiv" >&6; }
27541
27542cat >>confdefs.h <<_ACEOF
27543#define socklen_t $gl_cv_socklen_t_equiv
27544_ACEOF
27545
27546fi
27547
0750520d 27548
63ce7108
TT
27549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
27550$as_echo_n "checking for ssize_t... " >&6; }
d0ac1c44 27551if ${gt_cv_ssize_t+:} false; then :
63ce7108
TT
27552 $as_echo_n "(cached) " >&6
27553else
27554 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27555/* end confdefs.h. */
27556#include <sys/types.h>
27557int
27558main ()
27559{
27560int x = sizeof (ssize_t *) + sizeof (ssize_t);
27561 return !x;
27562 ;
27563 return 0;
27564}
27565_ACEOF
27566if ac_fn_c_try_compile "$LINENO"; then :
27567 gt_cv_ssize_t=yes
27568else
27569 gt_cv_ssize_t=no
27570fi
27571rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27572fi
27573{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
27574$as_echo "$gt_cv_ssize_t" >&6; }
27575 if test $gt_cv_ssize_t = no; then
27576
27577$as_echo "#define ssize_t int" >>confdefs.h
27578
27579 fi
27580
27581
27582
27583
472fa5ee 27584
c0c3707f
CB
27585 case "$host_os" in
27586 mingw*)
d706b69e 27587 ;;
c0c3707f
CB
27588 *)
27589 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
27590$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
27591if ${gl_cv_func_stat_file_slash+:} false; then :
2196f55f
YQ
27592 $as_echo_n "(cached) " >&6
27593else
c0c3707f
CB
27594 touch conftest.tmp
27595 # Assume that if we have lstat, we can also check symlinks.
27596 if test $ac_cv_func_lstat = yes; then
27597 ln -s conftest.tmp conftest.lnk
27598 fi
27599 if test "$cross_compiling" = yes; then :
27600 case "$host_os" in
27601 # Guess yes on Linux systems.
27602 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
27603 # Guess yes on glibc systems.
27604 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
27605 # If we don't know, obey --enable-cross-guesses.
27606 *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
27607 esac
27608
2196f55f
YQ
27609else
27610 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27611/* end confdefs.h. */
27612#include <sys/stat.h>
27613
27614int
27615main ()
27616{
c0c3707f
CB
27617int result = 0;
27618 struct stat st;
27619 if (!stat ("conftest.tmp/", &st))
27620 result |= 1;
27621#if HAVE_LSTAT
27622 if (!stat ("conftest.lnk/", &st))
27623 result |= 2;
27624#endif
27625 return result;
27626
2196f55f
YQ
27627 ;
27628 return 0;
27629}
27630_ACEOF
27631if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 27632 gl_cv_func_stat_file_slash=yes
2196f55f 27633else
c0c3707f 27634 gl_cv_func_stat_file_slash=no
2196f55f
YQ
27635fi
27636rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27637 conftest.$ac_objext conftest.beam conftest.$ac_ext
27638fi
27639
c0c3707f 27640 rm -f conftest.tmp conftest.lnk
2196f55f 27641fi
c0c3707f
CB
27642{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
27643$as_echo "$gl_cv_func_stat_file_slash" >&6; }
27644 case $gl_cv_func_stat_file_slash in
27645 *no)
27646 REPLACE_STAT=1
27647
27648$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
27649;;
27650 esac
27651 case $host_os in
27652 solaris*)
27653 REPLACE_FSTAT=1 ;;
27654 esac
27655 ;;
27656 esac
27657
27658 if test $REPLACE_STAT = 1; then
27659
27660
27661
27662
27663
27664
27665
27666
27667 gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
27668
27669 case "$host_os" in
27670 mingw*)
27671
27672
27673
27674
27675
27676
27677
27678
27679 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
27680
27681 ;;
27682 esac
27683
27684
9c9d63b1 27685
c0c3707f
CB
27686 :
27687
27688 fi
27689
27690
27691
27692
27693
27694 GNULIB_STAT=1
27695
27696
27697
27698
27699
27700$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
27701
27702
27703
27704
7a6dbc2f 27705
c0c3707f
CB
27706
27707
27708 ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
27709 #include <sys/stat.h>
27710"
27711if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
27712
27713cat >>confdefs.h <<_ACEOF
27714#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
27715_ACEOF
27716
27717{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
27718$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
27719if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
27720 $as_echo_n "(cached) " >&6
2196f55f 27721else
5e8754f9
SDJ
27722 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27723/* end confdefs.h. */
c0c3707f
CB
27724
27725 #include <sys/types.h>
27726 #include <sys/stat.h>
27727 #if HAVE_SYS_TIME_H
27728 # include <sys/time.h>
27729 #endif
27730 #include <time.h>
27731 struct timespec ts;
27732 struct stat st;
7a6dbc2f 27733
5e8754f9
SDJ
27734int
27735main ()
27736{
c0c3707f
CB
27737
27738 st.st_atim = ts;
7a6dbc2f 27739
5e8754f9
SDJ
27740 ;
27741 return 0;
27742}
27743_ACEOF
c0c3707f
CB
27744if ac_fn_c_try_compile "$LINENO"; then :
27745 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
5e8754f9 27746else
c0c3707f 27747 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
2196f55f 27748fi
c0c3707f 27749rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2196f55f 27750fi
c0c3707f
CB
27751{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
27752$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
27753 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
2196f55f 27754
c0c3707f 27755$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
2196f55f 27756
c0c3707f
CB
27757 fi
27758else
27759 ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
27760 #include <sys/stat.h>
27761"
27762if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
2196f55f 27763
c0c3707f
CB
27764cat >>confdefs.h <<_ACEOF
27765#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
27766_ACEOF
2196f55f 27767
c0c3707f
CB
27768
27769else
27770 ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
27771 #include <sys/stat.h>
27772"
27773if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
27774
27775cat >>confdefs.h <<_ACEOF
27776#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
27777_ACEOF
2196f55f
YQ
27778
27779
c0c3707f
CB
27780else
27781 ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
27782 #include <sys/stat.h>
27783"
27784if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
2196f55f 27785
c0c3707f
CB
27786cat >>confdefs.h <<_ACEOF
27787#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
27788_ACEOF
2196f55f
YQ
27789
27790
c0c3707f 27791fi
2196f55f 27792
c0c3707f 27793fi
2196f55f 27794
c0c3707f 27795fi
2196f55f 27796
c0c3707f 27797fi
2196f55f
YQ
27798
27799
27800
27801
27802
c0c3707f
CB
27803 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
27804 #include <sys/stat.h>
27805"
27806if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
2196f55f 27807
c0c3707f
CB
27808cat >>confdefs.h <<_ACEOF
27809#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
27810_ACEOF
2196f55f
YQ
27811
27812
c0c3707f
CB
27813else
27814 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
27815 #include <sys/stat.h>
27816"
27817if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
2196f55f 27818
c0c3707f
CB
27819cat >>confdefs.h <<_ACEOF
27820#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
27821_ACEOF
2196f55f 27822
2196f55f 27823
c0c3707f
CB
27824else
27825 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h>
27826 #include <sys/stat.h>
27827"
27828if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
27829
27830cat >>confdefs.h <<_ACEOF
27831#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
27832_ACEOF
27833
27834
27835fi
27836
27837fi
5e8754f9 27838
c0c3707f 27839fi
2196f55f
YQ
27840
27841
27842
725e2999
JB
27843 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
27844$as_echo_n "checking for working stdalign.h... " >&6; }
27845if ${gl_cv_header_working_stdalign_h+:} false; then :
27846 $as_echo_n "(cached) " >&6
27847else
27848 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27849/* end confdefs.h. */
27850#include <stdalign.h>
27851 #include <stddef.h>
27852
27853 /* Test that alignof yields a result consistent with offsetof.
27854 This catches GCC bug 52023
c0c3707f 27855 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
725e2999
JB
27856 #ifdef __cplusplus
27857 template <class t> struct alignof_helper { char a; t b; };
27858 # define ao(type) offsetof (alignof_helper<type>, b)
27859 #else
27860 # define ao(type) offsetof (struct { char a; type b; }, b)
27861 #endif
27862 char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
27863 char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
27864 char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
27865
27866 /* Test _Alignas only on platforms where gnulib can help. */
27867 #if \
27868 ((defined __cplusplus && 201103 <= __cplusplus) \
27869 || (defined __APPLE__ && defined __MACH__ \
27870 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
27871 : __GNUC__) \
c0c3707f
CB
27872 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
27873 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
725e2999
JB
27874 || 1300 <= _MSC_VER)
27875 struct alignas_test { char c; char alignas (8) alignas_8; };
27876 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
27877 ? 1 : -1];
27878 #endif
27879
27880int
27881main ()
27882{
27883
27884 ;
27885 return 0;
27886}
27887_ACEOF
27888if ac_fn_c_try_compile "$LINENO"; then :
27889 gl_cv_header_working_stdalign_h=yes
27890else
27891 gl_cv_header_working_stdalign_h=no
27892fi
27893rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27894fi
27895{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
27896$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
27897
27898 if test $gl_cv_header_working_stdalign_h = yes; then
27899 STDALIGN_H=''
27900 else
27901 STDALIGN_H='stdalign.h'
27902 fi
27903
27904
27905 if test -n "$STDALIGN_H"; then
27906 GL_GENERATE_STDALIGN_H_TRUE=
27907 GL_GENERATE_STDALIGN_H_FALSE='#'
27908else
27909 GL_GENERATE_STDALIGN_H_TRUE='#'
27910 GL_GENERATE_STDALIGN_H_FALSE=
27911fi
27912
27913
27914
2196f55f
YQ
27915
27916
63ce7108 27917
c0c3707f
CB
27918 if test "$ac_cv_header_stdbool_h" = yes; then
27919 case "$host_os" in
27920 solaris*)
27921 if test -z "$GCC"; then
27922 STDBOOL_H='stdbool.h'
27923 else
27924 STDBOOL_H=''
27925 fi
27926 ;;
27927 *)
27928 STDBOOL_H=''
27929 ;;
27930 esac
63ce7108
TT
27931 else
27932 STDBOOL_H='stdbool.h'
27933 fi
27934
27935 if test -n "$STDBOOL_H"; then
27936 GL_GENERATE_STDBOOL_H_TRUE=
27937 GL_GENERATE_STDBOOL_H_FALSE='#'
27938else
27939 GL_GENERATE_STDBOOL_H_TRUE='#'
27940 GL_GENERATE_STDBOOL_H_FALSE=
27941fi
27942
27943
27944 if test "$ac_cv_type__Bool" = yes; then
27945 HAVE__BOOL=1
27946 else
27947 HAVE__BOOL=0
27948 fi
27949
27950
27951
27952
27953
9c9d63b1
PM
27954
27955
27956
63ce7108 27957 STDDEF_H=
4a626d0a 27958
c0c3707f
CB
27959 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
27960$as_echo_n "checking for good max_align_t... " >&6; }
27961if ${gl_cv_type_max_align_t+:} false; then :
27962 $as_echo_n "(cached) " >&6
27963else
27964 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27965/* end confdefs.h. */
27966#include <stddef.h>
27967 unsigned int s = sizeof (max_align_t);
9c9d63b1 27968 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
c0c3707f
CB
27969 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
27970 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
27971 #endif
9c9d63b1
PM
27972 typedef struct { char a; max_align_t b; } max_helper;
27973 typedef struct { char a; long b; } long_helper;
27974 typedef struct { char a; double b; } double_helper;
27975 typedef struct { char a; long double b; } long_double_helper;
27976 int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
27977 int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
27978 int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
c0c3707f
CB
27979
27980int
27981main ()
27982{
4a626d0a 27983
c0c3707f
CB
27984 ;
27985 return 0;
27986}
27987_ACEOF
27988if ac_fn_c_try_compile "$LINENO"; then :
27989 gl_cv_type_max_align_t=yes
4a626d0a 27990else
c0c3707f 27991 gl_cv_type_max_align_t=no
4a626d0a 27992fi
c0c3707f
CB
27993rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27994
27995fi
27996{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
27997$as_echo "$gl_cv_type_max_align_t" >&6; }
27998 if test $gl_cv_type_max_align_t = no; then
27999 HAVE_MAX_ALIGN_T=0
28000 STDDEF_H=stddef.h
28001 fi
4a626d0a 28002
63ce7108
TT
28003 if test $gt_cv_c_wchar_t = no; then
28004 HAVE_WCHAR_T=0
28005 STDDEF_H=stddef.h
28006 fi
c0c3707f 28007
63ce7108
TT
28008 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
28009$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
d0ac1c44 28010if ${gl_cv_decl_null_works+:} false; then :
63ce7108
TT
28011 $as_echo_n "(cached) " >&6
28012else
28013 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28014/* end confdefs.h. */
28015#include <stddef.h>
28016 int test[2 * (sizeof NULL == sizeof (void *)) -1];
28017
28018int
28019main ()
28020{
28021
28022 ;
28023 return 0;
28024}
28025_ACEOF
28026if ac_fn_c_try_compile "$LINENO"; then :
28027 gl_cv_decl_null_works=yes
28028else
28029 gl_cv_decl_null_works=no
28030fi
28031rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28032fi
28033{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
28034$as_echo "$gl_cv_decl_null_works" >&6; }
28035 if test $gl_cv_decl_null_works = no; then
28036 REPLACE_NULL=1
28037 STDDEF_H=stddef.h
28038 fi
28039
c0c3707f 28040
63ce7108
TT
28041 if test -n "$STDDEF_H"; then
28042 GL_GENERATE_STDDEF_H_TRUE=
28043 GL_GENERATE_STDDEF_H_FALSE='#'
28044else
28045 GL_GENERATE_STDDEF_H_TRUE='#'
28046 GL_GENERATE_STDDEF_H_FALSE=
28047fi
28048
28049 if test -n "$STDDEF_H"; then
28050
28051
28052
28053
28054
28055
28056
28057
28058 if test $gl_cv_have_include_next = yes; then
28059 gl_cv_next_stddef_h='<'stddef.h'>'
28060 else
28061 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
28062$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
d0ac1c44 28063if ${gl_cv_next_stddef_h+:} false; then :
63ce7108
TT
28064 $as_echo_n "(cached) " >&6
28065else
28066
4a626d0a
PA
28067
28068
28069 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63ce7108
TT
28070/* end confdefs.h. */
28071#include <stddef.h>
63ce7108 28072_ACEOF
4a626d0a
PA
28073 case "$host_os" in
28074 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28075 *) gl_absname_cpp="$ac_cpp" ;;
28076 esac
63ce7108 28077
4a626d0a
PA
28078 case "$host_os" in
28079 mingw*)
28080 gl_dirsep_regex='[/\\]'
28081 ;;
28082 *)
28083 gl_dirsep_regex='\/'
28084 ;;
28085 esac
28086 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28087 gl_header_literal_regex=`echo 'stddef.h' \
28088 | sed -e "$gl_make_literal_regex_sed"`
28089 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28090 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28091 s|^/[^/]|//&|
28092 p
28093 q
28094 }'
63ce7108 28095
4a626d0a
PA
28096 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28097 sed -n "$gl_absolute_header_sed"`
28098
28099 gl_header=$gl_cv_absolute_stddef_h
28100 gl_cv_next_stddef_h='"'$gl_header'"'
63ce7108
TT
28101
28102
28103fi
28104{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
28105$as_echo "$gl_cv_next_stddef_h" >&6; }
28106 fi
28107 NEXT_STDDEF_H=$gl_cv_next_stddef_h
28108
28109 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28110 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28111 gl_next_as_first_directive='<'stddef.h'>'
28112 else
28113 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28114 gl_next_as_first_directive=$gl_cv_next_stddef_h
28115 fi
28116 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
28117
28118
28119
28120
28121 fi
28122
28123
28124
28125
49e4877c 28126 $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
63ce7108
TT
28127
28128
28129
98399780
YQ
28130
28131
28132
28133
28134
4a626d0a
PA
28135
28136
6a29c58e
YQ
28137 if test $gl_cv_have_include_next = yes; then
28138 gl_cv_next_stdio_h='<'stdio.h'>'
28139 else
28140 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
28141$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
d0ac1c44 28142if ${gl_cv_next_stdio_h+:} false; then :
6a29c58e
YQ
28143 $as_echo_n "(cached) " >&6
28144else
28145
4a626d0a
PA
28146
28147
28148 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6a29c58e
YQ
28149/* end confdefs.h. */
28150#include <stdio.h>
6a29c58e 28151_ACEOF
4a626d0a
PA
28152 case "$host_os" in
28153 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28154 *) gl_absname_cpp="$ac_cpp" ;;
28155 esac
28156
28157 case "$host_os" in
28158 mingw*)
28159 gl_dirsep_regex='[/\\]'
28160 ;;
28161 *)
28162 gl_dirsep_regex='\/'
28163 ;;
28164 esac
28165 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28166 gl_header_literal_regex=`echo 'stdio.h' \
28167 | sed -e "$gl_make_literal_regex_sed"`
28168 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28169 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28170 s|^/[^/]|//&|
28171 p
28172 q
28173 }'
6a29c58e 28174
4a626d0a
PA
28175 gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28176 sed -n "$gl_absolute_header_sed"`
6a29c58e 28177
4a626d0a
PA
28178 gl_header=$gl_cv_absolute_stdio_h
28179 gl_cv_next_stdio_h='"'$gl_header'"'
6a29c58e
YQ
28180
28181
28182fi
28183{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
28184$as_echo "$gl_cv_next_stdio_h" >&6; }
28185 fi
28186 NEXT_STDIO_H=$gl_cv_next_stdio_h
28187
28188 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28189 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28190 gl_next_as_first_directive='<'stdio.h'>'
28191 else
28192 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28193 gl_next_as_first_directive=$gl_cv_next_stdio_h
28194 fi
28195 NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
28196
28197
28198
28199
28200
4a626d0a
PA
28201 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
28202$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
d0ac1c44 28203if ${gl_cv_func_printf_attribute_flavor+:} false; then :
4a626d0a
PA
28204 $as_echo_n "(cached) " >&6
28205else
28206 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28207/* end confdefs.h. */
28208
28209 #define __STDC_FORMAT_MACROS 1
28210 #include <stdio.h>
28211 #include <inttypes.h>
28212 /* For non-mingw systems, compilation will trivially succeed.
28213 For mingw, compilation will succeed for older mingw (system
28214 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
c0c3707f 28215 #if (defined _WIN32 && ! defined __CYGWIN__) && \
4a626d0a
PA
28216 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
28217 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
28218 #endif
28219
28220int
28221main ()
28222{
28223
28224 ;
28225 return 0;
28226}
28227_ACEOF
28228if ac_fn_c_try_compile "$LINENO"; then :
28229 gl_cv_func_printf_attribute_flavor=system
28230else
28231 gl_cv_func_printf_attribute_flavor=gnu
28232fi
28233rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28234fi
28235{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
28236$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
28237 if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
28238
28239$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
28240
28241 fi
28242
6a29c58e
YQ
28243 GNULIB_FSCANF=1
28244
28245
28246cat >>confdefs.h <<_ACEOF
28247#define GNULIB_FSCANF 1
28248_ACEOF
28249
28250
28251 GNULIB_SCANF=1
28252
28253
28254cat >>confdefs.h <<_ACEOF
28255#define GNULIB_SCANF 1
28256_ACEOF
28257
28258
28259 GNULIB_FGETC=1
28260 GNULIB_GETC=1
28261 GNULIB_GETCHAR=1
28262 GNULIB_FGETS=1
28263 GNULIB_FREAD=1
28264
28265
28266 GNULIB_FPRINTF=1
28267 GNULIB_PRINTF=1
28268 GNULIB_VFPRINTF=1
28269 GNULIB_VPRINTF=1
28270 GNULIB_FPUTC=1
28271 GNULIB_PUTC=1
28272 GNULIB_PUTCHAR=1
28273 GNULIB_FPUTS=1
28274 GNULIB_PUTS=1
28275 GNULIB_FWRITE=1
28276
28277
28278
28279
6a29c58e 28280
6a29c58e
YQ
28281
28282
28283
28284
28285
9c9d63b1
PM
28286 if test $ac_cv_have_decl_fcloseall = no; then
28287 HAVE_DECL_FCLOSEALL=0
28288 fi
28289
28290
6a29c58e
YQ
28291
28292
28293
28294
28295
28296
28297
698be2d8
CB
28298
28299
98399780
YQ
28300 if test $gl_cv_have_include_next = yes; then
28301 gl_cv_next_stdlib_h='<'stdlib.h'>'
28302 else
28303 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
28304$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
d0ac1c44 28305if ${gl_cv_next_stdlib_h+:} false; then :
98399780
YQ
28306 $as_echo_n "(cached) " >&6
28307else
28308
4a626d0a
PA
28309
28310
28311 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98399780
YQ
28312/* end confdefs.h. */
28313#include <stdlib.h>
98399780 28314_ACEOF
4a626d0a
PA
28315 case "$host_os" in
28316 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28317 *) gl_absname_cpp="$ac_cpp" ;;
28318 esac
28319
28320 case "$host_os" in
28321 mingw*)
28322 gl_dirsep_regex='[/\\]'
28323 ;;
28324 *)
28325 gl_dirsep_regex='\/'
28326 ;;
28327 esac
28328 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28329 gl_header_literal_regex=`echo 'stdlib.h' \
28330 | sed -e "$gl_make_literal_regex_sed"`
28331 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28332 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28333 s|^/[^/]|//&|
28334 p
28335 q
28336 }'
98399780 28337
4a626d0a
PA
28338 gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28339 sed -n "$gl_absolute_header_sed"`
98399780 28340
4a626d0a
PA
28341 gl_header=$gl_cv_absolute_stdlib_h
28342 gl_cv_next_stdlib_h='"'$gl_header'"'
98399780
YQ
28343
28344
28345fi
28346{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
28347$as_echo "$gl_cv_next_stdlib_h" >&6; }
28348 fi
28349 NEXT_STDLIB_H=$gl_cv_next_stdlib_h
28350
28351 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28352 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28353 gl_next_as_first_directive='<'stdlib.h'>'
28354 else
28355 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28356 gl_next_as_first_directive=$gl_cv_next_stdlib_h
28357 fi
28358 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
28359
28360
28361
28362
28363
28364
98399780 28365
98399780
YQ
28366
28367
28368
28369
28370
9c9d63b1
PM
28371 if test $ac_cv_have_decl_ecvt = no; then
28372 HAVE_DECL_ECVT=0
28373 fi
28374
28375 if test $ac_cv_have_decl_fcvt = no; then
28376 HAVE_DECL_FCVT=0
28377 fi
28378
28379 if test $ac_cv_have_decl_gcvt = no; then
28380 HAVE_DECL_GCVT=0
28381 fi
28382
28383
98399780 28384
698be2d8
CB
28385
28386
8424cc97
SM
28387 for ac_func in strchrnul
28388do :
28389 ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
d0ac1c44 28390if test "x$ac_cv_func_strchrnul" = xyes; then :
8424cc97
SM
28391 cat >>confdefs.h <<_ACEOF
28392#define HAVE_STRCHRNUL 1
28393_ACEOF
28394
28395fi
28396done
28397
28398 if test $ac_cv_func_strchrnul = no; then
28399 HAVE_STRCHRNUL=0
28400 else
28401 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
28402$as_echo_n "checking whether strchrnul works... " >&6; }
d0ac1c44 28403if ${gl_cv_func_strchrnul_works+:} false; then :
8424cc97
SM
28404 $as_echo_n "(cached) " >&6
28405else
28406 if test "$cross_compiling" = yes; then :
28407 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28408/* end confdefs.h. */
28409
28410#if defined __CYGWIN__
28411 #include <cygwin/version.h>
28412 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
28413 Lucky user
28414 #endif
28415#else
28416 Lucky user
28417#endif
28418
28419_ACEOF
28420if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28421 $EGREP "Lucky user" >/dev/null 2>&1; then :
28422 gl_cv_func_strchrnul_works="guessing yes"
28423else
28424 gl_cv_func_strchrnul_works="guessing no"
28425fi
28426rm -f conftest*
28427
28428
28429else
28430 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28431/* end confdefs.h. */
28432
28433#include <string.h> /* for strchrnul */
28434
28435int
28436main ()
28437{
28438const char *buf = "a";
28439 return strchrnul (buf, 'b') != buf + 1;
28440
28441 ;
28442 return 0;
28443}
28444_ACEOF
28445if ac_fn_c_try_run "$LINENO"; then :
28446 gl_cv_func_strchrnul_works=yes
28447else
28448 gl_cv_func_strchrnul_works=no
28449fi
28450rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28451 conftest.$ac_objext conftest.beam conftest.$ac_ext
28452fi
28453
28454
28455fi
28456{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
28457$as_echo "$gl_cv_func_strchrnul_works" >&6; }
28458 case "$gl_cv_func_strchrnul_works" in
28459 *yes) ;;
28460 *) REPLACE_STRCHRNUL=1 ;;
28461 esac
28462 fi
28463
28464 if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
28465
28466
28467
28468
28469
28470
28471
28472
28473 gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext"
28474
28475 :
28476 fi
28477
28478
28479
28480
28481
28482 GNULIB_STRCHRNUL=1
28483
28484
28485
28486
28487
28488$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
28489
28490
28491
28492
28493
28494
9c9d63b1
PM
28495 if test $gl_cv_func_malloc_posix != yes; then
28496 REPLACE_STRDUP=1
6ec2e0f5
SDJ
28497 fi
28498
28499 if test $ac_cv_have_decl_strdup = no; then
28500 HAVE_DECL_STRDUP=0
28501 fi
28502
9c9d63b1 28503 if test $REPLACE_STRDUP = 1; then
6ec2e0f5
SDJ
28504
28505
28506
28507
28508
28509
28510
28511
28512 gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
28513
28514 :
28515 fi
28516
28517
28518
28519
28520
28521 GNULIB_STRDUP=1
28522
28523
28524
28525
28526
28527$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
28528
28529
28530
28531
28532
28533
28534
28535
5abebf3c
CB
28536
28537
6ec2e0f5
SDJ
28538 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
28539 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
28540$as_echo_n "checking for working strerror function... " >&6; }
d0ac1c44 28541if ${gl_cv_func_working_strerror+:} false; then :
6ec2e0f5
SDJ
28542 $as_echo_n "(cached) " >&6
28543else
28544 if test "$cross_compiling" = yes; then :
28545 case "$host_os" in
c0c3707f
CB
28546 # Guess yes on glibc systems.
28547 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
28548 # Guess yes on musl systems.
28549 *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
28550 # If we don't know, obey --enable-cross-guesses.
28551 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
6ec2e0f5
SDJ
28552 esac
28553
28554else
28555 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28556/* end confdefs.h. */
28557#include <string.h>
28558
28559int
28560main ()
28561{
28562if (!*strerror (-2)) return 1;
28563 ;
28564 return 0;
28565}
28566_ACEOF
28567if ac_fn_c_try_run "$LINENO"; then :
28568 gl_cv_func_working_strerror=yes
28569else
28570 gl_cv_func_working_strerror=no
28571fi
28572rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28573 conftest.$ac_objext conftest.beam conftest.$ac_ext
28574fi
28575
28576
28577fi
28578{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
28579$as_echo "$gl_cv_func_working_strerror" >&6; }
28580 case "$gl_cv_func_working_strerror" in
28581 *yes) ;;
28582 *)
28583 REPLACE_STRERROR=1
28584 ;;
28585 esac
28586
5abebf3c
CB
28587 case "$gl_cv_func_strerror_r_works" in
28588 *no) REPLACE_STRERROR=1 ;;
28589 esac
28590
6ec2e0f5
SDJ
28591 else
28592 REPLACE_STRERROR=1
28593 fi
28594
28595 if test $REPLACE_STRERROR = 1; then
28596
28597
28598
28599
28600
28601
28602
28603
28604 gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
28605
28606 fi
28607
28608
28609cat >>confdefs.h <<_ACEOF
28610#define GNULIB_STRERROR 1
28611_ACEOF
28612
28613
28614
28615
28616
28617
28618
28619 GNULIB_STRERROR=1
28620
28621
28622
28623
28624
28625$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
28626
28627
28628
28629
28630
28631 if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
28632
28633
28634
28635
28636
28637
28638
28639
28640 gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
28641
28642
28643
28644
28645
28646 if test $ac_cv_header_sys_socket_h != yes; then
28647 for ac_header in winsock2.h
28648do :
28649 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
d0ac1c44 28650if test "x$ac_cv_header_winsock2_h" = xyes; then :
6ec2e0f5
SDJ
28651 cat >>confdefs.h <<_ACEOF
28652#define HAVE_WINSOCK2_H 1
28653_ACEOF
28654
28655fi
28656
28657done
28658
28659 fi
28660 if test "$ac_cv_header_winsock2_h" = yes; then
28661 HAVE_WINSOCK2_H=1
28662 UNISTD_H_HAVE_WINSOCK2_H=1
28663 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
28664 else
28665 HAVE_WINSOCK2_H=0
28666 fi
28667
28668
28669 fi
28670
28671
28672
28673
98399780 28674
5abebf3c 28675
5abebf3c 28676
c0c3707f
CB
28677 if test $ac_cv_have_decl_strerror_r = no; then
28678 HAVE_DECL_STRERROR_R=0
28679 fi
5abebf3c
CB
28680
28681 if test $ac_cv_func_strerror_r = yes; then
28682 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
28683 if test $gl_cv_func_strerror_r_posix_signature = yes; then
28684 case "$gl_cv_func_strerror_r_works" in
28685 *no) REPLACE_STRERROR_R=1 ;;
28686 esac
28687 else
28688 REPLACE_STRERROR_R=1
28689 fi
28690 else
28691 REPLACE_STRERROR_R=1
28692 fi
28693 fi
28694
5abebf3c
CB
28695 if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
28696
28697
28698
28699
28700
28701
28702
28703
28704 gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext"
28705
28706
28707
5abebf3c
CB
28708
28709
28710
c0c3707f 28711 fi
5abebf3c
CB
28712
28713
28714
28715
5abebf3c 28716
c0c3707f 28717 GNULIB_STRERROR_R=1
5abebf3c
CB
28718
28719
28720
28721
5abebf3c 28722
c0c3707f 28723$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
5abebf3c
CB
28724
28725
28726
28727
5abebf3c 28728
c0c3707f
CB
28729cat >>confdefs.h <<_ACEOF
28730#define GNULIB_STRERROR_R_POSIX 1
28731_ACEOF
5abebf3c
CB
28732
28733
28734
28735
28736
28737
28738
698be2d8
CB
28739
28740
28741
28742
28743 if test $ac_cv_have_decl_strnlen = no; then
28744 HAVE_DECL_STRNLEN=0
28745 else
28746
28747 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
28748$as_echo_n "checking for working strnlen... " >&6; }
28749if ${ac_cv_func_strnlen_working+:} false; then :
28750 $as_echo_n "(cached) " >&6
28751else
28752 if test "$cross_compiling" = yes; then :
28753 # Guess no on AIX systems, yes otherwise.
28754 case "$host_os" in
28755 aix*) ac_cv_func_strnlen_working=no;;
28756 *) ac_cv_func_strnlen_working=yes;;
28757 esac
28758else
28759 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28760/* end confdefs.h. */
28761$ac_includes_default
28762int
28763main ()
28764{
28765
28766#define S "foobar"
28767#define S_LEN (sizeof S - 1)
28768
28769 /* At least one implementation is buggy: that of AIX 4.3 would
28770 give strnlen (S, 1) == 3. */
28771
28772 int i;
28773 for (i = 0; i < S_LEN + 1; ++i)
28774 {
28775 int expected = i <= S_LEN ? i : S_LEN;
28776 if (strnlen (S, i) != expected)
28777 return 1;
28778 }
28779 return 0;
28780
28781 ;
28782 return 0;
28783}
28784_ACEOF
28785if ac_fn_c_try_run "$LINENO"; then :
28786 ac_cv_func_strnlen_working=yes
28787else
28788 ac_cv_func_strnlen_working=no
28789fi
28790rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28791 conftest.$ac_objext conftest.beam conftest.$ac_ext
28792fi
28793
28794fi
28795{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5
28796$as_echo "$ac_cv_func_strnlen_working" >&6; }
28797test $ac_cv_func_strnlen_working = no && :
28798
28799
28800 if test $ac_cv_func_strnlen_working = no; then
28801 REPLACE_STRNLEN=1
28802 fi
28803 fi
28804
28805 if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
28806
28807
28808
28809
28810
28811
28812
28813
28814 gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
28815
28816 :
28817 fi
28818
28819
28820
28821
28822
28823 GNULIB_STRNLEN=1
28824
28825
28826
28827
28828
28829$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
28830
28831
28832
28833
28834
63ce7108
TT
28835 if test $REPLACE_STRSTR = 0; then
28836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
28837$as_echo_n "checking whether strstr works in linear time... " >&6; }
d0ac1c44 28838if ${gl_cv_func_strstr_linear+:} false; then :
63ce7108
TT
28839 $as_echo_n "(cached) " >&6
28840else
28841 if test "$cross_compiling" = yes; then :
28842 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28843/* end confdefs.h. */
28844
28845#include <features.h>
28846#ifdef __GNU_LIBRARY__
28847 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
28848 && !(defined __i386__ || defined __x86_64__) \
28849 && !defined __UCLIBC__
28850 Lucky user
28851 #endif
28852#endif
28853#ifdef __CYGWIN__
28854 #include <cygwin/version.h>
28855 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
28856 Lucky user
28857 #endif
28858#endif
28859
28860_ACEOF
28861if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28862 $EGREP "Lucky user" >/dev/null 2>&1; then :
28863 gl_cv_func_strstr_linear="guessing yes"
c971b7fa 28864else
c0c3707f 28865 gl_cv_func_strstr_linear="$gl_cross_guess_normal"
c971b7fa
PA
28866fi
28867rm -f conftest*
28868
28869
28870else
28871 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28872/* end confdefs.h. */
28873
49e4877c
PA
28874#ifdef __MVS__
28875/* z/OS does not deliver signals while strstr() is running (thanks to
28876 restrictions on its LE runtime), which prevents us from limiting the
28877 running time of this test. */
28878# error "This test does not work properly on z/OS"
28879#endif
c971b7fa 28880#include <signal.h> /* for signal */
63ce7108 28881#include <string.h> /* for strstr */
c971b7fa
PA
28882#include <stdlib.h> /* for malloc */
28883#include <unistd.h> /* for alarm */
49e4877c 28884static void quit (int sig) { _exit (sig + 128); }
c971b7fa
PA
28885
28886int
28887main ()
28888{
28889
28890 int result = 0;
28891 size_t m = 1000000;
63ce7108
TT
28892 char *haystack = (char *) malloc (2 * m + 2);
28893 char *needle = (char *) malloc (m + 2);
c971b7fa 28894 /* Failure to compile this test due to missing alarm is okay,
63ce7108 28895 since all such platforms (mingw) also have quadratic strstr. */
c971b7fa
PA
28896 signal (SIGALRM, quit);
28897 alarm (5);
28898 /* Check for quadratic performance. */
28899 if (haystack && needle)
28900 {
28901 memset (haystack, 'A', 2 * m);
28902 haystack[2 * m] = 'B';
63ce7108 28903 haystack[2 * m + 1] = 0;
c971b7fa
PA
28904 memset (needle, 'A', m);
28905 needle[m] = 'B';
63ce7108
TT
28906 needle[m + 1] = 0;
28907 if (!strstr (haystack, needle))
c971b7fa
PA
28908 result |= 1;
28909 }
c0c3707f
CB
28910 /* Free allocated memory, in case some sanitizer is watching. */
28911 free (haystack);
28912 free (needle);
c971b7fa
PA
28913 return result;
28914
28915 ;
28916 return 0;
28917}
28918_ACEOF
28919if ac_fn_c_try_run "$LINENO"; then :
63ce7108 28920 gl_cv_func_strstr_linear=yes
c971b7fa 28921else
63ce7108 28922 gl_cv_func_strstr_linear=no
c971b7fa
PA
28923fi
28924rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28925 conftest.$ac_objext conftest.beam conftest.$ac_ext
28926fi
28927
28928
28929fi
63ce7108
TT
28930{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
28931$as_echo "$gl_cv_func_strstr_linear" >&6; }
28932 case "$gl_cv_func_strstr_linear" in
40a73391
JK
28933 *yes) ;;
28934 *)
63ce7108 28935 REPLACE_STRSTR=1
40a73391
JK
28936 ;;
28937 esac
c971b7fa
PA
28938 fi
28939
63ce7108 28940 if test $REPLACE_STRSTR = 1; then
c971b7fa
PA
28941
28942
28943
28944
28945
28946
28947
28948
63ce7108 28949 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
c971b7fa 28950
a512b375 28951 fi
c971b7fa
PA
28952
28953
28954
9c9d63b1 28955 if test $REPLACE_MEMCHR = 1; then
63ce7108 28956 REPLACE_STRSTR=1
c971b7fa 28957 else
c0c3707f 28958 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
63ce7108 28959$as_echo_n "checking whether strstr works... " >&6; }
d0ac1c44 28960if ${gl_cv_func_strstr_works_always+:} false; then :
c971b7fa
PA
28961 $as_echo_n "(cached) " >&6
28962else
28963 if test "$cross_compiling" = yes; then :
c0c3707f 28964 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
28965/* end confdefs.h. */
28966
28967#ifdef __GNU_LIBRARY__
28968 #include <features.h>
63ce7108 28969 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
c971b7fa
PA
28970 || defined __UCLIBC__
28971 Lucky user
28972 #endif
28973#elif defined __CYGWIN__
28974 #include <cygwin/version.h>
28975 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
28976 Lucky user
28977 #endif
28978#else
28979 Lucky user
28980#endif
28981
28982_ACEOF
28983if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28984 $EGREP "Lucky user" >/dev/null 2>&1; then :
63ce7108 28985 gl_cv_func_strstr_works_always="guessing yes"
c971b7fa 28986else
c0c3707f 28987 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
c971b7fa
PA
28988fi
28989rm -f conftest*
28990
28991
28992else
28993 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28994/* end confdefs.h. */
28995
63ce7108 28996#include <string.h> /* for strstr */
c0c3707f
CB
28997#ifdef __GNU_LIBRARY__
28998 #include <features.h>
28999 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
29000 Unlucky user
29001 #endif
29002#endif
c971b7fa
PA
29003#define P "_EF_BF_BD"
29004#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
29005#define NEEDLE P P P P P
29006
29007int
29008main ()
29009{
63ce7108 29010return !!strstr (HAYSTACK, NEEDLE);
c971b7fa
PA
29011
29012 ;
29013 return 0;
29014}
29015_ACEOF
29016if ac_fn_c_try_run "$LINENO"; then :
63ce7108 29017 gl_cv_func_strstr_works_always=yes
c971b7fa 29018else
63ce7108 29019 gl_cv_func_strstr_works_always=no
c971b7fa
PA
29020fi
29021rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29022 conftest.$ac_objext conftest.beam conftest.$ac_ext
29023fi
29024
29025
29026fi
63ce7108
TT
29027{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
29028$as_echo "$gl_cv_func_strstr_works_always" >&6; }
29029 case "$gl_cv_func_strstr_works_always" in
40a73391
JK
29030 *yes) ;;
29031 *)
63ce7108 29032 REPLACE_STRSTR=1
40a73391
JK
29033 ;;
29034 esac
c971b7fa 29035 fi
8839a007 29036
63ce7108 29037 if test $REPLACE_STRSTR = 1; then
8839a007 29038
8690e634
JK
29039
29040
8690e634
JK
29041
29042
29043
29044
29045
63ce7108 29046 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
8690e634 29047
8690e634
JK
29048 fi
29049
8690e634
JK
29050
29051
8690e634 29052
8690e634 29053
63ce7108 29054 GNULIB_STRSTR=1
8690e634
JK
29055
29056
29057
8690e634
JK
29058
29059
63ce7108 29060$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
8690e634
JK
29061
29062
29063
29064
29065
29066
29067
421693b0
PA
29068 for ac_func in strtok_r
29069do :
29070 ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r"
d0ac1c44 29071if test "x$ac_cv_func_strtok_r" = xyes; then :
421693b0
PA
29072 cat >>confdefs.h <<_ACEOF
29073#define HAVE_STRTOK_R 1
29074_ACEOF
29075
29076fi
29077done
29078
29079 if test $ac_cv_func_strtok_r = yes; then
29080 HAVE_STRTOK_R=1
29081 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5
29082$as_echo_n "checking whether strtok_r works... " >&6; }
d0ac1c44 29083if ${gl_cv_func_strtok_r_works+:} false; then :
421693b0
PA
29084 $as_echo_n "(cached) " >&6
29085else
29086 if test "$cross_compiling" = yes; then :
c0c3707f
CB
29087 case "$host_os" in
29088 # Guess no on glibc systems.
29089 *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;;
29090 # Guess yes on native Windows.
29091 mingw*) gl_cv_func_strtok_r_works="guessing yes" ;;
29092 *) gl_cv_func_strtok_r_works="guessing yes" ;;
421693b0
PA
29093 esac
29094
29095else
29096 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29097/* end confdefs.h. */
29098
29099 #ifndef __OPTIMIZE__
29100 # define __OPTIMIZE__ 1
29101 #endif
29102 #undef __OPTIMIZE_SIZE__
29103 #undef __NO_INLINE__
29104 #include <stdlib.h>
29105 #include <string.h>
29106
29107int
29108main ()
29109{
29110static const char dummy[] = "\177\01a";
29111 char delimiters[] = "xxxxxxxx";
29112 char *save_ptr = (char *) dummy;
29113 strtok_r (delimiters, "x", &save_ptr);
29114 strtok_r (NULL, "x", &save_ptr);
29115 return 0;
29116
29117 ;
29118 return 0;
29119}
29120
29121_ACEOF
29122if ac_fn_c_try_run "$LINENO"; then :
29123 gl_cv_func_strtok_r_works=yes
29124else
29125 gl_cv_func_strtok_r_works=no
29126fi
29127rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29128 conftest.$ac_objext conftest.beam conftest.$ac_ext
29129fi
29130
29131
29132fi
29133{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5
29134$as_echo "$gl_cv_func_strtok_r_works" >&6; }
29135 case "$gl_cv_func_strtok_r_works" in
29136 *no)
29137 UNDEFINE_STRTOK_R=1
29138 ;;
29139 esac
29140 else
29141 HAVE_STRTOK_R=0
29142 fi
29143
29144 if test $ac_cv_have_decl_strtok_r = no; then
29145 HAVE_DECL_STRTOK_R=0
29146 fi
29147
29148 if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then
29149
29150
29151
29152
29153
29154
29155
29156
29157 gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext"
29158
29159
29160 :
29161
29162 fi
29163
29164
29165
29166
29167
29168 GNULIB_STRTOK_R=1
29169
29170
29171
29172
29173
29174$as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h
29175
29176
29177
29178
29179
29180
29181
8690e634
JK
29182
29183
29184
29185
29186
8690e634 29187
09607c9e 29188
698be2d8
CB
29189 if test $gl_cv_have_include_next = yes; then
29190 gl_cv_next_sys_random_h='<'sys/random.h'>'
29191 else
29192 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/random.h>" >&5
29193$as_echo_n "checking absolute name of <sys/random.h>... " >&6; }
29194if ${gl_cv_next_sys_random_h+:} false; then :
29195 $as_echo_n "(cached) " >&6
29196else
29197
29198 if test $ac_cv_header_sys_random_h = yes; then
29199
29200
29201
29202
29203 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29204/* end confdefs.h. */
29205#include <sys/random.h>
29206_ACEOF
29207 case "$host_os" in
29208 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29209 *) gl_absname_cpp="$ac_cpp" ;;
29210 esac
29211
29212 case "$host_os" in
29213 mingw*)
29214 gl_dirsep_regex='[/\\]'
29215 ;;
29216 *)
29217 gl_dirsep_regex='\/'
29218 ;;
29219 esac
29220 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29221 gl_header_literal_regex=`echo 'sys/random.h' \
29222 | sed -e "$gl_make_literal_regex_sed"`
29223 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29224 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29225 s|^/[^/]|//&|
29226 p
29227 q
29228 }'
29229
29230 gl_cv_absolute_sys_random_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29231 sed -n "$gl_absolute_header_sed"`
29232
29233 gl_header=$gl_cv_absolute_sys_random_h
29234 gl_cv_next_sys_random_h='"'$gl_header'"'
29235 else
29236 gl_cv_next_sys_random_h='<'sys/random.h'>'
29237 fi
29238
29239
29240fi
29241{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_random_h" >&5
29242$as_echo "$gl_cv_next_sys_random_h" >&6; }
29243 fi
29244 NEXT_SYS_RANDOM_H=$gl_cv_next_sys_random_h
29245
29246 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29247 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29248 gl_next_as_first_directive='<'sys/random.h'>'
29249 else
29250 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29251 gl_next_as_first_directive=$gl_cv_next_sys_random_h
29252 fi
29253 NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H=$gl_next_as_first_directive
29254
29255
29256
29257
29258 if test $ac_cv_header_sys_random_h = yes; then
29259 HAVE_SYS_RANDOM_H=1
29260 else
29261 HAVE_SYS_RANDOM_H=0
29262 fi
29263
29264
29265
29266 if test $ac_cv_header_sys_random_h = yes; then
29267 UNISTD_H_HAVE_SYS_RANDOM_H=1
29268 fi
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
29285
725e2999
JB
29286
29287
09607c9e
TT
29288
29289
29290
29291 if test $gl_cv_have_include_next = yes; then
29292 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
29293 else
29294 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
29295$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
d0ac1c44 29296if ${gl_cv_next_sys_stat_h+:} false; then :
09607c9e
TT
29297 $as_echo_n "(cached) " >&6
29298else
29299
29300 if test $ac_cv_header_sys_stat_h = yes; then
29301
29302
4a626d0a
PA
29303
29304
29305 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
09607c9e
TT
29306/* end confdefs.h. */
29307#include <sys/stat.h>
09607c9e 29308_ACEOF
4a626d0a
PA
29309 case "$host_os" in
29310 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29311 *) gl_absname_cpp="$ac_cpp" ;;
29312 esac
29313
29314 case "$host_os" in
29315 mingw*)
29316 gl_dirsep_regex='[/\\]'
29317 ;;
29318 *)
29319 gl_dirsep_regex='\/'
29320 ;;
29321 esac
29322 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29323 gl_header_literal_regex=`echo 'sys/stat.h' \
29324 | sed -e "$gl_make_literal_regex_sed"`
29325 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29326 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29327 s|^/[^/]|//&|
29328 p
29329 q
29330 }'
29331
29332 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29333 sed -n "$gl_absolute_header_sed"`
29334
29335 gl_header=$gl_cv_absolute_sys_stat_h
29336 gl_cv_next_sys_stat_h='"'$gl_header'"'
09607c9e
TT
29337 else
29338 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
29339 fi
29340
29341
29342fi
29343{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
29344$as_echo "$gl_cv_next_sys_stat_h" >&6; }
29345 fi
29346 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
29347
29348 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29349 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29350 gl_next_as_first_directive='<'sys/stat.h'>'
29351 else
29352 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29353 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
29354 fi
29355 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
29356
29357
29358
29359
29360
29361
29362
29363
c0c3707f
CB
29364 WINDOWS_STAT_TIMESPEC=0
29365
29366
2196f55f 29367
09607c9e
TT
29368
29369
09607c9e 29370
09607c9e 29371
09607c9e
TT
29372
29373 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
29374 #include <sys/stat.h>
29375"
d0ac1c44 29376if test "x$ac_cv_type_nlink_t" = xyes; then :
09607c9e
TT
29377
29378else
29379
c0c3707f 29380$as_echo "#define nlink_t int" >>confdefs.h
09607c9e 29381
c0c3707f 29382fi
09607c9e
TT
29383
29384
29385
29386
29387
29388
29389
29390
29391
29392
725e2999
JB
29393
29394
29395
29396
29397
29398
725e2999
JB
29399
29400
29401
29402
29403
698be2d8
CB
29404
29405
725e2999
JB
29406
29407
29408
29409 if test $gl_cv_have_include_next = yes; then
29410 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
29411 else
29412 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
29413$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
29414if ${gl_cv_next_sys_uio_h+:} false; then :
29415 $as_echo_n "(cached) " >&6
29416else
29417
29418 if test $ac_cv_header_sys_uio_h = yes; then
29419
29420
29421
29422
29423 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29424/* end confdefs.h. */
29425#include <sys/uio.h>
29426_ACEOF
29427 case "$host_os" in
29428 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29429 *) gl_absname_cpp="$ac_cpp" ;;
29430 esac
29431
29432 case "$host_os" in
29433 mingw*)
29434 gl_dirsep_regex='[/\\]'
29435 ;;
29436 *)
29437 gl_dirsep_regex='\/'
29438 ;;
29439 esac
29440 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29441 gl_header_literal_regex=`echo 'sys/uio.h' \
29442 | sed -e "$gl_make_literal_regex_sed"`
29443 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29444 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29445 s|^/[^/]|//&|
29446 p
29447 q
29448 }'
29449
29450 gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29451 sed -n "$gl_absolute_header_sed"`
29452
29453 gl_header=$gl_cv_absolute_sys_uio_h
29454 gl_cv_next_sys_uio_h='"'$gl_header'"'
29455 else
29456 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
29457 fi
29458
29459
29460fi
29461{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
29462$as_echo "$gl_cv_next_sys_uio_h" >&6; }
29463 fi
29464 NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
29465
29466 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29467 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29468 gl_next_as_first_directive='<'sys/uio.h'>'
29469 else
29470 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29471 gl_next_as_first_directive=$gl_cv_next_sys_uio_h
29472 fi
29473 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
29474
29475
29476
29477
29478 if test $ac_cv_header_sys_uio_h = yes; then
29479 HAVE_SYS_UIO_H=1
29480 else
29481 HAVE_SYS_UIO_H=0
29482 fi
29483
29484
29485
29486
29487
2d8adcbd
MM
29488 :
29489
29490
29491
29492
9c9d63b1
PM
29493cat >>confdefs.h <<_ACEOF
29494#define GNULIB_TEMPNAME 1
29495_ACEOF
29496
29497
29498
29499
09607c9e
TT
29500
29501
29502
8839a007
PA
29503
29504
29505
29506
09607c9e 29507
c0c3707f
CB
29508 ac_fn_c_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "/* mingw's <time.h> provides the functions asctime_r, ctime_r,
29509 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29510 been included before. */
29511 #if defined __MINGW32__
29512 # include <unistd.h>
29513 #endif
29514 #include <time.h>
09607c9e 29515
f8e27d88
CB
29516"
29517if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
29518 ac_have_decl=1
29519else
29520 ac_have_decl=0
29521fi
29522
29523cat >>confdefs.h <<_ACEOF
29524#define HAVE_DECL_LOCALTIME_R $ac_have_decl
29525_ACEOF
29526
29527 if test $ac_cv_have_decl_localtime_r = no; then
29528 HAVE_DECL_LOCALTIME_R=0
29529 fi
29530
29531
f8e27d88
CB
29532 if test $ac_cv_func_localtime_r = yes; then
29533 HAVE_LOCALTIME_R=1
29534 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
29535$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
29536if ${gl_cv_time_r_posix+:} false; then :
29537 $as_echo_n "(cached) " >&6
29538else
29539 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29540/* end confdefs.h. */
c0c3707f
CB
29541/* mingw's <time.h> provides the functions asctime_r, ctime_r,
29542 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29543 been included before. */
29544 #if defined __MINGW32__
29545 # include <unistd.h>
29546 #endif
29547 #include <time.h>
29548
f8e27d88
CB
29549int
29550main ()
29551{
29552/* We don't need to append 'restrict's to the argument types,
29553 even though the POSIX signature has the 'restrict's,
29554 since C99 says they can't affect type compatibility. */
29555 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
29556 if (ptr) return 0;
29557 /* Check the return type is a pointer.
29558 On HP-UX 10 it is 'int'. */
29559 *localtime_r (0, 0);
29560 ;
29561 return 0;
29562}
29563
29564_ACEOF
29565if ac_fn_c_try_compile "$LINENO"; then :
29566 gl_cv_time_r_posix=yes
29567else
29568 gl_cv_time_r_posix=no
29569fi
29570rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29571
29572fi
29573{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
29574$as_echo "$gl_cv_time_r_posix" >&6; }
29575 if test $gl_cv_time_r_posix = yes; then
29576 REPLACE_LOCALTIME_R=0
29577 else
29578 REPLACE_LOCALTIME_R=1
29579 fi
29580 else
29581 HAVE_LOCALTIME_R=0
c0c3707f
CB
29582 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5
29583$as_echo_n "checking whether localtime_r exists as an inline function... " >&6; }
29584if ${gl_cv_func_localtime_r_inline+:} false; then :
29585 $as_echo_n "(cached) " >&6
29586else
29587 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29588/* end confdefs.h. */
29589/* mingw's <time.h> provides the functions asctime_r, ctime_r,
29590 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29591 been included before. */
29592 #if defined __MINGW32__
29593 # include <unistd.h>
29594 #endif
29595 #include <time.h>
29596
29597int
29598main ()
29599{
29600time_t a;
29601 struct tm r;
29602 localtime_r (&a, &r);
29603
29604 ;
29605 return 0;
29606}
29607
29608_ACEOF
29609if ac_fn_c_try_link "$LINENO"; then :
29610 gl_cv_func_localtime_r_inline=yes
29611else
29612 gl_cv_func_localtime_r_inline=no
29613fi
29614rm -f core conftest.err conftest.$ac_objext \
29615 conftest$ac_exeext conftest.$ac_ext
29616
29617fi
29618{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5
29619$as_echo "$gl_cv_func_localtime_r_inline" >&6; }
29620 if test $gl_cv_func_localtime_r_inline = yes; then
29621 REPLACE_LOCALTIME_R=1
29622 fi
f8e27d88
CB
29623 fi
29624
29625 if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
29626
29627
29628
29629
29630
29631
29632
29633
29634 gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
29635
29636
29637 :
29638
29639 fi
29640
29641
29642
29643
29644
29645 GNULIB_TIME_R=1
29646
29647
29648
29649
29650
29651$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
29652
29653
29654
29655
29656
29657
29658
29659
29660
5abebf3c
CB
29661
29662
29663
8839a007
PA
29664
29665
29666
29667 if test $gl_cv_have_include_next = yes; then
29668 gl_cv_next_unistd_h='<'unistd.h'>'
29669 else
29670 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
29671$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
d0ac1c44 29672if ${gl_cv_next_unistd_h+:} false; then :
8839a007
PA
29673 $as_echo_n "(cached) " >&6
29674else
29675
29676 if test $ac_cv_header_unistd_h = yes; then
29677
29678
4a626d0a
PA
29679
29680
29681 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8839a007
PA
29682/* end confdefs.h. */
29683#include <unistd.h>
8839a007 29684_ACEOF
4a626d0a
PA
29685 case "$host_os" in
29686 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29687 *) gl_absname_cpp="$ac_cpp" ;;
29688 esac
29689
29690 case "$host_os" in
29691 mingw*)
29692 gl_dirsep_regex='[/\\]'
29693 ;;
29694 *)
29695 gl_dirsep_regex='\/'
29696 ;;
29697 esac
29698 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29699 gl_header_literal_regex=`echo 'unistd.h' \
29700 | sed -e "$gl_make_literal_regex_sed"`
29701 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29702 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29703 s|^/[^/]|//&|
29704 p
29705 q
29706 }'
29707
29708 gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29709 sed -n "$gl_absolute_header_sed"`
29710
29711 gl_header=$gl_cv_absolute_unistd_h
29712 gl_cv_next_unistd_h='"'$gl_header'"'
8839a007
PA
29713 else
29714 gl_cv_next_unistd_h='<'unistd.h'>'
29715 fi
29716
29717
29718fi
29719{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
29720$as_echo "$gl_cv_next_unistd_h" >&6; }
29721 fi
29722 NEXT_UNISTD_H=$gl_cv_next_unistd_h
29723
29724 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29725 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29726 gl_next_as_first_directive='<'unistd.h'>'
29727 else
29728 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29729 gl_next_as_first_directive=$gl_cv_next_unistd_h
29730 fi
29731 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
29732
29733
29734
29735
29736 if test $ac_cv_header_unistd_h = yes; then
29737 HAVE_UNISTD_H=1
29738 else
29739 HAVE_UNISTD_H=0
29740 fi
29741
29742
29743
29744
29745
29746
29747
472fa5ee
SM
29748
29749
29750
29751
29752
8839a007 29753
9c9d63b1
PM
29754 if test $ac_cv_have_decl_execvpe = no; then
29755 HAVE_DECL_EXECVPE=0
29756 fi
29757
29758
6ec2e0f5
SDJ
29759
29760
29761
698be2d8
CB
29762
29763
3d99e817
AK
29764 if test $ac_cv_have_decl_unsetenv = no; then
29765 HAVE_DECL_UNSETENV=0
29766 fi
29767 for ac_func in unsetenv
29768do :
29769 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
d0ac1c44 29770if test "x$ac_cv_func_unsetenv" = xyes; then :
3d99e817
AK
29771 cat >>confdefs.h <<_ACEOF
29772#define HAVE_UNSETENV 1
29773_ACEOF
29774
29775fi
29776done
29777
29778 if test $ac_cv_func_unsetenv = no; then
29779 HAVE_UNSETENV=0
29780 else
29781 HAVE_UNSETENV=1
29782 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
29783$as_echo_n "checking for unsetenv() return type... " >&6; }
d0ac1c44 29784if ${gt_cv_func_unsetenv_ret+:} false; then :
3d99e817
AK
29785 $as_echo_n "(cached) " >&6
29786else
29787 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29788/* end confdefs.h. */
29789
29790#undef _BSD
29791#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
29792#include <stdlib.h>
29793extern
29794#ifdef __cplusplus
29795"C"
29796#endif
29797int unsetenv (const char *name);
29798
29799int
29800main ()
29801{
29802
29803 ;
29804 return 0;
29805}
29806_ACEOF
29807if ac_fn_c_try_compile "$LINENO"; then :
29808 gt_cv_func_unsetenv_ret='int'
29809else
29810 gt_cv_func_unsetenv_ret='void'
29811fi
29812rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29813fi
29814{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
29815$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
29816 if test $gt_cv_func_unsetenv_ret = 'void'; then
29817
29818$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
29819
29820 REPLACE_UNSETENV=1
29821 fi
29822
29823 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
29824$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
d0ac1c44 29825if ${gl_cv_func_unsetenv_works+:} false; then :
3d99e817
AK
29826 $as_echo_n "(cached) " >&6
29827else
29828 if test "$cross_compiling" = yes; then :
29829 case "$host_os" in
9c9d63b1
PM
29830 # Guess yes on glibc systems.
29831 *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
29832 # If we don't know, obey --enable-cross-guesses.
29833 *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
29834 esac
3d99e817
AK
29835
29836else
29837 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29838/* end confdefs.h. */
29839
9c9d63b1
PM
29840 #include <stdlib.h>
29841 #include <errno.h>
29842 extern char **environ;
29843
29844
29845$gl_mda_defines
3d99e817
AK
29846
29847int
29848main ()
29849{
29850
9c9d63b1
PM
29851 char entry1[] = "a=1";
29852 char entry2[] = "b=2";
29853 char *env[] = { entry1, entry2, NULL };
29854 if (putenv ((char *) "a=1")) return 1;
29855 if (putenv (entry2)) return 2;
29856 entry2[0] = 'a';
29857 unsetenv ("a");
29858 if (getenv ("a")) return 3;
29859 if (!unsetenv ("") || errno != EINVAL) return 4;
29860 entry2[0] = 'b';
29861 environ = env;
29862 if (!getenv ("a")) return 5;
29863 entry2[0] = 'a';
29864 unsetenv ("a");
29865 if (getenv ("a")) return 6;
3d99e817
AK
29866
29867 ;
29868 return 0;
29869}
29870_ACEOF
29871if ac_fn_c_try_run "$LINENO"; then :
29872 gl_cv_func_unsetenv_works=yes
29873else
29874 gl_cv_func_unsetenv_works=no
29875fi
29876rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29877 conftest.$ac_objext conftest.beam conftest.$ac_ext
29878fi
29879
9c9d63b1 29880
3d99e817
AK
29881fi
29882{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
29883$as_echo "$gl_cv_func_unsetenv_works" >&6; }
29884 case "$gl_cv_func_unsetenv_works" in
29885 *yes) ;;
29886 *)
29887 REPLACE_UNSETENV=1
29888 ;;
29889 esac
29890 fi
29891
29892 if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
29893
29894
29895
29896
29897
29898
29899
29900
29901 gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
29902
29903
29904
29905
29906
29907 fi
29908
29909
29910
29911
29912
29913 GNULIB_UNSETENV=1
29914
29915
29916
29917
29918
29919$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
29920
29921
29922
29923
29924
29925
8839a007
PA
29926
29927
29928
29929
29930
29931
29932
8690e634
JK
29933
29934
29935 if test $gl_cv_have_include_next = yes; then
29936 gl_cv_next_wchar_h='<'wchar.h'>'
29937 else
29938 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
29939$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
d0ac1c44 29940if ${gl_cv_next_wchar_h+:} false; then :
8690e634
JK
29941 $as_echo_n "(cached) " >&6
29942else
29943
29944 if test $ac_cv_header_wchar_h = yes; then
29945
29946
4a626d0a
PA
29947
29948
29949 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
29950/* end confdefs.h. */
29951#include <wchar.h>
8690e634 29952_ACEOF
4a626d0a
PA
29953 case "$host_os" in
29954 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29955 *) gl_absname_cpp="$ac_cpp" ;;
29956 esac
29957
29958 case "$host_os" in
29959 mingw*)
29960 gl_dirsep_regex='[/\\]'
29961 ;;
29962 *)
29963 gl_dirsep_regex='\/'
29964 ;;
29965 esac
29966 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29967 gl_header_literal_regex=`echo 'wchar.h' \
29968 | sed -e "$gl_make_literal_regex_sed"`
29969 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29970 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29971 s|^/[^/]|//&|
29972 p
29973 q
29974 }'
29975
29976 gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29977 sed -n "$gl_absolute_header_sed"`
29978
29979 gl_header=$gl_cv_absolute_wchar_h
29980 gl_cv_next_wchar_h='"'$gl_header'"'
8690e634
JK
29981 else
29982 gl_cv_next_wchar_h='<'wchar.h'>'
29983 fi
29984
29985
29986fi
29987{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
29988$as_echo "$gl_cv_next_wchar_h" >&6; }
29989 fi
29990 NEXT_WCHAR_H=$gl_cv_next_wchar_h
29991
29992 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29993 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29994 gl_next_as_first_directive='<'wchar.h'>'
29995 else
29996 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29997 gl_next_as_first_directive=$gl_cv_next_wchar_h
29998 fi
29999 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
30000
30001
30002
30003
30004 if test $ac_cv_header_wchar_h = yes; then
30005 HAVE_WCHAR_H=1
30006 else
30007 HAVE_WCHAR_H=0
30008 fi
30009
c971b7fa
PA
30010
30011
30012
30013
8690e634
JK
30014 if test $gt_cv_c_wint_t = yes; then
30015 HAVE_WINT_T=1
30016 else
30017 HAVE_WINT_T=0
30018 fi
c971b7fa
PA
30019
30020
30021
8690e634
JK
30022
30023
30024
30025
30026
472fa5ee
SM
30027
30028
9c9d63b1
PM
30029 ac_fn_c_check_decl "$LINENO" "wcsdup" "ac_cv_have_decl_wcsdup" "
30030 #include <wchar.h>
30031
30032"
30033if test "x$ac_cv_have_decl_wcsdup" = xyes; then :
30034 ac_have_decl=1
30035else
30036 ac_have_decl=0
30037fi
30038
30039cat >>confdefs.h <<_ACEOF
30040#define HAVE_DECL_WCSDUP $ac_have_decl
30041_ACEOF
30042
30043 if test $ac_cv_have_decl_wcsdup = no; then
30044 HAVE_DECL_WCSDUP=0
30045 fi
30046
472fa5ee
SM
30047
30048
30049
698be2d8
CB
30050
30051
8690e634
JK
30052 if test $ac_cv_func_iswcntrl = yes; then
30053 HAVE_ISWCNTRL=1
30054 else
30055 HAVE_ISWCNTRL=0
30056 fi
30057
30058
30059
8690e634
JK
30060 if test $gt_cv_c_wint_t = yes; then
30061 HAVE_WINT_T=1
30062 else
30063 HAVE_WINT_T=0
30064 fi
30065
30066
30067
30068
30069
30070
c971b7fa 30071
8690e634 30072
472fa5ee
SM
30073
30074
c971b7fa
PA
30075
30076
30077
30078 if test $gl_cv_have_include_next = yes; then
8690e634 30079 gl_cv_next_wctype_h='<'wctype.h'>'
c971b7fa 30080 else
8690e634
JK
30081 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
30082$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
d0ac1c44 30083if ${gl_cv_next_wctype_h+:} false; then :
c971b7fa
PA
30084 $as_echo_n "(cached) " >&6
30085else
30086
8690e634
JK
30087 if test $ac_cv_header_wctype_h = yes; then
30088
30089
4a626d0a
PA
30090
30091
30092 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 30093/* end confdefs.h. */
8690e634 30094#include <wctype.h>
c971b7fa 30095_ACEOF
4a626d0a
PA
30096 case "$host_os" in
30097 aix*) gl_absname_cpp="$ac_cpp -C" ;;
30098 *) gl_absname_cpp="$ac_cpp" ;;
30099 esac
30100
30101 case "$host_os" in
30102 mingw*)
30103 gl_dirsep_regex='[/\\]'
30104 ;;
30105 *)
30106 gl_dirsep_regex='\/'
30107 ;;
30108 esac
30109 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
30110 gl_header_literal_regex=`echo 'wctype.h' \
30111 | sed -e "$gl_make_literal_regex_sed"`
30112 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
30113 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
30114 s|^/[^/]|//&|
30115 p
30116 q
30117 }'
30118
30119 gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
30120 sed -n "$gl_absolute_header_sed"`
30121
30122 gl_header=$gl_cv_absolute_wctype_h
30123 gl_cv_next_wctype_h='"'$gl_header'"'
8690e634
JK
30124 else
30125 gl_cv_next_wctype_h='<'wctype.h'>'
30126 fi
c971b7fa
PA
30127
30128
30129fi
8690e634
JK
30130{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
30131$as_echo "$gl_cv_next_wctype_h" >&6; }
c971b7fa 30132 fi
8690e634 30133 NEXT_WCTYPE_H=$gl_cv_next_wctype_h
c971b7fa
PA
30134
30135 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
30136 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8690e634 30137 gl_next_as_first_directive='<'wctype.h'>'
c971b7fa
PA
30138 else
30139 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8690e634 30140 gl_next_as_first_directive=$gl_cv_next_wctype_h
c971b7fa 30141 fi
8690e634
JK
30142 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
30143
30144
30145
30146
30147 if test $ac_cv_header_wctype_h = yes; then
30148 if test $ac_cv_func_iswcntrl = yes; then
30149 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
30150$as_echo_n "checking whether iswcntrl works... " >&6; }
d0ac1c44 30151if ${gl_cv_func_iswcntrl_works+:} false; then :
8690e634
JK
30152 $as_echo_n "(cached) " >&6
30153else
30154
30155 if test "$cross_compiling" = yes; then :
c0c3707f 30156 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
30157/* end confdefs.h. */
30158#include <stdlib.h>
30159 #if __GNU_LIBRARY__ == 1
30160 Linux libc5 i18n is broken.
30161 #endif
30162int
30163main ()
30164{
30165
30166 ;
30167 return 0;
30168}
30169_ACEOF
30170if ac_fn_c_try_compile "$LINENO"; then :
30171 gl_cv_func_iswcntrl_works="guessing yes"
30172else
30173 gl_cv_func_iswcntrl_works="guessing no"
30174fi
30175rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
30176
30177else
30178 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30179/* end confdefs.h. */
30180
8690e634
JK
30181 #include <wchar.h>
30182 #include <wctype.h>
30183 int main () { return iswprint ('x') == 0; }
30184
30185_ACEOF
30186if ac_fn_c_try_run "$LINENO"; then :
30187 gl_cv_func_iswcntrl_works=yes
30188else
30189 gl_cv_func_iswcntrl_works=no
30190fi
30191rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
30192 conftest.$ac_objext conftest.beam conftest.$ac_ext
30193fi
30194
30195
30196fi
30197{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
30198$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
30199 fi
30200 HAVE_WCTYPE_H=1
30201 else
30202 HAVE_WCTYPE_H=0
30203 fi
30204
30205
c0c3707f
CB
30206 if test $GNULIB_OVERRIDES_WINT_T = 1; then
30207 REPLACE_ISWCNTRL=1
30208 else
30209 case "$gl_cv_func_iswcntrl_works" in
30210 *yes) REPLACE_ISWCNTRL=0 ;;
30211 *) REPLACE_ISWCNTRL=1 ;;
30212 esac
30213 fi
8690e634
JK
30214
30215
30216 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
30217 :
30218 fi
30219
30220 if test $REPLACE_ISWCNTRL = 1; then
30221 REPLACE_TOWLOWER=1
30222 else
30223 for ac_func in towlower
30224do :
30225 ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
d0ac1c44 30226if test "x$ac_cv_func_towlower" = xyes; then :
8690e634
JK
30227 cat >>confdefs.h <<_ACEOF
30228#define HAVE_TOWLOWER 1
30229_ACEOF
30230
30231fi
30232done
30233
30234 if test $ac_cv_func_towlower = yes; then
30235 REPLACE_TOWLOWER=0
30236 else
9c9d63b1 30237 ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include <wchar.h>
8690e634
JK
30238 #if HAVE_WCTYPE_H
30239 # include <wctype.h>
30240 #endif
30241
30242"
d0ac1c44 30243if test "x$ac_cv_have_decl_towlower" = xyes; then :
8690e634
JK
30244 ac_have_decl=1
30245else
30246 ac_have_decl=0
30247fi
30248
30249cat >>confdefs.h <<_ACEOF
30250#define HAVE_DECL_TOWLOWER $ac_have_decl
30251_ACEOF
30252
30253 if test $ac_cv_have_decl_towlower = yes; then
30254 REPLACE_TOWLOWER=1
30255 else
30256 REPLACE_TOWLOWER=0
30257 fi
30258 fi
30259 fi
30260
30261
30262 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
30263 :
30264 fi
30265
30266 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
30267$as_echo_n "checking for wctype_t... " >&6; }
d0ac1c44 30268if ${gl_cv_type_wctype_t+:} false; then :
8690e634
JK
30269 $as_echo_n "(cached) " >&6
30270else
30271 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30272/* end confdefs.h. */
9c9d63b1 30273#include <wchar.h>
8690e634
JK
30274 #if HAVE_WCTYPE_H
30275 # include <wctype.h>
30276 #endif
30277 wctype_t a;
30278
30279int
30280main ()
30281{
30282
30283 ;
30284 return 0;
30285}
30286_ACEOF
30287if ac_fn_c_try_compile "$LINENO"; then :
30288 gl_cv_type_wctype_t=yes
30289else
30290 gl_cv_type_wctype_t=no
30291fi
30292rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 30293
8690e634
JK
30294fi
30295{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
30296$as_echo "$gl_cv_type_wctype_t" >&6; }
30297 if test $gl_cv_type_wctype_t = no; then
30298 HAVE_WCTYPE_T=0
30299 fi
30300
30301 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
30302$as_echo_n "checking for wctrans_t... " >&6; }
d0ac1c44 30303if ${gl_cv_type_wctrans_t+:} false; then :
8690e634
JK
30304 $as_echo_n "(cached) " >&6
30305else
30306 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30307/* end confdefs.h. */
9c9d63b1 30308#include <wchar.h>
8690e634
JK
30309 #include <wctype.h>
30310 wctrans_t a;
c971b7fa 30311
8690e634
JK
30312int
30313main ()
30314{
c971b7fa 30315
8690e634
JK
30316 ;
30317 return 0;
30318}
30319_ACEOF
30320if ac_fn_c_try_compile "$LINENO"; then :
30321 gl_cv_type_wctrans_t=yes
30322else
30323 gl_cv_type_wctrans_t=no
30324fi
30325rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 30326
8690e634
JK
30327fi
30328{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
30329$as_echo "$gl_cv_type_wctrans_t" >&6; }
30330 if test $gl_cv_type_wctrans_t = no; then
30331 HAVE_WCTRANS_T=0
c971b7fa
PA
30332 fi
30333
30334
5e8754f9 30335
5e8754f9 30336
c971b7fa 30337
c0c3707f
CB
30338
30339 case "$host_os" in
30340 mingw*)
30341
30342
30343
30344
30345
30346
30347
30348
30349 gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext"
30350
30351 ;;
30352 esac
30353
30354 case "$host_os" in
30355 mingw*)
30356
30357
30358
30359
30360
30361
30362
30363
30364 gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext"
30365
30366 ;;
30367 esac
30368
30369 case "$host_os" in
30370 mingw*)
30371
30372
c971b7fa
PA
30373
30374
c0c3707f
CB
30375
30376
30377
30378
30379 gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext"
30380
30381 ;;
30382 esac
30383
30384 case "$host_os" in
30385 mingw*)
30386
30387
30388
30389
30390
30391
30392
30393
30394 gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext"
30395
30396 ;;
30397 esac
698be2d8
CB
30398
30399
30400 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wmemchr" >&5
30401$as_echo_n "checking for wmemchr... " >&6; }
30402if ${gl_cv_func_wmemchr+:} false; then :
30403 $as_echo_n "(cached) " >&6
30404else
30405 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30406/* end confdefs.h. */
698be2d8
CB
30407#include <wchar.h>
30408
30409int
30410main ()
30411{
30412return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0);
30413 ;
30414 return 0;
30415}
30416
30417_ACEOF
30418if ac_fn_c_try_link "$LINENO"; then :
30419 gl_cv_func_wmemchr=yes
30420else
30421 gl_cv_func_wmemchr=no
30422fi
30423rm -f core conftest.err conftest.$ac_objext \
30424 conftest$ac_exeext conftest.$ac_ext
30425
30426fi
30427{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wmemchr" >&5
30428$as_echo "$gl_cv_func_wmemchr" >&6; }
30429 if test $gl_cv_func_wmemchr = no; then
30430 HAVE_WMEMCHR=0
30431 fi
30432
30433 if test $HAVE_WMEMCHR = 0; then
30434
30435
30436
30437
30438
30439
30440
30441
30442 gl_LIBOBJS="$gl_LIBOBJS wmemchr.$ac_objext"
30443
30444 fi
30445
30446
30447
30448
30449
30450 GNULIB_WMEMCHR=1
30451
30452
30453
30454
30455
30456$as_echo "#define GNULIB_TEST_WMEMCHR 1" >>confdefs.h
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467
30468 if test $ac_cv_func_wmempcpy = no; then
30469 HAVE_WMEMPCPY=0
30470 fi
30471
30472 if test $HAVE_WMEMPCPY = 0; then
30473
30474
30475
30476
30477
30478
30479
30480
30481 gl_LIBOBJS="$gl_LIBOBJS wmempcpy.$ac_objext"
30482
30483 fi
30484
30485
30486
30487
30488
30489 GNULIB_WMEMPCPY=1
30490
30491
30492
30493
30494
30495$as_echo "#define GNULIB_TEST_WMEMPCPY 1" >>confdefs.h
30496
30497
30498
c971b7fa
PA
30499 # End of code from modules
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509 gltests_libdeps=
30510 gltests_ltlibdeps=
30511
30512
30513
30514
30515
30516
30517
30518
30519
5df4cba6 30520
c971b7fa
PA
30521 gl_source_base='tests'
30522 gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
30523
30524 gl_module_indicator_condition=$gltests_WITNESS
30525
30526
30527
30528
30529
30530
30531
30532
30533
30534 LIBGNU_LIBDEPS="$gl_libdeps"
30535
30536 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
30537
30538
30539
d0ac1c44 30540am__api_version='1.15'
c971b7fa
PA
30541
30542# Find a good install program. We prefer a C program (faster),
30543# so one script is as good as another. But avoid the broken or
30544# incompatible versions:
30545# SysV /etc/install, /usr/sbin/install
30546# SunOS /usr/etc/install
30547# IRIX /sbin/install
30548# AIX /bin/install
30549# AmigaOS /C/install, which installs bootblocks on floppy discs
30550# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
30551# AFS /usr/afsws/bin/install, which mishandles nonexistent args
30552# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
30553# OS/2's system install, which has a completely different semantic
30554# ./install, which can be erroneously created by make from ./install.sh.
30555# Reject install programs that cannot install multiple files.
30556{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
30557$as_echo_n "checking for a BSD-compatible install... " >&6; }
30558if test -z "$INSTALL"; then
d0ac1c44 30559if ${ac_cv_path_install+:} false; then :
c971b7fa
PA
30560 $as_echo_n "(cached) " >&6
30561else
30562 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30563for as_dir in $PATH
30564do
30565 IFS=$as_save_IFS
30566 test -z "$as_dir" && as_dir=.
30567 # Account for people who put trailing slashes in PATH elements.
30568case $as_dir/ in #((
30569 ./ | .// | /[cC]/* | \
30570 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
30571 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
30572 /usr/ucb/* ) ;;
30573 *)
30574 # OSF1 and SCO ODT 3.0 have their own names for install.
30575 # Don't use installbsd from OSF since it installs stuff as root
30576 # by default.
30577 for ac_prog in ginstall scoinst install; do
30578 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30579 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
c971b7fa
PA
30580 if test $ac_prog = install &&
30581 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
30582 # AIX install. It has an incompatible calling convention.
30583 :
30584 elif test $ac_prog = install &&
30585 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
30586 # program-specific install script used by HP pwplus--don't use.
30587 :
30588 else
30589 rm -rf conftest.one conftest.two conftest.dir
30590 echo one > conftest.one
30591 echo two > conftest.two
30592 mkdir conftest.dir
30593 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
30594 test -s conftest.one && test -s conftest.two &&
30595 test -s conftest.dir/conftest.one &&
30596 test -s conftest.dir/conftest.two
30597 then
30598 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
30599 break 3
30600 fi
30601 fi
30602 fi
30603 done
30604 done
30605 ;;
30606esac
30607
30608 done
30609IFS=$as_save_IFS
30610
30611rm -rf conftest.one conftest.two conftest.dir
30612
30613fi
30614 if test "${ac_cv_path_install+set}" = set; then
30615 INSTALL=$ac_cv_path_install
30616 else
30617 # As a last resort, use the slow shell script. Don't cache a
30618 # value for INSTALL within a source directory, because that will
30619 # break other packages using the cache if that directory is
30620 # removed, or if the value is a relative name.
30621 INSTALL=$ac_install_sh
30622 fi
30623fi
30624{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
30625$as_echo "$INSTALL" >&6; }
30626
30627# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
30628# It thinks the first close brace ends the variable substitution.
30629test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
30630
30631test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
30632
30633test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
30634
30635{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
30636$as_echo_n "checking whether build environment is sane... " >&6; }
c971b7fa
PA
30637# Reject unsafe characters in $srcdir or the absolute working directory
30638# name. Accept space and tab only in the latter.
30639am_lf='
30640'
30641case `pwd` in
30642 *[\\\"\#\$\&\'\`$am_lf]*)
d0ac1c44 30643 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
c971b7fa
PA
30644esac
30645case $srcdir in
30646 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
d0ac1c44 30647 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
c971b7fa
PA
30648esac
30649
d0ac1c44 30650# Do 'set' in a subshell so we don't clobber the current shell's
c971b7fa
PA
30651# arguments. Must try -L first in case configure is actually a
30652# symlink; some systems play weird games with the mod time of symlinks
30653# (eg FreeBSD returns the mod time of the symlink's containing
30654# directory).
30655if (
d0ac1c44
SM
30656 am_has_slept=no
30657 for am_try in 1 2; do
30658 echo "timestamp, slept: $am_has_slept" > conftest.file
30659 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
30660 if test "$*" = "X"; then
30661 # -L didn't work.
30662 set X `ls -t "$srcdir/configure" conftest.file`
30663 fi
30664 if test "$*" != "X $srcdir/configure conftest.file" \
30665 && test "$*" != "X conftest.file $srcdir/configure"; then
30666
30667 # If neither matched, then we have a broken ls. This can happen
30668 # if, for instance, CONFIG_SHELL is bash and it inherits a
30669 # broken ls alias from the environment. This has actually
30670 # happened. Such a system could not be considered "sane".
30671 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
30672 alias in your environment" "$LINENO" 5
30673 fi
30674 if test "$2" = conftest.file || test $am_try -eq 2; then
30675 break
30676 fi
30677 # Just in case.
30678 sleep 1
30679 am_has_slept=yes
30680 done
c971b7fa
PA
30681 test "$2" = conftest.file
30682 )
30683then
30684 # Ok.
30685 :
30686else
d0ac1c44 30687 as_fn_error $? "newly created file is older than distributed files!
c971b7fa
PA
30688Check your system clock" "$LINENO" 5
30689fi
30690{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30691$as_echo "yes" >&6; }
d0ac1c44
SM
30692# If we didn't sleep, we still need to ensure time stamps of config.status and
30693# generated files are strictly newer.
30694am_sleep_pid=
30695if grep 'slept: no' conftest.file >/dev/null 2>&1; then
30696 ( sleep 1 ) &
30697 am_sleep_pid=$!
30698fi
30699
30700rm -f conftest.file
30701
c971b7fa
PA
30702test "$program_prefix" != NONE &&
30703 program_transform_name="s&^&$program_prefix&;$program_transform_name"
30704# Use a double $ so make ignores it.
30705test "$program_suffix" != NONE &&
30706 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
30707# Double any \ or $.
30708# By default was `s,x,x', remove it if useless.
30709ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
30710program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
30711
c0c3707f
CB
30712# Expand $ac_aux_dir to an absolute path.
30713am_aux_dir=`cd "$ac_aux_dir" && pwd`
30714
c971b7fa
PA
30715if test x"${MISSING+set}" != xset; then
30716 case $am_aux_dir in
30717 *\ * | *\ *)
30718 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
30719 *)
30720 MISSING="\${SHELL} $am_aux_dir/missing" ;;
30721 esac
30722fi
30723# Use eval to expand $SHELL
d0ac1c44
SM
30724if eval "$MISSING --is-lightweight"; then
30725 am_missing_run="$MISSING "
c971b7fa
PA
30726else
30727 am_missing_run=
d0ac1c44
SM
30728 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
30729$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
c971b7fa
PA
30730fi
30731
d0ac1c44 30732if test x"${install_sh+set}" != xset; then
c971b7fa
PA
30733 case $am_aux_dir in
30734 *\ * | *\ *)
30735 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
30736 *)
30737 install_sh="\${SHELL} $am_aux_dir/install-sh"
30738 esac
30739fi
30740
d0ac1c44
SM
30741# Installed binaries are usually stripped using 'strip' when the user
30742# run "make install-strip". However 'strip' might not be the right
c971b7fa 30743# tool to use in cross-compilation environments, therefore Automake
d0ac1c44 30744# will honor the 'STRIP' environment variable to overrule this program.
c971b7fa
PA
30745if test "$cross_compiling" != no; then
30746 if test -n "$ac_tool_prefix"; then
30747 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
30748set dummy ${ac_tool_prefix}strip; ac_word=$2
30749{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30750$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30751if ${ac_cv_prog_STRIP+:} false; then :
c971b7fa
PA
30752 $as_echo_n "(cached) " >&6
30753else
30754 if test -n "$STRIP"; then
30755 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
30756else
30757as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30758for as_dir in $PATH
30759do
30760 IFS=$as_save_IFS
30761 test -z "$as_dir" && as_dir=.
30762 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30763 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30764 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
30765 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30766 break 2
30767 fi
30768done
30769 done
30770IFS=$as_save_IFS
30771
30772fi
30773fi
30774STRIP=$ac_cv_prog_STRIP
30775if test -n "$STRIP"; then
30776 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
30777$as_echo "$STRIP" >&6; }
30778else
30779 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30780$as_echo "no" >&6; }
30781fi
30782
30783
30784fi
30785if test -z "$ac_cv_prog_STRIP"; then
30786 ac_ct_STRIP=$STRIP
30787 # Extract the first word of "strip", so it can be a program name with args.
30788set dummy strip; ac_word=$2
30789{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30790$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30791if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
c971b7fa
PA
30792 $as_echo_n "(cached) " >&6
30793else
30794 if test -n "$ac_ct_STRIP"; then
30795 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
30796else
30797as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30798for as_dir in $PATH
30799do
30800 IFS=$as_save_IFS
30801 test -z "$as_dir" && as_dir=.
30802 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30803 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30804 ac_cv_prog_ac_ct_STRIP="strip"
30805 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30806 break 2
30807 fi
30808done
30809 done
30810IFS=$as_save_IFS
30811
30812fi
30813fi
30814ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
30815if test -n "$ac_ct_STRIP"; then
30816 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
30817$as_echo "$ac_ct_STRIP" >&6; }
30818else
30819 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30820$as_echo "no" >&6; }
30821fi
30822
30823 if test "x$ac_ct_STRIP" = x; then
30824 STRIP=":"
30825 else
30826 case $cross_compiling:$ac_tool_warned in
30827yes:)
30828{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
30829$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
30830ac_tool_warned=yes ;;
30831esac
30832 STRIP=$ac_ct_STRIP
30833 fi
30834else
30835 STRIP="$ac_cv_prog_STRIP"
30836fi
30837
30838fi
30839INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
30840
c971b7fa
PA
30841for ac_prog in gawk mawk nawk awk
30842do
30843 # Extract the first word of "$ac_prog", so it can be a program name with args.
30844set dummy $ac_prog; ac_word=$2
30845{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30846$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30847if ${ac_cv_prog_AWK+:} false; then :
c971b7fa
PA
30848 $as_echo_n "(cached) " >&6
30849else
30850 if test -n "$AWK"; then
30851 ac_cv_prog_AWK="$AWK" # Let the user override the test.
30852else
30853as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30854for as_dir in $PATH
30855do
30856 IFS=$as_save_IFS
30857 test -z "$as_dir" && as_dir=.
30858 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30859 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30860 ac_cv_prog_AWK="$ac_prog"
30861 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30862 break 2
30863 fi
30864done
30865 done
30866IFS=$as_save_IFS
30867
30868fi
30869fi
30870AWK=$ac_cv_prog_AWK
30871if test -n "$AWK"; then
30872 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
30873$as_echo "$AWK" >&6; }
30874else
30875 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30876$as_echo "no" >&6; }
30877fi
30878
30879
30880 test -n "$AWK" && break
30881done
30882
30883{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
30884$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
30885set x ${MAKE-make}
30886ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
d0ac1c44 30887if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
c971b7fa
PA
30888 $as_echo_n "(cached) " >&6
30889else
30890 cat >conftest.make <<\_ACEOF
30891SHELL = /bin/sh
30892all:
30893 @echo '@@@%%%=$(MAKE)=@@@%%%'
30894_ACEOF
d0ac1c44 30895# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
c971b7fa
PA
30896case `${MAKE-make} -f conftest.make 2>/dev/null` in
30897 *@@@%%%=?*=@@@%%%*)
30898 eval ac_cv_prog_make_${ac_make}_set=yes;;
30899 *)
30900 eval ac_cv_prog_make_${ac_make}_set=no;;
30901esac
30902rm -f conftest.make
30903fi
30904if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
30905 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30906$as_echo "yes" >&6; }
30907 SET_MAKE=
30908else
30909 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30910$as_echo "no" >&6; }
30911 SET_MAKE="MAKE=${MAKE-make}"
30912fi
30913
30914rm -rf .tst 2>/dev/null
30915mkdir .tst 2>/dev/null
30916if test -d .tst; then
30917 am__leading_dot=.
30918else
30919 am__leading_dot=_
30920fi
30921rmdir .tst 2>/dev/null
30922
30923DEPDIR="${am__leading_dot}deps"
30924
30925ac_config_commands="$ac_config_commands depfiles"
30926
30927
30928am_make=${MAKE-make}
30929cat > confinc << 'END'
30930am__doit:
30931 @echo this is the am__doit target
30932.PHONY: am__doit
30933END
30934# If we don't find an include directive, just comment out the code.
30935{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
30936$as_echo_n "checking for style of include used by $am_make... " >&6; }
30937am__include="#"
30938am__quote=
30939_am_result=none
30940# First try GNU make style include.
30941echo "include confinc" > confmf
d0ac1c44 30942# Ignore all kinds of additional output from 'make'.
c971b7fa
PA
30943case `$am_make -s -f confmf 2> /dev/null` in #(
30944*the\ am__doit\ target*)
30945 am__include=include
30946 am__quote=
30947 _am_result=GNU
30948 ;;
30949esac
30950# Now try BSD make style include.
30951if test "$am__include" = "#"; then
30952 echo '.include "confinc"' > confmf
30953 case `$am_make -s -f confmf 2> /dev/null` in #(
30954 *the\ am__doit\ target*)
30955 am__include=.include
30956 am__quote="\""
30957 _am_result=BSD
30958 ;;
30959 esac
30960fi
30961
30962
30963{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
30964$as_echo "$_am_result" >&6; }
30965rm -f confinc confmf
30966
30967# Check whether --enable-dependency-tracking was given.
30968if test "${enable_dependency_tracking+set}" = set; then :
30969 enableval=$enable_dependency_tracking;
30970fi
30971
30972if test "x$enable_dependency_tracking" != xno; then
30973 am_depcomp="$ac_aux_dir/depcomp"
30974 AMDEPBACKSLASH='\'
d0ac1c44 30975 am__nodep='_no'
c971b7fa
PA
30976fi
30977 if test "x$enable_dependency_tracking" != xno; then
30978 AMDEP_TRUE=
30979 AMDEP_FALSE='#'
30980else
30981 AMDEP_TRUE='#'
30982 AMDEP_FALSE=
30983fi
30984
30985
d0ac1c44
SM
30986# Check whether --enable-silent-rules was given.
30987if test "${enable_silent_rules+set}" = set; then :
30988 enableval=$enable_silent_rules;
30989fi
30990
30991case $enable_silent_rules in # (((
30992 yes) AM_DEFAULT_VERBOSITY=0;;
30993 no) AM_DEFAULT_VERBOSITY=1;;
30994 *) AM_DEFAULT_VERBOSITY=1;;
30995esac
30996am_make=${MAKE-make}
30997{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
30998$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
30999if ${am_cv_make_support_nested_variables+:} false; then :
31000 $as_echo_n "(cached) " >&6
31001else
31002 if $as_echo 'TRUE=$(BAR$(V))
31003BAR0=false
31004BAR1=true
31005V=1
31006am__doit:
31007 @$(TRUE)
31008.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
31009 am_cv_make_support_nested_variables=yes
31010else
31011 am_cv_make_support_nested_variables=no
31012fi
31013fi
31014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
31015$as_echo "$am_cv_make_support_nested_variables" >&6; }
31016if test $am_cv_make_support_nested_variables = yes; then
31017 AM_V='$(V)'
31018 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
31019else
31020 AM_V=$AM_DEFAULT_VERBOSITY
31021 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
31022fi
31023AM_BACKSLASH='\'
31024
c971b7fa
PA
31025if test "`cd $srcdir && pwd`" != "`pwd`"; then
31026 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
31027 # is not polluted with repeated "-I."
31028 am__isrc=' -I$(srcdir)'
31029 # test to see if srcdir already configured
31030 if test -f $srcdir/config.status; then
d0ac1c44 31031 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
c971b7fa
PA
31032 fi
31033fi
31034
31035# test whether we have cygpath
31036if test -z "$CYGPATH_W"; then
31037 if (cygpath --version) >/dev/null 2>/dev/null; then
31038 CYGPATH_W='cygpath -w'
31039 else
31040 CYGPATH_W=echo
31041 fi
31042fi
31043
31044
31045# Define the identity of the package.
d0ac1c44
SM
31046 PACKAGE='libgnu'
31047 VERSION='UNUSED-VERSION'
c971b7fa
PA
31048
31049
31050# Some tools Automake needs.
31051
31052ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
31053
31054
31055AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
31056
31057
31058AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
31059
31060
31061AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
31062
31063
31064MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
31065
d0ac1c44
SM
31066# For better backward compatibility. To be removed once Automake 1.9.x
31067# dies out for good. For more background, see:
31068# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
31069# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
31070mkdir_p='$(MKDIR_P)'
31071
31072# We need awk for the "check" target (and possibly the TAP driver). The
31073# system "awk" is bad on some platforms.
31074# Always define AMTAR for backward compatibility. Yes, it's still used
31075# in the wild :-( We should find a proper way to deprecate it ...
31076AMTAR='$${TAR-tar}'
31077
31078
31079# We'll loop over all known methods to create a tar archive until one works.
31080_am_tools='gnutar pax cpio none'
c971b7fa 31081
d0ac1c44 31082am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
c971b7fa 31083
c971b7fa
PA
31084
31085
31086
31087
31088depcc="$CC" am_compiler_list=
31089
31090{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
31091$as_echo_n "checking dependency style of $depcc... " >&6; }
d0ac1c44 31092if ${am_cv_CC_dependencies_compiler_type+:} false; then :
c971b7fa
PA
31093 $as_echo_n "(cached) " >&6
31094else
31095 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
31096 # We make a subdir and do the tests there. Otherwise we can end up
31097 # making bogus files that we don't know about and never remove. For
31098 # instance it was reported that on HP-UX the gcc test will end up
d0ac1c44
SM
31099 # making a dummy file named 'D' -- because '-MD' means "put the output
31100 # in D".
31101 rm -rf conftest.dir
c971b7fa
PA
31102 mkdir conftest.dir
31103 # Copy depcomp to subdir because otherwise we won't find it if we're
31104 # using a relative directory.
31105 cp "$am_depcomp" conftest.dir
31106 cd conftest.dir
31107 # We will build objects and dependencies in a subdirectory because
31108 # it helps to detect inapplicable dependency modes. For instance
31109 # both Tru64's cc and ICC support -MD to output dependencies as a
31110 # side effect of compilation, but ICC will put the dependencies in
31111 # the current directory while Tru64 will put them in the object
31112 # directory.
31113 mkdir sub
31114
31115 am_cv_CC_dependencies_compiler_type=none
31116 if test "$am_compiler_list" = ""; then
31117 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
31118 fi
31119 am__universal=false
31120 case " $depcc " in #(
31121 *\ -arch\ *\ -arch\ *) am__universal=true ;;
31122 esac
31123
31124 for depmode in $am_compiler_list; do
31125 # Setup a source with many dependencies, because some compilers
31126 # like to wrap large dependency lists on column 80 (with \), and
31127 # we should not choose a depcomp mode which is confused by this.
31128 #
31129 # We need to recreate these files for each test, as the compiler may
31130 # overwrite some of them when testing with obscure command lines.
31131 # This happens at least with the AIX C compiler.
31132 : > sub/conftest.c
31133 for i in 1 2 3 4 5 6; do
31134 echo '#include "conftst'$i'.h"' >> sub/conftest.c
d0ac1c44
SM
31135 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
31136 # Solaris 10 /bin/sh.
31137 echo '/* dummy */' > sub/conftst$i.h
c971b7fa
PA
31138 done
31139 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
31140
d0ac1c44 31141 # We check with '-c' and '-o' for the sake of the "dashmstdout"
c971b7fa 31142 # mode. It turns out that the SunPro C++ compiler does not properly
d0ac1c44
SM
31143 # handle '-M -o', and we need to detect this. Also, some Intel
31144 # versions had trouble with output in subdirs.
c971b7fa
PA
31145 am__obj=sub/conftest.${OBJEXT-o}
31146 am__minus_obj="-o $am__obj"
31147 case $depmode in
31148 gcc)
31149 # This depmode causes a compiler race in universal mode.
31150 test "$am__universal" = false || continue
31151 ;;
31152 nosideeffect)
d0ac1c44
SM
31153 # After this tag, mechanisms are not by side-effect, so they'll
31154 # only be used when explicitly requested.
c971b7fa
PA
31155 if test "x$enable_dependency_tracking" = xyes; then
31156 continue
31157 else
31158 break
31159 fi
31160 ;;
d0ac1c44
SM
31161 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
31162 # This compiler won't grok '-c -o', but also, the minuso test has
c971b7fa
PA
31163 # not run yet. These depmodes are late enough in the game, and
31164 # so weak that their functioning should not be impacted.
31165 am__obj=conftest.${OBJEXT-o}
31166 am__minus_obj=
31167 ;;
31168 none) break ;;
31169 esac
31170 if depmode=$depmode \
31171 source=sub/conftest.c object=$am__obj \
31172 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
31173 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
31174 >/dev/null 2>conftest.err &&
31175 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
31176 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
31177 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
31178 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
31179 # icc doesn't choke on unknown options, it will just issue warnings
31180 # or remarks (even with -Werror). So we grep stderr for any message
31181 # that says an option was ignored or not supported.
31182 # When given -MP, icc 7.0 and 7.1 complain thusly:
31183 # icc: Command line warning: ignoring option '-M'; no argument required
31184 # The diagnosis changed in icc 8.0:
31185 # icc: Command line remark: option '-MP' not supported
31186 if (grep 'ignoring option' conftest.err ||
31187 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
31188 am_cv_CC_dependencies_compiler_type=$depmode
31189 break
31190 fi
31191 fi
31192 done
31193
31194 cd ..
31195 rm -rf conftest.dir
31196else
31197 am_cv_CC_dependencies_compiler_type=none
31198fi
31199
31200fi
31201{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
31202$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
31203CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
31204
31205 if
31206 test "x$enable_dependency_tracking" != xno \
31207 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
31208 am__fastdepCC_TRUE=
31209 am__fastdepCC_FALSE='#'
31210else
31211 am__fastdepCC_TRUE='#'
31212 am__fastdepCC_FALSE=
31213fi
31214
31215
31216
d0ac1c44
SM
31217# POSIX will say in a future version that running "rm -f" with no argument
31218# is OK; and we want to be able to make that assumption in our Makefile
31219# recipes. So use an aggressive probe to check that the usage we want is
31220# actually supported "in the wild" to an acceptable degree.
31221# See automake bug#10828.
31222# To make any issue more visible, cause the running configure to be aborted
31223# by default if the 'rm' program in use doesn't match our expectations; the
31224# user can still override this though.
31225if rm -f && rm -fr && rm -rf; then : OK; else
31226 cat >&2 <<'END'
31227Oops!
31228
31229Your 'rm' program seems unable to run without file operands specified
31230on the command line, even when the '-f' option is present. This is contrary
31231to the behaviour of most rm programs out there, and not conforming with
31232the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
31233
31234Please tell bug-automake@gnu.org about your system, including the value
31235of your $PATH and any error possibly output before this message. This
31236can help us improve future automake versions.
31237
31238END
31239 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
31240 echo 'Configuration will proceed anyway, since you have set the' >&2
31241 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
31242 echo >&2
31243 else
31244 cat >&2 <<'END'
31245Aborting the configuration process, to ensure you take notice of the issue.
31246
31247You can download and install GNU coreutils to get an 'rm' implementation
31248that behaves properly: <http://www.gnu.org/software/coreutils/>.
31249
31250If you want to complete the configuration process using your problematic
31251'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
31252to "yes", and re-run configure.
31253
31254END
31255 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
31256 fi
31257fi
31258
c971b7fa 31259
39be3c7e
SM
31260# Check whether --enable-silent-rules was given.
31261if test "${enable_silent_rules+set}" = set; then :
31262 enableval=$enable_silent_rules;
31263fi
31264
d0ac1c44
SM
31265case $enable_silent_rules in # (((
31266 yes) AM_DEFAULT_VERBOSITY=0;;
31267 no) AM_DEFAULT_VERBOSITY=1;;
31268 *) AM_DEFAULT_VERBOSITY=0;;
39be3c7e 31269esac
d0ac1c44
SM
31270am_make=${MAKE-make}
31271{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
31272$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
31273if ${am_cv_make_support_nested_variables+:} false; then :
31274 $as_echo_n "(cached) " >&6
31275else
31276 if $as_echo 'TRUE=$(BAR$(V))
31277BAR0=false
31278BAR1=true
31279V=1
31280am__doit:
31281 @$(TRUE)
31282.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
31283 am_cv_make_support_nested_variables=yes
31284else
31285 am_cv_make_support_nested_variables=no
31286fi
31287fi
31288{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
31289$as_echo "$am_cv_make_support_nested_variables" >&6; }
31290if test $am_cv_make_support_nested_variables = yes; then
31291 AM_V='$(V)'
31292 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
31293else
31294 AM_V=$AM_DEFAULT_VERBOSITY
31295 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
31296fi
39be3c7e
SM
31297AM_BACKSLASH='\'
31298
31299
c971b7fa
PA
31300# --------------------- #
31301# Checks for programs. #
31302# --------------------- #
31303
31304
31305{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
31306$as_echo_n "checking whether ln -s works... " >&6; }
31307LN_S=$as_ln_s
31308if test "$LN_S" = "ln -s"; then
31309 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
31310$as_echo "yes" >&6; }
31311else
31312 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
31313$as_echo "no, using $LN_S" >&6; }
31314fi
31315
31316if test -n "$ac_tool_prefix"; then
31317 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
31318set dummy ${ac_tool_prefix}ranlib; ac_word=$2
31319{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31320$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31321if ${ac_cv_prog_RANLIB+:} false; then :
c971b7fa
PA
31322 $as_echo_n "(cached) " >&6
31323else
31324 if test -n "$RANLIB"; then
31325 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
31326else
31327as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31328for as_dir in $PATH
31329do
31330 IFS=$as_save_IFS
31331 test -z "$as_dir" && as_dir=.
31332 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31333 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31334 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
31335 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31336 break 2
31337 fi
31338done
31339 done
31340IFS=$as_save_IFS
31341
31342fi
31343fi
31344RANLIB=$ac_cv_prog_RANLIB
31345if test -n "$RANLIB"; then
31346 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
31347$as_echo "$RANLIB" >&6; }
31348else
31349 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31350$as_echo "no" >&6; }
31351fi
31352
31353
31354fi
31355if test -z "$ac_cv_prog_RANLIB"; then
31356 ac_ct_RANLIB=$RANLIB
31357 # Extract the first word of "ranlib", so it can be a program name with args.
31358set dummy ranlib; ac_word=$2
31359{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31360$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31361if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
31362 $as_echo_n "(cached) " >&6
31363else
31364 if test -n "$ac_ct_RANLIB"; then
31365 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
31366else
31367as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31368for as_dir in $PATH
31369do
31370 IFS=$as_save_IFS
31371 test -z "$as_dir" && as_dir=.
31372 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31373 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31374 ac_cv_prog_ac_ct_RANLIB="ranlib"
31375 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31376 break 2
31377 fi
31378done
31379 done
31380IFS=$as_save_IFS
31381
31382fi
31383fi
31384ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
31385if test -n "$ac_ct_RANLIB"; then
31386 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
31387$as_echo "$ac_ct_RANLIB" >&6; }
31388else
31389 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31390$as_echo "no" >&6; }
31391fi
31392
31393 if test "x$ac_ct_RANLIB" = x; then
31394 RANLIB=":"
31395 else
31396 case $cross_compiling:$ac_tool_warned in
31397yes:)
31398{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
31399$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
31400ac_tool_warned=yes ;;
31401esac
31402 RANLIB=$ac_ct_RANLIB
31403 fi
31404else
31405 RANLIB="$ac_cv_prog_RANLIB"
31406fi
31407
31408
31409if test -n "$ac_tool_prefix"; then
31410 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
31411set dummy ${ac_tool_prefix}ar; ac_word=$2
31412{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31413$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31414if ${ac_cv_prog_AR+:} false; then :
c971b7fa
PA
31415 $as_echo_n "(cached) " >&6
31416else
31417 if test -n "$AR"; then
31418 ac_cv_prog_AR="$AR" # Let the user override the test.
31419else
31420as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31421for as_dir in $PATH
31422do
31423 IFS=$as_save_IFS
31424 test -z "$as_dir" && as_dir=.
31425 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31426 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31427 ac_cv_prog_AR="${ac_tool_prefix}ar"
31428 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31429 break 2
31430 fi
31431done
31432 done
31433IFS=$as_save_IFS
31434
31435fi
31436fi
31437AR=$ac_cv_prog_AR
31438if test -n "$AR"; then
31439 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
31440$as_echo "$AR" >&6; }
31441else
31442 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31443$as_echo "no" >&6; }
31444fi
31445
31446
31447fi
31448if test -z "$ac_cv_prog_AR"; then
31449 ac_ct_AR=$AR
31450 # Extract the first word of "ar", so it can be a program name with args.
31451set dummy ar; ac_word=$2
31452{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31453$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31454if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
31455 $as_echo_n "(cached) " >&6
31456else
31457 if test -n "$ac_ct_AR"; then
31458 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
31459else
31460as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31461for as_dir in $PATH
31462do
31463 IFS=$as_save_IFS
31464 test -z "$as_dir" && as_dir=.
31465 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31466 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31467 ac_cv_prog_ac_ct_AR="ar"
31468 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31469 break 2
31470 fi
31471done
31472 done
31473IFS=$as_save_IFS
31474
31475fi
31476fi
31477ac_ct_AR=$ac_cv_prog_ac_ct_AR
31478if test -n "$ac_ct_AR"; then
31479 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
31480$as_echo "$ac_ct_AR" >&6; }
31481else
31482 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31483$as_echo "no" >&6; }
31484fi
31485
31486 if test "x$ac_ct_AR" = x; then
31487 AR=""
31488 else
31489 case $cross_compiling:$ac_tool_warned in
31490yes:)
31491{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
31492$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
31493ac_tool_warned=yes ;;
31494esac
31495 AR=$ac_ct_AR
31496 fi
31497else
31498 AR="$ac_cv_prog_AR"
31499fi
31500
31501
31502# ---------------------- #
31503# Checks for libraries. #
31504# ---------------------- #
31505
361cb219
AB
31506ac_config_files="$ac_config_files Makefile.gnulib.inc"
31507
31508
c971b7fa
PA
31509ac_config_files="$ac_config_files Makefile import/Makefile"
31510
31511ac_config_commands="$ac_config_commands default"
31512
31513cat >confcache <<\_ACEOF
31514# This file is a shell script that caches the results of configure
31515# tests run on this system so they can be shared between configure
31516# scripts and configure runs, see configure's option --config-cache.
31517# It is not useful on other systems. If it contains results you don't
31518# want to keep, you may remove or edit it.
31519#
31520# config.status only pays attention to the cache file if you give it
31521# the --recheck option to rerun configure.
31522#
31523# `ac_cv_env_foo' variables (set or unset) will be overridden when
31524# loading this file, other *unset* `ac_cv_foo' will be assigned the
31525# following values.
31526
31527_ACEOF
31528
31529# The following way of writing the cache mishandles newlines in values,
31530# but we know of no workaround that is simple, portable, and efficient.
31531# So, we kill variables containing newlines.
31532# Ultrix sh set writes to stderr and can't be redirected directly,
31533# and sets the high bit in the cache file unless we assign to the vars.
31534(
31535 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
31536 eval ac_val=\$$ac_var
31537 case $ac_val in #(
31538 *${as_nl}*)
31539 case $ac_var in #(
31540 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
31541$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
31542 esac
31543 case $ac_var in #(
31544 _ | IFS | as_nl) ;; #(
31545 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
31546 *) { eval $ac_var=; unset $ac_var;} ;;
31547 esac ;;
31548 esac
31549 done
31550
31551 (set) 2>&1 |
31552 case $as_nl`(ac_space=' '; set) 2>&1` in #(
31553 *${as_nl}ac_space=\ *)
31554 # `set' does not quote correctly, so add quotes: double-quote
31555 # substitution turns \\\\ into \\, and sed turns \\ into \.
31556 sed -n \
31557 "s/'/'\\\\''/g;
31558 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
31559 ;; #(
31560 *)
31561 # `set' quotes correctly as required by POSIX, so do not add quotes.
31562 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
31563 ;;
31564 esac |
31565 sort
31566) |
31567 sed '
31568 /^ac_cv_env_/b end
31569 t clear
31570 :clear
31571 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
31572 t end
31573 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
31574 :end' >>confcache
31575if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
31576 if test -w "$cache_file"; then
d0ac1c44 31577 if test "x$cache_file" != "x/dev/null"; then
c971b7fa
PA
31578 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
31579$as_echo "$as_me: updating cache $cache_file" >&6;}
d0ac1c44
SM
31580 if test ! -f "$cache_file" || test -h "$cache_file"; then
31581 cat confcache >"$cache_file"
31582 else
31583 case $cache_file in #(
31584 */* | ?:*)
31585 mv -f confcache "$cache_file"$$ &&
31586 mv -f "$cache_file"$$ "$cache_file" ;; #(
31587 *)
31588 mv -f confcache "$cache_file" ;;
31589 esac
31590 fi
31591 fi
c971b7fa
PA
31592 else
31593 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
31594$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
31595 fi
31596fi
31597rm -f confcache
31598
31599test "x$prefix" = xNONE && prefix=$ac_default_prefix
31600# Let make expand exec_prefix.
31601test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
31602
31603DEFS=-DHAVE_CONFIG_H
31604
31605ac_libobjs=
31606ac_ltlibobjs=
31607for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
31608 # 1. Remove the extension, and $U if already installed.
31609 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
31610 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
31611 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
31612 # will be set to the directory where LIBOBJS objects are built.
31613 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
31614 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
31615done
31616LIBOBJS=$ac_libobjs
31617
31618LTLIBOBJS=$ac_ltlibobjs
31619
31620
31621if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
d0ac1c44 31622 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
c971b7fa
PA
31623Usually this means the macro was only invoked conditionally." "$LINENO" 5
31624fi
31625if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
d0ac1c44 31626 as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
c971b7fa
PA
31627Usually this means the macro was only invoked conditionally." "$LINENO" 5
31628fi
8690e634 31629if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
d0ac1c44 31630 as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
8690e634
JK
31631Usually this means the macro was only invoked conditionally." "$LINENO" 5
31632fi
18848e28 31633if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
d0ac1c44 31634 as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
18848e28
GF
31635Usually this means the macro was only invoked conditionally." "$LINENO" 5
31636fi
88b48903 31637if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
d0ac1c44 31638 as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
88b48903
WN
31639Usually this means the macro was only invoked conditionally." "$LINENO" 5
31640fi
8690e634 31641if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
d0ac1c44 31642 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
8690e634
JK
31643Usually this means the macro was only invoked conditionally." "$LINENO" 5
31644fi
c0c3707f
CB
31645if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
31646 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
31647Usually this means the macro was only invoked conditionally." "$LINENO" 5
31648fi
31649if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
31650 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
31651Usually this means the macro was only invoked conditionally." "$LINENO" 5
31652fi
6ec2e0f5 31653if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
d0ac1c44 31654 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
6ec2e0f5
SDJ
31655Usually this means the macro was only invoked conditionally." "$LINENO" 5
31656fi
49e4877c 31657if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 31658 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
31659Usually this means the macro was only invoked conditionally." "$LINENO" 5
31660fi
31661if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 31662 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
31663Usually this means the macro was only invoked conditionally." "$LINENO" 5
31664fi
c971b7fa 31665if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
d0ac1c44 31666 as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
c971b7fa
PA
31667Usually this means the macro was only invoked conditionally." "$LINENO" 5
31668fi
88b48903
WN
31669
31670
5df4cba6
SM
31671if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
31672 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
31673Usually this means the macro was only invoked conditionally." "$LINENO" 5
31674fi
725e2999
JB
31675if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
31676 as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
31677Usually this means the macro was only invoked conditionally." "$LINENO" 5
31678fi
31679if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
31680 as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
31681Usually this means the macro was only invoked conditionally." "$LINENO" 5
31682fi
8690e634 31683if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
d0ac1c44 31684 as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
8690e634
JK
31685Usually this means the macro was only invoked conditionally." "$LINENO" 5
31686fi
c971b7fa 31687if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
d0ac1c44 31688 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
c971b7fa
PA
31689Usually this means the macro was only invoked conditionally." "$LINENO" 5
31690fi
31691
31692 gl_libobjs=
31693 gl_ltlibobjs=
31694 if test -n "$gl_LIBOBJS"; then
31695 # Remove the extension.
31696 sed_drop_objext='s/\.o$//;s/\.obj$//'
31697 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
31698 gl_libobjs="$gl_libobjs $i.$ac_objext"
31699 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
31700 done
31701 fi
31702 gl_LIBOBJS=$gl_libobjs
31703
31704 gl_LTLIBOBJS=$gl_ltlibobjs
31705
31706
31707
31708 gltests_libobjs=
31709 gltests_ltlibobjs=
31710 if test -n "$gltests_LIBOBJS"; then
31711 # Remove the extension.
31712 sed_drop_objext='s/\.o$//;s/\.obj$//'
31713 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
31714 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
31715 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
31716 done
31717 fi
31718 gltests_LIBOBJS=$gltests_libobjs
31719
31720 gltests_LTLIBOBJS=$gltests_ltlibobjs
31721
31722
d0ac1c44
SM
31723{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
31724$as_echo_n "checking that generated files are newer than configure... " >&6; }
31725 if test -n "$am_sleep_pid"; then
31726 # Hide warnings about reused PIDs.
31727 wait $am_sleep_pid 2>/dev/null
31728 fi
31729 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
31730$as_echo "done" >&6; }
c971b7fa 31731if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
d0ac1c44 31732 as_fn_error $? "conditional \"AMDEP\" was never defined.
c971b7fa
PA
31733Usually this means the macro was only invoked conditionally." "$LINENO" 5
31734fi
31735if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
d0ac1c44 31736 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
c971b7fa
PA
31737Usually this means the macro was only invoked conditionally." "$LINENO" 5
31738fi
31739 if test -n "$EXEEXT"; then
31740 am__EXEEXT_TRUE=
31741 am__EXEEXT_FALSE='#'
31742else
31743 am__EXEEXT_TRUE='#'
31744 am__EXEEXT_FALSE=
31745fi
31746
31747
d0ac1c44 31748: "${CONFIG_STATUS=./config.status}"
c971b7fa
PA
31749ac_write_fail=0
31750ac_clean_files_save=$ac_clean_files
31751ac_clean_files="$ac_clean_files $CONFIG_STATUS"
31752{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
31753$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
31754as_write_fail=0
31755cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
31756#! $SHELL
31757# Generated by $as_me.
31758# Run this file to recreate the current configuration.
31759# Compiler output produced by configure, useful for debugging
31760# configure, is in config.log if it exists.
31761
31762debug=false
31763ac_cs_recheck=false
31764ac_cs_silent=false
31765
31766SHELL=\${CONFIG_SHELL-$SHELL}
31767export SHELL
31768_ASEOF
31769cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
31770## -------------------- ##
31771## M4sh Initialization. ##
31772## -------------------- ##
31773
31774# Be more Bourne compatible
31775DUALCASE=1; export DUALCASE # for MKS sh
31776if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
31777 emulate sh
31778 NULLCMD=:
31779 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
31780 # is contrary to our usage. Disable this feature.
31781 alias -g '${1+"$@"}'='"$@"'
31782 setopt NO_GLOB_SUBST
31783else
31784 case `(set -o) 2>/dev/null` in #(
31785 *posix*) :
31786 set -o posix ;; #(
31787 *) :
31788 ;;
31789esac
31790fi
31791
31792
31793as_nl='
31794'
31795export as_nl
31796# Printing a long string crashes Solaris 7 /usr/bin/printf.
31797as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
31798as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
31799as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
31800# Prefer a ksh shell builtin over an external printf program on Solaris,
31801# but without wasting forks for bash or zsh.
31802if test -z "$BASH_VERSION$ZSH_VERSION" \
31803 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
31804 as_echo='print -r --'
31805 as_echo_n='print -rn --'
31806elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
31807 as_echo='printf %s\n'
31808 as_echo_n='printf %s'
31809else
31810 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
31811 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
31812 as_echo_n='/usr/ucb/echo -n'
31813 else
31814 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
31815 as_echo_n_body='eval
31816 arg=$1;
31817 case $arg in #(
31818 *"$as_nl"*)
31819 expr "X$arg" : "X\\(.*\\)$as_nl";
31820 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
31821 esac;
31822 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
31823 '
31824 export as_echo_n_body
31825 as_echo_n='sh -c $as_echo_n_body as_echo'
31826 fi
31827 export as_echo_body
31828 as_echo='sh -c $as_echo_body as_echo'
31829fi
31830
31831# The user is always right.
31832if test "${PATH_SEPARATOR+set}" != set; then
31833 PATH_SEPARATOR=:
31834 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
31835 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
31836 PATH_SEPARATOR=';'
31837 }
31838fi
31839
31840
31841# IFS
31842# We need space, tab and new line, in precisely that order. Quoting is
31843# there to prevent editors from complaining about space-tab.
31844# (If _AS_PATH_WALK were called with IFS unset, it would disable word
31845# splitting by setting IFS to empty value.)
31846IFS=" "" $as_nl"
31847
31848# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 31849as_myself=
c971b7fa
PA
31850case $0 in #((
31851 *[\\/]* ) as_myself=$0 ;;
31852 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31853for as_dir in $PATH
31854do
31855 IFS=$as_save_IFS
31856 test -z "$as_dir" && as_dir=.
31857 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
31858 done
31859IFS=$as_save_IFS
31860
31861 ;;
31862esac
31863# We did not find ourselves, most probably we were run as `sh COMMAND'
31864# in which case we are not to be found in the path.
31865if test "x$as_myself" = x; then
31866 as_myself=$0
31867fi
31868if test ! -f "$as_myself"; then
31869 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
31870 exit 1
31871fi
31872
31873# Unset variables that we do not need and which cause bugs (e.g. in
31874# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
31875# suppresses any "Segmentation fault" message there. '((' could
31876# trigger a bug in pdksh 5.2.14.
31877for as_var in BASH_ENV ENV MAIL MAILPATH
31878do eval test x\${$as_var+set} = xset \
31879 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
31880done
31881PS1='$ '
31882PS2='> '
31883PS4='+ '
31884
31885# NLS nuisances.
31886LC_ALL=C
31887export LC_ALL
31888LANGUAGE=C
31889export LANGUAGE
31890
31891# CDPATH.
31892(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
31893
31894
d0ac1c44
SM
31895# as_fn_error STATUS ERROR [LINENO LOG_FD]
31896# ----------------------------------------
c971b7fa
PA
31897# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
31898# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 31899# script with STATUS, using 1 if that was 0.
c971b7fa
PA
31900as_fn_error ()
31901{
d0ac1c44
SM
31902 as_status=$1; test $as_status -eq 0 && as_status=1
31903 if test "$4"; then
31904 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
31905 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 31906 fi
d0ac1c44 31907 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
31908 as_fn_exit $as_status
31909} # as_fn_error
31910
31911
31912# as_fn_set_status STATUS
31913# -----------------------
31914# Set $? to STATUS, without forking.
31915as_fn_set_status ()
31916{
31917 return $1
31918} # as_fn_set_status
31919
31920# as_fn_exit STATUS
31921# -----------------
31922# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
31923as_fn_exit ()
31924{
31925 set +e
31926 as_fn_set_status $1
31927 exit $1
31928} # as_fn_exit
31929
31930# as_fn_unset VAR
31931# ---------------
31932# Portably unset VAR.
31933as_fn_unset ()
31934{
31935 { eval $1=; unset $1;}
31936}
31937as_unset=as_fn_unset
31938# as_fn_append VAR VALUE
31939# ----------------------
31940# Append the text in VALUE to the end of the definition contained in VAR. Take
31941# advantage of any shell optimizations that allow amortized linear growth over
31942# repeated appends, instead of the typical quadratic growth present in naive
31943# implementations.
31944if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
31945 eval 'as_fn_append ()
31946 {
31947 eval $1+=\$2
31948 }'
31949else
31950 as_fn_append ()
31951 {
31952 eval $1=\$$1\$2
31953 }
31954fi # as_fn_append
31955
31956# as_fn_arith ARG...
31957# ------------------
31958# Perform arithmetic evaluation on the ARGs, and store the result in the
31959# global $as_val. Take advantage of shells that can avoid forks. The arguments
31960# must be portable across $(()) and expr.
31961if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
31962 eval 'as_fn_arith ()
31963 {
31964 as_val=$(( $* ))
31965 }'
31966else
31967 as_fn_arith ()
31968 {
31969 as_val=`expr "$@" || test $? -eq 1`
31970 }
31971fi # as_fn_arith
31972
31973
31974if expr a : '\(a\)' >/dev/null 2>&1 &&
31975 test "X`expr 00001 : '.*\(...\)'`" = X001; then
31976 as_expr=expr
31977else
31978 as_expr=false
31979fi
31980
31981if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
31982 as_basename=basename
31983else
31984 as_basename=false
31985fi
31986
31987if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
31988 as_dirname=dirname
31989else
31990 as_dirname=false
31991fi
31992
31993as_me=`$as_basename -- "$0" ||
31994$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
31995 X"$0" : 'X\(//\)$' \| \
31996 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
31997$as_echo X/"$0" |
31998 sed '/^.*\/\([^/][^/]*\)\/*$/{
31999 s//\1/
32000 q
32001 }
32002 /^X\/\(\/\/\)$/{
32003 s//\1/
32004 q
32005 }
32006 /^X\/\(\/\).*/{
32007 s//\1/
32008 q
32009 }
32010 s/.*/./; q'`
32011
32012# Avoid depending upon Character Ranges.
32013as_cr_letters='abcdefghijklmnopqrstuvwxyz'
32014as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
32015as_cr_Letters=$as_cr_letters$as_cr_LETTERS
32016as_cr_digits='0123456789'
32017as_cr_alnum=$as_cr_Letters$as_cr_digits
32018
32019ECHO_C= ECHO_N= ECHO_T=
32020case `echo -n x` in #(((((
32021-n*)
32022 case `echo 'xy\c'` in
32023 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
32024 xy) ECHO_C='\c';;
32025 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
32026 ECHO_T=' ';;
32027 esac;;
32028*)
32029 ECHO_N='-n';;
32030esac
32031
32032rm -f conf$$ conf$$.exe conf$$.file
32033if test -d conf$$.dir; then
32034 rm -f conf$$.dir/conf$$.file
32035else
32036 rm -f conf$$.dir
32037 mkdir conf$$.dir 2>/dev/null
32038fi
32039if (echo >conf$$.file) 2>/dev/null; then
32040 if ln -s conf$$.file conf$$ 2>/dev/null; then
32041 as_ln_s='ln -s'
32042 # ... but there are two gotchas:
32043 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
32044 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 32045 # In both cases, we have to default to `cp -pR'.
c971b7fa 32046 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 32047 as_ln_s='cp -pR'
c971b7fa
PA
32048 elif ln conf$$.file conf$$ 2>/dev/null; then
32049 as_ln_s=ln
32050 else
d0ac1c44 32051 as_ln_s='cp -pR'
c971b7fa
PA
32052 fi
32053else
d0ac1c44 32054 as_ln_s='cp -pR'
c971b7fa
PA
32055fi
32056rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
32057rmdir conf$$.dir 2>/dev/null
32058
32059
32060# as_fn_mkdir_p
32061# -------------
32062# Create "$as_dir" as a directory, including parents if necessary.
32063as_fn_mkdir_p ()
32064{
32065
32066 case $as_dir in #(
32067 -*) as_dir=./$as_dir;;
32068 esac
32069 test -d "$as_dir" || eval $as_mkdir_p || {
32070 as_dirs=
32071 while :; do
32072 case $as_dir in #(
32073 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
32074 *) as_qdir=$as_dir;;
32075 esac
32076 as_dirs="'$as_qdir' $as_dirs"
32077 as_dir=`$as_dirname -- "$as_dir" ||
32078$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32079 X"$as_dir" : 'X\(//\)[^/]' \| \
32080 X"$as_dir" : 'X\(//\)$' \| \
32081 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
32082$as_echo X"$as_dir" |
32083 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32084 s//\1/
32085 q
32086 }
32087 /^X\(\/\/\)[^/].*/{
32088 s//\1/
32089 q
32090 }
32091 /^X\(\/\/\)$/{
32092 s//\1/
32093 q
32094 }
32095 /^X\(\/\).*/{
32096 s//\1/
32097 q
32098 }
32099 s/.*/./; q'`
32100 test -d "$as_dir" && break
32101 done
32102 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 32103 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
32104
32105
32106} # as_fn_mkdir_p
32107if mkdir -p . 2>/dev/null; then
32108 as_mkdir_p='mkdir -p "$as_dir"'
32109else
32110 test -d ./-p && rmdir ./-p
32111 as_mkdir_p=false
32112fi
32113
d0ac1c44
SM
32114
32115# as_fn_executable_p FILE
32116# -----------------------
32117# Test if FILE is an executable regular file.
32118as_fn_executable_p ()
32119{
32120 test -f "$1" && test -x "$1"
32121} # as_fn_executable_p
32122as_test_x='test -x'
32123as_executable_p=as_fn_executable_p
c971b7fa
PA
32124
32125# Sed expression to map a string onto a valid CPP name.
32126as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
32127
32128# Sed expression to map a string onto a valid variable name.
32129as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
32130
32131
32132exec 6>&1
32133## ----------------------------------- ##
32134## Main body of $CONFIG_STATUS script. ##
32135## ----------------------------------- ##
32136_ASEOF
32137test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
32138
32139cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32140# Save the log message, to keep $0 and so on meaningful, and to
32141# report actual input values of CONFIG_FILES etc. instead of their
32142# values after options handling.
32143ac_log="
d0ac1c44
SM
32144This file was extended by libgnu $as_me UNUSED-VERSION, which was
32145generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
32146
32147 CONFIG_FILES = $CONFIG_FILES
32148 CONFIG_HEADERS = $CONFIG_HEADERS
32149 CONFIG_LINKS = $CONFIG_LINKS
32150 CONFIG_COMMANDS = $CONFIG_COMMANDS
32151 $ $0 $@
32152
32153on `(hostname || uname -n) 2>/dev/null | sed 1q`
32154"
32155
32156_ACEOF
32157
32158case $ac_config_files in *"
32159"*) set x $ac_config_files; shift; ac_config_files=$*;;
32160esac
32161
32162case $ac_config_headers in *"
32163"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
32164esac
32165
32166
32167cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32168# Files that config.status was made for.
32169config_files="$ac_config_files"
32170config_headers="$ac_config_headers"
32171config_commands="$ac_config_commands"
32172
32173_ACEOF
32174
32175cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32176ac_cs_usage="\
32177\`$as_me' instantiates files and other configuration actions
32178from templates according to the current configuration. Unless the files
32179and actions are specified as TAGs, all are instantiated by default.
32180
32181Usage: $0 [OPTION]... [TAG]...
32182
32183 -h, --help print this help, then exit
32184 -V, --version print version number and configuration settings, then exit
d0ac1c44 32185 --config print configuration, then exit
c971b7fa
PA
32186 -q, --quiet, --silent
32187 do not print progress messages
32188 -d, --debug don't remove temporary files
32189 --recheck update $as_me by reconfiguring in the same conditions
32190 --file=FILE[:TEMPLATE]
32191 instantiate the configuration file FILE
32192 --header=FILE[:TEMPLATE]
32193 instantiate the configuration header FILE
32194
32195Configuration files:
32196$config_files
32197
32198Configuration headers:
32199$config_headers
32200
32201Configuration commands:
32202$config_commands
32203
32204Report bugs to the package provider."
32205
32206_ACEOF
32207cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 32208ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
c971b7fa 32209ac_cs_version="\\
d0ac1c44
SM
32210libgnu config.status UNUSED-VERSION
32211configured by $0, generated by GNU Autoconf 2.69,
32212 with options \\"\$ac_cs_config\\"
c971b7fa 32213
d0ac1c44 32214Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
32215This config.status script is free software; the Free Software Foundation
32216gives unlimited permission to copy, distribute and modify it."
32217
32218ac_pwd='$ac_pwd'
32219srcdir='$srcdir'
32220INSTALL='$INSTALL'
32221MKDIR_P='$MKDIR_P'
32222AWK='$AWK'
32223test -n "\$AWK" || AWK=awk
32224_ACEOF
32225
32226cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32227# The default lists apply if the user does not specify any file.
32228ac_need_defaults=:
32229while test $# != 0
32230do
32231 case $1 in
d0ac1c44 32232 --*=?*)
c971b7fa
PA
32233 ac_option=`expr "X$1" : 'X\([^=]*\)='`
32234 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
32235 ac_shift=:
32236 ;;
d0ac1c44
SM
32237 --*=)
32238 ac_option=`expr "X$1" : 'X\([^=]*\)='`
32239 ac_optarg=
32240 ac_shift=:
32241 ;;
c971b7fa
PA
32242 *)
32243 ac_option=$1
32244 ac_optarg=$2
32245 ac_shift=shift
32246 ;;
32247 esac
32248
32249 case $ac_option in
32250 # Handling of the options.
32251 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
32252 ac_cs_recheck=: ;;
32253 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
32254 $as_echo "$ac_cs_version"; exit ;;
d0ac1c44
SM
32255 --config | --confi | --conf | --con | --co | --c )
32256 $as_echo "$ac_cs_config"; exit ;;
c971b7fa
PA
32257 --debug | --debu | --deb | --de | --d | -d )
32258 debug=: ;;
32259 --file | --fil | --fi | --f )
32260 $ac_shift
32261 case $ac_optarg in
32262 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
d0ac1c44 32263 '') as_fn_error $? "missing file argument" ;;
c971b7fa
PA
32264 esac
32265 as_fn_append CONFIG_FILES " '$ac_optarg'"
32266 ac_need_defaults=false;;
32267 --header | --heade | --head | --hea )
32268 $ac_shift
32269 case $ac_optarg in
32270 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
32271 esac
32272 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
32273 ac_need_defaults=false;;
32274 --he | --h)
32275 # Conflict between --help and --header
d0ac1c44 32276 as_fn_error $? "ambiguous option: \`$1'
c971b7fa
PA
32277Try \`$0 --help' for more information.";;
32278 --help | --hel | -h )
32279 $as_echo "$ac_cs_usage"; exit ;;
32280 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
32281 | -silent | --silent | --silen | --sile | --sil | --si | --s)
32282 ac_cs_silent=: ;;
32283
32284 # This is an error.
d0ac1c44 32285 -*) as_fn_error $? "unrecognized option: \`$1'
c971b7fa
PA
32286Try \`$0 --help' for more information." ;;
32287
32288 *) as_fn_append ac_config_targets " $1"
32289 ac_need_defaults=false ;;
32290
32291 esac
32292 shift
32293done
32294
32295ac_configure_extra_args=
32296
32297if $ac_cs_silent; then
32298 exec 6>/dev/null
32299 ac_configure_extra_args="$ac_configure_extra_args --silent"
32300fi
32301
32302_ACEOF
32303cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32304if \$ac_cs_recheck; then
d0ac1c44 32305 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
c971b7fa
PA
32306 shift
32307 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
32308 CONFIG_SHELL='$SHELL'
32309 export CONFIG_SHELL
32310 exec "\$@"
32311fi
32312
32313_ACEOF
32314cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32315exec 5>>config.log
32316{
32317 echo
32318 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
32319## Running $as_me. ##
32320_ASBOX
32321 $as_echo "$ac_log"
32322} >&5
32323
32324_ACEOF
32325cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32326#
32327# INIT-COMMANDS
32328#
32329AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
32330
32331_ACEOF
32332
32333cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32334
32335# Handling of arguments.
32336for ac_config_target in $ac_config_targets
32337do
32338 case $ac_config_target in
32339 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
32340 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
361cb219 32341 "Makefile.gnulib.inc") CONFIG_FILES="$CONFIG_FILES Makefile.gnulib.inc" ;;
c971b7fa
PA
32342 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
32343 "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;;
32344 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
32345
d0ac1c44 32346 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
c971b7fa
PA
32347 esac
32348done
32349
32350
32351# If the user did not use the arguments to specify the items to instantiate,
32352# then the envvar interface is used. Set only those that are not.
32353# We use the long form for the default assignment because of an extremely
32354# bizarre bug on SunOS 4.1.3.
32355if $ac_need_defaults; then
32356 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
32357 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
32358 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
32359fi
32360
32361# Have a temporary directory for convenience. Make it in the build tree
32362# simply because there is no reason against having it here, and in addition,
32363# creating and moving files from /tmp can sometimes cause problems.
32364# Hook for its removal unless debugging.
32365# Note that there is a small window in which the directory will not be cleaned:
32366# after its creation but before its name has been assigned to `$tmp'.
32367$debug ||
32368{
d0ac1c44 32369 tmp= ac_tmp=
c971b7fa 32370 trap 'exit_status=$?
d0ac1c44
SM
32371 : "${ac_tmp:=$tmp}"
32372 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
c971b7fa
PA
32373' 0
32374 trap 'as_fn_exit 1' 1 2 13 15
32375}
32376# Create a (secure) tmp directory for tmp files.
32377
32378{
32379 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
d0ac1c44 32380 test -d "$tmp"
c971b7fa
PA
32381} ||
32382{
32383 tmp=./conf$$-$RANDOM
32384 (umask 077 && mkdir "$tmp")
d0ac1c44
SM
32385} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
32386ac_tmp=$tmp
c971b7fa
PA
32387
32388# Set up the scripts for CONFIG_FILES section.
32389# No need to generate them if there are no CONFIG_FILES.
32390# This happens for instance with `./config.status config.h'.
32391if test -n "$CONFIG_FILES"; then
32392
32393
32394ac_cr=`echo X | tr X '\015'`
32395# On cygwin, bash can eat \r inside `` if the user requested igncr.
32396# But we know of no other shell where ac_cr would be empty at this
32397# point, so we can use a bashism as a fallback.
32398if test "x$ac_cr" = x; then
32399 eval ac_cr=\$\'\\r\'
32400fi
32401ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
32402if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
d0ac1c44 32403 ac_cs_awk_cr='\\r'
c971b7fa
PA
32404else
32405 ac_cs_awk_cr=$ac_cr
32406fi
32407
d0ac1c44 32408echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
c971b7fa
PA
32409_ACEOF
32410
32411
32412{
32413 echo "cat >conf$$subs.awk <<_ACEOF" &&
32414 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
32415 echo "_ACEOF"
32416} >conf$$subs.sh ||
d0ac1c44
SM
32417 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
32418ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
c971b7fa
PA
32419ac_delim='%!_!# '
32420for ac_last_try in false false false false false :; do
32421 . ./conf$$subs.sh ||
d0ac1c44 32422 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
32423
32424 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
32425 if test $ac_delim_n = $ac_delim_num; then
32426 break
32427 elif $ac_last_try; then
d0ac1c44 32428 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
32429 else
32430 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
32431 fi
32432done
32433rm -f conf$$subs.sh
32434
32435cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 32436cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
c971b7fa
PA
32437_ACEOF
32438sed -n '
32439h
32440s/^/S["/; s/!.*/"]=/
32441p
32442g
32443s/^[^!]*!//
32444:repl
32445t repl
32446s/'"$ac_delim"'$//
32447t delim
32448:nl
32449h
d0ac1c44 32450s/\(.\{148\}\)..*/\1/
c971b7fa
PA
32451t more1
32452s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
32453p
32454n
32455b repl
32456:more1
32457s/["\\]/\\&/g; s/^/"/; s/$/"\\/
32458p
32459g
32460s/.\{148\}//
32461t nl
32462:delim
32463h
d0ac1c44 32464s/\(.\{148\}\)..*/\1/
c971b7fa
PA
32465t more2
32466s/["\\]/\\&/g; s/^/"/; s/$/"/
32467p
32468b
32469:more2
32470s/["\\]/\\&/g; s/^/"/; s/$/"\\/
32471p
32472g
32473s/.\{148\}//
32474t delim
32475' <conf$$subs.awk | sed '
32476/^[^""]/{
32477 N
32478 s/\n//
32479}
32480' >>$CONFIG_STATUS || ac_write_fail=1
32481rm -f conf$$subs.awk
32482cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32483_ACAWK
d0ac1c44 32484cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
c971b7fa
PA
32485 for (key in S) S_is_set[key] = 1
32486 FS = "\a"
32487
32488}
32489{
32490 line = $ 0
32491 nfields = split(line, field, "@")
32492 substed = 0
32493 len = length(field[1])
32494 for (i = 2; i < nfields; i++) {
32495 key = field[i]
32496 keylen = length(key)
32497 if (S_is_set[key]) {
32498 value = S[key]
32499 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
32500 len += length(value) + length(field[++i])
32501 substed = 1
32502 } else
32503 len += 1 + keylen
32504 }
32505
32506 print line
32507}
32508
32509_ACAWK
32510_ACEOF
32511cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32512if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
32513 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
32514else
32515 cat
d0ac1c44
SM
32516fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
32517 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
c971b7fa
PA
32518_ACEOF
32519
d0ac1c44
SM
32520# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
32521# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
c971b7fa
PA
32522# trailing colons and then remove the whole line if VPATH becomes empty
32523# (actually we leave an empty line to preserve line numbers).
32524if test "x$srcdir" = x.; then
d0ac1c44
SM
32525 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
32526h
32527s///
32528s/^/:/
32529s/[ ]*$/:/
32530s/:\$(srcdir):/:/g
32531s/:\${srcdir}:/:/g
32532s/:@srcdir@:/:/g
32533s/^:*//
c971b7fa 32534s/:*$//
d0ac1c44
SM
32535x
32536s/\(=[ ]*\).*/\1/
32537G
32538s/\n//
c971b7fa
PA
32539s/^[^=]*=[ ]*$//
32540}'
32541fi
32542
32543cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32544fi # test -n "$CONFIG_FILES"
32545
32546# Set up the scripts for CONFIG_HEADERS section.
32547# No need to generate them if there are no CONFIG_HEADERS.
32548# This happens for instance with `./config.status Makefile'.
32549if test -n "$CONFIG_HEADERS"; then
d0ac1c44 32550cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
c971b7fa
PA
32551BEGIN {
32552_ACEOF
32553
32554# Transform confdefs.h into an awk script `defines.awk', embedded as
32555# here-document in config.status, that substitutes the proper values into
32556# config.h.in to produce config.h.
32557
32558# Create a delimiter string that does not exist in confdefs.h, to ease
32559# handling of long lines.
32560ac_delim='%!_!# '
32561for ac_last_try in false false :; do
d0ac1c44
SM
32562 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
32563 if test -z "$ac_tt"; then
c971b7fa
PA
32564 break
32565 elif $ac_last_try; then
d0ac1c44 32566 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
c971b7fa
PA
32567 else
32568 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
32569 fi
32570done
32571
32572# For the awk script, D is an array of macro values keyed by name,
32573# likewise P contains macro parameters if any. Preserve backslash
32574# newline sequences.
32575
32576ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
32577sed -n '
32578s/.\{148\}/&'"$ac_delim"'/g
32579t rset
32580:rset
32581s/^[ ]*#[ ]*define[ ][ ]*/ /
32582t def
32583d
32584:def
32585s/\\$//
32586t bsnl
32587s/["\\]/\\&/g
32588s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
32589D["\1"]=" \3"/p
32590s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
32591d
32592:bsnl
32593s/["\\]/\\&/g
32594s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
32595D["\1"]=" \3\\\\\\n"\\/p
32596t cont
32597s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
32598t cont
32599d
32600:cont
32601n
32602s/.\{148\}/&'"$ac_delim"'/g
32603t clear
32604:clear
32605s/\\$//
32606t bsnlc
32607s/["\\]/\\&/g; s/^/"/; s/$/"/p
32608d
32609:bsnlc
32610s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
32611b cont
32612' <confdefs.h | sed '
32613s/'"$ac_delim"'/"\\\
32614"/g' >>$CONFIG_STATUS || ac_write_fail=1
32615
32616cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32617 for (key in D) D_is_set[key] = 1
32618 FS = "\a"
32619}
32620/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
32621 line = \$ 0
32622 split(line, arg, " ")
32623 if (arg[1] == "#") {
32624 defundef = arg[2]
32625 mac1 = arg[3]
32626 } else {
32627 defundef = substr(arg[1], 2)
32628 mac1 = arg[2]
32629 }
32630 split(mac1, mac2, "(") #)
32631 macro = mac2[1]
32632 prefix = substr(line, 1, index(line, defundef) - 1)
32633 if (D_is_set[macro]) {
32634 # Preserve the white space surrounding the "#".
32635 print prefix "define", macro P[macro] D[macro]
32636 next
32637 } else {
32638 # Replace #undef with comments. This is necessary, for example,
32639 # in the case of _POSIX_SOURCE, which is predefined and required
32640 # on some systems where configure will not decide to define it.
32641 if (defundef == "undef") {
32642 print "/*", prefix defundef, macro, "*/"
32643 next
32644 }
32645 }
32646}
32647{ print }
32648_ACAWK
32649_ACEOF
32650cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
d0ac1c44 32651 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
c971b7fa
PA
32652fi # test -n "$CONFIG_HEADERS"
32653
32654
32655eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
32656shift
32657for ac_tag
32658do
32659 case $ac_tag in
32660 :[FHLC]) ac_mode=$ac_tag; continue;;
32661 esac
32662 case $ac_mode$ac_tag in
32663 :[FHL]*:*);;
d0ac1c44 32664 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
c971b7fa
PA
32665 :[FH]-) ac_tag=-:-;;
32666 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
32667 esac
32668 ac_save_IFS=$IFS
32669 IFS=:
32670 set x $ac_tag
32671 IFS=$ac_save_IFS
32672 shift
32673 ac_file=$1
32674 shift
32675
32676 case $ac_mode in
32677 :L) ac_source=$1;;
32678 :[FH])
32679 ac_file_inputs=
32680 for ac_f
32681 do
32682 case $ac_f in
d0ac1c44 32683 -) ac_f="$ac_tmp/stdin";;
c971b7fa
PA
32684 *) # Look for the file first in the build tree, then in the source tree
32685 # (if the path is not absolute). The absolute path cannot be DOS-style,
32686 # because $ac_f cannot contain `:'.
32687 test -f "$ac_f" ||
32688 case $ac_f in
32689 [\\/$]*) false;;
32690 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
32691 esac ||
d0ac1c44 32692 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
c971b7fa
PA
32693 esac
32694 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
32695 as_fn_append ac_file_inputs " '$ac_f'"
32696 done
32697
32698 # Let's still pretend it is `configure' which instantiates (i.e., don't
32699 # use $as_me), people would be surprised to read:
32700 # /* config.h. Generated by config.status. */
32701 configure_input='Generated from '`
32702 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
32703 `' by configure.'
32704 if test x"$ac_file" != x-; then
32705 configure_input="$ac_file. $configure_input"
32706 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
32707$as_echo "$as_me: creating $ac_file" >&6;}
32708 fi
32709 # Neutralize special characters interpreted by sed in replacement strings.
32710 case $configure_input in #(
32711 *\&* | *\|* | *\\* )
32712 ac_sed_conf_input=`$as_echo "$configure_input" |
32713 sed 's/[\\\\&|]/\\\\&/g'`;; #(
32714 *) ac_sed_conf_input=$configure_input;;
32715 esac
32716
32717 case $ac_tag in
d0ac1c44
SM
32718 *:-:* | *:-) cat >"$ac_tmp/stdin" \
32719 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
c971b7fa
PA
32720 esac
32721 ;;
32722 esac
32723
32724 ac_dir=`$as_dirname -- "$ac_file" ||
32725$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32726 X"$ac_file" : 'X\(//\)[^/]' \| \
32727 X"$ac_file" : 'X\(//\)$' \| \
32728 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
32729$as_echo X"$ac_file" |
32730 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32731 s//\1/
32732 q
32733 }
32734 /^X\(\/\/\)[^/].*/{
32735 s//\1/
32736 q
32737 }
32738 /^X\(\/\/\)$/{
32739 s//\1/
32740 q
32741 }
32742 /^X\(\/\).*/{
32743 s//\1/
32744 q
32745 }
32746 s/.*/./; q'`
32747 as_dir="$ac_dir"; as_fn_mkdir_p
32748 ac_builddir=.
32749
32750case "$ac_dir" in
32751.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
32752*)
32753 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
32754 # A ".." for each directory in $ac_dir_suffix.
32755 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
32756 case $ac_top_builddir_sub in
32757 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
32758 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
32759 esac ;;
32760esac
32761ac_abs_top_builddir=$ac_pwd
32762ac_abs_builddir=$ac_pwd$ac_dir_suffix
32763# for backward compatibility:
32764ac_top_builddir=$ac_top_build_prefix
32765
32766case $srcdir in
32767 .) # We are building in place.
32768 ac_srcdir=.
32769 ac_top_srcdir=$ac_top_builddir_sub
32770 ac_abs_top_srcdir=$ac_pwd ;;
32771 [\\/]* | ?:[\\/]* ) # Absolute name.
32772 ac_srcdir=$srcdir$ac_dir_suffix;
32773 ac_top_srcdir=$srcdir
32774 ac_abs_top_srcdir=$srcdir ;;
32775 *) # Relative name.
32776 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
32777 ac_top_srcdir=$ac_top_build_prefix$srcdir
32778 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
32779esac
32780ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
32781
32782
32783 case $ac_mode in
32784 :F)
32785 #
32786 # CONFIG_FILE
32787 #
32788
32789 case $INSTALL in
32790 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
32791 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
32792 esac
32793 ac_MKDIR_P=$MKDIR_P
32794 case $MKDIR_P in
32795 [\\/$]* | ?:[\\/]* ) ;;
32796 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
32797 esac
32798_ACEOF
32799
32800cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32801# If the template does not know about datarootdir, expand it.
32802# FIXME: This hack should be removed a few years after 2.60.
32803ac_datarootdir_hack=; ac_datarootdir_seen=
32804ac_sed_dataroot='
32805/datarootdir/ {
32806 p
32807 q
32808}
32809/@datadir@/p
32810/@docdir@/p
32811/@infodir@/p
32812/@localedir@/p
32813/@mandir@/p'
32814case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
32815*datarootdir*) ac_datarootdir_seen=yes;;
32816*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
32817 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
32818$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
32819_ACEOF
32820cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32821 ac_datarootdir_hack='
32822 s&@datadir@&$datadir&g
32823 s&@docdir@&$docdir&g
32824 s&@infodir@&$infodir&g
32825 s&@localedir@&$localedir&g
32826 s&@mandir@&$mandir&g
32827 s&\\\${datarootdir}&$datarootdir&g' ;;
32828esac
32829_ACEOF
32830
32831# Neutralize VPATH when `$srcdir' = `.'.
32832# Shell code in configure.ac might set extrasub.
32833# FIXME: do we really want to maintain this feature?
32834cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32835ac_sed_extra="$ac_vpsub
32836$extrasub
32837_ACEOF
32838cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32839:t
32840/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
32841s|@configure_input@|$ac_sed_conf_input|;t t
32842s&@top_builddir@&$ac_top_builddir_sub&;t t
32843s&@top_build_prefix@&$ac_top_build_prefix&;t t
32844s&@srcdir@&$ac_srcdir&;t t
32845s&@abs_srcdir@&$ac_abs_srcdir&;t t
32846s&@top_srcdir@&$ac_top_srcdir&;t t
32847s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
32848s&@builddir@&$ac_builddir&;t t
32849s&@abs_builddir@&$ac_abs_builddir&;t t
32850s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
32851s&@INSTALL@&$ac_INSTALL&;t t
32852s&@MKDIR_P@&$ac_MKDIR_P&;t t
32853$ac_datarootdir_hack
32854"
d0ac1c44
SM
32855eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
32856 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32857
32858test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
d0ac1c44
SM
32859 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
32860 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
32861 "$ac_tmp/out"`; test -z "$ac_out"; } &&
c971b7fa 32862 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 32863which seems to be undefined. Please make sure it is defined" >&5
c971b7fa 32864$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 32865which seems to be undefined. Please make sure it is defined" >&2;}
c971b7fa 32866
d0ac1c44 32867 rm -f "$ac_tmp/stdin"
c971b7fa 32868 case $ac_file in
d0ac1c44
SM
32869 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
32870 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
c971b7fa 32871 esac \
d0ac1c44 32872 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32873 ;;
32874 :H)
32875 #
32876 # CONFIG_HEADER
32877 #
32878 if test x"$ac_file" != x-; then
32879 {
32880 $as_echo "/* $configure_input */" \
d0ac1c44
SM
32881 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
32882 } >"$ac_tmp/config.h" \
32883 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
32884 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
c971b7fa
PA
32885 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
32886$as_echo "$as_me: $ac_file is unchanged" >&6;}
32887 else
32888 rm -f "$ac_file"
d0ac1c44
SM
32889 mv "$ac_tmp/config.h" "$ac_file" \
32890 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32891 fi
32892 else
32893 $as_echo "/* $configure_input */" \
d0ac1c44
SM
32894 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
32895 || as_fn_error $? "could not create -" "$LINENO" 5
c971b7fa
PA
32896 fi
32897# Compute "$ac_file"'s index in $config_headers.
32898_am_arg="$ac_file"
32899_am_stamp_count=1
32900for _am_header in $config_headers :; do
32901 case $_am_header in
32902 $_am_arg | $_am_arg:* )
32903 break ;;
32904 * )
32905 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
32906 esac
32907done
32908echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
32909$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32910 X"$_am_arg" : 'X\(//\)[^/]' \| \
32911 X"$_am_arg" : 'X\(//\)$' \| \
32912 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
32913$as_echo X"$_am_arg" |
32914 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32915 s//\1/
32916 q
32917 }
32918 /^X\(\/\/\)[^/].*/{
32919 s//\1/
32920 q
32921 }
32922 /^X\(\/\/\)$/{
32923 s//\1/
32924 q
32925 }
32926 /^X\(\/\).*/{
32927 s//\1/
32928 q
32929 }
32930 s/.*/./; q'`/stamp-h$_am_stamp_count
32931 ;;
32932
32933 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
32934$as_echo "$as_me: executing $ac_file commands" >&6;}
32935 ;;
32936 esac
32937
32938
32939 case $ac_file$ac_mode in
32940 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
d0ac1c44 32941 # Older Autoconf quotes --file arguments for eval, but not when files
c971b7fa
PA
32942 # are listed without --file. Let's play safe and only enable the eval
32943 # if we detect the quoting.
32944 case $CONFIG_FILES in
32945 *\'*) eval set x "$CONFIG_FILES" ;;
32946 *) set x $CONFIG_FILES ;;
32947 esac
32948 shift
32949 for mf
32950 do
32951 # Strip MF so we end up with the name of the file.
32952 mf=`echo "$mf" | sed -e 's/:.*$//'`
32953 # Check whether this is an Automake generated Makefile or not.
d0ac1c44 32954 # We used to match only the files named 'Makefile.in', but
c971b7fa
PA
32955 # some people rename them; so instead we look at the file content.
32956 # Grep'ing the first line is not enough: some people post-process
32957 # each Makefile.in and add a new line on top of each file to say so.
32958 # Grep'ing the whole file is not good either: AIX grep has a line
32959 # limit of 2048, but all sed's we know have understand at least 4000.
32960 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
32961 dirpart=`$as_dirname -- "$mf" ||
32962$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32963 X"$mf" : 'X\(//\)[^/]' \| \
32964 X"$mf" : 'X\(//\)$' \| \
32965 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
32966$as_echo X"$mf" |
32967 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32968 s//\1/
32969 q
32970 }
32971 /^X\(\/\/\)[^/].*/{
32972 s//\1/
32973 q
32974 }
32975 /^X\(\/\/\)$/{
32976 s//\1/
32977 q
32978 }
32979 /^X\(\/\).*/{
32980 s//\1/
32981 q
32982 }
32983 s/.*/./; q'`
32984 else
32985 continue
32986 fi
32987 # Extract the definition of DEPDIR, am__include, and am__quote
d0ac1c44 32988 # from the Makefile without running 'make'.
c971b7fa
PA
32989 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
32990 test -z "$DEPDIR" && continue
32991 am__include=`sed -n 's/^am__include = //p' < "$mf"`
d0ac1c44 32992 test -z "$am__include" && continue
c971b7fa 32993 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
c971b7fa
PA
32994 # Find all dependency output files, they are included files with
32995 # $(DEPDIR) in their names. We invoke sed twice because it is the
32996 # simplest approach to changing $(DEPDIR) to its actual value in the
32997 # expansion.
32998 for file in `sed -n "
32999 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
d0ac1c44 33000 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
c971b7fa
PA
33001 # Make sure the directory exists.
33002 test -f "$dirpart/$file" && continue
33003 fdir=`$as_dirname -- "$file" ||
33004$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
33005 X"$file" : 'X\(//\)[^/]' \| \
33006 X"$file" : 'X\(//\)$' \| \
33007 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
33008$as_echo X"$file" |
33009 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
33010 s//\1/
33011 q
33012 }
33013 /^X\(\/\/\)[^/].*/{
33014 s//\1/
33015 q
33016 }
33017 /^X\(\/\/\)$/{
33018 s//\1/
33019 q
33020 }
33021 /^X\(\/\).*/{
33022 s//\1/
33023 q
33024 }
33025 s/.*/./; q'`
33026 as_dir=$dirpart/$fdir; as_fn_mkdir_p
33027 # echo "creating $dirpart/$file"
33028 echo '# dummy' > "$dirpart/$file"
33029 done
33030 done
33031}
33032 ;;
33033 "default":C)
33034case x$CONFIG_HEADERS in
33035xconfig.h:config.in)
33036echo > stamp-h ;;
33037esac
33038 ;;
33039
33040 esac
33041done # for ac_tag
33042
33043
33044as_fn_exit 0
33045_ACEOF
33046ac_clean_files=$ac_clean_files_save
33047
33048test $ac_write_fail = 0 ||
d0ac1c44 33049 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
33050
33051
33052# configure is writing to config.log, and then calls config.status.
33053# config.status does its own redirection, appending to config.log.
33054# Unfortunately, on DOS this fails, as config.log is still kept open
33055# by configure, so config.status won't be able to write to it; its
33056# output is simply discarded. So we exec the FD to /dev/null,
33057# effectively closing config.log, so it can be properly (re)opened and
33058# appended to by config.status. When coming back to configure, we
33059# need to make the FD available again.
33060if test "$no_create" != yes; then
33061 ac_cs_success=:
33062 ac_config_status_args=
33063 test "$silent" = yes &&
33064 ac_config_status_args="$ac_config_status_args --quiet"
33065 exec 5>/dev/null
33066 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
33067 exec 5>>config.log
33068 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
33069 # would make configure fail if this is the last instruction.
d0ac1c44 33070 $ac_cs_success || as_fn_exit 1
c971b7fa
PA
33071fi
33072if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
33073 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
33074$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
33075fi
33076
33077
33078exit 0
This page took 2.416634 seconds and 4 git commands to generate.