gdb: add target_ops::supports_displaced_step
[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"
c971b7fa
PA
586# Factoring default headers for most tests.
587ac_includes_default="\
588#include <stdio.h>
589#ifdef HAVE_SYS_TYPES_H
590# include <sys/types.h>
591#endif
592#ifdef HAVE_SYS_STAT_H
593# include <sys/stat.h>
594#endif
595#ifdef STDC_HEADERS
596# include <stdlib.h>
597# include <stddef.h>
598#else
599# ifdef HAVE_STDLIB_H
600# include <stdlib.h>
601# endif
602#endif
603#ifdef HAVE_STRING_H
604# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
605# include <memory.h>
606# endif
607# include <string.h>
608#endif
609#ifdef HAVE_STRINGS_H
610# include <strings.h>
611#endif
612#ifdef HAVE_INTTYPES_H
613# include <inttypes.h>
614#endif
615#ifdef HAVE_STDINT_H
616# include <stdint.h>
617#endif
618#ifdef HAVE_UNISTD_H
619# include <unistd.h>
620#endif"
621
5abebf3c 622gl_use_threads_default=
c0c3707f
CB
623gl_use_winpthreads_default=
624ac_header_list=
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
4a626d0a 701UNISTD_H_DEFINES_STRUCT_TIMESPEC
09607c9e
TT
702PTHREAD_H_DEFINES_STRUCT_TIMESPEC
703SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
704TIME_H_DEFINES_STRUCT_TIMESPEC
705NEXT_AS_FIRST_DIRECTIVE_TIME_H
706NEXT_TIME_H
725e2999
JB
707HAVE_SYS_UIO_H
708NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
709NEXT_SYS_UIO_H
c0c3707f 710WINDOWS_STAT_INODES
63ce7108
TT
711WINDOWS_64_BIT_OFF_T
712NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
713NEXT_SYS_TYPES_H
2196f55f
YQ
714NEXT_AS_FIRST_DIRECTIVE_STRING_H
715NEXT_STRING_H
98399780
YQ
716NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
717NEXT_STDLIB_H
6a29c58e
YQ
718NEXT_AS_FIRST_DIRECTIVE_STDIO_H
719NEXT_STDIO_H
2196f55f
YQ
720HAVE__BOOL
721GL_GENERATE_STDBOOL_H_FALSE
722GL_GENERATE_STDBOOL_H_TRUE
723STDBOOL_H
725e2999
JB
724GL_GENERATE_STDALIGN_H_FALSE
725GL_GENERATE_STDALIGN_H_TRUE
726STDALIGN_H
0750520d
PA
727NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
728NEXT_SIGNAL_H
729REPLACE_RAISE
730REPLACE_PTHREAD_SIGMASK
731HAVE_SIGHANDLER_T
732HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
733HAVE_STRUCT_SIGACTION_SA_SIGACTION
734HAVE_SIGACTION
735HAVE_SIGINFO_T
736HAVE_SIGSET_T
737HAVE_RAISE
738HAVE_PTHREAD_SIGMASK
739HAVE_POSIX_SIGNALBLOCKING
740GNULIB_SIGACTION
741GNULIB_SIGPROCMASK
742GNULIB_SIGNAL_H_SIGPIPE
743GNULIB_RAISE
744GNULIB_PTHREAD_SIGMASK
6a29c58e
YQ
745REPLACE_VSPRINTF
746REPLACE_VSNPRINTF
747REPLACE_VPRINTF
748REPLACE_VFPRINTF
749REPLACE_VDPRINTF
750REPLACE_VASPRINTF
751REPLACE_TMPFILE
752REPLACE_STDIO_WRITE_FUNCS
753REPLACE_STDIO_READ_FUNCS
754REPLACE_SPRINTF
755REPLACE_SNPRINTF
756REPLACE_RENAMEAT
757REPLACE_RENAME
758REPLACE_REMOVE
759REPLACE_PRINTF
760REPLACE_POPEN
761REPLACE_PERROR
762REPLACE_OBSTACK_PRINTF
763REPLACE_GETLINE
764REPLACE_GETDELIM
765REPLACE_FTELLO
766REPLACE_FTELL
767REPLACE_FSEEKO
768REPLACE_FSEEK
769REPLACE_FREOPEN
770REPLACE_FPURGE
771REPLACE_FPRINTF
772REPLACE_FOPEN
773REPLACE_FFLUSH
774REPLACE_FDOPEN
775REPLACE_FCLOSE
776REPLACE_DPRINTF
777HAVE_VDPRINTF
778HAVE_VASPRINTF
779HAVE_RENAMEAT
780HAVE_POPEN
781HAVE_PCLOSE
782HAVE_FTELLO
783HAVE_FSEEKO
784HAVE_DPRINTF
785HAVE_DECL_VSNPRINTF
786HAVE_DECL_SNPRINTF
787HAVE_DECL_OBSTACK_PRINTF
788HAVE_DECL_GETLINE
789HAVE_DECL_GETDELIM
790HAVE_DECL_FTELLO
791HAVE_DECL_FSEEKO
792HAVE_DECL_FPURGE
793GNULIB_VSPRINTF_POSIX
794GNULIB_VSNPRINTF
795GNULIB_VPRINTF_POSIX
796GNULIB_VPRINTF
797GNULIB_VFPRINTF_POSIX
798GNULIB_VFPRINTF
799GNULIB_VDPRINTF
800GNULIB_VSCANF
801GNULIB_VFSCANF
802GNULIB_VASPRINTF
803GNULIB_TMPFILE
804GNULIB_STDIO_H_SIGPIPE
805GNULIB_STDIO_H_NONBLOCKING
806GNULIB_SPRINTF_POSIX
807GNULIB_SNPRINTF
808GNULIB_SCANF
809GNULIB_RENAMEAT
810GNULIB_RENAME
811GNULIB_REMOVE
812GNULIB_PUTS
813GNULIB_PUTCHAR
814GNULIB_PUTC
815GNULIB_PRINTF_POSIX
816GNULIB_PRINTF
817GNULIB_POPEN
818GNULIB_PERROR
819GNULIB_PCLOSE
820GNULIB_OBSTACK_PRINTF_POSIX
821GNULIB_OBSTACK_PRINTF
822GNULIB_GETLINE
823GNULIB_GETDELIM
824GNULIB_GETCHAR
825GNULIB_GETC
826GNULIB_FWRITE
827GNULIB_FTELLO
828GNULIB_FTELL
829GNULIB_FSEEKO
830GNULIB_FSEEK
831GNULIB_FSCANF
832GNULIB_FREOPEN
833GNULIB_FREAD
834GNULIB_FPUTS
835GNULIB_FPUTC
836GNULIB_FPURGE
837GNULIB_FPRINTF_POSIX
838GNULIB_FPRINTF
839GNULIB_FOPEN
840GNULIB_FGETS
841GNULIB_FGETC
842GNULIB_FFLUSH
843GNULIB_FDOPEN
844GNULIB_FCLOSE
845GNULIB_DPRINTF
725e2999
JB
846GL_GENERATE_NETINET_IN_H_FALSE
847GL_GENERATE_NETINET_IN_H_TRUE
848NETINET_IN_H
849HAVE_NETINET_IN_H
850NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
851NEXT_NETINET_IN_H
c971b7fa 852UNDEFINE_STRTOK_R
c971b7fa 853REPLACE_STRSIGNAL
c971b7fa
PA
854REPLACE_STRERROR_R
855REPLACE_STRERROR
c0c3707f 856REPLACE_STRTOK_R
c971b7fa
PA
857REPLACE_STRCASESTR
858REPLACE_STRSTR
c0c3707f
CB
859REPLACE_STRNLEN
860REPLACE_STRNDUP
861REPLACE_STRNCAT
c971b7fa 862REPLACE_STRDUP
c0c3707f 863REPLACE_STRCHRNUL
c971b7fa
PA
864REPLACE_STPNCPY
865REPLACE_MEMMEM
866REPLACE_MEMCHR
867HAVE_STRVERSCMP
868HAVE_DECL_STRSIGNAL
869HAVE_DECL_STRERROR_R
870HAVE_DECL_STRTOK_R
871HAVE_STRCASESTR
872HAVE_STRSEP
873HAVE_STRPBRK
874HAVE_DECL_STRNLEN
875HAVE_DECL_STRNDUP
876HAVE_DECL_STRDUP
877HAVE_STRCHRNUL
878HAVE_STPNCPY
879HAVE_STPCPY
880HAVE_RAWMEMCHR
881HAVE_DECL_MEMRCHR
882HAVE_MEMPCPY
883HAVE_DECL_MEMMEM
884HAVE_MEMCHR
885HAVE_FFSLL
886HAVE_FFSL
c0c3707f 887HAVE_EXPLICIT_BZERO
c971b7fa
PA
888HAVE_MBSLEN
889GNULIB_STRVERSCMP
890GNULIB_STRSIGNAL
891GNULIB_STRERROR_R
892GNULIB_STRERROR
893GNULIB_MBSTOK_R
894GNULIB_MBSSEP
895GNULIB_MBSSPN
896GNULIB_MBSPBRK
897GNULIB_MBSCSPN
898GNULIB_MBSCASESTR
899GNULIB_MBSPCASECMP
900GNULIB_MBSNCASECMP
901GNULIB_MBSCASECMP
902GNULIB_MBSSTR
903GNULIB_MBSRCHR
904GNULIB_MBSCHR
905GNULIB_MBSNLEN
906GNULIB_MBSLEN
907GNULIB_STRTOK_R
908GNULIB_STRCASESTR
909GNULIB_STRSTR
910GNULIB_STRSEP
911GNULIB_STRPBRK
912GNULIB_STRNLEN
913GNULIB_STRNDUP
914GNULIB_STRNCAT
915GNULIB_STRDUP
916GNULIB_STRCHRNUL
917GNULIB_STPNCPY
918GNULIB_STPCPY
919GNULIB_RAWMEMCHR
920GNULIB_MEMRCHR
921GNULIB_MEMPCPY
922GNULIB_MEMMEM
923GNULIB_MEMCHR
924GNULIB_FFSLL
925GNULIB_FFSL
c0c3707f 926GNULIB_EXPLICIT_BZERO
8690e634 927LOCALE_FR
5df4cba6
SM
928HAVE_VISIBILITY
929CFLAG_VISIBILITY
930LIB_MBRTOWC
8690e634 931LOCALE_ZH_CN
c0c3707f 932LOCALE_FR_UTF8
8690e634 933LOCALE_JA
c0c3707f
CB
934REPLACE_WCSTOK
935REPLACE_WCSFTIME
8690e634
JK
936REPLACE_WCSWIDTH
937REPLACE_WCWIDTH
938REPLACE_WCSNRTOMBS
939REPLACE_WCSRTOMBS
940REPLACE_WCRTOMB
941REPLACE_MBSNRTOWCS
942REPLACE_MBSRTOWCS
943REPLACE_MBRLEN
944REPLACE_MBRTOWC
945REPLACE_MBSINIT
946REPLACE_WCTOB
947REPLACE_BTOWC
948REPLACE_MBSTATE_T
949HAVE_DECL_WCWIDTH
950HAVE_DECL_WCTOB
c0c3707f 951HAVE_WCSFTIME
8690e634
JK
952HAVE_WCSWIDTH
953HAVE_WCSTOK
954HAVE_WCSSTR
955HAVE_WCSPBRK
956HAVE_WCSSPN
957HAVE_WCSCSPN
958HAVE_WCSRCHR
959HAVE_WCSCHR
960HAVE_WCSDUP
961HAVE_WCSXFRM
962HAVE_WCSCOLL
963HAVE_WCSNCASECMP
964HAVE_WCSCASECMP
965HAVE_WCSNCMP
966HAVE_WCSCMP
967HAVE_WCSNCAT
968HAVE_WCSCAT
969HAVE_WCPNCPY
970HAVE_WCSNCPY
971HAVE_WCPCPY
972HAVE_WCSCPY
973HAVE_WCSNLEN
974HAVE_WCSLEN
975HAVE_WMEMSET
976HAVE_WMEMMOVE
977HAVE_WMEMCPY
978HAVE_WMEMCMP
979HAVE_WMEMCHR
980HAVE_WCSNRTOMBS
981HAVE_WCSRTOMBS
982HAVE_WCRTOMB
983HAVE_MBSNRTOWCS
984HAVE_MBSRTOWCS
985HAVE_MBRLEN
986HAVE_MBRTOWC
987HAVE_MBSINIT
988HAVE_BTOWC
c0c3707f 989GNULIB_WCSFTIME
8690e634
JK
990GNULIB_WCSWIDTH
991GNULIB_WCSTOK
992GNULIB_WCSSTR
993GNULIB_WCSPBRK
994GNULIB_WCSSPN
995GNULIB_WCSCSPN
996GNULIB_WCSRCHR
997GNULIB_WCSCHR
998GNULIB_WCSDUP
999GNULIB_WCSXFRM
1000GNULIB_WCSCOLL
1001GNULIB_WCSNCASECMP
1002GNULIB_WCSCASECMP
1003GNULIB_WCSNCMP
1004GNULIB_WCSCMP
1005GNULIB_WCSNCAT
1006GNULIB_WCSCAT
1007GNULIB_WCPNCPY
1008GNULIB_WCSNCPY
1009GNULIB_WCPCPY
1010GNULIB_WCSCPY
1011GNULIB_WCSNLEN
1012GNULIB_WCSLEN
1013GNULIB_WMEMSET
1014GNULIB_WMEMMOVE
1015GNULIB_WMEMCPY
1016GNULIB_WMEMCMP
1017GNULIB_WMEMCHR
1018GNULIB_WCWIDTH
1019GNULIB_WCSNRTOMBS
1020GNULIB_WCSRTOMBS
1021GNULIB_WCRTOMB
1022GNULIB_MBSNRTOWCS
1023GNULIB_MBSRTOWCS
1024GNULIB_MBRLEN
1025GNULIB_MBRTOWC
1026GNULIB_MBSINIT
1027GNULIB_WCTOB
1028GNULIB_BTOWC
88b48903
WN
1029NEXT_AS_FIRST_DIRECTIVE_MATH_H
1030NEXT_MATH_H
5abebf3c
CB
1031LTLIBMULTITHREAD
1032LIBMULTITHREAD
1033LTLIBTHREAD
1034LIBTHREAD
5df4cba6
SM
1035LIBSTDTHREAD
1036NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
1037NEXT_LOCALE_H
1038HAVE_XLOCALE_H
1039NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
1040NEXT_STDDEF_H
1041GL_GENERATE_STDDEF_H_FALSE
1042GL_GENERATE_STDDEF_H_TRUE
1043STDDEF_H
1044HAVE_WCHAR_T
1045HAVE_MAX_ALIGN_T
1046REPLACE_NULL
1047REPLACE_STRUCT_LCONV
1048REPLACE_FREELOCALE
1049REPLACE_DUPLOCALE
1050REPLACE_NEWLOCALE
1051REPLACE_SETLOCALE
1052REPLACE_LOCALECONV
1053HAVE_FREELOCALE
1054HAVE_DUPLOCALE
1055HAVE_NEWLOCALE
1056GNULIB_LOCALENAME
1057GNULIB_DUPLOCALE
1058GNULIB_SETLOCALE_NULL
1059GNULIB_SETLOCALE
1060GNULIB_LOCALECONV
8690e634 1061LOCALCHARSET_TESTS_ENVIRONMENT
c971b7fa
PA
1062NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
1063NEXT_INTTYPES_H
1064UINT64_MAX_EQ_ULONG_MAX
1065UINT32_MAX_LT_UINTMAX_MAX
1066PRIPTR_PREFIX
1067PRI_MACROS_BROKEN
1068INT64_MAX_EQ_LONG_MAX
1069INT32_MAX_LT_INTMAX_MAX
4a626d0a 1070REPLACE_STRTOUMAX
c971b7fa 1071REPLACE_STRTOIMAX
c0c3707f 1072HAVE_IMAXDIV_T
c971b7fa
PA
1073HAVE_DECL_STRTOUMAX
1074HAVE_DECL_STRTOIMAX
1075HAVE_DECL_IMAXDIV
1076HAVE_DECL_IMAXABS
1077GNULIB_STRTOUMAX
1078GNULIB_STRTOIMAX
1079GNULIB_IMAXDIV
1080GNULIB_IMAXABS
1081GL_GENERATE_STDINT_H_FALSE
1082GL_GENERATE_STDINT_H_TRUE
1083STDINT_H
49e4877c
PA
1084HAVE_SYS_INTTYPES_H
1085HAVE_SYS_BITYPES_H
1086HAVE_C99_STDINT_H
c971b7fa
PA
1087WINT_T_SUFFIX
1088WCHAR_T_SUFFIX
1089SIG_ATOMIC_T_SUFFIX
1090SIZE_T_SUFFIX
1091PTRDIFF_T_SUFFIX
1092HAVE_SIGNED_WINT_T
1093HAVE_SIGNED_WCHAR_T
1094HAVE_SIGNED_SIG_ATOMIC_T
1095BITSIZEOF_WINT_T
1096BITSIZEOF_WCHAR_T
1097BITSIZEOF_SIG_ATOMIC_T
1098BITSIZEOF_SIZE_T
1099BITSIZEOF_PTRDIFF_T
1100APPLE_UNIVERSAL_BUILD
c971b7fa
PA
1101HAVE_STDINT_H
1102NEXT_AS_FIRST_DIRECTIVE_STDINT_H
1103NEXT_STDINT_H
c971b7fa
PA
1104HAVE_SYS_TYPES_H
1105HAVE_INTTYPES_H
1106HAVE_WCHAR_H
c0c3707f 1107GNULIB_OVERRIDES_WINT_T
49e4877c
PA
1108GL_GENERATE_LIMITS_H_FALSE
1109GL_GENERATE_LIMITS_H_TRUE
1110LIMITS_H
1111NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
1112NEXT_LIMITS_H
725e2999
JB
1113HAVE_SYS_SOCKET_H
1114NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
1115NEXT_SYS_SOCKET_H
1116HAVE_ACCEPT4
1117HAVE_SA_FAMILY_T
1118HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
1119HAVE_STRUCT_SOCKADDR_STORAGE
1120GNULIB_ACCEPT4
1121GNULIB_SHUTDOWN
1122GNULIB_SETSOCKOPT
1123GNULIB_SENDTO
1124GNULIB_RECVFROM
1125GNULIB_SEND
1126GNULIB_RECV
1127GNULIB_LISTEN
1128GNULIB_GETSOCKOPT
1129GNULIB_GETSOCKNAME
1130GNULIB_GETPEERNAME
1131GNULIB_BIND
1132GNULIB_ACCEPT
1133GNULIB_CONNECT
1134GNULIB_SOCKET
1135INET_NTOP_LIB
5df4cba6
SM
1136LIB_HARD_LOCALE
1137LIB_SETLOCALE_NULL
1138LIB_SCHED_YIELD
1139LIBPMULTITHREAD
1140LIBPTHREAD
6ec2e0f5
SDJ
1141GL_GENERATE_GLOB_H_FALSE
1142GL_GENERATE_GLOB_H_TRUE
1143GLOB_H
c0c3707f
CB
1144HAVE_GLOB_H
1145NEXT_AS_FIRST_DIRECTIVE_GLOB_H
1146NEXT_GLOB_H
1147REPLACE_GLOB_PATTERN_P
1148REPLACE_GLOB
1149HAVE_GLOB_PATTERN_P
1150HAVE_GLOB
1151GNULIB_GLOB
1152REPLACE_LOCALTIME
1153REPLACE_GMTIME
1154REPLACE_TZSET
1155REPLACE_TIMEGM
1156REPLACE_STRFTIME
1157REPLACE_NANOSLEEP
1158REPLACE_MKTIME
1159REPLACE_LOCALTIME_R
1160REPLACE_CTIME
1161HAVE_TIMEZONE_T
1162HAVE_TZSET
1163HAVE_TIMEGM
1164HAVE_STRPTIME
1165HAVE_NANOSLEEP
1166HAVE_DECL_LOCALTIME_R
1167GNULIB_TZSET
1168GNULIB_TIME_RZ
1169GNULIB_TIME_R
1170GNULIB_TIMEGM
1171GNULIB_STRPTIME
1172GNULIB_STRFTIME
1173GNULIB_NANOSLEEP
1174GNULIB_LOCALTIME
1175GNULIB_MKTIME
1176GNULIB_CTIME
4a626d0a
PA
1177NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
1178NEXT_SYS_TIME_H
1179REPLACE_STRUCT_TIMEVAL
1180REPLACE_GETTIMEOFDAY
4a626d0a
PA
1181HAVE_SYS_TIME_H
1182HAVE_STRUCT_TIMEVAL
1183HAVE_GETTIMEOFDAY
1184GNULIB_GETTIMEOFDAY
6ec2e0f5
SDJ
1185LTLIBINTL
1186LIBINTL
c0c3707f 1187LIB_GETLOGIN
6ec2e0f5 1188WINDOWS_64_BIT_ST_SIZE
c0c3707f 1189WINDOWS_STAT_TIMESPEC
6ec2e0f5
SDJ
1190NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
1191NEXT_SYS_STAT_H
1192REPLACE_UTIMENSAT
1193REPLACE_STAT
1194REPLACE_MKNOD
1195REPLACE_MKFIFO
1196REPLACE_MKDIR
1197REPLACE_LSTAT
5df4cba6 1198REPLACE_LCHMOD
6ec2e0f5
SDJ
1199REPLACE_FUTIMENS
1200REPLACE_FSTATAT
1201REPLACE_FSTAT
5df4cba6 1202REPLACE_FCHMODAT
6ec2e0f5
SDJ
1203HAVE_UTIMENSAT
1204HAVE_MKNODAT
1205HAVE_MKNOD
1206HAVE_MKFIFOAT
1207HAVE_MKFIFO
1208HAVE_MKDIRAT
1209HAVE_LSTAT
1210HAVE_LCHMOD
1211HAVE_FUTIMENS
1212HAVE_FSTATAT
1213HAVE_FCHMODAT
c0c3707f 1214GNULIB_OVERRIDES_STRUCT_STAT
6ec2e0f5
SDJ
1215GNULIB_UTIMENSAT
1216GNULIB_STAT
1217GNULIB_MKNODAT
1218GNULIB_MKNOD
1219GNULIB_MKFIFOAT
1220GNULIB_MKFIFO
1221GNULIB_MKDIRAT
1222GNULIB_LSTAT
1223GNULIB_LCHMOD
1224GNULIB_FUTIMENS
1225GNULIB_FSTATAT
1226GNULIB_FSTAT
1227GNULIB_FCHMODAT
88b48903
WN
1228FREXPL_LIBM
1229HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
1230FREXP_LIBM
1231REPLACE_TRUNCL
1232REPLACE_TRUNCF
1233REPLACE_TRUNC
c0c3707f
CB
1234REPLACE_TANHF
1235REPLACE_TANF
88b48903 1236REPLACE_SQRTL
c0c3707f
CB
1237REPLACE_SQRTF
1238REPLACE_SINHF
1239REPLACE_SINF
88b48903
WN
1240REPLACE_SIGNBIT_USING_GCC
1241REPLACE_SIGNBIT
1242REPLACE_ROUNDL
1243REPLACE_ROUNDF
1244REPLACE_ROUND
c0c3707f 1245REPLACE_RINTL
88b48903
WN
1246REPLACE_REMAINDERL
1247REPLACE_REMAINDERF
1248REPLACE_REMAINDER
1249REPLACE_NAN
1250REPLACE_MODFL
1251REPLACE_MODFF
1252REPLACE_MODF
1253REPLACE_LOGBL
1254REPLACE_LOGBF
1255REPLACE_LOGB
1256REPLACE_LOG2L
1257REPLACE_LOG2F
1258REPLACE_LOG2
1259REPLACE_LOG1PL
1260REPLACE_LOG1PF
1261REPLACE_LOG1P
1262REPLACE_LOG10L
1263REPLACE_LOG10F
1264REPLACE_LOG10
1265REPLACE_LOGL
1266REPLACE_LOGF
1267REPLACE_LOG
1268REPLACE_LDEXPL
1269REPLACE_ISNAN
1270REPLACE_ISINF
1271REPLACE_ISFINITE
c0c3707f 1272REPLACE_ILOGBL
88b48903
WN
1273REPLACE_ILOGBF
1274REPLACE_ILOGB
1275REPLACE_HYPOTL
1276REPLACE_HYPOTF
1277REPLACE_HYPOT
1278REPLACE_HUGE_VAL
1279REPLACE_FREXPL
1280REPLACE_FREXP
1281REPLACE_FREXPF
1282REPLACE_FMODL
1283REPLACE_FMODF
1284REPLACE_FMOD
1285REPLACE_FMAL
1286REPLACE_FMAF
1287REPLACE_FMA
1288REPLACE_FLOORL
1289REPLACE_FLOORF
1290REPLACE_FLOOR
1291REPLACE_FABSL
1292REPLACE_EXP2L
1293REPLACE_EXP2
c0c3707f 1294REPLACE_EXPM1L
88b48903
WN
1295REPLACE_EXPM1F
1296REPLACE_EXPM1
c0c3707f
CB
1297REPLACE_EXPL
1298REPLACE_EXPF
1299REPLACE_COSHF
1300REPLACE_COSF
88b48903
WN
1301REPLACE_CEILL
1302REPLACE_CEILF
1303REPLACE_CEIL
1304REPLACE_CBRTL
1305REPLACE_CBRTF
c0c3707f
CB
1306REPLACE_ATAN2F
1307REPLACE_ATANF
1308REPLACE_ASINF
1309REPLACE_ACOSF
88b48903
WN
1310HAVE_DECL_TRUNCL
1311HAVE_DECL_TRUNCF
1312HAVE_DECL_TRUNC
1313HAVE_DECL_TANL
1314HAVE_DECL_SQRTL
1315HAVE_DECL_SINL
1316HAVE_DECL_ROUNDL
1317HAVE_DECL_ROUNDF
1318HAVE_DECL_ROUND
1319HAVE_DECL_RINTF
1320HAVE_DECL_REMAINDERL
1321HAVE_DECL_REMAINDER
1322HAVE_DECL_LOGB
1323HAVE_DECL_LOG2L
1324HAVE_DECL_LOG2F
1325HAVE_DECL_LOG2
1326HAVE_DECL_LOG10L
1327HAVE_DECL_LOGL
1328HAVE_DECL_LDEXPL
1329HAVE_DECL_FREXPL
1330HAVE_DECL_FLOORL
1331HAVE_DECL_FLOORF
1332HAVE_DECL_EXPM1L
1333HAVE_DECL_EXP2L
1334HAVE_DECL_EXP2F
1335HAVE_DECL_EXP2
1336HAVE_DECL_EXPL
1337HAVE_DECL_COSL
1338HAVE_DECL_COPYSIGNF
1339HAVE_DECL_CEILL
1340HAVE_DECL_CEILF
1341HAVE_DECL_CBRTL
1342HAVE_DECL_CBRTF
1343HAVE_DECL_ATANL
1344HAVE_DECL_ASINL
1345HAVE_DECL_ACOSL
1346HAVE_TANHF
1347HAVE_TANL
1348HAVE_TANF
1349HAVE_SQRTL
1350HAVE_SQRTF
1351HAVE_SINHF
1352HAVE_SINL
1353HAVE_SINF
1354HAVE_RINTL
1355HAVE_RINT
1356HAVE_REMAINDERF
1357HAVE_REMAINDER
1358HAVE_POWF
1359HAVE_MODFL
1360HAVE_MODFF
1361HAVE_LOGBL
1362HAVE_LOGBF
1363HAVE_LOG1PL
1364HAVE_LOG1PF
1365HAVE_LOG1P
1366HAVE_LOG10L
1367HAVE_LOG10F
1368HAVE_LOGL
1369HAVE_LOGF
1370HAVE_LDEXPF
1371HAVE_ISNANL
1372HAVE_ISNAND
1373HAVE_ISNANF
1374HAVE_ILOGBL
1375HAVE_ILOGBF
1376HAVE_ILOGB
1377HAVE_HYPOTL
1378HAVE_HYPOTF
1379HAVE_FREXPF
1380HAVE_FMODL
1381HAVE_FMODF
1382HAVE_FMAL
1383HAVE_FMAF
1384HAVE_FMA
1385HAVE_FABSL
1386HAVE_FABSF
1387HAVE_EXPM1F
1388HAVE_EXPM1
1389HAVE_EXPL
1390HAVE_EXPF
1391HAVE_COSHF
1392HAVE_COSL
1393HAVE_COSF
1394HAVE_COPYSIGNL
1395HAVE_COPYSIGN
1396HAVE_CBRTL
1397HAVE_CBRTF
1398HAVE_CBRT
1399HAVE_ATAN2F
1400HAVE_ATANL
1401HAVE_ATANF
1402HAVE_ASINL
1403HAVE_ASINF
1404HAVE_ACOSL
1405HAVE_ACOSF
1406GNULIB_TRUNCL
1407GNULIB_TRUNCF
1408GNULIB_TRUNC
1409GNULIB_TANHF
1410GNULIB_TANL
1411GNULIB_TANF
1412GNULIB_SQRTL
1413GNULIB_SQRTF
1414GNULIB_SINHF
1415GNULIB_SINL
1416GNULIB_SINF
1417GNULIB_SIGNBIT
1418GNULIB_ROUNDL
1419GNULIB_ROUNDF
1420GNULIB_ROUND
1421GNULIB_RINTL
1422GNULIB_RINTF
1423GNULIB_RINT
1424GNULIB_REMAINDERL
1425GNULIB_REMAINDERF
1426GNULIB_REMAINDER
1427GNULIB_POWF
1428GNULIB_MODFL
1429GNULIB_MODFF
1430GNULIB_MODF
1431GNULIB_LOGBL
1432GNULIB_LOGBF
1433GNULIB_LOGB
1434GNULIB_LOG2L
1435GNULIB_LOG2F
1436GNULIB_LOG2
1437GNULIB_LOG1PL
1438GNULIB_LOG1PF
1439GNULIB_LOG1P
1440GNULIB_LOG10L
1441GNULIB_LOG10F
1442GNULIB_LOG10
1443GNULIB_LOGL
1444GNULIB_LOGF
1445GNULIB_LOG
1446GNULIB_LDEXPL
1447GNULIB_LDEXPF
1448GNULIB_ISNANL
1449GNULIB_ISNAND
1450GNULIB_ISNANF
1451GNULIB_ISNAN
1452GNULIB_ISINF
1453GNULIB_ISFINITE
1454GNULIB_ILOGBL
1455GNULIB_ILOGBF
1456GNULIB_ILOGB
1457GNULIB_HYPOTL
1458GNULIB_HYPOTF
1459GNULIB_HYPOT
1460GNULIB_FREXPL
1461GNULIB_FREXP
1462GNULIB_FREXPF
1463GNULIB_FMODL
1464GNULIB_FMODF
1465GNULIB_FMOD
1466GNULIB_FMAL
1467GNULIB_FMAF
1468GNULIB_FMA
1469GNULIB_FLOORL
1470GNULIB_FLOORF
1471GNULIB_FLOOR
1472GNULIB_FABSL
1473GNULIB_FABSF
1474GNULIB_EXPM1L
1475GNULIB_EXPM1F
1476GNULIB_EXPM1
1477GNULIB_EXP2L
1478GNULIB_EXP2F
1479GNULIB_EXP2
1480GNULIB_EXPL
1481GNULIB_EXPF
1482GNULIB_COSHF
1483GNULIB_COSL
1484GNULIB_COSF
1485GNULIB_COPYSIGNL
1486GNULIB_COPYSIGNF
1487GNULIB_COPYSIGN
1488GNULIB_CEILL
1489GNULIB_CEILF
1490GNULIB_CEIL
1491GNULIB_CBRTL
1492GNULIB_CBRTF
1493GNULIB_CBRT
1494GNULIB_ATAN2F
1495GNULIB_ATANL
1496GNULIB_ATANF
1497GNULIB_ASINL
1498GNULIB_ASINF
1499GNULIB_ACOSL
1500GNULIB_ACOSF
8690e634
JK
1501GL_GENERATE_FNMATCH_H_FALSE
1502GL_GENERATE_FNMATCH_H_TRUE
1503FNMATCH_H
c0c3707f
CB
1504HAVE_FNMATCH_H
1505NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H
1506NEXT_FNMATCH_H
1507REPLACE_FNMATCH
1508HAVE_FNMATCH
1509GNULIB_FNMATCH
88b48903
WN
1510REPLACE_ITOLD
1511GL_GENERATE_FLOAT_H_FALSE
1512GL_GENERATE_FLOAT_H_TRUE
1513FLOAT_H
1514NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
1515NEXT_FLOAT_H
6ec2e0f5
SDJ
1516NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
1517NEXT_FCNTL_H
1518REPLACE_OPENAT
1519REPLACE_OPEN
1520REPLACE_FCNTL
c0c3707f 1521REPLACE_CREAT
6ec2e0f5
SDJ
1522HAVE_OPENAT
1523HAVE_FCNTL
1524GNULIB_OPENAT
1525GNULIB_OPEN
1526GNULIB_NONBLOCKING
1527GNULIB_FCNTL
c0c3707f 1528GNULIB_CREAT
18848e28
GF
1529EOVERFLOW_VALUE
1530EOVERFLOW_HIDDEN
1531ENOLINK_VALUE
1532ENOLINK_HIDDEN
1533EMULTIHOP_VALUE
1534EMULTIHOP_HIDDEN
1535GL_GENERATE_ERRNO_H_FALSE
1536GL_GENERATE_ERRNO_H_TRUE
1537ERRNO_H
1538NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
1539NEXT_ERRNO_H
e26b6bb0
TT
1540HAVE_DIRENT_H
1541NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
1542NEXT_DIRENT_H
e26b6bb0
TT
1543REPLACE_FDOPENDIR
1544REPLACE_DIRFD
1545REPLACE_CLOSEDIR
1546REPLACE_OPENDIR
1547HAVE_ALPHASORT
1548HAVE_SCANDIR
1549HAVE_FDOPENDIR
1550HAVE_DECL_FDOPENDIR
1551HAVE_DECL_DIRFD
1552HAVE_CLOSEDIR
1553HAVE_REWINDDIR
1554HAVE_READDIR
1555HAVE_OPENDIR
1556GNULIB_ALPHASORT
1557GNULIB_SCANDIR
1558GNULIB_FDOPENDIR
1559GNULIB_DIRFD
1560GNULIB_CLOSEDIR
1561GNULIB_REWINDDIR
1562GNULIB_READDIR
1563GNULIB_OPENDIR
6ec2e0f5
SDJ
1564HAVE_WINSOCK2_H
1565HAVE_MSVC_INVALID_PARAMETER_HANDLER
e26b6bb0
TT
1566UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
1567UNISTD_H_HAVE_WINSOCK2_H
1568REPLACE_WRITE
1569REPLACE_USLEEP
1570REPLACE_UNLINKAT
1571REPLACE_UNLINK
1572REPLACE_TTYNAME_R
c0c3707f 1573REPLACE_TRUNCATE
4a626d0a 1574REPLACE_SYMLINKAT
e26b6bb0
TT
1575REPLACE_SYMLINK
1576REPLACE_SLEEP
1577REPLACE_RMDIR
4a626d0a 1578REPLACE_READLINKAT
e26b6bb0
TT
1579REPLACE_READLINK
1580REPLACE_READ
1581REPLACE_PWRITE
1582REPLACE_PREAD
1583REPLACE_LSEEK
1584REPLACE_LINKAT
1585REPLACE_LINK
1586REPLACE_LCHOWN
1587REPLACE_ISATTY
c0c3707f 1588REPLACE_GETPASS
e26b6bb0
TT
1589REPLACE_GETPAGESIZE
1590REPLACE_GETGROUPS
1591REPLACE_GETLOGIN_R
4a626d0a 1592REPLACE_GETDTABLESIZE
e26b6bb0
TT
1593REPLACE_GETDOMAINNAME
1594REPLACE_GETCWD
1595REPLACE_FTRUNCATE
1596REPLACE_FCHOWNAT
c0c3707f 1597REPLACE_FACCESSAT
e26b6bb0
TT
1598REPLACE_DUP2
1599REPLACE_DUP
1600REPLACE_CLOSE
1601REPLACE_CHOWN
c0c3707f 1602REPLACE_ACCESS
e26b6bb0
TT
1603HAVE_SYS_PARAM_H
1604HAVE_OS_H
1605HAVE_DECL_TTYNAME_R
c0c3707f 1606HAVE_DECL_TRUNCATE
e26b6bb0
TT
1607HAVE_DECL_SETHOSTNAME
1608HAVE_DECL_GETUSERSHELL
1609HAVE_DECL_GETPAGESIZE
1610HAVE_DECL_GETLOGIN_R
c0c3707f 1611HAVE_DECL_GETLOGIN
e26b6bb0
TT
1612HAVE_DECL_GETDOMAINNAME
1613HAVE_DECL_FDATASYNC
1614HAVE_DECL_FCHDIR
1615HAVE_DECL_ENVIRON
1616HAVE_USLEEP
1617HAVE_UNLINKAT
1618HAVE_SYMLINKAT
1619HAVE_SYMLINK
1620HAVE_SLEEP
1621HAVE_SETHOSTNAME
1622HAVE_READLINKAT
1623HAVE_READLINK
1624HAVE_PWRITE
1625HAVE_PREAD
1626HAVE_PIPE2
1627HAVE_PIPE
1628HAVE_LINKAT
1629HAVE_LINK
1630HAVE_LCHOWN
1631HAVE_GROUP_MEMBER
c0c3707f 1632HAVE_GETPASS
e26b6bb0
TT
1633HAVE_GETPAGESIZE
1634HAVE_GETLOGIN
1635HAVE_GETHOSTNAME
1636HAVE_GETGROUPS
1637HAVE_GETDTABLESIZE
1638HAVE_FTRUNCATE
1639HAVE_FSYNC
1640HAVE_FDATASYNC
1641HAVE_FCHOWNAT
1642HAVE_FCHDIR
1643HAVE_FACCESSAT
1644HAVE_EUIDACCESS
1645HAVE_DUP3
1646HAVE_DUP2
c0c3707f 1647HAVE_COPY_FILE_RANGE
e26b6bb0
TT
1648HAVE_CHOWN
1649GNULIB_WRITE
1650GNULIB_USLEEP
1651GNULIB_UNLINKAT
1652GNULIB_UNLINK
1653GNULIB_UNISTD_H_SIGPIPE
1654GNULIB_UNISTD_H_NONBLOCKING
1655GNULIB_TTYNAME_R
c0c3707f 1656GNULIB_TRUNCATE
e26b6bb0
TT
1657GNULIB_SYMLINKAT
1658GNULIB_SYMLINK
1659GNULIB_SLEEP
1660GNULIB_SETHOSTNAME
1661GNULIB_RMDIR
1662GNULIB_READLINKAT
1663GNULIB_READLINK
1664GNULIB_READ
1665GNULIB_PWRITE
1666GNULIB_PREAD
1667GNULIB_PIPE2
1668GNULIB_PIPE
1669GNULIB_LSEEK
1670GNULIB_LINKAT
1671GNULIB_LINK
1672GNULIB_LCHOWN
1673GNULIB_ISATTY
1674GNULIB_GROUP_MEMBER
1675GNULIB_GETUSERSHELL
c0c3707f 1676GNULIB_GETPASS
e26b6bb0 1677GNULIB_GETPAGESIZE
5df4cba6 1678GNULIB_GETOPT_POSIX
e26b6bb0
TT
1679GNULIB_GETLOGIN_R
1680GNULIB_GETLOGIN
1681GNULIB_GETHOSTNAME
1682GNULIB_GETGROUPS
1683GNULIB_GETDTABLESIZE
1684GNULIB_GETDOMAINNAME
1685GNULIB_GETCWD
1686GNULIB_FTRUNCATE
1687GNULIB_FSYNC
1688GNULIB_FDATASYNC
1689GNULIB_FCHOWNAT
1690GNULIB_FCHDIR
1691GNULIB_FACCESSAT
1692GNULIB_EUIDACCESS
1693GNULIB_ENVIRON
1694GNULIB_DUP3
1695GNULIB_DUP2
1696GNULIB_DUP
c0c3707f 1697GNULIB_COPY_FILE_RANGE
e26b6bb0
TT
1698GNULIB_CLOSE
1699GNULIB_CHOWN
1700GNULIB_CHDIR
c0c3707f 1701GNULIB_ACCESS
98399780
YQ
1702REPLACE_WCTOMB
1703REPLACE_UNSETENV
c0c3707f 1704REPLACE_STRTOLD
98399780 1705REPLACE_STRTOD
c0c3707f 1706REPLACE_SETSTATE
98399780
YQ
1707REPLACE_SETENV
1708REPLACE_REALPATH
1709REPLACE_REALLOC
1710REPLACE_RANDOM_R
c0c3707f 1711REPLACE_RANDOM
4a626d0a 1712REPLACE_QSORT_R
98399780
YQ
1713REPLACE_PUTENV
1714REPLACE_PTSNAME_R
1715REPLACE_PTSNAME
1716REPLACE_MKSTEMP
1717REPLACE_MBTOWC
1718REPLACE_MALLOC
c0c3707f 1719REPLACE_INITSTATE
98399780
YQ
1720REPLACE_CANONICALIZE_FILE_NAME
1721REPLACE_CALLOC
1722HAVE_DECL_UNSETENV
1723HAVE_UNLOCKPT
1724HAVE_SYS_LOADAVG_H
1725HAVE_STRUCT_RANDOM_DATA
1726HAVE_STRTOULL
1727HAVE_STRTOLL
c0c3707f 1728HAVE_STRTOLD
98399780 1729HAVE_STRTOD
c0c3707f
CB
1730HAVE_DECL_SETSTATE
1731HAVE_SETSTATE
98399780
YQ
1732HAVE_DECL_SETENV
1733HAVE_SETENV
4a626d0a 1734HAVE_SECURE_GETENV
98399780
YQ
1735HAVE_RPMATCH
1736HAVE_REALPATH
c0c3707f 1737HAVE_REALLOCARRAY
98399780
YQ
1738HAVE_RANDOM_R
1739HAVE_RANDOM_H
1740HAVE_RANDOM
4c62b19f 1741HAVE_QSORT_R
98399780
YQ
1742HAVE_PTSNAME_R
1743HAVE_PTSNAME
1744HAVE_POSIX_OPENPT
1745HAVE_MKSTEMPS
1746HAVE_MKSTEMP
1747HAVE_MKOSTEMPS
1748HAVE_MKOSTEMP
1749HAVE_MKDTEMP
c0c3707f
CB
1750HAVE_MBTOWC
1751HAVE_DECL_INITSTATE
1752HAVE_INITSTATE
98399780
YQ
1753HAVE_GRANTPT
1754HAVE_GETSUBOPT
1755HAVE_DECL_GETLOADAVG
1756HAVE_CANONICALIZE_FILE_NAME
1757HAVE_ATOLL
1758HAVE__EXIT
1759GNULIB_WCTOMB
1760GNULIB_UNSETENV
1761GNULIB_UNLOCKPT
1762GNULIB_SYSTEM_POSIX
1763GNULIB_STRTOULL
1764GNULIB_STRTOLL
c0c3707f 1765GNULIB_STRTOLD
98399780
YQ
1766GNULIB_STRTOD
1767GNULIB_SETENV
4a626d0a 1768GNULIB_SECURE_GETENV
98399780
YQ
1769GNULIB_RPMATCH
1770GNULIB_REALPATH
1771GNULIB_REALLOC_POSIX
c0c3707f 1772GNULIB_REALLOCARRAY
98399780
YQ
1773GNULIB_RANDOM_R
1774GNULIB_RANDOM
4a626d0a 1775GNULIB_QSORT_R
98399780
YQ
1776GNULIB_PUTENV
1777GNULIB_PTSNAME_R
1778GNULIB_PTSNAME
1779GNULIB_POSIX_OPENPT
1780GNULIB_MKSTEMPS
1781GNULIB_MKSTEMP
1782GNULIB_MKOSTEMPS
1783GNULIB_MKOSTEMP
1784GNULIB_MKDTEMP
1785GNULIB_MBTOWC
1786GNULIB_MALLOC_POSIX
1787GNULIB_GRANTPT
1788GNULIB_GETSUBOPT
1789GNULIB_GETLOADAVG
1790GNULIB_CANONICALIZE_FILE_NAME
1791GNULIB_CALLOC_POSIX
1792GNULIB_ATOLL
1793GNULIB__EXIT
725e2999 1794MKDIR_P
c0c3707f 1795HAVE_WS2TCPIP_H
725e2999
JB
1796HAVE_FEATURES_H
1797NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
1798NEXT_ARPA_INET_H
1799PRAGMA_COLUMNS
1800PRAGMA_SYSTEM_HEADER
1801INCLUDE_NEXT_AS_FIRST_DIRECTIVE
1802INCLUDE_NEXT
1803HAVE_ARPA_INET_H
1804REPLACE_INET_PTON
1805REPLACE_INET_NTOP
1806HAVE_DECL_INET_PTON
1807HAVE_DECL_INET_NTOP
1808GNULIB_INET_PTON
1809GNULIB_INET_NTOP
c0c3707f 1810HAVE_ALLOCA_H
8690e634
JK
1811GL_GENERATE_ALLOCA_H_FALSE
1812GL_GENERATE_ALLOCA_H_TRUE
1813ALLOCA_H
1814ALLOCA
c971b7fa
PA
1815GL_COND_LIBTOOL_FALSE
1816GL_COND_LIBTOOL_TRUE
1817target_os
1818target_vendor
1819target_cpu
1820target
c971b7fa
PA
1821host_os
1822host_vendor
1823host_cpu
1824host
1825build_os
1826build_vendor
1827build_cpu
1828build
4a626d0a
PA
1829RANLIB
1830ARFLAGS
1831AR
1832EGREP
1833GREP
1834CPP
c971b7fa
PA
1835OBJEXT
1836EXEEXT
1837ac_ct_CC
1838CPPFLAGS
1839LDFLAGS
1840CFLAGS
1841CC
1842MAINT
1843MAINTAINER_MODE_FALSE
1844MAINTAINER_MODE_TRUE
1845target_alias
1846host_alias
1847build_alias
1848LIBS
1849ECHO_T
1850ECHO_N
1851ECHO_C
1852DEFS
1853mandir
1854localedir
1855libdir
1856psdir
1857pdfdir
1858dvidir
1859htmldir
1860infodir
1861docdir
1862oldincludedir
1863includedir
1864localstatedir
1865sharedstatedir
1866sysconfdir
1867datadir
1868datarootdir
1869libexecdir
1870sbindir
1871bindir
1872program_transform_name
1873prefix
1874exec_prefix
1875PACKAGE_URL
1876PACKAGE_BUGREPORT
1877PACKAGE_STRING
1878PACKAGE_VERSION
1879PACKAGE_TARNAME
1880PACKAGE_NAME
1881PATH_SEPARATOR
1882SHELL'
1883ac_subst_files=''
1884ac_user_opts='
1885enable_option_checking
1886enable_maintainer_mode
2196f55f 1887enable_largefile
5abebf3c 1888enable_threads
73cc7272 1889enable_plugins
c0c3707f 1890enable_cross_guesses
c971b7fa 1891enable_dependency_tracking
39be3c7e 1892enable_silent_rules
c971b7fa
PA
1893'
1894 ac_precious_vars='build_alias
1895host_alias
1896target_alias
1897CC
1898CFLAGS
1899LDFLAGS
1900LIBS
1901CPPFLAGS
1902CPP'
1903
1904
1905# Initialize some variables set by options.
1906ac_init_help=
1907ac_init_version=false
1908ac_unrecognized_opts=
1909ac_unrecognized_sep=
1910# The variables have the same names as the options, with
1911# dashes changed to underlines.
1912cache_file=/dev/null
1913exec_prefix=NONE
1914no_create=
1915no_recursion=
1916prefix=NONE
1917program_prefix=NONE
1918program_suffix=NONE
1919program_transform_name=s,x,x,
1920silent=
1921site=
1922srcdir=
1923verbose=
1924x_includes=NONE
1925x_libraries=NONE
1926
1927# Installation directory options.
1928# These are left unexpanded so users can "make install exec_prefix=/foo"
1929# and all the variables that are supposed to be based on exec_prefix
1930# by default will actually change.
1931# Use braces instead of parens because sh, perl, etc. also accept them.
1932# (The list follows the same order as the GNU Coding Standards.)
1933bindir='${exec_prefix}/bin'
1934sbindir='${exec_prefix}/sbin'
1935libexecdir='${exec_prefix}/libexec'
1936datarootdir='${prefix}/share'
1937datadir='${datarootdir}'
1938sysconfdir='${prefix}/etc'
1939sharedstatedir='${prefix}/com'
1940localstatedir='${prefix}/var'
1941includedir='${prefix}/include'
1942oldincludedir='/usr/include'
d0ac1c44 1943docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
c971b7fa
PA
1944infodir='${datarootdir}/info'
1945htmldir='${docdir}'
1946dvidir='${docdir}'
1947pdfdir='${docdir}'
1948psdir='${docdir}'
1949libdir='${exec_prefix}/lib'
1950localedir='${datarootdir}/locale'
1951mandir='${datarootdir}/man'
1952
1953ac_prev=
1954ac_dashdash=
1955for ac_option
1956do
1957 # If the previous option needs an argument, assign it.
1958 if test -n "$ac_prev"; then
1959 eval $ac_prev=\$ac_option
1960 ac_prev=
1961 continue
1962 fi
1963
1964 case $ac_option in
d0ac1c44
SM
1965 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
1966 *=) ac_optarg= ;;
1967 *) ac_optarg=yes ;;
c971b7fa
PA
1968 esac
1969
1970 # Accept the important Cygnus configure options, so we can diagnose typos.
1971
1972 case $ac_dashdash$ac_option in
1973 --)
1974 ac_dashdash=yes ;;
1975
1976 -bindir | --bindir | --bindi | --bind | --bin | --bi)
1977 ac_prev=bindir ;;
1978 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
1979 bindir=$ac_optarg ;;
1980
1981 -build | --build | --buil | --bui | --bu)
1982 ac_prev=build_alias ;;
1983 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
1984 build_alias=$ac_optarg ;;
1985
1986 -cache-file | --cache-file | --cache-fil | --cache-fi \
1987 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1988 ac_prev=cache_file ;;
1989 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1990 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
1991 cache_file=$ac_optarg ;;
1992
1993 --config-cache | -C)
1994 cache_file=config.cache ;;
1995
1996 -datadir | --datadir | --datadi | --datad)
1997 ac_prev=datadir ;;
1998 -datadir=* | --datadir=* | --datadi=* | --datad=*)
1999 datadir=$ac_optarg ;;
2000
2001 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
2002 | --dataroo | --dataro | --datar)
2003 ac_prev=datarootdir ;;
2004 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
2005 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
2006 datarootdir=$ac_optarg ;;
2007
2008 -disable-* | --disable-*)
2009 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
2010 # Reject names that are not valid shell variable names.
2011 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2012 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2013 ac_useropt_orig=$ac_useropt
2014 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2015 case $ac_user_opts in
2016 *"
2017"enable_$ac_useropt"
2018"*) ;;
2019 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
2020 ac_unrecognized_sep=', ';;
2021 esac
2022 eval enable_$ac_useropt=no ;;
2023
2024 -docdir | --docdir | --docdi | --doc | --do)
2025 ac_prev=docdir ;;
2026 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
2027 docdir=$ac_optarg ;;
2028
2029 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
2030 ac_prev=dvidir ;;
2031 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
2032 dvidir=$ac_optarg ;;
2033
2034 -enable-* | --enable-*)
2035 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
2036 # Reject names that are not valid shell variable names.
2037 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2038 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2039 ac_useropt_orig=$ac_useropt
2040 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2041 case $ac_user_opts in
2042 *"
2043"enable_$ac_useropt"
2044"*) ;;
2045 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
2046 ac_unrecognized_sep=', ';;
2047 esac
2048 eval enable_$ac_useropt=\$ac_optarg ;;
2049
2050 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
2051 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
2052 | --exec | --exe | --ex)
2053 ac_prev=exec_prefix ;;
2054 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
2055 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
2056 | --exec=* | --exe=* | --ex=*)
2057 exec_prefix=$ac_optarg ;;
2058
2059 -gas | --gas | --ga | --g)
2060 # Obsolete; use --with-gas.
2061 with_gas=yes ;;
2062
2063 -help | --help | --hel | --he | -h)
2064 ac_init_help=long ;;
2065 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
2066 ac_init_help=recursive ;;
2067 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
2068 ac_init_help=short ;;
2069
2070 -host | --host | --hos | --ho)
2071 ac_prev=host_alias ;;
2072 -host=* | --host=* | --hos=* | --ho=*)
2073 host_alias=$ac_optarg ;;
2074
2075 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
2076 ac_prev=htmldir ;;
2077 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
2078 | --ht=*)
2079 htmldir=$ac_optarg ;;
2080
2081 -includedir | --includedir | --includedi | --included | --include \
2082 | --includ | --inclu | --incl | --inc)
2083 ac_prev=includedir ;;
2084 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
2085 | --includ=* | --inclu=* | --incl=* | --inc=*)
2086 includedir=$ac_optarg ;;
2087
2088 -infodir | --infodir | --infodi | --infod | --info | --inf)
2089 ac_prev=infodir ;;
2090 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
2091 infodir=$ac_optarg ;;
2092
2093 -libdir | --libdir | --libdi | --libd)
2094 ac_prev=libdir ;;
2095 -libdir=* | --libdir=* | --libdi=* | --libd=*)
2096 libdir=$ac_optarg ;;
2097
2098 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
2099 | --libexe | --libex | --libe)
2100 ac_prev=libexecdir ;;
2101 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
2102 | --libexe=* | --libex=* | --libe=*)
2103 libexecdir=$ac_optarg ;;
2104
2105 -localedir | --localedir | --localedi | --localed | --locale)
2106 ac_prev=localedir ;;
2107 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
2108 localedir=$ac_optarg ;;
2109
2110 -localstatedir | --localstatedir | --localstatedi | --localstated \
2111 | --localstate | --localstat | --localsta | --localst | --locals)
2112 ac_prev=localstatedir ;;
2113 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
2114 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
2115 localstatedir=$ac_optarg ;;
2116
2117 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
2118 ac_prev=mandir ;;
2119 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
2120 mandir=$ac_optarg ;;
2121
2122 -nfp | --nfp | --nf)
2123 # Obsolete; use --without-fp.
2124 with_fp=no ;;
2125
2126 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
2127 | --no-cr | --no-c | -n)
2128 no_create=yes ;;
2129
2130 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
2131 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
2132 no_recursion=yes ;;
2133
2134 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
2135 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
2136 | --oldin | --oldi | --old | --ol | --o)
2137 ac_prev=oldincludedir ;;
2138 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
2139 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
2140 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
2141 oldincludedir=$ac_optarg ;;
2142
2143 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
2144 ac_prev=prefix ;;
2145 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
2146 prefix=$ac_optarg ;;
2147
2148 -program-prefix | --program-prefix | --program-prefi | --program-pref \
2149 | --program-pre | --program-pr | --program-p)
2150 ac_prev=program_prefix ;;
2151 -program-prefix=* | --program-prefix=* | --program-prefi=* \
2152 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
2153 program_prefix=$ac_optarg ;;
2154
2155 -program-suffix | --program-suffix | --program-suffi | --program-suff \
2156 | --program-suf | --program-su | --program-s)
2157 ac_prev=program_suffix ;;
2158 -program-suffix=* | --program-suffix=* | --program-suffi=* \
2159 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
2160 program_suffix=$ac_optarg ;;
2161
2162 -program-transform-name | --program-transform-name \
2163 | --program-transform-nam | --program-transform-na \
2164 | --program-transform-n | --program-transform- \
2165 | --program-transform | --program-transfor \
2166 | --program-transfo | --program-transf \
2167 | --program-trans | --program-tran \
2168 | --progr-tra | --program-tr | --program-t)
2169 ac_prev=program_transform_name ;;
2170 -program-transform-name=* | --program-transform-name=* \
2171 | --program-transform-nam=* | --program-transform-na=* \
2172 | --program-transform-n=* | --program-transform-=* \
2173 | --program-transform=* | --program-transfor=* \
2174 | --program-transfo=* | --program-transf=* \
2175 | --program-trans=* | --program-tran=* \
2176 | --progr-tra=* | --program-tr=* | --program-t=*)
2177 program_transform_name=$ac_optarg ;;
2178
2179 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
2180 ac_prev=pdfdir ;;
2181 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
2182 pdfdir=$ac_optarg ;;
2183
2184 -psdir | --psdir | --psdi | --psd | --ps)
2185 ac_prev=psdir ;;
2186 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
2187 psdir=$ac_optarg ;;
2188
2189 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2190 | -silent | --silent | --silen | --sile | --sil)
2191 silent=yes ;;
2192
2193 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
2194 ac_prev=sbindir ;;
2195 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
2196 | --sbi=* | --sb=*)
2197 sbindir=$ac_optarg ;;
2198
2199 -sharedstatedir | --sharedstatedir | --sharedstatedi \
2200 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
2201 | --sharedst | --shareds | --shared | --share | --shar \
2202 | --sha | --sh)
2203 ac_prev=sharedstatedir ;;
2204 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
2205 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
2206 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
2207 | --sha=* | --sh=*)
2208 sharedstatedir=$ac_optarg ;;
2209
2210 -site | --site | --sit)
2211 ac_prev=site ;;
2212 -site=* | --site=* | --sit=*)
2213 site=$ac_optarg ;;
2214
2215 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
2216 ac_prev=srcdir ;;
2217 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
2218 srcdir=$ac_optarg ;;
2219
2220 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
2221 | --syscon | --sysco | --sysc | --sys | --sy)
2222 ac_prev=sysconfdir ;;
2223 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
2224 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
2225 sysconfdir=$ac_optarg ;;
2226
2227 -target | --target | --targe | --targ | --tar | --ta | --t)
2228 ac_prev=target_alias ;;
2229 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
2230 target_alias=$ac_optarg ;;
2231
2232 -v | -verbose | --verbose | --verbos | --verbo | --verb)
2233 verbose=yes ;;
2234
2235 -version | --version | --versio | --versi | --vers | -V)
2236 ac_init_version=: ;;
2237
2238 -with-* | --with-*)
2239 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
2240 # Reject names that are not valid shell variable names.
2241 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2242 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2243 ac_useropt_orig=$ac_useropt
2244 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2245 case $ac_user_opts in
2246 *"
2247"with_$ac_useropt"
2248"*) ;;
2249 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
2250 ac_unrecognized_sep=', ';;
2251 esac
2252 eval with_$ac_useropt=\$ac_optarg ;;
2253
2254 -without-* | --without-*)
2255 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
2256 # Reject names that are not valid shell variable names.
2257 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2258 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2259 ac_useropt_orig=$ac_useropt
2260 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2261 case $ac_user_opts in
2262 *"
2263"with_$ac_useropt"
2264"*) ;;
2265 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
2266 ac_unrecognized_sep=', ';;
2267 esac
2268 eval with_$ac_useropt=no ;;
2269
2270 --x)
2271 # Obsolete; use --with-x.
2272 with_x=yes ;;
2273
2274 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
2275 | --x-incl | --x-inc | --x-in | --x-i)
2276 ac_prev=x_includes ;;
2277 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
2278 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
2279 x_includes=$ac_optarg ;;
2280
2281 -x-libraries | --x-libraries | --x-librarie | --x-librari \
2282 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
2283 ac_prev=x_libraries ;;
2284 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
2285 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
2286 x_libraries=$ac_optarg ;;
2287
d0ac1c44
SM
2288 -*) as_fn_error $? "unrecognized option: \`$ac_option'
2289Try \`$0 --help' for more information"
c971b7fa
PA
2290 ;;
2291
2292 *=*)
2293 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
2294 # Reject names that are not valid shell variable names.
2295 case $ac_envvar in #(
2296 '' | [0-9]* | *[!_$as_cr_alnum]* )
d0ac1c44 2297 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
c971b7fa
PA
2298 esac
2299 eval $ac_envvar=\$ac_optarg
2300 export $ac_envvar ;;
2301
2302 *)
2303 # FIXME: should be removed in autoconf 3.0.
2304 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
2305 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
2306 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
d0ac1c44 2307 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
c971b7fa
PA
2308 ;;
2309
2310 esac
2311done
2312
2313if test -n "$ac_prev"; then
2314 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
d0ac1c44 2315 as_fn_error $? "missing argument to $ac_option"
c971b7fa
PA
2316fi
2317
2318if test -n "$ac_unrecognized_opts"; then
2319 case $enable_option_checking in
2320 no) ;;
d0ac1c44 2321 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
c971b7fa
PA
2322 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
2323 esac
2324fi
2325
2326# Check all directory arguments for consistency.
2327for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
2328 datadir sysconfdir sharedstatedir localstatedir includedir \
2329 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
2330 libdir localedir mandir
2331do
2332 eval ac_val=\$$ac_var
2333 # Remove trailing slashes.
2334 case $ac_val in
2335 */ )
2336 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
2337 eval $ac_var=\$ac_val;;
2338 esac
2339 # Be sure to have absolute directory names.
2340 case $ac_val in
2341 [\\/$]* | ?:[\\/]* ) continue;;
2342 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
2343 esac
d0ac1c44 2344 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
c971b7fa
PA
2345done
2346
2347# There might be people who depend on the old broken behavior: `$host'
2348# used to hold the argument of --host etc.
2349# FIXME: To remove some day.
2350build=$build_alias
2351host=$host_alias
2352target=$target_alias
2353
2354# FIXME: To remove some day.
2355if test "x$host_alias" != x; then
2356 if test "x$build_alias" = x; then
2357 cross_compiling=maybe
c971b7fa
PA
2358 elif test "x$build_alias" != "x$host_alias"; then
2359 cross_compiling=yes
2360 fi
2361fi
2362
2363ac_tool_prefix=
2364test -n "$host_alias" && ac_tool_prefix=$host_alias-
2365
2366test "$silent" = yes && exec 6>/dev/null
2367
2368
2369ac_pwd=`pwd` && test -n "$ac_pwd" &&
2370ac_ls_di=`ls -di .` &&
2371ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
d0ac1c44 2372 as_fn_error $? "working directory cannot be determined"
c971b7fa 2373test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
d0ac1c44 2374 as_fn_error $? "pwd does not report name of working directory"
c971b7fa
PA
2375
2376
2377# Find the source files, if location was not specified.
2378if test -z "$srcdir"; then
2379 ac_srcdir_defaulted=yes
2380 # Try the directory containing this script, then the parent directory.
2381 ac_confdir=`$as_dirname -- "$as_myself" ||
2382$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2383 X"$as_myself" : 'X\(//\)[^/]' \| \
2384 X"$as_myself" : 'X\(//\)$' \| \
2385 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
2386$as_echo X"$as_myself" |
2387 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
2388 s//\1/
2389 q
2390 }
2391 /^X\(\/\/\)[^/].*/{
2392 s//\1/
2393 q
2394 }
2395 /^X\(\/\/\)$/{
2396 s//\1/
2397 q
2398 }
2399 /^X\(\/\).*/{
2400 s//\1/
2401 q
2402 }
2403 s/.*/./; q'`
2404 srcdir=$ac_confdir
2405 if test ! -r "$srcdir/$ac_unique_file"; then
2406 srcdir=..
2407 fi
2408else
2409 ac_srcdir_defaulted=no
2410fi
2411if test ! -r "$srcdir/$ac_unique_file"; then
2412 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
d0ac1c44 2413 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
c971b7fa
PA
2414fi
2415ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
2416ac_abs_confdir=`(
d0ac1c44 2417 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
c971b7fa
PA
2418 pwd)`
2419# When building in place, set srcdir=.
2420if test "$ac_abs_confdir" = "$ac_pwd"; then
2421 srcdir=.
2422fi
2423# Remove unnecessary trailing slashes from srcdir.
2424# Double slashes in file names in object file debugging info
2425# mess up M-x gdb in Emacs.
2426case $srcdir in
2427*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
2428esac
2429for ac_var in $ac_precious_vars; do
2430 eval ac_env_${ac_var}_set=\${${ac_var}+set}
2431 eval ac_env_${ac_var}_value=\$${ac_var}
2432 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
2433 eval ac_cv_env_${ac_var}_value=\$${ac_var}
2434done
2435
2436#
2437# Report the --help message.
2438#
2439if test "$ac_init_help" = "long"; then
2440 # Omit some internal or obsolete options to make the list less imposing.
2441 # This message is too long to be a string in the A/UX 3.1 sh.
2442 cat <<_ACEOF
d0ac1c44 2443\`configure' configures libgnu UNUSED-VERSION to adapt to many kinds of systems.
c971b7fa
PA
2444
2445Usage: $0 [OPTION]... [VAR=VALUE]...
2446
2447To assign environment variables (e.g., CC, CFLAGS...), specify them as
2448VAR=VALUE. See below for descriptions of some of the useful variables.
2449
2450Defaults for the options are specified in brackets.
2451
2452Configuration:
2453 -h, --help display this help and exit
2454 --help=short display options specific to this package
2455 --help=recursive display the short help of all the included packages
2456 -V, --version display version information and exit
d0ac1c44 2457 -q, --quiet, --silent do not print \`checking ...' messages
c971b7fa
PA
2458 --cache-file=FILE cache test results in FILE [disabled]
2459 -C, --config-cache alias for \`--cache-file=config.cache'
2460 -n, --no-create do not create output files
2461 --srcdir=DIR find the sources in DIR [configure dir or \`..']
2462
2463Installation directories:
2464 --prefix=PREFIX install architecture-independent files in PREFIX
2465 [$ac_default_prefix]
2466 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
2467 [PREFIX]
2468
2469By default, \`make install' will install all the files in
2470\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
2471an installation prefix other than \`$ac_default_prefix' using \`--prefix',
2472for instance \`--prefix=\$HOME'.
2473
2474For better control, use the options below.
2475
2476Fine tuning of the installation directories:
2477 --bindir=DIR user executables [EPREFIX/bin]
2478 --sbindir=DIR system admin executables [EPREFIX/sbin]
2479 --libexecdir=DIR program executables [EPREFIX/libexec]
2480 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
2481 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
2482 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
2483 --libdir=DIR object code libraries [EPREFIX/lib]
2484 --includedir=DIR C header files [PREFIX/include]
2485 --oldincludedir=DIR C header files for non-gcc [/usr/include]
2486 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
2487 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
2488 --infodir=DIR info documentation [DATAROOTDIR/info]
2489 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
2490 --mandir=DIR man documentation [DATAROOTDIR/man]
d0ac1c44 2491 --docdir=DIR documentation root [DATAROOTDIR/doc/libgnu]
c971b7fa
PA
2492 --htmldir=DIR html documentation [DOCDIR]
2493 --dvidir=DIR dvi documentation [DOCDIR]
2494 --pdfdir=DIR pdf documentation [DOCDIR]
2495 --psdir=DIR ps documentation [DOCDIR]
2496_ACEOF
2497
2498 cat <<\_ACEOF
2499
2500Program names:
2501 --program-prefix=PREFIX prepend PREFIX to installed program names
2502 --program-suffix=SUFFIX append SUFFIX to installed program names
2503 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
2504
2505System types:
2506 --build=BUILD configure for building on BUILD [guessed]
2507 --host=HOST cross-compile to build programs to run on HOST [BUILD]
2508 --target=TARGET configure for building compilers for TARGET [HOST]
2509_ACEOF
2510fi
2511
2512if test -n "$ac_init_help"; then
d0ac1c44
SM
2513 case $ac_init_help in
2514 short | recursive ) echo "Configuration of libgnu UNUSED-VERSION:";;
2515 esac
c971b7fa
PA
2516 cat <<\_ACEOF
2517
2518Optional Features:
2519 --disable-option-checking ignore unrecognized --enable/--with options
2520 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
2521 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
d0ac1c44
SM
2522 --enable-maintainer-mode
2523 enable make rules and dependencies not useful (and
2524 sometimes confusing) to the casual installer
2196f55f 2525 --disable-largefile omit support for large files
c0c3707f 2526 --enable-threads={isoc|posix|isoc+posix|windows}
5abebf3c
CB
2527 specify multithreading API
2528 --disable-threads build without multithread safety
73cc7272 2529 --enable-plugins Enable support for plugins
c0c3707f
CB
2530 --enable-cross-guesses={conservative|risky}
2531 specify policy for cross-compilation guesses
d0ac1c44
SM
2532 --enable-dependency-tracking
2533 do not reject slow dependency extractors
2534 --disable-dependency-tracking
2535 speeds up one-time build
2536 --enable-silent-rules less verbose build output (undo: "make V=1")
2537 --disable-silent-rules verbose build output (undo: "make V=0")
c971b7fa
PA
2538
2539Some influential environment variables:
2540 CC C compiler command
2541 CFLAGS C compiler flags
2542 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
2543 nonstandard directory <lib dir>
2544 LIBS libraries to pass to the linker, e.g. -l<library>
d0ac1c44 2545 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
c971b7fa
PA
2546 you have headers in a nonstandard directory <include dir>
2547 CPP C preprocessor
2548
2549Use these variables to override the choices made by `configure' or to help
2550it to find libraries and programs with nonstandard names/locations.
2551
2552Report bugs to the package provider.
2553_ACEOF
2554ac_status=$?
2555fi
2556
2557if test "$ac_init_help" = "recursive"; then
2558 # If there are subdirs, report their specific --help.
2559 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
2560 test -d "$ac_dir" ||
2561 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
2562 continue
2563 ac_builddir=.
2564
2565case "$ac_dir" in
2566.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
2567*)
2568 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
2569 # A ".." for each directory in $ac_dir_suffix.
2570 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
2571 case $ac_top_builddir_sub in
2572 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
2573 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
2574 esac ;;
2575esac
2576ac_abs_top_builddir=$ac_pwd
2577ac_abs_builddir=$ac_pwd$ac_dir_suffix
2578# for backward compatibility:
2579ac_top_builddir=$ac_top_build_prefix
2580
2581case $srcdir in
2582 .) # We are building in place.
2583 ac_srcdir=.
2584 ac_top_srcdir=$ac_top_builddir_sub
2585 ac_abs_top_srcdir=$ac_pwd ;;
2586 [\\/]* | ?:[\\/]* ) # Absolute name.
2587 ac_srcdir=$srcdir$ac_dir_suffix;
2588 ac_top_srcdir=$srcdir
2589 ac_abs_top_srcdir=$srcdir ;;
2590 *) # Relative name.
2591 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
2592 ac_top_srcdir=$ac_top_build_prefix$srcdir
2593 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
2594esac
2595ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
2596
2597 cd "$ac_dir" || { ac_status=$?; continue; }
2598 # Check for guested configure.
2599 if test -f "$ac_srcdir/configure.gnu"; then
2600 echo &&
2601 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
2602 elif test -f "$ac_srcdir/configure"; then
2603 echo &&
2604 $SHELL "$ac_srcdir/configure" --help=recursive
2605 else
2606 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
2607 fi || ac_status=$?
2608 cd "$ac_pwd" || { ac_status=$?; break; }
2609 done
2610fi
2611
2612test -n "$ac_init_help" && exit $ac_status
2613if $ac_init_version; then
2614 cat <<\_ACEOF
d0ac1c44
SM
2615libgnu configure UNUSED-VERSION
2616generated by GNU Autoconf 2.69
c971b7fa 2617
d0ac1c44 2618Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
2619This configure script is free software; the Free Software Foundation
2620gives unlimited permission to copy, distribute and modify it.
2621_ACEOF
2622 exit
2623fi
2624
2625## ------------------------ ##
2626## Autoconf initialization. ##
2627## ------------------------ ##
2628
2629# ac_fn_c_try_compile LINENO
2630# --------------------------
2631# Try to compile conftest.$ac_ext, and return whether this succeeded.
2632ac_fn_c_try_compile ()
2633{
2634 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2635 rm -f conftest.$ac_objext
2636 if { { ac_try="$ac_compile"
2637case "(($ac_try" in
2638 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2639 *) ac_try_echo=$ac_try;;
2640esac
2641eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2642$as_echo "$ac_try_echo"; } >&5
2643 (eval "$ac_compile") 2>conftest.err
2644 ac_status=$?
2645 if test -s conftest.err; then
2646 grep -v '^ *+' conftest.err >conftest.er1
2647 cat conftest.er1 >&5
2648 mv -f conftest.er1 conftest.err
2649 fi
2650 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2651 test $ac_status = 0; } && {
2652 test -z "$ac_c_werror_flag" ||
2653 test ! -s conftest.err
2654 } && test -s conftest.$ac_objext; then :
2655 ac_retval=0
2656else
2657 $as_echo "$as_me: failed program was:" >&5
2658sed 's/^/| /' conftest.$ac_ext >&5
2659
2660 ac_retval=1
2661fi
d0ac1c44
SM
2662 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2663 as_fn_set_status $ac_retval
c971b7fa
PA
2664
2665} # ac_fn_c_try_compile
2666
2667# ac_fn_c_try_cpp LINENO
2668# ----------------------
2669# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
2670ac_fn_c_try_cpp ()
2671{
2672 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2673 if { { ac_try="$ac_cpp conftest.$ac_ext"
2674case "(($ac_try" in
2675 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2676 *) ac_try_echo=$ac_try;;
2677esac
2678eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2679$as_echo "$ac_try_echo"; } >&5
2680 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
2681 ac_status=$?
2682 if test -s conftest.err; then
2683 grep -v '^ *+' conftest.err >conftest.er1
2684 cat conftest.er1 >&5
2685 mv -f conftest.er1 conftest.err
2686 fi
2687 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
d0ac1c44 2688 test $ac_status = 0; } > conftest.i && {
c971b7fa
PA
2689 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
2690 test ! -s conftest.err
2691 }; then :
2692 ac_retval=0
2693else
2694 $as_echo "$as_me: failed program was:" >&5
2695sed 's/^/| /' conftest.$ac_ext >&5
2696
2697 ac_retval=1
2698fi
d0ac1c44
SM
2699 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2700 as_fn_set_status $ac_retval
c971b7fa
PA
2701
2702} # ac_fn_c_try_cpp
2703
2704# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
2705# -------------------------------------------------------
2706# Tests whether HEADER exists, giving a warning if it cannot be compiled using
2707# the include files in INCLUDES and setting the cache variable VAR
2708# accordingly.
2709ac_fn_c_check_header_mongrel ()
2710{
2711 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
d0ac1c44 2712 if eval \${$3+:} false; then :
c971b7fa
PA
2713 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2714$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2715if eval \${$3+:} false; then :
c971b7fa
PA
2716 $as_echo_n "(cached) " >&6
2717fi
2718eval ac_res=\$$3
2719 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2720$as_echo "$ac_res" >&6; }
2721else
2722 # Is the header compilable?
2723{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
2724$as_echo_n "checking $2 usability... " >&6; }
2725cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2726/* end confdefs.h. */
2727$4
2728#include <$2>
2729_ACEOF
2730if ac_fn_c_try_compile "$LINENO"; then :
2731 ac_header_compiler=yes
2732else
2733 ac_header_compiler=no
2734fi
2735rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2736{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
2737$as_echo "$ac_header_compiler" >&6; }
2738
2739# Is the header present?
2740{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
2741$as_echo_n "checking $2 presence... " >&6; }
2742cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2743/* end confdefs.h. */
2744#include <$2>
2745_ACEOF
2746if ac_fn_c_try_cpp "$LINENO"; then :
2747 ac_header_preproc=yes
2748else
2749 ac_header_preproc=no
2750fi
d0ac1c44 2751rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
2752{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
2753$as_echo "$ac_header_preproc" >&6; }
2754
2755# So? What about this header?
2756case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
2757 yes:no: )
2758 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
2759$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
2760 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2761$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2762 ;;
2763 no:yes:* )
2764 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
2765$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
2766 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
2767$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
2768 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
2769$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
2770 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
2771$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
2772 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2773$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2774 ;;
2775esac
2776 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2777$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2778if eval \${$3+:} false; then :
c971b7fa
PA
2779 $as_echo_n "(cached) " >&6
2780else
2781 eval "$3=\$ac_header_compiler"
2782fi
2783eval ac_res=\$$3
2784 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2785$as_echo "$ac_res" >&6; }
2786fi
d0ac1c44 2787 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
c971b7fa
PA
2788
2789} # ac_fn_c_check_header_mongrel
2790
2791# ac_fn_c_try_run LINENO
2792# ----------------------
2793# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
2794# that executables *can* be run.
2795ac_fn_c_try_run ()
2796{
2797 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2798 if { { ac_try="$ac_link"
2799case "(($ac_try" in
2800 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2801 *) ac_try_echo=$ac_try;;
2802esac
2803eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2804$as_echo "$ac_try_echo"; } >&5
2805 (eval "$ac_link") 2>&5
2806 ac_status=$?
2807 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2808 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
2809 { { case "(($ac_try" in
2810 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2811 *) ac_try_echo=$ac_try;;
2812esac
2813eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2814$as_echo "$ac_try_echo"; } >&5
2815 (eval "$ac_try") 2>&5
2816 ac_status=$?
2817 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2818 test $ac_status = 0; }; }; then :
2819 ac_retval=0
2820else
2821 $as_echo "$as_me: program exited with status $ac_status" >&5
2822 $as_echo "$as_me: failed program was:" >&5
2823sed 's/^/| /' conftest.$ac_ext >&5
2824
2825 ac_retval=$ac_status
2826fi
2827 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
d0ac1c44
SM
2828 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2829 as_fn_set_status $ac_retval
c971b7fa
PA
2830
2831} # ac_fn_c_try_run
2832
2833# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
2834# -------------------------------------------------------
2835# Tests whether HEADER exists and can be compiled using the include files in
2836# INCLUDES, setting the cache variable VAR accordingly.
2837ac_fn_c_check_header_compile ()
2838{
2839 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2840 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2841$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2842if eval \${$3+:} false; then :
c971b7fa
PA
2843 $as_echo_n "(cached) " >&6
2844else
2845 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2846/* end confdefs.h. */
2847$4
2848#include <$2>
2849_ACEOF
2850if ac_fn_c_try_compile "$LINENO"; then :
2851 eval "$3=yes"
2852else
2853 eval "$3=no"
2854fi
2855rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2856fi
2857eval ac_res=\$$3
2858 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2859$as_echo "$ac_res" >&6; }
d0ac1c44 2860 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
c971b7fa
PA
2861
2862} # ac_fn_c_check_header_compile
2863
73cc7272
TT
2864# ac_fn_c_try_link LINENO
2865# -----------------------
2866# Try to link conftest.$ac_ext, and return whether this succeeded.
2867ac_fn_c_try_link ()
2868{
2869 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2870 rm -f conftest.$ac_objext conftest$ac_exeext
2871 if { { ac_try="$ac_link"
2872case "(($ac_try" in
2873 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2874 *) ac_try_echo=$ac_try;;
2875esac
2876eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2877$as_echo "$ac_try_echo"; } >&5
2878 (eval "$ac_link") 2>conftest.err
2879 ac_status=$?
2880 if test -s conftest.err; then
2881 grep -v '^ *+' conftest.err >conftest.er1
2882 cat conftest.er1 >&5
2883 mv -f conftest.er1 conftest.err
2884 fi
2885 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2886 test $ac_status = 0; } && {
2887 test -z "$ac_c_werror_flag" ||
2888 test ! -s conftest.err
2889 } && test -s conftest$ac_exeext && {
2890 test "$cross_compiling" = yes ||
2891 test -x conftest$ac_exeext
2892 }; then :
2893 ac_retval=0
2894else
2895 $as_echo "$as_me: failed program was:" >&5
2896sed 's/^/| /' conftest.$ac_ext >&5
2897
2898 ac_retval=1
2899fi
2900 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2901 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2902 # interfere with the next link command; also delete a directory that is
2903 # left behind by Apple's compiler. We do this before executing the actions.
2904 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2905 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2906 as_fn_set_status $ac_retval
2907
2908} # ac_fn_c_try_link
2909
d0ac1c44
SM
2910# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2911# -------------------------------------------
2912# Tests whether TYPE exists after having included INCLUDES, setting cache
2913# variable VAR accordingly.
2914ac_fn_c_check_type ()
2915{
2916 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2917 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2918$as_echo_n "checking for $2... " >&6; }
2919if eval \${$3+:} false; then :
2920 $as_echo_n "(cached) " >&6
2921else
2922 eval "$3=no"
2923 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2924/* end confdefs.h. */
2925$4
2926int
2927main ()
2928{
2929if (sizeof ($2))
2930 return 0;
2931 ;
2932 return 0;
2933}
2934_ACEOF
2935if ac_fn_c_try_compile "$LINENO"; then :
2936 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2937/* end confdefs.h. */
2938$4
2939int
2940main ()
2941{
2942if (sizeof (($2)))
2943 return 0;
2944 ;
2945 return 0;
2946}
2947_ACEOF
2948if ac_fn_c_try_compile "$LINENO"; then :
2949
2950else
2951 eval "$3=yes"
2952fi
2953rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2954fi
2955rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2956fi
2957eval ac_res=\$$3
2958 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2959$as_echo "$ac_res" >&6; }
2960 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2961
2962} # ac_fn_c_check_type
2963
8690e634
JK
2964# ac_fn_c_check_func LINENO FUNC VAR
2965# ----------------------------------
2966# Tests whether FUNC exists, setting the cache variable VAR accordingly
2967ac_fn_c_check_func ()
2968{
2969 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2970 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2971$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2972if eval \${$3+:} false; then :
8690e634
JK
2973 $as_echo_n "(cached) " >&6
2974else
2975 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2976/* end confdefs.h. */
2977/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
2978 For example, HP-UX 11i <limits.h> declares gettimeofday. */
2979#define $2 innocuous_$2
2980
2981/* System header to define __stub macros and hopefully few prototypes,
2982 which can conflict with char $2 (); below.
2983 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
2984 <limits.h> exists even on freestanding compilers. */
2985
2986#ifdef __STDC__
2987# include <limits.h>
2988#else
2989# include <assert.h>
2990#endif
2991
2992#undef $2
2993
2994/* Override any GCC internal prototype to avoid an error.
2995 Use char because int might match the return type of a GCC
2996 builtin and then its argument prototype would still apply. */
2997#ifdef __cplusplus
2998extern "C"
2999#endif
3000char $2 ();
3001/* The GNU C library defines this for functions which it implements
3002 to always fail with ENOSYS. Some functions are actually named
3003 something starting with __ and the normal name is an alias. */
3004#if defined __stub_$2 || defined __stub___$2
3005choke me
3006#endif
3007
3008int
3009main ()
3010{
3011return $2 ();
3012 ;
3013 return 0;
3014}
3015_ACEOF
3016if ac_fn_c_try_link "$LINENO"; then :
3017 eval "$3=yes"
3018else
3019 eval "$3=no"
3020fi
3021rm -f core conftest.err conftest.$ac_objext \
3022 conftest$ac_exeext conftest.$ac_ext
3023fi
3024eval ac_res=\$$3
3025 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3026$as_echo "$ac_res" >&6; }
d0ac1c44 3027 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
8690e634
JK
3028
3029} # ac_fn_c_check_func
3030
d0ac1c44
SM
3031# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
3032# ---------------------------------------------
3033# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
3034# accordingly.
8986e351
TT
3035ac_fn_c_check_decl ()
3036{
5df4cba6
SM
3037 ac_save_ac_compile="$ac_compile"
3038 if test -n "$ac_compile_for_check_decl"; then
3039 ac_compile="$ac_compile_for_check_decl"
3040 fi
8986e351 3041 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
d0ac1c44
SM
3042 as_decl_name=`echo $2|sed 's/ *(.*//'`
3043 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
3044 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
3045$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
3046if eval \${$3+:} false; then :
8986e351
TT
3047 $as_echo_n "(cached) " >&6
3048else
3049 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3050/* end confdefs.h. */
3051$4
3052int
3053main ()
3054{
d0ac1c44
SM
3055#ifndef $as_decl_name
3056#ifdef __cplusplus
3057 (void) $as_decl_use;
3058#else
3059 (void) $as_decl_name;
3060#endif
8986e351
TT
3061#endif
3062
3063 ;
3064 return 0;
3065}
3066_ACEOF
3067if ac_fn_c_try_compile "$LINENO"; then :
3068 eval "$3=yes"
3069else
3070 eval "$3=no"
3071fi
3072rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3073fi
3074eval ac_res=\$$3
3075 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3076$as_echo "$ac_res" >&6; }
d0ac1c44 3077 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
5df4cba6 3078 ac_compile="$ac_save_ac_compile"
8986e351
TT
3079
3080} # ac_fn_c_check_decl
3081
c971b7fa
PA
3082# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
3083# --------------------------------------------
3084# Tries to find the compile-time value of EXPR in a program that includes
3085# INCLUDES, setting VAR accordingly. Returns whether the value could be
3086# computed
3087ac_fn_c_compute_int ()
3088{
3089 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3090 if test "$cross_compiling" = yes; then
3091 # Depending upon the size, compute the lo and hi bounds.
3092cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3093/* end confdefs.h. */
3094$4
3095int
3096main ()
3097{
3098static int test_array [1 - 2 * !(($2) >= 0)];
d0ac1c44
SM
3099test_array [0] = 0;
3100return test_array [0];
c971b7fa
PA
3101
3102 ;
3103 return 0;
3104}
3105_ACEOF
3106if ac_fn_c_try_compile "$LINENO"; then :
3107 ac_lo=0 ac_mid=0
3108 while :; do
3109 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3110/* end confdefs.h. */
3111$4
3112int
3113main ()
3114{
3115static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3116test_array [0] = 0;
3117return test_array [0];
c971b7fa
PA
3118
3119 ;
3120 return 0;
3121}
3122_ACEOF
3123if ac_fn_c_try_compile "$LINENO"; then :
3124 ac_hi=$ac_mid; break
3125else
3126 as_fn_arith $ac_mid + 1 && ac_lo=$as_val
3127 if test $ac_lo -le $ac_mid; then
3128 ac_lo= ac_hi=
3129 break
3130 fi
3131 as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
3132fi
3133rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3134 done
3135else
3136 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3137/* end confdefs.h. */
3138$4
3139int
3140main ()
3141{
3142static int test_array [1 - 2 * !(($2) < 0)];
d0ac1c44
SM
3143test_array [0] = 0;
3144return test_array [0];
c971b7fa
PA
3145
3146 ;
3147 return 0;
3148}
3149_ACEOF
3150if ac_fn_c_try_compile "$LINENO"; then :
3151 ac_hi=-1 ac_mid=-1
3152 while :; do
3153 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3154/* end confdefs.h. */
3155$4
3156int
3157main ()
3158{
3159static int test_array [1 - 2 * !(($2) >= $ac_mid)];
d0ac1c44
SM
3160test_array [0] = 0;
3161return test_array [0];
c971b7fa
PA
3162
3163 ;
3164 return 0;
3165}
3166_ACEOF
3167if ac_fn_c_try_compile "$LINENO"; then :
3168 ac_lo=$ac_mid; break
3169else
3170 as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
3171 if test $ac_mid -le $ac_hi; then
3172 ac_lo= ac_hi=
3173 break
3174 fi
3175 as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
3176fi
3177rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3178 done
3179else
3180 ac_lo= ac_hi=
3181fi
3182rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3183fi
3184rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3185# Binary search between lo and hi bounds.
3186while test "x$ac_lo" != "x$ac_hi"; do
3187 as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
3188 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3189/* end confdefs.h. */
3190$4
3191int
3192main ()
3193{
3194static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3195test_array [0] = 0;
3196return test_array [0];
c971b7fa
PA
3197
3198 ;
3199 return 0;
3200}
3201_ACEOF
3202if ac_fn_c_try_compile "$LINENO"; then :
3203 ac_hi=$ac_mid
3204else
3205 as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
3206fi
3207rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3208done
3209case $ac_lo in #((
3210?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
3211'') ac_retval=1 ;;
3212esac
3213 else
3214 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3215/* end confdefs.h. */
3216$4
3217static long int longval () { return $2; }
3218static unsigned long int ulongval () { return $2; }
3219#include <stdio.h>
3220#include <stdlib.h>
3221int
3222main ()
3223{
3224
3225 FILE *f = fopen ("conftest.val", "w");
3226 if (! f)
3227 return 1;
3228 if (($2) < 0)
3229 {
3230 long int i = longval ();
3231 if (i != ($2))
3232 return 1;
3233 fprintf (f, "%ld", i);
3234 }
3235 else
3236 {
3237 unsigned long int i = ulongval ();
3238 if (i != ($2))
3239 return 1;
3240 fprintf (f, "%lu", i);
3241 }
3242 /* Do not output a trailing newline, as this causes \r\n confusion
3243 on some platforms. */
3244 return ferror (f) || fclose (f) != 0;
3245
3246 ;
3247 return 0;
3248}
3249_ACEOF
3250if ac_fn_c_try_run "$LINENO"; then :
3251 echo >>conftest.val; read $3 <conftest.val; ac_retval=0
3252else
3253 ac_retval=1
3254fi
3255rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3256 conftest.$ac_objext conftest.beam conftest.$ac_ext
3257rm -f conftest.val
3258
3259 fi
d0ac1c44
SM
3260 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3261 as_fn_set_status $ac_retval
c971b7fa
PA
3262
3263} # ac_fn_c_compute_int
725e2999
JB
3264
3265# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
3266# ----------------------------------------------------
3267# Tries to find if the field MEMBER exists in type AGGR, after including
3268# INCLUDES, setting cache variable VAR accordingly.
3269ac_fn_c_check_member ()
3270{
3271 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3272 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
3273$as_echo_n "checking for $2.$3... " >&6; }
3274if eval \${$4+:} false; then :
3275 $as_echo_n "(cached) " >&6
3276else
3277 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3278/* end confdefs.h. */
3279$5
3280int
3281main ()
3282{
3283static $2 ac_aggr;
3284if (ac_aggr.$3)
3285return 0;
3286 ;
3287 return 0;
3288}
3289_ACEOF
3290if ac_fn_c_try_compile "$LINENO"; then :
3291 eval "$4=yes"
3292else
3293 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3294/* end confdefs.h. */
3295$5
3296int
3297main ()
3298{
3299static $2 ac_aggr;
3300if (sizeof ac_aggr.$3)
3301return 0;
3302 ;
3303 return 0;
3304}
3305_ACEOF
3306if ac_fn_c_try_compile "$LINENO"; then :
3307 eval "$4=yes"
3308else
3309 eval "$4=no"
3310fi
3311rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3312fi
3313rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3314fi
3315eval ac_res=\$$4
3316 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3317$as_echo "$ac_res" >&6; }
3318 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3319
3320} # ac_fn_c_check_member
c971b7fa
PA
3321cat >config.log <<_ACEOF
3322This file contains any messages produced by compilers while
3323running configure, to aid debugging if configure makes a mistake.
3324
d0ac1c44
SM
3325It was created by libgnu $as_me UNUSED-VERSION, which was
3326generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
3327
3328 $ $0 $@
3329
3330_ACEOF
3331exec 5>>config.log
3332{
3333cat <<_ASUNAME
3334## --------- ##
3335## Platform. ##
3336## --------- ##
3337
3338hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
3339uname -m = `(uname -m) 2>/dev/null || echo unknown`
3340uname -r = `(uname -r) 2>/dev/null || echo unknown`
3341uname -s = `(uname -s) 2>/dev/null || echo unknown`
3342uname -v = `(uname -v) 2>/dev/null || echo unknown`
3343
3344/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
3345/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
3346
3347/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
3348/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
3349/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
3350/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
3351/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
3352/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
3353/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
3354
3355_ASUNAME
3356
3357as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3358for as_dir in $PATH
3359do
3360 IFS=$as_save_IFS
3361 test -z "$as_dir" && as_dir=.
3362 $as_echo "PATH: $as_dir"
3363 done
3364IFS=$as_save_IFS
3365
3366} >&5
3367
3368cat >&5 <<_ACEOF
3369
3370
3371## ----------- ##
3372## Core tests. ##
3373## ----------- ##
3374
3375_ACEOF
3376
3377
3378# Keep a trace of the command line.
3379# Strip out --no-create and --no-recursion so they do not pile up.
3380# Strip out --silent because we don't want to record it for future runs.
3381# Also quote any args containing shell meta-characters.
3382# Make two passes to allow for proper duplicate-argument suppression.
3383ac_configure_args=
3384ac_configure_args0=
3385ac_configure_args1=
3386ac_must_keep_next=false
3387for ac_pass in 1 2
3388do
3389 for ac_arg
3390 do
3391 case $ac_arg in
3392 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
3393 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
3394 | -silent | --silent | --silen | --sile | --sil)
3395 continue ;;
3396 *\'*)
3397 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
3398 esac
3399 case $ac_pass in
3400 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
3401 2)
3402 as_fn_append ac_configure_args1 " '$ac_arg'"
3403 if test $ac_must_keep_next = true; then
3404 ac_must_keep_next=false # Got value, back to normal.
3405 else
3406 case $ac_arg in
3407 *=* | --config-cache | -C | -disable-* | --disable-* \
3408 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
3409 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
3410 | -with-* | --with-* | -without-* | --without-* | --x)
3411 case "$ac_configure_args0 " in
3412 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
3413 esac
3414 ;;
3415 -* ) ac_must_keep_next=true ;;
3416 esac
3417 fi
3418 as_fn_append ac_configure_args " '$ac_arg'"
3419 ;;
3420 esac
3421 done
3422done
3423{ ac_configure_args0=; unset ac_configure_args0;}
3424{ ac_configure_args1=; unset ac_configure_args1;}
3425
3426# When interrupted or exit'd, cleanup temporary files, and complete
3427# config.log. We remove comments because anyway the quotes in there
3428# would cause problems or look ugly.
3429# WARNING: Use '\'' to represent an apostrophe within the trap.
3430# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
3431trap 'exit_status=$?
3432 # Save into config.log some information that might help in debugging.
3433 {
3434 echo
3435
d0ac1c44 3436 $as_echo "## ---------------- ##
c971b7fa 3437## Cache variables. ##
d0ac1c44 3438## ---------------- ##"
c971b7fa
PA
3439 echo
3440 # The following way of writing the cache mishandles newlines in values,
3441(
3442 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
3443 eval ac_val=\$$ac_var
3444 case $ac_val in #(
3445 *${as_nl}*)
3446 case $ac_var in #(
3447 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
3448$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
3449 esac
3450 case $ac_var in #(
3451 _ | IFS | as_nl) ;; #(
3452 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
3453 *) { eval $ac_var=; unset $ac_var;} ;;
3454 esac ;;
3455 esac
3456 done
3457 (set) 2>&1 |
3458 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
3459 *${as_nl}ac_space=\ *)
3460 sed -n \
3461 "s/'\''/'\''\\\\'\'''\''/g;
3462 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
3463 ;; #(
3464 *)
3465 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
3466 ;;
3467 esac |
3468 sort
3469)
3470 echo
3471
d0ac1c44 3472 $as_echo "## ----------------- ##
c971b7fa 3473## Output variables. ##
d0ac1c44 3474## ----------------- ##"
c971b7fa
PA
3475 echo
3476 for ac_var in $ac_subst_vars
3477 do
3478 eval ac_val=\$$ac_var
3479 case $ac_val in
3480 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3481 esac
3482 $as_echo "$ac_var='\''$ac_val'\''"
3483 done | sort
3484 echo
3485
3486 if test -n "$ac_subst_files"; then
d0ac1c44 3487 $as_echo "## ------------------- ##
c971b7fa 3488## File substitutions. ##
d0ac1c44 3489## ------------------- ##"
c971b7fa
PA
3490 echo
3491 for ac_var in $ac_subst_files
3492 do
3493 eval ac_val=\$$ac_var
3494 case $ac_val in
3495 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3496 esac
3497 $as_echo "$ac_var='\''$ac_val'\''"
3498 done | sort
3499 echo
3500 fi
3501
3502 if test -s confdefs.h; then
d0ac1c44 3503 $as_echo "## ----------- ##
c971b7fa 3504## confdefs.h. ##
d0ac1c44 3505## ----------- ##"
c971b7fa
PA
3506 echo
3507 cat confdefs.h
3508 echo
3509 fi
3510 test "$ac_signal" != 0 &&
3511 $as_echo "$as_me: caught signal $ac_signal"
3512 $as_echo "$as_me: exit $exit_status"
3513 } >&5
3514 rm -f core *.core core.conftest.* &&
3515 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
3516 exit $exit_status
3517' 0
3518for ac_signal in 1 2 13 15; do
3519 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
3520done
3521ac_signal=0
3522
3523# confdefs.h avoids OS command line length limits that DEFS can exceed.
3524rm -f -r conftest* confdefs.h
3525
3526$as_echo "/* confdefs.h */" > confdefs.h
3527
3528# Predefined preprocessor variables.
3529
3530cat >>confdefs.h <<_ACEOF
3531#define PACKAGE_NAME "$PACKAGE_NAME"
3532_ACEOF
3533
3534cat >>confdefs.h <<_ACEOF
3535#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
3536_ACEOF
3537
3538cat >>confdefs.h <<_ACEOF
3539#define PACKAGE_VERSION "$PACKAGE_VERSION"
3540_ACEOF
3541
3542cat >>confdefs.h <<_ACEOF
3543#define PACKAGE_STRING "$PACKAGE_STRING"
3544_ACEOF
3545
3546cat >>confdefs.h <<_ACEOF
3547#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
3548_ACEOF
3549
3550cat >>confdefs.h <<_ACEOF
3551#define PACKAGE_URL "$PACKAGE_URL"
3552_ACEOF
3553
3554
3555# Let the site file select an alternate cache file if it wants to.
3556# Prefer an explicitly selected file to automatically selected ones.
3557ac_site_file1=NONE
3558ac_site_file2=NONE
3559if test -n "$CONFIG_SITE"; then
d0ac1c44
SM
3560 # We do not want a PATH search for config.site.
3561 case $CONFIG_SITE in #((
3562 -*) ac_site_file1=./$CONFIG_SITE;;
3563 */*) ac_site_file1=$CONFIG_SITE;;
3564 *) ac_site_file1=./$CONFIG_SITE;;
3565 esac
c971b7fa
PA
3566elif test "x$prefix" != xNONE; then
3567 ac_site_file1=$prefix/share/config.site
3568 ac_site_file2=$prefix/etc/config.site
3569else
3570 ac_site_file1=$ac_default_prefix/share/config.site
3571 ac_site_file2=$ac_default_prefix/etc/config.site
3572fi
3573for ac_site_file in "$ac_site_file1" "$ac_site_file2"
3574do
3575 test "x$ac_site_file" = xNONE && continue
d0ac1c44 3576 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
c971b7fa
PA
3577 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
3578$as_echo "$as_me: loading site script $ac_site_file" >&6;}
3579 sed 's/^/| /' "$ac_site_file" >&5
d0ac1c44
SM
3580 . "$ac_site_file" \
3581 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3582$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3583as_fn_error $? "failed to load site script $ac_site_file
3584See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
3585 fi
3586done
3587
3588if test -r "$cache_file"; then
d0ac1c44
SM
3589 # Some versions of bash will fail to source /dev/null (special files
3590 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
3591 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
c971b7fa
PA
3592 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
3593$as_echo "$as_me: loading cache $cache_file" >&6;}
3594 case $cache_file in
3595 [\\/]* | ?:[\\/]* ) . "$cache_file";;
3596 *) . "./$cache_file";;
3597 esac
3598 fi
3599else
3600 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
3601$as_echo "$as_me: creating cache $cache_file" >&6;}
3602 >$cache_file
3603fi
3604
c0c3707f
CB
3605as_fn_append ac_header_list " arpa/inet.h"
3606as_fn_append ac_header_list " features.h"
3607as_fn_append ac_header_list " sys/socket.h"
3608as_fn_append ac_func_list " canonicalize_file_name"
3609as_fn_append ac_func_list " getcwd"
3610as_fn_append ac_func_list " readlink"
3611as_fn_append ac_func_list " realpath"
3612as_fn_append ac_header_list " sys/param.h"
3613as_fn_append ac_header_list " unistd.h"
3614as_fn_append ac_func_list " _set_invalid_parameter_handler"
3615as_fn_append ac_func_list " fchdir"
3616as_fn_append ac_header_list " dirent.h"
3617as_fn_append ac_func_list " fcntl"
3618as_fn_append ac_func_list " symlink"
3619as_fn_append ac_func_list " fdopendir"
3620as_fn_append ac_func_list " mempcpy"
3621as_fn_append ac_header_list " fnmatch.h"
3622as_fn_append ac_func_list " fnmatch"
3623as_fn_append ac_func_list " btowc"
3624as_fn_append ac_func_list " isblank"
3625as_fn_append ac_func_list " iswctype"
3626as_fn_append ac_func_list " mbsrtowcs"
3627as_fn_append ac_func_list " wmemchr"
3628as_fn_append ac_func_list " wmemcpy"
3629as_fn_append ac_func_list " wmempcpy"
3630as_fn_append ac_header_list " wctype.h"
8690e634 3631gl_fnmatch_required=GNU
c0c3707f
CB
3632as_fn_append ac_header_list " sys/stat.h"
3633as_fn_append ac_func_list " fstatat"
3634as_fn_append ac_func_list " getdtablesize"
3635as_fn_append ac_func_list " getlogin_r"
3636as_fn_append ac_func_list " getprogname"
3637as_fn_append ac_func_list " getexecname"
3638as_fn_append ac_header_list " sys/time.h"
3639as_fn_append ac_func_list " gettimeofday"
3640as_fn_append ac_header_list " glob.h"
3641as_fn_append ac_func_list " glob"
3642as_fn_append ac_func_list " glob_pattern_p"
3643as_fn_append ac_func_list " getpwnam_r"
5df4cba6 3644as_fn_append ac_header_list " threads.h"
c0c3707f
CB
3645as_fn_append ac_header_list " netdb.h"
3646as_fn_append ac_header_list " netinet/in.h"
3647as_fn_append ac_header_list " limits.h"
3648as_fn_append ac_header_list " wchar.h"
3649as_fn_append ac_header_list " stdint.h"
3650as_fn_append ac_header_list " inttypes.h"
5df4cba6 3651as_fn_append ac_header_list " xlocale.h"
c0c3707f
CB
3652as_fn_append ac_func_list " lstat"
3653as_fn_append ac_header_list " math.h"
3654as_fn_append ac_func_list " mbsinit"
3655as_fn_append ac_func_list " mbrtowc"
3656as_fn_append ac_header_list " sys/mman.h"
3657as_fn_append ac_func_list " mprotect"
3658as_fn_append ac_func_list " mkostemp"
3659as_fn_append ac_func_list " openat"
3660as_fn_append ac_func_list " link"
3661as_fn_append ac_func_list " setenv"
3662as_fn_append ac_func_list " strdup"
3663as_fn_append ac_func_list " strerror_r"
3664as_fn_append ac_func_list " __xpg_strerror_r"
3665as_fn_append ac_func_list " catgets"
3666as_fn_append ac_func_list " snprintf"
3667as_fn_append ac_header_list " sys/uio.h"
3668as_fn_append ac_func_list " localtime_r"
3669as_fn_append ac_func_list " pipe"
3670as_fn_append ac_header_list " crtdefs.h"
3671as_fn_append ac_func_list " iswcntrl"
c971b7fa
PA
3672# Check that the precious variables saved in the cache have kept the same
3673# value.
3674ac_cache_corrupted=false
3675for ac_var in $ac_precious_vars; do
3676 eval ac_old_set=\$ac_cv_env_${ac_var}_set
3677 eval ac_new_set=\$ac_env_${ac_var}_set
3678 eval ac_old_val=\$ac_cv_env_${ac_var}_value
3679 eval ac_new_val=\$ac_env_${ac_var}_value
3680 case $ac_old_set,$ac_new_set in
3681 set,)
3682 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
3683$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
3684 ac_cache_corrupted=: ;;
3685 ,set)
3686 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
3687$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
3688 ac_cache_corrupted=: ;;
3689 ,);;
3690 *)
3691 if test "x$ac_old_val" != "x$ac_new_val"; then
3692 # differences in whitespace do not lead to failure.
3693 ac_old_val_w=`echo x $ac_old_val`
3694 ac_new_val_w=`echo x $ac_new_val`
3695 if test "$ac_old_val_w" != "$ac_new_val_w"; then
3696 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
3697$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
3698 ac_cache_corrupted=:
3699 else
3700 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
3701$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
3702 eval $ac_var=\$ac_old_val
3703 fi
3704 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
3705$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
3706 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
3707$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
3708 fi;;
3709 esac
3710 # Pass precious variables to config.status.
3711 if test "$ac_new_set" = set; then
3712 case $ac_new_val in
3713 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
3714 *) ac_arg=$ac_var=$ac_new_val ;;
3715 esac
3716 case " $ac_configure_args " in
3717 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
3718 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
3719 esac
3720 fi
3721done
3722if $ac_cache_corrupted; then
3723 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3724$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3725 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
3726$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
d0ac1c44 3727 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
c971b7fa
PA
3728fi
3729## -------------------- ##
3730## Main body of script. ##
3731## -------------------- ##
3732
3733ac_ext=c
3734ac_cpp='$CPP $CPPFLAGS'
3735ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3736ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3737ac_compiler_gnu=$ac_cv_c_compiler_gnu
3738
3739
d0ac1c44 3740
73cc7272
TT
3741
3742
3743
c971b7fa
PA
3744ac_config_headers="$ac_config_headers config.h:config.in"
3745
3746
5abebf3c
CB
3747
3748
c971b7fa
PA
3749{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
3750$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
3751 # Check whether --enable-maintainer-mode was given.
3752if test "${enable_maintainer_mode+set}" = set; then :
3753 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
3754else
3755 USE_MAINTAINER_MODE=no
3756fi
3757
3758 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
3759$as_echo "$USE_MAINTAINER_MODE" >&6; }
3760 if test $USE_MAINTAINER_MODE = yes; then
3761 MAINTAINER_MODE_TRUE=
3762 MAINTAINER_MODE_FALSE='#'
3763else
3764 MAINTAINER_MODE_TRUE='#'
3765 MAINTAINER_MODE_FALSE=
3766fi
3767
3768 MAINT=$MAINTAINER_MODE_TRUE
3769
3770
3771
3772ac_ext=c
3773ac_cpp='$CPP $CPPFLAGS'
3774ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3775ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3776ac_compiler_gnu=$ac_cv_c_compiler_gnu
3777if test -n "$ac_tool_prefix"; then
3778 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3779set dummy ${ac_tool_prefix}gcc; ac_word=$2
3780{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3781$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3782if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3783 $as_echo_n "(cached) " >&6
3784else
3785 if test -n "$CC"; then
3786 ac_cv_prog_CC="$CC" # Let the user override the test.
3787else
3788as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3789for as_dir in $PATH
3790do
3791 IFS=$as_save_IFS
3792 test -z "$as_dir" && as_dir=.
3793 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3794 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3795 ac_cv_prog_CC="${ac_tool_prefix}gcc"
3796 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3797 break 2
3798 fi
3799done
3800 done
3801IFS=$as_save_IFS
3802
3803fi
3804fi
3805CC=$ac_cv_prog_CC
3806if test -n "$CC"; then
3807 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3808$as_echo "$CC" >&6; }
3809else
3810 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3811$as_echo "no" >&6; }
3812fi
3813
3814
3815fi
3816if test -z "$ac_cv_prog_CC"; then
3817 ac_ct_CC=$CC
3818 # Extract the first word of "gcc", so it can be a program name with args.
3819set dummy gcc; ac_word=$2
3820{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3821$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3822if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
3823 $as_echo_n "(cached) " >&6
3824else
3825 if test -n "$ac_ct_CC"; then
3826 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3827else
3828as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3829for as_dir in $PATH
3830do
3831 IFS=$as_save_IFS
3832 test -z "$as_dir" && as_dir=.
3833 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3834 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3835 ac_cv_prog_ac_ct_CC="gcc"
3836 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3837 break 2
3838 fi
3839done
3840 done
3841IFS=$as_save_IFS
3842
3843fi
3844fi
3845ac_ct_CC=$ac_cv_prog_ac_ct_CC
3846if test -n "$ac_ct_CC"; then
3847 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3848$as_echo "$ac_ct_CC" >&6; }
3849else
3850 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3851$as_echo "no" >&6; }
3852fi
3853
3854 if test "x$ac_ct_CC" = x; then
3855 CC=""
3856 else
3857 case $cross_compiling:$ac_tool_warned in
3858yes:)
3859{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3860$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3861ac_tool_warned=yes ;;
3862esac
3863 CC=$ac_ct_CC
3864 fi
3865else
3866 CC="$ac_cv_prog_CC"
3867fi
3868
3869if test -z "$CC"; then
3870 if test -n "$ac_tool_prefix"; then
3871 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3872set dummy ${ac_tool_prefix}cc; ac_word=$2
3873{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3874$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3875if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3876 $as_echo_n "(cached) " >&6
3877else
3878 if test -n "$CC"; then
3879 ac_cv_prog_CC="$CC" # Let the user override the test.
3880else
3881as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3882for as_dir in $PATH
3883do
3884 IFS=$as_save_IFS
3885 test -z "$as_dir" && as_dir=.
3886 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3887 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3888 ac_cv_prog_CC="${ac_tool_prefix}cc"
3889 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3890 break 2
3891 fi
3892done
3893 done
3894IFS=$as_save_IFS
3895
3896fi
3897fi
3898CC=$ac_cv_prog_CC
3899if test -n "$CC"; then
3900 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3901$as_echo "$CC" >&6; }
3902else
3903 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3904$as_echo "no" >&6; }
3905fi
3906
3907
3908 fi
3909fi
3910if test -z "$CC"; then
3911 # Extract the first word of "cc", so it can be a program name with args.
3912set dummy cc; ac_word=$2
3913{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3914$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3915if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3916 $as_echo_n "(cached) " >&6
3917else
3918 if test -n "$CC"; then
3919 ac_cv_prog_CC="$CC" # Let the user override the test.
3920else
3921 ac_prog_rejected=no
3922as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3923for as_dir in $PATH
3924do
3925 IFS=$as_save_IFS
3926 test -z "$as_dir" && as_dir=.
3927 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3928 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3929 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3930 ac_prog_rejected=yes
3931 continue
3932 fi
3933 ac_cv_prog_CC="cc"
3934 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3935 break 2
3936 fi
3937done
3938 done
3939IFS=$as_save_IFS
3940
3941if test $ac_prog_rejected = yes; then
3942 # We found a bogon in the path, so make sure we never use it.
3943 set dummy $ac_cv_prog_CC
3944 shift
3945 if test $# != 0; then
3946 # We chose a different compiler from the bogus one.
3947 # However, it has the same basename, so the bogon will be chosen
3948 # first if we set CC to just the basename; use the full file name.
3949 shift
3950 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
3951 fi
3952fi
3953fi
3954fi
3955CC=$ac_cv_prog_CC
3956if test -n "$CC"; then
3957 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3958$as_echo "$CC" >&6; }
3959else
3960 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3961$as_echo "no" >&6; }
3962fi
3963
3964
3965fi
3966if test -z "$CC"; then
3967 if test -n "$ac_tool_prefix"; then
3968 for ac_prog in cl.exe
3969 do
3970 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3971set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3972{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3973$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3974if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3975 $as_echo_n "(cached) " >&6
3976else
3977 if test -n "$CC"; then
3978 ac_cv_prog_CC="$CC" # Let the user override the test.
3979else
3980as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3981for as_dir in $PATH
3982do
3983 IFS=$as_save_IFS
3984 test -z "$as_dir" && as_dir=.
3985 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3986 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3987 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3988 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3989 break 2
3990 fi
3991done
3992 done
3993IFS=$as_save_IFS
3994
3995fi
3996fi
3997CC=$ac_cv_prog_CC
3998if test -n "$CC"; then
3999 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4000$as_echo "$CC" >&6; }
4001else
4002 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4003$as_echo "no" >&6; }
4004fi
4005
4006
4007 test -n "$CC" && break
4008 done
4009fi
4010if test -z "$CC"; then
4011 ac_ct_CC=$CC
4012 for ac_prog in cl.exe
4013do
4014 # Extract the first word of "$ac_prog", so it can be a program name with args.
4015set dummy $ac_prog; ac_word=$2
4016{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4017$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4018if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
4019 $as_echo_n "(cached) " >&6
4020else
4021 if test -n "$ac_ct_CC"; then
4022 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4023else
4024as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4025for as_dir in $PATH
4026do
4027 IFS=$as_save_IFS
4028 test -z "$as_dir" && as_dir=.
4029 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4030 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4031 ac_cv_prog_ac_ct_CC="$ac_prog"
4032 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4033 break 2
4034 fi
4035done
4036 done
4037IFS=$as_save_IFS
4038
4039fi
4040fi
4041ac_ct_CC=$ac_cv_prog_ac_ct_CC
4042if test -n "$ac_ct_CC"; then
4043 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4044$as_echo "$ac_ct_CC" >&6; }
4045else
4046 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4047$as_echo "no" >&6; }
4048fi
4049
4050
4051 test -n "$ac_ct_CC" && break
4052done
4053
4054 if test "x$ac_ct_CC" = x; then
4055 CC=""
4056 else
4057 case $cross_compiling:$ac_tool_warned in
4058yes:)
4059{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4060$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4061ac_tool_warned=yes ;;
4062esac
4063 CC=$ac_ct_CC
4064 fi
4065fi
4066
c0c3707f
CB
4067fi
4068if test -z "$CC"; then
4069 if test -n "$ac_tool_prefix"; then
4070 # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
4071set dummy ${ac_tool_prefix}clang; ac_word=$2
4072{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4073$as_echo_n "checking for $ac_word... " >&6; }
4074if ${ac_cv_prog_CC+:} false; then :
4075 $as_echo_n "(cached) " >&6
4076else
4077 if test -n "$CC"; then
4078 ac_cv_prog_CC="$CC" # Let the user override the test.
4079else
4080as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4081for as_dir in $PATH
4082do
4083 IFS=$as_save_IFS
4084 test -z "$as_dir" && as_dir=.
4085 for ac_exec_ext in '' $ac_executable_extensions; do
4086 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4087 ac_cv_prog_CC="${ac_tool_prefix}clang"
4088 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4089 break 2
4090 fi
4091done
4092 done
4093IFS=$as_save_IFS
4094
4095fi
4096fi
4097CC=$ac_cv_prog_CC
4098if test -n "$CC"; then
4099 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4100$as_echo "$CC" >&6; }
4101else
4102 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4103$as_echo "no" >&6; }
4104fi
4105
4106
4107fi
4108if test -z "$ac_cv_prog_CC"; then
4109 ac_ct_CC=$CC
4110 # Extract the first word of "clang", so it can be a program name with args.
4111set dummy clang; ac_word=$2
4112{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4113$as_echo_n "checking for $ac_word... " >&6; }
4114if ${ac_cv_prog_ac_ct_CC+:} false; then :
4115 $as_echo_n "(cached) " >&6
4116else
4117 if test -n "$ac_ct_CC"; then
4118 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4119else
4120as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4121for as_dir in $PATH
4122do
4123 IFS=$as_save_IFS
4124 test -z "$as_dir" && as_dir=.
4125 for ac_exec_ext in '' $ac_executable_extensions; do
4126 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4127 ac_cv_prog_ac_ct_CC="clang"
4128 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4129 break 2
4130 fi
4131done
4132 done
4133IFS=$as_save_IFS
4134
4135fi
4136fi
4137ac_ct_CC=$ac_cv_prog_ac_ct_CC
4138if test -n "$ac_ct_CC"; then
4139 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4140$as_echo "$ac_ct_CC" >&6; }
4141else
4142 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4143$as_echo "no" >&6; }
4144fi
4145
4146 if test "x$ac_ct_CC" = x; then
4147 CC=""
4148 else
4149 case $cross_compiling:$ac_tool_warned in
4150yes:)
4151{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4152$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4153ac_tool_warned=yes ;;
4154esac
4155 CC=$ac_ct_CC
4156 fi
4157else
4158 CC="$ac_cv_prog_CC"
4159fi
4160
c971b7fa
PA
4161fi
4162
4163
4164test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4165$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4166as_fn_error $? "no acceptable C compiler found in \$PATH
4167See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4168
4169# Provide some information about the compiler.
4170$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4171set X $ac_compile
4172ac_compiler=$2
c0c3707f 4173for ac_option in --version -v -V -qversion -version; do
c971b7fa
PA
4174 { { ac_try="$ac_compiler $ac_option >&5"
4175case "(($ac_try" in
4176 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4177 *) ac_try_echo=$ac_try;;
4178esac
4179eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4180$as_echo "$ac_try_echo"; } >&5
4181 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4182 ac_status=$?
4183 if test -s conftest.err; then
4184 sed '10a\
4185... rest of stderr output deleted ...
4186 10q' conftest.err >conftest.er1
4187 cat conftest.er1 >&5
c971b7fa 4188 fi
d0ac1c44 4189 rm -f conftest.er1 conftest.err
c971b7fa
PA
4190 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4191 test $ac_status = 0; }
4192done
4193
4194cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4195/* end confdefs.h. */
d0ac1c44 4196
c971b7fa
PA
4197int
4198main ()
4199{
c971b7fa
PA
4200
4201 ;
4202 return 0;
4203}
4204_ACEOF
4205ac_clean_files_save=$ac_clean_files
d0ac1c44 4206ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
c971b7fa
PA
4207# Try to create an executable without -o first, disregard a.out.
4208# It will help us diagnose broken compilers, and finding out an intuition
4209# of exeext.
d0ac1c44
SM
4210{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
4211$as_echo_n "checking whether the C compiler works... " >&6; }
c971b7fa
PA
4212ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
4213
4214# The possible output files:
4215ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
4216
4217ac_rmfiles=
4218for ac_file in $ac_files
4219do
4220 case $ac_file in
4221 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4222 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
4223 esac
4224done
4225rm -f $ac_rmfiles
4226
4227if { { ac_try="$ac_link_default"
4228case "(($ac_try" in
4229 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4230 *) ac_try_echo=$ac_try;;
4231esac
4232eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4233$as_echo "$ac_try_echo"; } >&5
4234 (eval "$ac_link_default") 2>&5
4235 ac_status=$?
4236 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4237 test $ac_status = 0; }; then :
4238 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
4239# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
4240# in a Makefile. We should not override ac_cv_exeext if it was cached,
4241# so that the user can short-circuit this test for compilers unknown to
4242# Autoconf.
4243for ac_file in $ac_files ''
4244do
4245 test -f "$ac_file" || continue
4246 case $ac_file in
4247 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
4248 ;;
4249 [ab].out )
4250 # We found the default executable, but exeext='' is most
4251 # certainly right.
4252 break;;
4253 *.* )
4254 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
4255 then :; else
4256 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4257 fi
4258 # We set ac_cv_exeext here because the later test for it is not
4259 # safe: cross compilers may not add the suffix if given an `-o'
4260 # argument, so we may need to know it at that point already.
4261 # Even if this section looks crufty: it has the advantage of
4262 # actually working.
4263 break;;
4264 * )
4265 break;;
4266 esac
4267done
4268test "$ac_cv_exeext" = no && ac_cv_exeext=
4269
4270else
4271 ac_file=''
4272fi
c971b7fa 4273if test -z "$ac_file"; then :
d0ac1c44
SM
4274 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4275$as_echo "no" >&6; }
4276$as_echo "$as_me: failed program was:" >&5
c971b7fa
PA
4277sed 's/^/| /' conftest.$ac_ext >&5
4278
4279{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4280$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4281as_fn_error 77 "C compiler cannot create executables
4282See \`config.log' for more details" "$LINENO" 5; }
4283else
4284 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4285$as_echo "yes" >&6; }
c971b7fa 4286fi
d0ac1c44
SM
4287{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
4288$as_echo_n "checking for C compiler default output file name... " >&6; }
4289{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
4290$as_echo "$ac_file" >&6; }
c971b7fa
PA
4291ac_exeext=$ac_cv_exeext
4292
d0ac1c44 4293rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
c971b7fa 4294ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4295{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
4296$as_echo_n "checking for suffix of executables... " >&6; }
4297if { { ac_try="$ac_link"
4298case "(($ac_try" in
4299 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4300 *) ac_try_echo=$ac_try;;
4301esac
4302eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4303$as_echo "$ac_try_echo"; } >&5
4304 (eval "$ac_link") 2>&5
4305 ac_status=$?
4306 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4307 test $ac_status = 0; }; then :
4308 # If both `conftest.exe' and `conftest' are `present' (well, observable)
4309# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
4310# work properly (i.e., refer to `conftest.exe'), while it won't with
4311# `rm'.
4312for ac_file in conftest.exe conftest conftest.*; do
4313 test -f "$ac_file" || continue
4314 case $ac_file in
4315 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4316 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4317 break;;
4318 * ) break;;
4319 esac
4320done
4321else
4322 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4323$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4324as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4325See \`config.log' for more details" "$LINENO" 5; }
c971b7fa 4326fi
d0ac1c44 4327rm -f conftest conftest$ac_cv_exeext
c971b7fa
PA
4328{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4329$as_echo "$ac_cv_exeext" >&6; }
4330
4331rm -f conftest.$ac_ext
4332EXEEXT=$ac_cv_exeext
4333ac_exeext=$EXEEXT
d0ac1c44
SM
4334cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4335/* end confdefs.h. */
4336#include <stdio.h>
4337int
4338main ()
4339{
4340FILE *f = fopen ("conftest.out", "w");
4341 return ferror (f) || fclose (f) != 0;
4342
4343 ;
4344 return 0;
4345}
4346_ACEOF
4347ac_clean_files="$ac_clean_files conftest.out"
4348# Check that the compiler produces executables we can run. If not, either
4349# the compiler is broken, or we cross compile.
4350{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4351$as_echo_n "checking whether we are cross compiling... " >&6; }
4352if test "$cross_compiling" != yes; then
4353 { { ac_try="$ac_link"
4354case "(($ac_try" in
4355 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4356 *) ac_try_echo=$ac_try;;
4357esac
4358eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4359$as_echo "$ac_try_echo"; } >&5
4360 (eval "$ac_link") 2>&5
4361 ac_status=$?
4362 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4363 test $ac_status = 0; }
4364 if { ac_try='./conftest$ac_cv_exeext'
4365 { { case "(($ac_try" in
4366 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4367 *) ac_try_echo=$ac_try;;
4368esac
4369eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4370$as_echo "$ac_try_echo"; } >&5
4371 (eval "$ac_try") 2>&5
4372 ac_status=$?
4373 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4374 test $ac_status = 0; }; }; then
4375 cross_compiling=no
4376 else
4377 if test "$cross_compiling" = maybe; then
4378 cross_compiling=yes
4379 else
4380 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4381$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4382as_fn_error $? "cannot run C compiled programs.
4383If you meant to cross compile, use \`--host'.
4384See \`config.log' for more details" "$LINENO" 5; }
4385 fi
4386 fi
4387fi
4388{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4389$as_echo "$cross_compiling" >&6; }
4390
4391rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4392ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4393{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4394$as_echo_n "checking for suffix of object files... " >&6; }
d0ac1c44 4395if ${ac_cv_objext+:} false; then :
c971b7fa
PA
4396 $as_echo_n "(cached) " >&6
4397else
4398 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4399/* end confdefs.h. */
4400
4401int
4402main ()
4403{
4404
4405 ;
4406 return 0;
4407}
4408_ACEOF
4409rm -f conftest.o conftest.obj
4410if { { ac_try="$ac_compile"
4411case "(($ac_try" in
4412 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4413 *) ac_try_echo=$ac_try;;
4414esac
4415eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4416$as_echo "$ac_try_echo"; } >&5
4417 (eval "$ac_compile") 2>&5
4418 ac_status=$?
4419 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4420 test $ac_status = 0; }; then :
4421 for ac_file in conftest.o conftest.obj conftest.*; do
4422 test -f "$ac_file" || continue;
4423 case $ac_file in
4424 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4425 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4426 break;;
4427 esac
4428done
4429else
4430 $as_echo "$as_me: failed program was:" >&5
4431sed 's/^/| /' conftest.$ac_ext >&5
4432
4433{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4434$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4435as_fn_error $? "cannot compute suffix of object files: cannot compile
4436See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4437fi
4438rm -f conftest.$ac_cv_objext conftest.$ac_ext
4439fi
4440{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4441$as_echo "$ac_cv_objext" >&6; }
4442OBJEXT=$ac_cv_objext
4443ac_objext=$OBJEXT
4444{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4445$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
d0ac1c44 4446if ${ac_cv_c_compiler_gnu+:} false; then :
c971b7fa
PA
4447 $as_echo_n "(cached) " >&6
4448else
4449 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4450/* end confdefs.h. */
4451
4452int
4453main ()
4454{
4455#ifndef __GNUC__
4456 choke me
4457#endif
4458
4459 ;
4460 return 0;
4461}
4462_ACEOF
4463if ac_fn_c_try_compile "$LINENO"; then :
4464 ac_compiler_gnu=yes
4465else
4466 ac_compiler_gnu=no
4467fi
4468rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4469ac_cv_c_compiler_gnu=$ac_compiler_gnu
4470
4471fi
4472{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4473$as_echo "$ac_cv_c_compiler_gnu" >&6; }
4474if test $ac_compiler_gnu = yes; then
4475 GCC=yes
4476else
4477 GCC=
4478fi
4479ac_test_CFLAGS=${CFLAGS+set}
4480ac_save_CFLAGS=$CFLAGS
4481{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4482$as_echo_n "checking whether $CC accepts -g... " >&6; }
d0ac1c44 4483if ${ac_cv_prog_cc_g+:} false; then :
c971b7fa
PA
4484 $as_echo_n "(cached) " >&6
4485else
4486 ac_save_c_werror_flag=$ac_c_werror_flag
4487 ac_c_werror_flag=yes
4488 ac_cv_prog_cc_g=no
4489 CFLAGS="-g"
4490 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4491/* end confdefs.h. */
4492
4493int
4494main ()
4495{
4496
4497 ;
4498 return 0;
4499}
4500_ACEOF
4501if ac_fn_c_try_compile "$LINENO"; then :
4502 ac_cv_prog_cc_g=yes
4503else
4504 CFLAGS=""
4505 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4506/* end confdefs.h. */
4507
4508int
4509main ()
4510{
4511
4512 ;
4513 return 0;
4514}
4515_ACEOF
4516if ac_fn_c_try_compile "$LINENO"; then :
4517
4518else
4519 ac_c_werror_flag=$ac_save_c_werror_flag
4520 CFLAGS="-g"
4521 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4522/* end confdefs.h. */
4523
4524int
4525main ()
4526{
4527
4528 ;
4529 return 0;
4530}
4531_ACEOF
4532if ac_fn_c_try_compile "$LINENO"; then :
4533 ac_cv_prog_cc_g=yes
4534fi
4535rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4536fi
4537rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4538fi
4539rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4540 ac_c_werror_flag=$ac_save_c_werror_flag
4541fi
4542{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4543$as_echo "$ac_cv_prog_cc_g" >&6; }
4544if test "$ac_test_CFLAGS" = set; then
4545 CFLAGS=$ac_save_CFLAGS
4546elif test $ac_cv_prog_cc_g = yes; then
4547 if test "$GCC" = yes; then
4548 CFLAGS="-g -O2"
4549 else
4550 CFLAGS="-g"
4551 fi
4552else
4553 if test "$GCC" = yes; then
4554 CFLAGS="-O2"
4555 else
4556 CFLAGS=
4557 fi
4558fi
c0c3707f
CB
4559{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
4560$as_echo_n "checking for $CC option to enable C11 features... " >&6; }
4561if ${ac_cv_prog_cc_c11+:} false; then :
c971b7fa
PA
4562 $as_echo_n "(cached) " >&6
4563else
c0c3707f 4564 ac_cv_prog_cc_c11=no
c971b7fa
PA
4565ac_save_CC=$CC
4566cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4567/* end confdefs.h. */
4568#include <stdarg.h>
c0c3707f
CB
4569#include <stdbool.h>
4570#include <stddef.h>
4571#include <stdlib.h>
4572#include <wchar.h>
c971b7fa 4573#include <stdio.h>
c0c3707f
CB
4574
4575// Check varargs macros. These examples are taken from C99 6.10.3.5.
4576#define debug(...) fprintf (stderr, __VA_ARGS__)
4577#define showlist(...) puts (#__VA_ARGS__)
4578#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4579static void
4580test_varargs_macros (void)
7a6dbc2f 4581{
c0c3707f
CB
4582 int x = 1234;
4583 int y = 5678;
4584 debug ("Flag");
4585 debug ("X = %d\n", x);
4586 showlist (The first, second, and third items.);
4587 report (x>y, "x is %d but y is %d", x, y);
c971b7fa 4588}
c0c3707f
CB
4589
4590// Check long long types.
4591#define BIG64 18446744073709551615ull
4592#define BIG32 4294967295ul
4593#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4594#if !BIG_OK
4595 your preprocessor is broken;
4596#endif
4597#if BIG_OK
4598#else
4599 your preprocessor is broken;
4600#endif
4601static long long int bignum = -9223372036854775807LL;
4602static unsigned long long int ubignum = BIG64;
4603
4604struct incomplete_array
7a6dbc2f 4605{
c0c3707f
CB
4606 int datasize;
4607 double data[];
4608};
4609
4610struct named_init {
4611 int number;
4612 const wchar_t *name;
4613 double average;
4614};
4615
4616typedef const char *ccp;
4617
4618static inline int
4619test_restrict (ccp restrict text)
4620{
4621 // See if C++-style comments work.
4622 // Iterate through items via the restricted pointer.
4623 // Also check for declarations in for loops.
4624 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4625 continue;
4626 return 0;
7a6dbc2f 4627}
7a6dbc2f 4628
c0c3707f
CB
4629// Check varargs and va_copy.
4630static bool
4631test_varargs (const char *format, ...)
4632{
4633 va_list args;
4634 va_start (args, format);
4635 va_list args_copy;
4636 va_copy (args_copy, args);
7a6dbc2f 4637
c0c3707f
CB
4638 const char *str = "";
4639 int number = 0;
4640 float fnumber = 0;
4641
4642 while (*format)
4643 {
4644 switch (*format++)
4645 {
4646 case 's': // string
4647 str = va_arg (args_copy, const char *);
4648 break;
4649 case 'd': // int
4650 number = va_arg (args_copy, int);
4651 break;
4652 case 'f': // float
4653 fnumber = va_arg (args_copy, double);
4654 break;
4655 default:
4656 break;
4657 }
4658 }
4659 va_end (args_copy);
4660 va_end (args);
4661
4662 return *str && number && fnumber;
4663}
4664// Check _Alignas.
4665char _Alignas (double) aligned_as_double;
4666char _Alignas (0) no_special_alignment;
4667extern char aligned_as_int;
4668char _Alignas (0) _Alignas (int) aligned_as_int;
4669
4670// Check _Alignof.
4671enum
4672{
4673 int_alignment = _Alignof (int),
4674 int_array_alignment = _Alignof (int[100]),
4675 char_alignment = _Alignof (char)
4676};
4677_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
4678
4679// Check _Noreturn.
4680int _Noreturn does_not_return (void) { for (;;) continue; }
4681
4682// Check _Static_assert.
4683struct test_static_assert
4684{
4685 int x;
4686 _Static_assert (sizeof (int) <= sizeof (long int),
4687 "_Static_assert does not work in struct");
4688 long int y;
4689};
4690
4691// Check UTF-8 literals.
4692#define u8 syntax error!
4693char const utf8_literal[] = u8"happens to be ASCII" "another string";
4694
4695// Check duplicate typedefs.
4696typedef long *long_ptr;
4697typedef long int *long_ptr;
4698typedef long_ptr long_ptr;
4699
4700// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
4701struct anonymous
4702{
4703 union {
4704 struct { int i; int j; };
4705 struct { int k; long int l; } w;
4706 };
4707 int m;
4708} v1;
c971b7fa 4709
c971b7fa
PA
4710int
4711main ()
4712{
c0c3707f
CB
4713
4714 // Check bool.
4715 _Bool success = false;
4716
4717 // Check restrict.
4718 if (test_restrict ("String literal") == 0)
4719 success = true;
4720 char *restrict newvar = "Another string";
4721
4722 // Check varargs.
4723 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4724 test_varargs_macros ();
4725
4726 // Check flexible array members.
4727 struct incomplete_array *ia =
4728 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4729 ia->datasize = 10;
4730 for (int i = 0; i < ia->datasize; ++i)
4731 ia->data[i] = i * 1.234;
4732
4733 // Check named initializers.
4734 struct named_init ni = {
4735 .number = 34,
4736 .name = L"Test wide string",
4737 .average = 543.34343,
4738 };
4739
4740 ni.number = 58;
4741
4742 int dynamic_array[ni.number];
4743 dynamic_array[ni.number - 1] = 543;
4744
4745 // work around unused variable warnings
4746 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4747 || dynamic_array[ni.number - 1] != 543);
4748
4749 v1.i = 2;
4750 v1.w.k = 5;
4751 _Static_assert ((offsetof (struct anonymous, i)
4752 == offsetof (struct anonymous, w.k)),
4753 "Anonymous union alignment botch");
4754
c971b7fa
PA
4755 ;
4756 return 0;
4757}
4758_ACEOF
c0c3707f 4759for ac_arg in '' -std=gnu11
c971b7fa
PA
4760do
4761 CC="$ac_save_CC $ac_arg"
4762 if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 4763 ac_cv_prog_cc_c11=$ac_arg
c971b7fa
PA
4764fi
4765rm -f core conftest.err conftest.$ac_objext
c0c3707f 4766 test "x$ac_cv_prog_cc_c11" != "xno" && break
c971b7fa
PA
4767done
4768rm -f conftest.$ac_ext
4769CC=$ac_save_CC
4770
4771fi
4772# AC_CACHE_VAL
c0c3707f
CB
4773ac_prog_cc_stdc_options=
4774case "x$ac_cv_prog_cc_c11" in
c971b7fa
PA
4775 x)
4776 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4777$as_echo "none needed" >&6; } ;;
4778 xno)
4779 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4780$as_echo "unsupported" >&6; } ;;
4781 *)
c0c3707f
CB
4782 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
4783 CC=$CC$ac_prog_cc_stdc_options
4784 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
4785$as_echo "$ac_cv_prog_cc_c11" >&6; } ;;
c971b7fa 4786esac
c0c3707f
CB
4787if test "x$ac_cv_prog_cc_c11" != xno; then :
4788 ac_prog_cc_stdc=c11
4789 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
4790else
4791 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
4792$as_echo_n "checking for $CC option to enable C99 features... " >&6; }
4793if ${ac_cv_prog_cc_c99+:} false; then :
4794 $as_echo_n "(cached) " >&6
4795else
4796 ac_cv_prog_cc_c99=no
4797ac_save_CC=$CC
4798cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4799/* end confdefs.h. */
4800#include <stdarg.h>
4801#include <stdbool.h>
4802#include <stddef.h>
4803#include <stdlib.h>
4804#include <wchar.h>
4805#include <stdio.h>
7a6dbc2f 4806
c0c3707f
CB
4807// Check varargs macros. These examples are taken from C99 6.10.3.5.
4808#define debug(...) fprintf (stderr, __VA_ARGS__)
4809#define showlist(...) puts (#__VA_ARGS__)
4810#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4811static void
4812test_varargs_macros (void)
4813{
4814 int x = 1234;
4815 int y = 5678;
4816 debug ("Flag");
4817 debug ("X = %d\n", x);
4818 showlist (The first, second, and third items.);
4819 report (x>y, "x is %d but y is %d", x, y);
4820}
7a6dbc2f 4821
c0c3707f
CB
4822// Check long long types.
4823#define BIG64 18446744073709551615ull
4824#define BIG32 4294967295ul
4825#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4826#if !BIG_OK
4827 your preprocessor is broken;
4828#endif
4829#if BIG_OK
4830#else
4831 your preprocessor is broken;
4832#endif
4833static long long int bignum = -9223372036854775807LL;
4834static unsigned long long int ubignum = BIG64;
7a6dbc2f 4835
c0c3707f
CB
4836struct incomplete_array
4837{
4838 int datasize;
4839 double data[];
4840};
7a6dbc2f 4841
c0c3707f
CB
4842struct named_init {
4843 int number;
4844 const wchar_t *name;
4845 double average;
4846};
7a6dbc2f 4847
c0c3707f 4848typedef const char *ccp;
7a6dbc2f 4849
c0c3707f
CB
4850static inline int
4851test_restrict (ccp restrict text)
4852{
4853 // See if C++-style comments work.
4854 // Iterate through items via the restricted pointer.
4855 // Also check for declarations in for loops.
4856 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4857 continue;
4858 return 0;
4859}
7a6dbc2f 4860
c0c3707f
CB
4861// Check varargs and va_copy.
4862static bool
4863test_varargs (const char *format, ...)
4864{
4865 va_list args;
4866 va_start (args, format);
4867 va_list args_copy;
4868 va_copy (args_copy, args);
4869
4870 const char *str = "";
4871 int number = 0;
4872 float fnumber = 0;
4873
4874 while (*format)
4875 {
4876 switch (*format++)
4877 {
4878 case 's': // string
4879 str = va_arg (args_copy, const char *);
4880 break;
4881 case 'd': // int
4882 number = va_arg (args_copy, int);
4883 break;
4884 case 'f': // float
4885 fnumber = va_arg (args_copy, double);
4886 break;
4887 default:
4888 break;
4889 }
4890 }
4891 va_end (args_copy);
4892 va_end (args);
4893
4894 return *str && number && fnumber;
4895}
4896int
4897main ()
4898{
4899
4900 // Check bool.
4901 _Bool success = false;
4902
4903 // Check restrict.
4904 if (test_restrict ("String literal") == 0)
4905 success = true;
4906 char *restrict newvar = "Another string";
4907
4908 // Check varargs.
4909 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4910 test_varargs_macros ();
4911
4912 // Check flexible array members.
4913 struct incomplete_array *ia =
4914 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4915 ia->datasize = 10;
4916 for (int i = 0; i < ia->datasize; ++i)
4917 ia->data[i] = i * 1.234;
4918
4919 // Check named initializers.
4920 struct named_init ni = {
4921 .number = 34,
4922 .name = L"Test wide string",
4923 .average = 543.34343,
4924 };
4925
4926 ni.number = 58;
4927
4928 int dynamic_array[ni.number];
4929 dynamic_array[ni.number - 1] = 543;
4930
4931 // work around unused variable warnings
4932 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4933 || dynamic_array[ni.number - 1] != 543);
4934
4935 ;
4936 return 0;
4937}
4938_ACEOF
4939for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
4940do
4941 CC="$ac_save_CC $ac_arg"
4942 if ac_fn_c_try_compile "$LINENO"; then :
4943 ac_cv_prog_cc_c99=$ac_arg
4944fi
4945rm -f core conftest.err conftest.$ac_objext
4946 test "x$ac_cv_prog_cc_c99" != "xno" && break
4947done
4948rm -f conftest.$ac_ext
4949CC=$ac_save_CC
4950
4951fi
4952# AC_CACHE_VAL
4953ac_prog_cc_stdc_options=
4954case "x$ac_cv_prog_cc_c99" in
4955 x)
4956 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4957$as_echo "none needed" >&6; } ;;
4958 xno)
4959 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4960$as_echo "unsupported" >&6; } ;;
4961 *)
4962 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
4963 CC=$CC$ac_prog_cc_stdc_options
4964 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
4965$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
4966esac
4967if test "x$ac_cv_prog_cc_c99" != xno; then :
4968 ac_prog_cc_stdc=c99
4969 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
4970else
4971 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
4972$as_echo_n "checking for $CC option to enable C89 features... " >&6; }
4973if ${ac_cv_prog_cc_c89+:} false; then :
d0ac1c44
SM
4974 $as_echo_n "(cached) " >&6
4975else
c0c3707f
CB
4976 ac_cv_prog_cc_c89=no
4977ac_save_CC=$CC
4978cat confdefs.h - <<_ACEOF >conftest.$ac_ext
d0ac1c44 4979/* end confdefs.h. */
c0c3707f
CB
4980#include <stdarg.h>
4981#include <stdio.h>
4982struct stat;
4983/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
4984struct buf { int x; };
4985FILE * (*rcsopen) (struct buf *, struct stat *, int);
4986static char *e (p, i)
4987 char **p;
4988 int i;
4989{
4990 return p[i];
4991}
4992static char *f (char * (*g) (char **, int), char **p, ...)
4993{
4994 char *s;
4995 va_list v;
4996 va_start (v,p);
4997 s = g (p, va_arg (v,int));
4998 va_end (v);
4999 return s;
5000}
5001
5002/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
5003 function prototypes and stuff, but not '\xHH' hex character constants.
5004 These don't provoke an error unfortunately, instead are silently treated
5005 as 'x'. The following induces an error, until -std is added to get
5006 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
5007 array size at least. It's necessary to write '\x00'==0 to get something
5008 that's true only with -std. */
5009int osf4_cc_array ['\x00' == 0 ? 1 : -1];
5010
5011/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
5012 inside strings and character constants. */
5013#define FOO(x) 'x'
5014int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
d0ac1c44 5015
c0c3707f
CB
5016int test (int i, double x);
5017struct s1 {int (*f) (int a);};
5018struct s2 {int (*f) (double a);};
5019int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
5020int argc;
5021char **argv;
d0ac1c44
SM
5022int
5023main ()
5024{
c0c3707f 5025return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
d0ac1c44
SM
5026 ;
5027 return 0;
5028}
5029_ACEOF
c0c3707f
CB
5030for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
5031 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
5032do
5033 CC="$ac_save_CC $ac_arg"
5034 if ac_fn_c_try_compile "$LINENO"; then :
5035 ac_cv_prog_cc_c89=$ac_arg
5036fi
5037rm -f core conftest.err conftest.$ac_objext
5038 test "x$ac_cv_prog_cc_c89" != "xno" && break
5039done
5040rm -f conftest.$ac_ext
5041CC=$ac_save_CC
5042
5043fi
5044# AC_CACHE_VAL
5045ac_prog_cc_stdc_options=
5046case "x$ac_cv_prog_cc_c89" in
5047 x)
5048 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5049$as_echo "none needed" >&6; } ;;
5050 xno)
5051 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5052$as_echo "unsupported" >&6; } ;;
5053 *)
5054 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
5055 CC=$CC$ac_prog_cc_stdc_options
5056 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
5057$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
5058esac
5059if test "x$ac_cv_prog_cc_c89" != xno; then :
5060 ac_prog_cc_stdc=c89
5061 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
5062else
5063 ac_prog_cc_stdc=no
5064 ac_cv_prog_cc_stdc=no
5065fi
5066
5067fi
5068
7a6dbc2f 5069fi
c0c3707f 5070
d0ac1c44
SM
5071ac_ext=c
5072ac_cpp='$CPP $CPPFLAGS'
5073ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5074ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5075ac_compiler_gnu=$ac_cv_c_compiler_gnu
5076
5077
5df4cba6
SM
5078 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
5079$as_echo_n "checking whether the compiler is clang... " >&6; }
5080if ${gl_cv_compiler_clang+:} false; then :
5081 $as_echo_n "(cached) " >&6
5082else
5083 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5084/* end confdefs.h. */
5085
5086 #ifdef __clang__
5087 barfbarf
5088 #endif
5089
5090int
5091main ()
5092{
5093
5094 ;
5095 return 0;
5096}
5097
5098_ACEOF
5099if ac_fn_c_try_compile "$LINENO"; then :
5100 gl_cv_compiler_clang=no
5101else
5102 gl_cv_compiler_clang=yes
5103fi
5104rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5105
5106fi
5107{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5
5108$as_echo "$gl_cv_compiler_clang" >&6; }
5109
5110
5111 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5
5112$as_echo_n "checking for compiler option needed when checking for declarations... " >&6; }
5113if ${gl_cv_compiler_check_decl_option+:} false; then :
5114 $as_echo_n "(cached) " >&6
5115else
5116 if test $gl_cv_compiler_clang = yes; then
5117 save_ac_compile="$ac_compile"
5118 ac_compile="$ac_compile -Werror=implicit-function-declaration"
5119 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5120/* end confdefs.h. */
5121
5122int
5123main ()
5124{
5125
5126 ;
5127 return 0;
5128}
5129_ACEOF
5130if ac_fn_c_try_compile "$LINENO"; then :
5131 gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'
5132else
5133 gl_cv_compiler_check_decl_option=none
5134fi
5135rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5136 ac_compile="$save_ac_compile"
5137 else
5138 gl_cv_compiler_check_decl_option=none
5139 fi
5140
5141fi
5142{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5
5143$as_echo "$gl_cv_compiler_check_decl_option" >&6; }
5144 if test "x$gl_cv_compiler_check_decl_option" != xnone; then
5145 ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
5146 else
5147 ac_compile_for_check_decl="$ac_compile"
5148 fi
5149
5150
5151
c971b7fa
PA
5152ac_ext=c
5153ac_cpp='$CPP $CPPFLAGS'
5154ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5155ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5156ac_compiler_gnu=$ac_cv_c_compiler_gnu
5157{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5158$as_echo_n "checking how to run the C preprocessor... " >&6; }
5159# On Suns, sometimes $CPP names a directory.
5160if test -n "$CPP" && test -d "$CPP"; then
5161 CPP=
5162fi
5163if test -z "$CPP"; then
d0ac1c44 5164 if ${ac_cv_prog_CPP+:} false; then :
c971b7fa
PA
5165 $as_echo_n "(cached) " >&6
5166else
5167 # Double quotes because CPP needs to be expanded
5168 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5169 do
5170 ac_preproc_ok=false
5171for ac_c_preproc_warn_flag in '' yes
5172do
5173 # Use a header file that comes with gcc, so configuring glibc
5174 # with a fresh cross-compiler works.
5175 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5176 # <limits.h> exists even on freestanding compilers.
5177 # On the NeXT, cc -E runs the code through the compiler's parser,
5178 # not just through cpp. "Syntax error" is here to catch this case.
5179 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5180/* end confdefs.h. */
5181#ifdef __STDC__
5182# include <limits.h>
5183#else
5184# include <assert.h>
5185#endif
5186 Syntax error
5187_ACEOF
5188if ac_fn_c_try_cpp "$LINENO"; then :
5189
5190else
5191 # Broken: fails on valid input.
5192continue
5193fi
d0ac1c44 5194rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5195
5196 # OK, works on sane cases. Now check whether nonexistent headers
5197 # can be detected and how.
5198 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5199/* end confdefs.h. */
5200#include <ac_nonexistent.h>
5201_ACEOF
5202if ac_fn_c_try_cpp "$LINENO"; then :
5203 # Broken: success on invalid input.
5204continue
5205else
5206 # Passes both tests.
5207ac_preproc_ok=:
5208break
5209fi
d0ac1c44 5210rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5211
5212done
5213# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5214rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5215if $ac_preproc_ok; then :
5216 break
5217fi
5218
5219 done
5220 ac_cv_prog_CPP=$CPP
5221
5222fi
5223 CPP=$ac_cv_prog_CPP
5224else
5225 ac_cv_prog_CPP=$CPP
5226fi
5227{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5228$as_echo "$CPP" >&6; }
5229ac_preproc_ok=false
5230for ac_c_preproc_warn_flag in '' yes
5231do
5232 # Use a header file that comes with gcc, so configuring glibc
5233 # with a fresh cross-compiler works.
5234 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5235 # <limits.h> exists even on freestanding compilers.
5236 # On the NeXT, cc -E runs the code through the compiler's parser,
5237 # not just through cpp. "Syntax error" is here to catch this case.
5238 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5239/* end confdefs.h. */
5240#ifdef __STDC__
5241# include <limits.h>
5242#else
5243# include <assert.h>
5244#endif
5245 Syntax error
5246_ACEOF
5247if ac_fn_c_try_cpp "$LINENO"; then :
5248
5249else
5250 # Broken: fails on valid input.
5251continue
5252fi
d0ac1c44 5253rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5254
5255 # OK, works on sane cases. Now check whether nonexistent headers
5256 # can be detected and how.
5257 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5258/* end confdefs.h. */
5259#include <ac_nonexistent.h>
5260_ACEOF
5261if ac_fn_c_try_cpp "$LINENO"; then :
5262 # Broken: success on invalid input.
5263continue
5264else
5265 # Passes both tests.
5266ac_preproc_ok=:
5267break
5268fi
d0ac1c44 5269rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5270
5271done
5272# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5273rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5274if $ac_preproc_ok; then :
5275
5276else
5277 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5278$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
5279as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5280See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
5281fi
5282
5283ac_ext=c
5284ac_cpp='$CPP $CPPFLAGS'
5285ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5286ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5287ac_compiler_gnu=$ac_cv_c_compiler_gnu
5288
5289
5290{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
5291$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
d0ac1c44 5292if ${ac_cv_path_GREP+:} false; then :
c971b7fa
PA
5293 $as_echo_n "(cached) " >&6
5294else
5295 if test -z "$GREP"; then
5296 ac_path_GREP_found=false
5297 # Loop through the user's path and test for each of PROGNAME-LIST
5298 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5299for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5300do
5301 IFS=$as_save_IFS
5302 test -z "$as_dir" && as_dir=.
5303 for ac_prog in grep ggrep; do
5304 for ac_exec_ext in '' $ac_executable_extensions; do
5305 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5306 as_fn_executable_p "$ac_path_GREP" || continue
c971b7fa
PA
5307# Check for GNU ac_path_GREP and select it if it is found.
5308 # Check for GNU $ac_path_GREP
5309case `"$ac_path_GREP" --version 2>&1` in
5310*GNU*)
5311 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
5312*)
5313 ac_count=0
5314 $as_echo_n 0123456789 >"conftest.in"
5315 while :
5316 do
5317 cat "conftest.in" "conftest.in" >"conftest.tmp"
5318 mv "conftest.tmp" "conftest.in"
5319 cp "conftest.in" "conftest.nl"
5320 $as_echo 'GREP' >> "conftest.nl"
5321 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5322 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5323 as_fn_arith $ac_count + 1 && ac_count=$as_val
5324 if test $ac_count -gt ${ac_path_GREP_max-0}; then
5325 # Best one so far, save it but keep looking for a better one
5326 ac_cv_path_GREP="$ac_path_GREP"
5327 ac_path_GREP_max=$ac_count
5328 fi
5329 # 10*(2^10) chars as input seems more than enough
5330 test $ac_count -gt 10 && break
5331 done
5332 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5333esac
5334
5335 $ac_path_GREP_found && break 3
5336 done
5337 done
5338 done
5339IFS=$as_save_IFS
5340 if test -z "$ac_cv_path_GREP"; then
d0ac1c44 5341 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5342 fi
5343else
5344 ac_cv_path_GREP=$GREP
5345fi
5346
5347fi
5348{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
5349$as_echo "$ac_cv_path_GREP" >&6; }
5350 GREP="$ac_cv_path_GREP"
5351
5352
5353{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
5354$as_echo_n "checking for egrep... " >&6; }
d0ac1c44 5355if ${ac_cv_path_EGREP+:} false; then :
c971b7fa
PA
5356 $as_echo_n "(cached) " >&6
5357else
5358 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
5359 then ac_cv_path_EGREP="$GREP -E"
5360 else
5361 if test -z "$EGREP"; then
5362 ac_path_EGREP_found=false
5363 # Loop through the user's path and test for each of PROGNAME-LIST
5364 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5365for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5366do
5367 IFS=$as_save_IFS
5368 test -z "$as_dir" && as_dir=.
5369 for ac_prog in egrep; do
5370 for ac_exec_ext in '' $ac_executable_extensions; do
5371 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5372 as_fn_executable_p "$ac_path_EGREP" || continue
c971b7fa
PA
5373# Check for GNU ac_path_EGREP and select it if it is found.
5374 # Check for GNU $ac_path_EGREP
5375case `"$ac_path_EGREP" --version 2>&1` in
5376*GNU*)
5377 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
5378*)
5379 ac_count=0
5380 $as_echo_n 0123456789 >"conftest.in"
5381 while :
5382 do
5383 cat "conftest.in" "conftest.in" >"conftest.tmp"
5384 mv "conftest.tmp" "conftest.in"
5385 cp "conftest.in" "conftest.nl"
5386 $as_echo 'EGREP' >> "conftest.nl"
5387 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5388 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5389 as_fn_arith $ac_count + 1 && ac_count=$as_val
5390 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
5391 # Best one so far, save it but keep looking for a better one
5392 ac_cv_path_EGREP="$ac_path_EGREP"
5393 ac_path_EGREP_max=$ac_count
5394 fi
5395 # 10*(2^10) chars as input seems more than enough
5396 test $ac_count -gt 10 && break
5397 done
5398 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5399esac
5400
5401 $ac_path_EGREP_found && break 3
5402 done
5403 done
5404 done
5405IFS=$as_save_IFS
5406 if test -z "$ac_cv_path_EGREP"; then
d0ac1c44 5407 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5408 fi
5409else
5410 ac_cv_path_EGREP=$EGREP
5411fi
5412
5413 fi
5414fi
5415{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
5416$as_echo "$ac_cv_path_EGREP" >&6; }
5417 EGREP="$ac_cv_path_EGREP"
5418
5419
5420{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
5421$as_echo_n "checking for ANSI C header files... " >&6; }
d0ac1c44 5422if ${ac_cv_header_stdc+:} false; then :
c971b7fa
PA
5423 $as_echo_n "(cached) " >&6
5424else
5425 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5426/* end confdefs.h. */
5427#include <stdlib.h>
5428#include <stdarg.h>
5429#include <string.h>
5430#include <float.h>
5431
5432int
5433main ()
5434{
5435
5436 ;
5437 return 0;
5438}
5439_ACEOF
5440if ac_fn_c_try_compile "$LINENO"; then :
5441 ac_cv_header_stdc=yes
5442else
5443 ac_cv_header_stdc=no
5444fi
5445rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5446
5447if test $ac_cv_header_stdc = yes; then
5448 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5449 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5450/* end confdefs.h. */
5451#include <string.h>
5452
5453_ACEOF
5454if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5455 $EGREP "memchr" >/dev/null 2>&1; then :
5456
5457else
5458 ac_cv_header_stdc=no
5459fi
5460rm -f conftest*
5461
5462fi
5463
5464if test $ac_cv_header_stdc = yes; then
5465 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5466 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5467/* end confdefs.h. */
5468#include <stdlib.h>
5469
5470_ACEOF
5471if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5472 $EGREP "free" >/dev/null 2>&1; then :
5473
5474else
5475 ac_cv_header_stdc=no
5476fi
5477rm -f conftest*
5478
5479fi
5480
5481if test $ac_cv_header_stdc = yes; then
5482 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5483 if test "$cross_compiling" = yes; then :
5484 :
5485else
5486 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5487/* end confdefs.h. */
5488#include <ctype.h>
5489#include <stdlib.h>
5490#if ((' ' & 0x0FF) == 0x020)
5491# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5492# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5493#else
5494# define ISLOWER(c) \
5495 (('a' <= (c) && (c) <= 'i') \
5496 || ('j' <= (c) && (c) <= 'r') \
5497 || ('s' <= (c) && (c) <= 'z'))
5498# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
5499#endif
5500
5501#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5502int
5503main ()
5504{
5505 int i;
5506 for (i = 0; i < 256; i++)
5507 if (XOR (islower (i), ISLOWER (i))
5508 || toupper (i) != TOUPPER (i))
5509 return 2;
5510 return 0;
5511}
5512_ACEOF
5513if ac_fn_c_try_run "$LINENO"; then :
5514
5515else
5516 ac_cv_header_stdc=no
5517fi
5518rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5519 conftest.$ac_objext conftest.beam conftest.$ac_ext
5520fi
5521
5522fi
5523fi
5524{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
5525$as_echo "$ac_cv_header_stdc" >&6; }
5526if test $ac_cv_header_stdc = yes; then
5527
5528$as_echo "#define STDC_HEADERS 1" >>confdefs.h
5529
5530fi
5531
5532# On IRIX 5.3, sys/types and inttypes.h are conflicting.
5533for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
5534 inttypes.h stdint.h unistd.h
5535do :
5536 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5537ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5538"
d0ac1c44 5539if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
c971b7fa
PA
5540 cat >>confdefs.h <<_ACEOF
5541#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5542_ACEOF
5543
5544fi
5545
5546done
5547
5548
5549
c971b7fa 5550 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
d0ac1c44 5551if test "x$ac_cv_header_minix_config_h" = xyes; then :
c971b7fa
PA
5552 MINIX=yes
5553else
5554 MINIX=
5555fi
5556
5557
5558 if test "$MINIX" = yes; then
5559
5560$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
5561
5562
5563$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
5564
5565
5566$as_echo "#define _MINIX 1" >>confdefs.h
5567
c971b7fa 5568
4a626d0a 5569$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
c971b7fa 5570
4a626d0a 5571 fi
c971b7fa
PA
5572
5573
5574 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
5575$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
d0ac1c44 5576if ${ac_cv_safe_to_define___extensions__+:} false; then :
c971b7fa
PA
5577 $as_echo_n "(cached) " >&6
5578else
5579 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5580/* end confdefs.h. */
5581
5582# define __EXTENSIONS__ 1
5583 $ac_includes_default
5584int
5585main ()
5586{
5587
5588 ;
5589 return 0;
5590}
5591_ACEOF
5592if ac_fn_c_try_compile "$LINENO"; then :
5593 ac_cv_safe_to_define___extensions__=yes
5594else
5595 ac_cv_safe_to_define___extensions__=no
5596fi
5597rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5598fi
5599{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
5600$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
5601 test $ac_cv_safe_to_define___extensions__ = yes &&
5602 $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
5603
5604 $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
5605
5606 $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
5607
5608 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
5609
c0c3707f
CB
5610 $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
5611
5612 $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h
5613
c971b7fa
PA
5614 $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
5615
49e4877c
PA
5616 $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
5617
5618 $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
5619
5620 $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
5621
5622 $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
5623
5624 $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
5625
5626 $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
5627
5628 $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
5629
c971b7fa
PA
5630 $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
5631
4a626d0a
PA
5632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
5633$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
d0ac1c44 5634if ${ac_cv_should_define__xopen_source+:} false; then :
4a626d0a
PA
5635 $as_echo_n "(cached) " >&6
5636else
5637 ac_cv_should_define__xopen_source=no
5638 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5639/* end confdefs.h. */
5640
5641 #include <wchar.h>
5642 mbstate_t x;
5643int
5644main ()
5645{
5646
5647 ;
5648 return 0;
5649}
5650_ACEOF
5651if ac_fn_c_try_compile "$LINENO"; then :
5652
5653else
5654 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5655/* end confdefs.h. */
5656
5657 #define _XOPEN_SOURCE 500
5658 #include <wchar.h>
5659 mbstate_t x;
5660int
5661main ()
5662{
5663
5664 ;
5665 return 0;
5666}
5667_ACEOF
5668if ac_fn_c_try_compile "$LINENO"; then :
5669 ac_cv_should_define__xopen_source=yes
5670fi
d0ac1c44
SM
5671rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5672fi
5673rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5674fi
5675{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
5676$as_echo "$ac_cv_should_define__xopen_source" >&6; }
5677 test $ac_cv_should_define__xopen_source = yes &&
5678 $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
5679
c0c3707f
CB
5680 $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
5681
d0ac1c44
SM
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
5693$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
5694if ${gl_cv_c_amsterdam_compiler+:} false; then :
5695 $as_echo_n "(cached) " >&6
5696else
5697
5698 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5699/* end confdefs.h. */
5700
5701#ifdef __ACK__
5702Amsterdam
5703#endif
5704
5705_ACEOF
5706if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5707 $EGREP "Amsterdam" >/dev/null 2>&1; then :
5708 gl_cv_c_amsterdam_compiler=yes
5709else
5710 gl_cv_c_amsterdam_compiler=no
5711fi
5712rm -f conftest*
5713
5714
5715fi
5716{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
5717$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
5718
5719 if test $gl_cv_c_amsterdam_compiler = yes; then
5720 if test -z "$AR"; then
5721 AR='cc -c.a'
5722 fi
5723 if test -z "$ARFLAGS"; then
5724 ARFLAGS='-o'
5725 fi
5726 else
c0c3707f
CB
5727 :
5728 fi
5729
5730 if test -n "$ac_tool_prefix"; then
5731 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
5732set dummy ${ac_tool_prefix}ar; ac_word=$2
d0ac1c44
SM
5733{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5734$as_echo_n "checking for $ac_word... " >&6; }
5735if ${ac_cv_prog_AR+:} false; then :
5736 $as_echo_n "(cached) " >&6
5737else
5738 if test -n "$AR"; then
5739 ac_cv_prog_AR="$AR" # Let the user override the test.
5740else
5741as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5742for as_dir in $PATH
5743do
5744 IFS=$as_save_IFS
5745 test -z "$as_dir" && as_dir=.
5746 for ac_exec_ext in '' $ac_executable_extensions; do
5747 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c0c3707f 5748 ac_cv_prog_AR="${ac_tool_prefix}ar"
d0ac1c44
SM
5749 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5750 break 2
5751 fi
5752done
5753 done
5754IFS=$as_save_IFS
5755
5756fi
4a626d0a 5757fi
d0ac1c44
SM
5758AR=$ac_cv_prog_AR
5759if test -n "$AR"; then
5760 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5761$as_echo "$AR" >&6; }
5762else
5763 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5764$as_echo "no" >&6; }
4a626d0a 5765fi
c971b7fa 5766
49e4877c 5767
d0ac1c44 5768fi
c0c3707f 5769if test -z "$ac_cv_prog_AR"; then
d0ac1c44 5770 ac_ct_AR=$AR
c0c3707f
CB
5771 # Extract the first word of "ar", so it can be a program name with args.
5772set dummy ar; ac_word=$2
d0ac1c44
SM
5773{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5774$as_echo_n "checking for $ac_word... " >&6; }
5775if ${ac_cv_prog_ac_ct_AR+:} false; then :
5776 $as_echo_n "(cached) " >&6
5777else
5778 if test -n "$ac_ct_AR"; then
5779 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5780else
5781as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5782for as_dir in $PATH
5783do
5784 IFS=$as_save_IFS
5785 test -z "$as_dir" && as_dir=.
5786 for ac_exec_ext in '' $ac_executable_extensions; do
5787 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c0c3707f 5788 ac_cv_prog_ac_ct_AR="ar"
d0ac1c44
SM
5789 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5790 break 2
5791 fi
5792done
5793 done
5794IFS=$as_save_IFS
49e4877c 5795
d0ac1c44
SM
5796fi
5797fi
5798ac_ct_AR=$ac_cv_prog_ac_ct_AR
5799if test -n "$ac_ct_AR"; then
5800 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5801$as_echo "$ac_ct_AR" >&6; }
5802else
5803 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5804$as_echo "no" >&6; }
5805fi
49e4877c 5806
d0ac1c44 5807 if test "x$ac_ct_AR" = x; then
c0c3707f 5808 AR="ar"
d0ac1c44
SM
5809 else
5810 case $cross_compiling:$ac_tool_warned in
5811yes:)
5812{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5813$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5814ac_tool_warned=yes ;;
5815esac
5816 AR=$ac_ct_AR
5817 fi
c971b7fa 5818else
c0c3707f 5819 AR="$ac_cv_prog_AR"
5e8754f9 5820fi
5e8754f9 5821
c0c3707f
CB
5822 if test -z "$ARFLAGS"; then
5823 ARFLAGS='cr'
5824 fi
5e8754f9 5825
5e8754f9 5826
5e8754f9 5827
c0c3707f
CB
5828 if test -z "$RANLIB"; then
5829 if test $gl_cv_c_amsterdam_compiler = yes; then
5830 RANLIB=':'
5831 else
5832 if test -n "$ac_tool_prefix"; then
5833 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5834set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5e8754f9
SDJ
5835{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5836$as_echo_n "checking for $ac_word... " >&6; }
c0c3707f 5837if ${ac_cv_prog_RANLIB+:} false; then :
5e8754f9
SDJ
5838 $as_echo_n "(cached) " >&6
5839else
c0c3707f
CB
5840 if test -n "$RANLIB"; then
5841 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5e8754f9
SDJ
5842else
5843as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5844for as_dir in $PATH
5845do
5846 IFS=$as_save_IFS
5847 test -z "$as_dir" && as_dir=.
5848 for ac_exec_ext in '' $ac_executable_extensions; do
5849 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c0c3707f 5850 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5e8754f9
SDJ
5851 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5852 break 2
5853 fi
5854done
5855 done
5856IFS=$as_save_IFS
5857
5858fi
5859fi
c0c3707f
CB
5860RANLIB=$ac_cv_prog_RANLIB
5861if test -n "$RANLIB"; then
5862 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5863$as_echo "$RANLIB" >&6; }
5e8754f9
SDJ
5864else
5865 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5866$as_echo "no" >&6; }
5867fi
5868
5869
5870fi
c0c3707f
CB
5871if test -z "$ac_cv_prog_RANLIB"; then
5872 ac_ct_RANLIB=$RANLIB
5873 # Extract the first word of "ranlib", so it can be a program name with args.
5874set dummy ranlib; ac_word=$2
5e8754f9
SDJ
5875{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5876$as_echo_n "checking for $ac_word... " >&6; }
c0c3707f 5877if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
5e8754f9
SDJ
5878 $as_echo_n "(cached) " >&6
5879else
c0c3707f
CB
5880 if test -n "$ac_ct_RANLIB"; then
5881 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
c971b7fa
PA
5882else
5883as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5884for as_dir in $PATH
5885do
5886 IFS=$as_save_IFS
5887 test -z "$as_dir" && as_dir=.
5888 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 5889 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
5890 ac_cv_prog_ac_ct_RANLIB="ranlib"
5891 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5892 break 2
5893 fi
5894done
5895 done
5896IFS=$as_save_IFS
5897
5898fi
5899fi
5900ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5901if test -n "$ac_ct_RANLIB"; then
5902 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5903$as_echo "$ac_ct_RANLIB" >&6; }
5904else
5905 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5906$as_echo "no" >&6; }
5907fi
5908
5909 if test "x$ac_ct_RANLIB" = x; then
5910 RANLIB=":"
5911 else
5912 case $cross_compiling:$ac_tool_warned in
5913yes:)
5914{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5915$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5916ac_tool_warned=yes ;;
5917esac
5918 RANLIB=$ac_ct_RANLIB
5919 fi
5920else
5921 RANLIB="$ac_cv_prog_RANLIB"
5922fi
5923
5924 fi
5925 fi
5926
5927
5abebf3c 5928
c0c3707f
CB
5929ac_aux_dir=
5930for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
5931 if test -f "$ac_dir/install-sh"; then
5932 ac_aux_dir=$ac_dir
5933 ac_install_sh="$ac_aux_dir/install-sh -c"
5934 break
5935 elif test -f "$ac_dir/install.sh"; then
5936 ac_aux_dir=$ac_dir
5937 ac_install_sh="$ac_aux_dir/install.sh -c"
5938 break
5939 elif test -f "$ac_dir/shtool"; then
5940 ac_aux_dir=$ac_dir
5941 ac_install_sh="$ac_aux_dir/shtool install -c"
5942 break
5943 fi
5944done
5945if test -z "$ac_aux_dir"; then
5946 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
5947fi
5948
5949# These three variables are undocumented and unsupported,
5950# and are intended to be withdrawn in a future Autoconf release.
5951# They can cause serious problems if a builder's source tree is in a directory
5952# whose full name contains unusual characters.
5953ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
5954ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
5955ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
5956
5957
4a626d0a
PA
5958# Make sure we can run config.sub.
5959$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
d0ac1c44 5960 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4a626d0a
PA
5961
5962{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
5963$as_echo_n "checking build system type... " >&6; }
d0ac1c44 5964if ${ac_cv_build+:} false; then :
4a626d0a
PA
5965 $as_echo_n "(cached) " >&6
5966else
5967 ac_build_alias=$build_alias
5968test "x$ac_build_alias" = x &&
5969 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
5970test "x$ac_build_alias" = x &&
d0ac1c44 5971 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4a626d0a 5972ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
d0ac1c44 5973 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4a626d0a
PA
5974
5975fi
5976{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
5977$as_echo "$ac_cv_build" >&6; }
5978case $ac_cv_build in
5979*-*-*) ;;
d0ac1c44 5980*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4a626d0a
PA
5981esac
5982build=$ac_cv_build
5983ac_save_IFS=$IFS; IFS='-'
5984set x $ac_cv_build
5985shift
5986build_cpu=$1
5987build_vendor=$2
5988shift; shift
5989# Remember, the first character of IFS is used to create $*,
5990# except with old shells:
5991build_os=$*
5992IFS=$ac_save_IFS
5993case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
5994
5995
5996{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
5997$as_echo_n "checking host system type... " >&6; }
d0ac1c44 5998if ${ac_cv_host+:} false; then :
4a626d0a
PA
5999 $as_echo_n "(cached) " >&6
6000else
6001 if test "x$host_alias" = x; then
6002 ac_cv_host=$ac_cv_build
6003else
6004 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
d0ac1c44 6005 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4a626d0a
PA
6006fi
6007
6008fi
6009{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
6010$as_echo "$ac_cv_host" >&6; }
6011case $ac_cv_host in
6012*-*-*) ;;
d0ac1c44 6013*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4a626d0a
PA
6014esac
6015host=$ac_cv_host
6016ac_save_IFS=$IFS; IFS='-'
6017set x $ac_cv_host
6018shift
6019host_cpu=$1
6020host_vendor=$2
6021shift; shift
6022# Remember, the first character of IFS is used to create $*,
6023# except with old shells:
6024host_os=$*
6025IFS=$ac_save_IFS
6026case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
6027
6028
c971b7fa
PA
6029
6030
88b48903
WN
6031
6032 # IEEE behaviour is the default on all CPUs except Alpha and SH
6033 # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
6034 # and the GCC 4.1.2 manual).
6035 case "$host_cpu" in
6036 alpha*)
6037 # On Alpha systems, a compiler option provides the behaviour.
6038 # See the ieee(3) manual page, also available at
c0c3707f 6039 # <https://backdrift.org/man/tru64/man3/ieee.3.html>
88b48903
WN
6040 if test -n "$GCC"; then
6041 # GCC has the option -mieee.
6042 # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
6043 CPPFLAGS="$CPPFLAGS -mieee"
6044 else
6045 # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
6046 # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
6047 CPPFLAGS="$CPPFLAGS -ieee"
6048 fi
6049 ;;
6050 sh*)
6051 if test -n "$GCC"; then
6052 # GCC has the option -mieee.
6053 CPPFLAGS="$CPPFLAGS -mieee"
6054 fi
6055 ;;
6056 esac
6057
2196f55f
YQ
6058# Check whether --enable-largefile was given.
6059if test "${enable_largefile+set}" = set; then :
6060 enableval=$enable_largefile;
6061fi
6062
6063if test "$enable_largefile" != no; then
6064
6065 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
6066$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
d0ac1c44 6067if ${ac_cv_sys_largefile_CC+:} false; then :
2196f55f
YQ
6068 $as_echo_n "(cached) " >&6
6069else
6070 ac_cv_sys_largefile_CC=no
6071 if test "$GCC" != yes; then
6072 ac_save_CC=$CC
6073 while :; do
6074 # IRIX 6.2 and later do not support large files by default,
6075 # so use the C compiler's -n32 option if that helps.
6076 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6077/* end confdefs.h. */
6078#include <sys/types.h>
6079 /* Check that off_t can represent 2**63 - 1 correctly.
6080 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6081 since some C++ compilers masquerading as C compilers
6082 incorrectly reject 9223372036854775807. */
6083#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6084 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6085 && LARGE_OFF_T % 2147483647 == 1)
6086 ? 1 : -1];
6087int
6088main ()
6089{
6090
6091 ;
6092 return 0;
6093}
6094_ACEOF
6095 if ac_fn_c_try_compile "$LINENO"; then :
6096 break
6097fi
6098rm -f core conftest.err conftest.$ac_objext
6099 CC="$CC -n32"
6100 if ac_fn_c_try_compile "$LINENO"; then :
6101 ac_cv_sys_largefile_CC=' -n32'; break
6102fi
6103rm -f core conftest.err conftest.$ac_objext
6104 break
6105 done
6106 CC=$ac_save_CC
6107 rm -f conftest.$ac_ext
6108 fi
6109fi
6110{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6111$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6112 if test "$ac_cv_sys_largefile_CC" != no; then
6113 CC=$CC$ac_cv_sys_largefile_CC
6114 fi
6115
6116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6117$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
d0ac1c44 6118if ${ac_cv_sys_file_offset_bits+:} false; then :
2196f55f
YQ
6119 $as_echo_n "(cached) " >&6
6120else
6121 while :; do
6122 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6123/* end confdefs.h. */
6124#include <sys/types.h>
6125 /* Check that off_t can represent 2**63 - 1 correctly.
6126 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6127 since some C++ compilers masquerading as C compilers
6128 incorrectly reject 9223372036854775807. */
6129#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6130 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6131 && LARGE_OFF_T % 2147483647 == 1)
6132 ? 1 : -1];
6133int
6134main ()
6135{
6136
6137 ;
6138 return 0;
6139}
6140_ACEOF
6141if ac_fn_c_try_compile "$LINENO"; then :
6142 ac_cv_sys_file_offset_bits=no; break
6143fi
6144rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6145 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6146/* end confdefs.h. */
6147#define _FILE_OFFSET_BITS 64
6148#include <sys/types.h>
6149 /* Check that off_t can represent 2**63 - 1 correctly.
6150 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6151 since some C++ compilers masquerading as C compilers
6152 incorrectly reject 9223372036854775807. */
6153#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6154 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6155 && LARGE_OFF_T % 2147483647 == 1)
6156 ? 1 : -1];
6157int
6158main ()
6159{
6160
6161 ;
6162 return 0;
6163}
6164_ACEOF
6165if ac_fn_c_try_compile "$LINENO"; then :
6166 ac_cv_sys_file_offset_bits=64; break
6167fi
6168rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6169 ac_cv_sys_file_offset_bits=unknown
6170 break
6171done
6172fi
6173{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6174$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6175case $ac_cv_sys_file_offset_bits in #(
6176 no | unknown) ;;
6177 *)
6178cat >>confdefs.h <<_ACEOF
6179#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6180_ACEOF
6181;;
6182esac
6183rm -rf conftest*
6184 if test $ac_cv_sys_file_offset_bits = unknown; then
6185 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6186$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
d0ac1c44 6187if ${ac_cv_sys_large_files+:} false; then :
2196f55f
YQ
6188 $as_echo_n "(cached) " >&6
6189else
6190 while :; do
6191 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6192/* end confdefs.h. */
6193#include <sys/types.h>
6194 /* Check that off_t can represent 2**63 - 1 correctly.
6195 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6196 since some C++ compilers masquerading as C compilers
6197 incorrectly reject 9223372036854775807. */
6198#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6199 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6200 && LARGE_OFF_T % 2147483647 == 1)
6201 ? 1 : -1];
6202int
6203main ()
6204{
6205
6206 ;
6207 return 0;
6208}
6209_ACEOF
6210if ac_fn_c_try_compile "$LINENO"; then :
6211 ac_cv_sys_large_files=no; break
6212fi
6213rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6214 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6215/* end confdefs.h. */
6216#define _LARGE_FILES 1
6217#include <sys/types.h>
6218 /* Check that off_t can represent 2**63 - 1 correctly.
6219 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6220 since some C++ compilers masquerading as C compilers
6221 incorrectly reject 9223372036854775807. */
6222#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6223 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6224 && LARGE_OFF_T % 2147483647 == 1)
6225 ? 1 : -1];
6226int
6227main ()
6228{
6229
6230 ;
6231 return 0;
6232}
6233_ACEOF
6234if ac_fn_c_try_compile "$LINENO"; then :
6235 ac_cv_sys_large_files=1; break
6236fi
6237rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6238 ac_cv_sys_large_files=unknown
6239 break
6240done
6241fi
6242{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6243$as_echo "$ac_cv_sys_large_files" >&6; }
6244case $ac_cv_sys_large_files in #(
6245 no | unknown) ;;
6246 *)
6247cat >>confdefs.h <<_ACEOF
6248#define _LARGE_FILES $ac_cv_sys_large_files
6249_ACEOF
6250;;
6251esac
6252rm -rf conftest*
6253 fi
6254
6255
4a626d0a
PA
6256$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
6257
2196f55f
YQ
6258fi
6259
88b48903
WN
6260
6261
5abebf3c
CB
6262
6263
6264
c0c3707f 6265
5abebf3c
CB
6266 # Check whether --enable-threads was given.
6267if test "${enable_threads+set}" = set; then :
6268 enableval=$enable_threads; gl_use_threads=$enableval
6269else
6270 if test -n "$gl_use_threads_default"; then
6271 gl_use_threads="$gl_use_threads_default"
6272 else
6273 case "$host_os" in
c0c3707f
CB
6274 osf*) gl_use_threads=no ;;
6275 cygwin*)
5abebf3c
CB
6276 case `uname -r` in
6277 1.[0-5].*) gl_use_threads=no ;;
6278 *) gl_use_threads=yes ;;
6279 esac
6280 ;;
c0c3707f
CB
6281 mingw*)
6282 case "$gl_use_winpthreads_default" in
6283 yes) gl_use_threads=posix ;;
6284 no) gl_use_threads=windows ;;
6285 *) gl_use_threads=yes ;;
6286 esac
6287 ;;
5abebf3c
CB
6288 *) gl_use_threads=yes ;;
6289 esac
6290 fi
6291
6292fi
6293
c0c3707f
CB
6294 if test "$gl_use_threads" = yes \
6295 || test "$gl_use_threads" = isoc \
6296 || test "$gl_use_threads" = posix \
6297 || test "$gl_use_threads" = isoc+posix; then
6298 # For using <threads.h> or <pthread.h>:
6299
6300
6301 if test -z "$gl_anythreadlib_early_done"; then
5abebf3c
CB
6302 case "$host_os" in
6303 osf*)
6304 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
6305 # groks <pthread.h>. cc also understands the flag -pthread, but
6306 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
6307 # 2. putting a flag into CPPFLAGS that has an effect on the linker
6308 # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
6309 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
6310 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
6311 ;;
6312 esac
6313 # Some systems optimize for single-threaded programs by default, and
6314 # need special flags to disable these optimizations. For example, the
6315 # definition of 'errno' in <errno.h>.
6316 case "$host_os" in
6317 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
6318 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
6319 esac
c0c3707f
CB
6320 gl_anythreadlib_early_done=done
6321 fi
6322
5abebf3c
CB
6323 fi
6324
6325
6326
49e4877c
PA
6327 # Pre-early section.
6328
6329
6330
5abebf3c 6331
4a626d0a 6332 # Code from module absolute-header:
8690e634
JK
6333 # Code from module alloca:
6334 # Code from module alloca-opt:
725e2999 6335 # Code from module arpa_inet:
6ec2e0f5
SDJ
6336 # Code from module assure:
6337 # Code from module at-internal:
c0c3707f
CB
6338 # Code from module builtin-expect:
6339 # Code from module c99:
98399780 6340 # Code from module canonicalize-lgpl:
6a29c58e 6341 # Code from module chdir:
6ec2e0f5
SDJ
6342 # Code from module chdir-long:
6343 # Code from module cloexec:
6344 # Code from module close:
6345 # Code from module closedir:
5f661e03 6346 # Code from module count-one-bits:
6ec2e0f5
SDJ
6347 # Code from module d-ino:
6348 # Code from module d-type:
e26b6bb0 6349 # Code from module dirent:
18848e28 6350 # Code from module dirfd:
6a29c58e 6351 # Code from module dirname-lgpl:
2196f55f 6352 # Code from module dosname:
6a29c58e 6353 # Code from module double-slash-root:
6ec2e0f5
SDJ
6354 # Code from module dup:
6355 # Code from module dup2:
3d99e817 6356 # Code from module environ:
18848e28 6357 # Code from module errno:
6ec2e0f5
SDJ
6358 # Code from module error:
6359 # Code from module exitfail:
c971b7fa 6360 # Code from module extensions:
a512b375 6361 # Code from module extern-inline:
6ec2e0f5
SDJ
6362 # Code from module fchdir:
6363 # Code from module fcntl:
6364 # Code from module fcntl-h:
6365 # Code from module fd-hook:
c0c3707f 6366 # Code from module fd-safer-flag:
6ec2e0f5
SDJ
6367 # Code from module fdopendir:
6368 # Code from module filename:
6369 # Code from module filenamecat-lgpl:
49e4877c 6370 # Code from module flexmember:
88b48903 6371 # Code from module float:
8690e634
JK
6372 # Code from module fnmatch:
6373 # Code from module fnmatch-gnu:
c0c3707f 6374 # Code from module fnmatch-h:
88b48903
WN
6375 # Code from module fpieee:
6376
6377 # Code from module fpucw:
6378 # Code from module frexp:
6379 # Code from module frexpl:
6ec2e0f5
SDJ
6380 # Code from module fstat:
6381 # Code from module fstatat:
6382 # Code from module getcwd:
6383 # Code from module getcwd-lgpl:
6384 # Code from module getdtablesize:
6385 # Code from module getlogin_r:
6386 # Code from module getprogname:
6387 # Code from module gettext-h:
4a626d0a 6388 # Code from module gettimeofday:
6ec2e0f5 6389 # Code from module glob:
c0c3707f 6390 # Code from module glob-h:
49e4877c 6391 # Code from module hard-locale:
c971b7fa 6392 # Code from module include_next:
725e2999 6393 # Code from module inet_ntop:
6ec2e0f5 6394 # Code from module intprops:
c971b7fa
PA
6395 # Code from module inttypes:
6396 # Code from module inttypes-incomplete:
88b48903
WN
6397 # Code from module isnand-nolibm:
6398 # Code from module isnanl-nolibm:
2196f55f
YQ
6399 # Code from module largefile:
6400
c0c3707f 6401 # Code from module libc-config:
49e4877c 6402 # Code from module limits-h:
8690e634 6403 # Code from module localcharset:
5df4cba6 6404 # Code from module locale:
c0c3707f 6405 # Code from module localtime-buffer:
5abebf3c 6406 # Code from module lock:
f45c62c4 6407 # Code from module lstat:
6a29c58e 6408 # Code from module malloc-posix:
98399780 6409 # Code from module malloca:
88b48903 6410 # Code from module math:
8690e634
JK
6411 # Code from module mbrtowc:
6412 # Code from module mbsinit:
6413 # Code from module mbsrtowcs:
c971b7fa
PA
6414 # Code from module memchr:
6415 # Code from module memmem:
6416 # Code from module memmem-simple:
6ec2e0f5
SDJ
6417 # Code from module mempcpy:
6418 # Code from module memrchr:
8a99096f 6419 # Code from module mkdir:
e8d8cce6 6420 # Code from module mkdtemp:
b3279b60 6421 # Code from module mkostemp:
6ec2e0f5
SDJ
6422 # Code from module msvc-inval:
6423 # Code from module msvc-nothrow:
c971b7fa 6424 # Code from module multiarch:
725e2999 6425 # Code from module netinet_in:
98399780 6426 # Code from module nocrash:
6ec2e0f5
SDJ
6427 # Code from module open:
6428 # Code from module openat:
6429 # Code from module openat-die:
6430 # Code from module openat-h:
6431 # Code from module opendir:
38ec2207 6432 # Code from module pathmax:
8424cc97 6433 # Code from module rawmemchr:
6ec2e0f5 6434 # Code from module readdir:
2196f55f 6435 # Code from module readlink:
6ec2e0f5 6436 # Code from module realloc-posix:
6a29c58e 6437 # Code from module rename:
6ec2e0f5 6438 # Code from module rewinddir:
6a29c58e
YQ
6439 # Code from module rmdir:
6440 # Code from module same-inode:
6ec2e0f5 6441 # Code from module save-cwd:
c0c3707f 6442 # Code from module scratch_buffer:
3d99e817 6443 # Code from module setenv:
5df4cba6 6444 # Code from module setlocale-null:
0750520d 6445 # Code from module signal-h:
98399780 6446 # Code from module snippet/_Noreturn:
c971b7fa
PA
6447 # Code from module snippet/arg-nonnull:
6448 # Code from module snippet/c++defs:
6449 # Code from module snippet/warn-on-use:
725e2999 6450 # Code from module socklen:
8839a007 6451 # Code from module ssize_t:
2196f55f 6452 # Code from module stat:
c0c3707f
CB
6453 # Code from module stat-time:
6454 # Code from module std-gnu11:
725e2999 6455 # Code from module stdalign:
8690e634 6456 # Code from module stdbool:
c971b7fa
PA
6457 # Code from module stddef:
6458 # Code from module stdint:
6a29c58e 6459 # Code from module stdio:
98399780 6460 # Code from module stdlib:
8424cc97 6461 # Code from module strchrnul:
6ec2e0f5 6462 # Code from module strdup-posix:
8690e634 6463 # Code from module streq:
6ec2e0f5
SDJ
6464 # Code from module strerror:
6465 # Code from module strerror-override:
5abebf3c 6466 # Code from module strerror_r-posix:
c971b7fa 6467 # Code from module string:
8690e634 6468 # Code from module strnlen1:
63ce7108
TT
6469 # Code from module strstr:
6470 # Code from module strstr-simple:
421693b0 6471 # Code from module strtok_r:
725e2999 6472 # Code from module sys_socket:
09607c9e 6473 # Code from module sys_stat:
4a626d0a 6474 # Code from module sys_time:
8839a007 6475 # Code from module sys_types:
725e2999 6476 # Code from module sys_uio:
2d8adcbd 6477 # Code from module tempname:
5abebf3c
CB
6478 # Code from module threadlib:
6479
6480
6481
09607c9e 6482 # Code from module time:
f8e27d88 6483 # Code from module time_r:
8839a007 6484 # Code from module unistd:
6ec2e0f5 6485 # Code from module unistd-safer:
3d99e817 6486 # Code from module unsetenv:
c971b7fa 6487 # Code from module update-copyright:
8690e634
JK
6488 # Code from module verify:
6489 # Code from module wchar:
6490 # Code from module wctype-h:
c0c3707f
CB
6491 # Code from module windows-mutex:
6492 # Code from module windows-once:
6493 # Code from module windows-recmutex:
6494 # Code from module windows-rwlock:
6495 # Code from module xalloc-oversized:
c971b7fa 6496
c971b7fa 6497
c0c3707f 6498am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
c971b7fa 6499
c971b7fa 6500
c0c3707f
CB
6501{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
6502$as_echo_n "checking target system type... " >&6; }
6503if ${ac_cv_target+:} false; then :
c971b7fa
PA
6504 $as_echo_n "(cached) " >&6
6505else
c0c3707f
CB
6506 if test "x$target_alias" = x; then
6507 ac_cv_target=$ac_cv_host
5e8754f9 6508else
c0c3707f
CB
6509 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
6510 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
5e8754f9 6511fi
7a6dbc2f 6512
c971b7fa 6513fi
c0c3707f
CB
6514{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
6515$as_echo "$ac_cv_target" >&6; }
6516case $ac_cv_target in
6517*-*-*) ;;
6518*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
6519esac
6520target=$ac_cv_target
6521ac_save_IFS=$IFS; IFS='-'
6522set x $ac_cv_target
6523shift
6524target_cpu=$1
6525target_vendor=$2
6526shift; shift
6527# Remember, the first character of IFS is used to create $*,
6528# except with old shells:
6529target_os=$*
6530IFS=$ac_save_IFS
6531case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
7a6dbc2f 6532
5e8754f9 6533
c0c3707f
CB
6534# The aliases save the names the user supplied, while $host etc.
6535# will get canonicalized.
6536test -n "$target_alias" &&
6537 test "$program_prefix$program_suffix$program_transform_name" = \
6538 NONENONEs,x,x, &&
6539 program_prefix=${target_alias}-
7a6dbc2f 6540
c0c3707f
CB
6541# The tests for host and target for $enable_largefile require
6542# canonical names.
7a6dbc2f 6543
5e8754f9 6544
c0c3707f
CB
6545
6546# As the $enable_largefile decision depends on --enable-plugins we must set it
6547# even in directories otherwise not depending on the $plugins option.
7a6dbc2f 6548
7a6dbc2f 6549
c0c3707f
CB
6550 maybe_plugins=no
6551 for ac_header in dlfcn.h
6552do :
6553 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
6554"
6555if test "x$ac_cv_header_dlfcn_h" = xyes; then :
6556 cat >>confdefs.h <<_ACEOF
6557#define HAVE_DLFCN_H 1
6558_ACEOF
6559 maybe_plugins=yes
c971b7fa 6560fi
c0c3707f 6561
5e8754f9 6562done
5e8754f9 6563
c0c3707f
CB
6564 for ac_header in windows.h
6565do :
6566 ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
6567"
6568if test "x$ac_cv_header_windows_h" = xyes; then :
6569 cat >>confdefs.h <<_ACEOF
6570#define HAVE_WINDOWS_H 1
6571_ACEOF
6572 maybe_plugins=yes
c971b7fa 6573fi
7a6dbc2f 6574
c0c3707f
CB
6575done
6576
6577
6578 # Check whether --enable-plugins was given.
6579if test "${enable_plugins+set}" = set; then :
6580 enableval=$enable_plugins; case "${enableval}" in
6581 no) plugins=no ;;
6582 *) plugins=yes
6583 if test "$maybe_plugins" != "yes" ; then
6584 as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
6585 fi ;;
6586 esac
6587else
6588 plugins=$maybe_plugins
5e8754f9 6589
5e8754f9 6590fi
c0c3707f
CB
6591
6592 if test "$plugins" = "yes"; then
6593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5
6594$as_echo_n "checking for library containing dlsym... " >&6; }
6595if ${ac_cv_search_dlsym+:} false; then :
c971b7fa
PA
6596 $as_echo_n "(cached) " >&6
6597else
c0c3707f
CB
6598 ac_func_search_save_LIBS=$LIBS
6599cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6600/* end confdefs.h. */
6601
6602/* Override any GCC internal prototype to avoid an error.
6603 Use char because int might match the return type of a GCC
6604 builtin and then its argument prototype would still apply. */
6605#ifdef __cplusplus
6606extern "C"
6607#endif
6608char dlsym ();
6609int
6610main ()
6611{
6612return dlsym ();
6613 ;
6614 return 0;
6615}
6616_ACEOF
6617for ac_lib in '' dl; do
6618 if test -z "$ac_lib"; then
6619 ac_res="none required"
6620 else
6621 ac_res=-l$ac_lib
6622 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5e8754f9 6623 fi
c0c3707f
CB
6624 if ac_fn_c_try_link "$LINENO"; then :
6625 ac_cv_search_dlsym=$ac_res
6626fi
6627rm -f core conftest.err conftest.$ac_objext \
6628 conftest$ac_exeext
6629 if ${ac_cv_search_dlsym+:} false; then :
6630 break
6631fi
5e8754f9 6632done
c0c3707f 6633if ${ac_cv_search_dlsym+:} false; then :
5e8754f9 6634
c0c3707f
CB
6635else
6636 ac_cv_search_dlsym=no
5e8754f9 6637fi
c0c3707f
CB
6638rm conftest.$ac_ext
6639LIBS=$ac_func_search_save_LIBS
5e8754f9 6640fi
c0c3707f
CB
6641{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5
6642$as_echo "$ac_cv_search_dlsym" >&6; }
6643ac_res=$ac_cv_search_dlsym
6644if test "$ac_res" != no; then :
6645 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6646
5e8754f9
SDJ
6647fi
6648
c0c3707f 6649 fi
5e8754f9 6650
5e8754f9 6651
c0c3707f
CB
6652case "${host}" in
6653 sparc-*-solaris*|i[3-7]86-*-solaris*)
6654 # On native 32bit sparc and ia32 solaris, large-file and procfs support
6655 # are mutually exclusive; and without procfs support, the bfd/ elf module
6656 # cannot provide certain routines such as elfcore_write_prpsinfo
6657 # or elfcore_write_prstatus. So unless the user explicitly requested
6658 # large-file support through the --enable-largefile switch, disable
6659 # large-file support in favor of procfs support.
6660 test "${target}" = "${host}" -a "x$plugins" = xno \
6661 && : ${enable_largefile="no"}
6662 ;;
5e8754f9 6663esac
5e8754f9 6664
c0c3707f
CB
6665# Check whether --enable-largefile was given.
6666if test "${enable_largefile+set}" = set; then :
6667 enableval=$enable_largefile;
5e8754f9
SDJ
6668fi
6669
c0c3707f 6670if test "$enable_largefile" != no; then
5e8754f9 6671
c0c3707f
CB
6672 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
6673$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
6674if ${ac_cv_sys_largefile_CC+:} false; then :
5e8754f9 6675 $as_echo_n "(cached) " >&6
7a6dbc2f 6676else
c0c3707f
CB
6677 ac_cv_sys_largefile_CC=no
6678 if test "$GCC" != yes; then
6679 ac_save_CC=$CC
6680 while :; do
6681 # IRIX 6.2 and later do not support large files by default,
6682 # so use the C compiler's -n32 option if that helps.
6683 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 6684/* end confdefs.h. */
c0c3707f
CB
6685#include <sys/types.h>
6686 /* Check that off_t can represent 2**63 - 1 correctly.
6687 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6688 since some C++ compilers masquerading as C compilers
6689 incorrectly reject 9223372036854775807. */
6690#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6691 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6692 && LARGE_OFF_T % 2147483647 == 1)
6693 ? 1 : -1];
c971b7fa 6694int
5e8754f9 6695main ()
c971b7fa 6696{
5e8754f9
SDJ
6697
6698 ;
6699 return 0;
c971b7fa
PA
6700}
6701_ACEOF
c0c3707f
CB
6702 if ac_fn_c_try_compile "$LINENO"; then :
6703 break
c971b7fa 6704fi
c0c3707f
CB
6705rm -f core conftest.err conftest.$ac_objext
6706 CC="$CC -n32"
6707 if ac_fn_c_try_compile "$LINENO"; then :
6708 ac_cv_sys_largefile_CC=' -n32'; break
c971b7fa 6709fi
c0c3707f
CB
6710rm -f core conftest.err conftest.$ac_objext
6711 break
6712 done
6713 CC=$ac_save_CC
6714 rm -f conftest.$ac_ext
6715 fi
d0ac1c44 6716fi
c0c3707f
CB
6717{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6718$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6719 if test "$ac_cv_sys_largefile_CC" != no; then
6720 CC=$CC$ac_cv_sys_largefile_CC
6721 fi
6722
6723 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6724$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
6725if ${ac_cv_sys_file_offset_bits+:} false; then :
5e8754f9
SDJ
6726 $as_echo_n "(cached) " >&6
6727else
c0c3707f
CB
6728 while :; do
6729 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6730/* end confdefs.h. */
c0c3707f
CB
6731#include <sys/types.h>
6732 /* Check that off_t can represent 2**63 - 1 correctly.
6733 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6734 since some C++ compilers masquerading as C compilers
6735 incorrectly reject 9223372036854775807. */
6736#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6737 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6738 && LARGE_OFF_T % 2147483647 == 1)
6739 ? 1 : -1];
5e8754f9
SDJ
6740int
6741main ()
6742{
c971b7fa 6743
5e8754f9
SDJ
6744 ;
6745 return 0;
6746}
6747_ACEOF
6748if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
6749 ac_cv_sys_file_offset_bits=no; break
6750fi
6751rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6752 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6753/* end confdefs.h. */
c0c3707f
CB
6754#define _FILE_OFFSET_BITS 64
6755#include <sys/types.h>
6756 /* Check that off_t can represent 2**63 - 1 correctly.
6757 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6758 since some C++ compilers masquerading as C compilers
6759 incorrectly reject 9223372036854775807. */
6760#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6761 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6762 && LARGE_OFF_T % 2147483647 == 1)
6763 ? 1 : -1];
5e8754f9
SDJ
6764int
6765main ()
6766{
c971b7fa 6767
5e8754f9
SDJ
6768 ;
6769 return 0;
6770}
6771_ACEOF
6772if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
6773 ac_cv_sys_file_offset_bits=64; break
6774fi
6775rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6776 ac_cv_sys_file_offset_bits=unknown
6777 break
6778done
6779fi
6780{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6781$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6782case $ac_cv_sys_file_offset_bits in #(
6783 no | unknown) ;;
6784 *)
6785cat >>confdefs.h <<_ACEOF
6786#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6787_ACEOF
6788;;
6789esac
6790rm -rf conftest*
6791 if test $ac_cv_sys_file_offset_bits = unknown; then
6792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6793$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
6794if ${ac_cv_sys_large_files+:} false; then :
6795 $as_echo_n "(cached) " >&6
5e8754f9 6796else
c0c3707f
CB
6797 while :; do
6798 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6799/* end confdefs.h. */
c0c3707f
CB
6800#include <sys/types.h>
6801 /* Check that off_t can represent 2**63 - 1 correctly.
6802 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6803 since some C++ compilers masquerading as C compilers
6804 incorrectly reject 9223372036854775807. */
6805#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6806 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6807 && LARGE_OFF_T % 2147483647 == 1)
6808 ? 1 : -1];
5e8754f9
SDJ
6809int
6810main ()
6811{
c971b7fa 6812
5e8754f9
SDJ
6813 ;
6814 return 0;
6815}
7a6dbc2f 6816_ACEOF
5e8754f9 6817if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 6818 ac_cv_sys_large_files=no; break
5e8754f9
SDJ
6819fi
6820rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f
CB
6821 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6822/* end confdefs.h. */
6823#define _LARGE_FILES 1
6824#include <sys/types.h>
6825 /* Check that off_t can represent 2**63 - 1 correctly.
6826 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6827 since some C++ compilers masquerading as C compilers
6828 incorrectly reject 9223372036854775807. */
6829#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6830 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6831 && LARGE_OFF_T % 2147483647 == 1)
6832 ? 1 : -1];
6833int
6834main ()
6835{
6836
6837 ;
6838 return 0;
6839}
6840_ACEOF
6841if ac_fn_c_try_compile "$LINENO"; then :
6842 ac_cv_sys_large_files=1; break
5e8754f9
SDJ
6843fi
6844rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f
CB
6845 ac_cv_sys_large_files=unknown
6846 break
6847done
5e8754f9 6848fi
c0c3707f
CB
6849{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6850$as_echo "$ac_cv_sys_large_files" >&6; }
6851case $ac_cv_sys_large_files in #(
6852 no | unknown) ;;
6853 *)
6854cat >>confdefs.h <<_ACEOF
6855#define _LARGE_FILES $ac_cv_sys_large_files
6856_ACEOF
6857;;
6858esac
6859rm -rf conftest*
5e8754f9 6860 fi
c0c3707f
CB
6861
6862
6863$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
6864
5e8754f9 6865fi
c971b7fa
PA
6866
6867
6868
c0c3707f
CB
6869ac_aux_dir=
6870for ac_dir in .. "$srcdir"/..; do
6871 if test -f "$ac_dir/install-sh"; then
6872 ac_aux_dir=$ac_dir
6873 ac_install_sh="$ac_aux_dir/install-sh -c"
6874 break
6875 elif test -f "$ac_dir/install.sh"; then
6876 ac_aux_dir=$ac_dir
6877 ac_install_sh="$ac_aux_dir/install.sh -c"
6878 break
6879 elif test -f "$ac_dir/shtool"; then
6880 ac_aux_dir=$ac_dir
6881 ac_install_sh="$ac_aux_dir/shtool install -c"
6882 break
6883 fi
6884done
6885if test -z "$ac_aux_dir"; then
6886 as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5
6887fi
6888
6889# These three variables are undocumented and unsupported,
6890# and are intended to be withdrawn in a future Autoconf release.
6891# They can cause serious problems if a builder's source tree is in a directory
6892# whose full name contains unusual characters.
6893ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
6894ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
6895ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906 # Check whether --enable-cross-guesses was given.
6907if test "${enable_cross_guesses+set}" = set; then :
6908 enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
6909 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
6910$as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
6911 enableval=conservative
6912 fi
6913 gl_cross_guesses="$enableval"
6914else
6915 gl_cross_guesses=conservative
6916fi
6917
6918 if test $gl_cross_guesses = risky; then
6919 gl_cross_guess_normal="guessing yes"
6920 gl_cross_guess_inverted="guessing no"
6921 else
6922 gl_cross_guess_normal="guessing no"
6923 gl_cross_guess_inverted="guessing yes"
6924 fi
6925 LIBC_FATAL_STDERR_=1
6926 export LIBC_FATAL_STDERR_
6927
5df4cba6 6928
c0c3707f
CB
6929ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
6930if test "x$ac_cv_type_size_t" = xyes; then :
6931
6932else
6933
6934cat >>confdefs.h <<_ACEOF
6935#define size_t unsigned int
6936_ACEOF
6937
6938fi
6939
6940# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
6941# for constant arguments. Useless!
6942{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
6943$as_echo_n "checking for working alloca.h... " >&6; }
6944if ${ac_cv_working_alloca_h+:} false; then :
6945 $as_echo_n "(cached) " >&6
6946else
6947 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6948/* end confdefs.h. */
6949#include <alloca.h>
5e8754f9
SDJ
6950int
6951main ()
6952{
c0c3707f
CB
6953char *p = (char *) alloca (2 * sizeof (int));
6954 if (p) return 0;
5e8754f9
SDJ
6955 ;
6956 return 0;
6957}
6958_ACEOF
c0c3707f
CB
6959if ac_fn_c_try_link "$LINENO"; then :
6960 ac_cv_working_alloca_h=yes
6961else
6962 ac_cv_working_alloca_h=no
5e8754f9 6963fi
c0c3707f
CB
6964rm -f core conftest.err conftest.$ac_objext \
6965 conftest$ac_exeext conftest.$ac_ext
5e8754f9 6966fi
c0c3707f
CB
6967{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
6968$as_echo "$ac_cv_working_alloca_h" >&6; }
6969if test $ac_cv_working_alloca_h = yes; then
c971b7fa 6970
c0c3707f 6971$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
c971b7fa 6972
c0c3707f 6973fi
d0ac1c44 6974
c0c3707f
CB
6975{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
6976$as_echo_n "checking for alloca... " >&6; }
6977if ${ac_cv_func_alloca_works+:} false; then :
5e8754f9
SDJ
6978 $as_echo_n "(cached) " >&6
6979else
6980 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6981/* end confdefs.h. */
c0c3707f
CB
6982#ifdef __GNUC__
6983# define alloca __builtin_alloca
6984#else
6985# ifdef _MSC_VER
6986# include <malloc.h>
6987# define alloca _alloca
6988# else
6989# ifdef HAVE_ALLOCA_H
6990# include <alloca.h>
6991# else
6992# ifdef _AIX
6993 #pragma alloca
6994# else
6995# ifndef alloca /* predefined by HP cc +Olibcalls */
6996void *alloca (size_t);
6997# endif
6998# endif
6999# endif
7000# endif
7001#endif
d0ac1c44 7002
5e8754f9
SDJ
7003int
7004main ()
7005{
c0c3707f
CB
7006char *p = (char *) alloca (1);
7007 if (p) return 0;
5e8754f9
SDJ
7008 ;
7009 return 0;
7010}
7011_ACEOF
c0c3707f
CB
7012if ac_fn_c_try_link "$LINENO"; then :
7013 ac_cv_func_alloca_works=yes
7014else
7015 ac_cv_func_alloca_works=no
5e8754f9 7016fi
c0c3707f
CB
7017rm -f core conftest.err conftest.$ac_objext \
7018 conftest$ac_exeext conftest.$ac_ext
7019fi
7020{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
7021$as_echo "$ac_cv_func_alloca_works" >&6; }
7a6dbc2f 7022
c0c3707f 7023if test $ac_cv_func_alloca_works = yes; then
7a6dbc2f 7024
c0c3707f 7025$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
7a6dbc2f 7026
5e8754f9 7027else
c0c3707f
CB
7028 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
7029# that cause trouble. Some versions do not even contain alloca or
7030# contain a buggy version. If you still want to use their alloca,
7031# use ar to extract alloca.o from them instead of compiling alloca.c.
c971b7fa
PA
7032
7033
7a6dbc2f 7034
73cc7272
TT
7035
7036
c0c3707f 7037ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
73cc7272 7038
c0c3707f 7039$as_echo "#define C_ALLOCA 1" >>confdefs.h
73cc7272
TT
7040
7041
c0c3707f
CB
7042{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
7043$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
7044if ${ac_cv_os_cray+:} false; then :
7045 $as_echo_n "(cached) " >&6
7046else
7047 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7048/* end confdefs.h. */
7049#if defined CRAY && ! defined CRAY2
7050webecray
7051#else
7052wenotbecray
7053#endif
73cc7272 7054
73cc7272 7055_ACEOF
c0c3707f
CB
7056if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7057 $EGREP "webecray" >/dev/null 2>&1; then :
7058 ac_cv_os_cray=yes
7059else
7060 ac_cv_os_cray=no
73cc7272 7061fi
c0c3707f 7062rm -f conftest*
73cc7272 7063
c0c3707f
CB
7064fi
7065{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
7066$as_echo "$ac_cv_os_cray" >&6; }
7067if test $ac_cv_os_cray = yes; then
7068 for ac_func in _getb67 GETB67 getb67; do
7069 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
7070ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
7071if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
73cc7272 7072
c0c3707f
CB
7073cat >>confdefs.h <<_ACEOF
7074#define CRAY_STACKSEG_END $ac_func
7075_ACEOF
73cc7272 7076
c0c3707f
CB
7077 break
7078fi
73cc7272 7079
c0c3707f 7080 done
73cc7272
TT
7081fi
7082
c0c3707f
CB
7083{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
7084$as_echo_n "checking stack direction for C alloca... " >&6; }
7085if ${ac_cv_c_stack_direction+:} false; then :
73cc7272
TT
7086 $as_echo_n "(cached) " >&6
7087else
c0c3707f
CB
7088 if test "$cross_compiling" = yes; then :
7089 ac_cv_c_stack_direction=0
7090else
7091 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7092/* end confdefs.h. */
c0c3707f
CB
7093$ac_includes_default
7094int
7095find_stack_direction (int *addr, int depth)
7096{
7097 int dir, dummy = 0;
7098 if (! addr)
7099 addr = &dummy;
7100 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
7101 dir = depth ? find_stack_direction (addr, depth - 1) : 0;
7102 return dir + dummy;
7103}
73cc7272 7104
73cc7272 7105int
c0c3707f 7106main (int argc, char **argv)
73cc7272 7107{
c0c3707f 7108 return find_stack_direction (0, argc + !argv + 20) < 0;
73cc7272
TT
7109}
7110_ACEOF
c0c3707f
CB
7111if ac_fn_c_try_run "$LINENO"; then :
7112 ac_cv_c_stack_direction=1
7113else
7114 ac_cv_c_stack_direction=-1
73cc7272 7115fi
c0c3707f
CB
7116rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7117 conftest.$ac_objext conftest.beam conftest.$ac_ext
73cc7272 7118fi
73cc7272 7119
73cc7272 7120fi
c0c3707f
CB
7121{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
7122$as_echo "$ac_cv_c_stack_direction" >&6; }
7123cat >>confdefs.h <<_ACEOF
7124#define STACK_DIRECTION $ac_cv_c_stack_direction
7125_ACEOF
7126
73cc7272
TT
7127
7128fi
7129
73cc7272 7130
c0c3707f
CB
7131 GNULIB_INET_NTOP=0;
7132 GNULIB_INET_PTON=0;
7133 HAVE_DECL_INET_NTOP=1;
7134 HAVE_DECL_INET_PTON=1;
7135 REPLACE_INET_NTOP=0;
7136 REPLACE_INET_PTON=0;
73cc7272 7137
73cc7272 7138
c0c3707f
CB
7139
7140
7141 for ac_header in $ac_header_list
7142do :
7143 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7144ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7145"
7146if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7147 cat >>confdefs.h <<_ACEOF
7148#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7149_ACEOF
7150
73cc7272
TT
7151fi
7152
c0c3707f 7153done
73cc7272 7154
c0c3707f
CB
7155
7156
7157
7158
7159 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
7160$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
7161if ${gl_cv_have_include_next+:} false; then :
73cc7272
TT
7162 $as_echo_n "(cached) " >&6
7163else
c0c3707f
CB
7164 rm -rf conftestd1a conftestd1b conftestd2
7165 mkdir conftestd1a conftestd1b conftestd2
7166 cat <<EOF > conftestd1a/conftest.h
7167#define DEFINED_IN_CONFTESTD1
7168#include_next <conftest.h>
7169#ifdef DEFINED_IN_CONFTESTD2
7170int foo;
7171#else
7172#error "include_next doesn't work"
7173#endif
7174EOF
7175 cat <<EOF > conftestd1b/conftest.h
7176#define DEFINED_IN_CONFTESTD1
7177#include <stdio.h>
7178#include_next <conftest.h>
7179#ifdef DEFINED_IN_CONFTESTD2
7180int foo;
7181#else
7182#error "include_next doesn't work"
7183#endif
7184EOF
7185 cat <<EOF > conftestd2/conftest.h
7186#ifndef DEFINED_IN_CONFTESTD1
7187#error "include_next test doesn't work"
7188#endif
7189#define DEFINED_IN_CONFTESTD2
7190EOF
7191 gl_save_CPPFLAGS="$CPPFLAGS"
7192 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
7193 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7194/* end confdefs.h. */
c0c3707f 7195#include <conftest.h>
73cc7272 7196_ACEOF
c0c3707f
CB
7197if ac_fn_c_try_compile "$LINENO"; then :
7198 gl_cv_have_include_next=yes
7199else
7200 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
7201 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7202/* end confdefs.h. */
7203#include <conftest.h>
7204_ACEOF
7205if ac_fn_c_try_compile "$LINENO"; then :
7206 gl_cv_have_include_next=buggy
7207else
7208 gl_cv_have_include_next=no
73cc7272 7209fi
c0c3707f
CB
7210rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7211
73cc7272 7212fi
c0c3707f
CB
7213rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7214 CPPFLAGS="$gl_save_CPPFLAGS"
7215 rm -rf conftestd1a conftestd1b conftestd2
7216
73cc7272 7217fi
c0c3707f
CB
7218{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
7219$as_echo "$gl_cv_have_include_next" >&6; }
7220 PRAGMA_SYSTEM_HEADER=
7221 if test $gl_cv_have_include_next = yes; then
7222 INCLUDE_NEXT=include_next
7223 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7224 if test -n "$GCC"; then
7225 PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
7226 fi
7227 else
7228 if test $gl_cv_have_include_next = buggy; then
7229 INCLUDE_NEXT=include
7230 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7231 else
7232 INCLUDE_NEXT=include
7233 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
7234 fi
73cc7272
TT
7235 fi
7236
73cc7272 7237
73cc7272 7238
c0c3707f
CB
7239 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
7240$as_echo_n "checking whether system header files limit the line length... " >&6; }
7241if ${gl_cv_pragma_columns+:} false; then :
73cc7272
TT
7242 $as_echo_n "(cached) " >&6
7243else
c0c3707f 7244 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7245/* end confdefs.h. */
73cc7272 7246
c0c3707f
CB
7247#ifdef __TANDEM
7248choke me
7249#endif
73cc7272 7250
73cc7272 7251_ACEOF
c0c3707f
CB
7252if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7253 $EGREP "choke me" >/dev/null 2>&1; then :
7254 gl_cv_pragma_columns=yes
7255else
7256 gl_cv_pragma_columns=no
73cc7272 7257fi
c0c3707f 7258rm -f conftest*
73cc7272 7259
73cc7272
TT
7260
7261fi
c0c3707f
CB
7262{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
7263$as_echo "$gl_cv_pragma_columns" >&6; }
7264 if test $gl_cv_pragma_columns = yes; then
7265 PRAGMA_COLUMNS="#pragma COLUMNS 10000"
7266 else
7267 PRAGMA_COLUMNS=
7268 fi
73cc7272
TT
7269
7270
7271
73cc7272 7272
73cc7272
TT
7273
7274
c0c3707f
CB
7275 if test $ac_cv_header_features_h = yes; then
7276 HAVE_FEATURES_H=1
7277 else
7278 HAVE_FEATURES_H=0
7279 fi
73cc7272 7280
7a6dbc2f
SDJ
7281
7282
7283
7284
c0c3707f
CB
7285 if test $ac_cv_header_sys_socket_h = no; then
7286 for ac_header in ws2tcpip.h
7287do :
7288 ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
7289if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
7290 cat >>confdefs.h <<_ACEOF
7291#define HAVE_WS2TCPIP_H 1
7292_ACEOF
7a6dbc2f 7293
c0c3707f 7294fi
7a6dbc2f 7295
c0c3707f 7296done
7a6dbc2f 7297
c0c3707f 7298 fi
7a6dbc2f 7299
c0c3707f
CB
7300{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7301$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7302if test -z "$MKDIR_P"; then
7303 if ${ac_cv_path_mkdir+:} false; then :
7304 $as_echo_n "(cached) " >&6
5e8754f9 7305else
c0c3707f
CB
7306 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7307for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7308do
7309 IFS=$as_save_IFS
7310 test -z "$as_dir" && as_dir=.
7311 for ac_prog in mkdir gmkdir; do
7312 for ac_exec_ext in '' $ac_executable_extensions; do
7313 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7314 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7315 'mkdir (GNU coreutils) '* | \
7316 'mkdir (coreutils) '* | \
7317 'mkdir (fileutils) '4.1*)
7318 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7319 break 3;;
7320 esac
7321 done
7322 done
7323 done
7324IFS=$as_save_IFS
7a6dbc2f 7325
5e8754f9 7326fi
7a6dbc2f 7327
c0c3707f
CB
7328 test -d ./--version && rmdir ./--version
7329 if test "${ac_cv_path_mkdir+set}" = set; then
7330 MKDIR_P="$ac_cv_path_mkdir -p"
7331 else
7332 # As a last resort, use the slow shell script. Don't cache a
7333 # value for MKDIR_P within a source directory, because that will
7334 # break other packages using the cache if that directory is
7335 # removed, or if the value is a relative name.
7336 MKDIR_P="$ac_install_sh -d"
7337 fi
5e8754f9 7338fi
c0c3707f
CB
7339{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7340$as_echo "$MKDIR_P" >&6; }
7a6dbc2f 7341
5e8754f9 7342
c0c3707f
CB
7343 GNULIB__EXIT=0;
7344 GNULIB_ATOLL=0;
7345 GNULIB_CALLOC_POSIX=0;
7346 GNULIB_CANONICALIZE_FILE_NAME=0;
7347 GNULIB_GETLOADAVG=0;
7348 GNULIB_GETSUBOPT=0;
7349 GNULIB_GRANTPT=0;
7350 GNULIB_MALLOC_POSIX=0;
7351 GNULIB_MBTOWC=0;
7352 GNULIB_MKDTEMP=0;
7353 GNULIB_MKOSTEMP=0;
7354 GNULIB_MKOSTEMPS=0;
7355 GNULIB_MKSTEMP=0;
7356 GNULIB_MKSTEMPS=0;
7357 GNULIB_POSIX_OPENPT=0;
7358 GNULIB_PTSNAME=0;
7359 GNULIB_PTSNAME_R=0;
7360 GNULIB_PUTENV=0;
7361 GNULIB_QSORT_R=0;
7362 GNULIB_RANDOM=0;
7363 GNULIB_RANDOM_R=0;
7364 GNULIB_REALLOCARRAY=0;
7365 GNULIB_REALLOC_POSIX=0;
7366 GNULIB_REALPATH=0;
7367 GNULIB_RPMATCH=0;
7368 GNULIB_SECURE_GETENV=0;
7369 GNULIB_SETENV=0;
7370 GNULIB_STRTOD=0;
7371 GNULIB_STRTOLD=0;
7372 GNULIB_STRTOLL=0;
7373 GNULIB_STRTOULL=0;
7374 GNULIB_SYSTEM_POSIX=0;
7375 GNULIB_UNLOCKPT=0;
7376 GNULIB_UNSETENV=0;
7377 GNULIB_WCTOMB=0;
7378 HAVE__EXIT=1;
7379 HAVE_ATOLL=1;
7380 HAVE_CANONICALIZE_FILE_NAME=1;
7381 HAVE_DECL_GETLOADAVG=1;
7382 HAVE_GETSUBOPT=1;
7383 HAVE_GRANTPT=1;
7384 HAVE_INITSTATE=1;
7385 HAVE_DECL_INITSTATE=1;
7386 HAVE_MBTOWC=1;
7387 HAVE_MKDTEMP=1;
7388 HAVE_MKOSTEMP=1;
7389 HAVE_MKOSTEMPS=1;
7390 HAVE_MKSTEMP=1;
7391 HAVE_MKSTEMPS=1;
7392 HAVE_POSIX_OPENPT=1;
7393 HAVE_PTSNAME=1;
7394 HAVE_PTSNAME_R=1;
7395 HAVE_QSORT_R=1;
7396 HAVE_RANDOM=1;
7397 HAVE_RANDOM_H=1;
7398 HAVE_RANDOM_R=1;
7399 HAVE_REALLOCARRAY=1;
7400 HAVE_REALPATH=1;
7401 HAVE_RPMATCH=1;
7402 HAVE_SECURE_GETENV=1;
7403 HAVE_SETENV=1;
7404 HAVE_DECL_SETENV=1;
7405 HAVE_SETSTATE=1;
7406 HAVE_DECL_SETSTATE=1;
7407 HAVE_STRTOD=1;
7408 HAVE_STRTOLD=1;
7409 HAVE_STRTOLL=1;
7410 HAVE_STRTOULL=1;
7411 HAVE_STRUCT_RANDOM_DATA=1;
7412 HAVE_SYS_LOADAVG_H=0;
7413 HAVE_UNLOCKPT=1;
7414 HAVE_DECL_UNSETENV=1;
7415 REPLACE_CALLOC=0;
7416 REPLACE_CANONICALIZE_FILE_NAME=0;
7417 REPLACE_INITSTATE=0;
7418 REPLACE_MALLOC=0;
7419 REPLACE_MBTOWC=0;
7420 REPLACE_MKSTEMP=0;
7421 REPLACE_PTSNAME=0;
7422 REPLACE_PTSNAME_R=0;
7423 REPLACE_PUTENV=0;
7424 REPLACE_QSORT_R=0;
7425 REPLACE_RANDOM=0;
7426 REPLACE_RANDOM_R=0;
7427 REPLACE_REALLOC=0;
7428 REPLACE_REALPATH=0;
7429 REPLACE_SETENV=0;
7430 REPLACE_SETSTATE=0;
7431 REPLACE_STRTOD=0;
7432 REPLACE_STRTOLD=0;
7433 REPLACE_UNSETENV=0;
7434 REPLACE_WCTOMB=0;
7a6dbc2f 7435
7a6dbc2f 7436
98399780 7437
98399780 7438
c0c3707f
CB
7439 for ac_func in $ac_func_list
7440do :
7441 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
7442ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
7443if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
7444 cat >>confdefs.h <<_ACEOF
7445#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
7446_ACEOF
472fa5ee 7447
c0c3707f
CB
7448fi
7449done
472fa5ee
SM
7450
7451
7452
7453
7454
7455
7456
7457
7458
c0c3707f
CB
7459 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
7460$as_echo_n "checking whether // is distinct from /... " >&6; }
7461if ${gl_cv_double_slash_root+:} false; then :
7462 $as_echo_n "(cached) " >&6
5e8754f9 7463else
c0c3707f
CB
7464 if test x"$cross_compiling" = xyes ; then
7465 # When cross-compiling, there is no way to tell whether // is special
7466 # short of a list of hosts. However, the only known hosts to date
7467 # that have a distinct // are Apollo DomainOS (too old to port to),
7468 # Cygwin, and z/OS. If anyone knows of another system for which // has
7469 # special semantics and is distinct from /, please report it to
7470 # <bug-gnulib@gnu.org>.
7471 case $host in
7472 *-cygwin | i370-ibm-openedition)
7473 gl_cv_double_slash_root=yes ;;
7474 *)
7475 # Be optimistic and assume that / and // are the same when we
7476 # don't know.
7477 gl_cv_double_slash_root='unknown, assuming no' ;;
7478 esac
7479 else
7480 set x `ls -di / // 2>/dev/null`
7481 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
7482 gl_cv_double_slash_root=no
7483 else
7484 gl_cv_double_slash_root=yes
7485 fi
7486 fi
5e8754f9 7487fi
c0c3707f
CB
7488{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
7489$as_echo "$gl_cv_double_slash_root" >&6; }
7490 if test "$gl_cv_double_slash_root" = yes; then
472fa5ee 7491
c0c3707f 7492$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
472fa5ee 7493
c0c3707f 7494 fi
472fa5ee
SM
7495
7496
472fa5ee 7497
c0c3707f
CB
7498
7499
7500 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
7501$as_echo_n "checking whether realpath works... " >&6; }
7502if ${gl_cv_func_realpath_works+:} false; then :
5e8754f9
SDJ
7503 $as_echo_n "(cached) " >&6
7504else
c0c3707f
CB
7505
7506 touch conftest.a
7507 mkdir conftest.d
7508 if test "$cross_compiling" = yes; then :
7509 case "$host_os" in
7510 # Guess yes on glibc systems.
7511 *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
7512 # Guess yes on musl systems.
7513 *-musl*) gl_cv_func_realpath_works="guessing yes" ;;
7514 # Guess no on native Windows.
7515 mingw*) gl_cv_func_realpath_works="guessing no" ;;
7516 # If we don't know, obey --enable-cross-guesses.
7517 *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
7518 esac
7519
5e8754f9
SDJ
7520else
7521 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7522/* end confdefs.h. */
c0c3707f
CB
7523
7524
7525
7526#include <stdlib.h>
7527#if defined __MACH__ && defined __APPLE__
7528/* Avoid a crash on Mac OS X. */
7529#include <mach/mach.h>
7530#include <mach/mach_error.h>
7531#include <mach/thread_status.h>
7532#include <mach/exception.h>
7533#include <mach/task.h>
7534#include <pthread.h>
7535/* The exception port on which our thread listens. */
7536static mach_port_t our_exception_port;
7537/* The main function of the thread listening for exceptions of type
7538 EXC_BAD_ACCESS. */
7539static void *
7540mach_exception_thread (void *arg)
5e8754f9 7541{
c0c3707f
CB
7542 /* Buffer for a message to be received. */
7543 struct {
7544 mach_msg_header_t head;
7545 mach_msg_body_t msgh_body;
7546 char data[1024];
7547 } msg;
7548 mach_msg_return_t retval;
7549 /* Wait for a message on the exception port. */
7550 retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
7551 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
7552 if (retval != MACH_MSG_SUCCESS)
7553 abort ();
7554 exit (1);
7555}
7556static void
7557nocrash_init (void)
7558{
7559 mach_port_t self = mach_task_self ();
7560 /* Allocate a port on which the thread shall listen for exceptions. */
7561 if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
7562 == KERN_SUCCESS) {
7563 /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
7564 if (mach_port_insert_right (self, our_exception_port, our_exception_port,
7565 MACH_MSG_TYPE_MAKE_SEND)
7566 == KERN_SUCCESS) {
7567 /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
7568 for us. */
7569 exception_mask_t mask = EXC_MASK_BAD_ACCESS;
7570 /* Create the thread listening on the exception port. */
7571 pthread_attr_t attr;
7572 pthread_t thread;
7573 if (pthread_attr_init (&attr) == 0
7574 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
7575 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
7576 pthread_attr_destroy (&attr);
7577 /* Replace the exception port info for these exceptions with our own.
7578 Note that we replace the exception port for the entire task, not only
7579 for a particular thread. This has the effect that when our exception
7580 port gets the message, the thread specific exception port has already
7581 been asked, and we don't need to bother about it.
7582 See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
7583 task_set_exception_ports (self, mask, our_exception_port,
7584 EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
7585 }
7586 }
7587 }
7588}
7589#elif defined _WIN32 && ! defined __CYGWIN__
7590/* Avoid a crash on native Windows. */
7591#define WIN32_LEAN_AND_MEAN
7592#include <windows.h>
7593#include <winerror.h>
7594static LONG WINAPI
7595exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
7596{
7597 switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
7598 {
7599 case EXCEPTION_ACCESS_VIOLATION:
7600 case EXCEPTION_IN_PAGE_ERROR:
7601 case EXCEPTION_STACK_OVERFLOW:
7602 case EXCEPTION_GUARD_PAGE:
7603 case EXCEPTION_PRIV_INSTRUCTION:
7604 case EXCEPTION_ILLEGAL_INSTRUCTION:
7605 case EXCEPTION_DATATYPE_MISALIGNMENT:
7606 case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
7607 case EXCEPTION_NONCONTINUABLE_EXCEPTION:
7608 exit (1);
7609 }
7610 return EXCEPTION_CONTINUE_SEARCH;
7611}
7612static void
7613nocrash_init (void)
7614{
7615 SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
7616}
7617#else
7618/* Avoid a crash on POSIX systems. */
7619#include <signal.h>
7620#include <unistd.h>
7621/* A POSIX signal handler. */
7622static void
7623exception_handler (int sig)
7624{
7625 _exit (1);
7626}
7627static void
7628nocrash_init (void)
7629{
7630#ifdef SIGSEGV
7631 signal (SIGSEGV, exception_handler);
7632#endif
7633#ifdef SIGBUS
7634 signal (SIGBUS, exception_handler);
7635#endif
5e8754f9 7636}
c0c3707f
CB
7637#endif
7638
7639 #include <stdlib.h>
7640 #include <string.h>
472fa5ee 7641
5e8754f9 7642int
c0c3707f 7643main ()
5e8754f9 7644{
c0c3707f
CB
7645
7646 int result = 0;
7647 {
7648 char *name = realpath ("conftest.a", NULL);
7649 if (!(name && *name == '/'))
7650 result |= 1;
7651 free (name);
7652 }
7653 {
7654 char *name = realpath ("conftest.b/../conftest.a", NULL);
7655 if (name != NULL)
7656 result |= 2;
7657 free (name);
7658 }
7659 {
7660 char *name = realpath ("conftest.a/", NULL);
7661 if (name != NULL)
7662 result |= 4;
7663 free (name);
7664 }
7665 {
7666 char *name1 = realpath (".", NULL);
7667 char *name2 = realpath ("conftest.d//./..", NULL);
7668 if (! name1 || ! name2 || strcmp (name1, name2))
7669 result |= 8;
7670 free (name1);
7671 free (name2);
7672 }
7673 return result;
7674
7675 ;
7676 return 0;
5e8754f9 7677}
c0c3707f 7678
5e8754f9
SDJ
7679_ACEOF
7680if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 7681 gl_cv_func_realpath_works=yes
5e8754f9 7682else
c0c3707f 7683 gl_cv_func_realpath_works=no
5e8754f9
SDJ
7684fi
7685rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7686 conftest.$ac_objext conftest.beam conftest.$ac_ext
7687fi
472fa5ee 7688
c0c3707f 7689 rm -rf conftest.a conftest.d
98399780 7690
5e8754f9 7691fi
c0c3707f
CB
7692{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
7693$as_echo "$gl_cv_func_realpath_works" >&6; }
7694 case "$gl_cv_func_realpath_works" in
7695 *yes)
98399780 7696
c0c3707f 7697$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
98399780 7698
c0c3707f
CB
7699 ;;
7700 esac
725e2999
JB
7701
7702
725e2999 7703
725e2999 7704
725e2999
JB
7705
7706
7707
7708
7709
7710
7711
c0c3707f
CB
7712 GNULIB_ACCESS=0;
7713 GNULIB_CHDIR=0;
7714 GNULIB_CHOWN=0;
7715 GNULIB_CLOSE=0;
7716 GNULIB_COPY_FILE_RANGE=0;
7717 GNULIB_DUP=0;
7718 GNULIB_DUP2=0;
7719 GNULIB_DUP3=0;
7720 GNULIB_ENVIRON=0;
7721 GNULIB_EUIDACCESS=0;
7722 GNULIB_FACCESSAT=0;
7723 GNULIB_FCHDIR=0;
7724 GNULIB_FCHOWNAT=0;
7725 GNULIB_FDATASYNC=0;
7726 GNULIB_FSYNC=0;
7727 GNULIB_FTRUNCATE=0;
7728 GNULIB_GETCWD=0;
7729 GNULIB_GETDOMAINNAME=0;
7730 GNULIB_GETDTABLESIZE=0;
7731 GNULIB_GETGROUPS=0;
7732 GNULIB_GETHOSTNAME=0;
7733 GNULIB_GETLOGIN=0;
7734 GNULIB_GETLOGIN_R=0;
5df4cba6 7735 GNULIB_GETOPT_POSIX=0;
c0c3707f
CB
7736 GNULIB_GETPAGESIZE=0;
7737 GNULIB_GETPASS=0;
7738 GNULIB_GETUSERSHELL=0;
7739 GNULIB_GROUP_MEMBER=0;
7740 GNULIB_ISATTY=0;
7741 GNULIB_LCHOWN=0;
7742 GNULIB_LINK=0;
7743 GNULIB_LINKAT=0;
7744 GNULIB_LSEEK=0;
7745 GNULIB_PIPE=0;
7746 GNULIB_PIPE2=0;
7747 GNULIB_PREAD=0;
7748 GNULIB_PWRITE=0;
7749 GNULIB_READ=0;
7750 GNULIB_READLINK=0;
7751 GNULIB_READLINKAT=0;
7752 GNULIB_RMDIR=0;
7753 GNULIB_SETHOSTNAME=0;
7754 GNULIB_SLEEP=0;
7755 GNULIB_SYMLINK=0;
7756 GNULIB_SYMLINKAT=0;
7757 GNULIB_TRUNCATE=0;
7758 GNULIB_TTYNAME_R=0;
7759 GNULIB_UNISTD_H_NONBLOCKING=0;
7760 GNULIB_UNISTD_H_SIGPIPE=0;
7761 GNULIB_UNLINK=0;
7762 GNULIB_UNLINKAT=0;
7763 GNULIB_USLEEP=0;
7764 GNULIB_WRITE=0;
7765 HAVE_CHOWN=1;
7766 HAVE_COPY_FILE_RANGE=1;
7767 HAVE_DUP2=1;
7768 HAVE_DUP3=1;
7769 HAVE_EUIDACCESS=1;
7770 HAVE_FACCESSAT=1;
7771 HAVE_FCHDIR=1;
7772 HAVE_FCHOWNAT=1;
7773 HAVE_FDATASYNC=1;
7774 HAVE_FSYNC=1;
7775 HAVE_FTRUNCATE=1;
7776 HAVE_GETDTABLESIZE=1;
7777 HAVE_GETGROUPS=1;
7778 HAVE_GETHOSTNAME=1;
7779 HAVE_GETLOGIN=1;
7780 HAVE_GETPAGESIZE=1;
7781 HAVE_GETPASS=1;
7782 HAVE_GROUP_MEMBER=1;
7783 HAVE_LCHOWN=1;
7784 HAVE_LINK=1;
7785 HAVE_LINKAT=1;
7786 HAVE_PIPE=1;
7787 HAVE_PIPE2=1;
7788 HAVE_PREAD=1;
7789 HAVE_PWRITE=1;
7790 HAVE_READLINK=1;
7791 HAVE_READLINKAT=1;
7792 HAVE_SETHOSTNAME=1;
7793 HAVE_SLEEP=1;
7794 HAVE_SYMLINK=1;
7795 HAVE_SYMLINKAT=1;
7796 HAVE_UNLINKAT=1;
7797 HAVE_USLEEP=1;
7798 HAVE_DECL_ENVIRON=1;
7799 HAVE_DECL_FCHDIR=1;
7800 HAVE_DECL_FDATASYNC=1;
7801 HAVE_DECL_GETDOMAINNAME=1;
7802 HAVE_DECL_GETLOGIN=1;
7803 HAVE_DECL_GETLOGIN_R=1;
7804 HAVE_DECL_GETPAGESIZE=1;
7805 HAVE_DECL_GETUSERSHELL=1;
7806 HAVE_DECL_SETHOSTNAME=1;
7807 HAVE_DECL_TRUNCATE=1;
7808 HAVE_DECL_TTYNAME_R=1;
7809 HAVE_OS_H=0;
7810 HAVE_SYS_PARAM_H=0;
7811 REPLACE_ACCESS=0;
7812 REPLACE_CHOWN=0;
7813 REPLACE_CLOSE=0;
7814 REPLACE_DUP=0;
7815 REPLACE_DUP2=0;
7816 REPLACE_FACCESSAT=0;
7817 REPLACE_FCHOWNAT=0;
7818 REPLACE_FTRUNCATE=0;
7819 REPLACE_GETCWD=0;
7820 REPLACE_GETDOMAINNAME=0;
7821 REPLACE_GETDTABLESIZE=0;
7822 REPLACE_GETLOGIN_R=0;
7823 REPLACE_GETGROUPS=0;
7824 REPLACE_GETPAGESIZE=0;
7825 REPLACE_GETPASS=0;
7826 REPLACE_ISATTY=0;
7827 REPLACE_LCHOWN=0;
7828 REPLACE_LINK=0;
7829 REPLACE_LINKAT=0;
7830 REPLACE_LSEEK=0;
7831 REPLACE_PREAD=0;
7832 REPLACE_PWRITE=0;
7833 REPLACE_READ=0;
7834 REPLACE_READLINK=0;
7835 REPLACE_READLINKAT=0;
7836 REPLACE_RMDIR=0;
7837 REPLACE_SLEEP=0;
7838 REPLACE_SYMLINK=0;
7839 REPLACE_SYMLINKAT=0;
7840 REPLACE_TRUNCATE=0;
7841 REPLACE_TTYNAME_R=0;
7842 REPLACE_UNLINK=0;
7843 REPLACE_UNLINKAT=0;
7844 REPLACE_USLEEP=0;
7845 REPLACE_WRITE=0;
7846 UNISTD_H_HAVE_WINSOCK2_H=0;
7847 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
725e2999 7848
725e2999 7849
725e2999
JB
7850
7851
7852
725e2999 7853
725e2999 7854
725e2999
JB
7855
7856
c0c3707f
CB
7857
7858
7859 if test $ac_cv_func__set_invalid_parameter_handler = yes; then
7860 HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
7861
7862$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
7863
725e2999 7864 else
c0c3707f 7865 HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
725e2999
JB
7866 fi
7867
7868
7869
7870
7871
c0c3707f
CB
7872 GNULIB_OPENDIR=0;
7873 GNULIB_READDIR=0;
7874 GNULIB_REWINDDIR=0;
7875 GNULIB_CLOSEDIR=0;
7876 GNULIB_DIRFD=0;
7877 GNULIB_FDOPENDIR=0;
7878 GNULIB_SCANDIR=0;
7879 GNULIB_ALPHASORT=0;
7880 HAVE_OPENDIR=1;
7881 HAVE_READDIR=1;
7882 HAVE_REWINDDIR=1;
7883 HAVE_CLOSEDIR=1;
7884 HAVE_DECL_DIRFD=1;
7885 HAVE_DECL_FDOPENDIR=1;
7886 HAVE_FDOPENDIR=1;
7887 HAVE_SCANDIR=1;
7888 HAVE_ALPHASORT=1;
7889 REPLACE_OPENDIR=0;
7890 REPLACE_CLOSEDIR=0;
7891 REPLACE_DIRFD=0;
7892 REPLACE_FDOPENDIR=0;
725e2999
JB
7893
7894
7895
7896
725e2999
JB
7897
7898
7899
7900
725e2999
JB
7901
7902
c0c3707f
CB
7903 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
7904$as_echo_n "checking if environ is properly declared... " >&6; }
7905if ${gt_cv_var_environ_declaration+:} false; then :
725e2999
JB
7906 $as_echo_n "(cached) " >&6
7907else
c0c3707f
CB
7908 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7909/* end confdefs.h. */
7910#if HAVE_UNISTD_H
7911 #include <unistd.h>
7912 #endif
7913 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
7914 #include <stdlib.h>
725e2999 7915
c0c3707f
CB
7916 extern struct { int foo; } environ;
7917int
7918main ()
7919{
7920environ.foo = 1;
7921 ;
7922 return 0;
7923}
7924_ACEOF
7925if ac_fn_c_try_compile "$LINENO"; then :
7926 gt_cv_var_environ_declaration=no
7927else
7928 gt_cv_var_environ_declaration=yes
725e2999 7929fi
c0c3707f
CB
7930rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7931fi
7932{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
7933$as_echo "$gt_cv_var_environ_declaration" >&6; }
7934 if test $gt_cv_var_environ_declaration = yes; then
7935
7936$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
725e2999 7937
725e2999 7938 fi
725e2999
JB
7939
7940
c0c3707f
CB
7941 if test $gt_cv_var_environ_declaration != yes; then
7942 HAVE_DECL_ENVIRON=0
7943 fi
6ec2e0f5
SDJ
7944
7945
7946
c0c3707f
CB
7947 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
7948$as_echo_n "checking for complete errno.h... " >&6; }
7949if ${gl_cv_header_errno_h_complete+:} false; then :
7950 $as_echo_n "(cached) " >&6
7951else
6ec2e0f5 7952
c0c3707f
CB
7953 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7954/* end confdefs.h. */
472fa5ee 7955
c0c3707f
CB
7956#include <errno.h>
7957#if !defined ETXTBSY
7958booboo
7959#endif
7960#if !defined ENOMSG
7961booboo
7962#endif
7963#if !defined EIDRM
7964booboo
7965#endif
7966#if !defined ENOLINK
7967booboo
7968#endif
7969#if !defined EPROTO
7970booboo
7971#endif
7972#if !defined EMULTIHOP
7973booboo
7974#endif
7975#if !defined EBADMSG
7976booboo
7977#endif
7978#if !defined EOVERFLOW
7979booboo
7980#endif
7981#if !defined ENOTSUP
7982booboo
7983#endif
7984#if !defined ENETRESET
7985booboo
7986#endif
7987#if !defined ECONNABORTED
7988booboo
7989#endif
7990#if !defined ESTALE
7991booboo
7992#endif
7993#if !defined EDQUOT
7994booboo
7995#endif
7996#if !defined ECANCELED
7997booboo
7998#endif
7999#if !defined EOWNERDEAD
8000booboo
8001#endif
8002#if !defined ENOTRECOVERABLE
8003booboo
8004#endif
8005#if !defined EILSEQ
8006booboo
8007#endif
472fa5ee 8008
c0c3707f
CB
8009_ACEOF
8010if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8011 $EGREP "booboo" >/dev/null 2>&1; then :
8012 gl_cv_header_errno_h_complete=no
8013else
8014 gl_cv_header_errno_h_complete=yes
5e8754f9 8015fi
c0c3707f 8016rm -f conftest*
472fa5ee
SM
8017
8018
c0c3707f
CB
8019fi
8020{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
8021$as_echo "$gl_cv_header_errno_h_complete" >&6; }
8022 if test $gl_cv_header_errno_h_complete = yes; then
8023 ERRNO_H=''
8024 else
472fa5ee
SM
8025
8026
8027
8028
8029
472fa5ee
SM
8030
8031
8032
c0c3707f
CB
8033 if test $gl_cv_have_include_next = yes; then
8034 gl_cv_next_errno_h='<'errno.h'>'
8035 else
8036 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
8037$as_echo_n "checking absolute name of <errno.h>... " >&6; }
8038if ${gl_cv_next_errno_h+:} false; then :
5e8754f9
SDJ
8039 $as_echo_n "(cached) " >&6
8040else
6ec2e0f5 8041
6ec2e0f5 8042
6ec2e0f5 8043
c0c3707f
CB
8044 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8045/* end confdefs.h. */
8046#include <errno.h>
8047_ACEOF
8048 case "$host_os" in
8049 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8050 *) gl_absname_cpp="$ac_cpp" ;;
8051 esac
6ec2e0f5 8052
c0c3707f
CB
8053 case "$host_os" in
8054 mingw*)
8055 gl_dirsep_regex='[/\\]'
8056 ;;
8057 *)
8058 gl_dirsep_regex='\/'
8059 ;;
8060 esac
8061 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
8062 gl_header_literal_regex=`echo 'errno.h' \
8063 | sed -e "$gl_make_literal_regex_sed"`
8064 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8065 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8066 s|^/[^/]|//&|
8067 p
8068 q
8069 }'
6ec2e0f5 8070
c0c3707f
CB
8071 gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
8072 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 8073
c0c3707f
CB
8074 gl_header=$gl_cv_absolute_errno_h
8075 gl_cv_next_errno_h='"'$gl_header'"'
6ec2e0f5
SDJ
8076
8077
c0c3707f
CB
8078fi
8079{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
8080$as_echo "$gl_cv_next_errno_h" >&6; }
8081 fi
8082 NEXT_ERRNO_H=$gl_cv_next_errno_h
6ec2e0f5 8083
c0c3707f
CB
8084 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8085 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8086 gl_next_as_first_directive='<'errno.h'>'
8087 else
8088 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8089 gl_next_as_first_directive=$gl_cv_next_errno_h
8090 fi
8091 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
6ec2e0f5 8092
472fa5ee
SM
8093
8094
8095
c0c3707f
CB
8096 ERRNO_H='errno.h'
8097 fi
472fa5ee 8098
c0c3707f
CB
8099 if test -n "$ERRNO_H"; then
8100 GL_GENERATE_ERRNO_H_TRUE=
8101 GL_GENERATE_ERRNO_H_FALSE='#'
5e8754f9 8102else
c0c3707f
CB
8103 GL_GENERATE_ERRNO_H_TRUE='#'
8104 GL_GENERATE_ERRNO_H_FALSE=
8105fi
472fa5ee
SM
8106
8107
c0c3707f
CB
8108 if test -n "$ERRNO_H"; then
8109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
8110$as_echo_n "checking for EMULTIHOP value... " >&6; }
8111if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
8112 $as_echo_n "(cached) " >&6
5e8754f9 8113else
e26b6bb0 8114
c0c3707f
CB
8115 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8116/* end confdefs.h. */
e26b6bb0 8117
c0c3707f
CB
8118#include <errno.h>
8119#ifdef EMULTIHOP
8120yes
88b48903 8121#endif
88b48903 8122
c0c3707f
CB
8123_ACEOF
8124if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8125 $EGREP "yes" >/dev/null 2>&1; then :
8126 gl_cv_header_errno_h_EMULTIHOP=yes
8127else
8128 gl_cv_header_errno_h_EMULTIHOP=no
8129fi
8130rm -f conftest*
88b48903 8131
c0c3707f
CB
8132 if test $gl_cv_header_errno_h_EMULTIHOP = no; then
8133 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8134/* end confdefs.h. */
88b48903 8135
c0c3707f
CB
8136#define _XOPEN_SOURCE_EXTENDED 1
8137#include <errno.h>
8138#ifdef EMULTIHOP
8139yes
8140#endif
88b48903
WN
8141
8142_ACEOF
c0c3707f
CB
8143if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8144 $EGREP "yes" >/dev/null 2>&1; then :
8145 gl_cv_header_errno_h_EMULTIHOP=hidden
88b48903 8146fi
c0c3707f 8147rm -f conftest*
88b48903 8148
c0c3707f
CB
8149 if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
8150 if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
8151#define _XOPEN_SOURCE_EXTENDED 1
8152#include <errno.h>
8153/* The following two lines are a workaround against an autoconf-2.52 bug. */
8154#include <stdio.h>
8155#include <stdlib.h>
8156"; then :
88b48903
WN
8157
8158fi
88b48903 8159
c0c3707f
CB
8160 fi
8161 fi
88b48903 8162
c0c3707f
CB
8163fi
8164{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
8165$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
8166 case $gl_cv_header_errno_h_EMULTIHOP in
8167 yes | no)
8168 EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
8169 ;;
8170 *)
8171 EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
8172 ;;
8173 esac
88b48903 8174
e26b6bb0 8175
c0c3707f 8176 fi
e26b6bb0 8177
3d99e817 8178
c0c3707f
CB
8179 if test -n "$ERRNO_H"; then
8180 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
8181$as_echo_n "checking for ENOLINK value... " >&6; }
8182if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
8183 $as_echo_n "(cached) " >&6
8184else
472fa5ee 8185
c0c3707f
CB
8186 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8187/* end confdefs.h. */
472fa5ee 8188
c0c3707f
CB
8189#include <errno.h>
8190#ifdef ENOLINK
8191yes
8192#endif
472fa5ee 8193
c0c3707f
CB
8194_ACEOF
8195if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8196 $EGREP "yes" >/dev/null 2>&1; then :
8197 gl_cv_header_errno_h_ENOLINK=yes
8198else
8199 gl_cv_header_errno_h_ENOLINK=no
8200fi
8201rm -f conftest*
472fa5ee 8202
c0c3707f
CB
8203 if test $gl_cv_header_errno_h_ENOLINK = no; then
8204 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8205/* end confdefs.h. */
3d99e817 8206
c0c3707f
CB
8207#define _XOPEN_SOURCE_EXTENDED 1
8208#include <errno.h>
8209#ifdef ENOLINK
8210yes
8211#endif
3d99e817 8212
c0c3707f
CB
8213_ACEOF
8214if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8215 $EGREP "yes" >/dev/null 2>&1; then :
8216 gl_cv_header_errno_h_ENOLINK=hidden
8217fi
8218rm -f conftest*
3d99e817 8219
c0c3707f
CB
8220 if test $gl_cv_header_errno_h_ENOLINK = hidden; then
8221 if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
8222#define _XOPEN_SOURCE_EXTENDED 1
8223#include <errno.h>
8224/* The following two lines are a workaround against an autoconf-2.52 bug. */
8225#include <stdio.h>
8226#include <stdlib.h>
8227"; then :
3d99e817 8228
c0c3707f 8229fi
3d99e817 8230
c0c3707f
CB
8231 fi
8232 fi
3d99e817 8233
c0c3707f
CB
8234fi
8235{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
8236$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
8237 case $gl_cv_header_errno_h_ENOLINK in
8238 yes | no)
8239 ENOLINK_HIDDEN=0; ENOLINK_VALUE=
8240 ;;
8241 *)
8242 ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
8243 ;;
8244 esac
18848e28 8245
18848e28 8246
c0c3707f 8247 fi
18848e28 8248
18848e28 8249
c0c3707f
CB
8250 if test -n "$ERRNO_H"; then
8251 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
8252$as_echo_n "checking for EOVERFLOW value... " >&6; }
8253if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
8254 $as_echo_n "(cached) " >&6
8255else
18848e28 8256
c0c3707f
CB
8257 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8258/* end confdefs.h. */
18848e28 8259
c0c3707f
CB
8260#include <errno.h>
8261#ifdef EOVERFLOW
8262yes
8263#endif
18848e28 8264
c0c3707f
CB
8265_ACEOF
8266if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8267 $EGREP "yes" >/dev/null 2>&1; then :
8268 gl_cv_header_errno_h_EOVERFLOW=yes
8269else
8270 gl_cv_header_errno_h_EOVERFLOW=no
8271fi
8272rm -f conftest*
18848e28 8273
c0c3707f
CB
8274 if test $gl_cv_header_errno_h_EOVERFLOW = no; then
8275 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8276/* end confdefs.h. */
18848e28 8277
c0c3707f
CB
8278#define _XOPEN_SOURCE_EXTENDED 1
8279#include <errno.h>
8280#ifdef EOVERFLOW
8281yes
8282#endif
18848e28 8283
c0c3707f
CB
8284_ACEOF
8285if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8286 $EGREP "yes" >/dev/null 2>&1; then :
8287 gl_cv_header_errno_h_EOVERFLOW=hidden
8288fi
8289rm -f conftest*
18848e28 8290
c0c3707f
CB
8291 if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
8292 if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
8293#define _XOPEN_SOURCE_EXTENDED 1
8294#include <errno.h>
8295/* The following two lines are a workaround against an autoconf-2.52 bug. */
8296#include <stdio.h>
8297#include <stdlib.h>
8298"; then :
18848e28 8299
c0c3707f 8300fi
18848e28 8301
c0c3707f
CB
8302 fi
8303 fi
18848e28 8304
c0c3707f
CB
8305fi
8306{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
8307$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
8308 case $gl_cv_header_errno_h_EOVERFLOW in
8309 yes | no)
8310 EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
8311 ;;
8312 *)
8313 EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
8314 ;;
8315 esac
4a626d0a
PA
8316
8317
c0c3707f 8318 fi
18848e28 8319
4a626d0a 8320
c0c3707f
CB
8321ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
8322if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
8323 ac_have_decl=1
8324else
8325 ac_have_decl=0
8326fi
4a626d0a 8327
c0c3707f
CB
8328cat >>confdefs.h <<_ACEOF
8329#define HAVE_DECL_STRERROR_R $ac_have_decl
8330_ACEOF
4a626d0a 8331
c0c3707f
CB
8332for ac_func in strerror_r
8333do :
8334 ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
8335if test "x$ac_cv_func_strerror_r" = xyes; then :
8336 cat >>confdefs.h <<_ACEOF
8337#define HAVE_STRERROR_R 1
8338_ACEOF
4a626d0a 8339
c0c3707f
CB
8340fi
8341done
18848e28 8342
c0c3707f
CB
8343{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
8344$as_echo_n "checking whether strerror_r returns char *... " >&6; }
8345if ${ac_cv_func_strerror_r_char_p+:} false; then :
8346 $as_echo_n "(cached) " >&6
8347else
18848e28 8348
c0c3707f
CB
8349 ac_cv_func_strerror_r_char_p=no
8350 if test $ac_cv_have_decl_strerror_r = yes; then
8351 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8352/* end confdefs.h. */
8353$ac_includes_default
8354int
8355main ()
8356{
18848e28 8357
c0c3707f
CB
8358 char buf[100];
8359 char x = *strerror_r (0, buf, sizeof buf);
8360 char *p = strerror_r (0, buf, sizeof buf);
8361 return !p || x;
18848e28 8362
c0c3707f
CB
8363 ;
8364 return 0;
8365}
8366_ACEOF
8367if ac_fn_c_try_compile "$LINENO"; then :
8368 ac_cv_func_strerror_r_char_p=yes
8369fi
8370rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8371 else
8372 # strerror_r is not declared. Choose between
8373 # systems that have relatively inaccessible declarations for the
8374 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
8375 # former has a strerror_r that returns char*, while the latter
8376 # has a strerror_r that returns `int'.
8377 # This test should segfault on the DEC system.
8378 if test "$cross_compiling" = yes; then :
8379 :
8380else
8381 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8382/* end confdefs.h. */
8383$ac_includes_default
8384 extern char *strerror_r ();
8385int
8386main ()
8387{
8388char buf[100];
8389 char x = *strerror_r (0, buf, sizeof buf);
8390 return ! isalpha (x);
8391 ;
8392 return 0;
8393}
8394_ACEOF
8395if ac_fn_c_try_run "$LINENO"; then :
8396 ac_cv_func_strerror_r_char_p=yes
8397fi
8398rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8399 conftest.$ac_objext conftest.beam conftest.$ac_ext
8400fi
18848e28 8401
c0c3707f 8402 fi
18848e28 8403
c0c3707f
CB
8404fi
8405{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
8406$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
8407if test $ac_cv_func_strerror_r_char_p = yes; then
18848e28 8408
c0c3707f 8409$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
18848e28 8410
c0c3707f 8411fi
18848e28 8412
18848e28 8413
18848e28 8414
18848e28 8415
c0c3707f
CB
8416ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
8417if test "x$ac_cv_have_decl_fchdir" = xyes; then :
8418 ac_have_decl=1
8419else
8420 ac_have_decl=0
8421fi
18848e28 8422
c0c3707f
CB
8423cat >>confdefs.h <<_ACEOF
8424#define HAVE_DECL_FCHDIR $ac_have_decl
8425_ACEOF
18848e28 8426
18848e28 8427
c0c3707f
CB
8428 GNULIB_CREAT=0;
8429 GNULIB_FCNTL=0;
8430 GNULIB_NONBLOCKING=0;
8431 GNULIB_OPEN=0;
8432 GNULIB_OPENAT=0;
8433 HAVE_FCNTL=1;
8434 HAVE_OPENAT=1;
8435 REPLACE_CREAT=0;
8436 REPLACE_FCNTL=0;
8437 REPLACE_OPEN=0;
8438 REPLACE_OPENAT=0;
18848e28 8439
18848e28 8440
18848e28 8441
18848e28
GF
8442
8443
18848e28
GF
8444
8445
18848e28 8446
18848e28 8447
18848e28 8448
c0c3707f
CB
8449 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
8450$as_echo_n "checking for working fcntl.h... " >&6; }
8451if ${gl_cv_header_working_fcntl_h+:} false; then :
8452 $as_echo_n "(cached) " >&6
8453else
8454 if test "$cross_compiling" = yes; then :
8455 case "$host_os" in
8456 # Guess 'no' on native Windows.
8457 mingw*) gl_cv_header_working_fcntl_h='no' ;;
8458 *) gl_cv_header_working_fcntl_h=cross-compiling ;;
8459 esac
18848e28 8460
c0c3707f
CB
8461else
8462 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8463/* end confdefs.h. */
8464#include <sys/types.h>
8465 #include <sys/stat.h>
8466 #if HAVE_UNISTD_H
8467 # include <unistd.h>
8468 #else /* on Windows with MSVC */
8469 # include <io.h>
8470 # include <stdlib.h>
8471 # defined sleep(n) _sleep ((n) * 1000)
8472 #endif
8473 #include <fcntl.h>
8474 #ifndef O_NOATIME
8475 #define O_NOATIME 0
8476 #endif
8477 #ifndef O_NOFOLLOW
8478 #define O_NOFOLLOW 0
8479 #endif
8480 static int const constants[] =
8481 {
8482 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
8483 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
8484 };
18848e28 8485
c0c3707f
CB
8486int
8487main ()
8488{
18848e28 8489
c0c3707f
CB
8490 int result = !constants;
8491 #if HAVE_SYMLINK
8492 {
8493 static char const sym[] = "conftest.sym";
8494 if (symlink ("/dev/null", sym) != 0)
8495 result |= 2;
8496 else
8497 {
8498 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
8499 if (fd >= 0)
8500 {
8501 close (fd);
8502 result |= 4;
8503 }
8504 }
8505 if (unlink (sym) != 0 || symlink (".", sym) != 0)
8506 result |= 2;
8507 else
8508 {
8509 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
8510 if (fd >= 0)
8511 {
8512 close (fd);
8513 result |= 4;
8514 }
8515 }
8516 unlink (sym);
8517 }
8518 #endif
8519 {
8520 static char const file[] = "confdefs.h";
8521 int fd = open (file, O_RDONLY | O_NOATIME);
8522 if (fd < 0)
8523 result |= 8;
8524 else
8525 {
8526 struct stat st0;
8527 if (fstat (fd, &st0) != 0)
8528 result |= 16;
8529 else
8530 {
8531 char c;
8532 sleep (1);
8533 if (read (fd, &c, 1) != 1)
8534 result |= 24;
8535 else
8536 {
8537 if (close (fd) != 0)
8538 result |= 32;
8539 else
8540 {
8541 struct stat st1;
8542 if (stat (file, &st1) != 0)
8543 result |= 40;
8544 else
8545 if (st0.st_atime != st1.st_atime)
8546 result |= 64;
8547 }
8548 }
8549 }
8550 }
8551 }
8552 return result;
8553 ;
8554 return 0;
8555}
8556_ACEOF
8557if ac_fn_c_try_run "$LINENO"; then :
8558 gl_cv_header_working_fcntl_h=yes
8559else
8560 case $? in #(
8561 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
8562 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
8563 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
8564 *) gl_cv_header_working_fcntl_h='no';;
8565 esac
8566fi
8567rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8568 conftest.$ac_objext conftest.beam conftest.$ac_ext
8569fi
18848e28 8570
18848e28 8571
c0c3707f
CB
8572fi
8573{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
8574$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
18848e28 8575
c0c3707f
CB
8576 case $gl_cv_header_working_fcntl_h in #(
8577 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
8578 *) ac_val=1;;
8579 esac
18848e28 8580
c0c3707f
CB
8581cat >>confdefs.h <<_ACEOF
8582#define HAVE_WORKING_O_NOATIME $ac_val
8583_ACEOF
18848e28
GF
8584
8585
c0c3707f
CB
8586 case $gl_cv_header_working_fcntl_h in #(
8587 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
8588 *) ac_val=1;;
8589 esac
18848e28 8590
c0c3707f
CB
8591cat >>confdefs.h <<_ACEOF
8592#define HAVE_WORKING_O_NOFOLLOW $ac_val
8593_ACEOF
18848e28 8594
63ce7108 8595
c0c3707f
CB
8596ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
8597if test "x$ac_cv_type_pid_t" = xyes; then :
63ce7108 8598
c0c3707f 8599else
63ce7108 8600
c0c3707f
CB
8601cat >>confdefs.h <<_ACEOF
8602#define pid_t int
8603_ACEOF
63ce7108 8604
c0c3707f 8605fi
63ce7108 8606
c0c3707f
CB
8607ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
8608if test "x$ac_cv_type_mode_t" = xyes; then :
63ce7108 8609
c0c3707f 8610else
63ce7108 8611
c0c3707f
CB
8612cat >>confdefs.h <<_ACEOF
8613#define mode_t int
8614_ACEOF
63ce7108 8615
c0c3707f 8616fi
63ce7108 8617
472fa5ee
SM
8618
8619
8620
8621
8622
c0c3707f
CB
8623 GNULIB_FNMATCH=0;
8624 HAVE_FNMATCH=1;
8625 REPLACE_FNMATCH=0;
472fa5ee
SM
8626
8627
8628
8629
8630
8631
472fa5ee
SM
8632
8633
472fa5ee
SM
8634
8635
8636
8637
8638
8639
8640
8641
7a6dbc2f 8642 if test $gl_cv_have_include_next = yes; then
c0c3707f 8643 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
7a6dbc2f 8644 else
c0c3707f
CB
8645 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5
8646$as_echo_n "checking absolute name of <fnmatch.h>... " >&6; }
8647if ${gl_cv_next_fnmatch_h+:} false; then :
7a6dbc2f
SDJ
8648 $as_echo_n "(cached) " >&6
8649else
472fa5ee 8650
c0c3707f
CB
8651 if test $ac_cv_header_fnmatch_h = yes; then
8652
8653
472fa5ee
SM
8654
8655
7a6dbc2f
SDJ
8656 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8657/* end confdefs.h. */
c0c3707f 8658#include <fnmatch.h>
7a6dbc2f
SDJ
8659_ACEOF
8660 case "$host_os" in
8661 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8662 *) gl_absname_cpp="$ac_cpp" ;;
8663 esac
472fa5ee 8664
7a6dbc2f
SDJ
8665 case "$host_os" in
8666 mingw*)
8667 gl_dirsep_regex='[/\\]'
8668 ;;
8669 *)
8670 gl_dirsep_regex='\/'
8671 ;;
8672 esac
8673 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 8674 gl_header_literal_regex=`echo 'fnmatch.h' \
7a6dbc2f
SDJ
8675 | sed -e "$gl_make_literal_regex_sed"`
8676 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8677 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8678 s|^/[^/]|//&|
8679 p
8680 q
8681 }'
8682
c0c3707f 8683 gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
7a6dbc2f
SDJ
8684 sed -n "$gl_absolute_header_sed"`
8685
c0c3707f
CB
8686 gl_header=$gl_cv_absolute_fnmatch_h
8687 gl_cv_next_fnmatch_h='"'$gl_header'"'
8688 else
8689 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
8690 fi
7a6dbc2f
SDJ
8691
8692
8693fi
c0c3707f
CB
8694{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5
8695$as_echo "$gl_cv_next_fnmatch_h" >&6; }
7a6dbc2f 8696 fi
c0c3707f 8697 NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h
7a6dbc2f
SDJ
8698
8699 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8700 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 8701 gl_next_as_first_directive='<'fnmatch.h'>'
7a6dbc2f
SDJ
8702 else
8703 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 8704 gl_next_as_first_directive=$gl_cv_next_fnmatch_h
7a6dbc2f 8705 fi
c0c3707f 8706 NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive
7a6dbc2f
SDJ
8707
8708
8709
8710
7a6dbc2f 8711
7a6dbc2f
SDJ
8712
8713
c0c3707f
CB
8714 if test $ac_cv_header_fnmatch_h = yes; then
8715 HAVE_FNMATCH_H=1
8716 else
8717 HAVE_FNMATCH_H=0
8718 fi
7a6dbc2f
SDJ
8719
8720
c0c3707f
CB
8721 FNMATCH_H=''
8722 if false; then
8723 FNMATCH_H=fnmatch.h
8724 else
8725 if test $ac_cv_header_fnmatch_h != yes; then
8726 FNMATCH_H=fnmatch.h
8727 fi
8728 fi
7a6dbc2f 8729
c0c3707f
CB
8730
8731 if test -n "$FNMATCH_H"; then
8732 GL_GENERATE_FNMATCH_H_TRUE=
8733 GL_GENERATE_FNMATCH_H_FALSE='#'
7a6dbc2f 8734else
c0c3707f
CB
8735 GL_GENERATE_FNMATCH_H_TRUE='#'
8736 GL_GENERATE_FNMATCH_H_FALSE=
7a6dbc2f 8737fi
7a6dbc2f 8738
7a6dbc2f 8739
7a6dbc2f 8740
7a6dbc2f
SDJ
8741
8742
8743
8744
8745
8746
8747
c0c3707f
CB
8748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
8749$as_echo_n "checking for mbstate_t... " >&6; }
8750if ${ac_cv_type_mbstate_t+:} false; then :
5e8754f9
SDJ
8751 $as_echo_n "(cached) " >&6
8752else
c0c3707f 8753 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 8754/* end confdefs.h. */
c0c3707f
CB
8755$ac_includes_default
8756/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
8757 <wchar.h>.
8758 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
8759 included before <wchar.h>. */
8760#include <stddef.h>
8761#include <stdio.h>
8762#include <time.h>
8763#include <wchar.h>
8764int
8765main ()
8766{
8767mbstate_t x; return sizeof x;
8768 ;
8769 return 0;
8770}
5e8754f9 8771_ACEOF
c0c3707f
CB
8772if ac_fn_c_try_compile "$LINENO"; then :
8773 ac_cv_type_mbstate_t=yes
5e8754f9 8774else
c0c3707f 8775 ac_cv_type_mbstate_t=no
5e8754f9 8776fi
c0c3707f
CB
8777rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8778fi
8779{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
8780$as_echo "$ac_cv_type_mbstate_t" >&6; }
8781 if test $ac_cv_type_mbstate_t = yes; then
5e8754f9 8782
c0c3707f 8783$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
5e8754f9 8784
c0c3707f 8785 else
5e8754f9 8786
c0c3707f 8787$as_echo "#define mbstate_t int" >>confdefs.h
5e8754f9 8788
c0c3707f 8789 fi
5e8754f9
SDJ
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808 GNULIB_ACOSF=0;
8809 GNULIB_ACOSL=0;
8810 GNULIB_ASINF=0;
8811 GNULIB_ASINL=0;
8812 GNULIB_ATANF=0;
8813 GNULIB_ATANL=0;
8814 GNULIB_ATAN2F=0;
8815 GNULIB_CBRT=0;
8816 GNULIB_CBRTF=0;
8817 GNULIB_CBRTL=0;
8818 GNULIB_CEIL=0;
8819 GNULIB_CEILF=0;
8820 GNULIB_CEILL=0;
8821 GNULIB_COPYSIGN=0;
8822 GNULIB_COPYSIGNF=0;
8823 GNULIB_COPYSIGNL=0;
8824 GNULIB_COSF=0;
8825 GNULIB_COSL=0;
8826 GNULIB_COSHF=0;
8827 GNULIB_EXPF=0;
8828 GNULIB_EXPL=0;
8829 GNULIB_EXP2=0;
8830 GNULIB_EXP2F=0;
8831 GNULIB_EXP2L=0;
8832 GNULIB_EXPM1=0;
8833 GNULIB_EXPM1F=0;
8834 GNULIB_EXPM1L=0;
8835 GNULIB_FABSF=0;
8836 GNULIB_FABSL=0;
8837 GNULIB_FLOOR=0;
8838 GNULIB_FLOORF=0;
8839 GNULIB_FLOORL=0;
8840 GNULIB_FMA=0;
8841 GNULIB_FMAF=0;
8842 GNULIB_FMAL=0;
8843 GNULIB_FMOD=0;
8844 GNULIB_FMODF=0;
8845 GNULIB_FMODL=0;
8846 GNULIB_FREXPF=0;
8847 GNULIB_FREXP=0;
8848 GNULIB_FREXPL=0;
8849 GNULIB_HYPOT=0;
8850 GNULIB_HYPOTF=0;
8851 GNULIB_HYPOTL=0;
8852 GNULIB_ILOGB=0;
8853 GNULIB_ILOGBF=0;
8854 GNULIB_ILOGBL=0;
8855 GNULIB_ISFINITE=0;
8856 GNULIB_ISINF=0;
8857 GNULIB_ISNAN=0;
8858 GNULIB_ISNANF=0;
8859 GNULIB_ISNAND=0;
8860 GNULIB_ISNANL=0;
8861 GNULIB_LDEXPF=0;
8862 GNULIB_LDEXPL=0;
8863 GNULIB_LOG=0;
8864 GNULIB_LOGF=0;
8865 GNULIB_LOGL=0;
8866 GNULIB_LOG10=0;
8867 GNULIB_LOG10F=0;
8868 GNULIB_LOG10L=0;
8869 GNULIB_LOG1P=0;
8870 GNULIB_LOG1PF=0;
8871 GNULIB_LOG1PL=0;
8872 GNULIB_LOG2=0;
8873 GNULIB_LOG2F=0;
8874 GNULIB_LOG2L=0;
8875 GNULIB_LOGB=0;
8876 GNULIB_LOGBF=0;
8877 GNULIB_LOGBL=0;
8878 GNULIB_MODF=0;
8879 GNULIB_MODFF=0;
8880 GNULIB_MODFL=0;
8881 GNULIB_POWF=0;
8882 GNULIB_REMAINDER=0;
8883 GNULIB_REMAINDERF=0;
8884 GNULIB_REMAINDERL=0;
8885 GNULIB_RINT=0;
8886 GNULIB_RINTF=0;
8887 GNULIB_RINTL=0;
8888 GNULIB_ROUND=0;
8889 GNULIB_ROUNDF=0;
8890 GNULIB_ROUNDL=0;
8891 GNULIB_SIGNBIT=0;
8892 GNULIB_SINF=0;
8893 GNULIB_SINL=0;
8894 GNULIB_SINHF=0;
8895 GNULIB_SQRTF=0;
8896 GNULIB_SQRTL=0;
8897 GNULIB_TANF=0;
8898 GNULIB_TANL=0;
8899 GNULIB_TANHF=0;
8900 GNULIB_TRUNC=0;
8901 GNULIB_TRUNCF=0;
8902 GNULIB_TRUNCL=0;
8903 HAVE_ACOSF=1;
8904 HAVE_ACOSL=1;
8905 HAVE_ASINF=1;
8906 HAVE_ASINL=1;
8907 HAVE_ATANF=1;
8908 HAVE_ATANL=1;
8909 HAVE_ATAN2F=1;
8910 HAVE_CBRT=1;
8911 HAVE_CBRTF=1;
8912 HAVE_CBRTL=1;
8913 HAVE_COPYSIGN=1;
8914 HAVE_COPYSIGNL=1;
8915 HAVE_COSF=1;
8916 HAVE_COSL=1;
8917 HAVE_COSHF=1;
8918 HAVE_EXPF=1;
8919 HAVE_EXPL=1;
8920 HAVE_EXPM1=1;
8921 HAVE_EXPM1F=1;
8922 HAVE_FABSF=1;
8923 HAVE_FABSL=1;
8924 HAVE_FMA=1;
8925 HAVE_FMAF=1;
8926 HAVE_FMAL=1;
8927 HAVE_FMODF=1;
8928 HAVE_FMODL=1;
8929 HAVE_FREXPF=1;
8930 HAVE_HYPOTF=1;
8931 HAVE_HYPOTL=1;
8932 HAVE_ILOGB=1;
8933 HAVE_ILOGBF=1;
8934 HAVE_ILOGBL=1;
8935 HAVE_ISNANF=1;
8936 HAVE_ISNAND=1;
8937 HAVE_ISNANL=1;
8938 HAVE_LDEXPF=1;
8939 HAVE_LOGF=1;
8940 HAVE_LOGL=1;
8941 HAVE_LOG10F=1;
8942 HAVE_LOG10L=1;
8943 HAVE_LOG1P=1;
8944 HAVE_LOG1PF=1;
8945 HAVE_LOG1PL=1;
8946 HAVE_LOGBF=1;
8947 HAVE_LOGBL=1;
8948 HAVE_MODFF=1;
8949 HAVE_MODFL=1;
8950 HAVE_POWF=1;
8951 HAVE_REMAINDER=1;
8952 HAVE_REMAINDERF=1;
8953 HAVE_RINT=1;
8954 HAVE_RINTL=1;
8955 HAVE_SINF=1;
8956 HAVE_SINL=1;
8957 HAVE_SINHF=1;
8958 HAVE_SQRTF=1;
8959 HAVE_SQRTL=1;
8960 HAVE_TANF=1;
8961 HAVE_TANL=1;
8962 HAVE_TANHF=1;
8963 HAVE_DECL_ACOSL=1;
8964 HAVE_DECL_ASINL=1;
8965 HAVE_DECL_ATANL=1;
8966 HAVE_DECL_CBRTF=1;
8967 HAVE_DECL_CBRTL=1;
8968 HAVE_DECL_CEILF=1;
8969 HAVE_DECL_CEILL=1;
8970 HAVE_DECL_COPYSIGNF=1;
8971 HAVE_DECL_COSL=1;
8972 HAVE_DECL_EXPL=1;
8973 HAVE_DECL_EXP2=1;
8974 HAVE_DECL_EXP2F=1;
8975 HAVE_DECL_EXP2L=1;
8976 HAVE_DECL_EXPM1L=1;
8977 HAVE_DECL_FLOORF=1;
8978 HAVE_DECL_FLOORL=1;
8979 HAVE_DECL_FREXPL=1;
8980 HAVE_DECL_LDEXPL=1;
8981 HAVE_DECL_LOGL=1;
8982 HAVE_DECL_LOG10L=1;
8983 HAVE_DECL_LOG2=1;
8984 HAVE_DECL_LOG2F=1;
8985 HAVE_DECL_LOG2L=1;
8986 HAVE_DECL_LOGB=1;
8987 HAVE_DECL_REMAINDER=1;
8988 HAVE_DECL_REMAINDERL=1;
8989 HAVE_DECL_RINTF=1;
8990 HAVE_DECL_ROUND=1;
8991 HAVE_DECL_ROUNDF=1;
8992 HAVE_DECL_ROUNDL=1;
8993 HAVE_DECL_SINL=1;
8994 HAVE_DECL_SQRTL=1;
8995 HAVE_DECL_TANL=1;
8996 HAVE_DECL_TRUNC=1;
8997 HAVE_DECL_TRUNCF=1;
8998 HAVE_DECL_TRUNCL=1;
c0c3707f
CB
8999 REPLACE_ACOSF=0;
9000 REPLACE_ASINF=0;
9001 REPLACE_ATANF=0;
9002 REPLACE_ATAN2F=0;
5e8754f9
SDJ
9003 REPLACE_CBRTF=0;
9004 REPLACE_CBRTL=0;
9005 REPLACE_CEIL=0;
9006 REPLACE_CEILF=0;
9007 REPLACE_CEILL=0;
c0c3707f
CB
9008 REPLACE_COSF=0;
9009 REPLACE_COSHF=0;
9010 REPLACE_EXPF=0;
9011 REPLACE_EXPL=0;
5e8754f9
SDJ
9012 REPLACE_EXPM1=0;
9013 REPLACE_EXPM1F=0;
c0c3707f 9014 REPLACE_EXPM1L=0;
5e8754f9
SDJ
9015 REPLACE_EXP2=0;
9016 REPLACE_EXP2L=0;
9017 REPLACE_FABSL=0;
9018 REPLACE_FLOOR=0;
9019 REPLACE_FLOORF=0;
9020 REPLACE_FLOORL=0;
9021 REPLACE_FMA=0;
9022 REPLACE_FMAF=0;
9023 REPLACE_FMAL=0;
9024 REPLACE_FMOD=0;
9025 REPLACE_FMODF=0;
9026 REPLACE_FMODL=0;
9027 REPLACE_FREXPF=0;
9028 REPLACE_FREXP=0;
9029 REPLACE_FREXPL=0;
9030 REPLACE_HUGE_VAL=0;
9031 REPLACE_HYPOT=0;
9032 REPLACE_HYPOTF=0;
9033 REPLACE_HYPOTL=0;
9034 REPLACE_ILOGB=0;
9035 REPLACE_ILOGBF=0;
c0c3707f 9036 REPLACE_ILOGBL=0;
5e8754f9
SDJ
9037 REPLACE_ISFINITE=0;
9038 REPLACE_ISINF=0;
9039 REPLACE_ISNAN=0;
9040 REPLACE_LDEXPL=0;
9041 REPLACE_LOG=0;
9042 REPLACE_LOGF=0;
9043 REPLACE_LOGL=0;
9044 REPLACE_LOG10=0;
9045 REPLACE_LOG10F=0;
9046 REPLACE_LOG10L=0;
9047 REPLACE_LOG1P=0;
9048 REPLACE_LOG1PF=0;
9049 REPLACE_LOG1PL=0;
9050 REPLACE_LOG2=0;
9051 REPLACE_LOG2F=0;
9052 REPLACE_LOG2L=0;
9053 REPLACE_LOGB=0;
9054 REPLACE_LOGBF=0;
9055 REPLACE_LOGBL=0;
9056 REPLACE_MODF=0;
9057 REPLACE_MODFF=0;
9058 REPLACE_MODFL=0;
9059 REPLACE_NAN=0;
9060 REPLACE_REMAINDER=0;
9061 REPLACE_REMAINDERF=0;
9062 REPLACE_REMAINDERL=0;
c0c3707f 9063 REPLACE_RINTL=0;
5e8754f9 9064 REPLACE_ROUND=0;
c0c3707f
CB
9065 REPLACE_ROUNDF=0;
9066 REPLACE_ROUNDL=0;
9067 REPLACE_SIGNBIT=0;
9068 REPLACE_SIGNBIT_USING_GCC=0;
9069 REPLACE_SINF=0;
9070 REPLACE_SINHF=0;
9071 REPLACE_SQRTF=0;
9072 REPLACE_SQRTL=0;
9073 REPLACE_TANF=0;
9074 REPLACE_TANHF=0;
9075 REPLACE_TRUNC=0;
9076 REPLACE_TRUNCF=0;
9077 REPLACE_TRUNCL=0;
49e4877c 9078
49e4877c 9079
c0c3707f
CB
9080 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
9081$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
9082if ${gl_cv_func_frexp_no_libm+:} false; then :
9083 $as_echo_n "(cached) " >&6
9084else
8690e634 9085
c0c3707f
CB
9086 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9087/* end confdefs.h. */
9088#include <math.h>
9089 double x;
9090int
9091main ()
9092{
9093int e; return frexp (x, &e) > 0;
9094 ;
9095 return 0;
9096}
9097_ACEOF
9098if ac_fn_c_try_link "$LINENO"; then :
9099 gl_cv_func_frexp_no_libm=yes
9100else
9101 gl_cv_func_frexp_no_libm=no
9102fi
9103rm -f core conftest.err conftest.$ac_objext \
9104 conftest$ac_exeext conftest.$ac_ext
8690e634 9105
c0c3707f
CB
9106fi
9107{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
9108$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
8690e634 9109
c0c3707f
CB
9110ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
9111if test "x$ac_cv_have_decl_alarm" = xyes; then :
9112 ac_have_decl=1
9113else
9114 ac_have_decl=0
9115fi
472fa5ee 9116
c0c3707f
CB
9117cat >>confdefs.h <<_ACEOF
9118#define HAVE_DECL_ALARM $ac_have_decl
9119_ACEOF
472fa5ee
SM
9120
9121
9122
9123
c0c3707f
CB
9124 FREXP_LIBM=
9125 if test $gl_cv_func_frexp_no_libm = no; then
9126 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5
9127$as_echo_n "checking whether frexp() can be used with libm... " >&6; }
9128if ${gl_cv_func_frexp_in_libm+:} false; then :
9129 $as_echo_n "(cached) " >&6
9130else
8690e634 9131
c0c3707f
CB
9132 save_LIBS="$LIBS"
9133 LIBS="$LIBS -lm"
9134 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9135/* end confdefs.h. */
9136#include <math.h>
9137 double x;
9138int
9139main ()
9140{
9141int e; return frexp (x, &e) > 0;
9142 ;
9143 return 0;
9144}
9145_ACEOF
9146if ac_fn_c_try_link "$LINENO"; then :
9147 gl_cv_func_frexp_in_libm=yes
9148else
9149 gl_cv_func_frexp_in_libm=no
9150fi
9151rm -f core conftest.err conftest.$ac_objext \
9152 conftest$ac_exeext conftest.$ac_ext
9153 LIBS="$save_LIBS"
8690e634 9154
c0c3707f
CB
9155fi
9156{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5
9157$as_echo "$gl_cv_func_frexp_in_libm" >&6; }
9158 if test $gl_cv_func_frexp_in_libm = yes; then
9159 FREXP_LIBM=-lm
9160 fi
6ec2e0f5 9161 fi
c0c3707f
CB
9162 if test $gl_cv_func_frexp_no_libm = yes \
9163 || test $gl_cv_func_frexp_in_libm = yes; then
9164 save_LIBS="$LIBS"
9165 LIBS="$LIBS $FREXP_LIBM"
8690e634
JK
9166
9167
8690e634 9168
c0c3707f
CB
9169 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
9170$as_echo_n "checking whether frexp works... " >&6; }
9171if ${gl_cv_func_frexp_works+:} false; then :
9172 $as_echo_n "(cached) " >&6
9173else
8690e634 9174
c0c3707f
CB
9175 if test "$cross_compiling" = yes; then :
9176 case "$host_os" in
9177 netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
9178 mingw*) # Guess yes with MSVC, no with mingw.
9179 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9180/* end confdefs.h. */
8690e634 9181
c0c3707f
CB
9182#ifdef _MSC_VER
9183 Good
9184#endif
8690e634 9185
c0c3707f
CB
9186_ACEOF
9187if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9188 $EGREP "Good" >/dev/null 2>&1; then :
9189 gl_cv_func_frexp_works="guessing yes"
9190else
9191 gl_cv_func_frexp_works="guessing no"
9192fi
9193rm -f conftest*
8690e634 9194
c0c3707f
CB
9195 ;;
9196 *) gl_cv_func_frexp_works="guessing yes" ;;
9197 esac
8690e634 9198
c0c3707f
CB
9199else
9200 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9201/* end confdefs.h. */
8690e634 9202
c0c3707f
CB
9203#include <float.h>
9204#include <math.h>
9205#include <string.h>
9206#if HAVE_DECL_ALARM
9207# include <signal.h>
9208# include <unistd.h>
9209#endif
9210/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
9211 ICC 10.0 has a bug when optimizing the expression -zero.
9212 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
9213 to PowerPC on Mac OS X 10.5. */
9214#if defined __hpux || defined __sgi || defined __ICC
9215static double
9216compute_minus_zero (void)
9217{
9218 return -DBL_MIN * DBL_MIN;
9219}
9220# define minus_zero compute_minus_zero ()
9221#else
9222double minus_zero = -0.0;
9223#endif
9224int main()
9225{
9226 int result = 0;
9227 int i;
9228 volatile double x;
9229 double zero = 0.0;
9230#if HAVE_DECL_ALARM
9231 /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
9232 number. Let the test fail in this case. */
9233 signal (SIGALRM, SIG_DFL);
9234 alarm (5);
9235#endif
9236 /* Test on denormalized numbers. */
9237 for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
9238 ;
9239 if (x > 0.0)
9240 {
9241 int exp;
9242 double y = frexp (x, &exp);
9243 /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
9244 On NetBSD: y = 0.75. Correct: y = 0.5. */
9245 if (y != 0.5)
9246 result |= 1;
9247 }
9248 /* Test on infinite numbers. */
9249 x = 1.0 / zero;
9250 {
9251 int exp;
9252 double y = frexp (x, &exp);
9253 if (y != x)
9254 result |= 2;
9255 }
9256 /* Test on negative zero. */
9257 x = minus_zero;
9258 {
9259 int exp;
9260 double y = frexp (x, &exp);
9261 if (memcmp (&y, &x, sizeof x))
9262 result |= 4;
9263 }
9264 return result;
9265}
9266_ACEOF
9267if ac_fn_c_try_run "$LINENO"; then :
9268 gl_cv_func_frexp_works=yes
9269else
9270 gl_cv_func_frexp_works=no
9271fi
9272rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9273 conftest.$ac_objext conftest.beam conftest.$ac_ext
9274fi
472fa5ee
SM
9275
9276
c0c3707f
CB
9277fi
9278{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
9279$as_echo "$gl_cv_func_frexp_works" >&6; }
472fa5ee 9280
c0c3707f
CB
9281 LIBS="$save_LIBS"
9282 case "$gl_cv_func_frexp_works" in
9283 *yes) gl_func_frexp=yes ;;
9284 *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
9285 esac
9286 else
9287 gl_func_frexp=no
9288 fi
9289 if test $gl_func_frexp = yes; then
472fa5ee 9290
c0c3707f 9291$as_echo "#define HAVE_FREXP 1" >>confdefs.h
472fa5ee 9292
c0c3707f 9293 fi
8690e634 9294
6ec2e0f5
SDJ
9295
9296
c0c3707f
CB
9297 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
9298$as_echo_n "checking whether long double and double are the same... " >&6; }
9299if ${gl_cv_long_double_equals_double+:} false; then :
8690e634
JK
9300 $as_echo_n "(cached) " >&6
9301else
c0c3707f
CB
9302 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9303/* end confdefs.h. */
9304#include <float.h>
9305int
9306main ()
9307{
9308typedef int check[sizeof (long double) == sizeof (double)
9309 && LDBL_MANT_DIG == DBL_MANT_DIG
9310 && LDBL_MAX_EXP == DBL_MAX_EXP
9311 && LDBL_MIN_EXP == DBL_MIN_EXP
9312 ? 1 : -1];
8690e634 9313
c0c3707f
CB
9314 ;
9315 return 0;
9316}
9317_ACEOF
9318if ac_fn_c_try_compile "$LINENO"; then :
9319 gl_cv_long_double_equals_double=yes
9320else
9321 gl_cv_long_double_equals_double=no
9322fi
9323rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9324
c0c3707f
CB
9325fi
9326{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
9327$as_echo "$gl_cv_long_double_equals_double" >&6; }
9328 if test $gl_cv_long_double_equals_double = yes; then
8690e634 9329
c0c3707f 9330$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
6ec2e0f5 9331
c0c3707f
CB
9332 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
9333 else
9334 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
9335 fi
8690e634 9336
6ec2e0f5 9337
6ec2e0f5 9338
6ec2e0f5
SDJ
9339
9340
6ec2e0f5 9341
8690e634
JK
9342
9343
c0c3707f
CB
9344 ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
9345"
9346if test "x$ac_cv_have_decl_frexpl" = xyes; then :
8690e634 9347
c0c3707f
CB
9348else
9349 HAVE_DECL_FREXPL=0
9350fi
8690e634 9351
6ec2e0f5 9352
c0c3707f
CB
9353 FREXPL_LIBM=
9354 if test $HAVE_DECL_FREXPL = 1; then
6ec2e0f5 9355
c0c3707f
CB
9356 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
9357$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
9358if ${gl_cv_func_frexpl_no_libm+:} false; then :
8690e634
JK
9359 $as_echo_n "(cached) " >&6
9360else
c0c3707f
CB
9361
9362 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9363/* end confdefs.h. */
c0c3707f
CB
9364#include <math.h>
9365 long double x;
9366int
9367main ()
9368{
9369int e; return frexpl (x, &e) > 0;
9370 ;
9371 return 0;
9372}
9373_ACEOF
9374if ac_fn_c_try_link "$LINENO"; then :
9375 gl_cv_func_frexpl_no_libm=yes
9376else
9377 gl_cv_func_frexpl_no_libm=no
9378fi
9379rm -f core conftest.err conftest.$ac_objext \
9380 conftest$ac_exeext conftest.$ac_ext
8690e634 9381
c0c3707f
CB
9382fi
9383{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
9384$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
6ec2e0f5 9385
c0c3707f
CB
9386 if test $gl_cv_func_frexpl_no_libm = no; then
9387 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5
9388$as_echo_n "checking whether frexpl() can be used with libm... " >&6; }
9389if ${gl_cv_func_frexpl_in_libm+:} false; then :
9390 $as_echo_n "(cached) " >&6
9391else
6ec2e0f5 9392
c0c3707f
CB
9393 save_LIBS="$LIBS"
9394 LIBS="$LIBS -lm"
9395 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9396/* end confdefs.h. */
9397#include <math.h>
9398 long double x;
9399int
9400main ()
9401{
9402int e; return frexpl (x, &e) > 0;
9403 ;
9404 return 0;
9405}
9406_ACEOF
9407if ac_fn_c_try_link "$LINENO"; then :
9408 gl_cv_func_frexpl_in_libm=yes
9409else
9410 gl_cv_func_frexpl_in_libm=no
9411fi
9412rm -f core conftest.err conftest.$ac_objext \
9413 conftest$ac_exeext conftest.$ac_ext
9414 LIBS="$save_LIBS"
6ec2e0f5 9415
c0c3707f
CB
9416fi
9417{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5
9418$as_echo "$gl_cv_func_frexpl_in_libm" >&6; }
9419 if test $gl_cv_func_frexpl_in_libm = yes; then
9420 FREXPL_LIBM=-lm
9421 fi
9422 fi
9423 if test $gl_cv_func_frexpl_no_libm = yes \
9424 || test $gl_cv_func_frexpl_in_libm = yes; then
9425 save_LIBS="$LIBS"
9426 LIBS="$LIBS $FREXPL_LIBM"
8690e634 9427
8690e634 9428
c0c3707f
CB
9429 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
9430$as_echo_n "checking whether frexpl works... " >&6; }
9431if ${gl_cv_func_frexpl_works+:} false; then :
9432 $as_echo_n "(cached) " >&6
9433else
8690e634 9434
c0c3707f 9435 if test "$cross_compiling" = yes; then :
8690e634 9436
c0c3707f
CB
9437 case "$host_os" in
9438 aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
9439 gl_cv_func_frexpl_works="guessing no";;
9440 *) gl_cv_func_frexpl_works="guessing yes";;
9441 esac
8690e634 9442
c0c3707f
CB
9443else
9444 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9445/* end confdefs.h. */
8690e634 9446
c0c3707f
CB
9447#include <float.h>
9448#include <math.h>
9449/* Override the values of <float.h>, like done in float.in.h. */
9450#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
9451# undef LDBL_MIN_EXP
9452# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9453#endif
c0c3707f
CB
9454#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
9455# undef LDBL_MIN_EXP
9456# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9457#endif
c0c3707f
CB
9458#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
9459# undef LDBL_MIN_EXP
9460# define LDBL_MIN_EXP DBL_MIN_EXP
6ec2e0f5 9461#endif
c0c3707f
CB
9462#if defined __sgi && (LDBL_MANT_DIG >= 106)
9463# if defined __GNUC__
9464# undef LDBL_MIN_EXP
9465# define LDBL_MIN_EXP DBL_MIN_EXP
9466# endif
6ec2e0f5 9467#endif
c0c3707f
CB
9468extern
9469#ifdef __cplusplus
9470"C"
9471#endif
9472long double frexpl (long double, int *);
9473int main()
8690e634 9474{
c0c3707f
CB
9475 int result = 0;
9476 volatile long double x;
9477 /* Test on finite numbers that fails on AIX 5.1. */
9478 x = 16.0L;
9479 {
9480 int exp = -9999;
9481 frexpl (x, &exp);
9482 if (exp != 5)
9483 result |= 1;
9484 }
9485 /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
9486 function returns an invalid (incorrectly normalized) value: it returns
9487 y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
9488 but the correct result is
9489 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
9490 x = 1.01L;
9491 {
9492 int exp = -9999;
9493 long double y = frexpl (x, &exp);
9494 if (!(exp == 1 && y == 0.505L))
9495 result |= 2;
9496 }
9497 /* Test on large finite numbers. This fails on BeOS at i = 16322, while
9498 LDBL_MAX_EXP = 16384.
9499 In the loop end test, we test x against Infinity, rather than comparing
9500 i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
9501 {
9502 int i;
9503 for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
9504 {
9505 int exp = -9999;
9506 frexpl (x, &exp);
9507 if (exp != i)
9508 {
9509 result |= 4;
9510 break;
9511 }
9512 }
9513 }
9514 /* Test on denormalized numbers. */
9515 {
9516 int i;
9517 for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
9518 ;
9519 if (x > 0.0L)
9520 {
9521 int exp;
9522 long double y = frexpl (x, &exp);
9523 /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
9524 exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
9525 if (exp != LDBL_MIN_EXP - 1)
9526 result |= 8;
9527 }
9528 }
9529 /* Test on infinite numbers. */
9530 x = 1.0L / 0.0L;
9531 {
9532 int exp;
9533 long double y = frexpl (x, &exp);
9534 if (y != x)
9535 result |= 16;
9536 }
9537 return result;
8690e634
JK
9538}
9539_ACEOF
c0c3707f
CB
9540if ac_fn_c_try_run "$LINENO"; then :
9541 gl_cv_func_frexpl_works=yes
6ec2e0f5 9542else
c0c3707f
CB
9543 gl_cv_func_frexpl_works=no
9544fi
9545rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9546 conftest.$ac_objext conftest.beam conftest.$ac_ext
9547fi
8690e634 9548
8690e634 9549
c0c3707f
CB
9550fi
9551{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
9552$as_echo "$gl_cv_func_frexpl_works" >&6; }
8690e634 9553
c0c3707f
CB
9554 LIBS="$save_LIBS"
9555 case "$gl_cv_func_frexpl_works" in
9556 *yes) gl_func_frexpl=yes ;;
9557 *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
9558 esac
9559 else
9560 gl_func_frexpl=no
9561 fi
9562 if test $gl_func_frexpl = yes; then
8690e634 9563
c0c3707f 9564$as_echo "#define HAVE_FREXPL 1" >>confdefs.h
8690e634 9565
c0c3707f
CB
9566 fi
9567 fi
9568 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
9569 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
8690e634 9570
c0c3707f
CB
9571 FREXPL_LIBM="$FREXP_LIBM"
9572 else
9573 FREXPL_LIBM=
9574 fi
9575 fi
6ec2e0f5 9576
6ec2e0f5 9577
6ec2e0f5 9578
c0c3707f
CB
9579 GNULIB_FCHMODAT=0;
9580 GNULIB_FSTAT=0;
9581 GNULIB_FSTATAT=0;
9582 GNULIB_FUTIMENS=0;
9583 GNULIB_LCHMOD=0;
9584 GNULIB_LSTAT=0;
9585 GNULIB_MKDIRAT=0;
9586 GNULIB_MKFIFO=0;
9587 GNULIB_MKFIFOAT=0;
9588 GNULIB_MKNOD=0;
9589 GNULIB_MKNODAT=0;
9590 GNULIB_STAT=0;
9591 GNULIB_UTIMENSAT=0;
9592 GNULIB_OVERRIDES_STRUCT_STAT=0;
9593 HAVE_FCHMODAT=1;
9594 HAVE_FSTATAT=1;
9595 HAVE_FUTIMENS=1;
9596 HAVE_LCHMOD=1;
9597 HAVE_LSTAT=1;
9598 HAVE_MKDIRAT=1;
9599 HAVE_MKFIFO=1;
9600 HAVE_MKFIFOAT=1;
9601 HAVE_MKNOD=1;
9602 HAVE_MKNODAT=1;
9603 HAVE_UTIMENSAT=1;
5df4cba6 9604 REPLACE_FCHMODAT=0;
c0c3707f
CB
9605 REPLACE_FSTAT=0;
9606 REPLACE_FSTATAT=0;
9607 REPLACE_FUTIMENS=0;
5df4cba6 9608 REPLACE_LCHMOD=0;
c0c3707f
CB
9609 REPLACE_LSTAT=0;
9610 REPLACE_MKDIR=0;
9611 REPLACE_MKFIFO=0;
9612 REPLACE_MKNOD=0;
9613 REPLACE_STAT=0;
9614 REPLACE_UTIMENSAT=0;
9615
9616{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
9617$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
9618if ${ac_cv_header_stat_broken+:} false; then :
9619 $as_echo_n "(cached) " >&6
9620else
9621 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9622/* end confdefs.h. */
9623#include <sys/types.h>
9624#include <sys/stat.h>
9625
9626#if defined S_ISBLK && defined S_IFDIR
9627extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
9628#endif
9629
9630#if defined S_ISBLK && defined S_IFCHR
9631extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
9632#endif
9633
9634#if defined S_ISLNK && defined S_IFREG
9635extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
9636#endif
8690e634 9637
c0c3707f
CB
9638#if defined S_ISSOCK && defined S_IFREG
9639extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
9640#endif
8690e634 9641
c0c3707f
CB
9642_ACEOF
9643if ac_fn_c_try_compile "$LINENO"; then :
9644 ac_cv_header_stat_broken=no
9645else
9646 ac_cv_header_stat_broken=yes
6ec2e0f5
SDJ
9647fi
9648rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 9649fi
c0c3707f
CB
9650{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
9651$as_echo "$ac_cv_header_stat_broken" >&6; }
9652if test $ac_cv_header_stat_broken = yes; then
8690e634 9653
c0c3707f 9654$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
49e4877c 9655
c0c3707f 9656fi
49e4877c
PA
9657
9658
9659
9660
8690e634 9661
c0c3707f
CB
9662 case "$host_os" in
9663 mingw*)
9664 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
9665$as_echo_n "checking for 64-bit off_t... " >&6; }
9666if ${gl_cv_type_off_t_64+:} false; then :
9667 $as_echo_n "(cached) " >&6
9668else
9669 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9670/* end confdefs.h. */
9671#include <sys/types.h>
9672 int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
8690e634 9673
6ec2e0f5
SDJ
9674int
9675main ()
9676{
8690e634 9677
6ec2e0f5
SDJ
9678 ;
9679 return 0;
9680}
9681_ACEOF
9682if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9683 gl_cv_type_off_t_64=yes
9684else
9685 gl_cv_type_off_t_64=no
6ec2e0f5
SDJ
9686fi
9687rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9688
c0c3707f
CB
9689fi
9690{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
9691$as_echo "$gl_cv_type_off_t_64" >&6; }
9692 if test $gl_cv_type_off_t_64 = no; then
9693 WINDOWS_64_BIT_OFF_T=1
9694 else
9695 WINDOWS_64_BIT_OFF_T=0
9696 fi
9697 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
9698$as_echo_n "checking for 64-bit st_size... " >&6; }
9699if ${gl_cv_member_st_size_64+:} false; then :
6ec2e0f5
SDJ
9700 $as_echo_n "(cached) " >&6
9701else
c0c3707f 9702 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 9703/* end confdefs.h. */
c0c3707f
CB
9704#include <sys/types.h>
9705 struct stat buf;
9706 int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
8690e634 9707
6ec2e0f5
SDJ
9708int
9709main ()
9710{
8690e634 9711
6ec2e0f5
SDJ
9712 ;
9713 return 0;
9714}
9715_ACEOF
9716if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9717 gl_cv_member_st_size_64=yes
9718else
9719 gl_cv_member_st_size_64=no
6ec2e0f5
SDJ
9720fi
9721rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9722
6ec2e0f5 9723fi
c0c3707f
CB
9724{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
9725$as_echo "$gl_cv_member_st_size_64" >&6; }
9726 if test $gl_cv_member_st_size_64 = no; then
9727 WINDOWS_64_BIT_ST_SIZE=1
9728 else
9729 WINDOWS_64_BIT_ST_SIZE=0
9730 fi
9731 ;;
9732 *)
9733 WINDOWS_64_BIT_OFF_T=0
9734 WINDOWS_64_BIT_ST_SIZE=0
9735 ;;
9736 esac
8690e634
JK
9737
9738
9739
9740
9741
9742
c0c3707f
CB
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752 if test $gl_cv_have_include_next = yes; then
9753 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
9754 else
9755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
9756$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
9757if ${gl_cv_next_sys_stat_h+:} false; then :
8690e634
JK
9758 $as_echo_n "(cached) " >&6
9759else
9760
c0c3707f 9761 if test $ac_cv_header_sys_stat_h = yes; then
4a626d0a
PA
9762
9763
4a626d0a 9764
c0c3707f
CB
9765
9766 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9767/* end confdefs.h. */
9768#include <sys/stat.h>
6ec2e0f5 9769_ACEOF
c0c3707f
CB
9770 case "$host_os" in
9771 aix*) gl_absname_cpp="$ac_cpp -C" ;;
9772 *) gl_absname_cpp="$ac_cpp" ;;
9773 esac
9774
9775 case "$host_os" in
9776 mingw*)
9777 gl_dirsep_regex='[/\\]'
9778 ;;
9779 *)
9780 gl_dirsep_regex='\/'
9781 ;;
9782 esac
9783 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
9784 gl_header_literal_regex=`echo 'sys/stat.h' \
9785 | sed -e "$gl_make_literal_regex_sed"`
9786 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
9787 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
9788 s|^/[^/]|//&|
9789 p
9790 q
9791 }'
9792
9793 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
9794 sed -n "$gl_absolute_header_sed"`
9795
9796 gl_header=$gl_cv_absolute_sys_stat_h
9797 gl_cv_next_sys_stat_h='"'$gl_header'"'
9798 else
9799 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
9800 fi
9801
9802
9803fi
9804{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
9805$as_echo "$gl_cv_next_sys_stat_h" >&6; }
9806 fi
9807 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
9808
9809 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
9810 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
9811 gl_next_as_first_directive='<'sys/stat.h'>'
9812 else
9813 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
9814 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
9815 fi
9816 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
9817
9818
9819
9820
9821
9822
9823
9824
9825 WINDOWS_STAT_TIMESPEC=0
9826
9827
9828
9829
4a626d0a 9830
4a626d0a 9831
8690e634
JK
9832
9833
c0c3707f
CB
9834 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
9835 #include <sys/stat.h>
9836"
9837if test "x$ac_cv_type_nlink_t" = xyes; then :
8690e634 9838
6ec2e0f5 9839else
8690e634 9840
c0c3707f 9841$as_echo "#define nlink_t int" >>confdefs.h
6ec2e0f5 9842
6ec2e0f5 9843fi
8690e634
JK
9844
9845
9846
9847
9848
9849
9850
c0c3707f
CB
9851 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
9852$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
9853if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
8690e634 9854 $as_echo_n "(cached) " >&6
c0c3707f
CB
9855else
9856 rm -f conftest.sym conftest.file
9857 echo >conftest.file
9858 if test "$cross_compiling" = yes; then :
9859 case "$host_os" in
9860 linux-* | linux)
9861 # Guess yes on Linux systems.
9862 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
9863 *-gnu* | gnu*)
9864 # Guess yes on glibc systems.
9865 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
9866 mingw*)
9867 # Guess no on native Windows.
9868 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
9869 *)
9870 # If we don't know, obey --enable-cross-guesses.
9871 gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
9872 esac
9873
8690e634
JK
9874else
9875 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9876/* end confdefs.h. */
c0c3707f 9877$ac_includes_default
8690e634
JK
9878int
9879main ()
9880{
c0c3707f
CB
9881struct stat sbuf;
9882 if (symlink ("conftest.file", "conftest.sym") != 0)
9883 return 1;
9884 /* Linux will dereference the symlink and fail, as required by
9885 POSIX. That is better in the sense that it means we will not
9886 have to compile and use the lstat wrapper. */
9887 return lstat ("conftest.sym/", &sbuf) == 0;
6ec2e0f5 9888
8690e634
JK
9889 ;
9890 return 0;
9891}
9892_ACEOF
c0c3707f
CB
9893if ac_fn_c_try_run "$LINENO"; then :
9894 gl_cv_func_lstat_dereferences_slashed_symlink=yes
8690e634 9895else
c0c3707f 9896 gl_cv_func_lstat_dereferences_slashed_symlink=no
8690e634 9897fi
c0c3707f
CB
9898rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9899 conftest.$ac_objext conftest.beam conftest.$ac_ext
9900fi
9901
9902 rm -f conftest.sym conftest.file
6ec2e0f5 9903
8690e634 9904fi
c0c3707f
CB
9905{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
9906$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
9907 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
9908 *yes)
9909
9910cat >>confdefs.h <<_ACEOF
9911#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
8690e634
JK
9912_ACEOF
9913
c0c3707f
CB
9914 ;;
9915 esac
8690e634 9916
8690e634 9917
8690e634 9918
8690e634 9919
c0c3707f
CB
9920
9921 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
9922$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
9923if ${gl_cv_func_getcwd_null+:} false; then :
8690e634
JK
9924 $as_echo_n "(cached) " >&6
9925else
c0c3707f
CB
9926 if test "$cross_compiling" = yes; then :
9927 case "$host_os" in
9928 # Guess yes on glibc systems.
9929 *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
9930 # Guess yes on musl systems.
9931 *-musl*) gl_cv_func_getcwd_null="guessing yes";;
9932 # Guess yes on Cygwin.
9933 cygwin*) gl_cv_func_getcwd_null="guessing yes";;
9934 # If we don't know, obey --enable-cross-guesses.
9935 *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
9936 esac
9937
9938else
9939 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
9940/* end confdefs.h. */
9941
c0c3707f
CB
9942# include <stdlib.h>
9943# if HAVE_UNISTD_H
9944# include <unistd.h>
9945# else /* on Windows with MSVC */
9946# include <direct.h>
9947# endif
9948# ifndef getcwd
9949 char *getcwd ();
9950# endif
8690e634
JK
9951
9952int
9953main ()
9954{
9955
c0c3707f
CB
9956#if defined _WIN32 && ! defined __CYGWIN__
9957/* mingw cwd does not start with '/', but getcwd does allocate.
9958 However, mingw fails to honor non-zero size. */
9959#else
9960 if (chdir ("/") != 0)
9961 return 1;
9962 else
9963 {
9964 char *f = getcwd (NULL, 0);
9965 if (! f)
9966 return 2;
9967 if (f[0] != '/')
9968 { free (f); return 3; }
9969 if (f[1] != '\0')
9970 { free (f); return 4; }
9971 free (f);
9972 return 0;
9973 }
9974#endif
9975
8690e634
JK
9976 ;
9977 return 0;
9978}
9979_ACEOF
c0c3707f
CB
9980if ac_fn_c_try_run "$LINENO"; then :
9981 gl_cv_func_getcwd_null=yes
9982else
9983 gl_cv_func_getcwd_null=no
8690e634 9984fi
c0c3707f
CB
9985rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9986 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 9987fi
8690e634 9988
c0c3707f
CB
9989fi
9990{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
9991$as_echo "$gl_cv_func_getcwd_null" >&6; }
8690e634 9992
6ec2e0f5 9993
c0c3707f
CB
9994 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
9995$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
9996if ${gl_cv_func_getcwd_posix_signature+:} false; then :
8690e634
JK
9997 $as_echo_n "(cached) " >&6
9998else
c0c3707f 9999 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 10000/* end confdefs.h. */
c0c3707f 10001#include <unistd.h>
88b48903
WN
10002int
10003main ()
10004{
c0c3707f
CB
10005extern
10006 #ifdef __cplusplus
10007 "C"
10008 #endif
10009 char *getcwd (char *, size_t);
88b48903
WN
10010
10011 ;
10012 return 0;
10013}
c0c3707f 10014
88b48903
WN
10015_ACEOF
10016if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
10017 gl_cv_func_getcwd_posix_signature=yes
10018else
10019 gl_cv_func_getcwd_posix_signature=no
8690e634 10020fi
88b48903 10021rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 10022
c0c3707f
CB
10023fi
10024{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
10025$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
8690e634 10026
c0c3707f
CB
10027ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
10028if test "x$ac_cv_have_decl_getcwd" = xyes; then :
10029 ac_have_decl=1
10030else
10031 ac_have_decl=0
10032fi
8690e634 10033
c0c3707f
CB
10034cat >>confdefs.h <<_ACEOF
10035#define HAVE_DECL_GETCWD $ac_have_decl
10036_ACEOF
8690e634
JK
10037
10038
7a6dbc2f 10039
c0c3707f
CB
10040ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
10041if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
10042 ac_have_decl=1
88b48903 10043else
c0c3707f 10044 ac_have_decl=0
88b48903 10045fi
8690e634 10046
c0c3707f
CB
10047cat >>confdefs.h <<_ACEOF
10048#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
10049_ACEOF
8690e634 10050
c0c3707f
CB
10051ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default"
10052if test "x$ac_cv_have_decl_getlogin_r" = xyes; then :
10053 ac_have_decl=1
10054else
10055 ac_have_decl=0
10056fi
8690e634 10057
c0c3707f
CB
10058cat >>confdefs.h <<_ACEOF
10059#define HAVE_DECL_GETLOGIN_R $ac_have_decl
10060_ACEOF
8690e634
JK
10061
10062
6ec2e0f5 10063
c0c3707f
CB
10064ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default"
10065if test "x$ac_cv_have_decl_getlogin" = xyes; then :
10066 ac_have_decl=1
6ec2e0f5 10067else
c0c3707f 10068 ac_have_decl=0
88b48903 10069fi
8690e634 10070
c0c3707f
CB
10071cat >>confdefs.h <<_ACEOF
10072#define HAVE_DECL_GETLOGIN $ac_have_decl
10073_ACEOF
8690e634
JK
10074
10075
10076
c0c3707f
CB
10077 case $host_os in
10078 mingw*)
10079 LIB_GETLOGIN='-ladvapi32' ;;
10080 *)
10081 LIB_GETLOGIN= ;;
10082 esac
6ec2e0f5 10083
472fa5ee
SM
10084
10085
10086
6ec2e0f5
SDJ
10087
10088
10089
c0c3707f
CB
10090 GNULIB_GETTIMEOFDAY=0;
10091 HAVE_GETTIMEOFDAY=1;
10092 HAVE_STRUCT_TIMEVAL=1;
10093 HAVE_SYS_TIME_H=1;
10094 REPLACE_GETTIMEOFDAY=0;
10095 REPLACE_STRUCT_TIMEVAL=0;
472fa5ee 10096
c0c3707f
CB
10097{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
10098$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
10099if ${ac_cv_c_restrict+:} false; then :
10100 $as_echo_n "(cached) " >&6
10101else
10102 ac_cv_c_restrict=no
10103 # The order here caters to the fact that C++ does not require restrict.
10104 for ac_kw in __restrict __restrict__ _Restrict restrict; do
10105 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10106/* end confdefs.h. */
10107typedef int *int_ptr;
10108 int foo (int_ptr $ac_kw ip) { return ip[0]; }
10109 int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
10110 int bar (int ip[$ac_kw]) { return ip[0]; }
472fa5ee 10111
c0c3707f
CB
10112int
10113main ()
10114{
10115int s[1];
10116 int *$ac_kw t = s;
10117 t[0] = 0;
10118 return foo (t) + bar (t);
472fa5ee 10119
c0c3707f
CB
10120 ;
10121 return 0;
10122}
10123_ACEOF
10124if ac_fn_c_try_compile "$LINENO"; then :
10125 ac_cv_c_restrict=$ac_kw
10126fi
10127rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10128 test "$ac_cv_c_restrict" != no && break
10129 done
472fa5ee 10130
c0c3707f
CB
10131fi
10132{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
10133$as_echo "$ac_cv_c_restrict" >&6; }
472fa5ee 10134
c0c3707f
CB
10135 case $ac_cv_c_restrict in
10136 restrict) ;;
10137 no) $as_echo "#define restrict /**/" >>confdefs.h
10138 ;;
10139 *) cat >>confdefs.h <<_ACEOF
10140#define restrict $ac_cv_c_restrict
10141_ACEOF
10142 ;;
10143 esac
472fa5ee
SM
10144
10145
6ec2e0f5
SDJ
10146
10147
10148
10149
10150
10151
472fa5ee
SM
10152
10153
10154
6ec2e0f5
SDJ
10155
10156
10157
10158
10159
10160 if test $gl_cv_have_include_next = yes; then
c0c3707f 10161 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10162 else
c0c3707f
CB
10163 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
10164$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
10165if ${gl_cv_next_sys_time_h+:} false; then :
6ec2e0f5 10166 $as_echo_n "(cached) " >&6
88b48903 10167else
8690e634 10168
c0c3707f 10169 if test $ac_cv_header_sys_time_h = yes; then
8690e634
JK
10170
10171
8690e634
JK
10172
10173
6ec2e0f5
SDJ
10174 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10175/* end confdefs.h. */
c0c3707f 10176#include <sys/time.h>
88b48903 10177_ACEOF
6ec2e0f5
SDJ
10178 case "$host_os" in
10179 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10180 *) gl_absname_cpp="$ac_cpp" ;;
10181 esac
8690e634 10182
6ec2e0f5
SDJ
10183 case "$host_os" in
10184 mingw*)
10185 gl_dirsep_regex='[/\\]'
10186 ;;
10187 *)
10188 gl_dirsep_regex='\/'
88b48903
WN
10189 ;;
10190 esac
6ec2e0f5 10191 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 10192 gl_header_literal_regex=`echo 'sys/time.h' \
6ec2e0f5
SDJ
10193 | sed -e "$gl_make_literal_regex_sed"`
10194 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10195 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10196 s|^/[^/]|//&|
10197 p
10198 q
10199 }'
8690e634 10200
c0c3707f 10201 gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5 10202 sed -n "$gl_absolute_header_sed"`
8690e634 10203
c0c3707f
CB
10204 gl_header=$gl_cv_absolute_sys_time_h
10205 gl_cv_next_sys_time_h='"'$gl_header'"'
6ec2e0f5 10206 else
c0c3707f 10207 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10208 fi
88b48903 10209
88b48903 10210
88b48903 10211fi
c0c3707f
CB
10212{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
10213$as_echo "$gl_cv_next_sys_time_h" >&6; }
6ec2e0f5 10214 fi
c0c3707f 10215 NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
88b48903 10216
6ec2e0f5
SDJ
10217 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10218 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 10219 gl_next_as_first_directive='<'sys/time.h'>'
6ec2e0f5
SDJ
10220 else
10221 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f
CB
10222 gl_next_as_first_directive=$gl_cv_next_sys_time_h
10223 fi
10224 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
6ec2e0f5 10225
6ec2e0f5
SDJ
10226
10227
10228
6ec2e0f5 10229
c0c3707f
CB
10230 if test $ac_cv_header_sys_time_h != yes; then
10231 HAVE_SYS_TIME_H=0
10232 fi
6ec2e0f5 10233
6ec2e0f5 10234
6ec2e0f5 10235
6ec2e0f5 10236
6ec2e0f5 10237
c0c3707f
CB
10238 if test $ac_cv_header_sys_socket_h != yes; then
10239 for ac_header in winsock2.h
10240do :
10241 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10242if test "x$ac_cv_header_winsock2_h" = xyes; then :
10243 cat >>confdefs.h <<_ACEOF
10244#define HAVE_WINSOCK2_H 1
6ec2e0f5 10245_ACEOF
6ec2e0f5 10246
6ec2e0f5 10247fi
6ec2e0f5 10248
c0c3707f 10249done
6ec2e0f5 10250
c0c3707f
CB
10251 fi
10252 if test "$ac_cv_header_winsock2_h" = yes; then
10253 HAVE_WINSOCK2_H=1
10254 UNISTD_H_HAVE_WINSOCK2_H=1
10255 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
10256 else
10257 HAVE_WINSOCK2_H=0
10258 fi
10259
10260
10261 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
10262$as_echo_n "checking for struct timeval... " >&6; }
10263if ${gl_cv_sys_struct_timeval+:} false; then :
10264 $as_echo_n "(cached) " >&6
10265else
10266 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10267/* end confdefs.h. */
c0c3707f
CB
10268#if HAVE_SYS_TIME_H
10269 #include <sys/time.h>
10270 #endif
10271 #include <time.h>
10272 #if HAVE_WINSOCK2_H
10273 # include <winsock2.h>
10274 #endif
6ec2e0f5
SDJ
10275
10276int
10277main ()
10278{
c0c3707f 10279static struct timeval x; x.tv_sec = x.tv_usec;
6ec2e0f5
SDJ
10280 ;
10281 return 0;
10282}
10283_ACEOF
10284if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10285 gl_cv_sys_struct_timeval=yes
6ec2e0f5 10286else
c0c3707f 10287 gl_cv_sys_struct_timeval=no
6ec2e0f5
SDJ
10288fi
10289rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903 10290
c0c3707f
CB
10291fi
10292{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
10293$as_echo "$gl_cv_sys_struct_timeval" >&6; }
10294 if test $gl_cv_sys_struct_timeval != yes; then
10295 HAVE_STRUCT_TIMEVAL=0
10296 else
10297 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
10298$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
10299if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
10300 $as_echo_n "(cached) " >&6
10301else
10302 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88b48903 10303/* end confdefs.h. */
c0c3707f
CB
10304#if HAVE_SYS_TIME_H
10305 #include <sys/time.h>
10306 #endif
10307 #include <time.h>
10308 #if HAVE_WINSOCK2_H
10309 # include <winsock2.h>
10310 #endif
88b48903
WN
10311
10312int
10313main ()
10314{
c0c3707f
CB
10315static struct timeval x;
10316 typedef int verify_tv_sec_type[
10317 sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
10318 ];
88b48903
WN
10319
10320 ;
10321 return 0;
10322}
10323_ACEOF
10324if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10325 gl_cv_sys_struct_timeval_tv_sec=yes
88b48903 10326else
c0c3707f 10327 gl_cv_sys_struct_timeval_tv_sec=no
88b48903
WN
10328fi
10329rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10330
88b48903 10331fi
c0c3707f
CB
10332{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
10333$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
10334 if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
10335 REPLACE_STRUCT_TIMEVAL=1
88b48903 10336 fi
c0c3707f 10337 fi
88b48903 10338
c0c3707f
CB
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349 NEED_LOCALTIME_BUFFER=0
10350
10351
10352 GNULIB_CTIME=0;
10353 GNULIB_MKTIME=0;
10354 GNULIB_LOCALTIME=0;
10355 GNULIB_NANOSLEEP=0;
10356 GNULIB_STRFTIME=0;
10357 GNULIB_STRPTIME=0;
10358 GNULIB_TIMEGM=0;
10359 GNULIB_TIME_R=0;
10360 GNULIB_TIME_RZ=0;
10361 GNULIB_TZSET=0;
10362 HAVE_DECL_LOCALTIME_R=1;
10363 HAVE_NANOSLEEP=1;
10364 HAVE_STRPTIME=1;
10365 HAVE_TIMEGM=1;
10366 HAVE_TZSET=1;
10367 HAVE_TIMEZONE_T=0;
10368 REPLACE_CTIME=GNULIB_PORTCHECK;
10369 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
10370 REPLACE_MKTIME=GNULIB_PORTCHECK;
10371 REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
10372 REPLACE_STRFTIME=GNULIB_PORTCHECK;
10373 REPLACE_TIMEGM=GNULIB_PORTCHECK;
10374 REPLACE_TZSET=GNULIB_PORTCHECK;
10375
10376 : ${GNULIB_GETTIMEOFDAY=0};
10377 REPLACE_GMTIME=0;
10378 REPLACE_LOCALTIME=0;
10379
10380
10381 GNULIB_GLOB=0;
10382 HAVE_GLOB=1;
10383 HAVE_GLOB_PATTERN_P=1;
10384 REPLACE_GLOB=0;
10385 REPLACE_GLOB_PATTERN_P=0;
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403 if test $gl_cv_have_include_next = yes; then
10404 gl_cv_next_glob_h='<'glob.h'>'
10405 else
10406 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5
10407$as_echo_n "checking absolute name of <glob.h>... " >&6; }
10408if ${gl_cv_next_glob_h+:} false; then :
10409 $as_echo_n "(cached) " >&6
88b48903 10410else
c0c3707f
CB
10411
10412 if test $ac_cv_header_glob_h = yes; then
10413
10414
10415
10416
88b48903
WN
10417 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10418/* end confdefs.h. */
c0c3707f
CB
10419#include <glob.h>
10420_ACEOF
10421 case "$host_os" in
10422 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10423 *) gl_absname_cpp="$ac_cpp" ;;
10424 esac
88b48903 10425
c0c3707f
CB
10426 case "$host_os" in
10427 mingw*)
10428 gl_dirsep_regex='[/\\]'
10429 ;;
10430 *)
10431 gl_dirsep_regex='\/'
10432 ;;
10433 esac
10434 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10435 gl_header_literal_regex=`echo 'glob.h' \
10436 | sed -e "$gl_make_literal_regex_sed"`
10437 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10438 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10439 s|^/[^/]|//&|
10440 p
10441 q
10442 }'
10443
10444 gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10445 sed -n "$gl_absolute_header_sed"`
10446
10447 gl_header=$gl_cv_absolute_glob_h
10448 gl_cv_next_glob_h='"'$gl_header'"'
10449 else
10450 gl_cv_next_glob_h='<'glob.h'>'
10451 fi
88b48903 10452
88b48903 10453
88b48903 10454fi
c0c3707f
CB
10455{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5
10456$as_echo "$gl_cv_next_glob_h" >&6; }
10457 fi
10458 NEXT_GLOB_H=$gl_cv_next_glob_h
88b48903 10459
c0c3707f
CB
10460 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10461 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10462 gl_next_as_first_directive='<'glob.h'>'
10463 else
10464 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10465 gl_next_as_first_directive=$gl_cv_next_glob_h
10466 fi
10467 NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive
88b48903 10468
88b48903
WN
10469
10470
10471
2196f55f 10472
c0c3707f
CB
10473 if test $ac_cv_header_glob_h = yes; then
10474 HAVE_GLOB_H=1
10475 else
10476 HAVE_GLOB_H=0
10477 fi
2196f55f 10478
6ec2e0f5 10479
c0c3707f
CB
10480 GLOB_H=''
10481 if false; then
10482 GLOB_H=glob.h
10483 else
10484 if test $ac_cv_header_glob_h != yes; then
10485 GLOB_H=glob.h
10486 fi
10487 fi
10488
10489
10490 if test -n "$GLOB_H"; then
10491 GL_GENERATE_GLOB_H_TRUE=
10492 GL_GENERATE_GLOB_H_FALSE='#'
88b48903 10493else
c0c3707f
CB
10494 GL_GENERATE_GLOB_H_TRUE='#'
10495 GL_GENERATE_GLOB_H_FALSE=
6ec2e0f5
SDJ
10496fi
10497
88b48903 10498
88b48903 10499
88b48903 10500
88b48903
WN
10501
10502
10503
10504
10505
10506
10507
10508
8690e634 10509
c0c3707f
CB
10510
10511
c0c3707f 10512
5df4cba6
SM
10513 if test -z "$gl_pthreadlib_body_done"; then
10514 gl_pthread_api=no
10515 LIBPTHREAD=
10516 LIBPMULTITHREAD=
10517 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
10518 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
10519 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
10520if test "x$ac_cv_header_pthread_h" = xyes; then :
10521 gl_have_pthread_h=yes
c0c3707f 10522else
5df4cba6
SM
10523 gl_have_pthread_h=no
10524fi
c0c3707f 10525
5df4cba6
SM
10526
10527 if test "$gl_have_pthread_h" = yes; then
10528 # Other possible tests:
10529 # -lpthreads (FSU threads, PCthreads)
10530 # -lgthreads
10531 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
10532 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
10533 # the second one only in libpthread, and lock.c needs it.
10534 #
10535 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
10536 # needs -pthread for some reason. See:
10537 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
10538 save_LIBS=$LIBS
10539 for gl_pthread in '' '-pthread'; do
10540 LIBS="$LIBS $gl_pthread"
10541 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 10542/* end confdefs.h. */
5df4cba6
SM
10543#include <pthread.h>
10544 pthread_mutex_t m;
10545 pthread_mutexattr_t ma;
10546
8690e634
JK
10547int
10548main ()
10549{
5df4cba6
SM
10550pthread_mutex_lock (&m);
10551 pthread_mutexattr_init (&ma);
8690e634
JK
10552 ;
10553 return 0;
10554}
10555_ACEOF
5df4cba6
SM
10556if ac_fn_c_try_link "$LINENO"; then :
10557 gl_pthread_api=yes
10558 LIBPTHREAD=$gl_pthread
10559 LIBPMULTITHREAD=$gl_pthread
c0c3707f 10560fi
5df4cba6
SM
10561rm -f core conftest.err conftest.$ac_objext \
10562 conftest$ac_exeext conftest.$ac_ext
10563 LIBS=$save_LIBS
10564 test $gl_pthread_api = yes && break
10565 done
6ec2e0f5 10566
5df4cba6
SM
10567 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
10568 # since it is defined as a macro on OSF/1.)
10569 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
10570 # The program links fine without libpthread. But it may actually
10571 # need to link with libpthread in order to create multiple threads.
10572 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
10573$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
10574if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
10575 $as_echo_n "(cached) " >&6
10576else
5df4cba6
SM
10577 ac_check_lib_save_LIBS=$LIBS
10578LIBS="-lpthread $LIBS"
10579cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 10580/* end confdefs.h. */
5df4cba6
SM
10581
10582/* Override any GCC internal prototype to avoid an error.
10583 Use char because int might match the return type of a GCC
10584 builtin and then its argument prototype would still apply. */
10585#ifdef __cplusplus
10586extern "C"
10587#endif
10588char pthread_kill ();
6ec2e0f5
SDJ
10589int
10590main ()
10591{
5df4cba6 10592return pthread_kill ();
6ec2e0f5
SDJ
10593 ;
10594 return 0;
10595}
10596_ACEOF
5df4cba6
SM
10597if ac_fn_c_try_link "$LINENO"; then :
10598 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 10599else
5df4cba6 10600 ac_cv_lib_pthread_pthread_kill=no
8690e634 10601fi
5df4cba6
SM
10602rm -f core conftest.err conftest.$ac_objext \
10603 conftest$ac_exeext conftest.$ac_ext
10604LIBS=$ac_check_lib_save_LIBS
10605fi
10606{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
10607$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
10608if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
10609 LIBPMULTITHREAD=-lpthread
10610 # On Solaris and HP-UX, most pthread functions exist also in libc.
10611 # Therefore pthread_in_use() needs to actually try to create a
10612 # thread: pthread_create from libc will fail, whereas
10613 # pthread_create will actually create a thread.
10614 # On Solaris 10 or newer, this test is no longer needed, because
10615 # libc contains the fully functional pthread functions.
10616 case "$host_os" in
10617 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
10618
10619$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
10620
10621 esac
c0c3707f 10622
6ec2e0f5 10623fi
8690e634 10624
5df4cba6
SM
10625 elif test $gl_pthread_api != yes; then
10626 # Some library is needed. Try libpthread and libc_r.
10627 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
10628$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
10629if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
10630 $as_echo_n "(cached) " >&6
10631else
10632 ac_check_lib_save_LIBS=$LIBS
10633LIBS="-lpthread $LIBS"
10634cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10635/* end confdefs.h. */
c0c3707f 10636
5df4cba6
SM
10637/* Override any GCC internal prototype to avoid an error.
10638 Use char because int might match the return type of a GCC
10639 builtin and then its argument prototype would still apply. */
10640#ifdef __cplusplus
10641extern "C"
10642#endif
10643char pthread_kill ();
10644int
10645main ()
10646{
10647return pthread_kill ();
10648 ;
10649 return 0;
10650}
10651_ACEOF
10652if ac_fn_c_try_link "$LINENO"; then :
10653 ac_cv_lib_pthread_pthread_kill=yes
10654else
10655 ac_cv_lib_pthread_pthread_kill=no
10656fi
10657rm -f core conftest.err conftest.$ac_objext \
10658 conftest$ac_exeext conftest.$ac_ext
10659LIBS=$ac_check_lib_save_LIBS
10660fi
10661{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
10662$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
10663if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
10664 gl_pthread_api=yes
10665 LIBPTHREAD=-lpthread
10666 LIBPMULTITHREAD=-lpthread
10667fi
c0c3707f 10668
5df4cba6
SM
10669 if test $gl_pthread_api != yes; then
10670 # For FreeBSD 4.
10671 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
10672$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
10673if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
10674 $as_echo_n "(cached) " >&6
10675else
10676 ac_check_lib_save_LIBS=$LIBS
10677LIBS="-lc_r $LIBS"
10678cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10679/* end confdefs.h. */
c0c3707f 10680
5df4cba6
SM
10681/* Override any GCC internal prototype to avoid an error.
10682 Use char because int might match the return type of a GCC
10683 builtin and then its argument prototype would still apply. */
10684#ifdef __cplusplus
10685extern "C"
10686#endif
10687char pthread_kill ();
10688int
10689main ()
10690{
10691return pthread_kill ();
10692 ;
10693 return 0;
10694}
10695_ACEOF
10696if ac_fn_c_try_link "$LINENO"; then :
10697 ac_cv_lib_c_r_pthread_kill=yes
10698else
10699 ac_cv_lib_c_r_pthread_kill=no
10700fi
10701rm -f core conftest.err conftest.$ac_objext \
10702 conftest$ac_exeext conftest.$ac_ext
10703LIBS=$ac_check_lib_save_LIBS
10704fi
10705{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
10706$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
10707if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
10708 gl_pthread_api=yes
10709 LIBPTHREAD=-lc_r
10710 LIBPMULTITHREAD=-lc_r
10711fi
c0c3707f 10712
5df4cba6
SM
10713 fi
10714 fi
10715 fi
10716 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
10717$as_echo_n "checking whether POSIX threads API is available... " >&6; }
10718 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
10719$as_echo "$gl_pthread_api" >&6; }
c0c3707f
CB
10720
10721
5df4cba6 10722 if test $gl_pthread_api = yes; then
c0c3707f 10723
5df4cba6 10724$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
c0c3707f 10725
5df4cba6 10726 fi
c0c3707f 10727
5df4cba6
SM
10728 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10729/* end confdefs.h. */
10730#include <sched.h>
10731int
10732main ()
10733{
10734sched_yield ();
10735 ;
10736 return 0;
10737}
10738_ACEOF
10739if ac_fn_c_try_link "$LINENO"; then :
10740 LIB_SCHED_YIELD=
c0c3707f 10741
5df4cba6
SM
10742else
10743 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
10744$as_echo_n "checking for sched_yield in -lrt... " >&6; }
10745if ${ac_cv_lib_rt_sched_yield+:} false; then :
c0c3707f 10746 $as_echo_n "(cached) " >&6
6ec2e0f5 10747else
5df4cba6
SM
10748 ac_check_lib_save_LIBS=$LIBS
10749LIBS="-lrt $LIBS"
10750cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10751/* end confdefs.h. */
6ec2e0f5 10752
5df4cba6
SM
10753/* Override any GCC internal prototype to avoid an error.
10754 Use char because int might match the return type of a GCC
10755 builtin and then its argument prototype would still apply. */
10756#ifdef __cplusplus
10757extern "C"
10758#endif
10759char sched_yield ();
10760int
10761main ()
10762{
10763return sched_yield ();
10764 ;
10765 return 0;
10766}
10767_ACEOF
10768if ac_fn_c_try_link "$LINENO"; then :
10769 ac_cv_lib_rt_sched_yield=yes
10770else
10771 ac_cv_lib_rt_sched_yield=no
10772fi
10773rm -f core conftest.err conftest.$ac_objext \
10774 conftest$ac_exeext conftest.$ac_ext
10775LIBS=$ac_check_lib_save_LIBS
10776fi
10777{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
10778$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
10779if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
10780 LIB_SCHED_YIELD=-lrt
10781else
10782 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
10783$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
10784if ${ac_cv_lib_posix4_sched_yield+:} false; then :
10785 $as_echo_n "(cached) " >&6
10786else
10787 ac_check_lib_save_LIBS=$LIBS
10788LIBS="-lposix4 $LIBS"
10789cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10790/* end confdefs.h. */
6ec2e0f5 10791
5df4cba6
SM
10792/* Override any GCC internal prototype to avoid an error.
10793 Use char because int might match the return type of a GCC
10794 builtin and then its argument prototype would still apply. */
10795#ifdef __cplusplus
10796extern "C"
10797#endif
10798char sched_yield ();
10799int
10800main ()
10801{
10802return sched_yield ();
10803 ;
10804 return 0;
10805}
10806_ACEOF
10807if ac_fn_c_try_link "$LINENO"; then :
10808 ac_cv_lib_posix4_sched_yield=yes
10809else
10810 ac_cv_lib_posix4_sched_yield=no
10811fi
10812rm -f core conftest.err conftest.$ac_objext \
10813 conftest$ac_exeext conftest.$ac_ext
10814LIBS=$ac_check_lib_save_LIBS
10815fi
10816{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
10817$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
10818if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
10819 LIB_SCHED_YIELD=-lposix4
6ec2e0f5 10820fi
8690e634 10821
5df4cba6 10822fi
8690e634 10823
8690e634 10824
5df4cba6
SM
10825fi
10826rm -f core conftest.err conftest.$ac_objext \
10827 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5
SDJ
10828
10829
5df4cba6 10830 gl_pthreadlib_body_done=done
c0c3707f 10831 fi
6ec2e0f5 10832
6ec2e0f5 10833
8690e634
JK
10834
10835
472fa5ee 10836
c0c3707f 10837
c0c3707f 10838
c0c3707f 10839
c0c3707f 10840
5df4cba6
SM
10841 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
10842$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
10843if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
10844 $as_echo_n "(cached) " >&6
10845else
10846 case "$host_os" in
10847 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
10848 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
10849 gl_cv_func_setlocale_null_all_mtsafe=no ;;
10850 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
10851 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
10852 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
10853 # If we don't know, obey --enable-cross-guesses.
10854 *)
10855 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
10856 esac
c0c3707f 10857
5e8754f9 10858fi
5df4cba6
SM
10859{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
10860$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
10861 case "$host_os" in
10862 mingw*) ;;
10863 *)
10864 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
10865 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
10866 fi
10867 ;;
10868 esac
10869 case "$gl_cv_func_setlocale_null_all_mtsafe" in
10870 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
10871 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
10872 esac
5e8754f9
SDJ
10873
10874cat >>confdefs.h <<_ACEOF
5df4cba6 10875#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
5e8754f9
SDJ
10876_ACEOF
10877
10878
5df4cba6
SM
10879 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
10880$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
10881if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
10882 $as_echo_n "(cached) " >&6
10883else
10884 case "$host_os" in
10885 # Guess no on OpenBSD, AIX.
10886 openbsd* | aix*)
10887 gl_cv_func_setlocale_null_one_mtsafe=no ;;
10888 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
10889 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
10890 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
10891 # If we don't know, obey --enable-cross-guesses.
10892 *)
10893 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
10894 esac
5abebf3c 10895
5df4cba6
SM
10896fi
10897{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
10898$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
10899 case "$host_os" in
10900 mingw*) ;;
10901 *)
10902 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
10903 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
10904 fi
10905 ;;
10906 esac
10907 case "$gl_cv_func_setlocale_null_one_mtsafe" in
10908 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
10909 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
10910 esac
5abebf3c 10911
c0c3707f 10912cat >>confdefs.h <<_ACEOF
5df4cba6 10913#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
5abebf3c 10914_ACEOF
c0c3707f
CB
10915
10916
5df4cba6
SM
10917 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
10918 case "$host_os" in
10919 mingw*) LIB_SETLOCALE_NULL= ;;
10920 *)
10921
10922
10923 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
10924$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
10925if ${gl_cv_have_weak+:} false; then :
10926 $as_echo_n "(cached) " >&6
5abebf3c 10927else
5df4cba6
SM
10928 gl_cv_have_weak=no
10929 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10930/* end confdefs.h. */
10931extern void xyzzy ();
10932#pragma weak xyzzy
10933int
10934main ()
10935{
10936xyzzy();
10937 ;
10938 return 0;
10939}
10940_ACEOF
10941if ac_fn_c_try_link "$LINENO"; then :
10942 gl_cv_have_weak=maybe
5abebf3c 10943fi
5df4cba6
SM
10944rm -f core conftest.err conftest.$ac_objext \
10945 conftest$ac_exeext conftest.$ac_ext
10946 if test $gl_cv_have_weak = maybe; then
10947 if test "$cross_compiling" = yes; then :
10948 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10949/* end confdefs.h. */
10950#ifdef __ELF__
10951 Extensible Linking Format
10952 #endif
c0c3707f 10953
5df4cba6
SM
10954_ACEOF
10955if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10956 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
10957 gl_cv_have_weak="guessing yes"
10958else
10959 gl_cv_have_weak="guessing no"
10960fi
10961rm -f conftest*
5abebf3c
CB
10962
10963
5df4cba6
SM
10964else
10965 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10966/* end confdefs.h. */
5abebf3c 10967
5df4cba6
SM
10968#include <stdio.h>
10969#pragma weak fputs
10970int main ()
10971{
10972 return (fputs == NULL);
10973}
c0c3707f 10974_ACEOF
5df4cba6
SM
10975if ac_fn_c_try_run "$LINENO"; then :
10976 gl_cv_have_weak=yes
10977else
10978 gl_cv_have_weak=no
10979fi
10980rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10981 conftest.$ac_objext conftest.beam conftest.$ac_ext
10982fi
10983
10984 fi
10985 case " $LDFLAGS " in
10986 *" -static "*) gl_cv_have_weak=no ;;
10987 esac
10988 case "$gl_cv_have_weak" in
10989 *yes)
10990 case "$host_os" in
10991 freebsd* | dragonfly*)
10992 : > conftest1.c
10993 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
10994 cat <<EOF > conftest2.c
10995#include <pthread.h>
10996#pragma weak pthread_mutexattr_gettype
10997int main ()
10998{
10999 return (pthread_mutexattr_gettype != NULL);
11000}
11001EOF
11002 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
11003 || gl_cv_have_weak=no
11004 rm -f conftest1.c libempty.so conftest2.c conftest
11005 ;;
11006 esac
11007 ;;
11008 esac
5abebf3c 11009
c0c3707f 11010fi
5df4cba6
SM
11011{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
11012$as_echo "$gl_cv_have_weak" >&6; }
11013 case "$gl_cv_have_weak" in
11014 *yes)
5abebf3c 11015
5df4cba6 11016$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
5abebf3c 11017
5df4cba6
SM
11018 ;;
11019 esac
11020
11021 case "$gl_cv_have_weak" in
11022 *yes) LIB_SETLOCALE_NULL= ;;
11023 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
11024 esac
11025 ;;
11026 esac
5abebf3c 11027 else
5df4cba6 11028 LIB_SETLOCALE_NULL=
5abebf3c 11029 fi
5abebf3c
CB
11030
11031
11032
5abebf3c 11033
5abebf3c 11034
5df4cba6
SM
11035 GNULIB_SOCKET=0;
11036 GNULIB_CONNECT=0;
11037 GNULIB_ACCEPT=0;
11038 GNULIB_BIND=0;
11039 GNULIB_GETPEERNAME=0;
11040 GNULIB_GETSOCKNAME=0;
11041 GNULIB_GETSOCKOPT=0;
11042 GNULIB_LISTEN=0;
11043 GNULIB_RECV=0;
11044 GNULIB_SEND=0;
11045 GNULIB_RECVFROM=0;
11046 GNULIB_SENDTO=0;
11047 GNULIB_SETSOCKOPT=0;
11048 GNULIB_SHUTDOWN=0;
11049 GNULIB_ACCEPT4=0;
11050 HAVE_STRUCT_SOCKADDR_STORAGE=1;
11051 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
11052
11053 HAVE_SA_FAMILY_T=1;
11054 HAVE_ACCEPT4=1;
c0c3707f
CB
11055
11056
11057
11058
11059
5df4cba6
SM
11060 case "$host_os" in
11061 osf*)
c0c3707f 11062
5df4cba6 11063$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
c0c3707f 11064
5df4cba6
SM
11065 ;;
11066 esac
c0c3707f 11067
5df4cba6
SM
11068 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
11069$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
11070if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
5abebf3c
CB
11071 $as_echo_n "(cached) " >&6
11072else
5df4cba6
SM
11073
11074 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11075/* end confdefs.h. */
c0c3707f 11076#include <sys/socket.h>
c0c3707f
CB
11077int
11078main ()
11079{
5df4cba6 11080
c0c3707f
CB
11081 ;
11082 return 0;
11083}
11084_ACEOF
11085if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11086 gl_cv_header_sys_socket_h_selfcontained=yes
5abebf3c 11087else
5df4cba6 11088 gl_cv_header_sys_socket_h_selfcontained=no
5abebf3c 11089fi
c0c3707f 11090rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11091
5df4cba6
SM
11092fi
11093{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
11094$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
11095 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
11096 for ac_func in shutdown
11097do :
11098 ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
11099if test "x$ac_cv_func_shutdown" = xyes; then :
11100 cat >>confdefs.h <<_ACEOF
11101#define HAVE_SHUTDOWN 1
11102_ACEOF
c0c3707f 11103
5df4cba6
SM
11104fi
11105done
c0c3707f 11106
5df4cba6
SM
11107 if test $ac_cv_func_shutdown = yes; then
11108 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
11109$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
11110if ${gl_cv_header_sys_socket_h_shut+:} false; then :
5abebf3c
CB
11111 $as_echo_n "(cached) " >&6
11112else
5df4cba6
SM
11113
11114 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11115/* end confdefs.h. */
c0c3707f 11116#include <sys/socket.h>
c0c3707f
CB
11117int
11118main ()
11119{
5df4cba6 11120int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
c0c3707f
CB
11121 ;
11122 return 0;
11123}
11124_ACEOF
11125if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11126 gl_cv_header_sys_socket_h_shut=yes
c0c3707f 11127else
5df4cba6 11128 gl_cv_header_sys_socket_h_shut=no
c0c3707f
CB
11129fi
11130rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11131
5df4cba6
SM
11132fi
11133{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
11134$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
11135 if test $gl_cv_header_sys_socket_h_shut = no; then
11136 SYS_SOCKET_H='sys/socket.h'
11137 fi
11138 fi
c0c3707f 11139 fi
5df4cba6 11140 # We need to check for ws2tcpip.h now.
5abebf3c 11141
5abebf3c 11142
5abebf3c 11143
5abebf3c
CB
11144
11145
11146
11147
c0c3707f
CB
11148
11149
11150
11151
11152 if test $gl_cv_have_include_next = yes; then
5df4cba6 11153 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11154 else
5df4cba6
SM
11155 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
11156$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
11157if ${gl_cv_next_sys_socket_h+:} false; then :
5abebf3c
CB
11158 $as_echo_n "(cached) " >&6
11159else
5abebf3c 11160
5df4cba6 11161 if test $ac_cv_header_sys_socket_h = yes; then
5abebf3c 11162
5abebf3c
CB
11163
11164
c0c3707f
CB
11165
11166 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11167/* end confdefs.h. */
5df4cba6 11168#include <sys/socket.h>
c0c3707f
CB
11169_ACEOF
11170 case "$host_os" in
11171 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11172 *) gl_absname_cpp="$ac_cpp" ;;
11173 esac
11174
11175 case "$host_os" in
11176 mingw*)
11177 gl_dirsep_regex='[/\\]'
5abebf3c
CB
11178 ;;
11179 *)
c0c3707f 11180 gl_dirsep_regex='\/'
5abebf3c
CB
11181 ;;
11182 esac
c0c3707f 11183 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
5df4cba6 11184 gl_header_literal_regex=`echo 'sys/socket.h' \
c0c3707f
CB
11185 | sed -e "$gl_make_literal_regex_sed"`
11186 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11187 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11188 s|^/[^/]|//&|
11189 p
11190 q
11191 }'
5abebf3c 11192
5df4cba6 11193 gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
c0c3707f 11194 sed -n "$gl_absolute_header_sed"`
5abebf3c 11195
5df4cba6
SM
11196 gl_header=$gl_cv_absolute_sys_socket_h
11197 gl_cv_next_sys_socket_h='"'$gl_header'"'
c0c3707f 11198 else
5df4cba6 11199 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11200 fi
5abebf3c 11201
5abebf3c 11202
5abebf3c 11203fi
5df4cba6
SM
11204{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
11205$as_echo "$gl_cv_next_sys_socket_h" >&6; }
c0c3707f 11206 fi
5df4cba6 11207 NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
c0c3707f
CB
11208
11209 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11210 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
5df4cba6 11211 gl_next_as_first_directive='<'sys/socket.h'>'
c0c3707f
CB
11212 else
11213 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
5df4cba6 11214 gl_next_as_first_directive=$gl_cv_next_sys_socket_h
c0c3707f 11215 fi
5df4cba6 11216 NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
5abebf3c
CB
11217
11218
c0c3707f
CB
11219
11220
5df4cba6
SM
11221 if test $ac_cv_header_sys_socket_h = yes; then
11222 HAVE_SYS_SOCKET_H=1
11223 else
11224 HAVE_SYS_SOCKET_H=0
11225 fi
c0c3707f 11226
5abebf3c 11227
c0c3707f 11228
5df4cba6
SM
11229 if test $ac_cv_header_sys_socket_h = yes; then
11230 HAVE_WS2TCPIP_H=0
11231 else
11232 if test $ac_cv_header_ws2tcpip_h = yes; then
11233 HAVE_WS2TCPIP_H=1
11234 else
11235 HAVE_WS2TCPIP_H=0
11236 fi
11237 fi
11238
11239
11240
11241 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
11242 /* sys/types.h is not needed according to POSIX, but the
11243 sys/socket.h in i386-unknown-freebsd4.10 and
11244 powerpc-apple-darwin5.5 required it. */
11245#include <sys/types.h>
11246#ifdef HAVE_SYS_SOCKET_H
11247#include <sys/socket.h>
11248#endif
11249#ifdef HAVE_WS2TCPIP_H
11250#include <ws2tcpip.h>
11251#endif
11252
11253"
11254if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
11255
11256cat >>confdefs.h <<_ACEOF
11257#define HAVE_STRUCT_SOCKADDR_STORAGE 1
5abebf3c 11258_ACEOF
5df4cba6
SM
11259
11260
5abebf3c 11261fi
5df4cba6
SM
11262ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
11263 /* sys/types.h is not needed according to POSIX, but the
11264 sys/socket.h in i386-unknown-freebsd4.10 and
11265 powerpc-apple-darwin5.5 required it. */
11266#include <sys/types.h>
11267#ifdef HAVE_SYS_SOCKET_H
11268#include <sys/socket.h>
11269#endif
11270#ifdef HAVE_WS2TCPIP_H
11271#include <ws2tcpip.h>
11272#endif
11273
11274"
11275if test "x$ac_cv_type_sa_family_t" = xyes; then :
11276
11277cat >>confdefs.h <<_ACEOF
11278#define HAVE_SA_FAMILY_T 1
11279_ACEOF
11280
11281
5abebf3c 11282fi
5df4cba6
SM
11283
11284 if test $ac_cv_type_struct_sockaddr_storage = no; then
11285 HAVE_STRUCT_SOCKADDR_STORAGE=0
11286 fi
11287 if test $ac_cv_type_sa_family_t = no; then
11288 HAVE_SA_FAMILY_T=0
c0c3707f 11289 fi
5df4cba6
SM
11290 if test $ac_cv_type_struct_sockaddr_storage != no; then
11291 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
11292 #ifdef HAVE_SYS_SOCKET_H
11293 #include <sys/socket.h>
11294 #endif
11295 #ifdef HAVE_WS2TCPIP_H
11296 #include <ws2tcpip.h>
11297 #endif
11298
11299"
11300if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
11301
11302cat >>confdefs.h <<_ACEOF
11303#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
11304_ACEOF
11305
5abebf3c 11306
5abebf3c 11307else
5df4cba6 11308 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
5abebf3c
CB
11309fi
11310
5df4cba6
SM
11311 fi
11312 if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
11313 || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
11314 SYS_SOCKET_H='sys/socket.h'
11315 fi
5abebf3c 11316
5abebf3c 11317
5df4cba6
SM
11318
11319
11320 if test $ac_cv_header_sys_socket_h != yes; then
11321 for ac_header in winsock2.h
11322do :
11323 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
11324if test "x$ac_cv_header_winsock2_h" = xyes; then :
11325 cat >>confdefs.h <<_ACEOF
11326#define HAVE_WINSOCK2_H 1
11327_ACEOF
11328
11329fi
11330
11331done
11332
11333 fi
11334 if test "$ac_cv_header_winsock2_h" = yes; then
11335 HAVE_WINSOCK2_H=1
11336 UNISTD_H_HAVE_WINSOCK2_H=1
11337 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
11338 else
11339 HAVE_WINSOCK2_H=0
11340 fi
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
11355$as_echo_n "checking for IPv4 sockets... " >&6; }
11356if ${gl_cv_socket_ipv4+:} false; then :
5abebf3c
CB
11357 $as_echo_n "(cached) " >&6
11358else
c0c3707f 11359 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11360/* end confdefs.h. */
5df4cba6
SM
11361#include <sys/types.h>
11362#ifdef HAVE_SYS_SOCKET_H
11363#include <sys/socket.h>
11364#endif
11365#ifdef HAVE_NETINET_IN_H
11366#include <netinet/in.h>
11367#endif
11368#ifdef HAVE_WINSOCK2_H
11369#include <winsock2.h>
11370#endif
5abebf3c
CB
11371int
11372main ()
11373{
5df4cba6
SM
11374int x = AF_INET; struct in_addr y; struct sockaddr_in z;
11375 if (&x && &y && &z) return 0;
5abebf3c
CB
11376 ;
11377 return 0;
11378}
11379_ACEOF
c0c3707f 11380if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11381 gl_cv_socket_ipv4=yes
5abebf3c 11382else
5df4cba6 11383 gl_cv_socket_ipv4=no
5abebf3c 11384fi
c0c3707f 11385rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11386fi
5df4cba6
SM
11387{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
11388$as_echo "$gl_cv_socket_ipv4" >&6; }
11389 if test $gl_cv_socket_ipv4 = yes; then
5abebf3c 11390
5df4cba6 11391$as_echo "#define HAVE_IPV4 1" >>confdefs.h
5abebf3c 11392
5df4cba6 11393 fi
5abebf3c 11394
5df4cba6
SM
11395 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
11396$as_echo_n "checking for IPv6 sockets... " >&6; }
11397if ${gl_cv_socket_ipv6+:} false; then :
5abebf3c
CB
11398 $as_echo_n "(cached) " >&6
11399else
c0c3707f 11400 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11401/* end confdefs.h. */
5df4cba6
SM
11402#include <sys/types.h>
11403#ifdef HAVE_SYS_SOCKET_H
11404#include <sys/socket.h>
5abebf3c 11405#endif
5df4cba6
SM
11406#ifdef HAVE_NETINET_IN_H
11407#include <netinet/in.h>
11408#endif
11409#ifdef HAVE_WINSOCK2_H
11410#include <winsock2.h>
11411#endif
11412#ifdef HAVE_WS2TCPIP_H
11413#include <ws2tcpip.h>
11414#endif
11415int
11416main ()
11417{
11418int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
11419 if (&x && &y && &z) return 0;
11420 ;
11421 return 0;
11422}
11423_ACEOF
11424if ac_fn_c_try_compile "$LINENO"; then :
11425 gl_cv_socket_ipv6=yes
11426else
11427 gl_cv_socket_ipv6=no
11428fi
11429rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11430fi
11431{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
11432$as_echo "$gl_cv_socket_ipv6" >&6; }
11433 if test $gl_cv_socket_ipv6 = yes; then
11434
11435$as_echo "#define HAVE_IPV6 1" >>confdefs.h
11436
11437 fi
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451 if test $gl_cv_have_include_next = yes; then
11452 gl_cv_next_limits_h='<'limits.h'>'
11453 else
11454 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
11455$as_echo_n "checking absolute name of <limits.h>... " >&6; }
11456if ${gl_cv_next_limits_h+:} false; then :
11457 $as_echo_n "(cached) " >&6
11458else
11459
11460 if test $ac_cv_header_limits_h = yes; then
11461
11462
11463
11464
11465 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11466/* end confdefs.h. */
11467#include <limits.h>
11468_ACEOF
11469 case "$host_os" in
11470 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11471 *) gl_absname_cpp="$ac_cpp" ;;
11472 esac
11473
11474 case "$host_os" in
11475 mingw*)
11476 gl_dirsep_regex='[/\\]'
11477 ;;
11478 *)
11479 gl_dirsep_regex='\/'
11480 ;;
11481 esac
11482 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11483 gl_header_literal_regex=`echo 'limits.h' \
11484 | sed -e "$gl_make_literal_regex_sed"`
11485 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11486 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11487 s|^/[^/]|//&|
11488 p
11489 q
11490 }'
11491
11492 gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11493 sed -n "$gl_absolute_header_sed"`
11494
11495 gl_header=$gl_cv_absolute_limits_h
11496 gl_cv_next_limits_h='"'$gl_header'"'
11497 else
11498 gl_cv_next_limits_h='<'limits.h'>'
11499 fi
11500
11501
11502fi
11503{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
11504$as_echo "$gl_cv_next_limits_h" >&6; }
11505 fi
11506 NEXT_LIMITS_H=$gl_cv_next_limits_h
11507
11508 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11509 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11510 gl_next_as_first_directive='<'limits.h'>'
11511 else
11512 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11513 gl_next_as_first_directive=$gl_cv_next_limits_h
11514 fi
11515 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
11516
11517
11518
11519
11520
11521 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
11522$as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
11523if ${gl_cv_header_limits_width+:} false; then :
11524 $as_echo_n "(cached) " >&6
11525else
11526 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11527/* end confdefs.h. */
11528#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
11529 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
11530 #endif
11531 #include <limits.h>
11532 long long llm = LLONG_MAX;
11533 int wb = WORD_BIT;
11534 int ullw = ULLONG_WIDTH;
c0c3707f 11535
5abebf3c
CB
11536int
11537main ()
11538{
c0c3707f 11539
5abebf3c
CB
11540 ;
11541 return 0;
11542}
11543_ACEOF
c0c3707f 11544if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11545 gl_cv_header_limits_width=yes
5abebf3c 11546else
5df4cba6 11547 gl_cv_header_limits_width=no
5abebf3c 11548fi
c0c3707f 11549rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11550fi
5df4cba6
SM
11551{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
11552$as_echo "$gl_cv_header_limits_width" >&6; }
11553 if test "$gl_cv_header_limits_width" = yes; then
11554 LIMITS_H=
c0c3707f 11555 else
5df4cba6 11556 LIMITS_H=limits.h
c0c3707f 11557 fi
5abebf3c 11558
5df4cba6
SM
11559 if test -n "$LIMITS_H"; then
11560 GL_GENERATE_LIMITS_H_TRUE=
11561 GL_GENERATE_LIMITS_H_FALSE='#'
11562else
11563 GL_GENERATE_LIMITS_H_TRUE='#'
11564 GL_GENERATE_LIMITS_H_FALSE=
11565fi
c0c3707f
CB
11566
11567
5abebf3c 11568
5df4cba6
SM
11569 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
11570$as_echo_n "checking for wint_t... " >&6; }
11571if ${gt_cv_c_wint_t+:} false; then :
c0c3707f 11572 $as_echo_n "(cached) " >&6
c0c3707f
CB
11573else
11574 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11575/* end confdefs.h. */
5df4cba6
SM
11576
11577/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
11578 <wchar.h>.
11579 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
11580 before <wchar.h>. */
11581#include <stddef.h>
11582#include <stdio.h>
11583#include <time.h>
11584#include <wchar.h>
11585 wint_t foo = (wchar_t)'\0';
5abebf3c
CB
11586int
11587main ()
11588{
5df4cba6 11589
5abebf3c
CB
11590 ;
11591 return 0;
11592}
11593_ACEOF
5df4cba6
SM
11594if ac_fn_c_try_compile "$LINENO"; then :
11595 gt_cv_c_wint_t=yes
c0c3707f 11596else
5df4cba6 11597 gt_cv_c_wint_t=no
c0c3707f 11598fi
5df4cba6 11599rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 11600fi
5df4cba6
SM
11601{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
11602$as_echo "$gt_cv_c_wint_t" >&6; }
11603 if test $gt_cv_c_wint_t = yes; then
5abebf3c 11604
5df4cba6 11605$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
5abebf3c
CB
11606
11607
5df4cba6
SM
11608 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5
11609$as_echo_n "checking whether wint_t is too small... " >&6; }
11610if ${gl_cv_type_wint_t_too_small+:} false; then :
11611 $as_echo_n "(cached) " >&6
11612else
11613 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11614/* end confdefs.h. */
11615
11616/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
11617 <wchar.h>.
11618 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11619 included before <wchar.h>. */
11620#if !(defined __GLIBC__ && !defined __UCLIBC__)
11621# include <stddef.h>
11622# include <stdio.h>
11623# include <time.h>
11624#endif
11625#include <wchar.h>
11626 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
11627
11628int
11629main ()
11630{
11631
11632 ;
11633 return 0;
11634}
11635_ACEOF
11636if ac_fn_c_try_compile "$LINENO"; then :
11637 gl_cv_type_wint_t_too_small=no
11638else
11639 gl_cv_type_wint_t_too_small=yes
11640fi
11641rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11642fi
11643{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5
11644$as_echo "$gl_cv_type_wint_t_too_small" >&6; }
11645 if test $gl_cv_type_wint_t_too_small = yes; then
11646 GNULIB_OVERRIDES_WINT_T=1
11647 else
11648 GNULIB_OVERRIDES_WINT_T=0
11649 fi
11650 else
11651 GNULIB_OVERRIDES_WINT_T=0
c0c3707f 11652 fi
5abebf3c 11653
5abebf3c
CB
11654
11655
11656
11657
11658
5df4cba6 11659
c0c3707f
CB
11660 gl_cv_c_multiarch=no
11661 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11662/* end confdefs.h. */
11663#ifndef __APPLE_CC__
11664 not a universal capable compiler
11665 #endif
11666 typedef int dummy;
5abebf3c 11667
c0c3707f
CB
11668_ACEOF
11669if ac_fn_c_try_compile "$LINENO"; then :
5abebf3c 11670
c0c3707f
CB
11671 arch=
11672 prev=
11673 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
11674 if test -n "$prev"; then
11675 case $word in
11676 i?86 | x86_64 | ppc | ppc64)
11677 if test -z "$arch" || test "$arch" = "$word"; then
11678 arch="$word"
11679 else
11680 gl_cv_c_multiarch=yes
11681 fi
11682 ;;
11683 esac
11684 prev=
11685 else
11686 if test "x$word" = "x-arch"; then
11687 prev=arch
11688 fi
11689 fi
11690 done
5abebf3c 11691
c0c3707f
CB
11692fi
11693rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11694 if test $gl_cv_c_multiarch = yes; then
11695 APPLE_UNIVERSAL_BUILD=1
11696 else
11697 APPLE_UNIVERSAL_BUILD=0
11698 fi
5abebf3c 11699
5abebf3c 11700
5abebf3c 11701
5abebf3c
CB
11702
11703
5abebf3c 11704
5abebf3c 11705
5abebf3c 11706
5df4cba6 11707$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 11708
5abebf3c 11709
5df4cba6 11710$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 11711
c0c3707f
CB
11712
11713
11714 if test $ac_cv_header_wchar_h = yes; then
11715 HAVE_WCHAR_H=1
11716 else
11717 HAVE_WCHAR_H=0
5abebf3c 11718 fi
c0c3707f
CB
11719
11720
11721 if test $ac_cv_header_inttypes_h = yes; then
11722 HAVE_INTTYPES_H=1
11723 else
11724 HAVE_INTTYPES_H=0
5abebf3c
CB
11725 fi
11726
11727
c0c3707f
CB
11728 if test $ac_cv_header_sys_types_h = yes; then
11729 HAVE_SYS_TYPES_H=1
11730 else
11731 HAVE_SYS_TYPES_H=0
11732 fi
11733
5abebf3c
CB
11734
11735
11736
11737
5abebf3c 11738
5abebf3c 11739
5abebf3c 11740
5abebf3c 11741
5abebf3c
CB
11742
11743
c0c3707f
CB
11744 if test $gl_cv_have_include_next = yes; then
11745 gl_cv_next_stdint_h='<'stdint.h'>'
11746 else
11747 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
11748$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
11749if ${gl_cv_next_stdint_h+:} false; then :
11750 $as_echo_n "(cached) " >&6
11751else
5abebf3c 11752
c0c3707f 11753 if test $ac_cv_header_stdint_h = yes; then
5abebf3c 11754
5abebf3c
CB
11755
11756
11757
c0c3707f 11758 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11759/* end confdefs.h. */
c0c3707f 11760#include <stdint.h>
5abebf3c 11761_ACEOF
c0c3707f
CB
11762 case "$host_os" in
11763 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11764 *) gl_absname_cpp="$ac_cpp" ;;
11765 esac
5abebf3c 11766
c0c3707f
CB
11767 case "$host_os" in
11768 mingw*)
11769 gl_dirsep_regex='[/\\]'
11770 ;;
11771 *)
11772 gl_dirsep_regex='\/'
11773 ;;
11774 esac
11775 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11776 gl_header_literal_regex=`echo 'stdint.h' \
11777 | sed -e "$gl_make_literal_regex_sed"`
11778 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11779 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11780 s|^/[^/]|//&|
11781 p
11782 q
11783 }'
5abebf3c 11784
c0c3707f
CB
11785 gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11786 sed -n "$gl_absolute_header_sed"`
5abebf3c 11787
c0c3707f
CB
11788 gl_header=$gl_cv_absolute_stdint_h
11789 gl_cv_next_stdint_h='"'$gl_header'"'
11790 else
11791 gl_cv_next_stdint_h='<'stdint.h'>'
11792 fi
5abebf3c 11793
5abebf3c 11794
c0c3707f
CB
11795fi
11796{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
11797$as_echo "$gl_cv_next_stdint_h" >&6; }
11798 fi
11799 NEXT_STDINT_H=$gl_cv_next_stdint_h
5abebf3c 11800
c0c3707f
CB
11801 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11802 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11803 gl_next_as_first_directive='<'stdint.h'>'
11804 else
11805 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11806 gl_next_as_first_directive=$gl_cv_next_stdint_h
11807 fi
11808 NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
5abebf3c 11809
5e8754f9 11810
5e8754f9 11811
5e8754f9 11812
c0c3707f
CB
11813 if test $ac_cv_header_stdint_h = yes; then
11814 HAVE_STDINT_H=1
11815 else
11816 HAVE_STDINT_H=0
11817 fi
5e8754f9
SDJ
11818
11819
c0c3707f
CB
11820 if test $ac_cv_header_stdint_h = yes; then
11821 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
11822$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
11823if ${gl_cv_header_working_stdint_h+:} false; then :
11824 $as_echo_n "(cached) " >&6
11825else
11826 gl_cv_header_working_stdint_h=no
11827 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11828/* end confdefs.h. */
5e8754f9 11829
5e8754f9 11830
c0c3707f
CB
11831#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
11832#define __STDC_CONSTANT_MACROS 1
11833#define __STDC_LIMIT_MACROS 1
11834#include <stdint.h>
11835/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
11836#if !(defined WCHAR_MIN && defined WCHAR_MAX)
11837#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
11838#endif
5e8754f9
SDJ
11839
11840
c0c3707f
CB
11841 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11842 included before <wchar.h>. */
11843 #include <stddef.h>
11844 #include <signal.h>
11845 #if HAVE_WCHAR_H
11846 # include <stdio.h>
11847 # include <time.h>
11848 # include <wchar.h>
11849 #endif
f45c62c4
YQ
11850
11851
c0c3707f
CB
11852#ifdef INT8_MAX
11853int8_t a1 = INT8_MAX;
11854int8_t a1min = INT8_MIN;
11855#endif
11856#ifdef INT16_MAX
11857int16_t a2 = INT16_MAX;
11858int16_t a2min = INT16_MIN;
11859#endif
11860#ifdef INT32_MAX
11861int32_t a3 = INT32_MAX;
11862int32_t a3min = INT32_MIN;
11863#endif
11864#ifdef INT64_MAX
11865int64_t a4 = INT64_MAX;
11866int64_t a4min = INT64_MIN;
11867#endif
11868#ifdef UINT8_MAX
11869uint8_t b1 = UINT8_MAX;
11870#else
11871typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
11872#endif
11873#ifdef UINT16_MAX
11874uint16_t b2 = UINT16_MAX;
11875#endif
11876#ifdef UINT32_MAX
11877uint32_t b3 = UINT32_MAX;
11878#endif
11879#ifdef UINT64_MAX
11880uint64_t b4 = UINT64_MAX;
11881#endif
11882int_least8_t c1 = INT8_C (0x7f);
11883int_least8_t c1max = INT_LEAST8_MAX;
11884int_least8_t c1min = INT_LEAST8_MIN;
11885int_least16_t c2 = INT16_C (0x7fff);
11886int_least16_t c2max = INT_LEAST16_MAX;
11887int_least16_t c2min = INT_LEAST16_MIN;
11888int_least32_t c3 = INT32_C (0x7fffffff);
11889int_least32_t c3max = INT_LEAST32_MAX;
11890int_least32_t c3min = INT_LEAST32_MIN;
11891int_least64_t c4 = INT64_C (0x7fffffffffffffff);
11892int_least64_t c4max = INT_LEAST64_MAX;
11893int_least64_t c4min = INT_LEAST64_MIN;
11894uint_least8_t d1 = UINT8_C (0xff);
11895uint_least8_t d1max = UINT_LEAST8_MAX;
11896uint_least16_t d2 = UINT16_C (0xffff);
11897uint_least16_t d2max = UINT_LEAST16_MAX;
11898uint_least32_t d3 = UINT32_C (0xffffffff);
11899uint_least32_t d3max = UINT_LEAST32_MAX;
11900uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
11901uint_least64_t d4max = UINT_LEAST64_MAX;
11902int_fast8_t e1 = INT_FAST8_MAX;
11903int_fast8_t e1min = INT_FAST8_MIN;
11904int_fast16_t e2 = INT_FAST16_MAX;
11905int_fast16_t e2min = INT_FAST16_MIN;
11906int_fast32_t e3 = INT_FAST32_MAX;
11907int_fast32_t e3min = INT_FAST32_MIN;
11908int_fast64_t e4 = INT_FAST64_MAX;
11909int_fast64_t e4min = INT_FAST64_MIN;
11910uint_fast8_t f1 = UINT_FAST8_MAX;
11911uint_fast16_t f2 = UINT_FAST16_MAX;
11912uint_fast32_t f3 = UINT_FAST32_MAX;
11913uint_fast64_t f4 = UINT_FAST64_MAX;
11914#ifdef INTPTR_MAX
11915intptr_t g = INTPTR_MAX;
11916intptr_t gmin = INTPTR_MIN;
11917#endif
11918#ifdef UINTPTR_MAX
11919uintptr_t h = UINTPTR_MAX;
11920#endif
11921intmax_t i = INTMAX_MAX;
11922uintmax_t j = UINTMAX_MAX;
472fa5ee 11923
c0c3707f
CB
11924/* Check that SIZE_MAX has the correct type, if possible. */
11925#if 201112 <= __STDC_VERSION__
11926int k = _Generic (SIZE_MAX, size_t: 0);
11927#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
11928 || (0x5110 <= __SUNPRO_C && !__STDC__))
11929extern size_t k;
11930extern __typeof__ (SIZE_MAX) k;
11931#endif
472fa5ee 11932
c0c3707f
CB
11933#include <limits.h> /* for CHAR_BIT */
11934#define TYPE_MINIMUM(t) \
11935 ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
11936#define TYPE_MAXIMUM(t) \
11937 ((t) ((t) 0 < (t) -1 \
11938 ? (t) -1 \
11939 : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
11940struct s {
11941 int check_PTRDIFF:
11942 PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
11943 && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
11944 ? 1 : -1;
11945 /* Detect bug in FreeBSD 6.0 / ia64. */
11946 int check_SIG_ATOMIC:
11947 SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
11948 && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
11949 ? 1 : -1;
11950 int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
11951 int check_WCHAR:
11952 WCHAR_MIN == TYPE_MINIMUM (wchar_t)
11953 && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
11954 ? 1 : -1;
11955 /* Detect bug in mingw. */
11956 int check_WINT:
11957 WINT_MIN == TYPE_MINIMUM (wint_t)
11958 && WINT_MAX == TYPE_MAXIMUM (wint_t)
11959 ? 1 : -1;
472fa5ee 11960
c0c3707f
CB
11961 /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
11962 int check_UINT8_C:
11963 (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
11964 int check_UINT16_C:
11965 (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
f45c62c4 11966
c0c3707f
CB
11967 /* Detect bugs in OpenBSD 3.9 stdint.h. */
11968#ifdef UINT8_MAX
11969 int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
11970#endif
11971#ifdef UINT16_MAX
11972 int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
11973#endif
11974#ifdef UINT32_MAX
11975 int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
11976#endif
11977#ifdef UINT64_MAX
11978 int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
11979#endif
11980 int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
11981 int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
11982 int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
11983 int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
11984 int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
11985 int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
11986 int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
11987 int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
11988 int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
11989 int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
11990 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
11991};
6ec2e0f5 11992
f45c62c4
YQ
11993int
11994main ()
11995{
f45c62c4
YQ
11996
11997 ;
11998 return 0;
11999}
12000_ACEOF
6ec2e0f5 12001if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 12002 if test "$cross_compiling" = yes; then :
6a29c58e 12003 case "$host_os" in
c0c3707f
CB
12004 # Guess yes on native Windows.
12005 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
12006 # In general, assume it works.
12007 *) gl_cv_header_working_stdint_h="guessing yes" ;;
12008 esac
6a29c58e 12009
98399780
YQ
12010else
12011 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12012/* end confdefs.h. */
98399780
YQ
12013
12014
c0c3707f
CB
12015#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12016#define __STDC_CONSTANT_MACROS 1
12017#define __STDC_LIMIT_MACROS 1
12018#include <stdint.h>
98399780 12019
88b48903 12020
c0c3707f
CB
12021 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12022 included before <wchar.h>. */
12023 #include <stddef.h>
12024 #include <signal.h>
12025 #if HAVE_WCHAR_H
12026 # include <stdio.h>
12027 # include <time.h>
12028 # include <wchar.h>
12029 #endif
88b48903 12030
472fa5ee 12031
c0c3707f
CB
12032#include <stdio.h>
12033#include <string.h>
12034#define MVAL(macro) MVAL1(macro)
12035#define MVAL1(expression) #expression
12036static const char *macro_values[] =
12037 {
12038#ifdef INT8_MAX
12039 MVAL (INT8_MAX),
12040#endif
12041#ifdef INT16_MAX
12042 MVAL (INT16_MAX),
12043#endif
12044#ifdef INT32_MAX
12045 MVAL (INT32_MAX),
12046#endif
12047#ifdef INT64_MAX
12048 MVAL (INT64_MAX),
12049#endif
12050#ifdef UINT8_MAX
12051 MVAL (UINT8_MAX),
12052#endif
12053#ifdef UINT16_MAX
12054 MVAL (UINT16_MAX),
12055#endif
12056#ifdef UINT32_MAX
12057 MVAL (UINT32_MAX),
12058#endif
12059#ifdef UINT64_MAX
12060 MVAL (UINT64_MAX),
12061#endif
12062 NULL
12063 };
472fa5ee 12064
c0c3707f
CB
12065int
12066main ()
12067{
472fa5ee 12068
c0c3707f
CB
12069 const char **mv;
12070 for (mv = macro_values; *mv != NULL; mv++)
12071 {
12072 const char *value = *mv;
12073 /* Test whether it looks like a cast expression. */
12074 if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
12075 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
12076 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
12077 || strncmp (value, "((int)"/*)*/, 6) == 0
12078 || strncmp (value, "((signed short)"/*)*/, 15) == 0
12079 || strncmp (value, "((signed char)"/*)*/, 14) == 0)
12080 return mv - macro_values + 1;
12081 }
12082 return 0;
12083
12084 ;
12085 return 0;
12086}
12087_ACEOF
12088if ac_fn_c_try_run "$LINENO"; then :
12089 gl_cv_header_working_stdint_h=yes
12090fi
12091rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12092 conftest.$ac_objext conftest.beam conftest.$ac_ext
12093fi
12094
12095
12096fi
12097rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 12098
c0c3707f
CB
12099fi
12100{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
12101$as_echo "$gl_cv_header_working_stdint_h" >&6; }
12102 fi
8690e634 12103
c0c3707f
CB
12104 HAVE_C99_STDINT_H=0
12105 HAVE_SYS_BITYPES_H=0
12106 HAVE_SYS_INTTYPES_H=0
12107 STDINT_H=stdint.h
12108 case "$gl_cv_header_working_stdint_h" in
12109 *yes)
12110 HAVE_C99_STDINT_H=1
12111 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5
12112$as_echo_n "checking whether stdint.h predates C++11... " >&6; }
12113if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then :
12114 $as_echo_n "(cached) " >&6
12115else
12116 gl_cv_header_stdint_predates_cxx11_h=yes
12117 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12118/* end confdefs.h. */
8690e634
JK
12119
12120
c0c3707f
CB
12121#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12122#include <stdint.h>
8690e634
JK
12123
12124
c0c3707f
CB
12125 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12126 included before <wchar.h>. */
12127 #include <stddef.h>
12128 #include <signal.h>
12129 #if HAVE_WCHAR_H
12130 # include <stdio.h>
12131 # include <time.h>
12132 # include <wchar.h>
12133 #endif
8690e634
JK
12134
12135
c0c3707f
CB
12136intmax_t im = INTMAX_MAX;
12137int32_t i32 = INT32_C (0x7fffffff);
472fa5ee 12138
c0c3707f
CB
12139int
12140main ()
12141{
472fa5ee 12142
c0c3707f
CB
12143 ;
12144 return 0;
12145}
12146_ACEOF
12147if ac_fn_c_try_compile "$LINENO"; then :
12148 gl_cv_header_stdint_predates_cxx11_h=no
12149fi
12150rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12151fi
12152{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5
12153$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; }
472fa5ee 12154
c0c3707f 12155 if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
472fa5ee 12156
c0c3707f 12157$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
472fa5ee
SM
12158
12159
c0c3707f
CB
12160$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
12161
12162 fi
12163 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
12164$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
12165if ${gl_cv_header_stdint_width+:} false; then :
8690e634
JK
12166 $as_echo_n "(cached) " >&6
12167else
c0c3707f
CB
12168 gl_cv_header_stdint_width=no
12169 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12170/* end confdefs.h. */
12171
c0c3707f
CB
12172 /* Work if build is not clean. */
12173 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
12174 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
12175 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
12176 #endif
12177 #include <stdint.h>
12178
12179 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12180 included before <wchar.h>. */
12181 #include <stddef.h>
12182 #include <signal.h>
12183 #if HAVE_WCHAR_H
12184 # include <stdio.h>
12185 # include <time.h>
12186 # include <wchar.h>
12187 #endif
12188
12189 int iw = UINTMAX_WIDTH;
12190
12191int
12192main ()
8690e634 12193{
c0c3707f
CB
12194
12195 ;
8690e634
JK
12196 return 0;
12197}
8690e634 12198_ACEOF
c0c3707f
CB
12199if ac_fn_c_try_compile "$LINENO"; then :
12200 gl_cv_header_stdint_width=yes
12201fi
12202rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12203fi
12204{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
12205$as_echo "$gl_cv_header_stdint_width" >&6; }
12206 if test "$gl_cv_header_stdint_width" = yes; then
12207 STDINT_H=
12208 fi
12209 ;;
12210 *)
12211 for ac_header in sys/inttypes.h sys/bitypes.h
12212do :
12213 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12214ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
12215if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12216 cat >>confdefs.h <<_ACEOF
12217#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12218_ACEOF
12219
12220fi
12221
12222done
12223
12224 if test $ac_cv_header_sys_inttypes_h = yes; then
12225 HAVE_SYS_INTTYPES_H=1
12226 fi
12227 if test $ac_cv_header_sys_bitypes_h = yes; then
12228 HAVE_SYS_BITYPES_H=1
12229 fi
12230
12231
12232 if test $APPLE_UNIVERSAL_BUILD = 0; then
12233
12234
12235 for gltype in ptrdiff_t size_t ; do
12236 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12237$as_echo_n "checking for bit size of $gltype... " >&6; }
12238if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
12239 $as_echo_n "(cached) " >&6
12240else
12241 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
12242 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12243 included before <wchar.h>. */
12244 #include <stddef.h>
12245 #include <signal.h>
12246 #if HAVE_WCHAR_H
12247 # include <stdio.h>
12248 # include <time.h>
12249 # include <wchar.h>
12250 #endif
12251
12252#include <limits.h>"; then :
12253
12254else
12255 result=unknown
12256fi
12257
12258 eval gl_cv_bitsizeof_${gltype}=\$result
12259
12260fi
12261eval ac_res=\$gl_cv_bitsizeof_${gltype}
12262 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12263$as_echo "$ac_res" >&6; }
12264 eval result=\$gl_cv_bitsizeof_${gltype}
12265 if test $result = unknown; then
12266 result=0
8690e634 12267 fi
c0c3707f
CB
12268 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12269 cat >>confdefs.h <<_ACEOF
12270#define BITSIZEOF_${GLTYPE} $result
12271_ACEOF
8690e634 12272
c0c3707f
CB
12273 eval BITSIZEOF_${GLTYPE}=\$result
12274 done
8690e634
JK
12275
12276
c0c3707f 12277 fi
8690e634
JK
12278
12279
c0c3707f
CB
12280 for gltype in sig_atomic_t wchar_t wint_t ; do
12281 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12282$as_echo_n "checking for bit size of $gltype... " >&6; }
12283if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
8690e634
JK
12284 $as_echo_n "(cached) " >&6
12285else
c0c3707f
CB
12286 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
12287 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12288 included before <wchar.h>. */
12289 #include <stddef.h>
12290 #include <signal.h>
12291 #if HAVE_WCHAR_H
12292 # include <stdio.h>
12293 # include <time.h>
12294 # include <wchar.h>
12295 #endif
8690e634 12296
c0c3707f 12297#include <limits.h>"; then :
8690e634 12298
c0c3707f
CB
12299else
12300 result=unknown
12301fi
8690e634 12302
c0c3707f 12303 eval gl_cv_bitsizeof_${gltype}=\$result
8690e634
JK
12304
12305fi
c0c3707f
CB
12306eval ac_res=\$gl_cv_bitsizeof_${gltype}
12307 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12308$as_echo "$ac_res" >&6; }
12309 eval result=\$gl_cv_bitsizeof_${gltype}
12310 if test $result = unknown; then
12311 result=0
12312 fi
12313 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12314 cat >>confdefs.h <<_ACEOF
12315#define BITSIZEOF_${GLTYPE} $result
12316_ACEOF
12317
12318 eval BITSIZEOF_${GLTYPE}=\$result
12319 done
8690e634
JK
12320
12321
12322
12323
c0c3707f
CB
12324 for gltype in sig_atomic_t wchar_t wint_t ; do
12325 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
12326$as_echo_n "checking whether $gltype is signed... " >&6; }
12327if eval \${gl_cv_type_${gltype}_signed+:} false; then :
8690e634
JK
12328 $as_echo_n "(cached) " >&6
12329else
c0c3707f 12330 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12331/* end confdefs.h. */
12332
c0c3707f
CB
12333 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12334 included before <wchar.h>. */
12335 #include <stddef.h>
12336 #include <signal.h>
12337 #if HAVE_WCHAR_H
12338 # include <stdio.h>
12339 # include <time.h>
12340 # include <wchar.h>
12341 #endif
12342
12343 int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
12344int
12345main ()
12346{
12347
12348 ;
8690e634
JK
12349 return 0;
12350}
c0c3707f
CB
12351_ACEOF
12352if ac_fn_c_try_compile "$LINENO"; then :
12353 result=yes
12354else
12355 result=no
12356fi
12357rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12358 eval gl_cv_type_${gltype}_signed=\$result
8690e634 12359
c0c3707f
CB
12360fi
12361eval ac_res=\$gl_cv_type_${gltype}_signed
12362 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12363$as_echo "$ac_res" >&6; }
12364 eval result=\$gl_cv_type_${gltype}_signed
12365 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12366 if test "$result" = yes; then
12367 cat >>confdefs.h <<_ACEOF
12368#define HAVE_SIGNED_${GLTYPE} 1
8690e634 12369_ACEOF
c0c3707f
CB
12370
12371 eval HAVE_SIGNED_${GLTYPE}=1
12372 else
12373 eval HAVE_SIGNED_${GLTYPE}=0
8690e634 12374 fi
c0c3707f
CB
12375 done
12376
12377
12378 gl_cv_type_ptrdiff_t_signed=yes
12379 gl_cv_type_size_t_signed=no
12380 if test $APPLE_UNIVERSAL_BUILD = 0; then
12381
12382
12383 for gltype in ptrdiff_t size_t ; do
12384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12385$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
12386if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
12387 $as_echo_n "(cached) " >&6
12388else
12389 eval gl_cv_type_${gltype}_suffix=no
12390 eval result=\$gl_cv_type_${gltype}_signed
12391 if test "$result" = yes; then
12392 glsufu=
12393 else
12394 glsufu=u
12395 fi
12396 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
12397 case $glsuf in
12398 '') gltype1='int';;
12399 l) gltype1='long int';;
12400 ll) gltype1='long long int';;
12401 i64) gltype1='__int64';;
12402 u) gltype1='unsigned int';;
12403 ul) gltype1='unsigned long int';;
12404 ull) gltype1='unsigned long long int';;
12405 ui64)gltype1='unsigned __int64';;
12406 esac
12407 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12408/* end confdefs.h. */
12409
12410 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12411 included before <wchar.h>. */
12412 #include <stddef.h>
12413 #include <signal.h>
12414 #if HAVE_WCHAR_H
12415 # include <stdio.h>
12416 # include <time.h>
12417 # include <wchar.h>
12418 #endif
8690e634 12419
c0c3707f
CB
12420 extern $gltype foo;
12421 extern $gltype1 foo;
12422int
12423main ()
12424{
12425
12426 ;
12427 return 0;
12428}
12429_ACEOF
12430if ac_fn_c_try_compile "$LINENO"; then :
12431 eval gl_cv_type_${gltype}_suffix=\$glsuf
8690e634 12432fi
c0c3707f
CB
12433rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12434 eval result=\$gl_cv_type_${gltype}_suffix
12435 test "$result" != no && break
12436 done
12437fi
12438eval ac_res=\$gl_cv_type_${gltype}_suffix
12439 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12440$as_echo "$ac_res" >&6; }
12441 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12442 eval result=\$gl_cv_type_${gltype}_suffix
12443 test "$result" = no && result=
12444 eval ${GLTYPE}_SUFFIX=\$result
12445 cat >>confdefs.h <<_ACEOF
12446#define ${GLTYPE}_SUFFIX $result
12447_ACEOF
8690e634 12448
c0c3707f 12449 done
8690e634
JK
12450
12451
c0c3707f 12452 fi
8690e634
JK
12453
12454
c0c3707f
CB
12455 for gltype in sig_atomic_t wchar_t wint_t ; do
12456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12457$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
12458if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
8690e634
JK
12459 $as_echo_n "(cached) " >&6
12460else
c0c3707f
CB
12461 eval gl_cv_type_${gltype}_suffix=no
12462 eval result=\$gl_cv_type_${gltype}_signed
12463 if test "$result" = yes; then
12464 glsufu=
12465 else
12466 glsufu=u
12467 fi
12468 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
12469 case $glsuf in
12470 '') gltype1='int';;
12471 l) gltype1='long int';;
12472 ll) gltype1='long long int';;
12473 i64) gltype1='__int64';;
12474 u) gltype1='unsigned int';;
12475 ul) gltype1='unsigned long int';;
12476 ull) gltype1='unsigned long long int';;
12477 ui64)gltype1='unsigned __int64';;
12478 esac
12479 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12480/* end confdefs.h. */
12481
c0c3707f
CB
12482 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12483 included before <wchar.h>. */
12484 #include <stddef.h>
12485 #include <signal.h>
12486 #if HAVE_WCHAR_H
12487 # include <stdio.h>
12488 # include <time.h>
12489 # include <wchar.h>
12490 #endif
12491
12492 extern $gltype foo;
12493 extern $gltype1 foo;
12494int
12495main ()
12496{
12497
12498 ;
5e8754f9 12499 return 0;
8690e634 12500}
c0c3707f
CB
12501_ACEOF
12502if ac_fn_c_try_compile "$LINENO"; then :
12503 eval gl_cv_type_${gltype}_suffix=\$glsuf
12504fi
12505rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12506 eval result=\$gl_cv_type_${gltype}_suffix
12507 test "$result" != no && break
12508 done
12509fi
12510eval ac_res=\$gl_cv_type_${gltype}_suffix
12511 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12512$as_echo "$ac_res" >&6; }
12513 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12514 eval result=\$gl_cv_type_${gltype}_suffix
12515 test "$result" = no && result=
12516 eval ${GLTYPE}_SUFFIX=\$result
12517 cat >>confdefs.h <<_ACEOF
12518#define ${GLTYPE}_SUFFIX $result
12519_ACEOF
12520
12521 done
12522
12523
12524
12525 if test $GNULIB_OVERRIDES_WINT_T = 1; then
12526 BITSIZEOF_WINT_T=32
12527 fi
12528
12529 ;;
12530 esac
8690e634 12531
8690e634 12532
c0c3707f
CB
12533
12534 LIMITS_H='limits.h'
12535 if test -n "$LIMITS_H"; then
12536 GL_GENERATE_LIMITS_H_TRUE=
12537 GL_GENERATE_LIMITS_H_FALSE='#'
12538else
12539 GL_GENERATE_LIMITS_H_TRUE='#'
12540 GL_GENERATE_LIMITS_H_FALSE=
8690e634 12541fi
6ec2e0f5
SDJ
12542
12543
12544
12545
12546
12547
12548
c0c3707f
CB
12549 if test -n "$STDINT_H"; then
12550 GL_GENERATE_STDINT_H_TRUE=
12551 GL_GENERATE_STDINT_H_FALSE='#'
12552else
12553 GL_GENERATE_STDINT_H_TRUE='#'
12554 GL_GENERATE_STDINT_H_FALSE=
12555fi
472fa5ee
SM
12556
12557
12558
12559
12560
c0c3707f
CB
12561 GNULIB_IMAXABS=0;
12562 GNULIB_IMAXDIV=0;
12563 GNULIB_STRTOIMAX=0;
12564 GNULIB_STRTOUMAX=0;
12565 HAVE_DECL_IMAXABS=1;
12566 HAVE_DECL_IMAXDIV=1;
12567 HAVE_DECL_STRTOIMAX=1;
12568 HAVE_DECL_STRTOUMAX=1;
12569 HAVE_IMAXDIV_T=1;
12570 REPLACE_STRTOIMAX=0;
12571 REPLACE_STRTOUMAX=0;
12572 INT32_MAX_LT_INTMAX_MAX=1;
12573 INT64_MAX_EQ_LONG_MAX='defined _LP64';
12574 PRI_MACROS_BROKEN=0;
12575 PRIPTR_PREFIX=__PRIPTR_PREFIX;
12576 UINT32_MAX_LT_UINTMAX_MAX=1;
12577 UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
472fa5ee 12578
6ec2e0f5
SDJ
12579
12580
12581
12582
12583
6ec2e0f5
SDJ
12584
12585
6ec2e0f5 12586
6ec2e0f5 12587
6ec2e0f5 12588
6ec2e0f5 12589
6ec2e0f5 12590
c0c3707f
CB
12591
12592
12593 if test $gl_cv_have_include_next = yes; then
12594 gl_cv_next_inttypes_h='<'inttypes.h'>'
12595 else
12596 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
12597$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
12598if ${gl_cv_next_inttypes_h+:} false; then :
12599 $as_echo_n "(cached) " >&6
12600else
12601
12602 if test $ac_cv_header_inttypes_h = yes; then
12603
12604
12605
12606
12607 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12608/* end confdefs.h. */
12609#include <inttypes.h>
6ec2e0f5 12610_ACEOF
c0c3707f
CB
12611 case "$host_os" in
12612 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12613 *) gl_absname_cpp="$ac_cpp" ;;
12614 esac
6ec2e0f5 12615
c0c3707f
CB
12616 case "$host_os" in
12617 mingw*)
12618 gl_dirsep_regex='[/\\]'
12619 ;;
12620 *)
12621 gl_dirsep_regex='\/'
12622 ;;
12623 esac
12624 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12625 gl_header_literal_regex=`echo 'inttypes.h' \
12626 | sed -e "$gl_make_literal_regex_sed"`
12627 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12628 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12629 s|^/[^/]|//&|
12630 p
12631 q
12632 }'
6ec2e0f5 12633
c0c3707f
CB
12634 gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12635 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 12636
c0c3707f
CB
12637 gl_header=$gl_cv_absolute_inttypes_h
12638 gl_cv_next_inttypes_h='"'$gl_header'"'
12639 else
12640 gl_cv_next_inttypes_h='<'inttypes.h'>'
12641 fi
6ec2e0f5 12642
6ec2e0f5 12643
c0c3707f
CB
12644fi
12645{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
12646$as_echo "$gl_cv_next_inttypes_h" >&6; }
12647 fi
12648 NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
6ec2e0f5 12649
c0c3707f
CB
12650 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12651 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12652 gl_next_as_first_directive='<'inttypes.h'>'
12653 else
12654 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12655 gl_next_as_first_directive=$gl_cv_next_inttypes_h
12656 fi
12657 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
6ec2e0f5 12658
472fa5ee
SM
12659
12660
12661
12662
12663
12664
472fa5ee
SM
12665
12666
12667
12668
6ec2e0f5 12669
c0c3707f
CB
12670 for ac_header in inttypes.h
12671do :
12672 ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
12673if test "x$ac_cv_header_inttypes_h" = xyes; then :
12674 cat >>confdefs.h <<_ACEOF
12675#define HAVE_INTTYPES_H 1
12676_ACEOF
6ec2e0f5 12677
c0c3707f 12678fi
6ec2e0f5 12679
c0c3707f 12680done
6ec2e0f5 12681
c0c3707f
CB
12682 if test $ac_cv_header_inttypes_h = yes; then
12683 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
12684$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
12685if ${gt_cv_inttypes_pri_broken+:} false; then :
6ec2e0f5
SDJ
12686 $as_echo_n "(cached) " >&6
12687else
c0c3707f
CB
12688
12689 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
12690/* end confdefs.h. */
12691
c0c3707f
CB
12692#include <inttypes.h>
12693#ifdef PRId32
12694char *p = PRId32;
6ec2e0f5
SDJ
12695#endif
12696
12697int
12698main ()
12699{
12700
6ec2e0f5
SDJ
12701 ;
12702 return 0;
12703}
12704_ACEOF
c0c3707f
CB
12705if ac_fn_c_try_compile "$LINENO"; then :
12706 gt_cv_inttypes_pri_broken=no
6ec2e0f5 12707else
5df4cba6
SM
12708 gt_cv_inttypes_pri_broken=yes
12709fi
12710rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12711
12712fi
12713{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
12714$as_echo "$gt_cv_inttypes_pri_broken" >&6; }
12715 fi
12716 if test "$gt_cv_inttypes_pri_broken" = yes; then
12717
12718cat >>confdefs.h <<_ACEOF
12719#define PRI_MACROS_BROKEN 1
12720_ACEOF
12721
12722 PRI_MACROS_BROKEN=1
12723 else
12724 PRI_MACROS_BROKEN=0
12725 fi
12726
12727
12728
12729 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
12730$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
12731if ${gl_cv_cc_double_expbit0+:} false; then :
12732 $as_echo_n "(cached) " >&6
12733else
12734
12735 if test "$cross_compiling" = yes; then :
12736
12737 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12738/* end confdefs.h. */
12739
12740#if defined arm || defined __arm || defined __arm__
12741 mixed_endianness
12742#endif
12743
12744_ACEOF
12745if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12746 $EGREP "mixed_endianness" >/dev/null 2>&1; then :
12747 gl_cv_cc_double_expbit0="unknown"
12748else
12749
12750 :
12751if ${ac_cv_c_bigendian+:} false; then :
12752 $as_echo_n "(cached) " >&6
12753else
12754 ac_cv_c_bigendian=unknown
12755 # See if we're dealing with a universal compiler.
12756 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12757/* end confdefs.h. */
12758#ifndef __APPLE_CC__
12759 not a universal capable compiler
12760 #endif
12761 typedef int dummy;
12762
12763_ACEOF
12764if ac_fn_c_try_compile "$LINENO"; then :
12765
12766 # Check for potential -arch flags. It is not universal unless
12767 # there are at least two -arch flags with different values.
12768 ac_arch=
12769 ac_prev=
12770 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
12771 if test -n "$ac_prev"; then
12772 case $ac_word in
12773 i?86 | x86_64 | ppc | ppc64)
12774 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
12775 ac_arch=$ac_word
12776 else
12777 ac_cv_c_bigendian=universal
12778 break
12779 fi
12780 ;;
12781 esac
12782 ac_prev=
12783 elif test "x$ac_word" = "x-arch"; then
12784 ac_prev=arch
12785 fi
12786 done
12787fi
12788rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12789 if test $ac_cv_c_bigendian = unknown; then
12790 # See if sys/param.h defines the BYTE_ORDER macro.
12791 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12792/* end confdefs.h. */
12793#include <sys/types.h>
12794 #include <sys/param.h>
12795
12796int
12797main ()
12798{
12799#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
12800 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
12801 && LITTLE_ENDIAN)
12802 bogus endian macros
12803 #endif
12804
12805 ;
12806 return 0;
12807}
12808_ACEOF
12809if ac_fn_c_try_compile "$LINENO"; then :
12810 # It does; now see whether it defined to BIG_ENDIAN or not.
12811 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12812/* end confdefs.h. */
12813#include <sys/types.h>
12814 #include <sys/param.h>
12815
12816int
12817main ()
12818{
12819#if BYTE_ORDER != BIG_ENDIAN
12820 not big endian
12821 #endif
12822
12823 ;
12824 return 0;
12825}
12826_ACEOF
12827if ac_fn_c_try_compile "$LINENO"; then :
12828 ac_cv_c_bigendian=yes
12829else
12830 ac_cv_c_bigendian=no
12831fi
12832rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12833fi
12834rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12835 fi
12836 if test $ac_cv_c_bigendian = unknown; then
12837 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
12838 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12839/* end confdefs.h. */
12840#include <limits.h>
12841
12842int
12843main ()
12844{
12845#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
12846 bogus endian macros
12847 #endif
12848
12849 ;
12850 return 0;
12851}
12852_ACEOF
12853if ac_fn_c_try_compile "$LINENO"; then :
12854 # It does; now see whether it defined to _BIG_ENDIAN or not.
12855 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12856/* end confdefs.h. */
12857#include <limits.h>
12858
12859int
12860main ()
12861{
12862#ifndef _BIG_ENDIAN
12863 not big endian
12864 #endif
12865
12866 ;
12867 return 0;
12868}
12869_ACEOF
12870if ac_fn_c_try_compile "$LINENO"; then :
12871 ac_cv_c_bigendian=yes
12872else
12873 ac_cv_c_bigendian=no
12874fi
12875rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12876fi
12877rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12878 fi
12879 if test $ac_cv_c_bigendian = unknown; then
12880 # Compile a test program.
12881 if test "$cross_compiling" = yes; then :
12882 # Try to guess by grepping values from an object file.
12883 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12884/* end confdefs.h. */
12885short int ascii_mm[] =
12886 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
12887 short int ascii_ii[] =
12888 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
12889 int use_ascii (int i) {
12890 return ascii_mm[i] + ascii_ii[i];
12891 }
12892 short int ebcdic_ii[] =
12893 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
12894 short int ebcdic_mm[] =
12895 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
12896 int use_ebcdic (int i) {
12897 return ebcdic_mm[i] + ebcdic_ii[i];
12898 }
12899 extern int foo;
12900
12901int
12902main ()
12903{
12904return use_ascii (foo) == use_ebcdic (foo);
12905 ;
12906 return 0;
12907}
12908_ACEOF
12909if ac_fn_c_try_compile "$LINENO"; then :
12910 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
12911 ac_cv_c_bigendian=yes
12912 fi
12913 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
12914 if test "$ac_cv_c_bigendian" = unknown; then
12915 ac_cv_c_bigendian=no
12916 else
12917 # finding both strings is unlikely to happen, but who knows?
12918 ac_cv_c_bigendian=unknown
12919 fi
12920 fi
12921fi
12922rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12923else
12924 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12925/* end confdefs.h. */
12926$ac_includes_default
12927int
12928main ()
12929{
12930
12931 /* Are we little or big endian? From Harbison&Steele. */
12932 union
12933 {
12934 long int l;
12935 char c[sizeof (long int)];
12936 } u;
12937 u.l = 1;
12938 return u.c[sizeof (long int) - 1] == 1;
12939
12940 ;
12941 return 0;
12942}
12943_ACEOF
12944if ac_fn_c_try_run "$LINENO"; then :
12945 ac_cv_c_bigendian=no
12946else
12947 ac_cv_c_bigendian=yes
12948fi
12949rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12950 conftest.$ac_objext conftest.beam conftest.$ac_ext
12951fi
12952
12953 fi
12954fi
12955:
12956 case $ac_cv_c_bigendian in #(
12957 yes)
12958 gl_cv_cc_double_expbit0="word 0 bit 20";; #(
12959 no)
12960 gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
12961 universal)
12962
12963$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
12964
12965 ;; #(
12966 *)
12967 gl_cv_cc_double_expbit0="unknown" ;;
12968 esac
12969
12970
12971fi
12972rm -f conftest*
12973
12974
12975else
12976 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12977/* end confdefs.h. */
12978
12979#include <float.h>
12980#include <stddef.h>
12981#include <stdio.h>
12982#include <string.h>
12983#define NWORDS \
12984 ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
12985typedef union { double value; unsigned int word[NWORDS]; } memory_double;
12986static unsigned int ored_words[NWORDS];
12987static unsigned int anded_words[NWORDS];
12988static void add_to_ored_words (double x)
12989{
12990 memory_double m;
12991 size_t i;
12992 /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
12993 memset (&m, 0, sizeof (memory_double));
12994 m.value = x;
12995 for (i = 0; i < NWORDS; i++)
12996 {
12997 ored_words[i] |= m.word[i];
12998 anded_words[i] &= m.word[i];
12999 }
13000}
13001int main ()
13002{
13003 size_t j;
13004 FILE *fp = fopen ("conftest.out", "w");
13005 if (fp == NULL)
13006 return 1;
13007 for (j = 0; j < NWORDS; j++)
13008 anded_words[j] = ~ (unsigned int) 0;
13009 add_to_ored_words (0.25);
13010 add_to_ored_words (0.5);
13011 add_to_ored_words (1.0);
13012 add_to_ored_words (2.0);
13013 add_to_ored_words (4.0);
13014 /* Remove bits that are common (e.g. if representation of the first mantissa
13015 bit is explicit). */
13016 for (j = 0; j < NWORDS; j++)
13017 ored_words[j] &= ~anded_words[j];
13018 /* Now find the nonzero word. */
13019 for (j = 0; j < NWORDS; j++)
13020 if (ored_words[j] != 0)
13021 break;
13022 if (j < NWORDS)
13023 {
13024 size_t i;
13025 for (i = j + 1; i < NWORDS; i++)
13026 if (ored_words[i] != 0)
13027 {
13028 fprintf (fp, "unknown");
13029 return (fclose (fp) != 0);
13030 }
13031 for (i = 0; ; i++)
13032 if ((ored_words[j] >> i) & 1)
13033 {
13034 fprintf (fp, "word %d bit %d", (int) j, (int) i);
13035 return (fclose (fp) != 0);
13036 }
13037 }
13038 fprintf (fp, "unknown");
13039 return (fclose (fp) != 0);
13040}
13041
13042_ACEOF
13043if ac_fn_c_try_run "$LINENO"; then :
13044 gl_cv_cc_double_expbit0=`cat conftest.out`
13045else
13046 gl_cv_cc_double_expbit0="unknown"
6ec2e0f5 13047fi
5df4cba6
SM
13048rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13049 conftest.$ac_objext conftest.beam conftest.$ac_ext
13050fi
13051
13052 rm -f conftest.out
6ec2e0f5
SDJ
13053
13054fi
5df4cba6
SM
13055{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
13056$as_echo "$gl_cv_cc_double_expbit0" >&6; }
13057 case "$gl_cv_cc_double_expbit0" in
13058 word*bit*)
13059 word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
13060 bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
6ec2e0f5
SDJ
13061
13062cat >>confdefs.h <<_ACEOF
5df4cba6 13063#define DBL_EXPBIT0_WORD $word
6ec2e0f5
SDJ
13064_ACEOF
13065
c0c3707f 13066
5df4cba6
SM
13067cat >>confdefs.h <<_ACEOF
13068#define DBL_EXPBIT0_BIT $bit
13069_ACEOF
6ec2e0f5 13070
5df4cba6
SM
13071 ;;
13072 esac
6ec2e0f5 13073
6ec2e0f5 13074
5df4cba6
SM
13075 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
13076$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
c0c3707f
CB
13077if ${ac_cv_c_bigendian+:} false; then :
13078 $as_echo_n "(cached) " >&6
6ec2e0f5 13079else
c0c3707f
CB
13080 ac_cv_c_bigendian=unknown
13081 # See if we're dealing with a universal compiler.
13082 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13083/* end confdefs.h. */
c0c3707f
CB
13084#ifndef __APPLE_CC__
13085 not a universal capable compiler
13086 #endif
13087 typedef int dummy;
6ec2e0f5 13088
c0c3707f
CB
13089_ACEOF
13090if ac_fn_c_try_compile "$LINENO"; then :
13091
13092 # Check for potential -arch flags. It is not universal unless
13093 # there are at least two -arch flags with different values.
13094 ac_arch=
13095 ac_prev=
13096 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13097 if test -n "$ac_prev"; then
13098 case $ac_word in
13099 i?86 | x86_64 | ppc | ppc64)
13100 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13101 ac_arch=$ac_word
13102 else
13103 ac_cv_c_bigendian=universal
13104 break
13105 fi
13106 ;;
13107 esac
13108 ac_prev=
13109 elif test "x$ac_word" = "x-arch"; then
13110 ac_prev=arch
13111 fi
13112 done
13113fi
13114rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13115 if test $ac_cv_c_bigendian = unknown; then
13116 # See if sys/param.h defines the BYTE_ORDER macro.
13117 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13118/* end confdefs.h. */
13119#include <sys/types.h>
13120 #include <sys/param.h>
6ec2e0f5
SDJ
13121
13122int
13123main ()
13124{
c0c3707f
CB
13125#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13126 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13127 && LITTLE_ENDIAN)
13128 bogus endian macros
13129 #endif
6ec2e0f5 13130
c0c3707f
CB
13131 ;
13132 return 0;
13133}
13134_ACEOF
13135if ac_fn_c_try_compile "$LINENO"; then :
13136 # It does; now see whether it defined to BIG_ENDIAN or not.
13137 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13138/* end confdefs.h. */
13139#include <sys/types.h>
13140 #include <sys/param.h>
13141
13142int
13143main ()
13144{
13145#if BYTE_ORDER != BIG_ENDIAN
13146 not big endian
13147 #endif
6ec2e0f5
SDJ
13148
13149 ;
13150 return 0;
13151}
13152_ACEOF
c0c3707f
CB
13153if ac_fn_c_try_compile "$LINENO"; then :
13154 ac_cv_c_bigendian=yes
6ec2e0f5 13155else
c0c3707f 13156 ac_cv_c_bigendian=no
6ec2e0f5 13157fi
c0c3707f 13158rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13159fi
c0c3707f
CB
13160rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13161 fi
13162 if test $ac_cv_c_bigendian = unknown; then
13163 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13164 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13165/* end confdefs.h. */
13166#include <limits.h>
472fa5ee 13167
c0c3707f
CB
13168int
13169main ()
13170{
13171#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13172 bogus endian macros
13173 #endif
6ec2e0f5 13174
c0c3707f
CB
13175 ;
13176 return 0;
13177}
6ec2e0f5 13178_ACEOF
c0c3707f
CB
13179if ac_fn_c_try_compile "$LINENO"; then :
13180 # It does; now see whether it defined to _BIG_ENDIAN or not.
13181 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13182/* end confdefs.h. */
c0c3707f
CB
13183#include <limits.h>
13184
6ec2e0f5
SDJ
13185int
13186main ()
13187{
5df4cba6
SM
13188#ifndef _BIG_ENDIAN
13189 not big endian
13190 #endif
13191
13192 ;
13193 return 0;
13194}
13195_ACEOF
13196if ac_fn_c_try_compile "$LINENO"; then :
13197 ac_cv_c_bigendian=yes
13198else
13199 ac_cv_c_bigendian=no
13200fi
13201rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13202fi
13203rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13204 fi
13205 if test $ac_cv_c_bigendian = unknown; then
13206 # Compile a test program.
13207 if test "$cross_compiling" = yes; then :
13208 # Try to guess by grepping values from an object file.
13209 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13210/* end confdefs.h. */
13211short int ascii_mm[] =
13212 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13213 short int ascii_ii[] =
13214 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13215 int use_ascii (int i) {
13216 return ascii_mm[i] + ascii_ii[i];
13217 }
13218 short int ebcdic_ii[] =
13219 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13220 short int ebcdic_mm[] =
13221 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13222 int use_ebcdic (int i) {
13223 return ebcdic_mm[i] + ebcdic_ii[i];
13224 }
13225 extern int foo;
13226
13227int
13228main ()
13229{
13230return use_ascii (foo) == use_ebcdic (foo);
13231 ;
13232 return 0;
13233}
13234_ACEOF
13235if ac_fn_c_try_compile "$LINENO"; then :
13236 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13237 ac_cv_c_bigendian=yes
13238 fi
13239 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13240 if test "$ac_cv_c_bigendian" = unknown; then
13241 ac_cv_c_bigendian=no
13242 else
13243 # finding both strings is unlikely to happen, but who knows?
13244 ac_cv_c_bigendian=unknown
13245 fi
13246 fi
13247fi
13248rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13249else
13250 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13251/* end confdefs.h. */
13252$ac_includes_default
13253int
13254main ()
13255{
13256
13257 /* Are we little or big endian? From Harbison&Steele. */
13258 union
13259 {
13260 long int l;
13261 char c[sizeof (long int)];
13262 } u;
13263 u.l = 1;
13264 return u.c[sizeof (long int) - 1] == 1;
13265
13266 ;
13267 return 0;
13268}
13269_ACEOF
13270if ac_fn_c_try_run "$LINENO"; then :
13271 ac_cv_c_bigendian=no
13272else
13273 ac_cv_c_bigendian=yes
13274fi
13275rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13276 conftest.$ac_objext conftest.beam conftest.$ac_ext
13277fi
13278
13279 fi
13280fi
13281{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
13282$as_echo "$ac_cv_c_bigendian" >&6; }
13283 case $ac_cv_c_bigendian in #(
13284 yes)
13285 $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
13286;; #(
13287 no)
13288 ;; #(
13289 universal)
13290
13291$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13292
13293 ;; #(
13294 *)
13295 as_fn_error $? "unknown endianness
13296 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
13297 esac
13298
13299
13300
13301 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
13302$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
13303if ${am_cv_langinfo_codeset+:} false; then :
13304 $as_echo_n "(cached) " >&6
13305else
13306 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13307/* end confdefs.h. */
13308#include <langinfo.h>
13309int
13310main ()
13311{
13312char* cs = nl_langinfo(CODESET); return !cs;
13313 ;
13314 return 0;
13315}
13316_ACEOF
13317if ac_fn_c_try_link "$LINENO"; then :
13318 am_cv_langinfo_codeset=yes
13319else
13320 am_cv_langinfo_codeset=no
13321fi
13322rm -f core conftest.err conftest.$ac_objext \
13323 conftest$ac_exeext conftest.$ac_ext
13324
13325fi
13326{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
13327$as_echo "$am_cv_langinfo_codeset" >&6; }
13328 if test $am_cv_langinfo_codeset = yes; then
13329
13330$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
13331
13332 fi
13333
13334
13335 GNULIB_LOCALECONV=0;
13336 GNULIB_SETLOCALE=0;
13337 GNULIB_SETLOCALE_NULL=0;
13338 GNULIB_DUPLOCALE=0;
13339 GNULIB_LOCALENAME=0;
13340 HAVE_NEWLOCALE=1;
13341 HAVE_DUPLOCALE=1;
13342 HAVE_FREELOCALE=1;
13343 REPLACE_LOCALECONV=0;
13344 REPLACE_SETLOCALE=0;
13345 REPLACE_NEWLOCALE=0;
13346 REPLACE_DUPLOCALE=0;
13347 REPLACE_FREELOCALE=0;
13348 REPLACE_STRUCT_LCONV=0;
13349
13350
13351 REPLACE_NULL=0;
13352 HAVE_MAX_ALIGN_T=1;
13353 HAVE_WCHAR_T=1;
13354
13355
13356 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
13357$as_echo_n "checking for wchar_t... " >&6; }
13358if ${gt_cv_c_wchar_t+:} false; then :
13359 $as_echo_n "(cached) " >&6
13360else
13361 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13362/* end confdefs.h. */
13363#include <stddef.h>
13364 wchar_t foo = (wchar_t)'\0';
13365int
13366main ()
13367{
13368
13369 ;
13370 return 0;
13371}
13372_ACEOF
13373if ac_fn_c_try_compile "$LINENO"; then :
13374 gt_cv_c_wchar_t=yes
13375else
13376 gt_cv_c_wchar_t=no
13377fi
13378rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13379fi
13380{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
13381$as_echo "$gt_cv_c_wchar_t" >&6; }
13382 if test $gt_cv_c_wchar_t = yes; then
13383
13384$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
13385
13386 fi
13387
13388
13389
13390
13391 STDDEF_H=
13392
13393 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
13394$as_echo_n "checking for good max_align_t... " >&6; }
13395if ${gl_cv_type_max_align_t+:} false; then :
13396 $as_echo_n "(cached) " >&6
13397else
13398 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13399/* end confdefs.h. */
13400#include <stddef.h>
13401 unsigned int s = sizeof (max_align_t);
13402 #if defined __GNUC__ || defined __IBM__ALIGNOF__
13403 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
13404 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
13405 #endif
13406
13407int
13408main ()
13409{
c0c3707f 13410
6ec2e0f5
SDJ
13411 ;
13412 return 0;
13413}
13414_ACEOF
13415if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 13416 gl_cv_type_max_align_t=yes
6ec2e0f5 13417else
5df4cba6 13418 gl_cv_type_max_align_t=no
6ec2e0f5 13419fi
c0c3707f 13420rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13421
c0c3707f 13422fi
5df4cba6
SM
13423{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
13424$as_echo "$gl_cv_type_max_align_t" >&6; }
13425 if test $gl_cv_type_max_align_t = no; then
13426 HAVE_MAX_ALIGN_T=0
13427 STDDEF_H=stddef.h
13428 fi
13429
13430 if test $gt_cv_c_wchar_t = no; then
13431 HAVE_WCHAR_T=0
13432 STDDEF_H=stddef.h
13433 fi
13434
13435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
13436$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
13437if ${gl_cv_decl_null_works+:} false; then :
13438 $as_echo_n "(cached) " >&6
c0c3707f
CB
13439else
13440 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13441/* end confdefs.h. */
5df4cba6
SM
13442#include <stddef.h>
13443 int test[2 * (sizeof NULL == sizeof (void *)) -1];
13444
c0c3707f
CB
13445int
13446main ()
13447{
6ec2e0f5 13448
c0c3707f
CB
13449 ;
13450 return 0;
13451}
13452_ACEOF
5df4cba6
SM
13453if ac_fn_c_try_compile "$LINENO"; then :
13454 gl_cv_decl_null_works=yes
c0c3707f 13455else
5df4cba6 13456 gl_cv_decl_null_works=no
c0c3707f 13457fi
5df4cba6 13458rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 13459fi
5df4cba6
SM
13460{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
13461$as_echo "$gl_cv_decl_null_works" >&6; }
13462 if test $gl_cv_decl_null_works = no; then
13463 REPLACE_NULL=1
13464 STDDEF_H=stddef.h
13465 fi
6ec2e0f5 13466
5df4cba6
SM
13467
13468 if test -n "$STDDEF_H"; then
13469 GL_GENERATE_STDDEF_H_TRUE=
13470 GL_GENERATE_STDDEF_H_FALSE='#'
13471else
13472 GL_GENERATE_STDDEF_H_TRUE='#'
13473 GL_GENERATE_STDDEF_H_FALSE=
c0c3707f 13474fi
6ec2e0f5 13475
5df4cba6 13476 if test -n "$STDDEF_H"; then
6ec2e0f5 13477
472fa5ee
SM
13478
13479
5e8754f9
SDJ
13480
13481
5df4cba6
SM
13482
13483
13484
13485 if test $gl_cv_have_include_next = yes; then
13486 gl_cv_next_stddef_h='<'stddef.h'>'
13487 else
13488 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
13489$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
13490if ${gl_cv_next_stddef_h+:} false; then :
13491 $as_echo_n "(cached) " >&6
c0c3707f 13492else
5df4cba6
SM
13493
13494
13495
c0c3707f
CB
13496 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13497/* end confdefs.h. */
c0c3707f 13498#include <stddef.h>
c0c3707f 13499_ACEOF
5df4cba6
SM
13500 case "$host_os" in
13501 aix*) gl_absname_cpp="$ac_cpp -C" ;;
13502 *) gl_absname_cpp="$ac_cpp" ;;
13503 esac
13504
13505 case "$host_os" in
13506 mingw*)
13507 gl_dirsep_regex='[/\\]'
13508 ;;
13509 *)
13510 gl_dirsep_regex='\/'
13511 ;;
13512 esac
13513 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13514 gl_header_literal_regex=`echo 'stddef.h' \
13515 | sed -e "$gl_make_literal_regex_sed"`
13516 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13517 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13518 s|^/[^/]|//&|
13519 p
13520 q
13521 }'
13522
13523 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13524 sed -n "$gl_absolute_header_sed"`
13525
13526 gl_header=$gl_cv_absolute_stddef_h
13527 gl_cv_next_stddef_h='"'$gl_header'"'
5e8754f9
SDJ
13528
13529
c0c3707f 13530fi
5df4cba6
SM
13531{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
13532$as_echo "$gl_cv_next_stddef_h" >&6; }
13533 fi
13534 NEXT_STDDEF_H=$gl_cv_next_stddef_h
13535
13536 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13537 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13538 gl_next_as_first_directive='<'stddef.h'>'
13539 else
13540 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13541 gl_next_as_first_directive=$gl_cv_next_stddef_h
13542 fi
13543 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
5e8754f9
SDJ
13544
13545
13546
13547
5df4cba6 13548 fi
5e8754f9
SDJ
13549
13550
13551
13552
13553
13554
5df4cba6
SM
13555 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
13556$as_echo_n "checking whether locale.h defines locale_t... " >&6; }
13557if ${gl_cv_header_locale_has_locale_t+:} false; then :
13558 $as_echo_n "(cached) " >&6
13559else
13560 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13561/* end confdefs.h. */
5df4cba6
SM
13562#include <locale.h>
13563 locale_t x;
c0c3707f
CB
13564int
13565main ()
13566{
5e8754f9 13567
c0c3707f
CB
13568 ;
13569 return 0;
13570}
13571_ACEOF
13572if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 13573 gl_cv_header_locale_has_locale_t=yes
c0c3707f 13574else
5df4cba6 13575 gl_cv_header_locale_has_locale_t=no
c0c3707f
CB
13576fi
13577rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 13578
c0c3707f 13579fi
5df4cba6
SM
13580{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
13581$as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
13582
13583
13584 if test $ac_cv_header_xlocale_h = yes; then
13585 HAVE_XLOCALE_H=1
13586 if test $gl_cv_header_locale_has_locale_t = yes; then
13587 gl_cv_header_locale_h_needs_xlocale_h=no
13588 else
13589 gl_cv_header_locale_h_needs_xlocale_h=yes
c0c3707f 13590 fi
5df4cba6
SM
13591 HAVE_LOCALE_T=1
13592 else
13593 HAVE_XLOCALE_H=0
13594 gl_cv_header_locale_h_needs_xlocale_h=no
13595 if test $gl_cv_header_locale_has_locale_t = yes; then
13596 HAVE_LOCALE_T=1
13597 else
13598 HAVE_LOCALE_T=0
13599 fi
13600 fi
13601
13602
5e8754f9 13603
5df4cba6
SM
13604
13605 gl_threads_api=none
13606 LIBTHREAD=
13607 LTLIBTHREAD=
13608 LIBMULTITHREAD=
13609 LTLIBMULTITHREAD=
13610 if test "$gl_use_threads" != no; then
13611
13612
13613 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
13614$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
13615if ${gl_cv_have_weak+:} false; then :
13616 $as_echo_n "(cached) " >&6
13617else
13618 gl_cv_have_weak=no
13619 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13620/* end confdefs.h. */
13621extern void xyzzy ();
13622#pragma weak xyzzy
c0c3707f
CB
13623int
13624main ()
13625{
5df4cba6 13626xyzzy();
c0c3707f
CB
13627 ;
13628 return 0;
13629}
13630_ACEOF
5df4cba6
SM
13631if ac_fn_c_try_link "$LINENO"; then :
13632 gl_cv_have_weak=maybe
13633fi
13634rm -f core conftest.err conftest.$ac_objext \
13635 conftest$ac_exeext conftest.$ac_ext
13636 if test $gl_cv_have_weak = maybe; then
13637 if test "$cross_compiling" = yes; then :
13638 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13639/* end confdefs.h. */
5df4cba6
SM
13640#ifdef __ELF__
13641 Extensible Linking Format
13642 #endif
5e8754f9 13643
5df4cba6
SM
13644_ACEOF
13645if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13646 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
13647 gl_cv_have_weak="guessing yes"
13648else
13649 gl_cv_have_weak="guessing no"
13650fi
13651rm -f conftest*
5e8754f9 13652
5df4cba6
SM
13653
13654else
13655 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13656/* end confdefs.h. */
13657
13658#include <stdio.h>
13659#pragma weak fputs
13660int main ()
13661{
13662 return (fputs == NULL);
c0c3707f
CB
13663}
13664_ACEOF
5df4cba6
SM
13665if ac_fn_c_try_run "$LINENO"; then :
13666 gl_cv_have_weak=yes
c0c3707f 13667else
5df4cba6 13668 gl_cv_have_weak=no
c0c3707f 13669fi
5df4cba6
SM
13670rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13671 conftest.$ac_objext conftest.beam conftest.$ac_ext
c0c3707f 13672fi
5df4cba6
SM
13673
13674 fi
13675 case " $LDFLAGS " in
13676 *" -static "*) gl_cv_have_weak=no ;;
13677 esac
13678 case "$gl_cv_have_weak" in
13679 *yes)
13680 case "$host_os" in
13681 freebsd* | dragonfly*)
13682 : > conftest1.c
13683 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
13684 cat <<EOF > conftest2.c
13685#include <pthread.h>
13686#pragma weak pthread_mutexattr_gettype
13687int main ()
13688{
13689 return (pthread_mutexattr_gettype != NULL);
13690}
13691EOF
13692 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
13693 || gl_cv_have_weak=no
13694 rm -f conftest1.c libempty.so conftest2.c conftest
13695 ;;
13696 esac
13697 ;;
13698 esac
13699
13700fi
13701{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
13702$as_echo "$gl_cv_have_weak" >&6; }
13703 case "$gl_cv_have_weak" in
13704 *yes)
13705
13706$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
13707
13708 ;;
13709 esac
13710
13711 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
13712
13713 :
c0c3707f 13714 fi
5df4cba6
SM
13715 if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
13716
13717 gl_have_isoc_threads="$ac_cv_header_threads_h"
13718 fi
13719 if test "$gl_use_threads" = yes \
13720 || test "$gl_use_threads" = posix \
13721 || test "$gl_use_threads" = isoc+posix; then
13722
13723
13724 if test -z "$gl_pthreadlib_body_done"; then
13725 gl_pthread_api=no
13726 LIBPTHREAD=
13727 LIBPMULTITHREAD=
13728 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
13729 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
13730 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
13731if test "x$ac_cv_header_pthread_h" = xyes; then :
13732 gl_have_pthread_h=yes
13733else
13734 gl_have_pthread_h=no
13735fi
13736
13737
13738 if test "$gl_have_pthread_h" = yes; then
13739 # Other possible tests:
13740 # -lpthreads (FSU threads, PCthreads)
13741 # -lgthreads
13742 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
13743 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
13744 # the second one only in libpthread, and lock.c needs it.
13745 #
13746 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
13747 # needs -pthread for some reason. See:
13748 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
13749 save_LIBS=$LIBS
13750 for gl_pthread in '' '-pthread'; do
13751 LIBS="$LIBS $gl_pthread"
13752 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13753/* end confdefs.h. */
13754#include <pthread.h>
13755 pthread_mutex_t m;
13756 pthread_mutexattr_t ma;
5e8754f9 13757
c0c3707f
CB
13758int
13759main ()
13760{
5df4cba6
SM
13761pthread_mutex_lock (&m);
13762 pthread_mutexattr_init (&ma);
c0c3707f
CB
13763 ;
13764 return 0;
13765}
13766_ACEOF
5df4cba6
SM
13767if ac_fn_c_try_link "$LINENO"; then :
13768 gl_pthread_api=yes
13769 LIBPTHREAD=$gl_pthread
13770 LIBPMULTITHREAD=$gl_pthread
c0c3707f 13771fi
5df4cba6
SM
13772rm -f core conftest.err conftest.$ac_objext \
13773 conftest$ac_exeext conftest.$ac_ext
13774 LIBS=$save_LIBS
13775 test $gl_pthread_api = yes && break
13776 done
13777
13778 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
13779 # since it is defined as a macro on OSF/1.)
13780 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
13781 # The program links fine without libpthread. But it may actually
13782 # need to link with libpthread in order to create multiple threads.
13783 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
13784$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
13785if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
13786 $as_echo_n "(cached) " >&6
c0c3707f 13787else
5df4cba6
SM
13788 ac_check_lib_save_LIBS=$LIBS
13789LIBS="-lpthread $LIBS"
13790cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13791/* end confdefs.h. */
5df4cba6
SM
13792
13793/* Override any GCC internal prototype to avoid an error.
13794 Use char because int might match the return type of a GCC
13795 builtin and then its argument prototype would still apply. */
13796#ifdef __cplusplus
13797extern "C"
13798#endif
13799char pthread_kill ();
c0c3707f
CB
13800int
13801main ()
13802{
5df4cba6 13803return pthread_kill ();
c0c3707f
CB
13804 ;
13805 return 0;
13806}
13807_ACEOF
5df4cba6
SM
13808if ac_fn_c_try_link "$LINENO"; then :
13809 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 13810else
5df4cba6 13811 ac_cv_lib_pthread_pthread_kill=no
6ec2e0f5 13812fi
5df4cba6
SM
13813rm -f core conftest.err conftest.$ac_objext \
13814 conftest$ac_exeext conftest.$ac_ext
13815LIBS=$ac_check_lib_save_LIBS
c0c3707f 13816fi
5df4cba6
SM
13817{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
13818$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
13819if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
13820 LIBPMULTITHREAD=-lpthread
13821 # On Solaris and HP-UX, most pthread functions exist also in libc.
13822 # Therefore pthread_in_use() needs to actually try to create a
13823 # thread: pthread_create from libc will fail, whereas
13824 # pthread_create will actually create a thread.
13825 # On Solaris 10 or newer, this test is no longer needed, because
13826 # libc contains the fully functional pthread functions.
13827 case "$host_os" in
13828 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
472fa5ee 13829
5df4cba6 13830$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
472fa5ee 13831
5df4cba6 13832 esac
472fa5ee 13833
5df4cba6 13834fi
472fa5ee 13835
5df4cba6
SM
13836 elif test $gl_pthread_api != yes; then
13837 # Some library is needed. Try libpthread and libc_r.
13838 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
13839$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
13840if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
13841 $as_echo_n "(cached) " >&6
13842else
5df4cba6
SM
13843 ac_check_lib_save_LIBS=$LIBS
13844LIBS="-lpthread $LIBS"
13845cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13846/* end confdefs.h. */
5df4cba6
SM
13847
13848/* Override any GCC internal prototype to avoid an error.
13849 Use char because int might match the return type of a GCC
13850 builtin and then its argument prototype would still apply. */
13851#ifdef __cplusplus
13852extern "C"
13853#endif
13854char pthread_kill ();
c0c3707f
CB
13855int
13856main ()
13857{
5df4cba6 13858return pthread_kill ();
c0c3707f
CB
13859 ;
13860 return 0;
13861}
13862_ACEOF
13863if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 13864 ac_cv_lib_pthread_pthread_kill=yes
c0c3707f 13865else
5df4cba6 13866 ac_cv_lib_pthread_pthread_kill=no
c0c3707f
CB
13867fi
13868rm -f core conftest.err conftest.$ac_objext \
13869 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
13870LIBS=$ac_check_lib_save_LIBS
13871fi
13872{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
13873$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
13874if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
13875 gl_pthread_api=yes
13876 LIBPTHREAD=-lpthread
13877 LIBPMULTITHREAD=-lpthread
c0c3707f 13878fi
472fa5ee 13879
5df4cba6
SM
13880 if test $gl_pthread_api != yes; then
13881 # For FreeBSD 4.
13882 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
13883$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
13884if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
13885 $as_echo_n "(cached) " >&6
13886else
13887 ac_check_lib_save_LIBS=$LIBS
13888LIBS="-lc_r $LIBS"
13889cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13890/* end confdefs.h. */
472fa5ee 13891
5df4cba6
SM
13892/* Override any GCC internal prototype to avoid an error.
13893 Use char because int might match the return type of a GCC
13894 builtin and then its argument prototype would still apply. */
13895#ifdef __cplusplus
13896extern "C"
13897#endif
13898char pthread_kill ();
13899int
13900main ()
13901{
13902return pthread_kill ();
13903 ;
13904 return 0;
13905}
13906_ACEOF
13907if ac_fn_c_try_link "$LINENO"; then :
13908 ac_cv_lib_c_r_pthread_kill=yes
13909else
13910 ac_cv_lib_c_r_pthread_kill=no
13911fi
13912rm -f core conftest.err conftest.$ac_objext \
13913 conftest$ac_exeext conftest.$ac_ext
13914LIBS=$ac_check_lib_save_LIBS
13915fi
13916{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
13917$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
13918if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
13919 gl_pthread_api=yes
13920 LIBPTHREAD=-lc_r
13921 LIBPMULTITHREAD=-lc_r
13922fi
6ec2e0f5 13923
5df4cba6
SM
13924 fi
13925 fi
13926 fi
13927 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
13928$as_echo_n "checking whether POSIX threads API is available... " >&6; }
13929 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
13930$as_echo "$gl_pthread_api" >&6; }
472fa5ee
SM
13931
13932
5df4cba6 13933 if test $gl_pthread_api = yes; then
472fa5ee 13934
5df4cba6 13935$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
472fa5ee 13936
5df4cba6 13937 fi
472fa5ee 13938
5df4cba6 13939 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13940/* end confdefs.h. */
5df4cba6 13941#include <sched.h>
c0c3707f
CB
13942int
13943main ()
13944{
5df4cba6 13945sched_yield ();
c0c3707f
CB
13946 ;
13947 return 0;
13948}
13949_ACEOF
13950if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 13951 LIB_SCHED_YIELD=
6ec2e0f5 13952
c0c3707f 13953else
5df4cba6
SM
13954 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
13955$as_echo_n "checking for sched_yield in -lrt... " >&6; }
13956if ${ac_cv_lib_rt_sched_yield+:} false; then :
13957 $as_echo_n "(cached) " >&6
c0c3707f 13958else
5df4cba6
SM
13959 ac_check_lib_save_LIBS=$LIBS
13960LIBS="-lrt $LIBS"
13961cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13962/* end confdefs.h. */
6ec2e0f5 13963
5df4cba6
SM
13964/* Override any GCC internal prototype to avoid an error.
13965 Use char because int might match the return type of a GCC
13966 builtin and then its argument prototype would still apply. */
13967#ifdef __cplusplus
13968extern "C"
13969#endif
13970char sched_yield ();
13971int
13972main ()
c0c3707f 13973{
5df4cba6
SM
13974return sched_yield ();
13975 ;
13976 return 0;
c0c3707f 13977}
6ec2e0f5 13978_ACEOF
5df4cba6
SM
13979if ac_fn_c_try_link "$LINENO"; then :
13980 ac_cv_lib_rt_sched_yield=yes
c0c3707f 13981else
5df4cba6 13982 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 13983fi
5df4cba6
SM
13984rm -f core conftest.err conftest.$ac_objext \
13985 conftest$ac_exeext conftest.$ac_ext
13986LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 13987fi
5df4cba6
SM
13988{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
13989$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
13990if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
13991 LIB_SCHED_YIELD=-lrt
13992else
13993 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
13994$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
13995if ${ac_cv_lib_posix4_sched_yield+:} false; then :
13996 $as_echo_n "(cached) " >&6
13997else
13998 ac_check_lib_save_LIBS=$LIBS
13999LIBS="-lposix4 $LIBS"
14000cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14001/* end confdefs.h. */
6ec2e0f5 14002
5df4cba6
SM
14003/* Override any GCC internal prototype to avoid an error.
14004 Use char because int might match the return type of a GCC
14005 builtin and then its argument prototype would still apply. */
14006#ifdef __cplusplus
14007extern "C"
14008#endif
14009char sched_yield ();
c0c3707f
CB
14010int
14011main ()
14012{
5df4cba6 14013return sched_yield ();
c0c3707f
CB
14014 ;
14015 return 0;
14016}
14017_ACEOF
14018if ac_fn_c_try_link "$LINENO"; then :
5df4cba6
SM
14019 ac_cv_lib_posix4_sched_yield=yes
14020else
14021 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14022fi
14023rm -f core conftest.err conftest.$ac_objext \
14024 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14025LIBS=$ac_check_lib_save_LIBS
14026fi
14027{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14028$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14029if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14030 LIB_SCHED_YIELD=-lposix4
14031fi
14032
14033fi
14034
14035
14036fi
14037rm -f core conftest.err conftest.$ac_objext \
14038 conftest$ac_exeext conftest.$ac_ext
14039
14040
14041 gl_pthreadlib_body_done=done
14042 fi
14043
14044 LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
14045 LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
14046 if test $gl_pthread_api = yes; then
14047 if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
14048 gl_threads_api='isoc+posix'
14049
14050$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
14051
14052 LIBTHREAD= LTLIBTHREAD=
14053 else
14054 gl_threads_api=posix
14055
14056$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
14057
14058 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
14059 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
14060
14061$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
14062
14063 LIBTHREAD= LTLIBTHREAD=
14064 fi
14065 fi
14066 fi
c0c3707f
CB
14067 fi
14068 fi
5df4cba6
SM
14069 if test $gl_threads_api = none; then
14070 if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
14071
14072
14073
14074 if test -z "$gl_stdthreadlib_body_done"; then
14075
14076
14077 case "$host_os" in
14078 mingw*)
14079 LIBSTDTHREAD=
14080 ;;
14081 *)
c0c3707f
CB
14082
14083
5df4cba6 14084 if test -z "$gl_pthreadlib_body_done"; then
c0c3707f
CB
14085 gl_pthread_api=no
14086 LIBPTHREAD=
14087 LIBPMULTITHREAD=
14088 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
14089 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
14090 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
14091if test "x$ac_cv_header_pthread_h" = xyes; then :
14092 gl_have_pthread_h=yes
14093else
14094 gl_have_pthread_h=no
14095fi
6ec2e0f5 14096
6ec2e0f5 14097
c0c3707f
CB
14098 if test "$gl_have_pthread_h" = yes; then
14099 # Other possible tests:
14100 # -lpthreads (FSU threads, PCthreads)
14101 # -lgthreads
14102 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
14103 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
14104 # the second one only in libpthread, and lock.c needs it.
14105 #
14106 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
14107 # needs -pthread for some reason. See:
14108 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
14109 save_LIBS=$LIBS
14110 for gl_pthread in '' '-pthread'; do
14111 LIBS="$LIBS $gl_pthread"
14112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14113/* end confdefs.h. */
14114#include <pthread.h>
14115 pthread_mutex_t m;
14116 pthread_mutexattr_t ma;
6ec2e0f5 14117
c0c3707f
CB
14118int
14119main ()
14120{
14121pthread_mutex_lock (&m);
14122 pthread_mutexattr_init (&ma);
14123 ;
14124 return 0;
14125}
6ec2e0f5 14126_ACEOF
c0c3707f
CB
14127if ac_fn_c_try_link "$LINENO"; then :
14128 gl_pthread_api=yes
14129 LIBPTHREAD=$gl_pthread
14130 LIBPMULTITHREAD=$gl_pthread
6ec2e0f5 14131fi
c0c3707f
CB
14132rm -f core conftest.err conftest.$ac_objext \
14133 conftest$ac_exeext conftest.$ac_ext
14134 LIBS=$save_LIBS
14135 test $gl_pthread_api = yes && break
14136 done
6ec2e0f5 14137
c0c3707f
CB
14138 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
14139 # since it is defined as a macro on OSF/1.)
14140 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
14141 # The program links fine without libpthread. But it may actually
14142 # need to link with libpthread in order to create multiple threads.
14143 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14144$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14145if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
14146 $as_echo_n "(cached) " >&6
14147else
c0c3707f 14148 ac_check_lib_save_LIBS=$LIBS
5df4cba6
SM
14149LIBS="-lpthread $LIBS"
14150cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14151/* end confdefs.h. */
14152
14153/* Override any GCC internal prototype to avoid an error.
14154 Use char because int might match the return type of a GCC
14155 builtin and then its argument prototype would still apply. */
14156#ifdef __cplusplus
14157extern "C"
14158#endif
14159char pthread_kill ();
14160int
14161main ()
14162{
14163return pthread_kill ();
14164 ;
14165 return 0;
14166}
14167_ACEOF
14168if ac_fn_c_try_link "$LINENO"; then :
14169 ac_cv_lib_pthread_pthread_kill=yes
14170else
14171 ac_cv_lib_pthread_pthread_kill=no
14172fi
14173rm -f core conftest.err conftest.$ac_objext \
14174 conftest$ac_exeext conftest.$ac_ext
14175LIBS=$ac_check_lib_save_LIBS
14176fi
14177{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14178$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14179if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14180 LIBPMULTITHREAD=-lpthread
14181 # On Solaris and HP-UX, most pthread functions exist also in libc.
14182 # Therefore pthread_in_use() needs to actually try to create a
14183 # thread: pthread_create from libc will fail, whereas
14184 # pthread_create will actually create a thread.
14185 # On Solaris 10 or newer, this test is no longer needed, because
14186 # libc contains the fully functional pthread functions.
14187 case "$host_os" in
14188 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
14189
14190$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
14191
14192 esac
14193
14194fi
14195
14196 elif test $gl_pthread_api != yes; then
14197 # Some library is needed. Try libpthread and libc_r.
14198 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14199$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14200if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
14201 $as_echo_n "(cached) " >&6
14202else
14203 ac_check_lib_save_LIBS=$LIBS
14204LIBS="-lpthread $LIBS"
14205cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14206/* end confdefs.h. */
14207
14208/* Override any GCC internal prototype to avoid an error.
14209 Use char because int might match the return type of a GCC
14210 builtin and then its argument prototype would still apply. */
14211#ifdef __cplusplus
14212extern "C"
14213#endif
14214char pthread_kill ();
14215int
14216main ()
14217{
14218return pthread_kill ();
14219 ;
14220 return 0;
14221}
14222_ACEOF
14223if ac_fn_c_try_link "$LINENO"; then :
14224 ac_cv_lib_pthread_pthread_kill=yes
14225else
14226 ac_cv_lib_pthread_pthread_kill=no
14227fi
14228rm -f core conftest.err conftest.$ac_objext \
14229 conftest$ac_exeext conftest.$ac_ext
14230LIBS=$ac_check_lib_save_LIBS
14231fi
14232{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14233$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14234if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14235 gl_pthread_api=yes
14236 LIBPTHREAD=-lpthread
14237 LIBPMULTITHREAD=-lpthread
14238fi
14239
14240 if test $gl_pthread_api != yes; then
14241 # For FreeBSD 4.
14242 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14243$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14244if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14245 $as_echo_n "(cached) " >&6
14246else
14247 ac_check_lib_save_LIBS=$LIBS
14248LIBS="-lc_r $LIBS"
14249cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14250/* end confdefs.h. */
14251
14252/* Override any GCC internal prototype to avoid an error.
14253 Use char because int might match the return type of a GCC
14254 builtin and then its argument prototype would still apply. */
14255#ifdef __cplusplus
14256extern "C"
14257#endif
14258char pthread_kill ();
14259int
14260main ()
14261{
14262return pthread_kill ();
14263 ;
14264 return 0;
14265}
14266_ACEOF
14267if ac_fn_c_try_link "$LINENO"; then :
14268 ac_cv_lib_c_r_pthread_kill=yes
14269else
14270 ac_cv_lib_c_r_pthread_kill=no
14271fi
14272rm -f core conftest.err conftest.$ac_objext \
14273 conftest$ac_exeext conftest.$ac_ext
14274LIBS=$ac_check_lib_save_LIBS
14275fi
14276{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14277$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14278if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14279 gl_pthread_api=yes
14280 LIBPTHREAD=-lc_r
14281 LIBPMULTITHREAD=-lc_r
14282fi
14283
14284 fi
14285 fi
14286 fi
14287 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14288$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14289 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14290$as_echo "$gl_pthread_api" >&6; }
14291
14292
14293 if test $gl_pthread_api = yes; then
14294
14295$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
14296
14297 fi
14298
14299 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14300/* end confdefs.h. */
14301#include <sched.h>
14302int
14303main ()
14304{
14305sched_yield ();
14306 ;
14307 return 0;
14308}
14309_ACEOF
14310if ac_fn_c_try_link "$LINENO"; then :
14311 LIB_SCHED_YIELD=
14312
14313else
14314 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14315$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14316if ${ac_cv_lib_rt_sched_yield+:} false; then :
14317 $as_echo_n "(cached) " >&6
14318else
14319 ac_check_lib_save_LIBS=$LIBS
14320LIBS="-lrt $LIBS"
c0c3707f 14321cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14322/* end confdefs.h. */
6ec2e0f5 14323
c0c3707f
CB
14324/* Override any GCC internal prototype to avoid an error.
14325 Use char because int might match the return type of a GCC
14326 builtin and then its argument prototype would still apply. */
14327#ifdef __cplusplus
14328extern "C"
14329#endif
5df4cba6 14330char sched_yield ();
c0c3707f
CB
14331int
14332main ()
14333{
5df4cba6 14334return sched_yield ();
c0c3707f
CB
14335 ;
14336 return 0;
14337}
6ec2e0f5 14338_ACEOF
c0c3707f 14339if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14340 ac_cv_lib_rt_sched_yield=yes
6ec2e0f5 14341else
5df4cba6 14342 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14343fi
c0c3707f
CB
14344rm -f core conftest.err conftest.$ac_objext \
14345 conftest$ac_exeext conftest.$ac_ext
14346LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14347fi
5df4cba6
SM
14348{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14349$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14350if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14351 LIB_SCHED_YIELD=-lrt
14352else
14353 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14354$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14355if ${ac_cv_lib_posix4_sched_yield+:} false; then :
6ec2e0f5
SDJ
14356 $as_echo_n "(cached) " >&6
14357else
c0c3707f 14358 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14359LIBS="-lposix4 $LIBS"
c0c3707f 14360cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
14361/* end confdefs.h. */
14362
c0c3707f
CB
14363/* Override any GCC internal prototype to avoid an error.
14364 Use char because int might match the return type of a GCC
14365 builtin and then its argument prototype would still apply. */
14366#ifdef __cplusplus
14367extern "C"
14368#endif
5df4cba6 14369char sched_yield ();
6ec2e0f5
SDJ
14370int
14371main ()
14372{
5df4cba6 14373return sched_yield ();
c0c3707f
CB
14374 ;
14375 return 0;
14376}
14377_ACEOF
14378if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14379 ac_cv_lib_posix4_sched_yield=yes
c0c3707f 14380else
5df4cba6 14381 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14382fi
14383rm -f core conftest.err conftest.$ac_objext \
14384 conftest$ac_exeext conftest.$ac_ext
14385LIBS=$ac_check_lib_save_LIBS
14386fi
5df4cba6
SM
14387{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14388$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14389if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14390 LIB_SCHED_YIELD=-lposix4
c0c3707f 14391fi
6ec2e0f5 14392
5df4cba6
SM
14393fi
14394
14395
14396fi
14397rm -f core conftest.err conftest.$ac_objext \
14398 conftest$ac_exeext conftest.$ac_ext
14399
14400
14401 gl_pthreadlib_body_done=done
14402 fi
14403
14404 if test $ac_cv_header_threads_h = yes; then
14405 for ac_func in thrd_create
14406do :
14407 ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create"
14408if test "x$ac_cv_func_thrd_create" = xyes; then :
14409 cat >>confdefs.h <<_ACEOF
14410#define HAVE_THRD_CREATE 1
14411_ACEOF
14412
14413fi
14414done
14415
14416 if test $ac_cv_func_thrd_create = yes; then
14417 LIBSTDTHREAD=
14418 else
14419 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5
14420$as_echo_n "checking for thrd_create in -lstdthreads... " >&6; }
14421if ${ac_cv_lib_stdthreads_thrd_create+:} false; then :
c0c3707f
CB
14422 $as_echo_n "(cached) " >&6
14423else
14424 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14425LIBS="-lstdthreads $LIBS"
c0c3707f
CB
14426cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14427/* end confdefs.h. */
6ec2e0f5 14428
c0c3707f
CB
14429/* Override any GCC internal prototype to avoid an error.
14430 Use char because int might match the return type of a GCC
14431 builtin and then its argument prototype would still apply. */
14432#ifdef __cplusplus
14433extern "C"
14434#endif
5df4cba6 14435char thrd_create ();
c0c3707f
CB
14436int
14437main ()
14438{
5df4cba6 14439return thrd_create ();
6ec2e0f5
SDJ
14440 ;
14441 return 0;
14442}
14443_ACEOF
c0c3707f 14444if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14445 ac_cv_lib_stdthreads_thrd_create=yes
6ec2e0f5 14446else
5df4cba6 14447 ac_cv_lib_stdthreads_thrd_create=no
6ec2e0f5 14448fi
c0c3707f
CB
14449rm -f core conftest.err conftest.$ac_objext \
14450 conftest$ac_exeext conftest.$ac_ext
14451LIBS=$ac_check_lib_save_LIBS
14452fi
5df4cba6
SM
14453{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5
14454$as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; }
14455if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then :
6ec2e0f5 14456
5df4cba6 14457 LIBSTDTHREAD='-lstdthreads -lpthread'
6ec2e0f5 14458
5df4cba6 14459else
6ec2e0f5 14460
5df4cba6 14461 LIBSTDTHREAD="$LIBPMULTITHREAD"
6ec2e0f5 14462
5df4cba6 14463fi
6ec2e0f5 14464
5df4cba6 14465 fi
c0c3707f 14466 else
5df4cba6
SM
14467 LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
14468 fi
14469 ;;
14470 esac
c0c3707f 14471
c0c3707f 14472
5df4cba6
SM
14473 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5
14474$as_echo_n "checking whether ISO C threads API is available... " >&6; }
14475 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5
14476$as_echo "$ac_cv_header_threads_h" >&6; }
14477 gl_stdthreadlib_body_done=done
14478 fi
c0c3707f 14479
5df4cba6
SM
14480 LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
14481 LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
c0c3707f
CB
14482 gl_threads_api=isoc
14483
14484$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
14485
14486 fi
14487 fi
14488 if test $gl_threads_api = none; then
14489 case "$gl_use_threads" in
14490 yes | windows | win32) # The 'win32' is for backward compatibility.
14491 if { case "$host_os" in
14492 mingw*) true;;
14493 *) false;;
14494 esac
14495 }; then
14496 gl_threads_api=windows
14497
14498$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
14499
14500 fi
14501 ;;
14502 esac
14503 fi
14504 fi
14505 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
14506$as_echo_n "checking for multithread API to use... " >&6; }
14507 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
14508$as_echo "$gl_threads_api" >&6; }
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
14522$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
14523if ${gl_cv_func_malloc_posix+:} false; then :
6ec2e0f5
SDJ
14524 $as_echo_n "(cached) " >&6
14525else
c0c3707f
CB
14526
14527 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14528/* end confdefs.h. */
c0c3707f 14529
6ec2e0f5
SDJ
14530int
14531main ()
14532{
c0c3707f
CB
14533#if defined _WIN32 && ! defined __CYGWIN__
14534 choke me
14535 #endif
6ec2e0f5
SDJ
14536
14537 ;
14538 return 0;
14539}
14540_ACEOF
14541if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 14542 gl_cv_func_malloc_posix=yes
6ec2e0f5 14543else
c0c3707f 14544 gl_cv_func_malloc_posix=no
6ec2e0f5
SDJ
14545fi
14546rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
472fa5ee 14547
c0c3707f
CB
14548fi
14549{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
14550$as_echo "$gl_cv_func_malloc_posix" >&6; }
472fa5ee
SM
14551
14552
6ec2e0f5 14553
c0c3707f
CB
14554 for ac_header in stdlib.h
14555do :
14556 ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
14557if test "x$ac_cv_header_stdlib_h" = xyes; then :
14558 cat >>confdefs.h <<_ACEOF
14559#define HAVE_STDLIB_H 1
6ec2e0f5
SDJ
14560_ACEOF
14561
c0c3707f 14562fi
6ec2e0f5 14563
c0c3707f 14564done
472fa5ee 14565
c0c3707f
CB
14566 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
14567$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
14568if ${ac_cv_func_malloc_0_nonnull+:} false; then :
6ec2e0f5
SDJ
14569 $as_echo_n "(cached) " >&6
14570else
14571 if test "$cross_compiling" = yes; then :
14572 case "$host_os" in
c0c3707f
CB
14573 # Guess yes on platforms where we know the result.
14574 *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
14575 | hpux* | solaris* | cygwin* | mingw*)
14576 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
14577 # If we don't know, obey --enable-cross-guesses.
14578 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
14579 esac
6ec2e0f5
SDJ
14580
14581else
14582 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14583/* end confdefs.h. */
c0c3707f
CB
14584#if defined STDC_HEADERS || defined HAVE_STDLIB_H
14585 # include <stdlib.h>
14586 #else
14587 char *malloc ();
14588 #endif
6ec2e0f5
SDJ
14589
14590int
14591main ()
14592{
c0c3707f
CB
14593char *p = malloc (0);
14594 int result = !p;
14595 free (p);
14596 return result;
6ec2e0f5
SDJ
14597 ;
14598 return 0;
14599}
c0c3707f 14600
6ec2e0f5
SDJ
14601_ACEOF
14602if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 14603 ac_cv_func_malloc_0_nonnull=yes
6ec2e0f5 14604else
c0c3707f 14605 ac_cv_func_malloc_0_nonnull=no
6ec2e0f5
SDJ
14606fi
14607rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14608 conftest.$ac_objext conftest.beam conftest.$ac_ext
14609fi
14610
14611
14612fi
c0c3707f
CB
14613{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
14614$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
14615 case "$ac_cv_func_malloc_0_nonnull" in
14616 *yes)
14617 gl_cv_func_malloc_0_nonnull=1
14618 ;;
6ec2e0f5 14619 *)
c0c3707f 14620 gl_cv_func_malloc_0_nonnull=0
6ec2e0f5
SDJ
14621 ;;
14622 esac
14623
14624
c0c3707f
CB
14625cat >>confdefs.h <<_ACEOF
14626#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
14627_ACEOF
14628
14629
14630
14631
14632
14633 GNULIB_BTOWC=0;
14634 GNULIB_WCTOB=0;
14635 GNULIB_MBSINIT=0;
14636 GNULIB_MBRTOWC=0;
14637 GNULIB_MBRLEN=0;
14638 GNULIB_MBSRTOWCS=0;
14639 GNULIB_MBSNRTOWCS=0;
14640 GNULIB_WCRTOMB=0;
14641 GNULIB_WCSRTOMBS=0;
14642 GNULIB_WCSNRTOMBS=0;
14643 GNULIB_WCWIDTH=0;
14644 GNULIB_WMEMCHR=0;
14645 GNULIB_WMEMCMP=0;
14646 GNULIB_WMEMCPY=0;
14647 GNULIB_WMEMMOVE=0;
14648 GNULIB_WMEMSET=0;
14649 GNULIB_WCSLEN=0;
14650 GNULIB_WCSNLEN=0;
14651 GNULIB_WCSCPY=0;
14652 GNULIB_WCPCPY=0;
14653 GNULIB_WCSNCPY=0;
14654 GNULIB_WCPNCPY=0;
14655 GNULIB_WCSCAT=0;
14656 GNULIB_WCSNCAT=0;
14657 GNULIB_WCSCMP=0;
14658 GNULIB_WCSNCMP=0;
14659 GNULIB_WCSCASECMP=0;
14660 GNULIB_WCSNCASECMP=0;
14661 GNULIB_WCSCOLL=0;
14662 GNULIB_WCSXFRM=0;
14663 GNULIB_WCSDUP=0;
14664 GNULIB_WCSCHR=0;
14665 GNULIB_WCSRCHR=0;
14666 GNULIB_WCSCSPN=0;
14667 GNULIB_WCSSPN=0;
14668 GNULIB_WCSPBRK=0;
14669 GNULIB_WCSSTR=0;
14670 GNULIB_WCSTOK=0;
14671 GNULIB_WCSWIDTH=0;
14672 GNULIB_WCSFTIME=0;
14673 HAVE_BTOWC=1;
14674 HAVE_MBSINIT=1;
14675 HAVE_MBRTOWC=1;
14676 HAVE_MBRLEN=1;
14677 HAVE_MBSRTOWCS=1;
14678 HAVE_MBSNRTOWCS=1;
14679 HAVE_WCRTOMB=1;
14680 HAVE_WCSRTOMBS=1;
14681 HAVE_WCSNRTOMBS=1;
14682 HAVE_WMEMCHR=1;
14683 HAVE_WMEMCMP=1;
14684 HAVE_WMEMCPY=1;
14685 HAVE_WMEMMOVE=1;
14686 HAVE_WMEMSET=1;
14687 HAVE_WCSLEN=1;
14688 HAVE_WCSNLEN=1;
14689 HAVE_WCSCPY=1;
14690 HAVE_WCPCPY=1;
14691 HAVE_WCSNCPY=1;
14692 HAVE_WCPNCPY=1;
14693 HAVE_WCSCAT=1;
14694 HAVE_WCSNCAT=1;
14695 HAVE_WCSCMP=1;
14696 HAVE_WCSNCMP=1;
14697 HAVE_WCSCASECMP=1;
14698 HAVE_WCSNCASECMP=1;
14699 HAVE_WCSCOLL=1;
14700 HAVE_WCSXFRM=1;
14701 HAVE_WCSDUP=1;
14702 HAVE_WCSCHR=1;
14703 HAVE_WCSRCHR=1;
14704 HAVE_WCSCSPN=1;
14705 HAVE_WCSSPN=1;
14706 HAVE_WCSPBRK=1;
14707 HAVE_WCSSTR=1;
14708 HAVE_WCSTOK=1;
14709 HAVE_WCSWIDTH=1;
14710 HAVE_WCSFTIME=1;
14711 HAVE_DECL_WCTOB=1;
14712 HAVE_DECL_WCWIDTH=1;
14713 REPLACE_MBSTATE_T=0;
14714 REPLACE_BTOWC=0;
14715 REPLACE_WCTOB=0;
14716 REPLACE_MBSINIT=0;
14717 REPLACE_MBRTOWC=0;
14718 REPLACE_MBRLEN=0;
14719 REPLACE_MBSRTOWCS=0;
14720 REPLACE_MBSNRTOWCS=0;
14721 REPLACE_WCRTOMB=0;
14722 REPLACE_WCSRTOMBS=0;
14723 REPLACE_WCSNRTOMBS=0;
14724 REPLACE_WCWIDTH=0;
14725 REPLACE_WCSWIDTH=0;
14726 REPLACE_WCSFTIME=0;
14727 REPLACE_WCSTOK=0;
14728
14729
6ec2e0f5
SDJ
14730
14731
14732
14733
14734
14735
c0c3707f
CB
14736 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
14737$as_echo_n "checking for a traditional japanese locale... " >&6; }
14738if ${gt_cv_locale_ja+:} false; then :
14739 $as_echo_n "(cached) " >&6
14740else
14741
14742 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14743/* end confdefs.h. */
6ec2e0f5 14744
c0c3707f
CB
14745#include <locale.h>
14746#include <time.h>
14747#if HAVE_LANGINFO_CODESET
14748# include <langinfo.h>
14749#endif
14750#include <stdlib.h>
14751#include <string.h>
14752struct tm t;
14753char buf[16];
14754int main ()
14755{
14756 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
14757 imitates locale dependent behaviour by looking at the environment
14758 variables, and all locales use the UTF-8 encoding. */
14759#if defined __BEOS__ || defined __HAIKU__
14760 return 1;
14761#else
14762 /* Check whether the given locale name is recognized by the system. */
14763# if defined _WIN32 && !defined __CYGWIN__
14764 /* On native Windows, setlocale(category, "") looks at the system settings,
14765 not at the environment variables. Also, when an encoding suffix such
14766 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
14767 category of the locale to "C". */
14768 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
14769 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
14770 return 1;
14771# else
14772 if (setlocale (LC_ALL, "") == NULL) return 1;
14773# endif
14774 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
14775 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
14776 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
14777 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
14778 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
14779 some unit tests fail.
14780 On MirBSD 10, when an unsupported locale is specified, setlocale()
14781 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
14782# if HAVE_LANGINFO_CODESET
14783 {
14784 const char *cs = nl_langinfo (CODESET);
14785 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
14786 || strcmp (cs, "UTF-8") == 0)
14787 return 1;
14788 }
14789# endif
14790# ifdef __CYGWIN__
14791 /* On Cygwin, avoid locale names without encoding suffix, because the
14792 locale_charset() function relies on the encoding suffix. Note that
14793 LC_ALL is set on the command line. */
14794 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
14795# endif
14796 /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
14797 on Cygwin 1.5.x. */
14798 if (MB_CUR_MAX == 1)
14799 return 1;
14800 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
14801 This excludes the UTF-8 encoding (except on MirBSD). */
14802 {
14803 const char *p;
14804 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
14805 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
14806 for (p = buf; *p != '\0'; p++)
14807 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
14808 return 1;
14809 }
14810 return 0;
14811#endif
14812}
6ec2e0f5 14813
c0c3707f
CB
14814_ACEOF
14815 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
14816 (eval $ac_link) 2>&5
14817 ac_status=$?
14818 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14819 test $ac_status = 0; } && test -s conftest$ac_exeext; then
14820 case "$host_os" in
14821 # Handle native Windows specially, because there setlocale() interprets
14822 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
14823 # "fr" or "fra" as "French" or "French_France.1252",
14824 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
14825 # "ja" as "Japanese" or "Japanese_Japan.932",
14826 # and similar.
14827 mingw*)
14828 # Note that on native Windows, the Japanese locale is
14829 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
14830 # cannot use it here.
14831 gt_cv_locale_ja=none
14832 ;;
14833 *)
14834 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
14835 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
14836 # configure script would override the LC_ALL setting. Likewise for
14837 # LC_CTYPE, which is also set at the beginning of the configure script.
14838 # Test for the AIX locale name.
14839 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14840 gt_cv_locale_ja=ja_JP
14841 else
14842 # Test for the locale name with explicit encoding suffix.
14843 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14844 gt_cv_locale_ja=ja_JP.EUC-JP
14845 else
14846 # Test for the HP-UX, OSF/1, NetBSD locale name.
14847 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14848 gt_cv_locale_ja=ja_JP.eucJP
14849 else
14850 # Test for the IRIX, FreeBSD locale name.
14851 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14852 gt_cv_locale_ja=ja_JP.EUC
14853 else
14854 # Test for the Solaris 7 locale name.
14855 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14856 gt_cv_locale_ja=ja
14857 else
14858 # Special test for NetBSD 1.6.
14859 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
14860 gt_cv_locale_ja=ja_JP.eucJP
14861 else
14862 # None found.
14863 gt_cv_locale_ja=none
14864 fi
14865 fi
14866 fi
14867 fi
14868 fi
14869 fi
14870 ;;
14871 esac
14872 fi
14873 rm -fr conftest*
5abebf3c
CB
14874
14875fi
c0c3707f
CB
14876{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
14877$as_echo "$gt_cv_locale_ja" >&6; }
14878 LOCALE_JA=$gt_cv_locale_ja
5abebf3c 14879
5abebf3c 14880
5abebf3c 14881
5abebf3c 14882
c0c3707f
CB
14883 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
14884$as_echo_n "checking for a french Unicode locale... " >&6; }
14885if ${gt_cv_locale_fr_utf8+:} false; then :
5abebf3c
CB
14886 $as_echo_n "(cached) " >&6
14887else
5abebf3c 14888
c0c3707f 14889 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 14890/* end confdefs.h. */
5abebf3c 14891
c0c3707f
CB
14892#include <locale.h>
14893#include <time.h>
14894#if HAVE_LANGINFO_CODESET
14895# include <langinfo.h>
14896#endif
14897#include <stdlib.h>
14898#include <string.h>
14899struct tm t;
14900char buf[16];
14901int main () {
14902 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
14903 imitates locale dependent behaviour by looking at the environment
14904 variables, and all locales use the UTF-8 encoding. */
14905#if !(defined __BEOS__ || defined __HAIKU__)
14906 /* Check whether the given locale name is recognized by the system. */
14907# if defined _WIN32 && !defined __CYGWIN__
14908 /* On native Windows, setlocale(category, "") looks at the system settings,
14909 not at the environment variables. Also, when an encoding suffix such
14910 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
14911 category of the locale to "C". */
14912 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
14913 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
14914 return 1;
14915# else
14916 if (setlocale (LC_ALL, "") == NULL) return 1;
14917# endif
14918 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
14919 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
14920 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
14921 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
14922 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
14923 some unit tests fail. */
14924# if HAVE_LANGINFO_CODESET
14925 {
14926 const char *cs = nl_langinfo (CODESET);
14927 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
14928 return 1;
14929 }
14930# endif
14931# ifdef __CYGWIN__
14932 /* On Cygwin, avoid locale names without encoding suffix, because the
14933 locale_charset() function relies on the encoding suffix. Note that
14934 LC_ALL is set on the command line. */
14935 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
14936# endif
14937 /* Check whether in the abbreviation of the second month, the second
14938 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
14939 two bytes long, with UTF-8 encoding. */
14940 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
14941 if (strftime (buf, sizeof (buf), "%b", &t) < 4
14942 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
14943 return 1;
14944#endif
14945#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
14946 /* Check whether the decimal separator is a comma.
14947 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
14948 are nl_langinfo(RADIXCHAR) are both ".". */
14949 if (localeconv () ->decimal_point[0] != ',') return 1;
14950#endif
5abebf3c
CB
14951 return 0;
14952}
5abebf3c 14953
c0c3707f
CB
14954_ACEOF
14955 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
14956 (eval $ac_link) 2>&5
14957 ac_status=$?
14958 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14959 test $ac_status = 0; } && test -s conftest$ac_exeext; then
14960 case "$host_os" in
14961 # Handle native Windows specially, because there setlocale() interprets
14962 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
14963 # "fr" or "fra" as "French" or "French_France.1252",
14964 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
14965 # "ja" as "Japanese" or "Japanese_Japan.932",
14966 # and similar.
14967 mingw*)
14968 # Test for the hypothetical native Windows locale name.
14969 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14970 gt_cv_locale_fr_utf8=French_France.65001
14971 else
14972 # None found.
14973 gt_cv_locale_fr_utf8=none
14974 fi
14975 ;;
14976 *)
14977 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
14978 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
14979 # configure script would override the LC_ALL setting. Likewise for
14980 # LC_CTYPE, which is also set at the beginning of the configure script.
14981 # Test for the usual locale name.
14982 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14983 gt_cv_locale_fr_utf8=fr_FR
14984 else
14985 # Test for the locale name with explicit encoding suffix.
14986 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14987 gt_cv_locale_fr_utf8=fr_FR.UTF-8
14988 else
14989 # Test for the Solaris 7 locale name.
14990 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14991 gt_cv_locale_fr_utf8=fr.UTF-8
14992 else
14993 # None found.
14994 gt_cv_locale_fr_utf8=none
14995 fi
14996 fi
14997 fi
14998 ;;
14999 esac
15000 fi
15001 rm -fr conftest*
5abebf3c
CB
15002
15003fi
c0c3707f
CB
15004{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
15005$as_echo "$gt_cv_locale_fr_utf8" >&6; }
15006 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
5abebf3c
CB
15007
15008
15009
15010
15011
c0c3707f
CB
15012 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
15013$as_echo_n "checking for a transitional chinese locale... " >&6; }
15014if ${gt_cv_locale_zh_CN+:} false; then :
5abebf3c
CB
15015 $as_echo_n "(cached) " >&6
15016else
5abebf3c 15017
c0c3707f 15018 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 15019/* end confdefs.h. */
5abebf3c 15020
c0c3707f
CB
15021#include <locale.h>
15022#include <stdlib.h>
15023#include <time.h>
15024#if HAVE_LANGINFO_CODESET
15025# include <langinfo.h>
15026#endif
15027#include <stdlib.h>
15028#include <string.h>
15029struct tm t;
15030char buf[16];
15031int main ()
5abebf3c 15032{
c0c3707f
CB
15033 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15034 imitates locale dependent behaviour by looking at the environment
15035 variables, and all locales use the UTF-8 encoding. */
15036#if defined __BEOS__ || defined __HAIKU__
15037 return 1;
15038#else
15039 /* Check whether the given locale name is recognized by the system. */
15040# if defined _WIN32 && !defined __CYGWIN__
15041 /* On native Windows, setlocale(category, "") looks at the system settings,
15042 not at the environment variables. Also, when an encoding suffix such
15043 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15044 category of the locale to "C". */
15045 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15046 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15047 return 1;
15048# else
15049 if (setlocale (LC_ALL, "") == NULL) return 1;
15050# endif
15051 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15052 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15053 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15054 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15055 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15056 some unit tests fail.
15057 On MirBSD 10, when an unsupported locale is specified, setlocale()
15058 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
15059# if HAVE_LANGINFO_CODESET
15060 {
15061 const char *cs = nl_langinfo (CODESET);
15062 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15063 || strcmp (cs, "UTF-8") == 0)
15064 return 1;
15065 }
15066# endif
15067# ifdef __CYGWIN__
15068 /* On Cygwin, avoid locale names without encoding suffix, because the
15069 locale_charset() function relies on the encoding suffix. Note that
15070 LC_ALL is set on the command line. */
15071 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15072# endif
15073 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
15074 This excludes the UTF-8 encoding (except on MirBSD). */
15075 {
15076 const char *p;
15077 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15078 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
15079 for (p = buf; *p != '\0'; p++)
15080 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
15081 return 1;
15082 }
15083 /* Check whether a typical GB18030 multibyte sequence is recognized as a
15084 single wide character. This excludes the GB2312 and GBK encodings. */
15085 if (mblen ("\203\062\332\066", 5) != 4)
15086 return 1;
5abebf3c 15087 return 0;
c0c3707f 15088#endif
5abebf3c 15089}
c0c3707f 15090
5abebf3c 15091_ACEOF
c0c3707f
CB
15092 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15093 (eval $ac_link) 2>&5
15094 ac_status=$?
15095 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15096 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15097 case "$host_os" in
15098 # Handle native Windows specially, because there setlocale() interprets
15099 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15100 # "fr" or "fra" as "French" or "French_France.1252",
15101 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15102 # "ja" as "Japanese" or "Japanese_Japan.932",
15103 # and similar.
15104 mingw*)
15105 # Test for the hypothetical native Windows locale name.
15106 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15107 gt_cv_locale_zh_CN=Chinese_China.54936
15108 else
15109 # None found.
15110 gt_cv_locale_zh_CN=none
15111 fi
15112 ;;
15113 solaris2.8)
15114 # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
15115 # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
15116 # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
15117 gt_cv_locale_zh_CN=none
15118 ;;
15119 *)
15120 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15121 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15122 # configure script would override the LC_ALL setting. Likewise for
15123 # LC_CTYPE, which is also set at the beginning of the configure script.
15124 # Test for the locale name without encoding suffix.
15125 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15126 gt_cv_locale_zh_CN=zh_CN
15127 else
15128 # Test for the locale name with explicit encoding suffix.
15129 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15130 gt_cv_locale_zh_CN=zh_CN.GB18030
15131 else
15132 # None found.
15133 gt_cv_locale_zh_CN=none
15134 fi
15135 fi
15136 ;;
15137 esac
15138 else
15139 # If there was a link error, due to mblen(), the system is so old that
15140 # it certainly doesn't have a chinese locale.
15141 gt_cv_locale_zh_CN=none
15142 fi
15143 rm -fr conftest*
15144
5abebf3c 15145fi
c0c3707f
CB
15146{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
15147$as_echo "$gt_cv_locale_zh_CN" >&6; }
15148 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
15149
15150
15151{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
15152$as_echo_n "checking for inline... " >&6; }
15153if ${ac_cv_c_inline+:} false; then :
15154 $as_echo_n "(cached) " >&6
15155else
15156 ac_cv_c_inline=no
15157for ac_kw in inline __inline__ __inline; do
15158 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15159/* end confdefs.h. */
15160#ifndef __cplusplus
15161typedef int foo_t;
15162static $ac_kw foo_t static_foo () {return 0; }
15163$ac_kw foo_t foo () {return 0; }
15164#endif
5abebf3c 15165
c0c3707f
CB
15166_ACEOF
15167if ac_fn_c_try_compile "$LINENO"; then :
15168 ac_cv_c_inline=$ac_kw
15169fi
15170rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15171 test "$ac_cv_c_inline" != no && break
15172done
5abebf3c
CB
15173
15174fi
c0c3707f
CB
15175{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
15176$as_echo "$ac_cv_c_inline" >&6; }
5abebf3c 15177
c0c3707f
CB
15178case $ac_cv_c_inline in
15179 inline | yes) ;;
15180 *)
15181 case $ac_cv_c_inline in
15182 no) ac_val=;;
15183 *) ac_val=$ac_cv_c_inline;;
15184 esac
15185 cat >>confdefs.h <<_ACEOF
15186#ifndef __cplusplus
15187#define inline $ac_val
15188#endif
15189_ACEOF
15190 ;;
15191esac
5abebf3c
CB
15192
15193
15194
15195
c0c3707f
CB
15196 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
15197$as_echo_n "checking for a traditional french locale... " >&6; }
15198if ${gt_cv_locale_fr+:} false; then :
15199 $as_echo_n "(cached) " >&6
15200else
5abebf3c 15201
c0c3707f
CB
15202 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15203/* end confdefs.h. */
5abebf3c 15204
c0c3707f
CB
15205#include <locale.h>
15206#include <time.h>
15207#if HAVE_LANGINFO_CODESET
15208# include <langinfo.h>
15209#endif
15210#include <stdlib.h>
15211#include <string.h>
15212struct tm t;
15213char buf[16];
15214int main () {
15215 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15216 imitates locale dependent behaviour by looking at the environment
15217 variables, and all locales use the UTF-8 encoding. */
15218#if defined __BEOS__ || defined __HAIKU__
15219 return 1;
15220#else
15221 /* Check whether the given locale name is recognized by the system. */
15222# if defined _WIN32 && !defined __CYGWIN__
15223 /* On native Windows, setlocale(category, "") looks at the system settings,
15224 not at the environment variables. Also, when an encoding suffix such
15225 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15226 category of the locale to "C". */
15227 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15228 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15229 return 1;
15230# else
15231 if (setlocale (LC_ALL, "") == NULL) return 1;
15232# endif
15233 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15234 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15235 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15236 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15237 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15238 some unit tests fail.
15239 On MirBSD 10, when an unsupported locale is specified, setlocale()
15240 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
15241# if HAVE_LANGINFO_CODESET
15242 {
15243 const char *cs = nl_langinfo (CODESET);
15244 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15245 || strcmp (cs, "UTF-8") == 0)
15246 return 1;
15247 }
15248# endif
15249# ifdef __CYGWIN__
15250 /* On Cygwin, avoid locale names without encoding suffix, because the
15251 locale_charset() function relies on the encoding suffix. Note that
15252 LC_ALL is set on the command line. */
15253 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15254# endif
15255 /* Check whether in the abbreviation of the second month, the second
15256 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
15257 one byte long. This excludes the UTF-8 encoding. */
15258 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15259 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
15260# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
15261 /* Check whether the decimal separator is a comma.
15262 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
15263 are nl_langinfo(RADIXCHAR) are both ".". */
15264 if (localeconv () ->decimal_point[0] != ',') return 1;
15265# endif
15266 return 0;
15267#endif
15268}
5abebf3c 15269
c0c3707f
CB
15270_ACEOF
15271 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15272 (eval $ac_link) 2>&5
15273 ac_status=$?
15274 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15275 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15276 case "$host_os" in
15277 # Handle native Windows specially, because there setlocale() interprets
15278 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15279 # "fr" or "fra" as "French" or "French_France.1252",
15280 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15281 # "ja" as "Japanese" or "Japanese_Japan.932",
15282 # and similar.
15283 mingw*)
15284 # Test for the native Windows locale name.
15285 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15286 gt_cv_locale_fr=French_France.1252
15287 else
15288 # None found.
15289 gt_cv_locale_fr=none
15290 fi
15291 ;;
15292 *)
15293 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15294 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15295 # configure script would override the LC_ALL setting. Likewise for
15296 # LC_CTYPE, which is also set at the beginning of the configure script.
15297 # Test for the usual locale name.
15298 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15299 gt_cv_locale_fr=fr_FR
15300 else
15301 # Test for the locale name with explicit encoding suffix.
15302 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15303 gt_cv_locale_fr=fr_FR.ISO-8859-1
15304 else
15305 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
15306 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15307 gt_cv_locale_fr=fr_FR.ISO8859-1
15308 else
15309 # Test for the HP-UX locale name.
15310 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15311 gt_cv_locale_fr=fr_FR.iso88591
15312 else
15313 # Test for the Solaris 7 locale name.
15314 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15315 gt_cv_locale_fr=fr
15316 else
15317 # None found.
15318 gt_cv_locale_fr=none
15319 fi
15320 fi
15321 fi
15322 fi
15323 fi
15324 ;;
15325 esac
15326 fi
15327 rm -fr conftest*
5abebf3c 15328
c0c3707f
CB
15329fi
15330{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
15331$as_echo "$gt_cv_locale_fr" >&6; }
15332 LOCALE_FR=$gt_cv_locale_fr
5abebf3c
CB
15333
15334
15335
15336
15337
15338
15339
c0c3707f
CB
15340 GNULIB_EXPLICIT_BZERO=0;
15341 GNULIB_FFSL=0;
15342 GNULIB_FFSLL=0;
15343 GNULIB_MEMCHR=0;
15344 GNULIB_MEMMEM=0;
15345 GNULIB_MEMPCPY=0;
15346 GNULIB_MEMRCHR=0;
15347 GNULIB_RAWMEMCHR=0;
15348 GNULIB_STPCPY=0;
15349 GNULIB_STPNCPY=0;
15350 GNULIB_STRCHRNUL=0;
15351 GNULIB_STRDUP=0;
15352 GNULIB_STRNCAT=0;
15353 GNULIB_STRNDUP=0;
15354 GNULIB_STRNLEN=0;
15355 GNULIB_STRPBRK=0;
15356 GNULIB_STRSEP=0;
15357 GNULIB_STRSTR=0;
15358 GNULIB_STRCASESTR=0;
15359 GNULIB_STRTOK_R=0;
15360 GNULIB_MBSLEN=0;
15361 GNULIB_MBSNLEN=0;
15362 GNULIB_MBSCHR=0;
15363 GNULIB_MBSRCHR=0;
15364 GNULIB_MBSSTR=0;
15365 GNULIB_MBSCASECMP=0;
15366 GNULIB_MBSNCASECMP=0;
15367 GNULIB_MBSPCASECMP=0;
15368 GNULIB_MBSCASESTR=0;
15369 GNULIB_MBSCSPN=0;
15370 GNULIB_MBSPBRK=0;
15371 GNULIB_MBSSPN=0;
15372 GNULIB_MBSSEP=0;
15373 GNULIB_MBSTOK_R=0;
15374 GNULIB_STRERROR=0;
15375 GNULIB_STRERROR_R=0;
15376 GNULIB_STRSIGNAL=0;
15377 GNULIB_STRVERSCMP=0;
15378 HAVE_MBSLEN=0;
15379 HAVE_EXPLICIT_BZERO=1;
15380 HAVE_FFSL=1;
15381 HAVE_FFSLL=1;
15382 HAVE_MEMCHR=1;
15383 HAVE_DECL_MEMMEM=1;
15384 HAVE_MEMPCPY=1;
15385 HAVE_DECL_MEMRCHR=1;
15386 HAVE_RAWMEMCHR=1;
15387 HAVE_STPCPY=1;
15388 HAVE_STPNCPY=1;
15389 HAVE_STRCHRNUL=1;
15390 HAVE_DECL_STRDUP=1;
15391 HAVE_DECL_STRNDUP=1;
15392 HAVE_DECL_STRNLEN=1;
15393 HAVE_STRPBRK=1;
15394 HAVE_STRSEP=1;
15395 HAVE_STRCASESTR=1;
15396 HAVE_DECL_STRTOK_R=1;
15397 HAVE_DECL_STRERROR_R=1;
15398 HAVE_DECL_STRSIGNAL=1;
15399 HAVE_STRVERSCMP=1;
15400 REPLACE_MEMCHR=0;
15401 REPLACE_MEMMEM=0;
15402 REPLACE_STPNCPY=0;
15403 REPLACE_STRCHRNUL=0;
15404 REPLACE_STRDUP=0;
15405 REPLACE_STRNCAT=0;
15406 REPLACE_STRNDUP=0;
15407 REPLACE_STRNLEN=0;
15408 REPLACE_STRSTR=0;
15409 REPLACE_STRCASESTR=0;
15410 REPLACE_STRTOK_R=0;
15411 REPLACE_STRERROR=0;
15412 REPLACE_STRERROR_R=0;
15413 REPLACE_STRSIGNAL=0;
15414 UNDEFINE_STRTOK_R=0;
5abebf3c
CB
15415
15416
15417
15418
6ec2e0f5
SDJ
15419
15420
c0c3707f
CB
15421 # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
15422 # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
15423 # irrelevant for anonymous mappings.
15424 ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
15425if test "x$ac_cv_func_mmap" = xyes; then :
15426 gl_have_mmap=yes
6ec2e0f5 15427else
c0c3707f
CB
15428 gl_have_mmap=no
15429fi
6ec2e0f5
SDJ
15430
15431
c0c3707f
CB
15432 # Try to allow MAP_ANONYMOUS.
15433 gl_have_mmap_anonymous=no
15434 if test $gl_have_mmap = yes; then
15435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
15436$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
15437 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15438/* end confdefs.h. */
6ec2e0f5 15439
c0c3707f
CB
15440#include <sys/mman.h>
15441#ifdef MAP_ANONYMOUS
15442 I cannot identify this map
15443#endif
6ec2e0f5 15444
c0c3707f
CB
15445_ACEOF
15446if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15447 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
15448 gl_have_mmap_anonymous=yes
6ec2e0f5 15449fi
c0c3707f 15450rm -f conftest*
6ec2e0f5 15451
c0c3707f
CB
15452 if test $gl_have_mmap_anonymous != yes; then
15453 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15454/* end confdefs.h. */
6ec2e0f5 15455
c0c3707f
CB
15456#include <sys/mman.h>
15457#ifdef MAP_ANON
15458 I cannot identify this map
15459#endif
6ec2e0f5 15460
c0c3707f
CB
15461_ACEOF
15462if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15463 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
6ec2e0f5 15464
c0c3707f 15465$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
5e8754f9 15466
c0c3707f 15467 gl_have_mmap_anonymous=yes
5e8754f9 15468fi
c0c3707f
CB
15469rm -f conftest*
15470
15471 fi
15472 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
15473$as_echo "$gl_have_mmap_anonymous" >&6; }
15474 if test $gl_have_mmap_anonymous = yes; then
6ec2e0f5 15475
c0c3707f 15476$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
6ec2e0f5 15477
c0c3707f
CB
15478 fi
15479 fi
6ec2e0f5
SDJ
15480
15481
15482
15483
6ec2e0f5 15484
6ec2e0f5 15485
c0c3707f
CB
15486 if test $HAVE_MEMCHR = 1; then
15487 # Detect platform-specific bugs in some versions of glibc:
15488 # memchr should not dereference anything with length 0
15489 # https://bugzilla.redhat.com/show_bug.cgi?id=499689
15490 # memchr should not dereference overestimated length after a match
15491 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
15492 # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
15493 # memchr should cast the second argument to 'unsigned char'.
15494 # This bug exists in Android 4.3.
15495 # Assume that memchr works on platforms that lack mprotect.
15496 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
15497$as_echo_n "checking whether memchr works... " >&6; }
15498if ${gl_cv_func_memchr_works+:} false; then :
15499 $as_echo_n "(cached) " >&6
6ec2e0f5 15500else
c0c3707f
CB
15501 if test "$cross_compiling" = yes; then :
15502 case "$host_os" in
15503 # Guess no on Android.
15504 linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
15505 # Guess yes on native Windows.
15506 mingw*) gl_cv_func_memchr_works="guessing yes" ;;
15507 # If we don't know, obey --enable-cross-guesses.
15508 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
15509 esac
6ec2e0f5
SDJ
15510
15511else
15512 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15513/* end confdefs.h. */
15514
c0c3707f
CB
15515#include <string.h>
15516#if HAVE_SYS_MMAN_H
15517# include <fcntl.h>
15518# include <unistd.h>
15519# include <sys/types.h>
15520# include <sys/mman.h>
15521# ifndef MAP_FILE
15522# define MAP_FILE 0
15523# endif
15524#endif
6ec2e0f5
SDJ
15525
15526int
15527main ()
15528{
c0c3707f
CB
15529
15530 int result = 0;
15531 char *fence = NULL;
15532#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
15533# if HAVE_MAP_ANONYMOUS
15534 const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
15535 const int fd = -1;
15536# else /* !HAVE_MAP_ANONYMOUS */
15537 const int flags = MAP_FILE | MAP_PRIVATE;
15538 int fd = open ("/dev/zero", O_RDONLY, 0666);
15539 if (fd >= 0)
15540# endif
15541 {
15542 int pagesize = getpagesize ();
15543 char *two_pages =
15544 (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
15545 flags, fd, 0);
15546 if (two_pages != (char *)(-1)
15547 && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
15548 fence = two_pages + pagesize;
15549 }
15550#endif
15551 if (fence)
15552 {
15553 if (memchr (fence, 0, 0))
15554 result |= 1;
15555 strcpy (fence - 9, "12345678");
15556 if (memchr (fence - 9, 0, 79) != fence - 1)
15557 result |= 2;
15558 if (memchr (fence - 1, 0, 3) != fence - 1)
15559 result |= 4;
15560 }
15561 /* Test against bug on Android 4.3. */
15562 {
15563 char input[3];
15564 input[0] = 'a';
15565 input[1] = 'b';
15566 input[2] = 'c';
15567 if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
15568 result |= 8;
15569 }
15570 return result;
6ec2e0f5
SDJ
15571
15572 ;
15573 return 0;
15574}
15575_ACEOF
15576if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 15577 gl_cv_func_memchr_works=yes
6ec2e0f5 15578else
c0c3707f 15579 gl_cv_func_memchr_works=no
6ec2e0f5
SDJ
15580fi
15581rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15582 conftest.$ac_objext conftest.beam conftest.$ac_ext
15583fi
15584
15585
15586fi
c0c3707f
CB
15587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
15588$as_echo "$gl_cv_func_memchr_works" >&6; }
15589 case "$gl_cv_func_memchr_works" in
6ec2e0f5 15590 *yes) ;;
c0c3707f 15591 *) REPLACE_MEMCHR=1 ;;
6ec2e0f5
SDJ
15592 esac
15593 fi
15594
c0c3707f
CB
15595ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default"
15596if test "x$ac_cv_have_decl_memmem" = xyes; then :
6ec2e0f5
SDJ
15597 ac_have_decl=1
15598else
15599 ac_have_decl=0
15600fi
15601
15602cat >>confdefs.h <<_ACEOF
c0c3707f 15603#define HAVE_DECL_MEMMEM $ac_have_decl
6ec2e0f5
SDJ
15604_ACEOF
15605
472fa5ee 15606
6ec2e0f5
SDJ
15607
15608
15609
c0c3707f
CB
15610 for ac_func in memmem
15611do :
15612 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
15613if test "x$ac_cv_func_memmem" = xyes; then :
15614 cat >>confdefs.h <<_ACEOF
15615#define HAVE_MEMMEM 1
15616_ACEOF
6ec2e0f5 15617
c0c3707f
CB
15618fi
15619done
6ec2e0f5 15620
c0c3707f
CB
15621 if test $ac_cv_func_memmem = yes; then
15622 HAVE_MEMMEM=1
15623 else
15624 HAVE_MEMMEM=0
15625 fi
6ec2e0f5 15626
c0c3707f
CB
15627 if test $ac_cv_have_decl_memmem = no; then
15628 HAVE_DECL_MEMMEM=0
15629 else
15630 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
15631$as_echo_n "checking whether memmem works... " >&6; }
15632if ${gl_cv_func_memmem_works_always+:} false; then :
6ec2e0f5
SDJ
15633 $as_echo_n "(cached) " >&6
15634else
c0c3707f
CB
15635 if test "$cross_compiling" = yes; then :
15636 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15637/* end confdefs.h. */
472fa5ee 15638
c0c3707f
CB
15639#ifdef __GNU_LIBRARY__
15640 #include <features.h>
15641 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
15642 || __GLIBC_MINOR__ > 12)) \
15643 || (__GLIBC__ > 2)) \
15644 || defined __UCLIBC__
15645 Lucky user
15646 #endif
15647#elif defined __CYGWIN__
15648 #include <cygwin/version.h>
15649 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
15650 Lucky user
15651 #endif
15652#else
15653 Lucky user
15654#endif
472fa5ee 15655
c0c3707f
CB
15656_ACEOF
15657if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15658 $EGREP "Lucky user" >/dev/null 2>&1; then :
15659 gl_cv_func_memmem_works_always="guessing yes"
15660else
15661 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
15662fi
15663rm -f conftest*
472fa5ee
SM
15664
15665
6ec2e0f5
SDJ
15666else
15667 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15668/* end confdefs.h. */
c0c3707f
CB
15669
15670#include <string.h> /* for memmem */
15671#define P "_EF_BF_BD"
15672#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
15673#define NEEDLE P P P P P
6ec2e0f5
SDJ
15674
15675int
15676main ()
15677{
c0c3707f
CB
15678
15679 int result = 0;
15680 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
15681 result |= 1;
15682 /* Check for empty needle behavior. */
15683 {
15684 const char *haystack = "AAA";
15685 if (memmem (haystack, 3, NULL, 0) != haystack)
15686 result |= 2;
15687 }
15688 return result;
15689
6ec2e0f5
SDJ
15690 ;
15691 return 0;
15692}
15693_ACEOF
c0c3707f
CB
15694if ac_fn_c_try_run "$LINENO"; then :
15695 gl_cv_func_memmem_works_always=yes
6ec2e0f5 15696else
c0c3707f 15697 gl_cv_func_memmem_works_always=no
6ec2e0f5 15698fi
c0c3707f
CB
15699rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15700 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 15701fi
6ec2e0f5 15702
c0c3707f
CB
15703
15704fi
15705{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
15706$as_echo "$gl_cv_func_memmem_works_always" >&6; }
15707 case "$gl_cv_func_memmem_works_always" in
15708 *yes) ;;
15709 *)
15710 REPLACE_MEMMEM=1
15711 ;;
15712 esac
15713 fi
15714 :
15715
15716ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
15717if test "x$ac_cv_have_decl_memrchr" = xyes; then :
15718 ac_have_decl=1
15719else
15720 ac_have_decl=0
15721fi
15722
15723cat >>confdefs.h <<_ACEOF
15724#define HAVE_DECL_MEMRCHR $ac_have_decl
15725_ACEOF
15726
15727
15728
15729
15730
15731
15732
15733 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
15734$as_echo_n "checking for O_CLOEXEC... " >&6; }
15735if ${gl_cv_macro_O_CLOEXEC+:} false; then :
6ec2e0f5
SDJ
15736 $as_echo_n "(cached) " >&6
15737else
15738 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15739/* end confdefs.h. */
c0c3707f
CB
15740#include <fcntl.h>
15741 #ifndef O_CLOEXEC
15742 choke me;
15743 #endif
6ec2e0f5
SDJ
15744
15745int
15746main ()
15747{
c0c3707f 15748return O_CLOEXEC;
6ec2e0f5
SDJ
15749 ;
15750 return 0;
15751}
15752_ACEOF
15753if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 15754 gl_cv_macro_O_CLOEXEC=yes
6ec2e0f5 15755else
c0c3707f 15756 gl_cv_macro_O_CLOEXEC=no
6ec2e0f5
SDJ
15757fi
15758rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15759fi
c0c3707f
CB
15760{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
15761$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
15762
15763
15764
15765 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
15766$as_echo_n "checking for promoted mode_t type... " >&6; }
15767if ${gl_cv_promoted_mode_t+:} false; then :
6ec2e0f5
SDJ
15768 $as_echo_n "(cached) " >&6
15769else
6ec2e0f5 15770
c0c3707f
CB
15771 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15772/* end confdefs.h. */
15773#include <sys/types.h>
6ec2e0f5
SDJ
15774int
15775main ()
15776{
c0c3707f 15777typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
6ec2e0f5
SDJ
15778 ;
15779 return 0;
15780}
15781_ACEOF
15782if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 15783 gl_cv_promoted_mode_t='int'
6ec2e0f5 15784else
c0c3707f 15785 gl_cv_promoted_mode_t='mode_t'
6ec2e0f5
SDJ
15786fi
15787rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 15788
6ec2e0f5 15789fi
c0c3707f
CB
15790{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
15791$as_echo "$gl_cv_promoted_mode_t" >&6; }
6ec2e0f5 15792
c0c3707f
CB
15793cat >>confdefs.h <<_ACEOF
15794#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
6ec2e0f5 15795_ACEOF
c0c3707f
CB
15796
15797
15798
15799
15800
15801 GNULIB_DPRINTF=0;
15802 GNULIB_FCLOSE=0;
15803 GNULIB_FDOPEN=0;
15804 GNULIB_FFLUSH=0;
15805 GNULIB_FGETC=0;
15806 GNULIB_FGETS=0;
15807 GNULIB_FOPEN=0;
15808 GNULIB_FPRINTF=0;
15809 GNULIB_FPRINTF_POSIX=0;
15810 GNULIB_FPURGE=0;
15811 GNULIB_FPUTC=0;
15812 GNULIB_FPUTS=0;
15813 GNULIB_FREAD=0;
15814 GNULIB_FREOPEN=0;
15815 GNULIB_FSCANF=0;
15816 GNULIB_FSEEK=0;
15817 GNULIB_FSEEKO=0;
15818 GNULIB_FTELL=0;
15819 GNULIB_FTELLO=0;
15820 GNULIB_FWRITE=0;
15821 GNULIB_GETC=0;
15822 GNULIB_GETCHAR=0;
15823 GNULIB_GETDELIM=0;
15824 GNULIB_GETLINE=0;
15825 GNULIB_OBSTACK_PRINTF=0;
15826 GNULIB_OBSTACK_PRINTF_POSIX=0;
15827 GNULIB_PCLOSE=0;
15828 GNULIB_PERROR=0;
15829 GNULIB_POPEN=0;
15830 GNULIB_PRINTF=0;
15831 GNULIB_PRINTF_POSIX=0;
15832 GNULIB_PUTC=0;
15833 GNULIB_PUTCHAR=0;
15834 GNULIB_PUTS=0;
15835 GNULIB_REMOVE=0;
15836 GNULIB_RENAME=0;
15837 GNULIB_RENAMEAT=0;
15838 GNULIB_SCANF=0;
15839 GNULIB_SNPRINTF=0;
15840 GNULIB_SPRINTF_POSIX=0;
15841 GNULIB_STDIO_H_NONBLOCKING=0;
15842 GNULIB_STDIO_H_SIGPIPE=0;
15843 GNULIB_TMPFILE=0;
15844 GNULIB_VASPRINTF=0;
15845 GNULIB_VFSCANF=0;
15846 GNULIB_VSCANF=0;
15847 GNULIB_VDPRINTF=0;
15848 GNULIB_VFPRINTF=0;
15849 GNULIB_VFPRINTF_POSIX=0;
15850 GNULIB_VPRINTF=0;
15851 GNULIB_VPRINTF_POSIX=0;
15852 GNULIB_VSNPRINTF=0;
15853 GNULIB_VSPRINTF_POSIX=0;
15854 HAVE_DECL_FPURGE=1;
15855 HAVE_DECL_FSEEKO=1;
15856 HAVE_DECL_FTELLO=1;
15857 HAVE_DECL_GETDELIM=1;
15858 HAVE_DECL_GETLINE=1;
15859 HAVE_DECL_OBSTACK_PRINTF=1;
15860 HAVE_DECL_SNPRINTF=1;
15861 HAVE_DECL_VSNPRINTF=1;
15862 HAVE_DPRINTF=1;
15863 HAVE_FSEEKO=1;
15864 HAVE_FTELLO=1;
15865 HAVE_PCLOSE=1;
15866 HAVE_POPEN=1;
15867 HAVE_RENAMEAT=1;
15868 HAVE_VASPRINTF=1;
15869 HAVE_VDPRINTF=1;
15870 REPLACE_DPRINTF=0;
15871 REPLACE_FCLOSE=0;
15872 REPLACE_FDOPEN=0;
15873 REPLACE_FFLUSH=0;
15874 REPLACE_FOPEN=0;
15875 REPLACE_FPRINTF=0;
15876 REPLACE_FPURGE=0;
15877 REPLACE_FREOPEN=0;
15878 REPLACE_FSEEK=0;
15879 REPLACE_FSEEKO=0;
15880 REPLACE_FTELL=0;
15881 REPLACE_FTELLO=0;
15882 REPLACE_GETDELIM=0;
15883 REPLACE_GETLINE=0;
15884 REPLACE_OBSTACK_PRINTF=0;
15885 REPLACE_PERROR=0;
15886 REPLACE_POPEN=0;
15887 REPLACE_PRINTF=0;
15888 REPLACE_REMOVE=0;
15889 REPLACE_RENAME=0;
15890 REPLACE_RENAMEAT=0;
15891 REPLACE_SNPRINTF=0;
15892 REPLACE_SPRINTF=0;
15893 REPLACE_STDIO_READ_FUNCS=0;
15894 REPLACE_STDIO_WRITE_FUNCS=0;
15895 REPLACE_TMPFILE=0;
15896 REPLACE_VASPRINTF=0;
15897 REPLACE_VDPRINTF=0;
15898 REPLACE_VFPRINTF=0;
15899 REPLACE_VPRINTF=0;
15900 REPLACE_VSNPRINTF=0;
15901 REPLACE_VSPRINTF=0;
15902
15903
15904
15905ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
15906if test "x$ac_cv_have_decl_setenv" = xyes; then :
15907 ac_have_decl=1
6ec2e0f5 15908else
c0c3707f 15909 ac_have_decl=0
6ec2e0f5 15910fi
c0c3707f
CB
15911
15912cat >>confdefs.h <<_ACEOF
15913#define HAVE_DECL_SETENV $ac_have_decl
15914_ACEOF
15915
15916
15917
15918
15919
15920
15921 if test $ac_cv_have_decl_setenv = no; then
15922 HAVE_DECL_SETENV=0
6ec2e0f5
SDJ
15923 fi
15924
15925
15926
15927
15928
c0c3707f
CB
15929 for ac_header in search.h
15930do :
15931 ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
15932if test "x$ac_cv_header_search_h" = xyes; then :
15933 cat >>confdefs.h <<_ACEOF
15934#define HAVE_SEARCH_H 1
15935_ACEOF
6ec2e0f5 15936
c0c3707f 15937fi
6ec2e0f5 15938
c0c3707f 15939done
6ec2e0f5 15940
c0c3707f
CB
15941 for ac_func in tsearch
15942do :
15943 ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
15944if test "x$ac_cv_func_tsearch" = xyes; then :
15945 cat >>confdefs.h <<_ACEOF
15946#define HAVE_TSEARCH 1
15947_ACEOF
6ec2e0f5 15948
c0c3707f
CB
15949fi
15950done
6ec2e0f5
SDJ
15951
15952
15953
15954
c0c3707f
CB
15955 GNULIB_PTHREAD_SIGMASK=0;
15956 GNULIB_RAISE=0;
15957 GNULIB_SIGNAL_H_SIGPIPE=0;
15958 GNULIB_SIGPROCMASK=0;
15959 GNULIB_SIGACTION=0;
15960 HAVE_POSIX_SIGNALBLOCKING=1;
15961 HAVE_PTHREAD_SIGMASK=1;
15962 HAVE_RAISE=1;
15963 HAVE_SIGSET_T=1;
15964 HAVE_SIGINFO_T=1;
15965 HAVE_SIGACTION=1;
15966 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
6ec2e0f5 15967
c0c3707f 15968 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
6ec2e0f5 15969
c0c3707f
CB
15970 HAVE_SIGHANDLER_T=1;
15971 REPLACE_PTHREAD_SIGMASK=0;
15972 REPLACE_RAISE=0;
6ec2e0f5 15973
6ec2e0f5 15974
c0c3707f
CB
15975 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
15976 #include <signal.h>
15977 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
15978 #include <sys/types.h>
15979
15980"
15981if test "x$ac_cv_type_sigset_t" = xyes; then :
15982
15983cat >>confdefs.h <<_ACEOF
15984#define HAVE_SIGSET_T 1
15985_ACEOF
15986
15987gl_cv_type_sigset_t=yes
15988else
15989 gl_cv_type_sigset_t=no
15990fi
6ec2e0f5 15991
c0c3707f
CB
15992 if test $gl_cv_type_sigset_t != yes; then
15993 HAVE_SIGSET_T=0
15994 fi
6ec2e0f5 15995
c0c3707f
CB
15996{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
15997$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
15998if ${ac_cv_type_uid_t+:} false; then :
15999 $as_echo_n "(cached) " >&6
16000else
6ec2e0f5
SDJ
16001 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16002/* end confdefs.h. */
c0c3707f
CB
16003#include <sys/types.h>
16004
6ec2e0f5 16005_ACEOF
c0c3707f
CB
16006if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16007 $EGREP "uid_t" >/dev/null 2>&1; then :
16008 ac_cv_type_uid_t=yes
16009else
16010 ac_cv_type_uid_t=no
16011fi
16012rm -f conftest*
6ec2e0f5 16013
c0c3707f
CB
16014fi
16015{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
16016$as_echo "$ac_cv_type_uid_t" >&6; }
16017if test $ac_cv_type_uid_t = no; then
6ec2e0f5 16018
c0c3707f 16019$as_echo "#define uid_t int" >>confdefs.h
6ec2e0f5 16020
6ec2e0f5 16021
c0c3707f 16022$as_echo "#define gid_t int" >>confdefs.h
6ec2e0f5
SDJ
16023
16024fi
6ec2e0f5 16025
c0c3707f
CB
16026{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
16027$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
16028if ${ac_cv_header_stdbool_h+:} false; then :
16029 $as_echo_n "(cached) " >&6
16030else
16031 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16032/* end confdefs.h. */
16033
16034 #include <stdbool.h>
16035
16036 #ifdef __cplusplus
16037 typedef bool Bool;
16038 #else
16039 typedef _Bool Bool;
16040 #ifndef bool
16041 "error: bool is not defined"
16042 #endif
16043 #ifndef false
16044 "error: false is not defined"
16045 #endif
16046 #if false
16047 "error: false is not 0"
16048 #endif
16049 #ifndef true
16050 "error: true is not defined"
16051 #endif
16052 #if true != 1
16053 "error: true is not 1"
16054 #endif
16055 #endif
16056
16057 #ifndef __bool_true_false_are_defined
16058 "error: __bool_true_false_are_defined is not defined"
16059 #endif
16060
16061 struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
16062
16063 char a[true == 1 ? 1 : -1];
16064 char b[false == 0 ? 1 : -1];
16065 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
16066 char d[(bool) 0.5 == true ? 1 : -1];
16067 /* See body of main program for 'e'. */
16068 char f[(Bool) 0.0 == false ? 1 : -1];
16069 char g[true];
16070 char h[sizeof (Bool)];
16071 char i[sizeof s.t];
16072 enum { j = false, k = true, l = false * true, m = true * 256 };
16073 /* The following fails for
16074 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
16075 Bool n[m];
16076 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
16077 char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
16078 /* Catch a bug in an HP-UX C compiler. See
16079 https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
16080 https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
16081 */
16082 Bool q = true;
16083 Bool *pq = &q;
16084 bool *qq = &q;
6ec2e0f5 16085
c0c3707f
CB
16086int
16087main ()
16088{
6ec2e0f5 16089
c0c3707f
CB
16090 bool e = &s;
16091 *pq |= q; *pq |= ! q;
16092 *qq |= q; *qq |= ! q;
16093 /* Refer to every declared value, to avoid compiler optimizations. */
16094 return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
16095 + !m + !n + !o + !p + !q + !pq + !qq);
6ec2e0f5 16096
c0c3707f
CB
16097 ;
16098 return 0;
16099}
16100_ACEOF
16101if ac_fn_c_try_compile "$LINENO"; then :
16102 ac_cv_header_stdbool_h=yes
16103else
16104 ac_cv_header_stdbool_h=no
16105fi
16106rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16107fi
16108{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
16109$as_echo "$ac_cv_header_stdbool_h" >&6; }
16110 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
16111if test "x$ac_cv_type__Bool" = xyes; then :
6ec2e0f5 16112
c0c3707f
CB
16113cat >>confdefs.h <<_ACEOF
16114#define HAVE__BOOL 1
16115_ACEOF
6ec2e0f5
SDJ
16116
16117
c0c3707f 16118fi
6ec2e0f5
SDJ
16119
16120
472fa5ee 16121
f8e27d88 16122
c0c3707f
CB
16123ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
16124if test "x$ac_cv_have_decl_strdup" = xyes; then :
6ec2e0f5
SDJ
16125 ac_have_decl=1
16126else
16127 ac_have_decl=0
16128fi
16129
16130cat >>confdefs.h <<_ACEOF
c0c3707f 16131#define HAVE_DECL_STRDUP $ac_have_decl
6ec2e0f5
SDJ
16132_ACEOF
16133
16134
c0c3707f
CB
16135 REPLACE_STRERROR_0=0
16136 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
16137$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
16138if ${gl_cv_func_strerror_0_works+:} false; then :
6ec2e0f5
SDJ
16139 $as_echo_n "(cached) " >&6
16140else
c0c3707f
CB
16141 if test "$cross_compiling" = yes; then :
16142 case "$host_os" in
16143 # Guess yes on glibc systems.
16144 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
16145 # Guess yes on musl systems.
16146 *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
16147 # Guess yes on native Windows.
16148 mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
16149 # If we don't know, obey --enable-cross-guesses.
16150 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
16151 esac
6ec2e0f5 16152
5e8754f9
SDJ
16153else
16154 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16155/* end confdefs.h. */
c0c3707f
CB
16156#include <string.h>
16157 #include <errno.h>
6ec2e0f5 16158
5e8754f9
SDJ
16159int
16160main ()
16161{
c0c3707f
CB
16162int result = 0;
16163 char *str;
16164 errno = 0;
16165 str = strerror (0);
16166 if (!*str) result |= 1;
16167 if (errno) result |= 2;
16168 if (strstr (str, "nknown") || strstr (str, "ndefined"))
16169 result |= 4;
16170 return result;
5e8754f9
SDJ
16171 ;
16172 return 0;
16173}
16174_ACEOF
c0c3707f
CB
16175if ac_fn_c_try_run "$LINENO"; then :
16176 gl_cv_func_strerror_0_works=yes
5e8754f9 16177else
c0c3707f 16178 gl_cv_func_strerror_0_works=no
5e8754f9 16179fi
c0c3707f
CB
16180rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16181 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 16182fi
6ec2e0f5 16183
6ec2e0f5 16184
c0c3707f
CB
16185fi
16186{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
16187$as_echo "$gl_cv_func_strerror_0_works" >&6; }
16188 case "$gl_cv_func_strerror_0_works" in
16189 *yes) ;;
16190 *)
16191 REPLACE_STRERROR_0=1
6ec2e0f5 16192
c0c3707f 16193$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
6ec2e0f5 16194
c0c3707f
CB
16195 ;;
16196 esac
6ec2e0f5
SDJ
16197
16198
16199
16200
472fa5ee
SM
16201
16202
16203
725e2999 16204
725e2999
JB
16205
16206
c0c3707f
CB
16207 if test $ac_cv_func_strerror_r = yes; then
16208 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
16209 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
16210$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
16211if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
16212 $as_echo_n "(cached) " >&6
16213else
16214 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16215/* end confdefs.h. */
16216#include <string.h>
16217 int strerror_r (int, char *, size_t);
725e2999 16218
c0c3707f
CB
16219int
16220main ()
16221{
725e2999 16222
c0c3707f
CB
16223 ;
16224 return 0;
16225}
16226_ACEOF
16227if ac_fn_c_try_compile "$LINENO"; then :
16228 gl_cv_func_strerror_r_posix_signature=yes
16229else
16230 gl_cv_func_strerror_r_posix_signature=no
16231fi
16232rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
725e2999 16233
c0c3707f
CB
16234fi
16235{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
16236$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
16237 if test $gl_cv_func_strerror_r_posix_signature = yes; then
16238 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
16239$as_echo_n "checking whether strerror_r works... " >&6; }
16240if ${gl_cv_func_strerror_r_works+:} false; then :
16241 $as_echo_n "(cached) " >&6
16242else
16243 if test "$cross_compiling" = yes; then :
725e2999 16244
c0c3707f
CB
16245 case "$host_os" in
16246 # Guess no on AIX.
16247 aix*) gl_cv_func_strerror_r_works="guessing no";;
16248 # Guess no on HP-UX.
16249 hpux*) gl_cv_func_strerror_r_works="guessing no";;
16250 # Guess no on BSD variants.
16251 *bsd*) gl_cv_func_strerror_r_works="guessing no";;
16252 # Guess yes otherwise.
16253 *) gl_cv_func_strerror_r_works="guessing yes";;
16254 esac
725e2999 16255
c0c3707f
CB
16256else
16257 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16258/* end confdefs.h. */
16259#include <errno.h>
16260 #include <string.h>
725e2999 16261
c0c3707f
CB
16262int
16263main ()
16264{
16265int result = 0;
16266 char buf[79];
16267 if (strerror_r (EACCES, buf, 0) < 0)
16268 result |= 1;
16269 errno = 0;
16270 if (strerror_r (EACCES, buf, sizeof buf) != 0)
16271 result |= 2;
16272 strcpy (buf, "Unknown");
16273 if (strerror_r (0, buf, sizeof buf) != 0)
16274 result |= 4;
16275 if (errno)
16276 result |= 8;
16277 if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
16278 result |= 0x10;
16279 errno = 0;
16280 *buf = 0;
16281 if (strerror_r (-3, buf, sizeof buf) < 0)
16282 result |= 0x20;
16283 if (errno)
16284 result |= 0x40;
16285 if (!*buf)
16286 result |= 0x80;
16287 return result;
725e2999 16288
c0c3707f
CB
16289 ;
16290 return 0;
16291}
16292_ACEOF
16293if ac_fn_c_try_run "$LINENO"; then :
16294 gl_cv_func_strerror_r_works=yes
16295else
16296 gl_cv_func_strerror_r_works=no
16297fi
16298rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16299 conftest.$ac_objext conftest.beam conftest.$ac_ext
16300fi
725e2999
JB
16301
16302
c0c3707f
CB
16303fi
16304{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16305$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16306 else
725e2999 16307
c0c3707f
CB
16308 if test $ac_cv_func___xpg_strerror_r = yes; then
16309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
16310$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
16311if ${gl_cv_func_strerror_r_works+:} false; then :
725e2999
JB
16312 $as_echo_n "(cached) " >&6
16313else
c0c3707f
CB
16314 if test "$cross_compiling" = yes; then :
16315 gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
725e2999 16316
c0c3707f
CB
16317else
16318 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
725e2999 16319/* end confdefs.h. */
c0c3707f
CB
16320#include <errno.h>
16321 #include <string.h>
16322 extern
16323 #ifdef __cplusplus
16324 "C"
16325 #endif
16326 int __xpg_strerror_r(int, char *, size_t);
725e2999 16327
c0c3707f
CB
16328int
16329main ()
16330{
16331int result = 0;
16332 char buf[256] = "^";
16333 char copy[256];
16334 char *str = strerror (-1);
16335 strcpy (copy, str);
16336 if (__xpg_strerror_r (-2, buf, 1) == 0)
16337 result |= 1;
16338 if (*buf)
16339 result |= 2;
16340 __xpg_strerror_r (-2, buf, 256);
16341 if (strcmp (str, copy))
16342 result |= 4;
16343 return result;
725e2999 16344
c0c3707f
CB
16345 ;
16346 return 0;
16347}
725e2999 16348_ACEOF
c0c3707f
CB
16349if ac_fn_c_try_run "$LINENO"; then :
16350 gl_cv_func_strerror_r_works=yes
725e2999 16351else
c0c3707f 16352 gl_cv_func_strerror_r_works=no
725e2999 16353fi
c0c3707f
CB
16354rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16355 conftest.$ac_objext conftest.beam conftest.$ac_ext
725e2999 16356fi
725e2999 16357
725e2999 16358
c0c3707f
CB
16359fi
16360{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16361$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16362 fi
16363 fi
725e2999 16364 fi
725e2999
JB
16365 fi
16366
c0c3707f
CB
16367ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
16368if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
16369 ac_have_decl=1
725e2999 16370else
c0c3707f 16371 ac_have_decl=0
725e2999
JB
16372fi
16373
c0c3707f
CB
16374cat >>confdefs.h <<_ACEOF
16375#define HAVE_DECL_STRERROR_R $ac_have_decl
16376_ACEOF
725e2999
JB
16377
16378
16379
16380
16381
725e2999
JB
16382
16383
16384
725e2999
JB
16385
16386
16387
16388
16389
16390
16391
16392
16393 if test $gl_cv_have_include_next = yes; then
c0c3707f 16394 gl_cv_next_string_h='<'string.h'>'
725e2999 16395 else
c0c3707f
CB
16396 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
16397$as_echo_n "checking absolute name of <string.h>... " >&6; }
16398if ${gl_cv_next_string_h+:} false; then :
725e2999
JB
16399 $as_echo_n "(cached) " >&6
16400else
16401
725e2999
JB
16402
16403
16404 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16405/* end confdefs.h. */
c0c3707f 16406#include <string.h>
725e2999
JB
16407_ACEOF
16408 case "$host_os" in
16409 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16410 *) gl_absname_cpp="$ac_cpp" ;;
16411 esac
16412
16413 case "$host_os" in
16414 mingw*)
16415 gl_dirsep_regex='[/\\]'
16416 ;;
16417 *)
16418 gl_dirsep_regex='\/'
16419 ;;
16420 esac
16421 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 16422 gl_header_literal_regex=`echo 'string.h' \
725e2999
JB
16423 | sed -e "$gl_make_literal_regex_sed"`
16424 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16425 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16426 s|^/[^/]|//&|
16427 p
16428 q
16429 }'
6ec2e0f5 16430
c0c3707f 16431 gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
725e2999 16432 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16433
c0c3707f
CB
16434 gl_header=$gl_cv_absolute_string_h
16435 gl_cv_next_string_h='"'$gl_header'"'
6ec2e0f5
SDJ
16436
16437
725e2999 16438fi
c0c3707f
CB
16439{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
16440$as_echo "$gl_cv_next_string_h" >&6; }
725e2999 16441 fi
c0c3707f 16442 NEXT_STRING_H=$gl_cv_next_string_h
6ec2e0f5 16443
725e2999
JB
16444 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16445 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 16446 gl_next_as_first_directive='<'string.h'>'
725e2999
JB
16447 else
16448 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 16449 gl_next_as_first_directive=$gl_cv_next_string_h
725e2999 16450 fi
c0c3707f
CB
16451 NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
16452
16453
16454
6ec2e0f5
SDJ
16455
16456
16457
16458
16459
6ec2e0f5
SDJ
16460
16461
6ec2e0f5 16462
c0c3707f
CB
16463
16464 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
16465 REPLACE_STRSTR=1
16466 else
16467 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
16468$as_echo_n "checking whether strstr works... " >&6; }
16469if ${gl_cv_func_strstr_works_always+:} false; then :
6ec2e0f5
SDJ
16470 $as_echo_n "(cached) " >&6
16471else
c0c3707f
CB
16472 if test "$cross_compiling" = yes; then :
16473 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
16474/* end confdefs.h. */
16475
c0c3707f
CB
16476#ifdef __GNU_LIBRARY__
16477 #include <features.h>
16478 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
16479 || defined __UCLIBC__
16480 Lucky user
16481 #endif
16482#elif defined __CYGWIN__
16483 #include <cygwin/version.h>
16484 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
16485 Lucky user
16486 #endif
16487#else
16488 Lucky user
6ec2e0f5 16489#endif
c0c3707f
CB
16490
16491_ACEOF
16492if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16493 $EGREP "Lucky user" >/dev/null 2>&1; then :
16494 gl_cv_func_strstr_works_always="guessing yes"
16495else
16496 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
16497fi
16498rm -f conftest*
16499
16500
16501else
16502 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16503/* end confdefs.h. */
16504
16505#include <string.h> /* for strstr */
16506#ifdef __GNU_LIBRARY__
16507 #include <features.h>
16508 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
16509 Unlucky user
16510 #endif
725e2999 16511#endif
c0c3707f
CB
16512#define P "_EF_BF_BD"
16513#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
16514#define NEEDLE P P P P P
6ec2e0f5 16515
725e2999
JB
16516int
16517main ()
16518{
c0c3707f
CB
16519return !!strstr (HAYSTACK, NEEDLE);
16520
725e2999
JB
16521 ;
16522 return 0;
16523}
6ec2e0f5 16524_ACEOF
c0c3707f
CB
16525if ac_fn_c_try_run "$LINENO"; then :
16526 gl_cv_func_strstr_works_always=yes
6ec2e0f5 16527else
c0c3707f 16528 gl_cv_func_strstr_works_always=no
6ec2e0f5 16529fi
c0c3707f
CB
16530rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16531 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 16532fi
6ec2e0f5
SDJ
16533
16534
c0c3707f
CB
16535fi
16536{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
16537$as_echo "$gl_cv_func_strstr_works_always" >&6; }
16538 case "$gl_cv_func_strstr_works_always" in
16539 *yes) ;;
16540 *)
16541 REPLACE_STRSTR=1
16542 ;;
16543 esac
16544 fi
6ec2e0f5 16545
c0c3707f
CB
16546ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default"
16547if test "x$ac_cv_have_decl_strtok_r" = xyes; then :
16548 ac_have_decl=1
16549else
16550 ac_have_decl=0
16551fi
6ec2e0f5 16552
c0c3707f
CB
16553cat >>confdefs.h <<_ACEOF
16554#define HAVE_DECL_STRTOK_R $ac_have_decl
16555_ACEOF
6ec2e0f5
SDJ
16556
16557
16558
16559
6ec2e0f5
SDJ
16560
16561
16562
16563
16564
16565
16566
c0c3707f 16567$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
6ec2e0f5 16568
6ec2e0f5
SDJ
16569
16570
16571
16572
16573
6ec2e0f5
SDJ
16574
16575
16576
16577
16578
c0c3707f
CB
16579 if test $gl_cv_have_include_next = yes; then
16580 gl_cv_next_sys_types_h='<'sys/types.h'>'
16581 else
16582 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
16583$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
16584if ${gl_cv_next_sys_types_h+:} false; then :
6ec2e0f5
SDJ
16585 $as_echo_n "(cached) " >&6
16586else
6ec2e0f5 16587
6ec2e0f5 16588
c0c3707f
CB
16589
16590 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16591/* end confdefs.h. */
16592#include <sys/types.h>
6ec2e0f5 16593_ACEOF
c0c3707f
CB
16594 case "$host_os" in
16595 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16596 *) gl_absname_cpp="$ac_cpp" ;;
16597 esac
6ec2e0f5 16598
c0c3707f
CB
16599 case "$host_os" in
16600 mingw*)
16601 gl_dirsep_regex='[/\\]'
16602 ;;
16603 *)
16604 gl_dirsep_regex='\/'
16605 ;;
16606 esac
16607 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16608 gl_header_literal_regex=`echo 'sys/types.h' \
16609 | sed -e "$gl_make_literal_regex_sed"`
16610 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16611 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16612 s|^/[^/]|//&|
16613 p
16614 q
16615 }'
6ec2e0f5 16616
c0c3707f
CB
16617 gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16618 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16619
c0c3707f
CB
16620 gl_header=$gl_cv_absolute_sys_types_h
16621 gl_cv_next_sys_types_h='"'$gl_header'"'
6ec2e0f5
SDJ
16622
16623
c0c3707f
CB
16624fi
16625{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
16626$as_echo "$gl_cv_next_sys_types_h" >&6; }
16627 fi
16628 NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
6ec2e0f5 16629
c0c3707f
CB
16630 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16631 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16632 gl_next_as_first_directive='<'sys/types.h'>'
16633 else
16634 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16635 gl_next_as_first_directive=$gl_cv_next_sys_types_h
16636 fi
16637 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
16638
16639
16640
16641
6ec2e0f5 16642
6ec2e0f5
SDJ
16643
16644
6ec2e0f5
SDJ
16645
16646
16647
16648
16649
c0c3707f 16650 WINDOWS_STAT_INODES=0
6ec2e0f5
SDJ
16651
16652
16653
16654
16655
472fa5ee
SM
16656
16657
16658
16659
c0c3707f
CB
16660 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
16661$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
16662if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
16663 $as_echo_n "(cached) " >&6
16664else
16665 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16666/* end confdefs.h. */
16667#include <time.h>
472fa5ee 16668
c0c3707f
CB
16669int
16670main ()
16671{
16672static struct timespec x; x.tv_sec = x.tv_nsec;
16673 ;
16674 return 0;
16675}
6ec2e0f5 16676_ACEOF
c0c3707f
CB
16677if ac_fn_c_try_compile "$LINENO"; then :
16678 gl_cv_sys_struct_timespec_in_time_h=yes
16679else
16680 gl_cv_sys_struct_timespec_in_time_h=no
6ec2e0f5 16681fi
c0c3707f
CB
16682rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16683fi
16684{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
16685$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
6ec2e0f5 16686
c0c3707f
CB
16687 TIME_H_DEFINES_STRUCT_TIMESPEC=0
16688 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
16689 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
16690 UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
16691 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
16692 TIME_H_DEFINES_STRUCT_TIMESPEC=1
6ec2e0f5 16693 else
c0c3707f
CB
16694 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
16695$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
16696if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
16697 $as_echo_n "(cached) " >&6
16698else
16699 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16700/* end confdefs.h. */
16701#include <sys/time.h>
472fa5ee 16702
c0c3707f
CB
16703int
16704main ()
16705{
16706static struct timespec x; x.tv_sec = x.tv_nsec;
16707 ;
16708 return 0;
16709}
16710_ACEOF
16711if ac_fn_c_try_compile "$LINENO"; then :
16712 gl_cv_sys_struct_timespec_in_sys_time_h=yes
16713else
16714 gl_cv_sys_struct_timespec_in_sys_time_h=no
16715fi
16716rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16717fi
16718{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
16719$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
16720 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
16721 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
16722 else
16723 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
16724$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
16725if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
16726 $as_echo_n "(cached) " >&6
16727else
16728 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16729/* end confdefs.h. */
16730#include <pthread.h>
472fa5ee 16731
c0c3707f
CB
16732int
16733main ()
16734{
16735static struct timespec x; x.tv_sec = x.tv_nsec;
16736 ;
16737 return 0;
16738}
16739_ACEOF
16740if ac_fn_c_try_compile "$LINENO"; then :
16741 gl_cv_sys_struct_timespec_in_pthread_h=yes
16742else
16743 gl_cv_sys_struct_timespec_in_pthread_h=no
16744fi
16745rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16746fi
16747{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
16748$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
16749 if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
16750 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
16751 else
16752 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
16753$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
16754if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
16755 $as_echo_n "(cached) " >&6
16756else
16757 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16758/* end confdefs.h. */
16759#include <unistd.h>
6ec2e0f5 16760
c0c3707f
CB
16761int
16762main ()
16763{
16764static struct timespec x; x.tv_sec = x.tv_nsec;
16765 ;
16766 return 0;
16767}
16768_ACEOF
16769if ac_fn_c_try_compile "$LINENO"; then :
16770 gl_cv_sys_struct_timespec_in_unistd_h=yes
16771else
16772 gl_cv_sys_struct_timespec_in_unistd_h=no
16773fi
16774rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16775fi
16776{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
16777$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
16778 if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
16779 UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
16780 fi
6ec2e0f5
SDJ
16781 fi
16782 fi
c0c3707f 16783 fi
6ec2e0f5
SDJ
16784
16785
16786
16787
16788
16789
6ec2e0f5 16790
6ec2e0f5
SDJ
16791
16792
16793
16794
16795
6ec2e0f5
SDJ
16796
16797
16798
16799
c0c3707f
CB
16800 if test $gl_cv_have_include_next = yes; then
16801 gl_cv_next_time_h='<'time.h'>'
16802 else
16803 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
16804$as_echo_n "checking absolute name of <time.h>... " >&6; }
16805if ${gl_cv_next_time_h+:} false; then :
16806 $as_echo_n "(cached) " >&6
16807else
6ec2e0f5 16808
6ec2e0f5
SDJ
16809
16810
c0c3707f
CB
16811 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16812/* end confdefs.h. */
16813#include <time.h>
16814_ACEOF
16815 case "$host_os" in
16816 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16817 *) gl_absname_cpp="$ac_cpp" ;;
16818 esac
6ec2e0f5 16819
c0c3707f
CB
16820 case "$host_os" in
16821 mingw*)
16822 gl_dirsep_regex='[/\\]'
16823 ;;
16824 *)
16825 gl_dirsep_regex='\/'
16826 ;;
16827 esac
16828 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16829 gl_header_literal_regex=`echo 'time.h' \
16830 | sed -e "$gl_make_literal_regex_sed"`
16831 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16832 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16833 s|^/[^/]|//&|
16834 p
16835 q
16836 }'
6ec2e0f5 16837
c0c3707f
CB
16838 gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16839 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16840
c0c3707f
CB
16841 gl_header=$gl_cv_absolute_time_h
16842 gl_cv_next_time_h='"'$gl_header'"'
6ec2e0f5 16843
6ec2e0f5
SDJ
16844
16845fi
c0c3707f
CB
16846{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
16847$as_echo "$gl_cv_next_time_h" >&6; }
16848 fi
16849 NEXT_TIME_H=$gl_cv_next_time_h
6ec2e0f5 16850
c0c3707f
CB
16851 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16852 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16853 gl_next_as_first_directive='<'time.h'>'
16854 else
16855 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16856 gl_next_as_first_directive=$gl_cv_next_time_h
16857 fi
16858 NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
6ec2e0f5 16859
472fa5ee
SM
16860
16861
16862
16863
16864
6ec2e0f5 16865
6ec2e0f5 16866
6ec2e0f5 16867
6ec2e0f5 16868
c0c3707f
CB
16869ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
16870if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
16871 ac_have_decl=1
16872else
16873 ac_have_decl=0
16874fi
6ec2e0f5 16875
c0c3707f
CB
16876cat >>confdefs.h <<_ACEOF
16877#define HAVE_DECL_UNSETENV $ac_have_decl
16878_ACEOF
6ec2e0f5
SDJ
16879
16880
c0c3707f
CB
16881 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
16882$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
16883if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
16884 $as_echo_n "(cached) " >&6
16885else
16886 gl_cv_header_wchar_h_correct_inline=yes
16887 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16888/* end confdefs.h. */
6ec2e0f5 16889
c0c3707f
CB
16890 #define wcstod renamed_wcstod
16891/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
16892 <wchar.h>.
16893 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
16894 included before <wchar.h>. */
16895#include <stddef.h>
16896#include <stdio.h>
16897#include <time.h>
16898#include <wchar.h>
16899extern int zero (void);
16900int main () { return zero(); }
6ec2e0f5 16901
c0c3707f
CB
16902_ACEOF
16903 save_ac_compile="$ac_compile"
16904 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
16905 if echo '#include "conftest.c"' >conftest1.c &&
16906 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
16907 (eval $ac_compile) 2>&5
16908 ac_status=$?
16909 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
16910 test $ac_status = 0; }; then
16911 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16912/* end confdefs.h. */
6ec2e0f5 16913
c0c3707f
CB
16914 #define wcstod renamed_wcstod
16915/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
16916 <wchar.h>.
16917 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
16918 included before <wchar.h>. */
16919#include <stddef.h>
16920#include <stdio.h>
16921#include <time.h>
16922#include <wchar.h>
16923int zero (void) { return 0; }
6ec2e0f5 16924
c0c3707f
CB
16925_ACEOF
16926 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
16927 if echo '#include "conftest.c"' >conftest2.c &&
16928 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
16929 (eval $ac_compile) 2>&5
16930 ac_status=$?
16931 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
16932 test $ac_status = 0; }; then
16933 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
16934 :
16935 else
16936 gl_cv_header_wchar_h_correct_inline=no
16937 fi
16938 fi
16939 fi
16940 ac_compile="$save_ac_compile"
16941 rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
6ec2e0f5 16942
c0c3707f
CB
16943fi
16944{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
16945$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
16946 if test $gl_cv_header_wchar_h_correct_inline = no; then
16947 as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
16948This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
16949C99 mode. You have four options:
16950 - Add the flag -fgnu89-inline to CC and reconfigure, or
16951 - Fix your include files, using parts of
16952 <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
16953 - Use a gcc version older than 4.3, or
16954 - Don't use the flags -std=c99 or -std=gnu99.
16955Configuration aborted." "$LINENO" 5
6ec2e0f5
SDJ
16956 fi
16957
16958
16959
16960
16961
c0c3707f
CB
16962 if test $ac_cv_header_crtdefs_h = yes; then
16963 HAVE_CRTDEFS_H=1
16964 else
16965 HAVE_CRTDEFS_H=0
5e8754f9 16966 fi
5e8754f9 16967
5e8754f9 16968
5e8754f9 16969
c0c3707f 16970 GNULIB_ISWBLANK=0;
5df4cba6
SM
16971 GNULIB_ISWDIGIT=0;
16972 GNULIB_ISWXDIGIT=0;
c0c3707f
CB
16973 GNULIB_WCTYPE=0;
16974 GNULIB_ISWCTYPE=0;
16975 GNULIB_WCTRANS=0;
16976 GNULIB_TOWCTRANS=0;
16977 HAVE_ISWBLANK=1;
16978 HAVE_WCTYPE_T=1;
16979 HAVE_WCTRANS_T=1;
16980 REPLACE_ISWBLANK=0;
5df4cba6
SM
16981 REPLACE_ISWDIGIT=0;
16982 REPLACE_ISWXDIGIT=0;
5e8754f9 16983
5e8754f9 16984
5e8754f9 16985
5e8754f9 16986
c0c3707f
CB
16987 if false; then
16988 GL_COND_LIBTOOL_TRUE=
16989 GL_COND_LIBTOOL_FALSE='#'
16990else
16991 GL_COND_LIBTOOL_TRUE='#'
16992 GL_COND_LIBTOOL_FALSE=
16993fi
5e8754f9 16994
c0c3707f
CB
16995 gl_cond_libtool=false
16996 gl_libdeps=
16997 gl_ltlibdeps=
16998 gl_m4_base='import/m4'
5e8754f9 16999
5e8754f9
SDJ
17000
17001
6ec2e0f5 17002
6ec2e0f5 17003
6ec2e0f5 17004
6ec2e0f5 17005
6ec2e0f5 17006
6ec2e0f5 17007
5df4cba6 17008
c0c3707f
CB
17009 gl_source_base='import'
17010
6ec2e0f5 17011
c0c3707f
CB
17012 if test $ac_cv_func_alloca_works = no; then
17013 :
17014 fi
6ec2e0f5 17015
c0c3707f
CB
17016 # Define an additional variable used in the Makefile substitution.
17017 if test $ac_cv_working_alloca_h = yes; then
17018 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
17019$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
17020if ${gl_cv_rpl_alloca+:} false; then :
6ec2e0f5
SDJ
17021 $as_echo_n "(cached) " >&6
17022else
c0c3707f
CB
17023
17024 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
17025/* end confdefs.h. */
17026
c0c3707f
CB
17027#if defined __GNUC__ || defined _AIX || defined _MSC_VER
17028 Need own alloca
17029#endif
6ec2e0f5 17030
6ec2e0f5 17031_ACEOF
c0c3707f
CB
17032if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17033 $EGREP "Need own alloca" >/dev/null 2>&1; then :
17034 gl_cv_rpl_alloca=yes
6ec2e0f5 17035else
c0c3707f 17036 gl_cv_rpl_alloca=no
6ec2e0f5 17037fi
c0c3707f 17038rm -f conftest*
6ec2e0f5
SDJ
17039
17040
17041fi
c0c3707f
CB
17042{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
17043$as_echo "$gl_cv_rpl_alloca" >&6; }
17044 if test $gl_cv_rpl_alloca = yes; then
6ec2e0f5 17045
c0c3707f 17046$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
6ec2e0f5 17047
c0c3707f
CB
17048 ALLOCA_H=alloca.h
17049 else
17050 ALLOCA_H=
17051 fi
17052 else
17053 ALLOCA_H=alloca.h
17054 fi
6ec2e0f5 17055
c0c3707f
CB
17056 if test -n "$ALLOCA_H"; then
17057 GL_GENERATE_ALLOCA_H_TRUE=
17058 GL_GENERATE_ALLOCA_H_FALSE='#'
17059else
17060 GL_GENERATE_ALLOCA_H_TRUE='#'
17061 GL_GENERATE_ALLOCA_H_FALSE=
17062fi
6ec2e0f5
SDJ
17063
17064
c0c3707f
CB
17065 if test $ac_cv_working_alloca_h = yes; then
17066 HAVE_ALLOCA_H=1
17067 else
17068 HAVE_ALLOCA_H=0
17069 fi
6ec2e0f5
SDJ
17070
17071
17072
17073
17074
17075
c0c3707f
CB
17076 if test $ac_cv_header_arpa_inet_h = yes; then
17077 HAVE_ARPA_INET_H=1
17078 else
17079 HAVE_ARPA_INET_H=0
17080 fi
6ec2e0f5
SDJ
17081
17082
472fa5ee
SM
17083
17084
17085
17086
17087
6ec2e0f5
SDJ
17088
17089
17090
17091 if test $gl_cv_have_include_next = yes; then
c0c3707f 17092 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5 17093 else
c0c3707f
CB
17094 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
17095$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
17096if ${gl_cv_next_arpa_inet_h+:} false; then :
6ec2e0f5
SDJ
17097 $as_echo_n "(cached) " >&6
17098else
17099
c0c3707f 17100 if test $ac_cv_header_arpa_inet_h = yes; then
6ec2e0f5
SDJ
17101
17102
17103
17104
17105 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17106/* end confdefs.h. */
c0c3707f 17107#include <arpa/inet.h>
6ec2e0f5
SDJ
17108_ACEOF
17109 case "$host_os" in
17110 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17111 *) gl_absname_cpp="$ac_cpp" ;;
17112 esac
17113
17114 case "$host_os" in
17115 mingw*)
17116 gl_dirsep_regex='[/\\]'
17117 ;;
17118 *)
17119 gl_dirsep_regex='\/'
17120 ;;
17121 esac
17122 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 17123 gl_header_literal_regex=`echo 'arpa/inet.h' \
6ec2e0f5
SDJ
17124 | sed -e "$gl_make_literal_regex_sed"`
17125 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17126 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17127 s|^/[^/]|//&|
17128 p
17129 q
17130 }'
17131
c0c3707f 17132 gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5
SDJ
17133 sed -n "$gl_absolute_header_sed"`
17134
c0c3707f
CB
17135 gl_header=$gl_cv_absolute_arpa_inet_h
17136 gl_cv_next_arpa_inet_h='"'$gl_header'"'
6ec2e0f5 17137 else
c0c3707f 17138 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5
SDJ
17139 fi
17140
c0c3707f 17141
6ec2e0f5 17142fi
c0c3707f
CB
17143{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
17144$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
17145 fi
17146 NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
6ec2e0f5 17147
c0c3707f
CB
17148 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17149 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17150 gl_next_as_first_directive='<'arpa/inet.h'>'
17151 else
17152 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17153 gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
17154 fi
17155 NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
17156
17157
6ec2e0f5 17158
6ec2e0f5 17159
6ec2e0f5
SDJ
17160
17161
6ec2e0f5
SDJ
17162
17163
17164
c0c3707f
CB
17165 if test $ac_cv_header_sys_socket_h = yes; then
17166 HAVE_WS2TCPIP_H=0
17167 else
17168 if test $ac_cv_header_ws2tcpip_h = yes; then
17169 HAVE_WS2TCPIP_H=1
17170 else
17171 HAVE_WS2TCPIP_H=0
17172 fi
17173 fi
17174
17175
6ec2e0f5
SDJ
17176
17177
6ec2e0f5
SDJ
17178
17179
17180
17181
17182
c0c3707f
CB
17183 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
17184$as_echo_n "checking for __builtin_expect... " >&6; }
17185if ${gl_cv___builtin_expect+:} false; then :
6ec2e0f5
SDJ
17186 $as_echo_n "(cached) " >&6
17187else
c0c3707f
CB
17188 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17189/* end confdefs.h. */
17190
17191 int
17192 main (int argc, char **argv)
17193 {
17194 argc = __builtin_expect (argc, 100);
17195 return argv[argc != 100][0];
17196 }
17197_ACEOF
17198if ac_fn_c_try_link "$LINENO"; then :
17199 gl_cv___builtin_expect=yes
17200else
17201 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17202/* end confdefs.h. */
17203
17204 #include <builtins.h>
17205 int
17206 main (int argc, char **argv)
17207 {
17208 argc = __builtin_expect (argc, 100);
17209 return argv[argc != 100][0];
17210 }
17211_ACEOF
17212if ac_fn_c_try_link "$LINENO"; then :
17213 gl_cv___builtin_expect="in <builtins.h>"
17214else
17215 gl_cv___builtin_expect=no
6ec2e0f5 17216fi
c0c3707f
CB
17217rm -f core conftest.err conftest.$ac_objext \
17218 conftest$ac_exeext conftest.$ac_ext
17219fi
17220rm -f core conftest.err conftest.$ac_objext \
17221 conftest$ac_exeext conftest.$ac_ext
17222fi
17223{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
17224$as_echo "$gl_cv___builtin_expect" >&6; }
17225 if test "$gl_cv___builtin_expect" = yes; then
17226 $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
8690e634 17227
c0c3707f
CB
17228 elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
17229 $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
8690e634 17230
6ec2e0f5 17231 fi
8690e634
JK
17232
17233
17234
17235
c0c3707f
CB
17236
17237 if test $ac_cv_func_canonicalize_file_name = no; then
17238 HAVE_CANONICALIZE_FILE_NAME=0
17239 if test $ac_cv_func_realpath = no; then
17240 HAVE_REALPATH=0
17241 else
17242 case "$gl_cv_func_realpath_works" in
17243 *yes) ;;
17244 *) REPLACE_REALPATH=1 ;;
17245 esac
17246 fi
17247 else
17248 case "$gl_cv_func_realpath_works" in
17249 *yes)
17250 ;;
17251 *)
17252 REPLACE_CANONICALIZE_FILE_NAME=1
17253 REPLACE_REALPATH=1
17254 ;;
17255 esac
5e8754f9 17256 fi
8690e634 17257
c0c3707f 17258 if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
8690e634
JK
17259
17260
17261
472fa5ee
SM
17262
17263
17264
17265
17266
c0c3707f
CB
17267 gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
17268
6ec2e0f5 17269 fi
8690e634
JK
17270
17271
c0c3707f
CB
17272cat >>confdefs.h <<_ACEOF
17273#define GNULIB_CANONICALIZE_LGPL 1
17274_ACEOF
8690e634 17275
8690e634 17276
8690e634 17277
8690e634 17278
8690e634 17279
8690e634 17280
8690e634 17281
c0c3707f 17282 GNULIB_CANONICALIZE_FILE_NAME=1
8690e634 17283
8690e634 17284
8690e634 17285
6ec2e0f5
SDJ
17286
17287
c0c3707f 17288$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
6ec2e0f5 17289
6ec2e0f5 17290
8690e634
JK
17291
17292
8690e634
JK
17293
17294
17295
17296
c0c3707f 17297 GNULIB_REALPATH=1
6ec2e0f5
SDJ
17298
17299
17300
17301
6ec2e0f5 17302
c0c3707f 17303$as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
6ec2e0f5
SDJ
17304
17305
17306
17307
17308
17309
17310
6ec2e0f5 17311
c0c3707f 17312 GNULIB_CHDIR=1
6ec2e0f5 17313
8690e634 17314
8690e634 17315
6ec2e0f5 17316
6ec2e0f5 17317
c0c3707f
CB
17318$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
17319
17320
17321
17322
17323
17324 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5
17325$as_echo_n "checking whether this system has an arbitrary file name length limit... " >&6; }
17326if ${gl_cv_have_arbitrary_file_name_length_limit+:} false; then :
17327 $as_echo_n "(cached) " >&6
8690e634 17328else
c0c3707f
CB
17329 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17330/* end confdefs.h. */
8690e634 17331
c0c3707f
CB
17332/* Arrange to define PATH_MAX, like "pathmax.h" does. */
17333#if HAVE_UNISTD_H
17334# include <unistd.h>
17335#endif
17336#include <limits.h>
17337#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
17338# include <sys/param.h>
17339#endif
17340#if !defined PATH_MAX && defined MAXPATHLEN
17341# define PATH_MAX MAXPATHLEN
17342#endif
17343#ifdef __hpux
17344# undef PATH_MAX
17345# define PATH_MAX 1024
17346#endif
17347#if defined _WIN32 && ! defined __CYGWIN__
17348# undef PATH_MAX
17349# define PATH_MAX 260
17350#endif
6ec2e0f5 17351
c0c3707f
CB
17352#ifdef PATH_MAX
17353have_arbitrary_file_name_length_limit
17354#endif
6ec2e0f5 17355_ACEOF
c0c3707f
CB
17356if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17357 $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then :
17358 gl_cv_have_arbitrary_file_name_length_limit=yes
17359else
17360 gl_cv_have_arbitrary_file_name_length_limit=no
17361fi
17362rm -f conftest*
6ec2e0f5
SDJ
17363
17364fi
c0c3707f
CB
17365{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5
17366$as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; }
6ec2e0f5 17367
c0c3707f 17368 if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
6ec2e0f5
SDJ
17369
17370
17371
17372
472fa5ee
SM
17373
17374
17375
17376
c0c3707f 17377 gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext"
472fa5ee 17378
c0c3707f 17379 :
8690e634
JK
17380 fi
17381
8690e634 17382
c0c3707f 17383$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
8690e634
JK
17384
17385
17386
17387
17388
8690e634 17389
c0c3707f
CB
17390 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
17391 REPLACE_CLOSE=1
17392 fi
8690e634 17393
6ec2e0f5
SDJ
17394
17395
6ec2e0f5
SDJ
17396
17397
8690e634 17398
c0c3707f
CB
17399 if test $ac_cv_header_sys_socket_h != yes; then
17400 for ac_header in winsock2.h
17401do :
17402 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
17403if test "x$ac_cv_header_winsock2_h" = xyes; then :
17404 cat >>confdefs.h <<_ACEOF
17405#define HAVE_WINSOCK2_H 1
17406_ACEOF
8690e634 17407
c0c3707f 17408fi
8690e634 17409
c0c3707f 17410done
8690e634 17411
c0c3707f
CB
17412 fi
17413 if test "$ac_cv_header_winsock2_h" = yes; then
17414 HAVE_WINSOCK2_H=1
17415 UNISTD_H_HAVE_WINSOCK2_H=1
17416 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
17417 else
17418 HAVE_WINSOCK2_H=0
17419 fi
8690e634 17420
6ec2e0f5 17421
c0c3707f
CB
17422 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
17423 REPLACE_CLOSE=1
17424 fi
6ec2e0f5
SDJ
17425
17426
c0c3707f 17427 if test $REPLACE_CLOSE = 0; then
6ec2e0f5
SDJ
17428
17429
6ec2e0f5 17430
c0c3707f
CB
17431 if test $ac_cv_func_fchdir = no; then
17432 HAVE_FCHDIR=0
17433 fi
6ec2e0f5 17434
c0c3707f
CB
17435 if test $HAVE_FCHDIR = 0; then
17436 REPLACE_CLOSE=1
17437 fi
17438 fi
6ec2e0f5
SDJ
17439
17440
c0c3707f 17441 if test $REPLACE_CLOSE = 1; then
6ec2e0f5
SDJ
17442
17443
17444
17445
17446
6ec2e0f5
SDJ
17447
17448
17449
c0c3707f 17450 gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
6ec2e0f5 17451
c0c3707f 17452 fi
6ec2e0f5 17453
6ec2e0f5
SDJ
17454
17455
17456
17457
c0c3707f 17458 GNULIB_CLOSE=1
6ec2e0f5 17459
6ec2e0f5 17460
6ec2e0f5
SDJ
17461
17462
17463
c0c3707f 17464$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
6ec2e0f5
SDJ
17465
17466
17467
17468
17469
c0c3707f
CB
17470
17471 for ac_func in closedir
17472do :
17473 ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
17474if test "x$ac_cv_func_closedir" = xyes; then :
17475 cat >>confdefs.h <<_ACEOF
17476#define HAVE_CLOSEDIR 1
17477_ACEOF
17478
17479fi
17480done
17481
17482 if test $ac_cv_func_closedir = no; then
17483 HAVE_CLOSEDIR=0
17484 fi
6ec2e0f5 17485
8690e634
JK
17486
17487
8690e634 17488
c0c3707f
CB
17489 if test $ac_cv_func_fchdir = no; then
17490 HAVE_FCHDIR=0
6ec2e0f5 17491 fi
6a29c58e 17492
c0c3707f
CB
17493 if test $HAVE_FCHDIR = 0; then
17494 if test $HAVE_CLOSEDIR = 1; then
17495 REPLACE_CLOSEDIR=1
17496 fi
17497 fi
6a29c58e 17498
c0c3707f
CB
17499 case $host_os,$HAVE_CLOSEDIR in
17500 os2*,1)
17501 REPLACE_CLOSEDIR=1;;
17502 esac
d0ac1c44 17503
c0c3707f 17504 if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
d0ac1c44
SM
17505
17506
d0ac1c44
SM
17507
17508
6a29c58e
YQ
17509
17510
3d99e817 17511
6ec2e0f5 17512
c0c3707f 17513 gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
6ec2e0f5 17514
6ec2e0f5
SDJ
17515 fi
17516
17517
6ec2e0f5
SDJ
17518
17519
3d99e817 17520
c0c3707f 17521 GNULIB_CLOSEDIR=1
3d99e817
AK
17522
17523
17524
17525
17526
c0c3707f 17527$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
3d99e817
AK
17528
17529
17530
c0c3707f
CB
17531 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
17532$as_echo_n "checking for d_ino member in directory struct... " >&6; }
17533if ${gl_cv_struct_dirent_d_ino+:} false; then :
6ec2e0f5
SDJ
17534 $as_echo_n "(cached) " >&6
17535else
17536 if test "$cross_compiling" = yes; then :
17537 case "$host_os" in
c0c3707f
CB
17538 # Guess yes on glibc systems with Linux kernel.
17539 linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
17540 # Guess yes on musl systems with Linux kernel.
17541 linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
17542 # Guess no on native Windows.
17543 mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
17544 # If we don't know, obey --enable-cross-guesses.
17545 *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
17546 esac
3d99e817 17547
6ec2e0f5
SDJ
17548else
17549 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17550/* end confdefs.h. */
c0c3707f
CB
17551#include <sys/types.h>
17552 #include <sys/stat.h>
17553 #include <dirent.h>
3d99e817 17554
6ec2e0f5
SDJ
17555int
17556main ()
17557{
c0c3707f
CB
17558DIR *dp = opendir (".");
17559 struct dirent *e;
17560 struct stat st;
17561 if (! dp)
17562 return 1;
17563 e = readdir (dp);
17564 if (! e)
17565 { closedir (dp); return 2; }
17566 if (lstat (e->d_name, &st) != 0)
17567 { closedir (dp); return 3; }
17568 if (e->d_ino != st.st_ino)
17569 { closedir (dp); return 4; }
17570 closedir (dp);
17571 return 0;
17572
6ec2e0f5
SDJ
17573 ;
17574 return 0;
17575}
3d99e817 17576_ACEOF
6ec2e0f5 17577if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
17578 gl_cv_struct_dirent_d_ino=yes
17579else
17580 gl_cv_struct_dirent_d_ino=no
17581fi
17582rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17583 conftest.$ac_objext conftest.beam conftest.$ac_ext
17584fi
17585
17586fi
17587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
17588$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
17589 case "$gl_cv_struct_dirent_d_ino" in
17590 *yes)
17591
17592$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
17593
17594 ;;
17595 esac
17596
17597
17598 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5
17599$as_echo_n "checking for d_type member in directory struct... " >&6; }
17600if ${gl_cv_struct_dirent_d_type+:} false; then :
17601 $as_echo_n "(cached) " >&6
17602else
17603 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17604/* end confdefs.h. */
17605
17606#include <sys/types.h>
17607#include <dirent.h>
17608
17609int
17610main ()
17611{
17612struct dirent dp; dp.d_type = 0;
17613 ;
17614 return 0;
17615}
17616_ACEOF
17617if ac_fn_c_try_link "$LINENO"; then :
17618 gl_cv_struct_dirent_d_type=yes
6ec2e0f5 17619else
c0c3707f 17620 gl_cv_struct_dirent_d_type=no
3d99e817 17621fi
c0c3707f
CB
17622rm -f core conftest.err conftest.$ac_objext \
17623 conftest$ac_exeext conftest.$ac_ext
3d99e817 17624
3d99e817 17625
c0c3707f
CB
17626fi
17627{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5
17628$as_echo "$gl_cv_struct_dirent_d_type" >&6; }
17629 if test $gl_cv_struct_dirent_d_type = yes; then
3d99e817 17630
c0c3707f 17631$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
3d99e817 17632
c0c3707f 17633 fi
3d99e817 17634
0750520d 17635
0750520d 17636
0750520d 17637
0750520d
PA
17638
17639
0750520d 17640
0750520d 17641
0750520d 17642
0750520d 17643
0750520d 17644
0750520d 17645
0750520d 17646
0750520d 17647
c0c3707f
CB
17648 if test $gl_cv_have_include_next = yes; then
17649 gl_cv_next_dirent_h='<'dirent.h'>'
17650 else
17651 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
17652$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
17653if ${gl_cv_next_dirent_h+:} false; then :
17654 $as_echo_n "(cached) " >&6
17655else
0750520d 17656
c0c3707f 17657 if test $ac_cv_header_dirent_h = yes; then
6ec2e0f5 17658
472fa5ee
SM
17659
17660
17661
c0c3707f
CB
17662 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17663/* end confdefs.h. */
17664#include <dirent.h>
17665_ACEOF
17666 case "$host_os" in
17667 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17668 *) gl_absname_cpp="$ac_cpp" ;;
17669 esac
472fa5ee 17670
c0c3707f
CB
17671 case "$host_os" in
17672 mingw*)
17673 gl_dirsep_regex='[/\\]'
17674 ;;
17675 *)
17676 gl_dirsep_regex='\/'
17677 ;;
17678 esac
17679 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17680 gl_header_literal_regex=`echo 'dirent.h' \
17681 | sed -e "$gl_make_literal_regex_sed"`
17682 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17683 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17684 s|^/[^/]|//&|
17685 p
17686 q
17687 }'
472fa5ee 17688
c0c3707f
CB
17689 gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17690 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 17691
c0c3707f
CB
17692 gl_header=$gl_cv_absolute_dirent_h
17693 gl_cv_next_dirent_h='"'$gl_header'"'
17694 else
17695 gl_cv_next_dirent_h='<'dirent.h'>'
17696 fi
6ec2e0f5
SDJ
17697
17698
c0c3707f
CB
17699fi
17700{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
17701$as_echo "$gl_cv_next_dirent_h" >&6; }
17702 fi
17703 NEXT_DIRENT_H=$gl_cv_next_dirent_h
472fa5ee 17704
c0c3707f
CB
17705 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17706 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17707 gl_next_as_first_directive='<'dirent.h'>'
17708 else
17709 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17710 gl_next_as_first_directive=$gl_cv_next_dirent_h
17711 fi
17712 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
472fa5ee
SM
17713
17714
17715
17716
c0c3707f
CB
17717 if test $ac_cv_header_dirent_h = yes; then
17718 HAVE_DIRENT_H=1
6ec2e0f5 17719 else
c0c3707f 17720 HAVE_DIRENT_H=0
6ec2e0f5
SDJ
17721 fi
17722
6ec2e0f5 17723
0750520d 17724
0750520d 17725
0750520d 17726
472fa5ee
SM
17727
17728
17729
17730
17731
0750520d 17732
c0c3707f
CB
17733 for ac_func in dirfd
17734do :
17735 ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
17736if test "x$ac_cv_func_dirfd" = xyes; then :
17737 cat >>confdefs.h <<_ACEOF
17738#define HAVE_DIRFD 1
17739_ACEOF
0750520d 17740
c0c3707f
CB
17741fi
17742done
0750520d 17743
c0c3707f
CB
17744 ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
17745 #include <dirent.h>
17746"
17747if test "x$ac_cv_have_decl_dirfd" = xyes; then :
17748 ac_have_decl=1
8690e634 17749else
c0c3707f
CB
17750 ac_have_decl=0
17751fi
8690e634 17752
c0c3707f
CB
17753cat >>confdefs.h <<_ACEOF
17754#define HAVE_DECL_DIRFD $ac_have_decl
17755_ACEOF
49e4877c 17756
c0c3707f
CB
17757 if test $ac_cv_have_decl_dirfd = no; then
17758 HAVE_DECL_DIRFD=0
17759 fi
8690e634 17760
c0c3707f
CB
17761 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
17762$as_echo_n "checking whether dirfd is a macro... " >&6; }
17763if ${gl_cv_func_dirfd_macro+:} false; then :
17764 $as_echo_n "(cached) " >&6
17765else
6ec2e0f5
SDJ
17766 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17767/* end confdefs.h. */
8690e634 17768
c0c3707f
CB
17769#include <sys/types.h>
17770#include <dirent.h>
17771#ifdef dirfd
17772 dirent_header_defines_dirfd
6ec2e0f5 17773#endif
8690e634 17774_ACEOF
c0c3707f
CB
17775if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17776 $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
17777 gl_cv_func_dirfd_macro=yes
6ec2e0f5 17778else
c0c3707f 17779 gl_cv_func_dirfd_macro=no
6ec2e0f5 17780fi
c0c3707f 17781rm -f conftest*
472fa5ee 17782
c0c3707f
CB
17783fi
17784{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
17785$as_echo "$gl_cv_func_dirfd_macro" >&6; }
472fa5ee 17786
c0c3707f
CB
17787 # Use the replacement if we have no function or macro with that name,
17788 # or if OS/2 kLIBC whose dirfd() does not work.
17789 # Replace only if the system declares dirfd already.
17790 case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
17791 no,no,*,yes | *,*,os2*,yes)
17792 REPLACE_DIRFD=1
472fa5ee 17793
c0c3707f
CB
17794$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
17795;;
17796 esac
472fa5ee 17797
c0c3707f
CB
17798 if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
17799 || test $REPLACE_DIRFD = 1; then
6ec2e0f5 17800
6ec2e0f5
SDJ
17801
17802
17803
17804
472fa5ee
SM
17805
17806
17807
c0c3707f 17808 gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
472fa5ee
SM
17809
17810
c0c3707f
CB
17811 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
17812$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
17813if ${gl_cv_sys_dir_fd_member_name+:} false; then :
17814 $as_echo_n "(cached) " >&6
17815else
6ec2e0f5 17816
c0c3707f
CB
17817 dirfd_save_CFLAGS=$CFLAGS
17818 for ac_expr in d_fd dd_fd; do
6ec2e0f5 17819
c0c3707f
CB
17820 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
17821 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17822/* end confdefs.h. */
6ec2e0f5 17823
c0c3707f
CB
17824 #include <sys/types.h>
17825 #include <dirent.h>
17826int
17827main ()
17828{
17829DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
17830 ;
17831 return 0;
17832}
17833_ACEOF
17834if ac_fn_c_try_compile "$LINENO"; then :
17835 dir_fd_found=yes
6ec2e0f5 17836
c0c3707f
CB
17837fi
17838rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17839 CFLAGS=$dirfd_save_CFLAGS
17840 test "$dir_fd_found" = yes && break
17841 done
17842 test "$dir_fd_found" = yes || ac_expr=no_such_member
472fa5ee 17843
c0c3707f 17844 gl_cv_sys_dir_fd_member_name=$ac_expr
472fa5ee
SM
17845
17846
c0c3707f
CB
17847fi
17848{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
17849$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
17850 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
472fa5ee 17851
c0c3707f
CB
17852cat >>confdefs.h <<_ACEOF
17853#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
17854_ACEOF
472fa5ee 17855
6ec2e0f5
SDJ
17856 fi
17857
6ec2e0f5 17858
c0c3707f 17859 fi
6ec2e0f5
SDJ
17860
17861
17862
17863
17864
c0c3707f 17865 GNULIB_DIRFD=1
6ec2e0f5
SDJ
17866
17867
17868
6ec2e0f5 17869
8690e634 17870
c0c3707f 17871$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
8690e634
JK
17872
17873
8690e634
JK
17874
17875
17876
8690e634
JK
17877
17878
8690e634 17879
8690e634 17880
c0c3707f
CB
17881 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
17882$as_echo_n "checking whether // is distinct from /... " >&6; }
17883if ${gl_cv_double_slash_root+:} false; then :
17884 $as_echo_n "(cached) " >&6
17885else
17886 if test x"$cross_compiling" = xyes ; then
17887 # When cross-compiling, there is no way to tell whether // is special
17888 # short of a list of hosts. However, the only known hosts to date
17889 # that have a distinct // are Apollo DomainOS (too old to port to),
17890 # Cygwin, and z/OS. If anyone knows of another system for which // has
17891 # special semantics and is distinct from /, please report it to
17892 # <bug-gnulib@gnu.org>.
17893 case $host in
17894 *-cygwin | i370-ibm-openedition)
17895 gl_cv_double_slash_root=yes ;;
17896 *)
17897 # Be optimistic and assume that / and // are the same when we
17898 # don't know.
17899 gl_cv_double_slash_root='unknown, assuming no' ;;
17900 esac
17901 else
17902 set x `ls -di / // 2>/dev/null`
17903 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
17904 gl_cv_double_slash_root=no
17905 else
17906 gl_cv_double_slash_root=yes
17907 fi
17908 fi
17909fi
17910{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
17911$as_echo "$gl_cv_double_slash_root" >&6; }
17912 if test "$gl_cv_double_slash_root" = yes; then
6ec2e0f5 17913
c0c3707f 17914$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
8690e634 17915
c0c3707f 17916 fi
8690e634 17917
63ce7108
TT
17918
17919
17920
17921
c0c3707f
CB
17922 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
17923 REPLACE_DUP=1
17924 fi
8690e634
JK
17925
17926
17927
17928
17929
c0c3707f
CB
17930 if test $ac_cv_func_fchdir = no; then
17931 HAVE_FCHDIR=0
17932 fi
8690e634 17933
c0c3707f
CB
17934 if test $HAVE_FCHDIR = 0; then
17935 REPLACE_DUP=1
17936 fi
8690e634 17937
c0c3707f
CB
17938 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
17939$as_echo_n "checking whether dup works... " >&6; }
17940if ${gl_cv_func_dup_works+:} false; then :
8690e634
JK
17941 $as_echo_n "(cached) " >&6
17942else
c0c3707f
CB
17943 if test "$cross_compiling" = yes; then :
17944 case "$host_os" in
17945 # Guess no on native Windows.
17946 mingw*) gl_cv_func_dup_works="guessing no" ;;
17947 *) gl_cv_func_dup_works="guessing yes" ;;
17948 esac
8690e634 17949
c0c3707f 17950else
4a626d0a 17951 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 17952/* end confdefs.h. */
c0c3707f
CB
17953#include <unistd.h>
17954 #include <fcntl.h>
17955 #include <errno.h>
17956int
17957main ()
17958{
17959/* On OS/2 kLIBC, dup does not work on a directory fd. */
17960 int fd = open (".", O_RDONLY);
17961 return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
8690e634 17962
c0c3707f
CB
17963 ;
17964 return 0;
17965}
8690e634 17966
c0c3707f
CB
17967_ACEOF
17968if ac_fn_c_try_run "$LINENO"; then :
17969 gl_cv_func_dup_works=yes
17970else
17971 gl_cv_func_dup_works=no
17972fi
17973rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17974 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 17975fi
8690e634 17976
8690e634 17977
c0c3707f
CB
17978fi
17979{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
17980$as_echo "$gl_cv_func_dup_works" >&6; }
17981 case "$gl_cv_func_dup_works" in
17982 *yes) ;;
17983 *)
17984 REPLACE_DUP=1
17985 ;;
17986 esac
8690e634 17987
c0c3707f 17988 if test $REPLACE_DUP = 1; then
8690e634
JK
17989
17990
17991
17992
6ec2e0f5
SDJ
17993
17994
17995
17996
c0c3707f 17997 gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
8690e634 17998
c0c3707f
CB
17999 :
18000 fi
8690e634 18001
5e8754f9 18002
8690e634
JK
18003
18004
8839a007 18005
c0c3707f 18006 GNULIB_DUP=1
63ce7108 18007
63ce7108 18008
63ce7108 18009
6ec2e0f5 18010
6ec2e0f5 18011
c0c3707f 18012$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
6ec2e0f5 18013
63ce7108
TT
18014
18015
472fa5ee
SM
18016
18017
18018
18019
18020
c0c3707f
CB
18021$as_echo "#define HAVE_DUP2 1" >>confdefs.h
18022
18023
18024 if test $HAVE_DUP2 = 1; then
18025 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
18026$as_echo_n "checking whether dup2 works... " >&6; }
18027if ${gl_cv_func_dup2_works+:} false; then :
6ec2e0f5
SDJ
18028 $as_echo_n "(cached) " >&6
18029else
18030 if test "$cross_compiling" = yes; then :
18031 case "$host_os" in
c0c3707f
CB
18032 mingw*) # on this platform, dup2 always returns 0 for success
18033 gl_cv_func_dup2_works="guessing no" ;;
18034 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
18035 gl_cv_func_dup2_works="guessing no" ;;
18036 aix* | freebsd*)
18037 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
18038 # not EBADF.
18039 gl_cv_func_dup2_works="guessing no" ;;
18040 haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
18041 gl_cv_func_dup2_works="guessing no" ;;
18042 *-android*) # implemented using dup3(), which fails if oldfd == newfd
18043 gl_cv_func_dup2_works="guessing no" ;;
18044 os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
18045 gl_cv_func_dup2_works="guessing no" ;;
18046 *) gl_cv_func_dup2_works="guessing yes" ;;
18047 esac
63ce7108
TT
18048else
18049 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18050/* end confdefs.h. */
18051
c0c3707f
CB
18052 #include <errno.h>
18053 #include <fcntl.h>
18054 #include <limits.h>
18055 #include <sys/resource.h>
18056 #include <unistd.h>
18057 #ifndef RLIM_SAVED_CUR
18058 # define RLIM_SAVED_CUR RLIM_INFINITY
18059 #endif
18060 #ifndef RLIM_SAVED_MAX
18061 # define RLIM_SAVED_MAX RLIM_INFINITY
18062 #endif
63ce7108
TT
18063
18064int
18065main ()
18066{
6ec2e0f5 18067int result = 0;
c0c3707f
CB
18068 int bad_fd = INT_MAX;
18069 struct rlimit rlim;
18070 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18071 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18072 && rlim.rlim_cur != RLIM_INFINITY
18073 && rlim.rlim_cur != RLIM_SAVED_MAX
18074 && rlim.rlim_cur != RLIM_SAVED_CUR)
18075 bad_fd = rlim.rlim_cur;
18076 #ifdef FD_CLOEXEC
18077 if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
18078 result |= 1;
18079 #endif
18080 if (dup2 (1, 1) != 1)
18081 result |= 2;
18082 #ifdef FD_CLOEXEC
18083 if (fcntl (1, F_GETFD) != FD_CLOEXEC)
18084 result |= 4;
18085 #endif
18086 close (0);
18087 if (dup2 (0, 0) != -1)
18088 result |= 8;
18089 /* Many gnulib modules require POSIX conformance of EBADF. */
18090 if (dup2 (2, bad_fd) == -1 && errno != EBADF)
18091 result |= 16;
18092 /* Flush out some cygwin core dumps. */
18093 if (dup2 (2, -1) != -1 || errno != EBADF)
18094 result |= 32;
18095 dup2 (2, 255);
18096 dup2 (2, 256);
18097 /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
18098 {
18099 int fd = open (".", O_RDONLY);
18100 if (fd == -1)
18101 result |= 64;
18102 else if (dup2 (fd, fd + 1) == -1)
18103 result |= 128;
18104
18105 close (fd);
18106 }
18107 return result;
63ce7108
TT
18108 ;
18109 return 0;
18110}
c0c3707f 18111
63ce7108
TT
18112_ACEOF
18113if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 18114 gl_cv_func_dup2_works=yes
63ce7108 18115else
c0c3707f 18116 gl_cv_func_dup2_works=no
63ce7108
TT
18117fi
18118rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18119 conftest.$ac_objext conftest.beam conftest.$ac_ext
18120fi
18121
c0c3707f 18122
63ce7108 18123fi
c0c3707f
CB
18124{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
18125$as_echo "$gl_cv_func_dup2_works" >&6; }
18126 case "$gl_cv_func_dup2_works" in
63ce7108
TT
18127 *yes) ;;
18128 *)
c0c3707f
CB
18129 REPLACE_DUP2=1
18130 for ac_func in setdtablesize
18131do :
18132 ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
18133if test "x$ac_cv_func_setdtablesize" = xyes; then :
18134 cat >>confdefs.h <<_ACEOF
18135#define HAVE_SETDTABLESIZE 1
18136_ACEOF
18137
18138fi
18139done
18140
63ce7108
TT
18141 ;;
18142 esac
18143 fi
18144
09607c9e
TT
18145
18146
18147
c0c3707f
CB
18148 if test $ac_cv_func_fchdir = no; then
18149 HAVE_FCHDIR=0
18150 fi
4a626d0a 18151
c0c3707f
CB
18152 if test $HAVE_FCHDIR = 0; then
18153 if test $HAVE_DUP2 = 1; then
18154 REPLACE_DUP2=1
18155 fi
18156 fi
4a626d0a
PA
18157
18158
c0c3707f 18159 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
4a626d0a
PA
18160
18161
18162
18163
18164
18165
4a626d0a 18166
4a626d0a 18167
c0c3707f 18168 gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
4a626d0a
PA
18169
18170
c0c3707f 18171 fi
4a626d0a
PA
18172
18173
18174
18175
18176
c0c3707f 18177 GNULIB_DUP2=1
4a626d0a
PA
18178
18179
18180
18181
09607c9e 18182
c0c3707f 18183$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
09607c9e
TT
18184
18185
472fa5ee
SM
18186
18187
18188
18189
18190
09607c9e 18191
6ec2e0f5 18192
c0c3707f 18193 GNULIB_ENVIRON=1
6ec2e0f5 18194
09607c9e 18195
09607c9e 18196
6ec2e0f5
SDJ
18197
18198
c0c3707f 18199$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
6ec2e0f5
SDJ
18200
18201
6ec2e0f5 18202
5e8754f9 18203
6ec2e0f5 18204
c0c3707f
CB
18205 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
18206$as_echo_n "checking for error_at_line... " >&6; }
18207if ${ac_cv_lib_error_at_line+:} false; then :
09607c9e 18208 $as_echo_n "(cached) " >&6
4a626d0a
PA
18209else
18210 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18211/* end confdefs.h. */
c0c3707f
CB
18212#include <error.h>
18213int
18214main ()
18215{
18216error_at_line (0, 0, "", 0, "an error occurred");
18217 ;
4a626d0a
PA
18218 return 0;
18219}
18220_ACEOF
c0c3707f
CB
18221if ac_fn_c_try_link "$LINENO"; then :
18222 ac_cv_lib_error_at_line=yes
4a626d0a 18223else
c0c3707f 18224 ac_cv_lib_error_at_line=no
6ec2e0f5 18225fi
c0c3707f
CB
18226rm -f core conftest.err conftest.$ac_objext \
18227 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5 18228fi
c0c3707f
CB
18229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
18230$as_echo "$ac_cv_lib_error_at_line" >&6; }
09607c9e 18231
c0c3707f 18232 if test $ac_cv_lib_error_at_line = no; then
09607c9e
TT
18233
18234
18235
18236
18237
18238
18239
18240
c0c3707f 18241 gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
09607c9e 18242
4a626d0a 18243
09607c9e 18244
c0c3707f 18245 :
4a626d0a 18246
c0c3707f 18247 fi
4a626d0a 18248
4a626d0a 18249
09607c9e 18250
09607c9e 18251
09607c9e
TT
18252
18253
09607c9e 18254
c0c3707f
CB
18255 if test $ac_cv_have_decl_fchdir = no; then
18256 HAVE_DECL_FCHDIR=0
18257 fi
09607c9e
TT
18258
18259
c0c3707f 18260 if test $HAVE_FCHDIR = 0; then
09607c9e
TT
18261
18262
18263
c0c3707f
CB
18264
18265
18266
18267
18268
18269 gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
18270
18271 :
18272
18273$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
18274
18275 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
18276$as_echo_n "checking whether open can visit directories... " >&6; }
18277if ${gl_cv_func_open_directory_works+:} false; then :
18278 $as_echo_n "(cached) " >&6
3d99e817 18279else
c0c3707f
CB
18280 if test "$cross_compiling" = yes; then :
18281 case "$host_os" in
18282 # Guess yes on Linux systems.
18283 linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
18284 # Guess yes on glibc systems.
18285 *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
18286 # Guess no on native Windows.
18287 mingw*) gl_cv_func_open_directory_works="guessing no" ;;
18288 # If we don't know, obey --enable-cross-guesses.
18289 *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
18290 esac
18291
18292else
18293 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18294/* end confdefs.h. */
18295#include <fcntl.h>
18296
18297int
18298main ()
18299{
18300return open(".", O_RDONLY) < 0;
18301 ;
18302 return 0;
18303}
18304_ACEOF
18305if ac_fn_c_try_run "$LINENO"; then :
18306 gl_cv_func_open_directory_works=yes
18307else
18308 gl_cv_func_open_directory_works=no
18309fi
18310rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18311 conftest.$ac_objext conftest.beam conftest.$ac_ext
3d99e817
AK
18312fi
18313
c0c3707f
CB
18314fi
18315{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
18316$as_echo "$gl_cv_func_open_directory_works" >&6; }
18317 case "$gl_cv_func_open_directory_works" in
18318 *yes) ;;
18319 *)
3d99e817 18320
c0c3707f 18321$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
09607c9e 18322
c0c3707f
CB
18323 ;;
18324 esac
18325 fi
8690e634 18326
8690e634 18327
8690e634 18328
8690e634 18329
8690e634 18330
6ec2e0f5 18331
c0c3707f 18332 GNULIB_FCHDIR=1
6ec2e0f5
SDJ
18333
18334
6ec2e0f5 18335
8690e634
JK
18336
18337
c0c3707f 18338$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
8690e634
JK
18339
18340
18341
6ec2e0f5
SDJ
18342
18343
18344
6ec2e0f5 18345
8690e634 18346
c0c3707f 18347 if test $ac_cv_func_fcntl = no; then
8690e634
JK
18348
18349
6ec2e0f5 18350
c0c3707f
CB
18351 if test $ac_cv_func_fcntl = no; then
18352 HAVE_FCNTL=0
18353 else
18354 REPLACE_FCNTL=1
18355 fi
5e8754f9 18356
c0c3707f
CB
18357 else
18358 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
18359$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
18360if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
8690e634 18361 $as_echo_n "(cached) " >&6
6ec2e0f5 18362else
c0c3707f
CB
18363 if test "$cross_compiling" = yes; then :
18364 case $host_os in
18365 aix* | cygwin* | haiku*)
18366 gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
18367 *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
18368 esac
18369else
18370 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18371/* end confdefs.h. */
18372#include <errno.h>
18373 #include <fcntl.h>
18374 #include <limits.h>
18375 #include <sys/resource.h>
18376 #include <unistd.h>
18377 #ifndef RLIM_SAVED_CUR
18378 # define RLIM_SAVED_CUR RLIM_INFINITY
18379 #endif
18380 #ifndef RLIM_SAVED_MAX
18381 # define RLIM_SAVED_MAX RLIM_INFINITY
18382 #endif
18383
18384int
18385main ()
18386{
18387int result = 0;
18388 int bad_fd = INT_MAX;
18389 struct rlimit rlim;
18390 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18391 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18392 && rlim.rlim_cur != RLIM_INFINITY
18393 && rlim.rlim_cur != RLIM_SAVED_MAX
18394 && rlim.rlim_cur != RLIM_SAVED_CUR)
18395 bad_fd = rlim.rlim_cur;
18396 if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
18397 if (errno != EINVAL) result |= 2;
18398 if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
18399 if (errno != EINVAL) result |= 8;
18400 /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
18401 {
18402 int fd;
18403 fd = open (".", O_RDONLY);
18404 if (fd == -1)
18405 result |= 16;
18406 else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
18407 result |= 32;
18408
18409 close (fd);
18410 }
18411 return result;
18412 ;
18413 return 0;
18414}
18415_ACEOF
18416if ac_fn_c_try_run "$LINENO"; then :
18417 gl_cv_func_fcntl_f_dupfd_works=yes
18418else
18419 gl_cv_func_fcntl_f_dupfd_works=no
18420fi
18421rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18422 conftest.$ac_objext conftest.beam conftest.$ac_ext
18423fi
18424
18425fi
18426{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
18427$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
18428 case $gl_cv_func_fcntl_f_dupfd_works in
18429 *yes) ;;
18430 *)
18431
18432
18433 if test $ac_cv_func_fcntl = no; then
18434 HAVE_FCNTL=0
18435 else
18436 REPLACE_FCNTL=1
18437 fi
18438
18439
18440$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
18441 ;;
18442 esac
18443
18444 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
18445$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
18446if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
18447 $as_echo_n "(cached) " >&6
8690e634
JK
18448else
18449 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18450/* end confdefs.h. */
c0c3707f
CB
18451
18452#include <fcntl.h>
18453#ifndef F_DUPFD_CLOEXEC
18454choke me
18455#endif
18456
18457int
18458main ()
18459{
18460
18461 ;
18462 return 0;
18463}
18464_ACEOF
18465if ac_fn_c_try_compile "$LINENO"; then :
18466 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18467/* end confdefs.h. */
18468
18469#ifdef __linux__
18470/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
18471 it to support the semantics on older kernels that failed with EINVAL. */
18472choke me
18473#endif
8690e634 18474
8690e634
JK
18475int
18476main ()
18477{
18478
18479 ;
18480 return 0;
18481}
18482_ACEOF
c0c3707f
CB
18483if ac_fn_c_try_compile "$LINENO"; then :
18484 gl_cv_func_fcntl_f_dupfd_cloexec=yes
8690e634 18485else
c0c3707f 18486 gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
8690e634 18487fi
c0c3707f
CB
18488rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18489else
18490 gl_cv_func_fcntl_f_dupfd_cloexec=no
18491fi
18492rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 18493fi
c0c3707f
CB
18494{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
18495$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
18496 if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
8690e634 18497
8690e634 18498
c0c3707f
CB
18499
18500 if test $ac_cv_func_fcntl = no; then
18501 HAVE_FCNTL=0
5e8754f9 18502 else
c0c3707f
CB
18503 REPLACE_FCNTL=1
18504 fi
18505
18506 fi
8690e634
JK
18507 fi
18508
18509
8690e634 18510
8690e634 18511
c0c3707f
CB
18512 if test $ac_cv_func_fchdir = no; then
18513 HAVE_FCHDIR=0
18514 fi
6ec2e0f5 18515
c0c3707f 18516 if test $HAVE_FCHDIR = 0; then
6ec2e0f5
SDJ
18517
18518
18519
c0c3707f
CB
18520 if test $ac_cv_func_fcntl = no; then
18521 HAVE_FCNTL=0
18522 else
18523 REPLACE_FCNTL=1
18524 fi
6ec2e0f5 18525
c0c3707f 18526 fi
6ec2e0f5
SDJ
18527
18528
c0c3707f 18529 if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
6ec2e0f5 18530
6ec2e0f5
SDJ
18531
18532
5e8754f9
SDJ
18533
18534
8690e634 18535
8690e634
JK
18536
18537
c0c3707f 18538 gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
472fa5ee 18539
c0c3707f 18540 fi
472fa5ee
SM
18541
18542
18543
18544
18545
c0c3707f 18546 GNULIB_FCNTL=1
472fa5ee
SM
18547
18548
18549
18550
18551
c0c3707f 18552$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
472fa5ee
SM
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
c0c3707f
CB
18567 if test $gl_cv_have_include_next = yes; then
18568 gl_cv_next_fcntl_h='<'fcntl.h'>'
18569 else
18570 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
18571$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
18572if ${gl_cv_next_fcntl_h+:} false; then :
18573 $as_echo_n "(cached) " >&6
18574else
472fa5ee
SM
18575
18576
472fa5ee 18577
c0c3707f
CB
18578 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18579/* end confdefs.h. */
18580#include <fcntl.h>
18581_ACEOF
18582 case "$host_os" in
18583 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18584 *) gl_absname_cpp="$ac_cpp" ;;
18585 esac
472fa5ee 18586
c0c3707f
CB
18587 case "$host_os" in
18588 mingw*)
18589 gl_dirsep_regex='[/\\]'
18590 ;;
18591 *)
18592 gl_dirsep_regex='\/'
18593 ;;
18594 esac
18595 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18596 gl_header_literal_regex=`echo 'fcntl.h' \
18597 | sed -e "$gl_make_literal_regex_sed"`
18598 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18599 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18600 s|^/[^/]|//&|
18601 p
18602 q
18603 }'
472fa5ee 18604
c0c3707f
CB
18605 gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18606 sed -n "$gl_absolute_header_sed"`
472fa5ee 18607
c0c3707f
CB
18608 gl_header=$gl_cv_absolute_fcntl_h
18609 gl_cv_next_fcntl_h='"'$gl_header'"'
8690e634
JK
18610
18611
c0c3707f
CB
18612fi
18613{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
18614$as_echo "$gl_cv_next_fcntl_h" >&6; }
18615 fi
18616 NEXT_FCNTL_H=$gl_cv_next_fcntl_h
8690e634 18617
c0c3707f
CB
18618 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18619 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18620 gl_next_as_first_directive='<'fcntl.h'>'
18621 else
18622 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18623 gl_next_as_first_directive=$gl_cv_next_fcntl_h
18624 fi
18625 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
8690e634
JK
18626
18627
18628
18629
5e8754f9
SDJ
18630
18631
18632
18633
472fa5ee
SM
18634
18635
18636
18637
18638
18639
18640
5e8754f9 18641cat >>confdefs.h <<_ACEOF
c0c3707f 18642#define GNULIB_FD_SAFER_FLAG 1
5e8754f9 18643_ACEOF
472fa5ee
SM
18644
18645
c0c3707f
CB
18646
18647
18648
18649
18650
18651 ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
18652#include <dirent.h>
18653
5e8754f9 18654"
c0c3707f 18655if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
5e8754f9
SDJ
18656 ac_have_decl=1
18657else
18658 ac_have_decl=0
18659fi
472fa5ee 18660
5e8754f9 18661cat >>confdefs.h <<_ACEOF
c0c3707f 18662#define HAVE_DECL_FDOPENDIR $ac_have_decl
5e8754f9 18663_ACEOF
c0c3707f 18664if test $ac_have_decl = 1; then :
472fa5ee 18665
c0c3707f
CB
18666else
18667 HAVE_DECL_FDOPENDIR=0
18668fi
472fa5ee
SM
18669
18670
c0c3707f
CB
18671 if test $ac_cv_func_fdopendir = no; then
18672 HAVE_FDOPENDIR=0
18673 else
18674 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
18675$as_echo_n "checking whether fdopendir works... " >&6; }
18676if ${gl_cv_func_fdopendir_works+:} false; then :
18677 $as_echo_n "(cached) " >&6
18678else
18679 if test "$cross_compiling" = yes; then :
18680 case "$host_os" in
18681 # Guess yes on glibc systems.
18682 *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
18683 # Guess yes on musl systems.
18684 *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
18685 # If we don't know, obey --enable-cross-guesses.
18686 *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
18687 esac
472fa5ee 18688
c0c3707f
CB
18689else
18690 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18691/* end confdefs.h. */
472fa5ee 18692
c0c3707f
CB
18693#include <dirent.h>
18694#include <fcntl.h>
18695#include <unistd.h>
18696#if !HAVE_DECL_FDOPENDIR
18697extern
18698# ifdef __cplusplus
18699"C"
18700# endif
18701DIR *fdopendir (int);
18702#endif
472fa5ee 18703
c0c3707f
CB
18704int
18705main ()
18706{
18707int result = 0;
18708 int fd = open ("conftest.c", O_RDONLY);
18709 if (fd < 0) result |= 1;
18710 if (fdopendir (fd)) result |= 2;
18711 if (close (fd)) result |= 4;
18712 return result;
18713 ;
18714 return 0;
18715}
18716_ACEOF
18717if ac_fn_c_try_run "$LINENO"; then :
18718 gl_cv_func_fdopendir_works=yes
18719else
18720 gl_cv_func_fdopendir_works=no
18721fi
18722rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18723 conftest.$ac_objext conftest.beam conftest.$ac_ext
18724fi
472fa5ee 18725
c0c3707f
CB
18726fi
18727{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
18728$as_echo "$gl_cv_func_fdopendir_works" >&6; }
18729 case "$gl_cv_func_fdopendir_works" in
18730 *yes) ;;
18731 *)
18732 REPLACE_FDOPENDIR=1
18733 ;;
18734 esac
18735 fi
472fa5ee 18736
c0c3707f 18737 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
472fa5ee
SM
18738
18739
18740
18741
18742
98399780 18743
5e8754f9
SDJ
18744
18745
c0c3707f 18746 gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
5e8754f9 18747
c0c3707f 18748 fi
5e8754f9
SDJ
18749
18750
18751
18752
18753
c0c3707f 18754 GNULIB_FDOPENDIR=1
5e8754f9
SDJ
18755
18756
18757
18758
18759
c0c3707f 18760$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
5e8754f9
SDJ
18761
18762
5e8754f9
SDJ
18763
18764
18765
c0c3707f
CB
18766cat >>confdefs.h <<_ACEOF
18767#define GNULIB_FDOPENDIR 1
18768_ACEOF
5e8754f9
SDJ
18769
18770
18771
5e8754f9
SDJ
18772
18773
18774
c0c3707f
CB
18775 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
18776$as_echo_n "checking for flexible array member... " >&6; }
18777if ${ac_cv_c_flexmember+:} false; then :
5e8754f9 18778 $as_echo_n "(cached) " >&6
6ec2e0f5 18779else
c0c3707f 18780 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 18781/* end confdefs.h. */
c0c3707f
CB
18782#include <stdlib.h>
18783 #include <stdio.h>
18784 #include <stddef.h>
18785 struct m { struct m *next, **list; char name[]; };
18786 struct s { struct s *p; struct m *m; int n; double d[]; };
5e8754f9
SDJ
18787int
18788main ()
18789{
c0c3707f
CB
18790int m = getchar ();
18791 size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
18792 nbytes += sizeof (struct s) - 1;
18793 nbytes -= nbytes % sizeof (struct s);
18794 struct s *p = malloc (nbytes);
18795 p->p = p;
18796 p->m = NULL;
18797 p->d[0] = 0.0;
18798 return p->d != (double *) NULL;
5e8754f9
SDJ
18799 ;
18800 return 0;
18801}
7a6dbc2f 18802_ACEOF
c0c3707f
CB
18803if ac_fn_c_try_compile "$LINENO"; then :
18804 ac_cv_c_flexmember=yes
5e8754f9 18805else
c0c3707f 18806 ac_cv_c_flexmember=no
5e8754f9 18807fi
c0c3707f 18808rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5e8754f9 18809fi
c0c3707f
CB
18810{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
18811$as_echo "$ac_cv_c_flexmember" >&6; }
18812 if test $ac_cv_c_flexmember = yes; then
18813
18814$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
5e8754f9 18815
c0c3707f
CB
18816 else
18817 $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
98399780 18818
c0c3707f 18819 fi
98399780 18820
472fa5ee
SM
18821
18822
18823
c0c3707f
CB
18824 FLOAT_H=
18825 REPLACE_FLOAT_LDBL=0
18826 case "$host_os" in
18827 aix* | beos* | openbsd* | mirbsd* | irix*)
18828 FLOAT_H=float.h
18829 ;;
18830 freebsd* | dragonfly*)
18831 case "$host_cpu" in
18832 i[34567]86 )
18833 FLOAT_H=float.h
18834 ;;
18835 x86_64 )
18836 # On x86_64 systems, the C compiler may still be generating
18837 # 32-bit code.
18838 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18839/* end confdefs.h. */
18840#if defined __LP64__ || defined __x86_64__ || defined __amd64__
18841 int ok;
18842 #else
18843 error fail
18844 #endif
472fa5ee 18845
c0c3707f
CB
18846_ACEOF
18847if ac_fn_c_try_compile "$LINENO"; then :
472fa5ee 18848
c0c3707f
CB
18849else
18850 FLOAT_H=float.h
18851fi
18852rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18853 ;;
18854 esac
18855 ;;
18856 linux*)
18857 case "$host_cpu" in
18858 powerpc*)
18859 FLOAT_H=float.h
18860 ;;
18861 esac
18862 ;;
18863 esac
18864 case "$host_os" in
18865 aix* | freebsd* | dragonfly* | linux*)
18866 if test -n "$FLOAT_H"; then
18867 REPLACE_FLOAT_LDBL=1
18868 fi
18869 ;;
18870 esac
18871
18872 REPLACE_ITOLD=0
18873 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
18874$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
18875if ${gl_cv_func_itold_works+:} false; then :
5e8754f9
SDJ
18876 $as_echo_n "(cached) " >&6
18877else
18878
18879 if test "$cross_compiling" = yes; then :
c0c3707f
CB
18880 case "$host" in
18881 sparc*-*-linux*)
18882 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18883/* end confdefs.h. */
18884#if defined __LP64__ || defined __arch64__
18885 int ok;
18886 #else
18887 error fail
18888 #endif
18889
18890_ACEOF
18891if ac_fn_c_try_compile "$LINENO"; then :
18892 gl_cv_func_itold_works="guessing no"
18893else
18894 gl_cv_func_itold_works="guessing yes"
18895fi
18896rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18897 ;;
18898 # Guess yes on native Windows.
18899 mingw*) gl_cv_func_itold_works="guessing yes" ;;
18900 *) gl_cv_func_itold_works="guessing yes" ;;
5e8754f9
SDJ
18901 esac
18902
18903else
18904 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18905/* end confdefs.h. */
18906
c0c3707f
CB
18907int i = -1;
18908volatile long double ld;
18909int main ()
5e8754f9 18910{
c0c3707f
CB
18911 ld += i * 1.0L;
18912 if (ld > 0)
18913 return 1;
18914 return 0;
5e8754f9
SDJ
18915}
18916_ACEOF
18917if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 18918 gl_cv_func_itold_works=yes
5e8754f9 18919else
c0c3707f 18920 gl_cv_func_itold_works=no
5e8754f9
SDJ
18921fi
18922rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18923 conftest.$ac_objext conftest.beam conftest.$ac_ext
18924fi
18925
98399780 18926
5e8754f9 18927fi
c0c3707f
CB
18928{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
18929$as_echo "$gl_cv_func_itold_works" >&6; }
18930 case "$gl_cv_func_itold_works" in
18931 *no)
18932 REPLACE_ITOLD=1
18933 FLOAT_H=float.h
18934 ;;
18935 esac
98399780 18936
c0c3707f 18937 if test -n "$FLOAT_H"; then
98399780
YQ
18938
18939
18940
18941
6a29c58e
YQ
18942
18943
18944
18945
c0c3707f
CB
18946 if test $gl_cv_have_include_next = yes; then
18947 gl_cv_next_float_h='<'float.h'>'
18948 else
18949 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
18950$as_echo_n "checking absolute name of <float.h>... " >&6; }
18951if ${gl_cv_next_float_h+:} false; then :
18952 $as_echo_n "(cached) " >&6
18953else
18954
18955
18956
18957 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18958/* end confdefs.h. */
18959#include <float.h>
18960_ACEOF
18961 case "$host_os" in
18962 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18963 *) gl_absname_cpp="$ac_cpp" ;;
18964 esac
18965
18966 case "$host_os" in
18967 mingw*)
18968 gl_dirsep_regex='[/\\]'
18969 ;;
18970 *)
18971 gl_dirsep_regex='\/'
18972 ;;
18973 esac
18974 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18975 gl_header_literal_regex=`echo 'float.h' \
18976 | sed -e "$gl_make_literal_regex_sed"`
18977 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18978 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18979 s|^/[^/]|//&|
18980 p
18981 q
18982 }'
18983
18984 gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18985 sed -n "$gl_absolute_header_sed"`
18986
18987 gl_header=$gl_cv_absolute_float_h
18988 gl_cv_next_float_h='"'$gl_header'"'
18989
18990
18991fi
18992{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
18993$as_echo "$gl_cv_next_float_h" >&6; }
18994 fi
18995 NEXT_FLOAT_H=$gl_cv_next_float_h
18996
18997 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18998 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18999 gl_next_as_first_directive='<'float.h'>'
19000 else
19001 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
19002 gl_next_as_first_directive=$gl_cv_next_float_h
19003 fi
19004 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
19005
19006
19007
6a29c58e 19008
c0c3707f 19009 fi
6a29c58e 19010
c0c3707f
CB
19011 if test -n "$FLOAT_H"; then
19012 GL_GENERATE_FLOAT_H_TRUE=
19013 GL_GENERATE_FLOAT_H_FALSE='#'
19014else
19015 GL_GENERATE_FLOAT_H_TRUE='#'
19016 GL_GENERATE_FLOAT_H_FALSE=
19017fi
6a29c58e
YQ
19018
19019
8690e634 19020
c0c3707f 19021 if test $REPLACE_FLOAT_LDBL = 1; then
8690e634 19022
8690e634 19023
8690e634 19024
8690e634 19025
8690e634 19026
8690e634 19027
8690e634 19028
4a626d0a 19029
c0c3707f 19030 gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
8690e634 19031
c0c3707f
CB
19032 fi
19033 if test $REPLACE_ITOLD = 1; then
8690e634
JK
19034
19035
19036
19037
19038
19039
63ce7108 19040
e26b6bb0 19041
c0c3707f 19042 gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
e26b6bb0 19043
c0c3707f 19044 fi
e26b6bb0
TT
19045
19046
19047
19048
c0c3707f
CB
19049 gl_fnmatch_required_lowercase=`
19050 echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
19051 `
e26b6bb0 19052
c0c3707f
CB
19053 if test $ac_cv_func_fnmatch = no; then
19054 HAVE_FNMATCH=0
19055 else
19056 gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
19057 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
19058$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; }
19059if eval \${$gl_fnmatch_cache_var+:} false; then :
5e8754f9
SDJ
19060 $as_echo_n "(cached) " >&6
19061else
c0c3707f
CB
19062 if test $gl_fnmatch_required = GNU; then
19063 gl_fnmatch_gnu_start=
19064 gl_fnmatch_gnu_end=
19065 else
19066 gl_fnmatch_gnu_start='#if 0'
19067 gl_fnmatch_gnu_end='#endif'
19068 fi
19069 if test "$cross_compiling" = yes; then :
19070 case "$host_os" in
19071 # Guess yes on musl systems.
19072 *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
19073 # Guess no otherwise, even on glibc systems.
19074 *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
19075 esac
e26b6bb0 19076
c0c3707f
CB
19077else
19078 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 19079/* end confdefs.h. */
c0c3707f
CB
19080#include <fnmatch.h>
19081 static int
19082 y (char const *pattern, char const *string, int flags)
19083 {
19084 return fnmatch (pattern, string, flags) == 0;
19085 }
19086 static int
19087 n (char const *pattern, char const *string, int flags)
19088 {
19089 return fnmatch (pattern, string, flags) == FNM_NOMATCH;
19090 }
19091
5e8754f9
SDJ
19092int
19093main ()
19094{
c0c3707f
CB
19095char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
19096 char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
19097 static char const A_1[] = { 'A' - 1, 0 };
19098 static char const A01[] = { 'A' + 1, 0 };
19099 static char const a_1[] = { 'a' - 1, 0 };
19100 static char const a01[] = { 'a' + 1, 0 };
19101 static char const bs_1[] = { '\\\\' - 1, 0 };
19102 static char const bs01[] = { '\\\\' + 1, 0 };
19103 int result = 0;
19104 if (!n ("a*", "", 0))
19105 return 1;
19106 if (!y ("a*", "abc", 0))
19107 return 1;
19108 if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
19109 return 1;
19110 if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
19111 return 2;
19112 if (!y ("a\\\\bc", "abc", 0))
19113 return 3;
19114 if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
19115 return 3;
19116 if (!y ("*x", ".x", 0))
19117 return 4;
19118 if (!n ("*x", ".x", FNM_PERIOD))
19119 return 4;
19120 if (!y (Apat, "\\\\", 0))
19121 return 5;
19122 if (!y (Apat, "A", 0))
19123 return 5;
19124 if (!y (apat, "\\\\", 0))
19125 return 5;
19126 if (!y (apat, "a", 0))
19127 return 5;
19128 if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
19129 return 5;
19130 if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
19131 return 5;
19132 if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
19133 return 5;
19134 if (!(y (apat, a01, 0) == ('a' < '\\\\')))
19135 return 5;
19136 if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
19137 return 5;
19138 if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
19139 return 5;
19140 if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
19141 return 5;
19142 if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
19143 return 5;
19144 $gl_fnmatch_gnu_start
19145 if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
19146 result |= 8;
19147 if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
19148 result |= 16;
19149 if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
19150 result |= 32;
19151 if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
19152 result |= 64;
19153 if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
19154 result |= 64;
19155 if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
19156 result |= 64;
19157 $gl_fnmatch_gnu_end
19158 return result;
19159
5e8754f9
SDJ
19160 ;
19161 return 0;
19162}
19163_ACEOF
c0c3707f
CB
19164if ac_fn_c_try_run "$LINENO"; then :
19165 eval "$gl_fnmatch_cache_var=yes"
5e8754f9 19166else
c0c3707f
CB
19167 eval "$gl_fnmatch_cache_var=no"
19168fi
19169rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19170 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 19171fi
c0c3707f 19172
e26b6bb0 19173
5e8754f9 19174fi
c0c3707f
CB
19175eval ac_res=\$$gl_fnmatch_cache_var
19176 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
19177$as_echo "$ac_res" >&6; }
19178 eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
19179 case "$gl_fnmatch_result" in
19180 *yes) ;;
19181 *) REPLACE_FNMATCH=1 ;;
19182 esac
19183 fi
19184 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
e26b6bb0 19185
e26b6bb0 19186
c0c3707f
CB
19187 FNMATCH_H='fnmatch.h'
19188 if test -n "$FNMATCH_H"; then
19189 GL_GENERATE_FNMATCH_H_TRUE=
19190 GL_GENERATE_FNMATCH_H_FALSE='#'
5e8754f9 19191else
c0c3707f
CB
19192 GL_GENERATE_FNMATCH_H_TRUE='#'
19193 GL_GENERATE_FNMATCH_H_FALSE=
5e8754f9 19194fi
e26b6bb0 19195
18848e28 19196
c0c3707f 19197 fi
18848e28 19198
c0c3707f 19199 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18848e28 19200
18848e28 19201
18848e28 19202
c0c3707f
CB
19203
19204
19205
19206
19207
19208 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19209
19210
19211
19212 ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
19213"
19214if test "x$ac_cv_have_decl_isblank" = xyes; then :
19215 ac_have_decl=1
5e8754f9 19216else
c0c3707f
CB
19217 ac_have_decl=0
19218fi
18848e28 19219
c0c3707f
CB
19220cat >>confdefs.h <<_ACEOF
19221#define HAVE_DECL_ISBLANK $ac_have_decl
5e8754f9 19222_ACEOF
c0c3707f
CB
19223
19224
19225
19226
19227 fi
19228
19229
19230
19231
19232
19233 GNULIB_FNMATCH=1
19234
19235
19236
19237
19238
19239$as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h
19240
19241
19242
19243
19244
19245
19246
19247
19248 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
19249
19250
19251
19252
19253
19254
19255
19256
19257 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19258
19259
19260
19261 ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
19262"
19263if test "x$ac_cv_have_decl_isblank" = xyes; then :
19264 ac_have_decl=1
5e8754f9 19265else
c0c3707f 19266 ac_have_decl=0
5e8754f9 19267fi
18848e28 19268
c0c3707f
CB
19269cat >>confdefs.h <<_ACEOF
19270#define HAVE_DECL_ISBLANK $ac_have_decl
19271_ACEOF
18848e28
GF
19272
19273
19274
18848e28 19275
5e8754f9 19276 fi
18848e28 19277
18848e28 19278
c0c3707f
CB
19279cat >>confdefs.h <<_ACEOF
19280#define GNULIB_FNMATCH_GNU 1
19281_ACEOF
18848e28 19282
18848e28 19283
18848e28 19284
18848e28 19285
c0c3707f
CB
19286 if test $gl_func_frexp != yes; then
19287
19288
18848e28
GF
19289
19290
18848e28 19291
18848e28 19292
18848e28 19293
c0c3707f
CB
19294
19295 gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
18848e28
GF
19296
19297 fi
19298
19299
19300
19301
19302
c0c3707f 19303 GNULIB_FREXP=1
18848e28
GF
19304
19305
19306
19307
19308
c0c3707f 19309$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
18848e28
GF
19310
19311
19312
19313
c0c3707f
CB
19314 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
19315
19316
19317
18848e28
GF
19318
19319
19320
5e8754f9
SDJ
19321
19322
c0c3707f
CB
19323 gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
19324
5e8754f9 19325 fi
18848e28 19326
6a29c58e 19327
6a29c58e 19328
6a29c58e 19329
6ec2e0f5 19330
c0c3707f
CB
19331 GNULIB_FREXPL=1
19332
19333
19334
19335
19336
19337$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
19338
19339
19340
19341
19342
19343
19344
19345 case "$host_os" in
19346 mingw* | solaris*)
19347 REPLACE_FSTAT=1
19348 ;;
19349 esac
472fa5ee
SM
19350
19351
19352
19353
19354
6ec2e0f5
SDJ
19355 if test $ac_cv_func_fchdir = no; then
19356 HAVE_FCHDIR=0
6a29c58e
YQ
19357 fi
19358
6ec2e0f5
SDJ
19359 if test $HAVE_FCHDIR = 0; then
19360 case "$gl_cv_func_open_directory_works" in
19361 *yes) ;;
19362 *)
19363 REPLACE_FSTAT=1
19364 ;;
19365 esac
19366 fi
6a29c58e
YQ
19367
19368
6ec2e0f5 19369 if test $REPLACE_FSTAT = 1; then
6a29c58e 19370
3d99e817
AK
19371
19372
19373
3d99e817
AK
19374
19375
19376
19377
6ec2e0f5 19378 gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
3d99e817 19379
c0c3707f
CB
19380 case "$host_os" in
19381 mingw*)
3d99e817
AK
19382
19383
19384
19385
19386
19387
49e4877c 19388
49e4877c 19389
c0c3707f 19390 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
49e4877c 19391
c0c3707f
CB
19392 ;;
19393 esac
49e4877c
PA
19394
19395
c0c3707f
CB
19396 :
19397
19398 fi
6a29c58e
YQ
19399
19400
88b48903 19401
8690e634 19402
a512b375 19403
c0c3707f
CB
19404 GNULIB_FSTAT=1
19405
19406
19407
19408
19409
19410$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
19411
19412
88b48903 19413
88b48903 19414
472fa5ee
SM
19415
19416
19417
19418
19419
6ec2e0f5
SDJ
19420
19421 if test $ac_cv_func_fstatat = no; then
19422 HAVE_FSTATAT=0
19423 else
19424 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
19425$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
d0ac1c44 19426if ${gl_cv_func_fstatat_zero_flag+:} false; then :
6ec2e0f5
SDJ
19427 $as_echo_n "(cached) " >&6
19428else
19429 if test "$cross_compiling" = yes; then :
19430 case "$host_os" in
19431 aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
19432 *) gl_cv_func_fstatat_zero_flag="guessing yes";;
19433 esac
88b48903 19434
8690e634
JK
19435else
19436 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19437/* end confdefs.h. */
8690e634 19438
6ec2e0f5
SDJ
19439 #include <fcntl.h>
19440 #include <sys/stat.h>
19441 int
19442 main (void)
19443 {
19444 struct stat a;
19445 return fstatat (AT_FDCWD, ".", &a, 0) != 0;
19446 }
19447
88b48903
WN
19448_ACEOF
19449if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 19450 gl_cv_func_fstatat_zero_flag=yes
88b48903 19451else
6ec2e0f5 19452 gl_cv_func_fstatat_zero_flag=no
88b48903
WN
19453fi
19454rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19455 conftest.$ac_objext conftest.beam conftest.$ac_ext
19456fi
19457
19458
19459fi
6ec2e0f5
SDJ
19460{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
19461$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
88b48903 19462
6ec2e0f5
SDJ
19463 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
19464 *yes+*yes) ;;
c0c3707f
CB
19465 *) REPLACE_FSTATAT=1 ;;
19466 esac
19467
19468 case $host_os in
19469 solaris*)
19470 REPLACE_FSTATAT=1 ;;
19471 esac
19472
19473 case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
19474 1,*yes)
88b48903 19475
6ec2e0f5 19476$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
88b48903 19477
7a6dbc2f 19478 ;;
6ec2e0f5
SDJ
19479 esac
19480 fi
88b48903 19481
6ec2e0f5 19482 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
88b48903
WN
19483
19484
19485
19486
19487
88b48903 19488
4a626d0a
PA
19489
19490
6ec2e0f5
SDJ
19491 gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
19492
19493 fi
19494
19495
19496
4a626d0a 19497
6ec2e0f5
SDJ
19498
19499 GNULIB_FSTATAT=1
19500
19501
19502
19503
19504
19505$as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
19506
19507
19508
19509
19510
19511
19512
19513
19514 gl_abort_bug=no
4a626d0a
PA
19515 case "$host_os" in
19516 mingw*)
6ec2e0f5 19517 gl_cv_func_getcwd_path_max=yes
4a626d0a
PA
19518 ;;
19519 *)
88b48903 19520
88b48903 19521
88b48903
WN
19522
19523
88b48903 19524
6ec2e0f5
SDJ
19525 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
19526$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
d0ac1c44 19527if ${gl_cv_func_getcwd_path_max+:} false; then :
6ec2e0f5
SDJ
19528 $as_echo_n "(cached) " >&6
19529else
19530 # Arrange for deletion of the temporary directory this test creates.
19531 ac_clean_files="$ac_clean_files confdir3"
19532 if test "$cross_compiling" = yes; then :
b567ca63 19533 # Cross-compilation guesses:
c0c3707f
CB
19534 case "$host_os" in
19535 aix*) # On AIX, it has the AIX bug.
19536 gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
19537 gnu*) # On Hurd, it is 'yes'.
19538 gl_cv_func_getcwd_path_max='guessing yes' ;;
19539 linux* | kfreebsd*)
19540 # On older Linux+glibc it's 'no, but it is partly working',
19541 # on newer Linux+glibc it's 'yes'.
19542 # On Linux+musl libc, it's 'no, but it is partly working'.
19543 # On kFreeBSD+glibc, it's 'no, but it is partly working'.
19544 gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
19545 *) # If we don't know, obey --enable-cross-guesses.
19546 gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
19547 esac
b567ca63 19548
6ec2e0f5
SDJ
19549else
19550 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19551/* end confdefs.h. */
88b48903 19552
6ec2e0f5
SDJ
19553#include <errno.h>
19554#include <stdlib.h>
19555#if HAVE_UNISTD_H
19556# include <unistd.h>
19557#else
19558# include <direct.h>
19559#endif
19560#include <string.h>
19561#include <limits.h>
19562#include <sys/stat.h>
19563#include <sys/types.h>
19564#include <fcntl.h>
88b48903
WN
19565
19566
6ec2e0f5
SDJ
19567/* Arrange to define PATH_MAX, like "pathmax.h" does. */
19568#if HAVE_UNISTD_H
19569# include <unistd.h>
19570#endif
19571#include <limits.h>
19572#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
19573# include <sys/param.h>
19574#endif
19575#if !defined PATH_MAX && defined MAXPATHLEN
19576# define PATH_MAX MAXPATHLEN
19577#endif
19578#ifdef __hpux
19579# undef PATH_MAX
19580# define PATH_MAX 1024
19581#endif
c0c3707f 19582#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
19583# undef PATH_MAX
19584# define PATH_MAX 260
19585#endif
88b48903 19586
88b48903 19587
6ec2e0f5
SDJ
19588#ifndef AT_FDCWD
19589# define AT_FDCWD 0
19590#endif
19591#ifdef ENAMETOOLONG
19592# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
19593#else
19594# define is_ENAMETOOLONG(x) 0
19595#endif
88b48903 19596
6ec2e0f5
SDJ
19597/* Use the getcwd function, not any macro. */
19598#undef getcwd
88b48903 19599
6ec2e0f5
SDJ
19600/* Don't get link errors because mkdir is redefined to rpl_mkdir. */
19601#undef mkdir
88b48903 19602
6ec2e0f5
SDJ
19603#ifndef S_IRWXU
19604# define S_IRWXU 0700
19605#endif
88b48903 19606
6ec2e0f5
SDJ
19607/* The length of this name must be 8. */
19608#define DIR_NAME "confdir3"
19609#define DIR_NAME_LEN 8
19610#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
88b48903 19611
6ec2e0f5
SDJ
19612/* The length of "../". */
19613#define DOTDOTSLASH_LEN 3
88b48903 19614
6ec2e0f5
SDJ
19615/* Leftover bytes in the buffer, to work around library or OS bugs. */
19616#define BUF_SLOP 20
88b48903 19617
6ec2e0f5
SDJ
19618int
19619main ()
19620{
19621#ifndef PATH_MAX
19622 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
19623 at least not on a local file system. And if we were to start worrying
19624 about remote file systems, we'd have to enable the wrapper function
19625 all of the time, just to be safe. That's not worth the cost. */
19626 exit (0);
19627#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
19628 - DIR_NAME_SIZE - BUF_SLOP) \
19629 <= PATH_MAX)
19630 /* FIXME: Assuming there's a system for which this is true,
19631 this should be done in a compile test. */
19632 exit (0);
19633#else
19634 char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
19635 + DIR_NAME_SIZE + BUF_SLOP];
19636 char *cwd = getcwd (buf, PATH_MAX);
19637 size_t initial_cwd_len;
19638 size_t cwd_len;
19639 int fail = 0;
19640 size_t n_chdirs = 0;
88b48903 19641
6ec2e0f5
SDJ
19642 if (cwd == NULL)
19643 exit (10);
88b48903 19644
6ec2e0f5 19645 cwd_len = initial_cwd_len = strlen (cwd);
88b48903 19646
6ec2e0f5
SDJ
19647 while (1)
19648 {
19649 size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
19650 char *c = NULL;
19651
19652 cwd_len += DIR_NAME_SIZE;
19653 /* If mkdir or chdir fails, it could be that this system cannot create
19654 any file with an absolute name longer than PATH_MAX, such as cygwin.
19655 If so, leave fail as 0, because the current working directory can't
c0c3707f
CB
19656 be too long for getcwd if it can't even be created. On Linux with
19657 the 9p file system, mkdir fails with error EINVAL when cwd_len gets
19658 too long; ignore this failure because the getcwd() system call
19659 produces good results whereas the gnulib substitute calls getdents64
19660 which fails with error EPROTO.
19661 For other errors, be pessimistic and consider that as a failure,
19662 too. */
6ec2e0f5
SDJ
19663 if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
19664 {
19665 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
c0c3707f
CB
19666 #ifdef __linux__
19667 if (! (errno == EINVAL))
19668 #endif
19669 fail = 20;
6ec2e0f5
SDJ
19670 break;
19671 }
88b48903 19672
6ec2e0f5
SDJ
19673 if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
19674 {
19675 struct stat sb;
88b48903 19676
6ec2e0f5
SDJ
19677 c = getcwd (buf, PATH_MAX);
19678 if (!c && errno == ENOENT)
19679 {
19680 fail = 11;
19681 break;
19682 }
19683 if (c)
19684 {
19685 fail = 31;
19686 break;
19687 }
19688 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
19689 {
19690 fail = 21;
19691 break;
19692 }
88b48903 19693
6ec2e0f5
SDJ
19694 /* Our replacement needs to be able to stat() long ../../paths,
19695 so generate a path larger than PATH_MAX to check,
19696 avoiding the replacement if we can't stat(). */
19697 c = getcwd (buf, cwd_len + 1);
19698 if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
19699 {
19700 fail = 32;
19701 break;
19702 }
19703 }
88b48903 19704
6ec2e0f5
SDJ
19705 if (dotdot_max <= cwd_len - initial_cwd_len)
19706 {
19707 if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
19708 break;
19709 c = getcwd (buf, cwd_len + 1);
19710 if (!c)
19711 {
19712 if (! (errno == ERANGE || errno == ENOENT
19713 || is_ENAMETOOLONG (errno)))
19714 {
19715 fail = 22;
19716 break;
19717 }
19718 if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
19719 {
19720 fail = 12;
19721 break;
19722 }
19723 }
19724 }
88b48903 19725
6ec2e0f5
SDJ
19726 if (c && strlen (c) != cwd_len)
19727 {
19728 fail = 23;
19729 break;
19730 }
19731 ++n_chdirs;
19732 }
88b48903 19733
6ec2e0f5
SDJ
19734 /* Leaving behind such a deep directory is not polite.
19735 So clean up here, right away, even though the driving
19736 shell script would also clean up. */
19737 {
19738 size_t i;
88b48903 19739
6ec2e0f5
SDJ
19740 /* Try rmdir first, in case the chdir failed. */
19741 rmdir (DIR_NAME);
19742 for (i = 0; i <= n_chdirs; i++)
19743 {
19744 if (chdir ("..") < 0)
19745 break;
19746 if (rmdir (DIR_NAME) != 0)
19747 break;
19748 }
19749 }
88b48903 19750
6ec2e0f5
SDJ
19751 exit (fail);
19752#endif
19753}
88b48903 19754
6ec2e0f5
SDJ
19755_ACEOF
19756if ac_fn_c_try_run "$LINENO"; then :
19757 gl_cv_func_getcwd_path_max=yes
19758else
19759 case $? in
c0c3707f
CB
19760 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
19761 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
19762 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
19763 *) gl_cv_func_getcwd_path_max=no;;
19764 esac
6ec2e0f5
SDJ
19765fi
19766rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19767 conftest.$ac_objext conftest.beam conftest.$ac_ext
19768fi
88b48903 19769
88b48903 19770
6ec2e0f5
SDJ
19771fi
19772{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
19773$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
88b48903 19774
6ec2e0f5
SDJ
19775 case "$gl_cv_func_getcwd_null" in
19776 *yes)
88b48903
WN
19777
19778
472fa5ee
SM
19779
19780
19781
472fa5ee 19782
c0c3707f
CB
19783 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
19784$as_echo_n "checking for getpagesize... " >&6; }
19785if ${gl_cv_func_getpagesize+:} false; then :
19786 $as_echo_n "(cached) " >&6
19787else
19788 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19789/* end confdefs.h. */
19790#include <unistd.h>
19791int
19792main ()
19793{
19794return getpagesize();
19795 ;
19796 return 0;
19797}
472fa5ee 19798
c0c3707f
CB
19799_ACEOF
19800if ac_fn_c_try_link "$LINENO"; then :
19801 gl_cv_func_getpagesize=yes
19802else
19803 gl_cv_func_getpagesize=no
19804fi
19805rm -f core conftest.err conftest.$ac_objext \
19806 conftest$ac_exeext conftest.$ac_ext
472fa5ee 19807
c0c3707f
CB
19808fi
19809{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
19810$as_echo "$gl_cv_func_getpagesize" >&6; }
88b48903 19811
c0c3707f 19812 if test $gl_cv_func_getpagesize = yes; then
88b48903 19813
c0c3707f 19814cat >>confdefs.h <<_ACEOF
7a6dbc2f
SDJ
19815#define HAVE_GETPAGESIZE 1
19816_ACEOF
19817
c0c3707f 19818 fi
6ec2e0f5
SDJ
19819
19820 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5
19821$as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; }
d0ac1c44 19822if ${gl_cv_func_getcwd_abort_bug+:} false; then :
88b48903
WN
19823 $as_echo_n "(cached) " >&6
19824else
6ec2e0f5
SDJ
19825 # Remove any remnants of a previous test.
19826 rm -rf confdir-14B---
19827 # Arrange for deletion of the temporary directory this test creates.
19828 ac_clean_files="$ac_clean_files confdir-14B---"
19829 if test "$cross_compiling" = yes; then :
c0c3707f
CB
19830 case "$host_os" in
19831 # Guess no on musl systems.
19832 *-musl*) gl_cv_func_getcwd_abort_bug="guessing no" ;;
19833 # Guess yes otherwise, even on glibc systems.
19834 *) gl_cv_func_getcwd_abort_bug="guessing yes"
19835 esac
19836
88b48903
WN
19837else
19838 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19839/* end confdefs.h. */
6ec2e0f5
SDJ
19840
19841#include <errno.h>
19842#include <stdlib.h>
19843#if HAVE_UNISTD_H
19844# include <unistd.h>
19845#else /* on Windows with MSVC */
19846# include <direct.h>
19847#endif
19848#include <string.h>
19849#include <sys/stat.h>
19850
19851
19852/* Arrange to define PATH_MAX, like "pathmax.h" does. */
19853#if HAVE_UNISTD_H
19854# include <unistd.h>
19855#endif
19856#include <limits.h>
19857#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
19858# include <sys/param.h>
19859#endif
19860#if !defined PATH_MAX && defined MAXPATHLEN
19861# define PATH_MAX MAXPATHLEN
19862#endif
19863#ifdef __hpux
19864# undef PATH_MAX
19865# define PATH_MAX 1024
19866#endif
c0c3707f 19867#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
19868# undef PATH_MAX
19869# define PATH_MAX 260
19870#endif
19871
19872
19873/* Don't get link errors because mkdir is redefined to rpl_mkdir. */
19874#undef mkdir
19875
19876#ifndef S_IRWXU
19877# define S_IRWXU 0700
19878#endif
19879
19880/* FIXME: skip the run-test altogether on systems without getpagesize. */
19881#if ! HAVE_GETPAGESIZE
19882# define getpagesize() 0
19883#endif
19884
19885/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
19886 the 16kB pagesize on ia64 linux. Those conditions make the code below
19887 trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
19888#define TARGET_LEN (5 * 1024)
88b48903
WN
19889
19890int
19891main ()
19892{
6ec2e0f5
SDJ
19893 char *cwd;
19894 size_t initial_cwd_len;
19895 int fail = 0;
19896
19897 /* The bug is triggered when PATH_MAX < getpagesize (), so skip
19898 this relatively expensive and invasive test if that's not true. */
19899#ifdef PATH_MAX
19900 int bug_possible = PATH_MAX < getpagesize ();
19901#else
19902 int bug_possible = 0;
19903#endif
19904 if (! bug_possible)
19905 return 0;
8690e634 19906
6ec2e0f5
SDJ
19907 cwd = getcwd (NULL, 0);
19908 if (cwd == NULL)
19909 return 2;
19910
19911 initial_cwd_len = strlen (cwd);
19912 free (cwd);
19913
19914 if (1)
19915 {
19916 static char const dir_name[] = "confdir-14B---";
19917 size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
19918 / sizeof dir_name);
19919 size_t d;
19920 for (d = 0; d < desired_depth; d++)
19921 {
19922 if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
19923 {
19924 if (! (errno == ERANGE || errno == ENAMETOOLONG
19925 || errno == ENOENT))
19926 fail = 3; /* Unable to construct deep hierarchy. */
19927 break;
19928 }
19929 }
19930
19931 /* If libc has the bug in question, this invocation of getcwd
19932 results in a failed assertion. */
19933 cwd = getcwd (NULL, 0);
19934 if (cwd == NULL)
19935 fail = 4; /* getcwd didn't assert, but it failed for a long name
19936 where the answer could have been learned. */
19937 free (cwd);
19938
19939 /* Call rmdir first, in case the above chdir failed. */
19940 rmdir (dir_name);
19941 while (0 < d--)
19942 {
19943 if (chdir ("..") < 0)
19944 {
19945 fail = 5;
19946 break;
19947 }
19948 rmdir (dir_name);
19949 }
19950 }
19951
19952 return fail;
8690e634 19953}
6ec2e0f5 19954
8690e634
JK
19955_ACEOF
19956if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 19957 gl_cv_func_getcwd_abort_bug=no
8690e634 19958else
c0c3707f
CB
19959 ret=$?
19960 if test $ret -ge 128 || test $ret = 4; then
19961 gl_cv_func_getcwd_abort_bug=yes
19962 else
19963 gl_cv_func_getcwd_abort_bug=no
19964 fi
19965
8690e634
JK
19966fi
19967rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19968 conftest.$ac_objext conftest.beam conftest.$ac_ext
19969fi
19970
19971
19972fi
6ec2e0f5
SDJ
19973{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_abort_bug" >&5
19974$as_echo "$gl_cv_func_getcwd_abort_bug" >&6; }
c0c3707f
CB
19975 case "$gl_cv_func_getcwd_abort_bug" in
19976 *yes)
19977 gl_abort_bug=yes
19978 ;;
19979 *)
19980
19981 ;;
19982 esac
6ec2e0f5
SDJ
19983
19984 ;;
19985 esac
19986 ;;
19987 esac
19988 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 19989 *"no" | *"no, it has the AIX bug") ;;
6ec2e0f5
SDJ
19990 *)
19991
19992$as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
19993
19994 ;;
19995 esac
19996 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 19997 *"no, but it is partly working")
6ec2e0f5
SDJ
19998
19999$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
20000
20001 ;;
c0c3707f 20002 *"yes, but with shorter paths")
6ec2e0f5
SDJ
20003
20004$as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
20005
20006 ;;
20007 esac
20008
20009 if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
20010 || test $gl_cv_func_getcwd_posix_signature != yes \
20011 || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
20012 || test $gl_abort_bug = yes; then
20013 REPLACE_GETCWD=1
8690e634
JK
20014 fi
20015
6ec2e0f5 20016 if test $REPLACE_GETCWD = 1; then
8690e634
JK
20017
20018
8690e634
JK
20019
20020
20021
20022
20023
20024
6ec2e0f5 20025 gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
8690e634
JK
20026
20027
8690e634
JK
20028
20029
6ec2e0f5
SDJ
20030 :
20031
20032 fi
20033
8690e634
JK
20034
20035cat >>confdefs.h <<_ACEOF
6ec2e0f5 20036#define GNULIB_GETCWD 1
8690e634
JK
20037_ACEOF
20038
20039
8690e634 20040
8690e634
JK
20041
20042
c971b7fa 20043
c971b7fa 20044
6ec2e0f5
SDJ
20045 GNULIB_GETCWD=1
20046
20047
20048
20049
20050
20051$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
20052
c971b7fa 20053
c971b7fa 20054
c971b7fa 20055
c971b7fa 20056
c971b7fa 20057
c971b7fa 20058
c971b7fa 20059
6ec2e0f5
SDJ
20060 case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
20061 *yes,yes) ;;
20062 *)
20063 REPLACE_GETCWD=1
20064 ;;
20065 esac
c971b7fa 20066
6ec2e0f5 20067 if test $REPLACE_GETCWD = 1; then
c971b7fa 20068
c971b7fa
PA
20069
20070
c971b7fa
PA
20071
20072
c971b7fa 20073
c971b7fa 20074
c971b7fa 20075
6ec2e0f5 20076 gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
c971b7fa 20077
6ec2e0f5 20078 fi
c971b7fa 20079
c971b7fa 20080
c971b7fa 20081
c971b7fa 20082
8690e634 20083
6ec2e0f5 20084 GNULIB_GETCWD=1
c971b7fa 20085
88b48903
WN
20086
20087
20088
88b48903 20089
6ec2e0f5 20090$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
88b48903 20091
88b48903
WN
20092
20093
20094
6ec2e0f5
SDJ
20095
20096
20097
20098
20099 if test $ac_cv_func_getdtablesize = yes &&
20100 test $ac_cv_have_decl_getdtablesize = yes; then
6ec2e0f5
SDJ
20101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
20102$as_echo_n "checking whether getdtablesize works... " >&6; }
d0ac1c44 20103if ${gl_cv_func_getdtablesize_works+:} false; then :
88b48903
WN
20104 $as_echo_n "(cached) " >&6
20105else
c0c3707f
CB
20106 case "$host_os" in
20107 vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
20108 *)
20109 if test "$cross_compiling" = yes; then :
88b48903 20110 case "$host_os" in
c0c3707f
CB
20111 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
20112 gl_cv_func_getdtablesize_works="guessing no" ;;
20113 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
20114 esac
20115
88b48903
WN
20116else
20117 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20118/* end confdefs.h. */
20119
c0c3707f 20120 #include <unistd.h>
6ec2e0f5
SDJ
20121int
20122main ()
88b48903 20123{
6ec2e0f5 20124int size = getdtablesize();
c0c3707f
CB
20125 if (dup2 (0, getdtablesize()) != -1)
20126 return 1;
20127 if (size != getdtablesize())
20128 return 2;
6ec2e0f5
SDJ
20129
20130 ;
20131 return 0;
88b48903
WN
20132}
20133_ACEOF
20134if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20135 gl_cv_func_getdtablesize_works=yes
88b48903 20136else
6ec2e0f5 20137 gl_cv_func_getdtablesize_works=no
88b48903
WN
20138fi
20139rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20140 conftest.$ac_objext conftest.beam conftest.$ac_ext
20141fi
20142
c0c3707f
CB
20143 ;;
20144 esac
88b48903
WN
20145
20146fi
6ec2e0f5
SDJ
20147{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
20148$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
20149 case "$gl_cv_func_getdtablesize_works" in
c0c3707f 20150 *yes | "no (limitation)") ;;
6ec2e0f5 20151 *) REPLACE_GETDTABLESIZE=1 ;;
88b48903
WN
20152 esac
20153 else
6ec2e0f5 20154 HAVE_GETDTABLESIZE=0
88b48903
WN
20155 fi
20156
6ec2e0f5 20157 if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
88b48903
WN
20158
20159
20160
20161
20162
20163
20164
20165
6ec2e0f5 20166 gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
88b48903 20167
6ec2e0f5 20168 :
88b48903
WN
20169 fi
20170
20171
20172
20173
20174
6ec2e0f5 20175 GNULIB_GETDTABLESIZE=1
88b48903
WN
20176
20177
20178
88b48903 20179
88b48903 20180
6ec2e0f5 20181$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
88b48903 20182
88b48903 20183
88b48903 20184
88b48903 20185
88b48903 20186
88b48903 20187
88b48903 20188
88b48903
WN
20189
20190
6ec2e0f5
SDJ
20191 if test $ac_cv_have_decl_getlogin_r = no; then
20192 HAVE_DECL_GETLOGIN_R=0
20193 fi
88b48903 20194
88b48903 20195
6ec2e0f5
SDJ
20196 if test $ac_cv_func_getlogin_r = no; then
20197 HAVE_GETLOGIN_R=0
20198 else
20199 HAVE_GETLOGIN_R=1
20200
20201 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5
20202$as_echo_n "checking whether getlogin_r works with small buffers... " >&6; }
d0ac1c44 20203if ${gl_cv_func_getlogin_r_works+:} false; then :
6ec2e0f5
SDJ
20204 $as_echo_n "(cached) " >&6
20205else
88b48903 20206
6ec2e0f5 20207 case "$host_os" in
c0c3707f
CB
20208 # Guess no on Mac OS X, OSF/1.
20209 darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;;
20210 # Guess yes otherwise.
20211 *) gl_cv_func_getlogin_r_works="guessing yes" ;;
6ec2e0f5
SDJ
20212 esac
20213 if test "$cross_compiling" = yes; then :
20214 :
88b48903
WN
20215else
20216 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20217/* end confdefs.h. */
20218
6ec2e0f5 20219#include <stddef.h>
c0c3707f 20220#include <string.h>
6ec2e0f5
SDJ
20221#include <unistd.h>
20222#if !HAVE_DECL_GETLOGIN_R
88b48903 20223extern
6ec2e0f5 20224# ifdef __cplusplus
88b48903 20225"C"
6ec2e0f5
SDJ
20226# endif
20227int getlogin_r (char *, size_t);
88b48903 20228#endif
6ec2e0f5
SDJ
20229int
20230main (void)
88b48903
WN
20231{
20232 int result = 0;
6ec2e0f5
SDJ
20233 char buf[100];
20234
20235 if (getlogin_r (buf, 0) == 0)
c0c3707f 20236 result |= 1;
6ec2e0f5 20237 if (getlogin_r (buf, 1) == 0)
c0c3707f
CB
20238 result |= 2;
20239 if (getlogin_r (buf, 100) == 0)
20240 {
20241 size_t n = strlen (buf);
20242 if (getlogin_r (buf, n) == 0)
20243 result |= 4;
20244 }
88b48903
WN
20245 return result;
20246}
20247_ACEOF
20248if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20249 gl_cv_func_getlogin_r_works=yes
88b48903 20250else
c0c3707f 20251 gl_cv_func_getlogin_r_works=no
88b48903
WN
20252fi
20253rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20254 conftest.$ac_objext conftest.beam conftest.$ac_ext
20255fi
20256
20257
4a626d0a 20258fi
6ec2e0f5
SDJ
20259{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5
20260$as_echo "$gl_cv_func_getlogin_r_works" >&6; }
20261 case "$gl_cv_func_getlogin_r_works" in
20262 *yes) ;;
20263 *) REPLACE_GETLOGIN_R=1 ;;
20264 esac
20265 fi
20266
20267 if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then
20268
20269
20270
20271
20272
20273
20274
20275
20276 gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext"
4a626d0a 20277
4a626d0a 20278
4a626d0a 20279
4a626d0a 20280
4a626d0a
PA
20281 fi
20282
20283
4a626d0a
PA
20284
20285
20286
6ec2e0f5 20287 GNULIB_GETLOGIN_R=1
4a626d0a
PA
20288
20289
20290
20291
20292
6ec2e0f5 20293$as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h
4a626d0a 20294
4a626d0a
PA
20295
20296
20297
20298
472fa5ee 20299
4a626d0a 20300
6ec2e0f5
SDJ
20301 ac_found=0
20302 ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
20303"
d0ac1c44 20304if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
6ec2e0f5
SDJ
20305 ac_have_decl=1
20306else
20307 ac_have_decl=0
20308fi
20309
20310cat >>confdefs.h <<_ACEOF
20311#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
20312_ACEOF
20313if test $ac_have_decl = 1; then :
20314 ac_found=1
20315fi
20316
20317 ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
20318"
d0ac1c44 20319if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
6ec2e0f5
SDJ
20320 ac_have_decl=1
20321else
20322 ac_have_decl=0
20323fi
20324
20325cat >>confdefs.h <<_ACEOF
20326#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
20327_ACEOF
20328if test $ac_have_decl = 1; then :
20329 ac_found=1
20330fi
4a626d0a 20331
6ec2e0f5
SDJ
20332 ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
20333"
d0ac1c44 20334if test "x$ac_cv_have_decl___argv" = xyes; then :
6ec2e0f5
SDJ
20335 ac_have_decl=1
20336else
20337 ac_have_decl=0
20338fi
4a626d0a 20339
6ec2e0f5
SDJ
20340cat >>confdefs.h <<_ACEOF
20341#define HAVE_DECL___ARGV $ac_have_decl
20342_ACEOF
20343if test $ac_have_decl = 1; then :
20344 ac_found=1
20345fi
4a626d0a
PA
20346
20347
6ec2e0f5
SDJ
20348 # Incur the cost of this test only if none of the above worked.
20349 if test $ac_found = 0; then
20350 # On OpenBSD 5.1, using the global __progname variable appears to be
20351 # the only way to implement getprogname.
20352 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
20353$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
d0ac1c44 20354if ${gl_cv_var___progname+:} false; then :
6ec2e0f5
SDJ
20355 $as_echo_n "(cached) " >&6
20356else
4a626d0a 20357
6ec2e0f5
SDJ
20358 gl_cv_var___progname=
20359 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20360/* end confdefs.h. */
20361extern char *__progname;
20362int
20363main ()
20364{
20365return *__progname;
20366
20367 ;
20368 return 0;
20369}
20370_ACEOF
20371if ac_fn_c_try_link "$LINENO"; then :
20372 gl_cv_var___progname=yes
20373
20374fi
20375rm -f core conftest.err conftest.$ac_objext \
20376 conftest$ac_exeext conftest.$ac_ext
20377
20378
20379fi
20380{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
20381$as_echo "$gl_cv_var___progname" >&6; }
20382 if test "$gl_cv_var___progname" = yes; then
20383
20384$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
20385
20386 fi
20387 fi
4a626d0a
PA
20388
20389
20390
20391
20392
20393
20394
20395
472fa5ee 20396
4a626d0a
PA
20397
20398 gl_gettimeofday_timezone=void
20399 if test $ac_cv_func_gettimeofday != yes; then
20400 HAVE_GETTIMEOFDAY=0
20401 else
20402
20403
20404
c0c3707f 20405
4a626d0a
PA
20406 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
20407$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
d0ac1c44 20408if ${gl_cv_func_gettimeofday_clobber+:} false; then :
4a626d0a
PA
20409 $as_echo_n "(cached) " >&6
20410else
20411 if test "$cross_compiling" = yes; then :
20412 # When cross-compiling:
20413 case "$host_os" in
c0c3707f
CB
20414 # Guess all is fine on glibc systems.
20415 *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
20416 # Guess all is fine on musl systems.
20417 *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
20418 # Guess no on native Windows.
20419 mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
20420 # If we don't know, obey --enable-cross-guesses.
20421 *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;;
4a626d0a
PA
20422 esac
20423
20424else
20425 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20426/* end confdefs.h. */
20427#include <string.h>
20428 #include <sys/time.h>
20429 #include <time.h>
20430 #include <stdlib.h>
20431
20432int
20433main ()
20434{
20435
20436 time_t t = 0;
20437 struct tm *lt;
20438 struct tm saved_lt;
20439 struct timeval tv;
20440 lt = localtime (&t);
20441 saved_lt = *lt;
20442 gettimeofday (&tv, NULL);
20443 return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
20444
20445 ;
20446 return 0;
20447}
20448_ACEOF
20449if ac_fn_c_try_run "$LINENO"; then :
20450 gl_cv_func_gettimeofday_clobber=no
20451else
20452 gl_cv_func_gettimeofday_clobber=yes
20453fi
20454rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20455 conftest.$ac_objext conftest.beam conftest.$ac_ext
20456fi
20457
20458fi
20459{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
20460$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
20461
20462 case "$gl_cv_func_gettimeofday_clobber" in
20463 *yes)
20464 REPLACE_GETTIMEOFDAY=1
20465
c0c3707f 20466$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
4a626d0a 20467
5e8754f9 20468
c0c3707f
CB
20469
20470
20471 NEED_LOCALTIME_BUFFER=1
20472 REPLACE_GMTIME=1
20473 REPLACE_LOCALTIME=1
5e8754f9 20474
4a626d0a
PA
20475 ;;
20476 esac
20477
20478 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
20479$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
d0ac1c44 20480if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
4a626d0a
PA
20481 $as_echo_n "(cached) " >&6
20482else
20483 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20484/* end confdefs.h. */
20485#include <sys/time.h>
20486 struct timeval c;
20487 int gettimeofday (struct timeval *restrict, void *restrict);
20488
20489int
20490main ()
20491{
20492/* glibc uses struct timezone * rather than the POSIX void *
20493 if _GNU_SOURCE is defined. However, since the only portable
20494 use of gettimeofday uses NULL as the second parameter, and
20495 since the glibc definition is actually more typesafe, it is
20496 not worth wrapping this to get a compliant signature. */
20497 int (*f) (struct timeval *restrict, void *restrict)
20498 = gettimeofday;
20499 int x = f (&c, 0);
20500 return !(x | c.tv_sec | c.tv_usec);
20501
20502 ;
20503 return 0;
20504}
20505_ACEOF
20506if ac_fn_c_try_compile "$LINENO"; then :
20507 gl_cv_func_gettimeofday_posix_signature=yes
20508else
20509 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20510/* end confdefs.h. */
20511#include <sys/time.h>
20512int gettimeofday (struct timeval *restrict, struct timezone *restrict);
20513
20514int
20515main ()
20516{
20517
20518 ;
20519 return 0;
20520}
20521_ACEOF
20522if ac_fn_c_try_compile "$LINENO"; then :
20523 gl_cv_func_gettimeofday_posix_signature=almost
20524else
20525 gl_cv_func_gettimeofday_posix_signature=no
20526fi
20527rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20528fi
20529rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20530fi
20531{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
20532$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
20533 if test $gl_cv_func_gettimeofday_posix_signature = almost; then
20534 gl_gettimeofday_timezone='struct timezone'
20535 elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
20536 REPLACE_GETTIMEOFDAY=1
20537 fi
20538 if test $REPLACE_STRUCT_TIMEVAL = 1; then
20539 REPLACE_GETTIMEOFDAY=1
20540 fi
c0c3707f
CB
20541 case "$host_os" in
20542 mingw*) REPLACE_GETTIMEOFDAY=1 ;;
20543 esac
4a626d0a
PA
20544 fi
20545
20546cat >>confdefs.h <<_ACEOF
c0c3707f
CB
20547#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
20548_ACEOF
88b48903
WN
20549
20550
c0c3707f 20551 if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
88b48903 20552
6ec2e0f5 20553
6ec2e0f5 20554
6ec2e0f5 20555
6ec2e0f5 20556
6ec2e0f5
SDJ
20557
20558
6ec2e0f5 20559
c0c3707f 20560 gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
6ec2e0f5 20561
c0c3707f 20562 :
5e8754f9 20563 fi
6ec2e0f5
SDJ
20564
20565
20566
6ec2e0f5
SDJ
20567
20568
5e8754f9 20569 GNULIB_GETTIMEOFDAY=1
6ec2e0f5
SDJ
20570
20571
20572
7a6dbc2f
SDJ
20573
20574
5e8754f9 20575$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
6ec2e0f5
SDJ
20576
20577
20578
6ec2e0f5 20579
6ec2e0f5 20580
6ec2e0f5
SDJ
20581
20582
c0c3707f
CB
20583 if test $ac_cv_func_glob = no; then
20584 HAVE_GLOB=0
20585 else
20586
20587 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5
20588$as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; }
20589if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then :
6ec2e0f5
SDJ
20590 $as_echo_n "(cached) " >&6
20591else
20592 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20593/* end confdefs.h. */
20594#include <gnu-versions.h>
c0c3707f 20595char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];
6ec2e0f5
SDJ
20596_ACEOF
20597if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 20598 gl_cv_gnu_glob_interface_version_1_2=yes
6ec2e0f5 20599else
c0c3707f 20600 gl_cv_gnu_glob_interface_version_1_2=no
6ec2e0f5
SDJ
20601fi
20602rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20603fi
c0c3707f
CB
20604{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5
20605$as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; }
20606 if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then
20607 REPLACE_GLOB=1
6ec2e0f5 20608 fi
6ec2e0f5 20609
c0c3707f
CB
20610 if test $REPLACE_GLOB = 0; then
20611 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5
6ec2e0f5 20612$as_echo_n "checking whether glob lists broken symlinks... " >&6; }
d0ac1c44 20613if ${gl_cv_glob_lists_symlinks+:} false; then :
6ec2e0f5
SDJ
20614 $as_echo_n "(cached) " >&6
20615else
c0c3707f
CB
20616 if test $cross_compiling != yes; then
20617 if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
20618 gl_cv_glob_lists_symlinks=maybe
20619 else
20620 # If we can't make a symlink, then we cannot test this issue. Be
20621 # pessimistic about this.
20622 gl_cv_glob_lists_symlinks=no
20623 fi
20624 if test $gl_cv_glob_lists_symlinks = maybe; then
20625 if test "$cross_compiling" = yes; then :
20626 :
5e8754f9 20627
6ec2e0f5
SDJ
20628else
20629 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20630/* end confdefs.h. */
6ec2e0f5 20631#include <stddef.h>
c0c3707f 20632 #include <glob.h>
6ec2e0f5
SDJ
20633int
20634main ()
20635{
20636glob_t found;
c0c3707f
CB
20637 if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
20638 return 1;
20639
6ec2e0f5
SDJ
20640 ;
20641 return 0;
20642}
4a626d0a 20643_ACEOF
6ec2e0f5
SDJ
20644if ac_fn_c_try_run "$LINENO"; then :
20645 gl_cv_glob_lists_symlinks=yes
20646else
20647 gl_cv_glob_lists_symlinks=no
20648fi
20649rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20650 conftest.$ac_objext conftest.beam conftest.$ac_ext
20651fi
88b48903 20652
c0c3707f
CB
20653 fi
20654 rm -f conf$$-globtest
20655 else
20656 gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
20657 fi
20658
4a626d0a 20659fi
6ec2e0f5
SDJ
20660{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5
20661$as_echo "$gl_cv_glob_lists_symlinks" >&6; }
c0c3707f
CB
20662 case "$gl_cv_glob_lists_symlinks" in
20663 *yes) ;;
20664 *) REPLACE_GLOB=1 ;;
20665 esac
20666 fi
20667
20668 fi
88b48903 20669
c0c3707f
CB
20670 if test $ac_cv_func_glob_pattern_p = no; then
20671 HAVE_GLOB_PATTERN_P=0
20672 else
20673 if test $REPLACE_GLOB = 1; then
20674 REPLACE_GLOB_PATTERN_P=1
6ec2e0f5
SDJ
20675 fi
20676 fi
4a626d0a 20677
c0c3707f 20678 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
4a626d0a 20679
88b48903 20680
c0c3707f 20681 GLOB_H='glob.h'
6ec2e0f5
SDJ
20682 if test -n "$GLOB_H"; then
20683 GL_GENERATE_GLOB_H_TRUE=
20684 GL_GENERATE_GLOB_H_FALSE='#'
20685else
20686 GL_GENERATE_GLOB_H_TRUE='#'
20687 GL_GENERATE_GLOB_H_FALSE=
20688fi
88b48903 20689
88b48903 20690
c0c3707f
CB
20691 fi
20692
20693 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
472fa5ee
SM
20694
20695
20696
20697
20698
20699
20700
20701
20702 gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext"
20703
20704
20705
7a6dbc2f
SDJ
20706
20707
20708
472fa5ee 20709
472fa5ee 20710
88b48903 20711
c0c3707f 20712 gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext"
88b48903
WN
20713
20714
20715
725e2999
JB
20716
20717
20718
c0c3707f
CB
20719 fi
20720 if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then
20721
725e2999
JB
20722
20723
20724
20725
20726
20727
20728
c0c3707f 20729 gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext"
725e2999
JB
20730
20731 fi
20732
725e2999
JB
20733
20734
20735
20736
c0c3707f
CB
20737 GNULIB_GLOB=1
20738
20739
20740
20741
20742
20743$as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h
20744
20745
725e2999
JB
20746
20747
20748
5df4cba6
SM
20749 LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
20750
20751
725e2999 20752
725e2999
JB
20753
20754
20755
20756
725e2999 20757
c0c3707f
CB
20758 HAVE_INET_NTOP=1
20759 INET_NTOP_LIB=
725e2999
JB
20760
20761
20762
20763
20764 if test $ac_cv_header_sys_socket_h != yes; then
20765 for ac_header in winsock2.h
20766do :
20767 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
20768if test "x$ac_cv_header_winsock2_h" = xyes; then :
20769 cat >>confdefs.h <<_ACEOF
20770#define HAVE_WINSOCK2_H 1
20771_ACEOF
20772
20773fi
20774
20775done
20776
20777 fi
20778 if test "$ac_cv_header_winsock2_h" = yes; then
20779 HAVE_WINSOCK2_H=1
20780 UNISTD_H_HAVE_WINSOCK2_H=1
20781 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
20782 else
20783 HAVE_WINSOCK2_H=0
20784 fi
20785
20786
20787 if test $HAVE_WINSOCK2_H = 1; then
c0c3707f 20788 REPLACE_INET_NTOP=1
725e2999
JB
20789 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
20790"
20791if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
20792 ac_have_decl=1
20793else
20794 ac_have_decl=0
20795fi
20796
20797cat >>confdefs.h <<_ACEOF
20798#define HAVE_DECL_INET_NTOP $ac_have_decl
20799_ACEOF
20800
20801 if test $ac_cv_have_decl_inet_ntop = yes; then
725e2999
JB
20802 INET_NTOP_LIB="-lws2_32"
20803 else
20804 HAVE_DECL_INET_NTOP=0
725e2999
JB
20805 fi
20806 else
20807 gl_save_LIBS=$LIBS
20808 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
20809$as_echo_n "checking for library containing inet_ntop... " >&6; }
20810if ${ac_cv_search_inet_ntop+:} false; then :
20811 $as_echo_n "(cached) " >&6
20812else
20813 ac_func_search_save_LIBS=$LIBS
20814cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20815/* end confdefs.h. */
20816
20817/* Override any GCC internal prototype to avoid an error.
20818 Use char because int might match the return type of a GCC
20819 builtin and then its argument prototype would still apply. */
20820#ifdef __cplusplus
20821extern "C"
20822#endif
20823char inet_ntop ();
20824int
20825main ()
20826{
20827return inet_ntop ();
20828 ;
20829 return 0;
20830}
20831_ACEOF
c0c3707f 20832for ac_lib in '' nsl resolv network; do
725e2999
JB
20833 if test -z "$ac_lib"; then
20834 ac_res="none required"
20835 else
20836 ac_res=-l$ac_lib
20837 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
20838 fi
20839 if ac_fn_c_try_link "$LINENO"; then :
20840 ac_cv_search_inet_ntop=$ac_res
20841fi
20842rm -f core conftest.err conftest.$ac_objext \
20843 conftest$ac_exeext
20844 if ${ac_cv_search_inet_ntop+:} false; then :
20845 break
20846fi
20847done
20848if ${ac_cv_search_inet_ntop+:} false; then :
20849
20850else
20851 ac_cv_search_inet_ntop=no
20852fi
20853rm conftest.$ac_ext
20854LIBS=$ac_func_search_save_LIBS
20855fi
20856{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
20857$as_echo "$ac_cv_search_inet_ntop" >&6; }
20858ac_res=$ac_cv_search_inet_ntop
20859if test "$ac_res" != no; then :
20860 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
20861
20862else
20863 for ac_func in inet_ntop
20864do :
20865 ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
20866if test "x$ac_cv_func_inet_ntop" = xyes; then :
20867 cat >>confdefs.h <<_ACEOF
20868#define HAVE_INET_NTOP 1
20869_ACEOF
20870
20871fi
20872done
20873
20874 if test $ac_cv_func_inet_ntop = no; then
20875 HAVE_INET_NTOP=0
20876 fi
20877
20878fi
20879
20880 LIBS=$gl_save_LIBS
20881
20882 if test "$ac_cv_search_inet_ntop" != "no" \
20883 && test "$ac_cv_search_inet_ntop" != "none required"; then
20884 INET_NTOP_LIB="$ac_cv_search_inet_ntop"
20885 fi
20886
20887
725e2999
JB
20888 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
20889 #if HAVE_NETDB_H
20890 # include <netdb.h>
20891 #endif
20892
20893"
20894if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
20895 ac_have_decl=1
20896else
20897 ac_have_decl=0
20898fi
20899
20900cat >>confdefs.h <<_ACEOF
20901#define HAVE_DECL_INET_NTOP $ac_have_decl
20902_ACEOF
20903
20904 if test $ac_cv_have_decl_inet_ntop = no; then
20905 HAVE_DECL_INET_NTOP=0
20906 fi
20907 fi
20908
20909
20910 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
20911
20912
20913
20914
20915
20916
20917
7a6dbc2f 20918
725e2999 20919 gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext"
7a6dbc2f
SDJ
20920
20921
20922
7a6dbc2f 20923
725e2999 20924 fi
7a6dbc2f
SDJ
20925
20926
20927
20928
7a6dbc2f 20929
725e2999
JB
20930 GNULIB_INET_NTOP=1
20931
7a6dbc2f
SDJ
20932
20933
49e4877c
PA
20934
20935
88b48903
WN
20936
20937
20938
20939
20940 PRIPTR_PREFIX=
20941 if test -n "$STDINT_H"; then
20942 PRIPTR_PREFIX='"l"'
20943 else
20944 for glpfx in '' l ll I64; do
20945 case $glpfx in
20946 '') gltype1='int';;
20947 l) gltype1='long int';;
20948 ll) gltype1='long long int';;
20949 I64) gltype1='__int64';;
20950 esac
20951 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20952/* end confdefs.h. */
20953#include <stdint.h>
20954 extern intptr_t foo;
20955 extern $gltype1 foo;
20956int
20957main ()
20958{
20959
20960 ;
20961 return 0;
20962}
20963_ACEOF
20964if ac_fn_c_try_compile "$LINENO"; then :
20965 PRIPTR_PREFIX='"'$glpfx'"'
20966fi
20967rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20968 test -n "$PRIPTR_PREFIX" && break
20969 done
20970 fi
20971
20972
20973
20974 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
20975$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
d0ac1c44 20976if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
88b48903
WN
20977 $as_echo_n "(cached) " >&6
20978else
20979 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20980/* end confdefs.h. */
20981/* Work also in C++ mode. */
20982 #define __STDC_LIMIT_MACROS 1
20983
20984 /* Work if build is not clean. */
20985 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
20986
20987 #include <limits.h>
20988 #if HAVE_STDINT_H
20989 #include <stdint.h>
20990 #endif
20991
20992 #if defined INT32_MAX && defined INTMAX_MAX
20993 #define CONDITION (INT32_MAX < INTMAX_MAX)
88b48903 20994 #else
5df4cba6 20995 #define CONDITION (sizeof (int) < sizeof (long long int))
88b48903
WN
20996 #endif
20997 int test[CONDITION ? 1 : -1];
20998int
20999main ()
21000{
21001
21002 ;
21003 return 0;
21004}
21005_ACEOF
21006if ac_fn_c_try_compile "$LINENO"; then :
21007 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
21008else
21009 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
21010fi
21011rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21012fi
21013{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
21014$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
21015 if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
21016 INT32_MAX_LT_INTMAX_MAX=1;
21017 else
21018 INT32_MAX_LT_INTMAX_MAX=0;
21019 fi
21020
21021
21022 if test $APPLE_UNIVERSAL_BUILD = 0; then
21023
21024 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
21025$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
d0ac1c44 21026if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
88b48903
WN
21027 $as_echo_n "(cached) " >&6
21028else
21029 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21030/* end confdefs.h. */
21031/* Work also in C++ mode. */
21032 #define __STDC_LIMIT_MACROS 1
21033
21034 /* Work if build is not clean. */
21035 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21036
21037 #include <limits.h>
21038 #if HAVE_STDINT_H
21039 #include <stdint.h>
21040 #endif
21041
21042 #if defined INT64_MAX
21043 #define CONDITION (INT64_MAX == LONG_MAX)
88b48903 21044 #else
5df4cba6 21045 #define CONDITION (sizeof (long long int) == sizeof (long int))
88b48903
WN
21046 #endif
21047 int test[CONDITION ? 1 : -1];
21048int
21049main ()
21050{
21051
21052 ;
21053 return 0;
21054}
21055_ACEOF
21056if ac_fn_c_try_compile "$LINENO"; then :
21057 gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
21058else
21059 gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
21060fi
21061rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21062fi
21063{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
21064$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
21065 if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
21066 INT64_MAX_EQ_LONG_MAX=1;
21067 else
21068 INT64_MAX_EQ_LONG_MAX=0;
21069 fi
21070
21071
21072 else
21073 INT64_MAX_EQ_LONG_MAX=-1
21074 fi
21075
21076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
21077$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
d0ac1c44 21078if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
88b48903
WN
21079 $as_echo_n "(cached) " >&6
21080else
21081 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21082/* end confdefs.h. */
21083/* Work also in C++ mode. */
21084 #define __STDC_LIMIT_MACROS 1
21085
21086 /* Work if build is not clean. */
21087 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21088
21089 #include <limits.h>
21090 #if HAVE_STDINT_H
21091 #include <stdint.h>
21092 #endif
21093
21094 #if defined UINT32_MAX && defined UINTMAX_MAX
21095 #define CONDITION (UINT32_MAX < UINTMAX_MAX)
88b48903 21096 #else
5df4cba6 21097 #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
88b48903
WN
21098 #endif
21099 int test[CONDITION ? 1 : -1];
21100int
21101main ()
21102{
21103
21104 ;
21105 return 0;
21106}
21107_ACEOF
21108if ac_fn_c_try_compile "$LINENO"; then :
21109 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
21110else
21111 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
21112fi
21113rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21114fi
21115{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
21116$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
21117 if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
21118 UINT32_MAX_LT_UINTMAX_MAX=1;
21119 else
21120 UINT32_MAX_LT_UINTMAX_MAX=0;
21121 fi
21122
21123
21124 if test $APPLE_UNIVERSAL_BUILD = 0; then
21125
21126 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
21127$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
d0ac1c44 21128if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
88b48903
WN
21129 $as_echo_n "(cached) " >&6
21130else
21131 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21132/* end confdefs.h. */
21133/* Work also in C++ mode. */
21134 #define __STDC_LIMIT_MACROS 1
21135
21136 /* Work if build is not clean. */
21137 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21138
21139 #include <limits.h>
21140 #if HAVE_STDINT_H
21141 #include <stdint.h>
21142 #endif
21143
21144 #if defined UINT64_MAX
21145 #define CONDITION (UINT64_MAX == ULONG_MAX)
88b48903 21146 #else
5df4cba6 21147 #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
88b48903
WN
21148 #endif
21149 int test[CONDITION ? 1 : -1];
21150int
21151main ()
21152{
21153
21154 ;
21155 return 0;
21156}
21157_ACEOF
21158if ac_fn_c_try_compile "$LINENO"; then :
21159 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
21160else
21161 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
21162fi
21163rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21164fi
21165{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
21166$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
21167 if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
21168 UINT64_MAX_EQ_ULONG_MAX=1;
21169 else
21170 UINT64_MAX_EQ_ULONG_MAX=0;
21171 fi
21172
21173
21174 else
21175 UINT64_MAX_EQ_ULONG_MAX=-1
21176 fi
21177
21178
21179
21180
21181
21182 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
21183$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
d0ac1c44 21184if ${gl_cv_func_isnand_no_libm+:} false; then :
88b48903
WN
21185 $as_echo_n "(cached) " >&6
21186else
21187
21188 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21189/* end confdefs.h. */
21190#include <math.h>
21191 #if __GNUC__ >= 4
21192 # undef isnand
21193 # define isnand(x) __builtin_isnan ((double)(x))
21194 #else
21195 # undef isnand
21196 # define isnand(x) isnan ((double)(x))
21197 #endif
21198 double x;
21199int
21200main ()
21201{
21202return isnand (x);
21203 ;
21204 return 0;
21205}
21206_ACEOF
21207if ac_fn_c_try_link "$LINENO"; then :
21208 gl_cv_func_isnand_no_libm=yes
21209else
21210 gl_cv_func_isnand_no_libm=no
21211fi
21212rm -f core conftest.err conftest.$ac_objext \
21213 conftest$ac_exeext conftest.$ac_ext
21214
21215fi
21216{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
21217$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
21218
21219 gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
21220 if test $gl_cv_func_isnand_no_libm = yes; then
21221
21222$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
21223
21224 fi
21225
21226 if test $gl_func_isnand_no_libm != yes; then
21227
21228
21229
21230
21231
21232
21233
21234
21235 gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
21236
21237
21238
21239
21240 fi
21241
21242
21243 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
21244$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
d0ac1c44 21245if ${gl_cv_func_isnanl_no_libm+:} false; then :
88b48903
WN
21246 $as_echo_n "(cached) " >&6
21247else
21248
21249 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21250/* end confdefs.h. */
21251#include <math.h>
21252 #if __GNUC__ >= 4
21253 # undef isnanl
21254 # define isnanl(x) __builtin_isnanl ((long double)(x))
21255 #elif defined isnan
21256 # undef isnanl
21257 # define isnanl(x) isnan ((long double)(x))
21258 #endif
21259 long double x;
21260int
21261main ()
21262{
21263return isnanl (x);
21264 ;
21265 return 0;
21266}
21267_ACEOF
21268if ac_fn_c_try_link "$LINENO"; then :
21269 gl_cv_func_isnanl_no_libm=yes
21270else
21271 gl_cv_func_isnanl_no_libm=no
21272fi
21273rm -f core conftest.err conftest.$ac_objext \
21274 conftest$ac_exeext conftest.$ac_ext
21275
21276fi
21277{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
21278$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
21279
21280 gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
21281 if test $gl_func_isnanl_no_libm = yes; then
21282
21283
21284
21285
21286 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
21287$as_echo_n "checking whether isnanl works... " >&6; }
d0ac1c44 21288if ${gl_cv_func_isnanl_works+:} false; then :
88b48903
WN
21289 $as_echo_n "(cached) " >&6
21290else
21291
21292 if test "$cross_compiling" = yes; then :
c0c3707f
CB
21293 case "$host_os" in
21294 mingw*) # Guess yes on mingw, no on MSVC.
21295 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21296/* end confdefs.h. */
21297
21298#ifdef __MINGW32__
21299 Known
21300#endif
21301
21302_ACEOF
21303if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21304 $EGREP "Known" >/dev/null 2>&1; then :
4a626d0a 21305 gl_cv_func_isnanl_works="guessing yes"
c0c3707f
CB
21306else
21307 gl_cv_func_isnanl_works="guessing no"
21308fi
21309rm -f conftest*
21310
21311 ;;
21312 *) gl_cv_func_isnanl_works="guessing yes" ;;
21313 esac
21314
88b48903
WN
21315else
21316 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21317/* end confdefs.h. */
21318
21319#include <float.h>
21320#include <limits.h>
21321#include <math.h>
21322#if __GNUC__ >= 4
21323# undef isnanl
21324# define isnanl(x) __builtin_isnanl ((long double)(x))
21325#elif defined isnan
21326# undef isnanl
21327# define isnanl(x) isnan ((long double)(x))
21328#endif
21329#define NWORDS \
21330 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
21331typedef union { unsigned int word[NWORDS]; long double value; }
21332 memory_long_double;
21333/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
21334 runtime type conversion. */
21335#ifdef __sgi
21336static long double NaNl ()
21337{
21338 double zero = 0.0;
21339 return zero / zero;
21340}
21341#else
21342# define NaNl() (0.0L / 0.0L)
21343#endif
21344int main ()
21345{
21346 int result = 0;
21347
21348 if (!isnanl (NaNl ()))
21349 result |= 1;
21350
21351 {
21352 memory_long_double m;
21353 unsigned int i;
21354
21355 /* The isnanl function should be immune against changes in the sign bit and
21356 in the mantissa bits. The xor operation twiddles a bit that can only be
21357 a sign bit or a mantissa bit (since the exponent never extends to
21358 bit 31). */
21359 m.value = NaNl ();
21360 m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
21361 for (i = 0; i < NWORDS; i++)
21362 m.word[i] |= 1;
21363 if (!isnanl (m.value))
21364 result |= 1;
21365 }
21366
21367#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
21368/* Representation of an 80-bit 'long double' as an initializer for a sequence
21369 of 'unsigned int' words. */
21370# ifdef WORDS_BIGENDIAN
21371# define LDBL80_WORDS(exponent,manthi,mantlo) \
21372 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
4a626d0a 21373 ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
88b48903
WN
21374 (unsigned int) (mantlo) << 16 \
21375 }
21376# else
21377# define LDBL80_WORDS(exponent,manthi,mantlo) \
21378 { mantlo, manthi, exponent }
21379# endif
21380 { /* Quiet NaN. */
21381 static memory_long_double x =
21382 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
21383 if (!isnanl (x.value))
21384 result |= 2;
21385 }
21386 {
21387 /* Signalling NaN. */
21388 static memory_long_double x =
21389 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
21390 if (!isnanl (x.value))
21391 result |= 2;
21392 }
4a626d0a 21393 /* isnanl should return something even for noncanonical values. */
88b48903
WN
21394 { /* Pseudo-NaN. */
21395 static memory_long_double x =
21396 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
4a626d0a 21397 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21398 result |= 4;
21399 }
21400 { /* Pseudo-Infinity. */
21401 static memory_long_double x =
21402 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
4a626d0a 21403 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21404 result |= 8;
21405 }
21406 { /* Pseudo-Zero. */
21407 static memory_long_double x =
21408 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
4a626d0a 21409 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21410 result |= 16;
21411 }
21412 { /* Unnormalized number. */
21413 static memory_long_double x =
21414 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
4a626d0a 21415 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21416 result |= 32;
21417 }
21418 { /* Pseudo-Denormal. */
21419 static memory_long_double x =
21420 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
4a626d0a 21421 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21422 result |= 64;
21423 }
21424#endif
21425
21426 return result;
21427}
21428_ACEOF
21429if ac_fn_c_try_run "$LINENO"; then :
21430 gl_cv_func_isnanl_works=yes
21431else
21432 gl_cv_func_isnanl_works=no
21433fi
21434rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21435 conftest.$ac_objext conftest.beam conftest.$ac_ext
21436fi
21437
21438
21439fi
21440{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
21441$as_echo "$gl_cv_func_isnanl_works" >&6; }
21442
21443 case "$gl_cv_func_isnanl_works" in
21444 *yes) ;;
21445 *) gl_func_isnanl_no_libm=no ;;
21446 esac
21447 fi
21448 if test $gl_func_isnanl_no_libm = yes; then
21449
21450$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
21451
21452 fi
21453
21454 if test $gl_func_isnanl_no_libm != yes; then
21455
21456
21457
21458
21459
21460
21461
21462
21463 gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext"
21464
21465
21466
21467
c0c3707f 21468 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
88b48903 21469$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
d0ac1c44 21470if ${gl_cv_cc_long_double_expbit0+:} false; then :
88b48903
WN
21471 $as_echo_n "(cached) " >&6
21472else
21473
21474 if test "$cross_compiling" = yes; then :
21475
21476 gl_cv_cc_long_double_expbit0="unknown"
c0c3707f
CB
21477 case "$host_os" in
21478 mingw*) # On native Windows (little-endian), we know the result
21479 # in two cases: mingw, MSVC.
21480 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21481/* end confdefs.h. */
21482
21483#ifdef __MINGW32__
21484 Known
21485#endif
21486
21487_ACEOF
21488if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21489 $EGREP "Known" >/dev/null 2>&1; then :
21490 gl_cv_cc_long_double_expbit0="word 2 bit 0"
21491fi
21492rm -f conftest*
21493
21494 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21495/* end confdefs.h. */
21496
21497#ifdef _MSC_VER
21498 Known
21499#endif
21500
21501_ACEOF
21502if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21503 $EGREP "Known" >/dev/null 2>&1; then :
21504 gl_cv_cc_long_double_expbit0="word 1 bit 20"
21505fi
21506rm -f conftest*
21507
21508 ;;
21509 esac
88b48903
WN
21510
21511else
21512 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21513/* end confdefs.h. */
21514
21515#include <float.h>
21516#include <stddef.h>
21517#include <stdio.h>
21518#include <string.h>
21519#define NWORDS \
21520 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
21521typedef union { long double value; unsigned int word[NWORDS]; }
21522 memory_long_double;
21523static unsigned int ored_words[NWORDS];
21524static unsigned int anded_words[NWORDS];
21525static void add_to_ored_words (long double x)
21526{
21527 memory_long_double m;
21528 size_t i;
21529 /* Clear it first, in case
21530 sizeof (long double) < sizeof (memory_long_double). */
21531 memset (&m, 0, sizeof (memory_long_double));
21532 m.value = x;
21533 for (i = 0; i < NWORDS; i++)
21534 {
21535 ored_words[i] |= m.word[i];
21536 anded_words[i] &= m.word[i];
21537 }
21538}
21539int main ()
21540{
21541 size_t j;
21542 FILE *fp = fopen ("conftest.out", "w");
21543 if (fp == NULL)
21544 return 1;
21545 for (j = 0; j < NWORDS; j++)
21546 anded_words[j] = ~ (unsigned int) 0;
21547 add_to_ored_words (0.25L);
21548 add_to_ored_words (0.5L);
21549 add_to_ored_words (1.0L);
21550 add_to_ored_words (2.0L);
21551 add_to_ored_words (4.0L);
21552 /* Remove bits that are common (e.g. if representation of the first mantissa
21553 bit is explicit). */
21554 for (j = 0; j < NWORDS; j++)
21555 ored_words[j] &= ~anded_words[j];
21556 /* Now find the nonzero word. */
21557 for (j = 0; j < NWORDS; j++)
21558 if (ored_words[j] != 0)
21559 break;
21560 if (j < NWORDS)
21561 {
21562 size_t i;
21563 for (i = j + 1; i < NWORDS; i++)
21564 if (ored_words[i] != 0)
21565 {
21566 fprintf (fp, "unknown");
21567 return (fclose (fp) != 0);
21568 }
21569 for (i = 0; ; i++)
21570 if ((ored_words[j] >> i) & 1)
21571 {
21572 fprintf (fp, "word %d bit %d", (int) j, (int) i);
21573 return (fclose (fp) != 0);
21574 }
21575 }
21576 fprintf (fp, "unknown");
21577 return (fclose (fp) != 0);
21578}
21579
21580_ACEOF
21581if ac_fn_c_try_run "$LINENO"; then :
21582 gl_cv_cc_long_double_expbit0=`cat conftest.out`
21583else
21584 gl_cv_cc_long_double_expbit0="unknown"
21585fi
21586rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21587 conftest.$ac_objext conftest.beam conftest.$ac_ext
21588fi
21589
21590 rm -f conftest.out
21591
21592fi
21593{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
21594$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
21595 case "$gl_cv_cc_long_double_expbit0" in
21596 word*bit*)
21597 word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
21598 bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
21599
21600cat >>confdefs.h <<_ACEOF
21601#define LDBL_EXPBIT0_WORD $word
21602_ACEOF
21603
21604
21605cat >>confdefs.h <<_ACEOF
21606#define LDBL_EXPBIT0_BIT $bit
21607_ACEOF
21608
21609 ;;
21610 esac
21611
21612
21613
21614 fi
21615
21616
5df4cba6
SM
21617 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
21618$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; }
21619if ${gl_cv_c___inline+:} false; then :
21620 $as_echo_n "(cached) " >&6
21621else
21622 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21623/* end confdefs.h. */
21624typedef int foo_t;
21625 static __inline foo_t foo (void) { return 0; }
21626int
21627main ()
21628{
21629return foo ();
21630 ;
21631 return 0;
21632}
21633_ACEOF
21634if ac_fn_c_try_compile "$LINENO"; then :
21635 gl_cv_c___inline=yes
21636else
21637 gl_cv_c___inline=no
21638fi
21639rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21640fi
21641{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
21642$as_echo "$gl_cv_c___inline" >&6; }
21643 if test $gl_cv_c___inline = yes; then
21644
21645$as_echo "#define HAVE___INLINE 1" >>confdefs.h
21646
21647 fi
21648
21649
21650
21651
21652
21653 LOCALCHARSET_TESTS_ENVIRONMENT=
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665 case "$host_os" in
21666 solaris*)
21667
21668$as_echo "#define _LCONV_C99 1" >>confdefs.h
21669
21670 ;;
21671 esac
21672
21673 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
21674$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; }
21675if ${gl_cv_header_locale_h_posix2001+:} false; then :
21676 $as_echo_n "(cached) " >&6
21677else
21678 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21679/* end confdefs.h. */
21680#include <locale.h>
21681 int x = LC_MESSAGES;
21682 int y = sizeof (((struct lconv *) 0)->decimal_point);
21683int
21684main ()
21685{
21686
21687 ;
21688 return 0;
21689}
21690_ACEOF
21691if ac_fn_c_try_compile "$LINENO"; then :
21692 gl_cv_header_locale_h_posix2001=yes
21693else
21694 gl_cv_header_locale_h_posix2001=no
21695fi
21696rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21697fi
21698{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
21699$as_echo "$gl_cv_header_locale_h_posix2001" >&6; }
21700
21701 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
21702$as_echo_n "checking whether struct lconv is properly defined... " >&6; }
21703if ${gl_cv_sys_struct_lconv_ok+:} false; then :
c0c3707f
CB
21704 $as_echo_n "(cached) " >&6
21705else
21706 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21707/* end confdefs.h. */
5df4cba6
SM
21708#include <locale.h>
21709 struct lconv l;
21710 int x = sizeof (l.decimal_point);
21711 int y = sizeof (l.int_p_cs_precedes);
c0c3707f
CB
21712int
21713main ()
21714{
5df4cba6 21715
c0c3707f
CB
21716 ;
21717 return 0;
21718}
21719_ACEOF
21720if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 21721 gl_cv_sys_struct_lconv_ok=yes
c0c3707f 21722else
5df4cba6 21723 gl_cv_sys_struct_lconv_ok=no
c0c3707f
CB
21724fi
21725rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 21726
c0c3707f 21727fi
5df4cba6
SM
21728{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
21729$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
21730 if test $gl_cv_sys_struct_lconv_ok = no; then
21731 case "$host_os" in
21732 mingw*)
21733 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21734/* end confdefs.h. */
c0c3707f 21735
5df4cba6
SM
21736#ifdef _MSC_VER
21737 Special
21738#endif
21739
21740_ACEOF
21741if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21742 $EGREP "Special" >/dev/null 2>&1; then :
21743
21744else
21745 REPLACE_STRUCT_LCONV=1
21746fi
21747rm -f conftest*
c0c3707f 21748
5df4cba6
SM
21749 ;;
21750 *) REPLACE_STRUCT_LCONV=1 ;;
21751 esac
c0c3707f 21752 fi
88b48903
WN
21753
21754
88b48903
WN
21755
21756
472fa5ee 21757
5df4cba6
SM
21758
21759
21760
21761
21762 if test $gl_cv_have_include_next = yes; then
21763 gl_cv_next_locale_h='<'locale.h'>'
21764 else
21765 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
21766$as_echo_n "checking absolute name of <locale.h>... " >&6; }
21767if ${gl_cv_next_locale_h+:} false; then :
21768 $as_echo_n "(cached) " >&6
21769else
21770
21771
21772
21773 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21774/* end confdefs.h. */
21775#include <locale.h>
21776_ACEOF
21777 case "$host_os" in
21778 aix*) gl_absname_cpp="$ac_cpp -C" ;;
21779 *) gl_absname_cpp="$ac_cpp" ;;
21780 esac
21781
21782 case "$host_os" in
21783 mingw*)
21784 gl_dirsep_regex='[/\\]'
21785 ;;
21786 *)
21787 gl_dirsep_regex='\/'
21788 ;;
21789 esac
21790 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
21791 gl_header_literal_regex=`echo 'locale.h' \
21792 | sed -e "$gl_make_literal_regex_sed"`
21793 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
21794 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
21795 s|^/[^/]|//&|
21796 p
21797 q
21798 }'
21799
21800 gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
21801 sed -n "$gl_absolute_header_sed"`
21802
21803 gl_header=$gl_cv_absolute_locale_h
21804 gl_cv_next_locale_h='"'$gl_header'"'
21805
21806
21807fi
21808{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
21809$as_echo "$gl_cv_next_locale_h" >&6; }
21810 fi
21811 NEXT_LOCALE_H=$gl_cv_next_locale_h
21812
21813 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
21814 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
21815 gl_next_as_first_directive='<'locale.h'>'
21816 else
21817 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
21818 gl_next_as_first_directive=$gl_cv_next_locale_h
21819 fi
21820 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
21821
21822
21823
21824
21825
21826
21827
21828
472fa5ee
SM
21829
21830
21831
21832
88b48903
WN
21833
21834
2196f55f 21835
49e4877c 21836
c0c3707f
CB
21837
21838
21839 gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext"
88b48903
WN
21840
21841
21842
5abebf3c
CB
21843 if test "$gl_threads_api" = posix; then
21844 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
21845 # pthread_rwlock_* functions.
c0c3707f 21846 has_rwlock=false
5abebf3c
CB
21847 ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
21848"
21849if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
c0c3707f 21850 has_rwlock=true
5abebf3c
CB
21851
21852$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
21853
21854fi
21855
c0c3707f
CB
21856 if $has_rwlock; then
21857
21858
21859 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
21860$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
21861if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
21862 $as_echo_n "(cached) " >&6
21863else
21864 save_LIBS="$LIBS"
21865 LIBS="$LIBS $LIBMULTITHREAD"
21866 if test "$cross_compiling" = yes; then :
21867 case "$host_os" in
21868 # Guess no on glibc systems.
21869 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
21870 # Guess no on musl systems.
21871 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
21872 # Guess no on bionic systems.
21873 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
21874 # Guess yes on native Windows with the mingw-w64 winpthreads library.
21875 # Guess no on native Windows with the gnulib windows-rwlock module.
21876 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
21877 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
21878 else
21879 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
21880 fi
21881 ;;
21882 # If we don't know, obey --enable-cross-guesses.
21883 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
21884 esac
21885
21886else
21887 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21888/* end confdefs.h. */
21889
21890#include <errno.h>
21891#include <pthread.h>
21892#include <stdlib.h>
21893#include <unistd.h>
21894
21895#define SUCCEED() exit (0)
21896#define FAILURE() exit (1)
21897#define UNEXPECTED(n) (exit (10 + (n)))
21898
21899/* The main thread creates the waiting writer and the requesting reader threads
21900 in the default way; this guarantees that they have the same priority.
21901 We can reuse the main thread as first reader thread. */
21902
21903static pthread_rwlock_t lock;
21904static pthread_t reader1;
21905static pthread_t writer;
21906static pthread_t reader2;
21907static pthread_t timer;
21908/* Used to pass control from writer to reader2 and from reader2 to timer,
21909 as in a relay race.
21910 Passing control from one running thread to another running thread
21911 is most likely faster than to create the second thread. */
21912static pthread_mutex_t baton;
21913
21914static void *
21915timer_func (void *ignored)
21916{
21917 /* Step 13 (can be before or after step 12):
21918 The timer thread takes the baton, then waits a moment to make sure
21919 it can tell whether the second reader thread is blocked at step 12. */
21920 if (pthread_mutex_lock (&baton))
21921 UNEXPECTED (13);
21922 usleep (100000);
21923 /* By the time we get here, it's clear that the second reader thread is
21924 blocked at step 12. This is the desired behaviour. */
21925 SUCCEED ();
21926}
21927
21928static void *
21929reader2_func (void *ignored)
21930{
21931 int err;
21932
21933 /* Step 8 (can be before or after step 7):
21934 The second reader thread takes the baton, then waits a moment to make sure
21935 the writer thread has reached step 7. */
21936 if (pthread_mutex_lock (&baton))
21937 UNEXPECTED (8);
21938 usleep (100000);
21939 /* Step 9: The second reader thread requests the lock. */
21940 err = pthread_rwlock_tryrdlock (&lock);
21941 if (err == 0)
21942 FAILURE ();
21943 else if (err != EBUSY)
21944 UNEXPECTED (9);
21945 /* Step 10: Launch a timer, to test whether the next call blocks. */
21946 if (pthread_create (&timer, NULL, timer_func, NULL))
21947 UNEXPECTED (10);
21948 /* Step 11: Release the baton. */
21949 if (pthread_mutex_unlock (&baton))
21950 UNEXPECTED (11);
21951 /* Step 12: The second reader thread requests the lock. */
21952 err = pthread_rwlock_rdlock (&lock);
21953 if (err == 0)
21954 FAILURE ();
21955 else
21956 UNEXPECTED (12);
21957}
21958
21959static void *
21960writer_func (void *ignored)
21961{
21962 /* Step 4: Take the baton, so that the second reader thread does not go ahead
21963 too early. */
21964 if (pthread_mutex_lock (&baton))
21965 UNEXPECTED (4);
21966 /* Step 5: Create the second reader thread. */
21967 if (pthread_create (&reader2, NULL, reader2_func, NULL))
21968 UNEXPECTED (5);
21969 /* Step 6: Release the baton. */
21970 if (pthread_mutex_unlock (&baton))
21971 UNEXPECTED (6);
21972 /* Step 7: The writer thread requests the lock. */
21973 if (pthread_rwlock_wrlock (&lock))
21974 UNEXPECTED (7);
21975 return NULL;
21976}
21977
21978int
21979main ()
21980{
21981 reader1 = pthread_self ();
21982
21983 /* Step 1: The main thread initializes the lock and the baton. */
21984 if (pthread_rwlock_init (&lock, NULL))
21985 UNEXPECTED (1);
21986 if (pthread_mutex_init (&baton, NULL))
21987 UNEXPECTED (1);
21988 /* Step 2: The main thread acquires the lock as a reader. */
21989 if (pthread_rwlock_rdlock (&lock))
21990 UNEXPECTED (2);
21991 /* Step 3: Create the writer thread. */
21992 if (pthread_create (&writer, NULL, writer_func, NULL))
21993 UNEXPECTED (3);
21994 /* Job done. Go to sleep. */
21995 for (;;)
21996 {
21997 sleep (1);
21998 }
21999}
22000
22001_ACEOF
22002if ac_fn_c_try_run "$LINENO"; then :
22003 gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
22004else
22005 gl_cv_pthread_rwlock_rdlock_prefer_writer=no
22006fi
22007rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22008 conftest.$ac_objext conftest.beam conftest.$ac_ext
22009fi
22010
22011 LIBS="$save_LIBS"
22012
22013fi
22014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
22015$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
22016 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
22017 *yes)
22018
22019$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
22020
22021 ;;
22022 esac
22023
22024 fi
5abebf3c
CB
22025 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
22026 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22027/* end confdefs.h. */
22028
22029 #include <pthread.h>
22030int
22031main ()
22032{
22033
22034#if __FreeBSD__ == 4
22035error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
22036#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
22037 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
22038error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
22039#else
22040int x = (int)PTHREAD_MUTEX_RECURSIVE;
22041return !x;
22042#endif
22043
22044 ;
22045 return 0;
22046}
22047_ACEOF
22048if ac_fn_c_try_compile "$LINENO"; then :
22049
22050$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
22051
22052fi
22053rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22054 fi
22055 :
22056
22057
22058
22059cat >>confdefs.h <<_ACEOF
22060#define GNULIB_LOCK 1
22061_ACEOF
22062
22063
22064
22065
88b48903 22066
472fa5ee 22067
f45c62c4
YQ
22068 if test $ac_cv_func_lstat = yes; then
22069
c0c3707f
CB
22070 case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
22071 solaris* | *no)
f45c62c4
YQ
22072 REPLACE_LSTAT=1
22073 ;;
22074 esac
22075 else
22076 HAVE_LSTAT=0
22077 fi
22078
22079 if test $REPLACE_LSTAT = 1; then
22080
22081
22082
22083
22084
22085
22086
22087
22088 gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
22089
22090 :
22091 fi
22092
22093
22094
22095
22096
22097 GNULIB_LSTAT=1
22098
22099
22100
22101
22102
22103$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
22104
22105
22106
22107
22108
22109
6a29c58e
YQ
22110 if test $gl_cv_func_malloc_posix = yes; then
22111
22112$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
22113
22114 else
22115 REPLACE_MALLOC=1
22116 fi
22117
22118 if test $REPLACE_MALLOC = 1; then
22119
22120
22121
22122
22123
22124
22125
22126
22127 gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
22128
22129 fi
22130
22131
22132
22133
22134
22135 GNULIB_MALLOC_POSIX=1
22136
22137
22138
22139
22140
22141$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
22142
22143
22144
22145
22146
22147
88b48903
WN
22148
22149
22150
22151
22152
88b48903 22153
c971b7fa 22154
c971b7fa 22155
98399780
YQ
22156
22157
22158
88b48903
WN
22159 if test $gl_cv_have_include_next = yes; then
22160 gl_cv_next_math_h='<'math.h'>'
22161 else
22162 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
22163$as_echo_n "checking absolute name of <math.h>... " >&6; }
d0ac1c44 22164if ${gl_cv_next_math_h+:} false; then :
88b48903
WN
22165 $as_echo_n "(cached) " >&6
22166else
c971b7fa 22167
88b48903 22168 if test $ac_cv_header_math_h = yes; then
c971b7fa
PA
22169
22170
4a626d0a
PA
22171
22172
22173 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 22174/* end confdefs.h. */
88b48903 22175#include <math.h>
8690e634 22176_ACEOF
4a626d0a
PA
22177 case "$host_os" in
22178 aix*) gl_absname_cpp="$ac_cpp -C" ;;
22179 *) gl_absname_cpp="$ac_cpp" ;;
22180 esac
22181
22182 case "$host_os" in
22183 mingw*)
22184 gl_dirsep_regex='[/\\]'
22185 ;;
22186 *)
22187 gl_dirsep_regex='\/'
22188 ;;
22189 esac
22190 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
22191 gl_header_literal_regex=`echo 'math.h' \
22192 | sed -e "$gl_make_literal_regex_sed"`
22193 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
22194 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
22195 s|^/[^/]|//&|
22196 p
22197 q
22198 }'
22199
22200 gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
22201 sed -n "$gl_absolute_header_sed"`
22202
22203 gl_header=$gl_cv_absolute_math_h
22204 gl_cv_next_math_h='"'$gl_header'"'
88b48903
WN
22205 else
22206 gl_cv_next_math_h='<'math.h'>'
22207 fi
8690e634 22208
c971b7fa 22209
88b48903
WN
22210fi
22211{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
22212$as_echo "$gl_cv_next_math_h" >&6; }
22213 fi
22214 NEXT_MATH_H=$gl_cv_next_math_h
c971b7fa 22215
88b48903
WN
22216 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
22217 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
22218 gl_next_as_first_directive='<'math.h'>'
22219 else
22220 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
22221 gl_next_as_first_directive=$gl_cv_next_math_h
22222 fi
22223 NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
8690e634 22224
c971b7fa 22225
c971b7fa
PA
22226
22227
c971b7fa 22228
88b48903
WN
22229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
22230$as_echo_n "checking whether NAN macro works... " >&6; }
d0ac1c44 22231if ${gl_cv_header_math_nan_works+:} false; then :
c971b7fa
PA
22232 $as_echo_n "(cached) " >&6
22233else
8690e634
JK
22234 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22235/* end confdefs.h. */
88b48903 22236#include <math.h>
c971b7fa
PA
22237int
22238main ()
22239{
88b48903
WN
22240/* Solaris 10 has a broken definition of NAN. Other platforms
22241 fail to provide NAN, or provide it only in C99 mode; this
22242 test only needs to fail when NAN is provided but wrong. */
22243 float f = 1.0f;
22244#ifdef NAN
22245 f = NAN;
22246#endif
22247 return f == 0;
c971b7fa
PA
22248 ;
22249 return 0;
22250}
22251_ACEOF
22252if ac_fn_c_try_compile "$LINENO"; then :
88b48903 22253 gl_cv_header_math_nan_works=yes
8690e634 22254else
88b48903 22255 gl_cv_header_math_nan_works=no
c971b7fa
PA
22256fi
22257rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 22258fi
88b48903
WN
22259{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
22260$as_echo "$gl_cv_header_math_nan_works" >&6; }
22261 if test $gl_cv_header_math_nan_works = no; then
22262 REPLACE_NAN=1
c971b7fa 22263 fi
88b48903
WN
22264 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
22265$as_echo_n "checking whether HUGE_VAL works... " >&6; }
d0ac1c44 22266if ${gl_cv_header_math_huge_val_works+:} false; then :
c971b7fa
PA
22267 $as_echo_n "(cached) " >&6
22268else
8690e634 22269 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 22270/* end confdefs.h. */
88b48903 22271#include <math.h>
c971b7fa
PA
22272int
22273main ()
22274{
88b48903
WN
22275/* Solaris 10 has a broken definition of HUGE_VAL. */
22276 double d = HUGE_VAL;
22277 return d == 0;
c971b7fa
PA
22278 ;
22279 return 0;
22280}
22281_ACEOF
22282if ac_fn_c_try_compile "$LINENO"; then :
88b48903 22283 gl_cv_header_math_huge_val_works=yes
8690e634 22284else
88b48903 22285 gl_cv_header_math_huge_val_works=no
c971b7fa
PA
22286fi
22287rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 22288fi
88b48903
WN
22289{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
22290$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
22291 if test $gl_cv_header_math_huge_val_works = no; then
22292 REPLACE_HUGE_VAL=1
8690e634 22293 fi
c971b7fa 22294
c971b7fa 22295
c971b7fa
PA
22296
22297
22298
22299
22300
22301
c971b7fa 22302
c971b7fa 22303
c971b7fa 22304
c971b7fa
PA
22305
22306
c971b7fa 22307
472fa5ee 22308
5df4cba6
SM
22309
22310
22311
22312 if case "$host_os" in
22313 mingw*) true ;;
22314 *) test $ac_cv_func_mbsinit = yes ;;
22315 esac \
22316 && test $ac_cv_func_mbrtowc = yes; then
472fa5ee
SM
22317
22318
22319
22320
c0c3707f
CB
22321 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
22322$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
22323if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
22324 $as_echo_n "(cached) " >&6
22325else
472fa5ee 22326
c0c3707f
CB
22327 case "$host_os" in
22328 # Guess no on AIX and OSF/1.
22329 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
22330 # Guess yes otherwise.
22331 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
22332 esac
22333 if test $LOCALE_JA != none; then
22334 if test "$cross_compiling" = yes; then :
472fa5ee 22335 :
c0c3707f
CB
22336else
22337 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22338/* end confdefs.h. */
472fa5ee 22339
c0c3707f
CB
22340#include <locale.h>
22341#include <string.h>
22342/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22343 <wchar.h>.
22344 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22345 included before <wchar.h>. */
22346#include <stddef.h>
22347#include <stdio.h>
22348#include <time.h>
22349#include <wchar.h>
22350int main ()
22351{
22352 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
22353 {
22354 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
22355 mbstate_t state;
22356 wchar_t wc;
472fa5ee 22357
c0c3707f
CB
22358 memset (&state, '\0', sizeof (mbstate_t));
22359 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
22360 if (mbsinit (&state))
22361 return 2;
22362 }
22363 return 0;
22364}
22365_ACEOF
22366if ac_fn_c_try_run "$LINENO"; then :
22367 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 22368else
c0c3707f
CB
22369 gl_cv_func_mbrtowc_incomplete_state=no
22370fi
22371rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22372 conftest.$ac_objext conftest.beam conftest.$ac_ext
22373fi
8690e634 22374
c0c3707f
CB
22375 else
22376 if test $LOCALE_FR_UTF8 != none; then
22377 if test "$cross_compiling" = yes; then :
8690e634
JK
22378 :
22379else
c971b7fa
PA
22380 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22381/* end confdefs.h. */
c971b7fa 22382
8690e634
JK
22383#include <locale.h>
22384#include <string.h>
22385/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22386 <wchar.h>.
22387 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22388 included before <wchar.h>. */
22389#include <stddef.h>
22390#include <stdio.h>
22391#include <time.h>
22392#include <wchar.h>
22393int main ()
c971b7fa 22394{
c0c3707f 22395 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
8690e634 22396 {
c0c3707f 22397 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
8690e634
JK
22398 mbstate_t state;
22399 wchar_t wc;
22400
22401 memset (&state, '\0', sizeof (mbstate_t));
22402 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
22403 if (mbsinit (&state))
c0c3707f 22404 return 2;
8690e634 22405 }
c971b7fa
PA
22406 return 0;
22407}
22408_ACEOF
8690e634
JK
22409if ac_fn_c_try_run "$LINENO"; then :
22410 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 22411else
8690e634 22412 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa 22413fi
8690e634
JK
22414rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22415 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22416fi
c971b7fa 22417
c0c3707f 22418 fi
8690e634 22419 fi
c971b7fa 22420
8690e634
JK
22421fi
22422{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
22423$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa 22424
c971b7fa 22425
c971b7fa 22426
c971b7fa 22427
8690e634
JK
22428 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
22429$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 22430if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
22431 $as_echo_n "(cached) " >&6
22432else
22433
8690e634
JK
22434 case "$host_os" in
22435 # Guess no on Solaris 8.
22436 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
22437 # Guess yes otherwise.
22438 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
22439 esac
22440 if test $LOCALE_ZH_CN != none; then
22441 if test "$cross_compiling" = yes; then :
22442 :
22443else
22444 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
22445/* end confdefs.h. */
22446
8690e634
JK
22447#include <locale.h>
22448#include <stdlib.h>
22449#include <string.h>
22450/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22451 <wchar.h>.
22452 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22453 included before <wchar.h>. */
22454#include <stddef.h>
22455#include <stdio.h>
22456#include <time.h>
22457#include <wchar.h>
22458int main ()
c971b7fa 22459{
8690e634
JK
22460 /* This fails on Solaris 8:
22461 mbrtowc returns 2, and sets wc to 0x00F0.
22462 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
22463 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
22464 {
22465 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
22466 mbstate_t state;
22467 wchar_t wc;
22468
22469 memset (&state, '\0', sizeof (mbstate_t));
22470 if (mbrtowc (&wc, input + 3, 6, &state) != 4
22471 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 22472 return 2;
8690e634 22473 }
c971b7fa
PA
22474 return 0;
22475}
22476_ACEOF
8690e634
JK
22477if ac_fn_c_try_run "$LINENO"; then :
22478 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 22479else
8690e634 22480 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 22481fi
8690e634
JK
22482rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22483 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22484fi
c971b7fa 22485
8690e634 22486 fi
c971b7fa 22487
8690e634
JK
22488fi
22489{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
22490$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
22491
22492 REPLACE_MBSTATE_T=0
22493 case "$gl_cv_func_mbrtowc_incomplete_state" in
22494 *yes) ;;
22495 *) REPLACE_MBSTATE_T=1 ;;
22496 esac
22497 case "$gl_cv_func_mbrtowc_sanitycheck" in
22498 *yes) ;;
22499 *) REPLACE_MBSTATE_T=1 ;;
22500 esac
c971b7fa 22501 else
8690e634 22502 REPLACE_MBSTATE_T=1
c971b7fa
PA
22503 fi
22504
22505
22506
8690e634
JK
22507 if test $ac_cv_func_mbrtowc = no; then
22508 HAVE_MBRTOWC=0
22509 ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
22510/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22511 <wchar.h>.
22512 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22513 included before <wchar.h>. */
22514#include <stddef.h>
22515#include <stdio.h>
22516#include <time.h>
22517#include <wchar.h>
c971b7fa 22518
8690e634 22519"
d0ac1c44 22520if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
8690e634
JK
22521 ac_have_decl=1
22522else
22523 ac_have_decl=0
c971b7fa 22524fi
c971b7fa 22525
8690e634
JK
22526cat >>confdefs.h <<_ACEOF
22527#define HAVE_DECL_MBRTOWC $ac_have_decl
22528_ACEOF
c971b7fa 22529
8690e634
JK
22530 if test $ac_cv_have_decl_mbrtowc = yes; then
22531 REPLACE_MBRTOWC=1
22532 fi
22533 else
22534 if test $REPLACE_MBSTATE_T = 1; then
22535 REPLACE_MBRTOWC=1
22536 else
c971b7fa
PA
22537
22538
22539
8690e634
JK
22540 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
22541$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
d0ac1c44 22542if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
8690e634 22543 $as_echo_n "(cached) " >&6
c971b7fa 22544else
c971b7fa 22545
8690e634
JK
22546 case "$host_os" in
22547 # Guess no on Solaris.
22548 solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
22549 # Guess yes otherwise.
22550 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
22551 esac
22552 if test $LOCALE_FR_UTF8 != none; then
22553 if test "$cross_compiling" = yes; then :
22554 :
22555else
22556 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
22557/* end confdefs.h. */
22558
8690e634
JK
22559#include <locale.h>
22560#include <stdlib.h>
22561#include <string.h>
22562/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22563 <wchar.h>.
22564 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22565 included before <wchar.h>. */
22566#include <stddef.h>
22567#include <stdio.h>
22568#include <time.h>
22569#include <wchar.h>
22570int main ()
22571{
22572 int result = 0;
22573
22574 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
22575 {
22576 char input[] = "\303\237er";
22577 mbstate_t state;
22578 wchar_t wc;
22579 size_t ret;
22580
22581 memset (&state, '\0', sizeof (mbstate_t));
22582 wc = (wchar_t) 0xBADFACE;
22583 ret = mbrtowc (&wc, input, 5, &state);
22584 if (ret != 2)
22585 result |= 1;
22586 if (!mbsinit (&state))
22587 result |= 2;
c971b7fa 22588
8690e634
JK
22589 memset (&state, '\0', sizeof (mbstate_t));
22590 ret = mbrtowc (NULL, input, 5, &state);
22591 if (ret != 2) /* Solaris 7 fails here: ret is -1. */
22592 result |= 4;
22593 if (!mbsinit (&state))
22594 result |= 8;
22595 }
22596 return result;
22597}
c971b7fa 22598_ACEOF
8690e634
JK
22599if ac_fn_c_try_run "$LINENO"; then :
22600 gl_cv_func_mbrtowc_null_arg1=yes
22601else
22602 gl_cv_func_mbrtowc_null_arg1=no
22603fi
22604rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22605 conftest.$ac_objext conftest.beam conftest.$ac_ext
22606fi
c971b7fa 22607
8690e634 22608 fi
c971b7fa 22609
c971b7fa 22610fi
8690e634
JK
22611{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
22612$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
c971b7fa 22613
c971b7fa 22614
c971b7fa 22615
c971b7fa 22616
8690e634
JK
22617 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
22618$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
d0ac1c44 22619if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
8690e634
JK
22620 $as_echo_n "(cached) " >&6
22621else
c971b7fa 22622
8690e634
JK
22623 case "$host_os" in
22624 # Guess no on OSF/1.
22625 osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
22626 # Guess yes otherwise.
22627 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
22628 esac
22629 if test $LOCALE_FR_UTF8 != none; then
22630 if test "$cross_compiling" = yes; then :
c971b7fa 22631 :
8690e634
JK
22632else
22633 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22634/* end confdefs.h. */
22635
22636#include <locale.h>
22637#include <string.h>
22638/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22639 <wchar.h>.
22640 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22641 included before <wchar.h>. */
22642#include <stddef.h>
22643#include <stdio.h>
22644#include <time.h>
22645#include <wchar.h>
22646int main ()
22647{
22648 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
22649 {
22650 mbstate_t state;
22651 wchar_t wc;
22652 int ret;
22653
22654 memset (&state, '\0', sizeof (mbstate_t));
22655 wc = (wchar_t) 0xBADFACE;
22656 mbrtowc (&wc, NULL, 5, &state);
22657 /* Check that wc was not modified. */
22658 if (wc != (wchar_t) 0xBADFACE)
c0c3707f 22659 return 2;
8690e634
JK
22660 }
22661 return 0;
22662}
22663_ACEOF
22664if ac_fn_c_try_run "$LINENO"; then :
22665 gl_cv_func_mbrtowc_null_arg2=yes
22666else
22667 gl_cv_func_mbrtowc_null_arg2=no
22668fi
22669rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22670 conftest.$ac_objext conftest.beam conftest.$ac_ext
22671fi
22672
22673 fi
22674
22675fi
22676{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
22677$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
c971b7fa
PA
22678
22679
22680
22681
22682
22683
8690e634
JK
22684 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
22685$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
d0ac1c44 22686if ${gl_cv_func_mbrtowc_retval+:} false; then :
8690e634
JK
22687 $as_echo_n "(cached) " >&6
22688else
22689
22690 case "$host_os" in
22691 # Guess no on HP-UX, Solaris, native Windows.
22692 hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
22693 # Guess yes otherwise.
22694 *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
22695 esac
22696 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
22697 || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
22698 if test "$cross_compiling" = yes; then :
c971b7fa 22699 :
8690e634
JK
22700else
22701 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22702/* end confdefs.h. */
c971b7fa 22703
8690e634
JK
22704#include <locale.h>
22705#include <string.h>
22706/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22707 <wchar.h>.
22708 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22709 included before <wchar.h>. */
22710#include <stddef.h>
22711#include <stdio.h>
22712#include <time.h>
22713#include <wchar.h>
22714int main ()
22715{
22716 int result = 0;
22717 int found_some_locale = 0;
22718 /* This fails on Solaris. */
22719 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
22720 {
22721 char input[] = "B\303\274\303\237er"; /* "Büßer" */
22722 mbstate_t state;
22723 wchar_t wc;
22724
22725 memset (&state, '\0', sizeof (mbstate_t));
22726 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
22727 {
22728 input[1] = '\0';
22729 if (mbrtowc (&wc, input + 2, 5, &state) != 1)
22730 result |= 1;
22731 }
22732 found_some_locale = 1;
22733 }
22734 /* This fails on HP-UX 11.11. */
22735 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
22736 {
22737 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
22738 mbstate_t state;
22739 wchar_t wc;
22740
22741 memset (&state, '\0', sizeof (mbstate_t));
22742 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
22743 {
22744 input[1] = '\0';
22745 if (mbrtowc (&wc, input + 2, 5, &state) != 2)
22746 result |= 2;
22747 }
22748 found_some_locale = 1;
22749 }
5df4cba6
SM
22750 /* This fails on native Windows. */
22751 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
22752 {
22753 char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
22754 mbstate_t state;
22755 wchar_t wc;
22756
22757 memset (&state, '\0', sizeof (mbstate_t));
22758 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
22759 {
22760 input[3] = '\0';
22761 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
22762 result |= 4;
22763 }
22764 found_some_locale = 1;
22765 }
22766 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
22767 {
22768 char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
22769 mbstate_t state;
22770 wchar_t wc;
22771
22772 memset (&state, '\0', sizeof (mbstate_t));
22773 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
22774 {
22775 input[3] = '\0';
22776 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
22777 result |= 8;
22778 }
22779 found_some_locale = 1;
22780 }
22781 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
22782 {
22783 char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
22784 mbstate_t state;
22785 wchar_t wc;
22786
22787 memset (&state, '\0', sizeof (mbstate_t));
22788 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
22789 {
22790 input[3] = '\0';
22791 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
22792 result |= 16;
22793 }
22794 found_some_locale = 1;
22795 }
22796 return (found_some_locale ? result : 77);
22797}
22798_ACEOF
22799if ac_fn_c_try_run "$LINENO"; then :
22800 gl_cv_func_mbrtowc_retval=yes
22801else
22802 if test $? != 77; then
22803 gl_cv_func_mbrtowc_retval=no
22804 fi
22805
22806fi
22807rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22808 conftest.$ac_objext conftest.beam conftest.$ac_ext
22809fi
22810
22811 fi
22812
22813fi
22814{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
22815$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
22816
22817
22818
22819
22820 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
22821$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
22822if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
22823 $as_echo_n "(cached) " >&6
22824else
22825
22826 case "$host_os" in
22827 # Guess no on Solaris 8 and 9.
22828 solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
22829 # Guess yes otherwise.
22830 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
22831 esac
22832 if test $LOCALE_ZH_CN != none; then
22833 if test "$cross_compiling" = yes; then :
22834 :
22835else
22836 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22837/* end confdefs.h. */
22838
22839#include <locale.h>
22840#include <string.h>
22841/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22842 <wchar.h>.
22843 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22844 included before <wchar.h>. */
22845#include <stddef.h>
22846#include <stdio.h>
22847#include <time.h>
22848#include <wchar.h>
22849int main ()
22850{
22851 /* This fails on Solaris 8 and 9. */
22852 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
22853 {
22854 mbstate_t state;
22855 wchar_t wc;
22856
22857 memset (&state, '\0', sizeof (mbstate_t));
22858 if (mbrtowc (&wc, "", 1, &state) != 0)
22859 return 2;
22860 }
22861 return 0;
22862}
22863_ACEOF
22864if ac_fn_c_try_run "$LINENO"; then :
22865 gl_cv_func_mbrtowc_nul_retval=yes
22866else
22867 gl_cv_func_mbrtowc_nul_retval=no
22868fi
22869rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22870 conftest.$ac_objext conftest.beam conftest.$ac_ext
22871fi
22872
22873 fi
22874
22875fi
22876{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
22877$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
22878
22879
22880
22881 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5
22882$as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; }
22883if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then :
22884 $as_echo_n "(cached) " >&6
22885else
22886
22887 case "$host_os" in
22888 # Guess yes on native Windows.
22889 mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
22890 *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
22891 esac
22892 case "$host_os" in
22893 mingw*)
22894 if test "$cross_compiling" = yes; then :
22895 :
22896else
22897 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22898/* end confdefs.h. */
22899
22900#include <locale.h>
22901#include <string.h>
22902/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22903 <wchar.h>.
22904 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22905 included before <wchar.h>. */
22906#include <stddef.h>
22907#include <stdio.h>
22908#include <time.h>
22909#include <wchar.h>
22910int main ()
22911{
22912 int result = 0;
22913 if (setlocale (LC_ALL, "French_France.65001") != NULL)
22914 {
22915 wchar_t wc = (wchar_t) 0xBADFACE;
22916 mbstate_t state;
22917
22918 memset (&state, '\0', sizeof (mbstate_t));
22919 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
22920 && wc != (wchar_t) 0xBADFACE)
22921 result |= 1;
22922 }
8690e634
JK
22923 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
22924 {
5df4cba6 22925 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 22926 mbstate_t state;
8690e634
JK
22927
22928 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
22929 if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
22930 && wc != (wchar_t) 0xBADFACE)
22931 result |= 2;
8690e634
JK
22932 }
22933 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
22934 {
5df4cba6 22935 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 22936 mbstate_t state;
8690e634
JK
22937
22938 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
22939 if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
22940 && wc != (wchar_t) 0xBADFACE)
22941 result |= 4;
8690e634
JK
22942 }
22943 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
22944 {
5df4cba6 22945 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 22946 mbstate_t state;
8690e634
JK
22947
22948 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
22949 if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
22950 && wc != (wchar_t) 0xBADFACE)
22951 result |= 8;
8690e634 22952 }
5df4cba6 22953 return result;
8690e634
JK
22954}
22955_ACEOF
22956if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 22957 gl_cv_func_mbrtowc_stores_incomplete=no
8690e634 22958else
5df4cba6 22959 gl_cv_func_mbrtowc_stores_incomplete=yes
8690e634
JK
22960fi
22961rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22962 conftest.$ac_objext conftest.beam conftest.$ac_ext
22963fi
c971b7fa 22964
5df4cba6
SM
22965 ;;
22966 *)
8690e634 22967
5df4cba6
SM
22968 if test $LOCALE_FR_UTF8 != none; then
22969 if test "$cross_compiling" = yes; then :
8690e634 22970 :
c971b7fa
PA
22971else
22972 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22973/* end confdefs.h. */
22974
8690e634 22975#include <locale.h>
c971b7fa 22976#include <string.h>
8690e634
JK
22977/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22978 <wchar.h>.
22979 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22980 included before <wchar.h>. */
22981#include <stddef.h>
22982#include <stdio.h>
22983#include <time.h>
22984#include <wchar.h>
22985int main ()
c971b7fa 22986{
5df4cba6 22987 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
c971b7fa 22988 {
5df4cba6 22989 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 22990 mbstate_t state;
c971b7fa 22991
8690e634 22992 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
22993 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
22994 && wc != (wchar_t) 0xBADFACE)
22995 return 1;
8690e634 22996 }
c971b7fa
PA
22997 return 0;
22998}
22999_ACEOF
23000if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23001 gl_cv_func_mbrtowc_stores_incomplete=no
c971b7fa 23002else
5df4cba6 23003 gl_cv_func_mbrtowc_stores_incomplete=yes
c971b7fa
PA
23004fi
23005rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23006 conftest.$ac_objext conftest.beam conftest.$ac_ext
23007fi
23008
5df4cba6
SM
23009 fi
23010 ;;
23011 esac
8690e634 23012
c971b7fa 23013fi
5df4cba6
SM
23014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5
23015$as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; }
8690e634 23016
4a626d0a
PA
23017
23018
23019 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
23020$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
d0ac1c44 23021if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
4a626d0a
PA
23022 $as_echo_n "(cached) " >&6
23023else
23024
23025 case "$host_os" in
c0c3707f
CB
23026 # Guess no on AIX and glibc systems.
23027 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
23028 # Guess yes on native Windows.
23029 mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
23030 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
4a626d0a
PA
23031 esac
23032 if test "$cross_compiling" = yes; then :
23033 :
23034else
23035 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23036/* end confdefs.h. */
23037
23038 #include <wchar.h>
23039 static wchar_t wc;
23040 static mbstate_t mbs;
23041 int
23042 main (void)
23043 {
49e4877c 23044 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
4a626d0a
PA
23045 }
23046_ACEOF
23047if ac_fn_c_try_run "$LINENO"; then :
4a626d0a 23048 gl_cv_func_mbrtowc_empty_input=yes
49e4877c
PA
23049else
23050 gl_cv_func_mbrtowc_empty_input=no
4a626d0a
PA
23051fi
23052rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23053 conftest.$ac_objext conftest.beam conftest.$ac_ext
23054fi
23055
23056
23057fi
23058{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
23059$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
23060
49e4877c 23061
c0c3707f 23062 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
49e4877c 23063$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
5df4cba6 23064if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then :
49e4877c
PA
23065 $as_echo_n "(cached) " >&6
23066else
23067
5df4cba6 23068 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
49e4877c
PA
23069
23070 if test "$cross_compiling" = yes; then :
c0c3707f
CB
23071 case "$host_os" in
23072 # Guess yes on native Windows.
5df4cba6 23073 mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
c0c3707f
CB
23074 esac
23075
49e4877c
PA
23076else
23077 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23078/* end confdefs.h. */
23079#include <limits.h>
23080 #include <locale.h>
23081 #include <wchar.h>
23082
23083int
23084main ()
23085{
23086
23087 int i;
23088 char *locale = setlocale (LC_ALL, "C");
23089 if (! locale)
c0c3707f 23090 return 2;
49e4877c
PA
23091 for (i = CHAR_MIN; i <= CHAR_MAX; i++)
23092 {
23093 char c = i;
23094 wchar_t wc;
23095 mbstate_t mbs = { 0, };
23096 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
23097 if (1 < ss)
c0c3707f 23098 return 3;
49e4877c
PA
23099 }
23100 return 0;
23101
6ec2e0f5
SDJ
23102 ;
23103 return 0;
23104}
23105_ACEOF
23106if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23107 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes
6ec2e0f5 23108else
5df4cba6 23109 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no
6ec2e0f5
SDJ
23110fi
23111rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23112 conftest.$ac_objext conftest.beam conftest.$ac_ext
23113fi
23114
c0c3707f 23115
6ec2e0f5 23116fi
5df4cba6
SM
23117{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5
23118$as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; }
6ec2e0f5
SDJ
23119
23120 case "$gl_cv_func_mbrtowc_null_arg1" in
23121 *yes) ;;
23122 *)
23123$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
23124
23125 REPLACE_MBRTOWC=1
23126 ;;
23127 esac
23128 case "$gl_cv_func_mbrtowc_null_arg2" in
23129 *yes) ;;
23130 *)
23131$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
23132
23133 REPLACE_MBRTOWC=1
23134 ;;
23135 esac
23136 case "$gl_cv_func_mbrtowc_retval" in
23137 *yes) ;;
23138 *)
23139$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
23140
23141 REPLACE_MBRTOWC=1
23142 ;;
23143 esac
23144 case "$gl_cv_func_mbrtowc_nul_retval" in
23145 *yes) ;;
23146 *)
23147$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
23148
5df4cba6
SM
23149 REPLACE_MBRTOWC=1
23150 ;;
23151 esac
23152 case "$gl_cv_func_mbrtowc_stores_incomplete" in
23153 *no) ;;
23154 *)
23155$as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h
23156
23157 REPLACE_MBRTOWC=1
23158 ;;
23159 esac
23160 case "$gl_cv_func_mbrtowc_empty_input" in
23161 *yes) ;;
23162 *)
23163$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
23164
23165 REPLACE_MBRTOWC=1
23166 ;;
23167 esac
23168 case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
23169 *yes) ;;
23170 *)
23171$as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
23172
23173 REPLACE_MBRTOWC=1
23174 ;;
23175 esac
23176 fi
23177 fi
23178 if test $REPLACE_MBSTATE_T = 1; then
23179 case "$host_os" in
23180 mingw*) LIB_MBRTOWC= ;;
23181 *)
23182
23183
23184 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
23185$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
23186if ${gl_cv_have_weak+:} false; then :
23187 $as_echo_n "(cached) " >&6
23188else
23189 gl_cv_have_weak=no
23190 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23191/* end confdefs.h. */
23192extern void xyzzy ();
23193#pragma weak xyzzy
23194int
23195main ()
23196{
23197xyzzy();
23198 ;
23199 return 0;
23200}
23201_ACEOF
23202if ac_fn_c_try_link "$LINENO"; then :
23203 gl_cv_have_weak=maybe
23204fi
23205rm -f core conftest.err conftest.$ac_objext \
23206 conftest$ac_exeext conftest.$ac_ext
23207 if test $gl_cv_have_weak = maybe; then
23208 if test "$cross_compiling" = yes; then :
23209 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23210/* end confdefs.h. */
23211#ifdef __ELF__
23212 Extensible Linking Format
23213 #endif
23214
23215_ACEOF
23216if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
23217 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
23218 gl_cv_have_weak="guessing yes"
23219else
23220 gl_cv_have_weak="guessing no"
23221fi
23222rm -f conftest*
23223
23224
23225else
23226 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23227/* end confdefs.h. */
23228
23229#include <stdio.h>
23230#pragma weak fputs
23231int main ()
23232{
23233 return (fputs == NULL);
23234}
23235_ACEOF
23236if ac_fn_c_try_run "$LINENO"; then :
23237 gl_cv_have_weak=yes
23238else
23239 gl_cv_have_weak=no
23240fi
23241rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23242 conftest.$ac_objext conftest.beam conftest.$ac_ext
23243fi
23244
23245 fi
23246 case " $LDFLAGS " in
23247 *" -static "*) gl_cv_have_weak=no ;;
23248 esac
23249 case "$gl_cv_have_weak" in
23250 *yes)
23251 case "$host_os" in
23252 freebsd* | dragonfly*)
23253 : > conftest1.c
23254 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
23255 cat <<EOF > conftest2.c
23256#include <pthread.h>
23257#pragma weak pthread_mutexattr_gettype
23258int main ()
23259{
23260 return (pthread_mutexattr_gettype != NULL);
23261}
23262EOF
23263 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
23264 || gl_cv_have_weak=no
23265 rm -f conftest1.c libempty.so conftest2.c conftest
23266 ;;
23267 esac
23268 ;;
23269 esac
23270
23271fi
23272{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
23273$as_echo "$gl_cv_have_weak" >&6; }
23274 case "$gl_cv_have_weak" in
23275 *yes)
23276
23277$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
23278
23279 ;;
23280 esac
23281
23282 case "$gl_cv_have_weak" in
23283 *yes) LIB_MBRTOWC= ;;
23284 *) LIB_MBRTOWC="$LIBPTHREAD" ;;
23285 esac
23286 ;;
23287 esac
23288 else
23289 LIB_MBRTOWC=
23290 fi
23291
23292
23293 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
23294
23295
23296
23297
23298
23299
23300
23301
23302 gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
23303
23304 if test $REPLACE_MBSTATE_T = 1; then
23305
23306
23307
23308
23309
23310
23311
23312
23313 gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext"
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323 gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext"
23324
23325
23326
23327
23328 CFLAG_VISIBILITY=
23329 HAVE_VISIBILITY=0
23330 if test -n "$GCC"; then
23331 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
23332$as_echo_n "checking whether the -Werror option is usable... " >&6; }
23333if ${gl_cv_cc_vis_werror+:} false; then :
23334 $as_echo_n "(cached) " >&6
23335else
23336 gl_save_CFLAGS="$CFLAGS"
23337 CFLAGS="$CFLAGS -Werror"
23338 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23339/* end confdefs.h. */
23340
23341int
23342main ()
23343{
23344
23345 ;
23346 return 0;
23347}
23348_ACEOF
23349if ac_fn_c_try_compile "$LINENO"; then :
23350 gl_cv_cc_vis_werror=yes
23351else
23352 gl_cv_cc_vis_werror=no
23353fi
23354rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23355 CFLAGS="$gl_save_CFLAGS"
23356
23357fi
23358{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
23359$as_echo "$gl_cv_cc_vis_werror" >&6; }
23360 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
23361$as_echo_n "checking for simple visibility declarations... " >&6; }
23362if ${gl_cv_cc_visibility+:} false; then :
23363 $as_echo_n "(cached) " >&6
23364else
23365 gl_save_CFLAGS="$CFLAGS"
23366 CFLAGS="$CFLAGS -fvisibility=hidden"
23367 if test $gl_cv_cc_vis_werror = yes; then
23368 CFLAGS="$CFLAGS -Werror"
23369 fi
23370 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23371/* end confdefs.h. */
23372extern __attribute__((__visibility__("hidden"))) int hiddenvar;
23373 extern __attribute__((__visibility__("default"))) int exportedvar;
23374 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
23375 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
23376 void dummyfunc (void) {}
23377
23378int
23379main ()
23380{
6ec2e0f5 23381
5df4cba6
SM
23382 ;
23383 return 0;
23384}
23385_ACEOF
23386if ac_fn_c_try_compile "$LINENO"; then :
23387 gl_cv_cc_visibility=yes
23388else
23389 gl_cv_cc_visibility=no
23390fi
23391rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23392 CFLAGS="$gl_save_CFLAGS"
6ec2e0f5 23393
5df4cba6
SM
23394fi
23395{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
23396$as_echo "$gl_cv_cc_visibility" >&6; }
23397 if test $gl_cv_cc_visibility = yes; then
23398 CFLAG_VISIBILITY="-fvisibility=hidden"
23399 HAVE_VISIBILITY=1
6ec2e0f5
SDJ
23400 fi
23401 fi
23402
6ec2e0f5
SDJ
23403
23404
5df4cba6
SM
23405cat >>confdefs.h <<_ACEOF
23406#define HAVE_VISIBILITY $HAVE_VISIBILITY
23407_ACEOF
6ec2e0f5
SDJ
23408
23409
6ec2e0f5 23410
5df4cba6 23411 fi
6ec2e0f5 23412
c0c3707f 23413
6ec2e0f5
SDJ
23414 :
23415
23416 fi
23417
23418
23419
23420
23421
23422 GNULIB_MBRTOWC=1
23423
23424
23425
23426
23427
23428$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
5df4cba6
SM
23443
23444 if case "$host_os" in
23445 mingw*) true ;;
23446 *) test $ac_cv_func_mbsinit = yes ;;
23447 esac \
23448 && test $ac_cv_func_mbrtowc = yes; then
6ec2e0f5
SDJ
23449
23450
23451
c0c3707f 23452
6ec2e0f5
SDJ
23453 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
23454$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 23455if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
6ec2e0f5
SDJ
23456 $as_echo_n "(cached) " >&6
23457else
23458
23459 case "$host_os" in
23460 # Guess no on AIX and OSF/1.
23461 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
23462 # Guess yes otherwise.
23463 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
23464 esac
23465 if test $LOCALE_JA != none; then
23466 if test "$cross_compiling" = yes; then :
23467 :
23468else
23469 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23470/* end confdefs.h. */
23471
23472#include <locale.h>
23473#include <string.h>
23474/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23475 <wchar.h>.
23476 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23477 included before <wchar.h>. */
23478#include <stddef.h>
23479#include <stdio.h>
23480#include <time.h>
23481#include <wchar.h>
23482int main ()
23483{
23484 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23485 {
23486 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23487 mbstate_t state;
23488 wchar_t wc;
23489
23490 memset (&state, '\0', sizeof (mbstate_t));
23491 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23492 if (mbsinit (&state))
c0c3707f
CB
23493 return 2;
23494 }
23495 return 0;
23496}
23497_ACEOF
23498if ac_fn_c_try_run "$LINENO"; then :
23499 gl_cv_func_mbrtowc_incomplete_state=yes
23500else
23501 gl_cv_func_mbrtowc_incomplete_state=no
23502fi
23503rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23504 conftest.$ac_objext conftest.beam conftest.$ac_ext
23505fi
23506
23507 else
23508 if test $LOCALE_FR_UTF8 != none; then
23509 if test "$cross_compiling" = yes; then :
23510 :
23511else
23512 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23513/* end confdefs.h. */
23514
23515#include <locale.h>
23516#include <string.h>
23517/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23518 <wchar.h>.
23519 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23520 included before <wchar.h>. */
23521#include <stddef.h>
23522#include <stdio.h>
23523#include <time.h>
23524#include <wchar.h>
23525int main ()
23526{
23527 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23528 {
23529 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
23530 mbstate_t state;
23531 wchar_t wc;
23532
23533 memset (&state, '\0', sizeof (mbstate_t));
23534 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23535 if (mbsinit (&state))
23536 return 2;
6ec2e0f5
SDJ
23537 }
23538 return 0;
23539}
23540_ACEOF
23541if ac_fn_c_try_run "$LINENO"; then :
23542 gl_cv_func_mbrtowc_incomplete_state=yes
23543else
23544 gl_cv_func_mbrtowc_incomplete_state=no
23545fi
23546rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23547 conftest.$ac_objext conftest.beam conftest.$ac_ext
23548fi
23549
c0c3707f 23550 fi
6ec2e0f5
SDJ
23551 fi
23552
23553fi
23554{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
23555$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
23556
23557
23558
23559
23560 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
23561$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 23562if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
6ec2e0f5
SDJ
23563 $as_echo_n "(cached) " >&6
23564else
23565
23566 case "$host_os" in
23567 # Guess no on Solaris 8.
23568 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
23569 # Guess yes otherwise.
23570 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
23571 esac
23572 if test $LOCALE_ZH_CN != none; then
23573 if test "$cross_compiling" = yes; then :
23574 :
23575else
23576 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23577/* end confdefs.h. */
23578
23579#include <locale.h>
23580#include <stdlib.h>
23581#include <string.h>
23582/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23583 <wchar.h>.
23584 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23585 included before <wchar.h>. */
23586#include <stddef.h>
23587#include <stdio.h>
23588#include <time.h>
23589#include <wchar.h>
23590int main ()
23591{
23592 /* This fails on Solaris 8:
23593 mbrtowc returns 2, and sets wc to 0x00F0.
23594 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
23595 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23596 {
23597 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
23598 mbstate_t state;
23599 wchar_t wc;
23600
23601 memset (&state, '\0', sizeof (mbstate_t));
23602 if (mbrtowc (&wc, input + 3, 6, &state) != 4
23603 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 23604 return 2;
6ec2e0f5 23605 }
49e4877c
PA
23606 return 0;
23607}
23608_ACEOF
23609if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 23610 gl_cv_func_mbrtowc_sanitycheck=yes
49e4877c 23611else
6ec2e0f5 23612 gl_cv_func_mbrtowc_sanitycheck=no
49e4877c
PA
23613fi
23614rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23615 conftest.$ac_objext conftest.beam conftest.$ac_ext
23616fi
23617
6ec2e0f5
SDJ
23618 fi
23619
49e4877c 23620fi
6ec2e0f5
SDJ
23621{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
23622$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
49e4877c 23623
6ec2e0f5
SDJ
23624 REPLACE_MBSTATE_T=0
23625 case "$gl_cv_func_mbrtowc_incomplete_state" in
23626 *yes) ;;
23627 *) REPLACE_MBSTATE_T=1 ;;
23628 esac
23629 case "$gl_cv_func_mbrtowc_sanitycheck" in
23630 *yes) ;;
23631 *) REPLACE_MBSTATE_T=1 ;;
23632 esac
23633 else
23634 REPLACE_MBSTATE_T=1
23635 fi
8690e634 23636
8690e634 23637
8690e634 23638
6ec2e0f5
SDJ
23639 if test $ac_cv_func_mbsinit = no; then
23640 HAVE_MBSINIT=0
23641 ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
23642/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23643 <wchar.h>.
23644 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23645 included before <wchar.h>. */
23646#include <stddef.h>
23647#include <stdio.h>
23648#include <time.h>
23649#include <wchar.h>
8690e634 23650
6ec2e0f5 23651"
d0ac1c44 23652if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
6ec2e0f5
SDJ
23653 ac_have_decl=1
23654else
23655 ac_have_decl=0
23656fi
4a626d0a 23657
6ec2e0f5
SDJ
23658cat >>confdefs.h <<_ACEOF
23659#define HAVE_DECL_MBSINIT $ac_have_decl
23660_ACEOF
49e4877c 23661
6ec2e0f5
SDJ
23662 if test $ac_cv_have_decl_mbsinit = yes; then
23663 REPLACE_MBSINIT=1
23664 fi
23665 else
23666 if test $REPLACE_MBSTATE_T = 1; then
23667 REPLACE_MBSINIT=1
23668 else
23669 case "$host_os" in
23670 mingw*) REPLACE_MBSINIT=1 ;;
8690e634 23671 esac
c971b7fa
PA
23672 fi
23673 fi
23674
6ec2e0f5 23675 if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
c971b7fa 23676
c971b7fa 23677
c971b7fa
PA
23678
23679
23680
23681
23682
23683
6ec2e0f5 23684 gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
8690e634
JK
23685
23686
23687 :
c971b7fa 23688
a512b375 23689 fi
c971b7fa 23690
8690e634
JK
23691
23692
23693
23694
6ec2e0f5 23695 GNULIB_MBSINIT=1
8690e634
JK
23696
23697
23698
23699
8690e634 23700
6ec2e0f5 23701$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
8690e634
JK
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
c971b7fa 23713
c971b7fa 23714
5df4cba6
SM
23715
23716 if case "$host_os" in
23717 mingw*) true ;;
23718 *) test $ac_cv_func_mbsinit = yes ;;
23719 esac \
23720 && test $ac_cv_func_mbrtowc = yes; then
c971b7fa 23721
8690e634
JK
23722
23723
c0c3707f 23724
8690e634
JK
23725 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
23726$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 23727if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
8690e634
JK
23728 $as_echo_n "(cached) " >&6
23729else
23730
23731 case "$host_os" in
23732 # Guess no on AIX and OSF/1.
23733 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
23734 # Guess yes otherwise.
23735 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
23736 esac
23737 if test $LOCALE_JA != none; then
23738 if test "$cross_compiling" = yes; then :
23739 :
c971b7fa
PA
23740else
23741 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23742/* end confdefs.h. */
23743
8690e634
JK
23744#include <locale.h>
23745#include <string.h>
23746/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23747 <wchar.h>.
23748 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23749 included before <wchar.h>. */
23750#include <stddef.h>
23751#include <stdio.h>
23752#include <time.h>
23753#include <wchar.h>
23754int main ()
c971b7fa 23755{
8690e634 23756 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
c971b7fa 23757 {
8690e634
JK
23758 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23759 mbstate_t state;
23760 wchar_t wc;
23761
23762 memset (&state, '\0', sizeof (mbstate_t));
23763 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23764 if (mbsinit (&state))
c0c3707f
CB
23765 return 2;
23766 }
23767 return 0;
23768}
23769_ACEOF
23770if ac_fn_c_try_run "$LINENO"; then :
23771 gl_cv_func_mbrtowc_incomplete_state=yes
23772else
23773 gl_cv_func_mbrtowc_incomplete_state=no
23774fi
23775rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23776 conftest.$ac_objext conftest.beam conftest.$ac_ext
23777fi
23778
23779 else
23780 if test $LOCALE_FR_UTF8 != none; then
23781 if test "$cross_compiling" = yes; then :
23782 :
23783else
23784 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23785/* end confdefs.h. */
23786
23787#include <locale.h>
23788#include <string.h>
23789/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23790 <wchar.h>.
23791 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23792 included before <wchar.h>. */
23793#include <stddef.h>
23794#include <stdio.h>
23795#include <time.h>
23796#include <wchar.h>
23797int main ()
23798{
23799 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23800 {
23801 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
23802 mbstate_t state;
23803 wchar_t wc;
23804
23805 memset (&state, '\0', sizeof (mbstate_t));
23806 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23807 if (mbsinit (&state))
23808 return 2;
c971b7fa 23809 }
c971b7fa
PA
23810 return 0;
23811}
23812_ACEOF
23813if ac_fn_c_try_run "$LINENO"; then :
8690e634 23814 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 23815else
8690e634 23816 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa
PA
23817fi
23818rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23819 conftest.$ac_objext conftest.beam conftest.$ac_ext
23820fi
23821
c0c3707f 23822 fi
8690e634 23823 fi
c971b7fa
PA
23824
23825fi
8690e634
JK
23826{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
23827$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa
PA
23828
23829
c971b7fa
PA
23830
23831
8690e634
JK
23832 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
23833$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 23834if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
23835 $as_echo_n "(cached) " >&6
23836else
8690e634
JK
23837
23838 case "$host_os" in
23839 # Guess no on Solaris 8.
23840 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
23841 # Guess yes otherwise.
23842 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
23843 esac
23844 if test $LOCALE_ZH_CN != none; then
23845 if test "$cross_compiling" = yes; then :
23846 :
23847else
c971b7fa
PA
23848 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23849/* end confdefs.h. */
8690e634
JK
23850
23851#include <locale.h>
23852#include <stdlib.h>
23853#include <string.h>
23854/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23855 <wchar.h>.
23856 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23857 included before <wchar.h>. */
c971b7fa 23858#include <stddef.h>
8690e634
JK
23859#include <stdio.h>
23860#include <time.h>
23861#include <wchar.h>
23862int main ()
c971b7fa 23863{
8690e634
JK
23864 /* This fails on Solaris 8:
23865 mbrtowc returns 2, and sets wc to 0x00F0.
23866 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
23867 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23868 {
23869 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
23870 mbstate_t state;
23871 wchar_t wc;
23872
23873 memset (&state, '\0', sizeof (mbstate_t));
23874 if (mbrtowc (&wc, input + 3, 6, &state) != 4
23875 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 23876 return 2;
8690e634 23877 }
c971b7fa
PA
23878 return 0;
23879}
23880_ACEOF
8690e634
JK
23881if ac_fn_c_try_run "$LINENO"; then :
23882 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 23883else
8690e634 23884 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 23885fi
8690e634
JK
23886rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23887 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 23888fi
c971b7fa 23889
8690e634
JK
23890 fi
23891
23892fi
23893{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
23894$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
c971b7fa 23895
8690e634
JK
23896 REPLACE_MBSTATE_T=0
23897 case "$gl_cv_func_mbrtowc_incomplete_state" in
23898 *yes) ;;
23899 *) REPLACE_MBSTATE_T=1 ;;
23900 esac
23901 case "$gl_cv_func_mbrtowc_sanitycheck" in
23902 *yes) ;;
23903 *) REPLACE_MBSTATE_T=1 ;;
23904 esac
23905 else
23906 REPLACE_MBSTATE_T=1
c971b7fa
PA
23907 fi
23908
c971b7fa 23909
8690e634 23910
6ec2e0f5
SDJ
23911 if test $ac_cv_func_mbsrtowcs = no; then
23912 HAVE_MBSRTOWCS=0
23913 ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
8690e634
JK
23914/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23915 <wchar.h>.
23916 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23917 included before <wchar.h>. */
23918#include <stddef.h>
23919#include <stdio.h>
23920#include <time.h>
23921#include <wchar.h>
23922
23923"
d0ac1c44 23924if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then :
8690e634
JK
23925 ac_have_decl=1
23926else
23927 ac_have_decl=0
c971b7fa 23928fi
c971b7fa 23929
8690e634 23930cat >>confdefs.h <<_ACEOF
6ec2e0f5 23931#define HAVE_DECL_MBSRTOWCS $ac_have_decl
c971b7fa 23932_ACEOF
c971b7fa 23933
6ec2e0f5
SDJ
23934 if test $ac_cv_have_decl_mbsrtowcs = yes; then
23935 REPLACE_MBSRTOWCS=1
8690e634
JK
23936 fi
23937 else
23938 if test $REPLACE_MBSTATE_T = 1; then
6ec2e0f5 23939 REPLACE_MBSRTOWCS=1
8690e634 23940 else
6ec2e0f5
SDJ
23941
23942
23943
23944
23945
23946
23947 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
23948$as_echo_n "checking whether mbsrtowcs works... " >&6; }
d0ac1c44 23949if ${gl_cv_func_mbsrtowcs_works+:} false; then :
6ec2e0f5
SDJ
23950 $as_echo_n "(cached) " >&6
23951else
23952
23953 case "$host_os" in
23954 # Guess no on HP-UX, Solaris, mingw.
23955 hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
23956 # Guess yes otherwise.
23957 *) gl_cv_func_mbsrtowcs_works="guessing yes" ;;
23958 esac
23959 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
23960 if test "$cross_compiling" = yes; then :
23961 :
23962else
23963 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23964/* end confdefs.h. */
23965
23966#include <locale.h>
23967#include <string.h>
23968/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23969 <wchar.h>.
23970 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23971 included before <wchar.h>. */
23972#include <stddef.h>
23973#include <stdio.h>
23974#include <time.h>
23975#include <wchar.h>
23976int main ()
23977{
23978 int result = 0;
23979 /* Test whether the function supports a NULL destination argument.
23980 This fails on native Windows. */
23981 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
23982 {
23983 const char input[] = "\337er";
23984 const char *src = input;
23985 mbstate_t state;
23986
23987 memset (&state, '\0', sizeof (mbstate_t));
23988 if (mbsrtowcs (NULL, &src, 1, &state) != 3
23989 || src != input)
23990 result |= 1;
23991 }
23992 /* Test whether the function works when started with a conversion state
23993 in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
23994 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23995 {
23996 const char input[] = "B\303\274\303\237er";
23997 mbstate_t state;
23998
23999 memset (&state, '\0', sizeof (mbstate_t));
24000 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24001 if (!mbsinit (&state))
24002 {
24003 const char *src = input + 2;
24004 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24005 result |= 2;
24006 }
24007 }
24008 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
24009 {
24010 const char input[] = "<\306\374\313\334\270\354>";
24011 mbstate_t state;
24012
24013 memset (&state, '\0', sizeof (mbstate_t));
24014 if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
24015 if (!mbsinit (&state))
24016 {
24017 const char *src = input + 4;
24018 if (mbsrtowcs (NULL, &src, 10, &state) != 3)
24019 result |= 4;
24020 }
24021 }
24022 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24023 {
24024 const char input[] = "B\250\271\201\060\211\070er";
24025 mbstate_t state;
24026
24027 memset (&state, '\0', sizeof (mbstate_t));
24028 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24029 if (!mbsinit (&state))
24030 {
24031 const char *src = input + 2;
24032 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24033 result |= 8;
24034 }
24035 }
24036 return result;
24037}
24038_ACEOF
24039if ac_fn_c_try_run "$LINENO"; then :
24040 gl_cv_func_mbsrtowcs_works=yes
24041else
24042 gl_cv_func_mbsrtowcs_works=no
24043fi
24044rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24045 conftest.$ac_objext conftest.beam conftest.$ac_ext
24046fi
24047
24048 fi
24049
24050fi
24051{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
24052$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
24053
24054 case "$gl_cv_func_mbsrtowcs_works" in
24055 *yes) ;;
24056 *) REPLACE_MBSRTOWCS=1 ;;
8690e634
JK
24057 esac
24058 fi
24059 fi
c971b7fa 24060
6ec2e0f5 24061 if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
c971b7fa
PA
24062
24063
24064
24065
24066
24067
24068
24069
6ec2e0f5
SDJ
24070 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
c971b7fa
PA
24081
24082
8690e634 24083 :
c971b7fa 24084
a512b375 24085 fi
c971b7fa 24086
c971b7fa 24087
c971b7fa 24088
c971b7fa
PA
24089
24090
6ec2e0f5 24091 GNULIB_MBSRTOWCS=1
c971b7fa 24092
c971b7fa
PA
24093
24094
24095
24096
6ec2e0f5 24097$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
c971b7fa
PA
24098
24099
c971b7fa 24100
c971b7fa 24101
6ec2e0f5 24102 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
c971b7fa
PA
24103
24104
24105
c971b7fa 24106
c971b7fa
PA
24107
24108
24109
24110
6ec2e0f5 24111 gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
8690e634 24112
c971b7fa 24113
6ec2e0f5
SDJ
24114 for ac_header in bp-sym.h
24115do :
24116 ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
d0ac1c44 24117if test "x$ac_cv_header_bp_sym_h" = xyes; then :
6ec2e0f5
SDJ
24118 cat >>confdefs.h <<_ACEOF
24119#define HAVE_BP_SYM_H 1
24120_ACEOF
c971b7fa 24121
6ec2e0f5 24122fi
c971b7fa 24123
6ec2e0f5
SDJ
24124done
24125
24126
24127 fi
24128
24129
24130
24131
24132
24133 GNULIB_MEMCHR=1
24134
24135
24136
24137
24138
24139$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
24140
24141
24142
24143
24144
24145 if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
24146 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5
24147$as_echo_n "checking whether memmem works in linear time... " >&6; }
d0ac1c44 24148if ${gl_cv_func_memmem_works_fast+:} false; then :
8690e634
JK
24149 $as_echo_n "(cached) " >&6
24150else
6ec2e0f5
SDJ
24151 if test "$cross_compiling" = yes; then :
24152 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24153/* end confdefs.h. */
24154
24155#include <features.h>
24156#ifdef __GNU_LIBRARY__
24157 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
24158 && !defined __UCLIBC__
24159 Lucky user
24160 #endif
24161#endif
24162#ifdef __CYGWIN__
24163 #include <cygwin/version.h>
24164 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
24165 Lucky user
24166 #endif
24167#endif
24168
24169_ACEOF
24170if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24171 $EGREP "Lucky user" >/dev/null 2>&1; then :
24172 gl_cv_func_memmem_works_fast="guessing yes"
24173else
c0c3707f 24174 gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"
6ec2e0f5
SDJ
24175fi
24176rm -f conftest*
24177
c971b7fa 24178
8690e634
JK
24179else
24180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 24181/* end confdefs.h. */
c971b7fa 24182
6ec2e0f5
SDJ
24183#include <signal.h> /* for signal */
24184#include <string.h> /* for memmem */
24185#include <stdlib.h> /* for malloc */
24186#include <unistd.h> /* for alarm */
24187static void quit (int sig) { _exit (sig + 128); }
24188
24189int
24190main ()
8690e634 24191{
8690e634 24192
6ec2e0f5
SDJ
24193 int result = 0;
24194 size_t m = 1000000;
24195 char *haystack = (char *) malloc (2 * m + 1);
24196 char *needle = (char *) malloc (m + 1);
24197 /* Failure to compile this test due to missing alarm is okay,
24198 since all such platforms (mingw) also lack memmem. */
24199 signal (SIGALRM, quit);
24200 alarm (5);
24201 /* Check for quadratic performance. */
24202 if (haystack && needle)
24203 {
24204 memset (haystack, 'A', 2 * m);
24205 haystack[2 * m] = 'B';
24206 memset (needle, 'A', m);
24207 needle[m] = 'B';
24208 if (!memmem (haystack, 2 * m + 1, needle, m + 1))
24209 result |= 1;
24210 }
c0c3707f
CB
24211 /* Free allocated memory, in case some sanitizer is watching. */
24212 free (haystack);
24213 free (needle);
6ec2e0f5
SDJ
24214 return result;
24215
24216 ;
c971b7fa
PA
24217 return 0;
24218}
24219_ACEOF
8690e634 24220if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24221 gl_cv_func_memmem_works_fast=yes
8690e634 24222else
6ec2e0f5 24223 gl_cv_func_memmem_works_fast=no
8690e634
JK
24224fi
24225rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24226 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24227fi
c971b7fa
PA
24228
24229
8690e634 24230fi
6ec2e0f5
SDJ
24231{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5
24232$as_echo "$gl_cv_func_memmem_works_fast" >&6; }
24233 case "$gl_cv_func_memmem_works_fast" in
24234 *yes) ;;
24235 *)
24236 REPLACE_MEMMEM=1
24237 ;;
24238 esac
24239 fi
c971b7fa 24240
6ec2e0f5 24241 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
8690e634
JK
24242
24243
24244
6ec2e0f5
SDJ
24245
24246
24247
24248
24249
24250 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
24251
24252 fi
24253
24254
24255
24256
24257 for ac_func in memmem
24258do :
24259 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
d0ac1c44 24260if test "x$ac_cv_func_memmem" = xyes; then :
6ec2e0f5
SDJ
24261 cat >>confdefs.h <<_ACEOF
24262#define HAVE_MEMMEM 1
24263_ACEOF
24264
24265fi
24266done
24267
24268 if test $ac_cv_func_memmem = yes; then
24269 HAVE_MEMMEM=1
24270 else
24271 HAVE_MEMMEM=0
24272 fi
24273
24274 if test $ac_cv_have_decl_memmem = no; then
24275 HAVE_DECL_MEMMEM=0
24276 else
24277 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
24278$as_echo_n "checking whether memmem works... " >&6; }
d0ac1c44 24279if ${gl_cv_func_memmem_works_always+:} false; then :
c971b7fa
PA
24280 $as_echo_n "(cached) " >&6
24281else
6ec2e0f5
SDJ
24282 if test "$cross_compiling" = yes; then :
24283 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24284/* end confdefs.h. */
24285
24286#ifdef __GNU_LIBRARY__
24287 #include <features.h>
24288 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
24289 || __GLIBC_MINOR__ > 12)) \
24290 || (__GLIBC__ > 2)) \
24291 || defined __UCLIBC__
24292 Lucky user
24293 #endif
24294#elif defined __CYGWIN__
24295 #include <cygwin/version.h>
24296 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
24297 Lucky user
24298 #endif
24299#else
24300 Lucky user
24301#endif
24302
24303_ACEOF
24304if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24305 $EGREP "Lucky user" >/dev/null 2>&1; then :
24306 gl_cv_func_memmem_works_always="guessing yes"
24307else
c0c3707f 24308 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
6ec2e0f5
SDJ
24309fi
24310rm -f conftest*
24311
8690e634 24312
8690e634 24313else
c971b7fa
PA
24314 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24315/* end confdefs.h. */
c971b7fa 24316
6ec2e0f5
SDJ
24317#include <string.h> /* for memmem */
24318#define P "_EF_BF_BD"
24319#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
24320#define NEEDLE P P P P P
24321
24322int
24323main ()
c971b7fa 24324{
8690e634 24325
6ec2e0f5
SDJ
24326 int result = 0;
24327 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
24328 result |= 1;
24329 /* Check for empty needle behavior. */
24330 {
24331 const char *haystack = "AAA";
24332 if (memmem (haystack, 3, NULL, 0) != haystack)
24333 result |= 2;
8690e634 24334 }
6ec2e0f5
SDJ
24335 return result;
24336
24337 ;
c971b7fa
PA
24338 return 0;
24339}
24340_ACEOF
8690e634 24341if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24342 gl_cv_func_memmem_works_always=yes
c971b7fa 24343else
6ec2e0f5 24344 gl_cv_func_memmem_works_always=no
c971b7fa 24345fi
8690e634
JK
24346rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24347 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24348fi
8690e634 24349
8690e634
JK
24350
24351fi
6ec2e0f5
SDJ
24352{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
24353$as_echo "$gl_cv_func_memmem_works_always" >&6; }
24354 case "$gl_cv_func_memmem_works_always" in
8690e634 24355 *yes) ;;
6ec2e0f5
SDJ
24356 *)
24357 REPLACE_MEMMEM=1
24358 ;;
8690e634 24359 esac
c971b7fa 24360 fi
6ec2e0f5 24361 :
c971b7fa 24362
6ec2e0f5 24363 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
c971b7fa 24364
c971b7fa 24365
8690e634 24366
c971b7fa 24367
6ec2e0f5
SDJ
24368
24369
24370
24371
24372 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
24373
24374 fi
24375
24376
24377
24378
24379
24380 GNULIB_MEMMEM=1
24381
24382
24383
24384
24385
24386$as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396 for ac_func in mempcpy
24397do :
24398 ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
d0ac1c44 24399if test "x$ac_cv_func_mempcpy" = xyes; then :
6ec2e0f5
SDJ
24400 cat >>confdefs.h <<_ACEOF
24401#define HAVE_MEMPCPY 1
8690e634 24402_ACEOF
c971b7fa 24403
6ec2e0f5
SDJ
24404fi
24405done
c971b7fa 24406
6ec2e0f5
SDJ
24407 if test $ac_cv_func_mempcpy = no; then
24408 HAVE_MEMPCPY=0
24409 fi
8690e634 24410
6ec2e0f5 24411 if test $HAVE_MEMPCPY = 0; then
8690e634
JK
24412
24413
24414
24415
8690e634 24416
6ec2e0f5
SDJ
24417
24418
24419
24420 gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
24421
24422
8690e634 24423 :
c971b7fa 24424
6ec2e0f5 24425 fi
c971b7fa 24426
8690e634 24427
8690e634 24428
8690e634 24429
6ec2e0f5
SDJ
24430
24431 GNULIB_MEMPCPY=1
24432
24433
24434
24435
24436
24437$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
24438
24439
24440
24441
24442
24443
24444
24445
24446 if test $ac_cv_have_decl_memrchr = no; then
24447 HAVE_DECL_MEMRCHR=0
24448 fi
24449
24450 for ac_func in memrchr
24451do :
24452 ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
d0ac1c44 24453if test "x$ac_cv_func_memrchr" = xyes; then :
6ec2e0f5
SDJ
24454 cat >>confdefs.h <<_ACEOF
24455#define HAVE_MEMRCHR 1
c971b7fa 24456_ACEOF
6ec2e0f5 24457
c971b7fa 24458fi
6ec2e0f5 24459done
8690e634 24460
8690e634 24461
6ec2e0f5 24462 if test $ac_cv_func_memrchr = no; then
8690e634 24463
6ec2e0f5
SDJ
24464
24465
24466
24467
24468
24469
24470
24471 gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
24472
24473 :
c971b7fa
PA
24474 fi
24475
24476
c971b7fa 24477
c971b7fa 24478
c971b7fa 24479
6ec2e0f5
SDJ
24480 GNULIB_MEMRCHR=1
24481
24482
24483
24484
24485
24486$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
24487
24488
24489
24490
2d8adcbd 24491
8a99096f
SM
24492 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
24493$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
24494if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then :
24495 $as_echo_n "(cached) " >&6
24496else
24497 rm -rf conftest.dir
24498 if test "$cross_compiling" = yes; then :
24499 case "$host_os" in
c0c3707f
CB
24500 # Guess yes on Linux systems.
24501 linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
24502 # Guess yes on glibc systems.
24503 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
24504 # Guess yes on MSVC, no on mingw.
24505 mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24506/* end confdefs.h. */
24507
24508#ifdef _MSC_VER
24509 Known
24510#endif
24511
24512_ACEOF
24513if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24514 $EGREP "Known" >/dev/null 2>&1; then :
24515 gl_cv_func_mkdir_trailing_slash_works="guessing yes"
24516else
24517 gl_cv_func_mkdir_trailing_slash_works="guessing no"
24518fi
24519rm -f conftest*
24520
24521 ;;
24522 # If we don't know, obey --enable-cross-guesses.
24523 *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
8a99096f
SM
24524 esac
24525
24526else
24527 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24528/* end confdefs.h. */
24529
24530# include <sys/types.h>
24531# include <sys/stat.h>
24532
24533int
24534main ()
24535{
24536return mkdir ("conftest.dir/", 0700);
24537 ;
24538 return 0;
24539}
24540_ACEOF
24541if ac_fn_c_try_run "$LINENO"; then :
24542 gl_cv_func_mkdir_trailing_slash_works=yes
24543else
24544 gl_cv_func_mkdir_trailing_slash_works=no
24545fi
24546rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24547 conftest.$ac_objext conftest.beam conftest.$ac_ext
24548fi
24549
24550 rm -rf conftest.dir
24551
24552
24553fi
24554{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
24555$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
24556 case "$gl_cv_func_mkdir_trailing_slash_works" in
24557 *yes) ;;
24558 *)
24559 REPLACE_MKDIR=1
24560 ;;
24561 esac
24562
24563 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
24564$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
24565if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then :
24566 $as_echo_n "(cached) " >&6
24567else
24568 rm -rf conftest.dir
24569 if test "$cross_compiling" = yes; then :
24570 case "$host_os" in
c0c3707f
CB
24571 # Guess yes on glibc systems.
24572 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
24573 # Guess yes on musl systems.
24574 *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
24575 # Guess no on native Windows.
24576 mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
24577 # If we don't know, obey --enable-cross-guesses.
24578 *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
8a99096f
SM
24579 esac
24580
24581else
24582 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24583/* end confdefs.h. */
24584
24585# include <sys/types.h>
24586# include <sys/stat.h>
24587
24588int
24589main ()
24590{
24591return !mkdir ("conftest.dir/./", 0700);
24592 ;
24593 return 0;
24594}
24595_ACEOF
24596if ac_fn_c_try_run "$LINENO"; then :
24597 gl_cv_func_mkdir_trailing_dot_works=yes
24598else
24599 gl_cv_func_mkdir_trailing_dot_works=no
24600fi
24601rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24602 conftest.$ac_objext conftest.beam conftest.$ac_ext
24603fi
24604
24605 rm -rf conftest.dir
24606
24607
24608fi
24609{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
24610$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
24611 case "$gl_cv_func_mkdir_trailing_dot_works" in
24612 *yes) ;;
24613 *)
24614 REPLACE_MKDIR=1
24615
24616$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
24617
24618 ;;
24619 esac
24620
24621 if test $REPLACE_MKDIR = 1; then
24622
24623
24624
24625
24626
24627
24628
24629
24630 gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
24631
24632 fi
24633
24634
e8d8cce6
SM
24635 for ac_func in mkdtemp
24636do :
24637 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
24638if test "x$ac_cv_func_mkdtemp" = xyes; then :
24639 cat >>confdefs.h <<_ACEOF
24640#define HAVE_MKDTEMP 1
24641_ACEOF
24642
24643fi
24644done
24645
24646 if test $ac_cv_func_mkdtemp = no; then
24647 HAVE_MKDTEMP=0
24648 fi
24649
24650 if test $HAVE_MKDTEMP = 0; then
24651
24652
24653
24654
24655
24656
24657
24658
24659 gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext"
24660
24661 :
24662
24663 fi
24664
24665
24666
24667
24668
24669 GNULIB_MKDTEMP=1
24670
24671
24672
24673
24674
24675$as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
24676
24677
24678
24679
24680
2d8adcbd
MM
24681
24682
b3279b60
TT
24683
24684
b3279b60
TT
24685 if test $ac_cv_func_mkostemp != yes; then
24686 HAVE_MKOSTEMP=0
24687 fi
2d8adcbd 24688
b3279b60 24689 if test $HAVE_MKOSTEMP = 0; then
2d8adcbd 24690
2d8adcbd 24691
2d8adcbd 24692
2d8adcbd 24693
2d8adcbd
MM
24694
24695
24696
24697
b3279b60 24698 gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
2d8adcbd
MM
24699
24700
24701
b3279b60 24702 fi
2d8adcbd 24703
2d8adcbd 24704
b3279b60
TT
24705cat >>confdefs.h <<_ACEOF
24706#define GNULIB_MKOSTEMP 1
24707_ACEOF
2d8adcbd
MM
24708
24709
2d8adcbd
MM
24710
24711
24712
24713
24714
b3279b60 24715 GNULIB_MKOSTEMP=1
2d8adcbd
MM
24716
24717
24718
24719
24720
b3279b60 24721$as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h
2d8adcbd
MM
24722
24723
24724
24725
6ec2e0f5
SDJ
24726 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
24727
24728
24729
c971b7fa 24730
c971b7fa 24731
c971b7fa
PA
24732
24733
8690e634 24734
6ec2e0f5 24735 gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
8690e634 24736
6ec2e0f5 24737 fi
8690e634 24738
6ec2e0f5 24739 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
8690e634
JK
24740
24741
24742
24743
24744
24745
8690e634
JK
24746
24747
6ec2e0f5 24748 gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
8690e634 24749
a512b375 24750 fi
8690e634
JK
24751
24752
c0c3707f
CB
24753cat >>confdefs.h <<_ACEOF
24754#define GNULIB_MSVC_NOTHROW 1
24755_ACEOF
24756
24757
24758
24759
725e2999
JB
24760 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
24761$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
24762if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
24763 $as_echo_n "(cached) " >&6
24764else
24765
24766 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24767/* end confdefs.h. */
24768#include <netinet/in.h>
24769int
24770main ()
24771{
24772
24773 ;
24774 return 0;
24775}
24776_ACEOF
24777if ac_fn_c_try_compile "$LINENO"; then :
24778 gl_cv_header_netinet_in_h_selfcontained=yes
24779else
24780 gl_cv_header_netinet_in_h_selfcontained=no
24781fi
24782rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24783
24784fi
24785{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
24786$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
24787 if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
24788 NETINET_IN_H=''
24789 else
24790 NETINET_IN_H='netinet/in.h'
24791 for ac_header in netinet/in.h
24792do :
24793 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
24794if test "x$ac_cv_header_netinet_in_h" = xyes; then :
24795 cat >>confdefs.h <<_ACEOF
24796#define HAVE_NETINET_IN_H 1
24797_ACEOF
24798
24799fi
24800
24801done
24802
24803
24804
24805
24806
24807
24808
725e2999
JB
24809
24810
24811
24812 if test $gl_cv_have_include_next = yes; then
24813 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
24814 else
24815 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
24816$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
24817if ${gl_cv_next_netinet_in_h+:} false; then :
24818 $as_echo_n "(cached) " >&6
24819else
24820
24821 if test $ac_cv_header_netinet_in_h = yes; then
24822
24823
24824
24825
24826 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24827/* end confdefs.h. */
24828#include <netinet/in.h>
24829_ACEOF
24830 case "$host_os" in
24831 aix*) gl_absname_cpp="$ac_cpp -C" ;;
24832 *) gl_absname_cpp="$ac_cpp" ;;
24833 esac
24834
24835 case "$host_os" in
24836 mingw*)
24837 gl_dirsep_regex='[/\\]'
24838 ;;
24839 *)
24840 gl_dirsep_regex='\/'
24841 ;;
24842 esac
24843 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
24844 gl_header_literal_regex=`echo 'netinet/in.h' \
24845 | sed -e "$gl_make_literal_regex_sed"`
24846 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
24847 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
24848 s|^/[^/]|//&|
24849 p
24850 q
24851 }'
24852
24853 gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
24854 sed -n "$gl_absolute_header_sed"`
24855
24856 gl_header=$gl_cv_absolute_netinet_in_h
24857 gl_cv_next_netinet_in_h='"'$gl_header'"'
24858 else
24859 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
24860 fi
24861
24862
24863fi
24864{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
24865$as_echo "$gl_cv_next_netinet_in_h" >&6; }
24866 fi
24867 NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
24868
24869 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
24870 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
24871 gl_next_as_first_directive='<'netinet/in.h'>'
24872 else
24873 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
24874 gl_next_as_first_directive=$gl_cv_next_netinet_in_h
24875 fi
24876 NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
24877
24878
24879
24880
24881 if test $ac_cv_header_netinet_in_h = yes; then
24882 HAVE_NETINET_IN_H=1
24883 else
24884 HAVE_NETINET_IN_H=0
24885 fi
24886
24887 fi
24888
24889 if test -n "$NETINET_IN_H"; then
24890 GL_GENERATE_NETINET_IN_H_TRUE=
24891 GL_GENERATE_NETINET_IN_H_FALSE='#'
24892else
24893 GL_GENERATE_NETINET_IN_H_TRUE='#'
24894 GL_GENERATE_NETINET_IN_H_FALSE=
24895fi
24896
24897
24898
24899
8690e634 24900
c0c3707f 24901
6ec2e0f5
SDJ
24902 case "$host_os" in
24903 mingw* | pw*)
24904 REPLACE_OPEN=1
24905 ;;
24906 *)
24907
c0c3707f
CB
24908 if test "$gl_cv_macro_O_CLOEXEC" != yes; then
24909 REPLACE_OPEN=1
24910 fi
472fa5ee
SM
24911
24912
c0c3707f 24913 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
6ec2e0f5 24914$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
d0ac1c44 24915if ${gl_cv_func_open_slash+:} false; then :
6ec2e0f5
SDJ
24916 $as_echo_n "(cached) " >&6
24917else
24918 # Assume that if we have lstat, we can also check symlinks.
c0c3707f
CB
24919 if test $ac_cv_func_lstat = yes; then
24920 touch conftest.tmp
24921 ln -s conftest.tmp conftest.lnk
24922 fi
24923 if test "$cross_compiling" = yes; then :
8690e634 24924
c0c3707f
CB
24925 case "$host_os" in
24926 freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
24927 gl_cv_func_open_slash="guessing no" ;;
24928 *)
24929 gl_cv_func_open_slash="guessing yes" ;;
24930 esac
8690e634 24931
6ec2e0f5
SDJ
24932else
24933 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24934/* end confdefs.h. */
24935
24936#include <fcntl.h>
24937#if HAVE_UNISTD_H
24938# include <unistd.h>
24939#endif
24940int main ()
24941{
24942 int result = 0;
24943#if HAVE_LSTAT
24944 if (open ("conftest.lnk/", O_RDONLY) != -1)
24945 result |= 1;
24946#endif
24947 if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
24948 result |= 2;
24949 return result;
24950}
24951_ACEOF
24952if ac_fn_c_try_run "$LINENO"; then :
24953 gl_cv_func_open_slash=yes
24954else
24955 gl_cv_func_open_slash=no
24956fi
24957rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24958 conftest.$ac_objext conftest.beam conftest.$ac_ext
24959fi
8690e634 24960
c0c3707f 24961 rm -f conftest.sl conftest.tmp conftest.lnk
8690e634 24962
6ec2e0f5
SDJ
24963fi
24964{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
24965$as_echo "$gl_cv_func_open_slash" >&6; }
c0c3707f
CB
24966 case "$gl_cv_func_open_slash" in
24967 *no)
8690e634 24968
6ec2e0f5 24969$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
8690e634 24970
6ec2e0f5
SDJ
24971 ;;
24972 esac
8690e634 24973
c0c3707f
CB
24974 case "$gl_cv_func_open_slash" in
24975 *no)
24976 REPLACE_OPEN=1
24977 ;;
24978 esac
24979 ;;
24980 esac
472fa5ee 24981
c0c3707f 24982 if test $REPLACE_OPEN = 0; then
472fa5ee
SM
24983
24984
24985
6ec2e0f5
SDJ
24986 if test $ac_cv_func_fchdir = no; then
24987 HAVE_FCHDIR=0
24988 fi
c971b7fa 24989
6ec2e0f5
SDJ
24990 if test $HAVE_FCHDIR = 0; then
24991 REPLACE_OPEN=1
24992 fi
24993 fi
c971b7fa
PA
24994
24995
24996
6ec2e0f5 24997 if test $REPLACE_OPEN = 1; then
c971b7fa
PA
24998
24999
25000
25001
25002
c971b7fa
PA
25003
25004
c971b7fa 25005
6ec2e0f5 25006 gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
c971b7fa 25007
c971b7fa
PA
25008
25009
6ec2e0f5
SDJ
25010 :
25011
a512b375 25012 fi
c971b7fa
PA
25013
25014
25015
25016
25017
6ec2e0f5 25018 GNULIB_OPEN=1
c971b7fa
PA
25019
25020
25021
25022
25023
6ec2e0f5 25024$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
c971b7fa
PA
25025
25026
25027
25028
25029
c971b7fa 25030
c971b7fa 25031
472fa5ee 25032
63ce7108 25033
c0c3707f
CB
25034 case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
25035 yes+*yes+yes)
6ec2e0f5
SDJ
25036 ;;
25037 yes+*)
c0c3707f 25038 # Solaris 10 lacks O_CLOEXEC.
6ec2e0f5
SDJ
25039 # Solaris 9 has *at functions, but uniformly mishandles trailing
25040 # slash in all of them.
25041 REPLACE_OPENAT=1
25042 ;;
25043 *)
25044 HAVE_OPENAT=0
25045 ;;
25046 esac
63ce7108 25047
6ec2e0f5 25048 if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
63ce7108 25049
63ce7108 25050
63ce7108 25051
63ce7108 25052
63ce7108
TT
25053
25054
63ce7108 25055
63ce7108 25056
6ec2e0f5 25057 gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
63ce7108
TT
25058
25059
25060
6ec2e0f5 25061 :
63ce7108 25062
6ec2e0f5 25063 fi
63ce7108
TT
25064
25065
6ec2e0f5
SDJ
25066cat >>confdefs.h <<_ACEOF
25067#define GNULIB_OPENAT 1
25068_ACEOF
63ce7108 25069
63ce7108 25070
63ce7108
TT
25071
25072
25073
25074
6ec2e0f5 25075 GNULIB_OPENAT=1
63ce7108 25076
63ce7108 25077
63ce7108 25078
63ce7108 25079
63ce7108 25080
6ec2e0f5 25081$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
63ce7108
TT
25082
25083
63ce7108 25084
63ce7108 25085
63ce7108 25086
63ce7108 25087
6ec2e0f5
SDJ
25088 for ac_func in opendir
25089do :
25090 ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
d0ac1c44 25091if test "x$ac_cv_func_opendir" = xyes; then :
6ec2e0f5
SDJ
25092 cat >>confdefs.h <<_ACEOF
25093#define HAVE_OPENDIR 1
63ce7108 25094_ACEOF
6ec2e0f5 25095
63ce7108 25096fi
6ec2e0f5 25097done
63ce7108 25098
6ec2e0f5
SDJ
25099 if test $ac_cv_func_opendir = no; then
25100 HAVE_OPENDIR=0
25101 fi
63ce7108 25102
6ec2e0f5
SDJ
25103
25104
25105
25106 if test $ac_cv_func_fchdir = no; then
25107 HAVE_FCHDIR=0
63ce7108 25108 fi
63ce7108 25109
6ec2e0f5
SDJ
25110 if test $HAVE_FCHDIR = 0; then
25111 if test $HAVE_OPENDIR = 1; then
25112 REPLACE_OPENDIR=1
25113 fi
25114 fi
25115
25116 case $host_os,$HAVE_OPENDIR in
25117 os2*,1)
25118 REPLACE_OPENDIR=1;;
25119 esac
25120
25121 if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
63ce7108
TT
25122
25123
25124
25125
25126
25127
25128
25129
6ec2e0f5 25130 gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
63ce7108
TT
25131
25132 fi
25133
25134
25135
25136
25137
6ec2e0f5 25138 GNULIB_OPENDIR=1
63ce7108
TT
25139
25140
25141
25142
63ce7108 25143
6ec2e0f5 25144$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
63ce7108
TT
25145
25146
25147
25148
25149
25150
25151
2196f55f
YQ
25152
25153
8424cc97
SM
25154
25155 for ac_func in rawmemchr
25156do :
25157 ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
d0ac1c44 25158if test "x$ac_cv_func_rawmemchr" = xyes; then :
8424cc97
SM
25159 cat >>confdefs.h <<_ACEOF
25160#define HAVE_RAWMEMCHR 1
25161_ACEOF
25162
25163fi
25164done
25165
25166 if test $ac_cv_func_rawmemchr = no; then
25167 HAVE_RAWMEMCHR=0
25168 fi
25169
25170 if test $HAVE_RAWMEMCHR = 0; then
25171
25172
25173
25174
25175
25176
25177
25178
25179 gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
25180
25181 :
25182 fi
25183
25184
25185
25186
25187
25188 GNULIB_RAWMEMCHR=1
25189
25190
25191
25192
25193
25194$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
25195
25196
25197
25198
25199
25200
6ec2e0f5
SDJ
25201 for ac_func in readdir
25202do :
25203 ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
d0ac1c44 25204if test "x$ac_cv_func_readdir" = xyes; then :
6ec2e0f5
SDJ
25205 cat >>confdefs.h <<_ACEOF
25206#define HAVE_READDIR 1
25207_ACEOF
25208
25209fi
25210done
25211
25212 if test $ac_cv_func_readdir = no; then
25213 HAVE_READDIR=0
25214 fi
25215
25216 if test $HAVE_READDIR = 0; then
25217
25218
25219
25220
25221
25222
25223
25224
25225 gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
25226
25227 fi
25228
25229
25230
25231
25232
25233 GNULIB_READDIR=1
25234
25235
25236
25237
25238
25239$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
25240
25241
25242
25243
25244
25245
2196f55f
YQ
25246 if test $ac_cv_func_readlink = no; then
25247 HAVE_READLINK=0
25248 else
25249 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
25250$as_echo_n "checking whether readlink signature is correct... " >&6; }
d0ac1c44 25251if ${gl_cv_decl_readlink_works+:} false; then :
2196f55f
YQ
25252 $as_echo_n "(cached) " >&6
25253else
25254 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25255/* end confdefs.h. */
25256#include <unistd.h>
25257 /* Cause compilation failure if original declaration has wrong type. */
25258 ssize_t readlink (const char *, char *, size_t);
25259int
25260main ()
25261{
25262
25263 ;
25264 return 0;
25265}
25266_ACEOF
25267if ac_fn_c_try_compile "$LINENO"; then :
25268 gl_cv_decl_readlink_works=yes
25269else
25270 gl_cv_decl_readlink_works=no
25271fi
25272rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25273fi
25274{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
25275$as_echo "$gl_cv_decl_readlink_works" >&6; }
25276 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
25277$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
d0ac1c44 25278if ${gl_cv_func_readlink_works+:} false; then :
2196f55f
YQ
25279 $as_echo_n "(cached) " >&6
25280else
25281 # We have readlink, so assume ln -s works.
25282 ln -s conftest.no-such conftest.link
25283 ln -s conftest.link conftest.lnk2
25284 if test "$cross_compiling" = yes; then :
25285 case "$host_os" in
c0c3707f
CB
25286 # Guess yes on Linux systems.
25287 linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
25288 # Guess yes on glibc systems.
25289 *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;;
25290 # If we don't know, obey --enable-cross-guesses.
25291 *) gl_cv_func_readlink_works="$gl_cross_guess_normal" ;;
2196f55f
YQ
25292 esac
25293
25294else
25295 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25296/* end confdefs.h. */
25297#include <unistd.h>
25298
25299int
25300main ()
25301{
25302char buf[20];
25303 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
25304 ;
25305 return 0;
25306}
25307_ACEOF
25308if ac_fn_c_try_run "$LINENO"; then :
25309 gl_cv_func_readlink_works=yes
25310else
25311 gl_cv_func_readlink_works=no
25312fi
25313rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25314 conftest.$ac_objext conftest.beam conftest.$ac_ext
25315fi
25316
25317 rm -f conftest.link conftest.lnk2
25318fi
25319{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
25320$as_echo "$gl_cv_func_readlink_works" >&6; }
25321 case "$gl_cv_func_readlink_works" in
25322 *yes)
25323 if test "$gl_cv_decl_readlink_works" != yes; then
25324 REPLACE_READLINK=1
25325 fi
25326 ;;
25327 *)
25328
25329$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
25330
25331 REPLACE_READLINK=1
25332 ;;
25333 esac
25334 fi
25335
25336 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
25337
25338
25339
25340
25341
25342
25343
25344
25345 gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
25346
25347
25348 :
25349
25350 fi
25351
25352
25353
25354
25355
25356 GNULIB_READLINK=1
25357
25358
25359
25360
25361
25362$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
25363
25364
25365
25366
6a29c58e
YQ
25367
25368
6ec2e0f5
SDJ
25369 if test $gl_cv_func_malloc_posix = yes; then
25370
25371$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
25372
25373 else
25374 REPLACE_REALLOC=1
25375 fi
25376
25377 if test $REPLACE_REALLOC = 1; then
25378
25379
25380
25381
25382
25383
25384
25385
25386 gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
25387
25388 fi
25389
25390
25391
25392
25393
25394 GNULIB_REALLOC_POSIX=1
25395
25396
25397
25398
25399
25400$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
25401
25402
25403
25404
25405
25406
6a29c58e
YQ
25407
25408
25409 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
25410$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
d0ac1c44 25411if ${gl_cv_func_rename_slash_dst_works+:} false; then :
6a29c58e
YQ
25412 $as_echo_n "(cached) " >&6
25413else
25414 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
25415 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 25416 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
25417 # Assume that if we have lstat, we can also check symlinks.
25418 if test $ac_cv_func_lstat = yes; then
25419 ln -s conftest.f conftest.lnk
25420 fi
25421 if test "$cross_compiling" = yes; then :
25422 case "$host_os" in
c0c3707f
CB
25423 # Guess yes on Linux systems.
25424 linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
25425 # Guess yes on glibc systems.
25426 *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
25427 # Guess no on native Windows.
25428 mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
25429 # If we don't know, obey --enable-cross-guesses.
25430 *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
25431 esac
25432
25433else
25434 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25435/* end confdefs.h. */
25436
25437# include <stdio.h>
25438# include <stdlib.h>
25439
25440int
25441main ()
25442{
25443int result = 0;
25444 if (rename ("conftest.f1", "conftest.f2/") == 0)
25445 result |= 1;
25446 if (rename ("conftest.d1", "conftest.d2/") != 0)
25447 result |= 2;
25448#if HAVE_LSTAT
25449 if (rename ("conftest.f", "conftest.lnk/") == 0)
25450 result |= 4;
25451#endif
25452 return result;
25453
25454 ;
25455 return 0;
25456}
25457_ACEOF
25458if ac_fn_c_try_run "$LINENO"; then :
25459 gl_cv_func_rename_slash_dst_works=yes
25460else
25461 gl_cv_func_rename_slash_dst_works=no
25462fi
25463rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25464 conftest.$ac_objext conftest.beam conftest.$ac_ext
25465fi
25466
25467 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
25468
25469fi
25470{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
25471$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
25472 case "$gl_cv_func_rename_slash_dst_works" in
25473 *yes) ;;
25474 *)
25475 REPLACE_RENAME=1
25476
25477$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
25478
25479 ;;
25480 esac
25481
25482 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
25483$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
d0ac1c44 25484if ${gl_cv_func_rename_slash_src_works+:} false; then :
6a29c58e
YQ
25485 $as_echo_n "(cached) " >&6
25486else
25487 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
25488 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 25489 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
25490 # Assume that if we have lstat, we can also check symlinks.
25491 if test $ac_cv_func_lstat = yes; then
25492 ln -s conftest.f conftest.lnk
25493 fi
25494 if test "$cross_compiling" = yes; then :
25495 case "$host_os" in
c0c3707f
CB
25496 # Guess yes on Linux systems.
25497 linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
25498 # Guess yes on glibc systems.
25499 *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
25500 # Guess yes on native Windows.
25501 mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
25502 # If we don't know, obey --enable-cross-guesses.
25503 *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
25504 esac
25505
25506else
25507 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25508/* end confdefs.h. */
25509
25510# include <stdio.h>
25511# include <stdlib.h>
25512
25513int
25514main ()
25515{
25516int result = 0;
25517 if (rename ("conftest.f1/", "conftest.d3") == 0)
25518 result |= 1;
25519 if (rename ("conftest.d1/", "conftest.d2") != 0)
25520 result |= 2;
25521#if HAVE_LSTAT
25522 if (rename ("conftest.lnk/", "conftest.f") == 0)
25523 result |= 4;
25524#endif
25525 return result;
25526
25527 ;
25528 return 0;
25529}
25530_ACEOF
25531if ac_fn_c_try_run "$LINENO"; then :
25532 gl_cv_func_rename_slash_src_works=yes
25533else
25534 gl_cv_func_rename_slash_src_works=no
25535fi
25536rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25537 conftest.$ac_objext conftest.beam conftest.$ac_ext
25538fi
25539
25540 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
25541
25542fi
25543{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
25544$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
25545 case "$gl_cv_func_rename_slash_src_works" in
25546 *yes) ;;
25547 *)
25548 REPLACE_RENAME=1
25549
25550$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
25551
25552 ;;
25553 esac
25554
25555
25556 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
25557$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
d0ac1c44 25558if ${gl_cv_func_rename_link_works+:} false; then :
6a29c58e
YQ
25559 $as_echo_n "(cached) " >&6
25560else
25561 if test $ac_cv_func_link = yes; then
c0c3707f
CB
25562 if test $cross_compiling != yes; then
25563 rm -rf conftest.f conftest.f1 conftest.f2
25564 if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
25565 set x `ls -i conftest.f conftest.f1` && test "" = ""; then
25566 if test "$cross_compiling" = yes; then :
25567 :
6a29c58e
YQ
25568
25569else
25570 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25571/* end confdefs.h. */
25572
c0c3707f
CB
25573# include <errno.h>
25574# include <stdio.h>
25575# include <stdlib.h>
25576# include <unistd.h>
6a29c58e
YQ
25577
25578int
25579main ()
25580{
25581int result = 0;
c0c3707f
CB
25582 if (rename ("conftest.f", "conftest.f1"))
25583 result |= 1;
25584 if (unlink ("conftest.f1"))
25585 result |= 2;
25586
25587 /* Allow either the POSIX-required behavior, where the
25588 previous rename kept conftest.f, or the (better) NetBSD
25589 behavior, where it removed conftest.f. */
25590 if (rename ("conftest.f", "conftest.f") != 0
25591 && errno != ENOENT)
25592 result |= 4;
25593
25594 if (rename ("conftest.f1", "conftest.f1") == 0)
25595 result |= 8;
25596 if (rename ("conftest.f2", "conftest.f2") != 0)
25597 result |= 16;
25598 return result;
6a29c58e
YQ
25599
25600 ;
25601 return 0;
25602}
25603_ACEOF
25604if ac_fn_c_try_run "$LINENO"; then :
25605 gl_cv_func_rename_link_works=yes
25606else
25607 gl_cv_func_rename_link_works=no
25608fi
25609rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25610 conftest.$ac_objext conftest.beam conftest.$ac_ext
25611fi
25612
c0c3707f
CB
25613 else
25614 gl_cv_func_rename_link_works="guessing no"
25615 fi
25616 rm -rf conftest.f conftest.f1 conftest.f2
6a29c58e 25617 else
c0c3707f
CB
25618 case "$host_os" in
25619 # Guess yes on Linux systems.
25620 linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
25621 # Guess yes on glibc systems.
25622 *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
25623 # Guess yes on native Windows.
25624 mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
25625 # If we don't know, obey --enable-cross-guesses.
25626 *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
25627 esac
6a29c58e 25628 fi
6a29c58e
YQ
25629 else
25630 gl_cv_func_rename_link_works=yes
25631 fi
25632
25633fi
25634{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
25635$as_echo "$gl_cv_func_rename_link_works" >&6; }
25636 case "$gl_cv_func_rename_link_works" in
25637 *yes) ;;
25638 *)
25639 REPLACE_RENAME=1
25640
25641$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
25642
25643 ;;
25644 esac
25645
25646 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
25647$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
d0ac1c44 25648if ${gl_cv_func_rename_dest_works+:} false; then :
6a29c58e
YQ
25649 $as_echo_n "(cached) " >&6
25650else
25651 rm -rf conftest.f conftest.d1 conftest.d2
25652 touch conftest.f && mkdir conftest.d1 conftest.d2 ||
d0ac1c44 25653 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
25654 if test "$cross_compiling" = yes; then :
25655 case "$host_os" in
c0c3707f
CB
25656 # Guess yes on Linux systems.
25657 linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
25658 # Guess yes on glibc systems.
25659 *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
25660 # Guess no on native Windows.
25661 mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
25662 # If we don't know, obey --enable-cross-guesses.
25663 *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
25664 esac
25665
25666else
25667 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25668/* end confdefs.h. */
25669
25670# include <stdio.h>
25671# include <stdlib.h>
25672
25673int
25674main ()
25675{
25676int result = 0;
25677 if (rename ("conftest.d1", "conftest.d2") != 0)
25678 result |= 1;
25679 if (rename ("conftest.d2", "conftest.f") == 0)
25680 result |= 2;
25681 return result;
25682
25683 ;
25684 return 0;
25685}
25686_ACEOF
25687if ac_fn_c_try_run "$LINENO"; then :
25688 gl_cv_func_rename_dest_works=yes
25689else
25690 gl_cv_func_rename_dest_works=no
25691fi
25692rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25693 conftest.$ac_objext conftest.beam conftest.$ac_ext
25694fi
25695
25696 rm -rf conftest.f conftest.d1 conftest.d2
25697
25698fi
25699{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
25700$as_echo "$gl_cv_func_rename_dest_works" >&6; }
25701 case "$gl_cv_func_rename_dest_works" in
25702 *yes) ;;
25703 *)
25704 REPLACE_RENAME=1
25705
25706$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
25707
25708 ;;
25709 esac
25710
25711 if test $REPLACE_RENAME = 1; then
25712
25713
25714
25715
25716
25717
25718
25719
25720 gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext"
25721
25722 fi
25723
25724
25725
25726
25727
25728 GNULIB_RENAME=1
25729
25730
25731
25732
25733
25734$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
25735
25736
25737
25738
25739
25740
6ec2e0f5
SDJ
25741 for ac_func in rewinddir
25742do :
25743 ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
d0ac1c44 25744if test "x$ac_cv_func_rewinddir" = xyes; then :
6ec2e0f5
SDJ
25745 cat >>confdefs.h <<_ACEOF
25746#define HAVE_REWINDDIR 1
25747_ACEOF
25748
25749fi
25750done
25751
25752 if test $ac_cv_func_rewinddir = no; then
25753 HAVE_REWINDDIR=0
25754 fi
25755
25756 if test $HAVE_REWINDDIR = 0; then
25757
25758
25759
25760
25761
25762
25763
25764
25765 gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext"
25766
25767 fi
25768
25769
25770
25771
25772
25773 GNULIB_REWINDDIR=1
25774
25775
25776
25777
25778
25779$as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
25780
25781
25782
25783
25784
25785
6a29c58e
YQ
25786 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
25787$as_echo_n "checking whether rmdir works... " >&6; }
d0ac1c44 25788if ${gl_cv_func_rmdir_works+:} false; then :
6a29c58e
YQ
25789 $as_echo_n "(cached) " >&6
25790else
25791 mkdir conftest.dir
25792 touch conftest.file
25793 if test "$cross_compiling" = yes; then :
25794 case "$host_os" in
c0c3707f
CB
25795 # Guess yes on Linux systems.
25796 linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
25797 # Guess yes on glibc systems.
25798 *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
25799 # Guess no on native Windows.
25800 mingw*) gl_cv_func_rmdir_works="guessing no" ;;
25801 # If we don't know, obey --enable-cross-guesses.
25802 *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
25803 esac
25804
25805else
25806 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25807/* end confdefs.h. */
25808#include <stdio.h>
25809 #include <errno.h>
25810 #if HAVE_UNISTD_H
25811 # include <unistd.h>
25812 #else /* on Windows with MSVC */
25813 # include <direct.h>
25814 #endif
25815
25816int
25817main ()
25818{
25819int result = 0;
25820 if (!rmdir ("conftest.file/"))
25821 result |= 1;
25822 else if (errno != ENOTDIR)
25823 result |= 2;
25824 if (!rmdir ("conftest.dir/./"))
25825 result |= 4;
25826 return result;
25827
25828 ;
25829 return 0;
25830}
25831_ACEOF
25832if ac_fn_c_try_run "$LINENO"; then :
25833 gl_cv_func_rmdir_works=yes
25834else
25835 gl_cv_func_rmdir_works=no
25836fi
25837rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25838 conftest.$ac_objext conftest.beam conftest.$ac_ext
25839fi
25840
25841 rm -rf conftest.dir conftest.file
25842fi
25843{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
25844$as_echo "$gl_cv_func_rmdir_works" >&6; }
25845 case "$gl_cv_func_rmdir_works" in
25846 *yes) ;;
25847 *)
25848 REPLACE_RMDIR=1
25849 ;;
25850 esac
25851
25852 if test $REPLACE_RMDIR = 1; then
25853
25854
25855
25856
25857
25858
25859
25860
25861 gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
25862
25863 fi
25864
25865
25866
25867
25868
25869 GNULIB_RMDIR=1
25870
25871
25872
25873
25874
25875$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
25876
25877
25878
25879
0750520d 25880
5e8754f9
SDJ
25881
25882
25883
3d99e817
AK
25884 if test $ac_cv_func_setenv = no; then
25885 HAVE_SETENV=0
25886 else
25887 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
25888$as_echo_n "checking whether setenv validates arguments... " >&6; }
d0ac1c44 25889if ${gl_cv_func_setenv_works+:} false; then :
3d99e817
AK
25890 $as_echo_n "(cached) " >&6
25891else
25892 if test "$cross_compiling" = yes; then :
25893 case "$host_os" in
c0c3707f
CB
25894 # Guess yes on glibc systems.
25895 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
25896 # Guess yes on musl systems.
25897 *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
25898 # If we don't know, obey --enable-cross-guesses.
25899 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
25900 esac
25901
25902else
25903 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25904/* end confdefs.h. */
25905
25906 #include <stdlib.h>
25907 #include <errno.h>
25908 #include <string.h>
25909
25910int
25911main ()
25912{
25913
25914 int result = 0;
25915 {
25916 if (setenv ("", "", 0) != -1)
25917 result |= 1;
25918 else if (errno != EINVAL)
25919 result |= 2;
25920 }
25921 {
25922 if (setenv ("a", "=", 1) != 0)
25923 result |= 4;
25924 else if (strcmp (getenv ("a"), "=") != 0)
25925 result |= 8;
25926 }
25927 return result;
25928
25929 ;
25930 return 0;
25931}
25932_ACEOF
25933if ac_fn_c_try_run "$LINENO"; then :
25934 gl_cv_func_setenv_works=yes
25935else
25936 gl_cv_func_setenv_works=no
25937fi
25938rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25939 conftest.$ac_objext conftest.beam conftest.$ac_ext
25940fi
25941
25942fi
25943{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
25944$as_echo "$gl_cv_func_setenv_works" >&6; }
25945 case "$gl_cv_func_setenv_works" in
25946 *yes) ;;
25947 *)
25948 REPLACE_SETENV=1
25949 ;;
25950 esac
25951 fi
25952
25953 if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
25954
25955
25956
25957
25958
25959
25960
25961
25962 gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
25963
25964 fi
25965
25966
25967
25968
25969
25970 GNULIB_SETENV=1
25971
25972
25973
25974
25975
25976$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
25977
25978
25979
25980
25981
0750520d
PA
25982
25983
25984
5df4cba6
SM
25985 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
25986$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
25987if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
25988 $as_echo_n "(cached) " >&6
25989else
25990 case "$host_os" in
25991 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
25992 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
25993 gl_cv_func_setlocale_null_all_mtsafe=no ;;
25994 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
25995 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
25996 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
25997 # If we don't know, obey --enable-cross-guesses.
25998 *)
25999 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
26000 esac
26001
26002fi
26003{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
26004$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
26005 case "$host_os" in
26006 mingw*) ;;
26007 *)
26008 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
26009 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
26010 fi
26011 ;;
26012 esac
26013 case "$gl_cv_func_setlocale_null_all_mtsafe" in
26014 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
26015 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
26016 esac
26017
26018cat >>confdefs.h <<_ACEOF
26019#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
26020_ACEOF
26021
26022
26023 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
26024$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
26025if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
26026 $as_echo_n "(cached) " >&6
26027else
26028 case "$host_os" in
26029 # Guess no on OpenBSD, AIX.
26030 openbsd* | aix*)
26031 gl_cv_func_setlocale_null_one_mtsafe=no ;;
26032 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
26033 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
26034 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
26035 # If we don't know, obey --enable-cross-guesses.
26036 *)
26037 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
26038 esac
26039
26040fi
26041{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
26042$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
26043 case "$host_os" in
26044 mingw*) ;;
26045 *)
26046 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
26047 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
26048 fi
26049 ;;
26050 esac
26051 case "$gl_cv_func_setlocale_null_one_mtsafe" in
26052 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
26053 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
26054 esac
26055
26056cat >>confdefs.h <<_ACEOF
26057#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
26058_ACEOF
26059
26060
26061 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
26062 case "$host_os" in
26063 mingw*) LIB_SETLOCALE_NULL= ;;
26064 *)
26065
26066
26067 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
26068$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
26069if ${gl_cv_have_weak+:} false; then :
26070 $as_echo_n "(cached) " >&6
26071else
26072 gl_cv_have_weak=no
26073 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26074/* end confdefs.h. */
26075extern void xyzzy ();
26076#pragma weak xyzzy
26077int
26078main ()
26079{
26080xyzzy();
26081 ;
26082 return 0;
26083}
26084_ACEOF
26085if ac_fn_c_try_link "$LINENO"; then :
26086 gl_cv_have_weak=maybe
26087fi
26088rm -f core conftest.err conftest.$ac_objext \
26089 conftest$ac_exeext conftest.$ac_ext
26090 if test $gl_cv_have_weak = maybe; then
26091 if test "$cross_compiling" = yes; then :
26092 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26093/* end confdefs.h. */
26094#ifdef __ELF__
26095 Extensible Linking Format
26096 #endif
26097
26098_ACEOF
26099if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
26100 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
26101 gl_cv_have_weak="guessing yes"
26102else
26103 gl_cv_have_weak="guessing no"
26104fi
26105rm -f conftest*
26106
26107
26108else
26109 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26110/* end confdefs.h. */
26111
26112#include <stdio.h>
26113#pragma weak fputs
26114int main ()
26115{
26116 return (fputs == NULL);
26117}
26118_ACEOF
26119if ac_fn_c_try_run "$LINENO"; then :
26120 gl_cv_have_weak=yes
26121else
26122 gl_cv_have_weak=no
26123fi
26124rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26125 conftest.$ac_objext conftest.beam conftest.$ac_ext
26126fi
26127
26128 fi
26129 case " $LDFLAGS " in
26130 *" -static "*) gl_cv_have_weak=no ;;
26131 esac
26132 case "$gl_cv_have_weak" in
26133 *yes)
26134 case "$host_os" in
26135 freebsd* | dragonfly*)
26136 : > conftest1.c
26137 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
26138 cat <<EOF > conftest2.c
26139#include <pthread.h>
26140#pragma weak pthread_mutexattr_gettype
26141int main ()
26142{
26143 return (pthread_mutexattr_gettype != NULL);
26144}
26145EOF
26146 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
26147 || gl_cv_have_weak=no
26148 rm -f conftest1.c libempty.so conftest2.c conftest
26149 ;;
26150 esac
26151 ;;
26152 esac
26153
26154fi
26155{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
26156$as_echo "$gl_cv_have_weak" >&6; }
26157 case "$gl_cv_have_weak" in
26158 *yes)
26159
26160$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
26161
26162 ;;
26163 esac
26164
26165 case "$gl_cv_have_weak" in
26166 *yes) LIB_SETLOCALE_NULL= ;;
26167 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
26168 esac
26169 ;;
26170 esac
26171 else
26172 LIB_SETLOCALE_NULL=
26173 fi
26174
26175
26176 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
26177
26178
26179
26180
26181
26182
26183
26184
26185 gl_LIBOBJS="$gl_LIBOBJS setlocale-lock.$ac_objext"
26186
26187
26188
26189
26190 CFLAG_VISIBILITY=
26191 HAVE_VISIBILITY=0
26192 if test -n "$GCC"; then
26193 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
26194$as_echo_n "checking whether the -Werror option is usable... " >&6; }
26195if ${gl_cv_cc_vis_werror+:} false; then :
26196 $as_echo_n "(cached) " >&6
26197else
26198 gl_save_CFLAGS="$CFLAGS"
26199 CFLAGS="$CFLAGS -Werror"
26200 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26201/* end confdefs.h. */
26202
26203int
26204main ()
26205{
26206
26207 ;
26208 return 0;
26209}
26210_ACEOF
26211if ac_fn_c_try_compile "$LINENO"; then :
26212 gl_cv_cc_vis_werror=yes
26213else
26214 gl_cv_cc_vis_werror=no
26215fi
26216rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26217 CFLAGS="$gl_save_CFLAGS"
26218
26219fi
26220{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
26221$as_echo "$gl_cv_cc_vis_werror" >&6; }
26222 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
26223$as_echo_n "checking for simple visibility declarations... " >&6; }
26224if ${gl_cv_cc_visibility+:} false; then :
26225 $as_echo_n "(cached) " >&6
26226else
26227 gl_save_CFLAGS="$CFLAGS"
26228 CFLAGS="$CFLAGS -fvisibility=hidden"
26229 if test $gl_cv_cc_vis_werror = yes; then
26230 CFLAGS="$CFLAGS -Werror"
26231 fi
26232 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26233/* end confdefs.h. */
26234extern __attribute__((__visibility__("hidden"))) int hiddenvar;
26235 extern __attribute__((__visibility__("default"))) int exportedvar;
26236 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
26237 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
26238 void dummyfunc (void) {}
26239
26240int
26241main ()
26242{
26243
26244 ;
26245 return 0;
26246}
26247_ACEOF
26248if ac_fn_c_try_compile "$LINENO"; then :
26249 gl_cv_cc_visibility=yes
26250else
26251 gl_cv_cc_visibility=no
26252fi
26253rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26254 CFLAGS="$gl_save_CFLAGS"
26255
26256fi
26257{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
26258$as_echo "$gl_cv_cc_visibility" >&6; }
26259 if test $gl_cv_cc_visibility = yes; then
26260 CFLAG_VISIBILITY="-fvisibility=hidden"
26261 HAVE_VISIBILITY=1
26262 fi
26263 fi
26264
26265
26266
26267cat >>confdefs.h <<_ACEOF
26268#define HAVE_VISIBILITY $HAVE_VISIBILITY
26269_ACEOF
26270
26271
26272
26273 fi
26274
26275
26276
26277
26278
26279 GNULIB_SETLOCALE_NULL=1
26280
26281
26282
26283
26284
26285$as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h
26286
26287
26288
26289
26290
26291
26292
26293
0750520d
PA
26294
26295
26296
26297
26298
26299
26300 if test $gl_cv_have_include_next = yes; then
26301 gl_cv_next_signal_h='<'signal.h'>'
26302 else
26303 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
26304$as_echo_n "checking absolute name of <signal.h>... " >&6; }
d0ac1c44 26305if ${gl_cv_next_signal_h+:} false; then :
0750520d
PA
26306 $as_echo_n "(cached) " >&6
26307else
26308
26309
26310
26311 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26312/* end confdefs.h. */
26313#include <signal.h>
26314_ACEOF
26315 case "$host_os" in
26316 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26317 *) gl_absname_cpp="$ac_cpp" ;;
26318 esac
26319
26320 case "$host_os" in
26321 mingw*)
26322 gl_dirsep_regex='[/\\]'
26323 ;;
26324 *)
26325 gl_dirsep_regex='\/'
26326 ;;
26327 esac
26328 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26329 gl_header_literal_regex=`echo 'signal.h' \
26330 | sed -e "$gl_make_literal_regex_sed"`
26331 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26332 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26333 s|^/[^/]|//&|
26334 p
26335 q
26336 }'
26337
26338 gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26339 sed -n "$gl_absolute_header_sed"`
26340
26341 gl_header=$gl_cv_absolute_signal_h
26342 gl_cv_next_signal_h='"'$gl_header'"'
26343
26344
26345fi
26346{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
26347$as_echo "$gl_cv_next_signal_h" >&6; }
26348 fi
26349 NEXT_SIGNAL_H=$gl_cv_next_signal_h
26350
26351 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26352 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
26353 gl_next_as_first_directive='<'signal.h'>'
26354 else
26355 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
26356 gl_next_as_first_directive=$gl_cv_next_signal_h
26357 fi
26358 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
26359
26360
26361
26362
26363
26364# AIX declares sig_atomic_t to already include volatile, and C89 compilers
26365# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
26366 ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
26367#include <signal.h>
26368
26369"
d0ac1c44 26370if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
0750520d
PA
26371
26372else
26373 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
26374fi
26375
26376
26377
26378
26379
26380
26381
26382 ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
26383#include <signal.h>
26384
26385"
d0ac1c44 26386if test "x$ac_cv_type_sighandler_t" = xyes; then :
0750520d
PA
26387
26388else
26389 HAVE_SIGHANDLER_T=0
26390fi
26391
26392
26393
0750520d 26394
0750520d
PA
26395
26396
725e2999
JB
26397 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
26398/* <sys/types.h> is not needed according to POSIX, but the
26399 <sys/socket.h> in i386-unknown-freebsd4.10 and
26400 powerpc-apple-darwin5.5 required it. */
26401#include <sys/types.h>
26402#if HAVE_SYS_SOCKET_H
26403# include <sys/socket.h>
26404#elif HAVE_WS2TCPIP_H
26405# include <ws2tcpip.h>
26406#endif
26407
26408"
26409if test "x$ac_cv_type_socklen_t" = xyes; then :
26410
26411else
26412 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
26413$as_echo_n "checking for socklen_t equivalent... " >&6; }
c0c3707f 26414if ${gl_cv_socklen_t_equiv+:} false; then :
725e2999
JB
26415 $as_echo_n "(cached) " >&6
26416else
26417 # Systems have either "struct sockaddr *" or
26418 # "void *" as the second argument to getpeername
26419 gl_cv_socklen_t_equiv=
26420 for arg2 in "struct sockaddr" void; do
26421 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
26422 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26423/* end confdefs.h. */
26424#include <sys/types.h>
26425 #include <sys/socket.h>
26426
26427 int getpeername (int, $arg2 *, $t *);
26428int
26429main ()
26430{
26431$t len;
26432 getpeername (0, 0, &len);
26433 ;
26434 return 0;
26435}
26436_ACEOF
26437if ac_fn_c_try_compile "$LINENO"; then :
26438 gl_cv_socklen_t_equiv="$t"
26439fi
26440rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26441 test "$gl_cv_socklen_t_equiv" != "" && break
26442 done
26443 test "$gl_cv_socklen_t_equiv" != "" && break
26444 done
c0c3707f
CB
26445 if test "$gl_cv_socklen_t_equiv" = ""; then
26446 as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
26447 fi
725e2999
JB
26448
26449fi
c0c3707f 26450{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
725e2999
JB
26451$as_echo "$gl_cv_socklen_t_equiv" >&6; }
26452
26453cat >>confdefs.h <<_ACEOF
26454#define socklen_t $gl_cv_socklen_t_equiv
26455_ACEOF
26456
26457fi
26458
0750520d 26459
63ce7108
TT
26460 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
26461$as_echo_n "checking for ssize_t... " >&6; }
d0ac1c44 26462if ${gt_cv_ssize_t+:} false; then :
63ce7108
TT
26463 $as_echo_n "(cached) " >&6
26464else
26465 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26466/* end confdefs.h. */
26467#include <sys/types.h>
26468int
26469main ()
26470{
26471int x = sizeof (ssize_t *) + sizeof (ssize_t);
26472 return !x;
26473 ;
26474 return 0;
26475}
26476_ACEOF
26477if ac_fn_c_try_compile "$LINENO"; then :
26478 gt_cv_ssize_t=yes
26479else
26480 gt_cv_ssize_t=no
26481fi
26482rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26483fi
26484{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
26485$as_echo "$gt_cv_ssize_t" >&6; }
26486 if test $gt_cv_ssize_t = no; then
26487
26488$as_echo "#define ssize_t int" >>confdefs.h
26489
26490 fi
26491
26492
26493
26494
472fa5ee 26495
c0c3707f
CB
26496 case "$host_os" in
26497 mingw*)
26498 REPLACE_STAT=1
26499 ;;
26500 *)
26501 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
26502$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
26503if ${gl_cv_func_stat_file_slash+:} false; then :
2196f55f
YQ
26504 $as_echo_n "(cached) " >&6
26505else
c0c3707f
CB
26506 touch conftest.tmp
26507 # Assume that if we have lstat, we can also check symlinks.
26508 if test $ac_cv_func_lstat = yes; then
26509 ln -s conftest.tmp conftest.lnk
26510 fi
26511 if test "$cross_compiling" = yes; then :
26512 case "$host_os" in
26513 # Guess yes on Linux systems.
26514 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
26515 # Guess yes on glibc systems.
26516 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
26517 # If we don't know, obey --enable-cross-guesses.
26518 *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
26519 esac
26520
2196f55f
YQ
26521else
26522 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26523/* end confdefs.h. */
26524#include <sys/stat.h>
26525
26526int
26527main ()
26528{
c0c3707f
CB
26529int result = 0;
26530 struct stat st;
26531 if (!stat ("conftest.tmp/", &st))
26532 result |= 1;
26533#if HAVE_LSTAT
26534 if (!stat ("conftest.lnk/", &st))
26535 result |= 2;
26536#endif
26537 return result;
26538
2196f55f
YQ
26539 ;
26540 return 0;
26541}
26542_ACEOF
26543if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 26544 gl_cv_func_stat_file_slash=yes
2196f55f 26545else
c0c3707f 26546 gl_cv_func_stat_file_slash=no
2196f55f
YQ
26547fi
26548rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26549 conftest.$ac_objext conftest.beam conftest.$ac_ext
26550fi
26551
c0c3707f 26552 rm -f conftest.tmp conftest.lnk
2196f55f 26553fi
c0c3707f
CB
26554{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
26555$as_echo "$gl_cv_func_stat_file_slash" >&6; }
26556 case $gl_cv_func_stat_file_slash in
26557 *no)
26558 REPLACE_STAT=1
26559
26560$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
26561;;
26562 esac
26563 case $host_os in
26564 solaris*)
26565 REPLACE_FSTAT=1 ;;
26566 esac
26567 ;;
26568 esac
26569
26570 if test $REPLACE_STAT = 1; then
26571
26572
26573
26574
26575
26576
26577
26578
26579 gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
26580
26581 case "$host_os" in
26582 mingw*)
26583
26584
26585
26586
26587
26588
26589
26590
26591 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
26592
26593 ;;
26594 esac
26595
26596
26597 :
26598
26599 fi
26600
26601
26602
26603
26604
26605 GNULIB_STAT=1
26606
26607
26608
26609
26610
26611$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
26612
26613
26614
26615
7a6dbc2f 26616
c0c3707f
CB
26617
26618
26619 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>
26620 #include <sys/stat.h>
26621"
26622if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
26623
26624cat >>confdefs.h <<_ACEOF
26625#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
26626_ACEOF
26627
26628{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
26629$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
26630if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
26631 $as_echo_n "(cached) " >&6
2196f55f 26632else
5e8754f9
SDJ
26633 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26634/* end confdefs.h. */
c0c3707f
CB
26635
26636 #include <sys/types.h>
26637 #include <sys/stat.h>
26638 #if HAVE_SYS_TIME_H
26639 # include <sys/time.h>
26640 #endif
26641 #include <time.h>
26642 struct timespec ts;
26643 struct stat st;
7a6dbc2f 26644
5e8754f9
SDJ
26645int
26646main ()
26647{
c0c3707f
CB
26648
26649 st.st_atim = ts;
7a6dbc2f 26650
5e8754f9
SDJ
26651 ;
26652 return 0;
26653}
26654_ACEOF
c0c3707f
CB
26655if ac_fn_c_try_compile "$LINENO"; then :
26656 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
5e8754f9 26657else
c0c3707f 26658 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
2196f55f 26659fi
c0c3707f 26660rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2196f55f 26661fi
c0c3707f
CB
26662{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
26663$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
26664 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
2196f55f 26665
c0c3707f 26666$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
2196f55f 26667
c0c3707f
CB
26668 fi
26669else
26670 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>
26671 #include <sys/stat.h>
26672"
26673if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
2196f55f 26674
c0c3707f
CB
26675cat >>confdefs.h <<_ACEOF
26676#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
26677_ACEOF
2196f55f 26678
c0c3707f
CB
26679
26680else
26681 ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
26682 #include <sys/stat.h>
26683"
26684if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
26685
26686cat >>confdefs.h <<_ACEOF
26687#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
26688_ACEOF
2196f55f
YQ
26689
26690
c0c3707f
CB
26691else
26692 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>
26693 #include <sys/stat.h>
26694"
26695if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
2196f55f 26696
c0c3707f
CB
26697cat >>confdefs.h <<_ACEOF
26698#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
26699_ACEOF
2196f55f
YQ
26700
26701
c0c3707f 26702fi
2196f55f 26703
c0c3707f 26704fi
2196f55f 26705
c0c3707f 26706fi
2196f55f 26707
c0c3707f 26708fi
2196f55f
YQ
26709
26710
26711
26712
26713
c0c3707f
CB
26714 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>
26715 #include <sys/stat.h>
26716"
26717if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
2196f55f 26718
c0c3707f
CB
26719cat >>confdefs.h <<_ACEOF
26720#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
26721_ACEOF
2196f55f
YQ
26722
26723
c0c3707f
CB
26724else
26725 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
26726 #include <sys/stat.h>
26727"
26728if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
2196f55f 26729
c0c3707f
CB
26730cat >>confdefs.h <<_ACEOF
26731#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
26732_ACEOF
2196f55f 26733
2196f55f 26734
c0c3707f
CB
26735else
26736 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>
26737 #include <sys/stat.h>
26738"
26739if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
26740
26741cat >>confdefs.h <<_ACEOF
26742#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
26743_ACEOF
26744
26745
26746fi
26747
26748fi
5e8754f9 26749
c0c3707f 26750fi
2196f55f
YQ
26751
26752
26753
725e2999
JB
26754 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
26755$as_echo_n "checking for working stdalign.h... " >&6; }
26756if ${gl_cv_header_working_stdalign_h+:} false; then :
26757 $as_echo_n "(cached) " >&6
26758else
26759 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26760/* end confdefs.h. */
26761#include <stdalign.h>
26762 #include <stddef.h>
26763
26764 /* Test that alignof yields a result consistent with offsetof.
26765 This catches GCC bug 52023
c0c3707f 26766 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
725e2999
JB
26767 #ifdef __cplusplus
26768 template <class t> struct alignof_helper { char a; t b; };
26769 # define ao(type) offsetof (alignof_helper<type>, b)
26770 #else
26771 # define ao(type) offsetof (struct { char a; type b; }, b)
26772 #endif
26773 char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
26774 char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
26775 char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
26776
26777 /* Test _Alignas only on platforms where gnulib can help. */
26778 #if \
26779 ((defined __cplusplus && 201103 <= __cplusplus) \
26780 || (defined __APPLE__ && defined __MACH__ \
26781 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
26782 : __GNUC__) \
c0c3707f
CB
26783 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
26784 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
725e2999
JB
26785 || 1300 <= _MSC_VER)
26786 struct alignas_test { char c; char alignas (8) alignas_8; };
26787 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
26788 ? 1 : -1];
26789 #endif
26790
26791int
26792main ()
26793{
26794
26795 ;
26796 return 0;
26797}
26798_ACEOF
26799if ac_fn_c_try_compile "$LINENO"; then :
26800 gl_cv_header_working_stdalign_h=yes
26801else
26802 gl_cv_header_working_stdalign_h=no
26803fi
26804rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26805fi
26806{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
26807$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
26808
26809 if test $gl_cv_header_working_stdalign_h = yes; then
26810 STDALIGN_H=''
26811 else
26812 STDALIGN_H='stdalign.h'
26813 fi
26814
26815
26816 if test -n "$STDALIGN_H"; then
26817 GL_GENERATE_STDALIGN_H_TRUE=
26818 GL_GENERATE_STDALIGN_H_FALSE='#'
26819else
26820 GL_GENERATE_STDALIGN_H_TRUE='#'
26821 GL_GENERATE_STDALIGN_H_FALSE=
26822fi
26823
26824
26825
2196f55f
YQ
26826
26827
63ce7108 26828
c0c3707f
CB
26829 if test "$ac_cv_header_stdbool_h" = yes; then
26830 case "$host_os" in
26831 solaris*)
26832 if test -z "$GCC"; then
26833 STDBOOL_H='stdbool.h'
26834 else
26835 STDBOOL_H=''
26836 fi
26837 ;;
26838 *)
26839 STDBOOL_H=''
26840 ;;
26841 esac
63ce7108
TT
26842 else
26843 STDBOOL_H='stdbool.h'
26844 fi
26845
26846 if test -n "$STDBOOL_H"; then
26847 GL_GENERATE_STDBOOL_H_TRUE=
26848 GL_GENERATE_STDBOOL_H_FALSE='#'
26849else
26850 GL_GENERATE_STDBOOL_H_TRUE='#'
26851 GL_GENERATE_STDBOOL_H_FALSE=
26852fi
26853
26854
26855 if test "$ac_cv_type__Bool" = yes; then
26856 HAVE__BOOL=1
26857 else
26858 HAVE__BOOL=0
26859 fi
26860
26861
26862
26863
26864
26865 STDDEF_H=
4a626d0a 26866
c0c3707f
CB
26867 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
26868$as_echo_n "checking for good max_align_t... " >&6; }
26869if ${gl_cv_type_max_align_t+:} false; then :
26870 $as_echo_n "(cached) " >&6
26871else
26872 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26873/* end confdefs.h. */
26874#include <stddef.h>
26875 unsigned int s = sizeof (max_align_t);
26876 #if defined __GNUC__ || defined __IBM__ALIGNOF__
26877 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
26878 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
26879 #endif
26880
26881int
26882main ()
26883{
4a626d0a 26884
c0c3707f
CB
26885 ;
26886 return 0;
26887}
26888_ACEOF
26889if ac_fn_c_try_compile "$LINENO"; then :
26890 gl_cv_type_max_align_t=yes
4a626d0a 26891else
c0c3707f 26892 gl_cv_type_max_align_t=no
4a626d0a 26893fi
c0c3707f
CB
26894rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26895
26896fi
26897{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
26898$as_echo "$gl_cv_type_max_align_t" >&6; }
26899 if test $gl_cv_type_max_align_t = no; then
26900 HAVE_MAX_ALIGN_T=0
26901 STDDEF_H=stddef.h
26902 fi
4a626d0a 26903
63ce7108
TT
26904 if test $gt_cv_c_wchar_t = no; then
26905 HAVE_WCHAR_T=0
26906 STDDEF_H=stddef.h
26907 fi
c0c3707f 26908
63ce7108
TT
26909 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
26910$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
d0ac1c44 26911if ${gl_cv_decl_null_works+:} false; then :
63ce7108
TT
26912 $as_echo_n "(cached) " >&6
26913else
26914 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26915/* end confdefs.h. */
26916#include <stddef.h>
26917 int test[2 * (sizeof NULL == sizeof (void *)) -1];
26918
26919int
26920main ()
26921{
26922
26923 ;
26924 return 0;
26925}
26926_ACEOF
26927if ac_fn_c_try_compile "$LINENO"; then :
26928 gl_cv_decl_null_works=yes
26929else
26930 gl_cv_decl_null_works=no
26931fi
26932rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26933fi
26934{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
26935$as_echo "$gl_cv_decl_null_works" >&6; }
26936 if test $gl_cv_decl_null_works = no; then
26937 REPLACE_NULL=1
26938 STDDEF_H=stddef.h
26939 fi
26940
c0c3707f 26941
63ce7108
TT
26942 if test -n "$STDDEF_H"; then
26943 GL_GENERATE_STDDEF_H_TRUE=
26944 GL_GENERATE_STDDEF_H_FALSE='#'
26945else
26946 GL_GENERATE_STDDEF_H_TRUE='#'
26947 GL_GENERATE_STDDEF_H_FALSE=
26948fi
26949
26950 if test -n "$STDDEF_H"; then
26951
26952
26953
26954
26955
26956
26957
26958
26959 if test $gl_cv_have_include_next = yes; then
26960 gl_cv_next_stddef_h='<'stddef.h'>'
26961 else
26962 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
26963$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
d0ac1c44 26964if ${gl_cv_next_stddef_h+:} false; then :
63ce7108
TT
26965 $as_echo_n "(cached) " >&6
26966else
26967
4a626d0a
PA
26968
26969
26970 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63ce7108
TT
26971/* end confdefs.h. */
26972#include <stddef.h>
63ce7108 26973_ACEOF
4a626d0a
PA
26974 case "$host_os" in
26975 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26976 *) gl_absname_cpp="$ac_cpp" ;;
26977 esac
63ce7108 26978
4a626d0a
PA
26979 case "$host_os" in
26980 mingw*)
26981 gl_dirsep_regex='[/\\]'
26982 ;;
26983 *)
26984 gl_dirsep_regex='\/'
26985 ;;
26986 esac
26987 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26988 gl_header_literal_regex=`echo 'stddef.h' \
26989 | sed -e "$gl_make_literal_regex_sed"`
26990 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26991 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26992 s|^/[^/]|//&|
26993 p
26994 q
26995 }'
63ce7108 26996
4a626d0a
PA
26997 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26998 sed -n "$gl_absolute_header_sed"`
26999
27000 gl_header=$gl_cv_absolute_stddef_h
27001 gl_cv_next_stddef_h='"'$gl_header'"'
63ce7108
TT
27002
27003
27004fi
27005{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
27006$as_echo "$gl_cv_next_stddef_h" >&6; }
27007 fi
27008 NEXT_STDDEF_H=$gl_cv_next_stddef_h
27009
27010 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27011 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27012 gl_next_as_first_directive='<'stddef.h'>'
27013 else
27014 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27015 gl_next_as_first_directive=$gl_cv_next_stddef_h
27016 fi
27017 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
27018
27019
27020
27021
27022 fi
27023
27024
27025
27026
49e4877c 27027 $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
63ce7108
TT
27028
27029
27030
98399780
YQ
27031
27032
27033
27034
27035
4a626d0a
PA
27036
27037
6a29c58e
YQ
27038 if test $gl_cv_have_include_next = yes; then
27039 gl_cv_next_stdio_h='<'stdio.h'>'
27040 else
27041 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
27042$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
d0ac1c44 27043if ${gl_cv_next_stdio_h+:} false; then :
6a29c58e
YQ
27044 $as_echo_n "(cached) " >&6
27045else
27046
4a626d0a
PA
27047
27048
27049 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6a29c58e
YQ
27050/* end confdefs.h. */
27051#include <stdio.h>
6a29c58e 27052_ACEOF
4a626d0a
PA
27053 case "$host_os" in
27054 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27055 *) gl_absname_cpp="$ac_cpp" ;;
27056 esac
27057
27058 case "$host_os" in
27059 mingw*)
27060 gl_dirsep_regex='[/\\]'
27061 ;;
27062 *)
27063 gl_dirsep_regex='\/'
27064 ;;
27065 esac
27066 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27067 gl_header_literal_regex=`echo 'stdio.h' \
27068 | sed -e "$gl_make_literal_regex_sed"`
27069 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27070 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27071 s|^/[^/]|//&|
27072 p
27073 q
27074 }'
6a29c58e 27075
4a626d0a
PA
27076 gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27077 sed -n "$gl_absolute_header_sed"`
6a29c58e 27078
4a626d0a
PA
27079 gl_header=$gl_cv_absolute_stdio_h
27080 gl_cv_next_stdio_h='"'$gl_header'"'
6a29c58e
YQ
27081
27082
27083fi
27084{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
27085$as_echo "$gl_cv_next_stdio_h" >&6; }
27086 fi
27087 NEXT_STDIO_H=$gl_cv_next_stdio_h
27088
27089 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27090 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27091 gl_next_as_first_directive='<'stdio.h'>'
27092 else
27093 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27094 gl_next_as_first_directive=$gl_cv_next_stdio_h
27095 fi
27096 NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
27097
27098
27099
27100
27101
4a626d0a
PA
27102 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
27103$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
d0ac1c44 27104if ${gl_cv_func_printf_attribute_flavor+:} false; then :
4a626d0a
PA
27105 $as_echo_n "(cached) " >&6
27106else
27107 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27108/* end confdefs.h. */
27109
27110 #define __STDC_FORMAT_MACROS 1
27111 #include <stdio.h>
27112 #include <inttypes.h>
27113 /* For non-mingw systems, compilation will trivially succeed.
27114 For mingw, compilation will succeed for older mingw (system
27115 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
c0c3707f 27116 #if (defined _WIN32 && ! defined __CYGWIN__) && \
4a626d0a
PA
27117 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
27118 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
27119 #endif
27120
27121int
27122main ()
27123{
27124
27125 ;
27126 return 0;
27127}
27128_ACEOF
27129if ac_fn_c_try_compile "$LINENO"; then :
27130 gl_cv_func_printf_attribute_flavor=system
27131else
27132 gl_cv_func_printf_attribute_flavor=gnu
27133fi
27134rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27135fi
27136{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
27137$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
27138 if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
27139
27140$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
27141
27142 fi
27143
6a29c58e
YQ
27144 GNULIB_FSCANF=1
27145
27146
27147cat >>confdefs.h <<_ACEOF
27148#define GNULIB_FSCANF 1
27149_ACEOF
27150
27151
27152 GNULIB_SCANF=1
27153
27154
27155cat >>confdefs.h <<_ACEOF
27156#define GNULIB_SCANF 1
27157_ACEOF
27158
27159
27160 GNULIB_FGETC=1
27161 GNULIB_GETC=1
27162 GNULIB_GETCHAR=1
27163 GNULIB_FGETS=1
27164 GNULIB_FREAD=1
27165
27166
27167 GNULIB_FPRINTF=1
27168 GNULIB_PRINTF=1
27169 GNULIB_VFPRINTF=1
27170 GNULIB_VPRINTF=1
27171 GNULIB_FPUTC=1
27172 GNULIB_PUTC=1
27173 GNULIB_PUTCHAR=1
27174 GNULIB_FPUTS=1
27175 GNULIB_PUTS=1
27176 GNULIB_FWRITE=1
27177
27178
27179
27180
6a29c58e 27181
6a29c58e
YQ
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
98399780
YQ
27194 if test $gl_cv_have_include_next = yes; then
27195 gl_cv_next_stdlib_h='<'stdlib.h'>'
27196 else
27197 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
27198$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
d0ac1c44 27199if ${gl_cv_next_stdlib_h+:} false; then :
98399780
YQ
27200 $as_echo_n "(cached) " >&6
27201else
27202
4a626d0a
PA
27203
27204
27205 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98399780
YQ
27206/* end confdefs.h. */
27207#include <stdlib.h>
98399780 27208_ACEOF
4a626d0a
PA
27209 case "$host_os" in
27210 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27211 *) gl_absname_cpp="$ac_cpp" ;;
27212 esac
27213
27214 case "$host_os" in
27215 mingw*)
27216 gl_dirsep_regex='[/\\]'
27217 ;;
27218 *)
27219 gl_dirsep_regex='\/'
27220 ;;
27221 esac
27222 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27223 gl_header_literal_regex=`echo 'stdlib.h' \
27224 | sed -e "$gl_make_literal_regex_sed"`
27225 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27226 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27227 s|^/[^/]|//&|
27228 p
27229 q
27230 }'
98399780 27231
4a626d0a
PA
27232 gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27233 sed -n "$gl_absolute_header_sed"`
98399780 27234
4a626d0a
PA
27235 gl_header=$gl_cv_absolute_stdlib_h
27236 gl_cv_next_stdlib_h='"'$gl_header'"'
98399780
YQ
27237
27238
27239fi
27240{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
27241$as_echo "$gl_cv_next_stdlib_h" >&6; }
27242 fi
27243 NEXT_STDLIB_H=$gl_cv_next_stdlib_h
27244
27245 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27246 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27247 gl_next_as_first_directive='<'stdlib.h'>'
27248 else
27249 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27250 gl_next_as_first_directive=$gl_cv_next_stdlib_h
27251 fi
27252 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
27253
27254
27255
27256
27257
27258
98399780 27259
98399780
YQ
27260
27261
27262
27263
27264
27265
8424cc97
SM
27266 for ac_func in strchrnul
27267do :
27268 ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
d0ac1c44 27269if test "x$ac_cv_func_strchrnul" = xyes; then :
8424cc97
SM
27270 cat >>confdefs.h <<_ACEOF
27271#define HAVE_STRCHRNUL 1
27272_ACEOF
27273
27274fi
27275done
27276
27277 if test $ac_cv_func_strchrnul = no; then
27278 HAVE_STRCHRNUL=0
27279 else
27280 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
27281$as_echo_n "checking whether strchrnul works... " >&6; }
d0ac1c44 27282if ${gl_cv_func_strchrnul_works+:} false; then :
8424cc97
SM
27283 $as_echo_n "(cached) " >&6
27284else
27285 if test "$cross_compiling" = yes; then :
27286 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27287/* end confdefs.h. */
27288
27289#if defined __CYGWIN__
27290 #include <cygwin/version.h>
27291 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
27292 Lucky user
27293 #endif
27294#else
27295 Lucky user
27296#endif
27297
27298_ACEOF
27299if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
27300 $EGREP "Lucky user" >/dev/null 2>&1; then :
27301 gl_cv_func_strchrnul_works="guessing yes"
27302else
27303 gl_cv_func_strchrnul_works="guessing no"
27304fi
27305rm -f conftest*
27306
27307
27308else
27309 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27310/* end confdefs.h. */
27311
27312#include <string.h> /* for strchrnul */
27313
27314int
27315main ()
27316{
27317const char *buf = "a";
27318 return strchrnul (buf, 'b') != buf + 1;
27319
27320 ;
27321 return 0;
27322}
27323_ACEOF
27324if ac_fn_c_try_run "$LINENO"; then :
27325 gl_cv_func_strchrnul_works=yes
27326else
27327 gl_cv_func_strchrnul_works=no
27328fi
27329rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27330 conftest.$ac_objext conftest.beam conftest.$ac_ext
27331fi
27332
27333
27334fi
27335{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
27336$as_echo "$gl_cv_func_strchrnul_works" >&6; }
27337 case "$gl_cv_func_strchrnul_works" in
27338 *yes) ;;
27339 *) REPLACE_STRCHRNUL=1 ;;
27340 esac
27341 fi
27342
27343 if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
27344
27345
27346
27347
27348
27349
27350
27351
27352 gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext"
27353
27354 :
27355 fi
27356
27357
27358
27359
27360
27361 GNULIB_STRCHRNUL=1
27362
27363
27364
27365
27366
27367$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
27368
27369
27370
27371
27372
27373
27374
6ec2e0f5
SDJ
27375 if test $ac_cv_func_strdup = yes; then
27376 if test $gl_cv_func_malloc_posix != yes; then
27377 REPLACE_STRDUP=1
27378 fi
27379 fi
27380
27381 if test $ac_cv_have_decl_strdup = no; then
27382 HAVE_DECL_STRDUP=0
27383 fi
27384
27385 if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
27386
27387
27388
27389
27390
27391
27392
27393
27394 gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
27395
27396 :
27397 fi
27398
27399
27400
27401
27402
27403 GNULIB_STRDUP=1
27404
27405
27406
27407
27408
27409$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
27410
27411
27412
27413
27414
27415
27416
27417
5abebf3c
CB
27418
27419
6ec2e0f5
SDJ
27420 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
27421 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
27422$as_echo_n "checking for working strerror function... " >&6; }
d0ac1c44 27423if ${gl_cv_func_working_strerror+:} false; then :
6ec2e0f5
SDJ
27424 $as_echo_n "(cached) " >&6
27425else
27426 if test "$cross_compiling" = yes; then :
27427 case "$host_os" in
c0c3707f
CB
27428 # Guess yes on glibc systems.
27429 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
27430 # Guess yes on musl systems.
27431 *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
27432 # If we don't know, obey --enable-cross-guesses.
27433 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
6ec2e0f5
SDJ
27434 esac
27435
27436else
27437 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27438/* end confdefs.h. */
27439#include <string.h>
27440
27441int
27442main ()
27443{
27444if (!*strerror (-2)) return 1;
27445 ;
27446 return 0;
27447}
27448_ACEOF
27449if ac_fn_c_try_run "$LINENO"; then :
27450 gl_cv_func_working_strerror=yes
27451else
27452 gl_cv_func_working_strerror=no
27453fi
27454rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27455 conftest.$ac_objext conftest.beam conftest.$ac_ext
27456fi
27457
27458
27459fi
27460{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
27461$as_echo "$gl_cv_func_working_strerror" >&6; }
27462 case "$gl_cv_func_working_strerror" in
27463 *yes) ;;
27464 *)
27465 REPLACE_STRERROR=1
27466 ;;
27467 esac
27468
5abebf3c
CB
27469 case "$gl_cv_func_strerror_r_works" in
27470 *no) REPLACE_STRERROR=1 ;;
27471 esac
27472
6ec2e0f5
SDJ
27473 else
27474 REPLACE_STRERROR=1
27475 fi
27476
27477 if test $REPLACE_STRERROR = 1; then
27478
27479
27480
27481
27482
27483
27484
27485
27486 gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
27487
27488 fi
27489
27490
27491cat >>confdefs.h <<_ACEOF
27492#define GNULIB_STRERROR 1
27493_ACEOF
27494
27495
27496
27497
27498
27499
27500
27501 GNULIB_STRERROR=1
27502
27503
27504
27505
27506
27507$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
27508
27509
27510
27511
27512
27513 if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
27514
27515
27516
27517
27518
27519
27520
27521
27522 gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
27523
27524
27525
27526
27527
27528 if test $ac_cv_header_sys_socket_h != yes; then
27529 for ac_header in winsock2.h
27530do :
27531 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
d0ac1c44 27532if test "x$ac_cv_header_winsock2_h" = xyes; then :
6ec2e0f5
SDJ
27533 cat >>confdefs.h <<_ACEOF
27534#define HAVE_WINSOCK2_H 1
27535_ACEOF
27536
27537fi
27538
27539done
27540
27541 fi
27542 if test "$ac_cv_header_winsock2_h" = yes; then
27543 HAVE_WINSOCK2_H=1
27544 UNISTD_H_HAVE_WINSOCK2_H=1
27545 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
27546 else
27547 HAVE_WINSOCK2_H=0
27548 fi
27549
27550
27551 fi
27552
27553
27554
27555
98399780 27556
5abebf3c 27557
5abebf3c 27558
c0c3707f
CB
27559 if test $ac_cv_have_decl_strerror_r = no; then
27560 HAVE_DECL_STRERROR_R=0
27561 fi
5abebf3c
CB
27562
27563 if test $ac_cv_func_strerror_r = yes; then
27564 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
27565 if test $gl_cv_func_strerror_r_posix_signature = yes; then
27566 case "$gl_cv_func_strerror_r_works" in
27567 *no) REPLACE_STRERROR_R=1 ;;
27568 esac
27569 else
27570 REPLACE_STRERROR_R=1
27571 fi
27572 else
27573 REPLACE_STRERROR_R=1
27574 fi
27575 fi
27576
5abebf3c
CB
27577 if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
27578
27579
27580
27581
27582
27583
27584
27585
27586 gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext"
27587
27588
27589
5abebf3c
CB
27590
27591
27592
c0c3707f 27593 fi
5abebf3c
CB
27594
27595
27596
27597
5abebf3c 27598
c0c3707f 27599 GNULIB_STRERROR_R=1
5abebf3c
CB
27600
27601
27602
27603
5abebf3c 27604
c0c3707f 27605$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
5abebf3c
CB
27606
27607
27608
27609
5abebf3c 27610
c0c3707f
CB
27611cat >>confdefs.h <<_ACEOF
27612#define GNULIB_STRERROR_R_POSIX 1
27613_ACEOF
5abebf3c
CB
27614
27615
27616
27617
27618
27619
27620
63ce7108
TT
27621 if test $REPLACE_STRSTR = 0; then
27622 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
27623$as_echo_n "checking whether strstr works in linear time... " >&6; }
d0ac1c44 27624if ${gl_cv_func_strstr_linear+:} false; then :
63ce7108
TT
27625 $as_echo_n "(cached) " >&6
27626else
27627 if test "$cross_compiling" = yes; then :
27628 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27629/* end confdefs.h. */
27630
27631#include <features.h>
27632#ifdef __GNU_LIBRARY__
27633 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
27634 && !(defined __i386__ || defined __x86_64__) \
27635 && !defined __UCLIBC__
27636 Lucky user
27637 #endif
27638#endif
27639#ifdef __CYGWIN__
27640 #include <cygwin/version.h>
27641 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
27642 Lucky user
27643 #endif
27644#endif
27645
27646_ACEOF
27647if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
27648 $EGREP "Lucky user" >/dev/null 2>&1; then :
27649 gl_cv_func_strstr_linear="guessing yes"
c971b7fa 27650else
c0c3707f 27651 gl_cv_func_strstr_linear="$gl_cross_guess_normal"
c971b7fa
PA
27652fi
27653rm -f conftest*
27654
27655
27656else
27657 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27658/* end confdefs.h. */
27659
49e4877c
PA
27660#ifdef __MVS__
27661/* z/OS does not deliver signals while strstr() is running (thanks to
27662 restrictions on its LE runtime), which prevents us from limiting the
27663 running time of this test. */
27664# error "This test does not work properly on z/OS"
27665#endif
c971b7fa 27666#include <signal.h> /* for signal */
63ce7108 27667#include <string.h> /* for strstr */
c971b7fa
PA
27668#include <stdlib.h> /* for malloc */
27669#include <unistd.h> /* for alarm */
49e4877c 27670static void quit (int sig) { _exit (sig + 128); }
c971b7fa
PA
27671
27672int
27673main ()
27674{
27675
27676 int result = 0;
27677 size_t m = 1000000;
63ce7108
TT
27678 char *haystack = (char *) malloc (2 * m + 2);
27679 char *needle = (char *) malloc (m + 2);
c971b7fa 27680 /* Failure to compile this test due to missing alarm is okay,
63ce7108 27681 since all such platforms (mingw) also have quadratic strstr. */
c971b7fa
PA
27682 signal (SIGALRM, quit);
27683 alarm (5);
27684 /* Check for quadratic performance. */
27685 if (haystack && needle)
27686 {
27687 memset (haystack, 'A', 2 * m);
27688 haystack[2 * m] = 'B';
63ce7108 27689 haystack[2 * m + 1] = 0;
c971b7fa
PA
27690 memset (needle, 'A', m);
27691 needle[m] = 'B';
63ce7108
TT
27692 needle[m + 1] = 0;
27693 if (!strstr (haystack, needle))
c971b7fa
PA
27694 result |= 1;
27695 }
c0c3707f
CB
27696 /* Free allocated memory, in case some sanitizer is watching. */
27697 free (haystack);
27698 free (needle);
c971b7fa
PA
27699 return result;
27700
27701 ;
27702 return 0;
27703}
27704_ACEOF
27705if ac_fn_c_try_run "$LINENO"; then :
63ce7108 27706 gl_cv_func_strstr_linear=yes
c971b7fa 27707else
63ce7108 27708 gl_cv_func_strstr_linear=no
c971b7fa
PA
27709fi
27710rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27711 conftest.$ac_objext conftest.beam conftest.$ac_ext
27712fi
27713
27714
27715fi
63ce7108
TT
27716{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
27717$as_echo "$gl_cv_func_strstr_linear" >&6; }
27718 case "$gl_cv_func_strstr_linear" in
40a73391
JK
27719 *yes) ;;
27720 *)
63ce7108 27721 REPLACE_STRSTR=1
40a73391
JK
27722 ;;
27723 esac
c971b7fa
PA
27724 fi
27725
63ce7108 27726 if test $REPLACE_STRSTR = 1; then
c971b7fa
PA
27727
27728
27729
27730
27731
27732
27733
27734
63ce7108 27735 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
c971b7fa 27736
a512b375 27737 fi
c971b7fa
PA
27738
27739
27740
c0c3707f 27741 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
63ce7108 27742 REPLACE_STRSTR=1
c971b7fa 27743 else
c0c3707f 27744 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
63ce7108 27745$as_echo_n "checking whether strstr works... " >&6; }
d0ac1c44 27746if ${gl_cv_func_strstr_works_always+:} false; then :
c971b7fa
PA
27747 $as_echo_n "(cached) " >&6
27748else
27749 if test "$cross_compiling" = yes; then :
c0c3707f 27750 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
27751/* end confdefs.h. */
27752
27753#ifdef __GNU_LIBRARY__
27754 #include <features.h>
63ce7108 27755 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
c971b7fa
PA
27756 || defined __UCLIBC__
27757 Lucky user
27758 #endif
27759#elif defined __CYGWIN__
27760 #include <cygwin/version.h>
27761 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
27762 Lucky user
27763 #endif
27764#else
27765 Lucky user
27766#endif
27767
27768_ACEOF
27769if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
27770 $EGREP "Lucky user" >/dev/null 2>&1; then :
63ce7108 27771 gl_cv_func_strstr_works_always="guessing yes"
c971b7fa 27772else
c0c3707f 27773 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
c971b7fa
PA
27774fi
27775rm -f conftest*
27776
27777
27778else
27779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27780/* end confdefs.h. */
27781
63ce7108 27782#include <string.h> /* for strstr */
c0c3707f
CB
27783#ifdef __GNU_LIBRARY__
27784 #include <features.h>
27785 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
27786 Unlucky user
27787 #endif
27788#endif
c971b7fa
PA
27789#define P "_EF_BF_BD"
27790#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
27791#define NEEDLE P P P P P
27792
27793int
27794main ()
27795{
63ce7108 27796return !!strstr (HAYSTACK, NEEDLE);
c971b7fa
PA
27797
27798 ;
27799 return 0;
27800}
27801_ACEOF
27802if ac_fn_c_try_run "$LINENO"; then :
63ce7108 27803 gl_cv_func_strstr_works_always=yes
c971b7fa 27804else
63ce7108 27805 gl_cv_func_strstr_works_always=no
c971b7fa
PA
27806fi
27807rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27808 conftest.$ac_objext conftest.beam conftest.$ac_ext
27809fi
27810
27811
27812fi
63ce7108
TT
27813{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
27814$as_echo "$gl_cv_func_strstr_works_always" >&6; }
27815 case "$gl_cv_func_strstr_works_always" in
40a73391
JK
27816 *yes) ;;
27817 *)
63ce7108 27818 REPLACE_STRSTR=1
40a73391
JK
27819 ;;
27820 esac
c971b7fa 27821 fi
8839a007 27822
63ce7108 27823 if test $REPLACE_STRSTR = 1; then
8839a007 27824
8690e634
JK
27825
27826
8690e634
JK
27827
27828
27829
27830
27831
63ce7108 27832 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
8690e634 27833
8690e634
JK
27834 fi
27835
8690e634
JK
27836
27837
8690e634 27838
8690e634 27839
63ce7108 27840 GNULIB_STRSTR=1
8690e634
JK
27841
27842
27843
8690e634
JK
27844
27845
63ce7108 27846$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
8690e634
JK
27847
27848
27849
27850
27851
27852
27853
421693b0
PA
27854 for ac_func in strtok_r
27855do :
27856 ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r"
d0ac1c44 27857if test "x$ac_cv_func_strtok_r" = xyes; then :
421693b0
PA
27858 cat >>confdefs.h <<_ACEOF
27859#define HAVE_STRTOK_R 1
27860_ACEOF
27861
27862fi
27863done
27864
27865 if test $ac_cv_func_strtok_r = yes; then
27866 HAVE_STRTOK_R=1
27867 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5
27868$as_echo_n "checking whether strtok_r works... " >&6; }
d0ac1c44 27869if ${gl_cv_func_strtok_r_works+:} false; then :
421693b0
PA
27870 $as_echo_n "(cached) " >&6
27871else
27872 if test "$cross_compiling" = yes; then :
c0c3707f
CB
27873 case "$host_os" in
27874 # Guess no on glibc systems.
27875 *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;;
27876 # Guess yes on native Windows.
27877 mingw*) gl_cv_func_strtok_r_works="guessing yes" ;;
27878 *) gl_cv_func_strtok_r_works="guessing yes" ;;
421693b0
PA
27879 esac
27880
27881else
27882 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27883/* end confdefs.h. */
27884
27885 #ifndef __OPTIMIZE__
27886 # define __OPTIMIZE__ 1
27887 #endif
27888 #undef __OPTIMIZE_SIZE__
27889 #undef __NO_INLINE__
27890 #include <stdlib.h>
27891 #include <string.h>
27892
27893int
27894main ()
27895{
27896static const char dummy[] = "\177\01a";
27897 char delimiters[] = "xxxxxxxx";
27898 char *save_ptr = (char *) dummy;
27899 strtok_r (delimiters, "x", &save_ptr);
27900 strtok_r (NULL, "x", &save_ptr);
27901 return 0;
27902
27903 ;
27904 return 0;
27905}
27906
27907_ACEOF
27908if ac_fn_c_try_run "$LINENO"; then :
27909 gl_cv_func_strtok_r_works=yes
27910else
27911 gl_cv_func_strtok_r_works=no
27912fi
27913rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27914 conftest.$ac_objext conftest.beam conftest.$ac_ext
27915fi
27916
27917
27918fi
27919{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5
27920$as_echo "$gl_cv_func_strtok_r_works" >&6; }
27921 case "$gl_cv_func_strtok_r_works" in
27922 *no)
27923 UNDEFINE_STRTOK_R=1
27924 ;;
27925 esac
27926 else
27927 HAVE_STRTOK_R=0
27928 fi
27929
27930 if test $ac_cv_have_decl_strtok_r = no; then
27931 HAVE_DECL_STRTOK_R=0
27932 fi
27933
27934 if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then
27935
27936
27937
27938
27939
27940
27941
27942
27943 gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext"
27944
27945
27946 :
27947
27948 fi
27949
27950
27951
27952
27953
27954 GNULIB_STRTOK_R=1
27955
27956
27957
27958
27959
27960$as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h
27961
27962
27963
27964
27965
27966
27967
8690e634
JK
27968
27969
27970
27971
27972
8690e634 27973
09607c9e 27974
725e2999
JB
27975
27976
09607c9e
TT
27977
27978
27979
27980 if test $gl_cv_have_include_next = yes; then
27981 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
27982 else
27983 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
27984$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
d0ac1c44 27985if ${gl_cv_next_sys_stat_h+:} false; then :
09607c9e
TT
27986 $as_echo_n "(cached) " >&6
27987else
27988
27989 if test $ac_cv_header_sys_stat_h = yes; then
27990
27991
4a626d0a
PA
27992
27993
27994 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
09607c9e
TT
27995/* end confdefs.h. */
27996#include <sys/stat.h>
09607c9e 27997_ACEOF
4a626d0a
PA
27998 case "$host_os" in
27999 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28000 *) gl_absname_cpp="$ac_cpp" ;;
28001 esac
28002
28003 case "$host_os" in
28004 mingw*)
28005 gl_dirsep_regex='[/\\]'
28006 ;;
28007 *)
28008 gl_dirsep_regex='\/'
28009 ;;
28010 esac
28011 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28012 gl_header_literal_regex=`echo 'sys/stat.h' \
28013 | sed -e "$gl_make_literal_regex_sed"`
28014 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28015 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28016 s|^/[^/]|//&|
28017 p
28018 q
28019 }'
28020
28021 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28022 sed -n "$gl_absolute_header_sed"`
28023
28024 gl_header=$gl_cv_absolute_sys_stat_h
28025 gl_cv_next_sys_stat_h='"'$gl_header'"'
09607c9e
TT
28026 else
28027 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
28028 fi
28029
28030
28031fi
28032{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
28033$as_echo "$gl_cv_next_sys_stat_h" >&6; }
28034 fi
28035 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
28036
28037 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28038 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28039 gl_next_as_first_directive='<'sys/stat.h'>'
28040 else
28041 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28042 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
28043 fi
28044 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
28045
28046
28047
28048
28049
28050
28051
28052
c0c3707f
CB
28053 WINDOWS_STAT_TIMESPEC=0
28054
28055
2196f55f 28056
09607c9e
TT
28057
28058
09607c9e 28059
09607c9e 28060
09607c9e
TT
28061
28062 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
28063 #include <sys/stat.h>
28064"
d0ac1c44 28065if test "x$ac_cv_type_nlink_t" = xyes; then :
09607c9e
TT
28066
28067else
28068
c0c3707f 28069$as_echo "#define nlink_t int" >>confdefs.h
09607c9e 28070
c0c3707f 28071fi
09607c9e
TT
28072
28073
28074
28075
28076
28077
28078
28079
28080
28081
725e2999
JB
28082
28083
28084
28085
28086
28087
725e2999
JB
28088
28089
28090
28091
28092
28093
28094
28095
28096 if test $gl_cv_have_include_next = yes; then
28097 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
28098 else
28099 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
28100$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
28101if ${gl_cv_next_sys_uio_h+:} false; then :
28102 $as_echo_n "(cached) " >&6
28103else
28104
28105 if test $ac_cv_header_sys_uio_h = yes; then
28106
28107
28108
28109
28110 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28111/* end confdefs.h. */
28112#include <sys/uio.h>
28113_ACEOF
28114 case "$host_os" in
28115 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28116 *) gl_absname_cpp="$ac_cpp" ;;
28117 esac
28118
28119 case "$host_os" in
28120 mingw*)
28121 gl_dirsep_regex='[/\\]'
28122 ;;
28123 *)
28124 gl_dirsep_regex='\/'
28125 ;;
28126 esac
28127 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28128 gl_header_literal_regex=`echo 'sys/uio.h' \
28129 | sed -e "$gl_make_literal_regex_sed"`
28130 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28131 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28132 s|^/[^/]|//&|
28133 p
28134 q
28135 }'
28136
28137 gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28138 sed -n "$gl_absolute_header_sed"`
28139
28140 gl_header=$gl_cv_absolute_sys_uio_h
28141 gl_cv_next_sys_uio_h='"'$gl_header'"'
28142 else
28143 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
28144 fi
28145
28146
28147fi
28148{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
28149$as_echo "$gl_cv_next_sys_uio_h" >&6; }
28150 fi
28151 NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
28152
28153 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28154 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28155 gl_next_as_first_directive='<'sys/uio.h'>'
28156 else
28157 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28158 gl_next_as_first_directive=$gl_cv_next_sys_uio_h
28159 fi
28160 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
28161
28162
28163
28164
28165 if test $ac_cv_header_sys_uio_h = yes; then
28166 HAVE_SYS_UIO_H=1
28167 else
28168 HAVE_SYS_UIO_H=0
28169 fi
28170
28171
28172
28173
28174
2d8adcbd
MM
28175 :
28176
28177
28178
28179
09607c9e
TT
28180
28181
28182
8839a007
PA
28183
28184
28185
28186
09607c9e 28187
c0c3707f
CB
28188 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,
28189 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
28190 been included before. */
28191 #if defined __MINGW32__
28192 # include <unistd.h>
28193 #endif
28194 #include <time.h>
09607c9e 28195
f8e27d88
CB
28196"
28197if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
28198 ac_have_decl=1
28199else
28200 ac_have_decl=0
28201fi
28202
28203cat >>confdefs.h <<_ACEOF
28204#define HAVE_DECL_LOCALTIME_R $ac_have_decl
28205_ACEOF
28206
28207 if test $ac_cv_have_decl_localtime_r = no; then
28208 HAVE_DECL_LOCALTIME_R=0
28209 fi
28210
28211
f8e27d88
CB
28212 if test $ac_cv_func_localtime_r = yes; then
28213 HAVE_LOCALTIME_R=1
28214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
28215$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
28216if ${gl_cv_time_r_posix+:} false; then :
28217 $as_echo_n "(cached) " >&6
28218else
28219 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28220/* end confdefs.h. */
c0c3707f
CB
28221/* mingw's <time.h> provides the functions asctime_r, ctime_r,
28222 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
28223 been included before. */
28224 #if defined __MINGW32__
28225 # include <unistd.h>
28226 #endif
28227 #include <time.h>
28228
f8e27d88
CB
28229int
28230main ()
28231{
28232/* We don't need to append 'restrict's to the argument types,
28233 even though the POSIX signature has the 'restrict's,
28234 since C99 says they can't affect type compatibility. */
28235 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
28236 if (ptr) return 0;
28237 /* Check the return type is a pointer.
28238 On HP-UX 10 it is 'int'. */
28239 *localtime_r (0, 0);
28240 ;
28241 return 0;
28242}
28243
28244_ACEOF
28245if ac_fn_c_try_compile "$LINENO"; then :
28246 gl_cv_time_r_posix=yes
28247else
28248 gl_cv_time_r_posix=no
28249fi
28250rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28251
28252fi
28253{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
28254$as_echo "$gl_cv_time_r_posix" >&6; }
28255 if test $gl_cv_time_r_posix = yes; then
28256 REPLACE_LOCALTIME_R=0
28257 else
28258 REPLACE_LOCALTIME_R=1
28259 fi
28260 else
28261 HAVE_LOCALTIME_R=0
c0c3707f
CB
28262 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5
28263$as_echo_n "checking whether localtime_r exists as an inline function... " >&6; }
28264if ${gl_cv_func_localtime_r_inline+:} false; then :
28265 $as_echo_n "(cached) " >&6
28266else
28267 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28268/* end confdefs.h. */
28269/* mingw's <time.h> provides the functions asctime_r, ctime_r,
28270 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
28271 been included before. */
28272 #if defined __MINGW32__
28273 # include <unistd.h>
28274 #endif
28275 #include <time.h>
28276
28277int
28278main ()
28279{
28280time_t a;
28281 struct tm r;
28282 localtime_r (&a, &r);
28283
28284 ;
28285 return 0;
28286}
28287
28288_ACEOF
28289if ac_fn_c_try_link "$LINENO"; then :
28290 gl_cv_func_localtime_r_inline=yes
28291else
28292 gl_cv_func_localtime_r_inline=no
28293fi
28294rm -f core conftest.err conftest.$ac_objext \
28295 conftest$ac_exeext conftest.$ac_ext
28296
28297fi
28298{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5
28299$as_echo "$gl_cv_func_localtime_r_inline" >&6; }
28300 if test $gl_cv_func_localtime_r_inline = yes; then
28301 REPLACE_LOCALTIME_R=1
28302 fi
f8e27d88
CB
28303 fi
28304
28305 if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
28306
28307
28308
28309
28310
28311
28312
28313
28314 gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
28315
28316
28317 :
28318
28319 fi
28320
28321
28322
28323
28324
28325 GNULIB_TIME_R=1
28326
28327
28328
28329
28330
28331$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
28332
28333
28334
28335
28336
28337
28338
28339
28340
5abebf3c
CB
28341
28342
28343
8839a007
PA
28344
28345
28346
28347 if test $gl_cv_have_include_next = yes; then
28348 gl_cv_next_unistd_h='<'unistd.h'>'
28349 else
28350 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
28351$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
d0ac1c44 28352if ${gl_cv_next_unistd_h+:} false; then :
8839a007
PA
28353 $as_echo_n "(cached) " >&6
28354else
28355
28356 if test $ac_cv_header_unistd_h = yes; then
28357
28358
4a626d0a
PA
28359
28360
28361 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8839a007
PA
28362/* end confdefs.h. */
28363#include <unistd.h>
8839a007 28364_ACEOF
4a626d0a
PA
28365 case "$host_os" in
28366 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28367 *) gl_absname_cpp="$ac_cpp" ;;
28368 esac
28369
28370 case "$host_os" in
28371 mingw*)
28372 gl_dirsep_regex='[/\\]'
28373 ;;
28374 *)
28375 gl_dirsep_regex='\/'
28376 ;;
28377 esac
28378 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28379 gl_header_literal_regex=`echo 'unistd.h' \
28380 | sed -e "$gl_make_literal_regex_sed"`
28381 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28382 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28383 s|^/[^/]|//&|
28384 p
28385 q
28386 }'
28387
28388 gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28389 sed -n "$gl_absolute_header_sed"`
28390
28391 gl_header=$gl_cv_absolute_unistd_h
28392 gl_cv_next_unistd_h='"'$gl_header'"'
8839a007
PA
28393 else
28394 gl_cv_next_unistd_h='<'unistd.h'>'
28395 fi
28396
28397
28398fi
28399{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
28400$as_echo "$gl_cv_next_unistd_h" >&6; }
28401 fi
28402 NEXT_UNISTD_H=$gl_cv_next_unistd_h
28403
28404 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28405 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28406 gl_next_as_first_directive='<'unistd.h'>'
28407 else
28408 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28409 gl_next_as_first_directive=$gl_cv_next_unistd_h
28410 fi
28411 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
28412
28413
28414
28415
28416 if test $ac_cv_header_unistd_h = yes; then
28417 HAVE_UNISTD_H=1
28418 else
28419 HAVE_UNISTD_H=0
28420 fi
28421
28422
28423
28424
28425
28426
28427
472fa5ee
SM
28428
28429
28430
28431
28432
8839a007 28433
6ec2e0f5
SDJ
28434
28435
28436
3d99e817
AK
28437 if test $ac_cv_have_decl_unsetenv = no; then
28438 HAVE_DECL_UNSETENV=0
28439 fi
28440 for ac_func in unsetenv
28441do :
28442 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
d0ac1c44 28443if test "x$ac_cv_func_unsetenv" = xyes; then :
3d99e817
AK
28444 cat >>confdefs.h <<_ACEOF
28445#define HAVE_UNSETENV 1
28446_ACEOF
28447
28448fi
28449done
28450
28451 if test $ac_cv_func_unsetenv = no; then
28452 HAVE_UNSETENV=0
28453 else
28454 HAVE_UNSETENV=1
28455 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
28456$as_echo_n "checking for unsetenv() return type... " >&6; }
d0ac1c44 28457if ${gt_cv_func_unsetenv_ret+:} false; then :
3d99e817
AK
28458 $as_echo_n "(cached) " >&6
28459else
28460 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28461/* end confdefs.h. */
28462
28463#undef _BSD
28464#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
28465#include <stdlib.h>
28466extern
28467#ifdef __cplusplus
28468"C"
28469#endif
28470int unsetenv (const char *name);
28471
28472int
28473main ()
28474{
28475
28476 ;
28477 return 0;
28478}
28479_ACEOF
28480if ac_fn_c_try_compile "$LINENO"; then :
28481 gt_cv_func_unsetenv_ret='int'
28482else
28483 gt_cv_func_unsetenv_ret='void'
28484fi
28485rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28486fi
28487{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
28488$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
28489 if test $gt_cv_func_unsetenv_ret = 'void'; then
28490
28491$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
28492
28493 REPLACE_UNSETENV=1
28494 fi
28495
28496 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
28497$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
d0ac1c44 28498if ${gl_cv_func_unsetenv_works+:} false; then :
3d99e817
AK
28499 $as_echo_n "(cached) " >&6
28500else
28501 if test "$cross_compiling" = yes; then :
28502 case "$host_os" in
28503 # Guess yes on glibc systems.
28504 *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
c0c3707f
CB
28505 # If we don't know, obey --enable-cross-guesses.
28506 *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
28507 esac
28508
28509else
28510 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28511/* end confdefs.h. */
28512
28513 #include <stdlib.h>
28514 #include <errno.h>
28515 extern char **environ;
28516
28517int
28518main ()
28519{
28520
28521 char entry1[] = "a=1";
28522 char entry2[] = "b=2";
28523 char *env[] = { entry1, entry2, NULL };
28524 if (putenv ((char *) "a=1")) return 1;
28525 if (putenv (entry2)) return 2;
28526 entry2[0] = 'a';
28527 unsetenv ("a");
28528 if (getenv ("a")) return 3;
28529 if (!unsetenv ("") || errno != EINVAL) return 4;
28530 entry2[0] = 'b';
28531 environ = env;
28532 if (!getenv ("a")) return 5;
28533 entry2[0] = 'a';
28534 unsetenv ("a");
28535 if (getenv ("a")) return 6;
28536
28537 ;
28538 return 0;
28539}
28540_ACEOF
28541if ac_fn_c_try_run "$LINENO"; then :
28542 gl_cv_func_unsetenv_works=yes
28543else
28544 gl_cv_func_unsetenv_works=no
28545fi
28546rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28547 conftest.$ac_objext conftest.beam conftest.$ac_ext
28548fi
28549
28550fi
28551{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
28552$as_echo "$gl_cv_func_unsetenv_works" >&6; }
28553 case "$gl_cv_func_unsetenv_works" in
28554 *yes) ;;
28555 *)
28556 REPLACE_UNSETENV=1
28557 ;;
28558 esac
28559 fi
28560
28561 if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
28562
28563
28564
28565
28566
28567
28568
28569
28570 gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
28571
28572
28573
28574
28575
28576 fi
28577
28578
28579
28580
28581
28582 GNULIB_UNSETENV=1
28583
28584
28585
28586
28587
28588$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
28589
28590
28591
28592
28593
28594
8839a007
PA
28595
28596
28597
28598
28599
28600
28601
8690e634
JK
28602
28603
28604 if test $gl_cv_have_include_next = yes; then
28605 gl_cv_next_wchar_h='<'wchar.h'>'
28606 else
28607 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
28608$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
d0ac1c44 28609if ${gl_cv_next_wchar_h+:} false; then :
8690e634
JK
28610 $as_echo_n "(cached) " >&6
28611else
28612
28613 if test $ac_cv_header_wchar_h = yes; then
28614
28615
4a626d0a
PA
28616
28617
28618 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
28619/* end confdefs.h. */
28620#include <wchar.h>
8690e634 28621_ACEOF
4a626d0a
PA
28622 case "$host_os" in
28623 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28624 *) gl_absname_cpp="$ac_cpp" ;;
28625 esac
28626
28627 case "$host_os" in
28628 mingw*)
28629 gl_dirsep_regex='[/\\]'
28630 ;;
28631 *)
28632 gl_dirsep_regex='\/'
28633 ;;
28634 esac
28635 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28636 gl_header_literal_regex=`echo 'wchar.h' \
28637 | sed -e "$gl_make_literal_regex_sed"`
28638 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28639 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28640 s|^/[^/]|//&|
28641 p
28642 q
28643 }'
28644
28645 gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28646 sed -n "$gl_absolute_header_sed"`
28647
28648 gl_header=$gl_cv_absolute_wchar_h
28649 gl_cv_next_wchar_h='"'$gl_header'"'
8690e634
JK
28650 else
28651 gl_cv_next_wchar_h='<'wchar.h'>'
28652 fi
28653
28654
28655fi
28656{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
28657$as_echo "$gl_cv_next_wchar_h" >&6; }
28658 fi
28659 NEXT_WCHAR_H=$gl_cv_next_wchar_h
28660
28661 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28662 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28663 gl_next_as_first_directive='<'wchar.h'>'
28664 else
28665 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28666 gl_next_as_first_directive=$gl_cv_next_wchar_h
28667 fi
28668 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
28669
28670
28671
28672
28673 if test $ac_cv_header_wchar_h = yes; then
28674 HAVE_WCHAR_H=1
28675 else
28676 HAVE_WCHAR_H=0
28677 fi
28678
c971b7fa
PA
28679
28680
28681
28682
8690e634
JK
28683 if test $gt_cv_c_wint_t = yes; then
28684 HAVE_WINT_T=1
28685 else
28686 HAVE_WINT_T=0
28687 fi
c971b7fa
PA
28688
28689
28690
8690e634
JK
28691
28692
28693
28694
28695
472fa5ee
SM
28696
28697
28698
28699
28700
8690e634
JK
28701 if test $ac_cv_func_iswcntrl = yes; then
28702 HAVE_ISWCNTRL=1
28703 else
28704 HAVE_ISWCNTRL=0
28705 fi
28706
28707
28708
8690e634
JK
28709 if test $gt_cv_c_wint_t = yes; then
28710 HAVE_WINT_T=1
28711 else
28712 HAVE_WINT_T=0
28713 fi
28714
28715
28716
28717
28718
28719
c971b7fa 28720
8690e634 28721
472fa5ee
SM
28722
28723
c971b7fa
PA
28724
28725
28726
28727 if test $gl_cv_have_include_next = yes; then
8690e634 28728 gl_cv_next_wctype_h='<'wctype.h'>'
c971b7fa 28729 else
8690e634
JK
28730 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
28731$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
d0ac1c44 28732if ${gl_cv_next_wctype_h+:} false; then :
c971b7fa
PA
28733 $as_echo_n "(cached) " >&6
28734else
28735
8690e634
JK
28736 if test $ac_cv_header_wctype_h = yes; then
28737
28738
4a626d0a
PA
28739
28740
28741 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 28742/* end confdefs.h. */
8690e634 28743#include <wctype.h>
c971b7fa 28744_ACEOF
4a626d0a
PA
28745 case "$host_os" in
28746 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28747 *) gl_absname_cpp="$ac_cpp" ;;
28748 esac
28749
28750 case "$host_os" in
28751 mingw*)
28752 gl_dirsep_regex='[/\\]'
28753 ;;
28754 *)
28755 gl_dirsep_regex='\/'
28756 ;;
28757 esac
28758 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28759 gl_header_literal_regex=`echo 'wctype.h' \
28760 | sed -e "$gl_make_literal_regex_sed"`
28761 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28762 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28763 s|^/[^/]|//&|
28764 p
28765 q
28766 }'
28767
28768 gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28769 sed -n "$gl_absolute_header_sed"`
28770
28771 gl_header=$gl_cv_absolute_wctype_h
28772 gl_cv_next_wctype_h='"'$gl_header'"'
8690e634
JK
28773 else
28774 gl_cv_next_wctype_h='<'wctype.h'>'
28775 fi
c971b7fa
PA
28776
28777
28778fi
8690e634
JK
28779{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
28780$as_echo "$gl_cv_next_wctype_h" >&6; }
c971b7fa 28781 fi
8690e634 28782 NEXT_WCTYPE_H=$gl_cv_next_wctype_h
c971b7fa
PA
28783
28784 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28785 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8690e634 28786 gl_next_as_first_directive='<'wctype.h'>'
c971b7fa
PA
28787 else
28788 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8690e634 28789 gl_next_as_first_directive=$gl_cv_next_wctype_h
c971b7fa 28790 fi
8690e634
JK
28791 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
28792
28793
28794
28795
28796 if test $ac_cv_header_wctype_h = yes; then
28797 if test $ac_cv_func_iswcntrl = yes; then
28798 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
28799$as_echo_n "checking whether iswcntrl works... " >&6; }
d0ac1c44 28800if ${gl_cv_func_iswcntrl_works+:} false; then :
8690e634
JK
28801 $as_echo_n "(cached) " >&6
28802else
28803
28804 if test "$cross_compiling" = yes; then :
c0c3707f 28805 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
28806/* end confdefs.h. */
28807#include <stdlib.h>
28808 #if __GNU_LIBRARY__ == 1
28809 Linux libc5 i18n is broken.
28810 #endif
28811int
28812main ()
28813{
28814
28815 ;
28816 return 0;
28817}
28818_ACEOF
28819if ac_fn_c_try_compile "$LINENO"; then :
28820 gl_cv_func_iswcntrl_works="guessing yes"
28821else
28822 gl_cv_func_iswcntrl_works="guessing no"
28823fi
28824rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28825
28826else
28827 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28828/* end confdefs.h. */
28829
28830 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
28831 included before <wchar.h>.
28832 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
28833 must be included before <wchar.h>. */
28834 #include <stddef.h>
28835 #include <stdio.h>
28836 #include <time.h>
28837 #include <wchar.h>
28838 #include <wctype.h>
28839 int main () { return iswprint ('x') == 0; }
28840
28841_ACEOF
28842if ac_fn_c_try_run "$LINENO"; then :
28843 gl_cv_func_iswcntrl_works=yes
28844else
28845 gl_cv_func_iswcntrl_works=no
28846fi
28847rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28848 conftest.$ac_objext conftest.beam conftest.$ac_ext
28849fi
28850
28851
28852fi
28853{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
28854$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
28855 fi
28856 HAVE_WCTYPE_H=1
28857 else
28858 HAVE_WCTYPE_H=0
28859 fi
28860
28861
c0c3707f
CB
28862 if test $GNULIB_OVERRIDES_WINT_T = 1; then
28863 REPLACE_ISWCNTRL=1
28864 else
28865 case "$gl_cv_func_iswcntrl_works" in
28866 *yes) REPLACE_ISWCNTRL=0 ;;
28867 *) REPLACE_ISWCNTRL=1 ;;
28868 esac
28869 fi
8690e634
JK
28870
28871
28872 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
28873 :
28874 fi
28875
28876 if test $REPLACE_ISWCNTRL = 1; then
28877 REPLACE_TOWLOWER=1
28878 else
28879 for ac_func in towlower
28880do :
28881 ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
d0ac1c44 28882if test "x$ac_cv_func_towlower" = xyes; then :
8690e634
JK
28883 cat >>confdefs.h <<_ACEOF
28884#define HAVE_TOWLOWER 1
28885_ACEOF
28886
28887fi
28888done
28889
28890 if test $ac_cv_func_towlower = yes; then
28891 REPLACE_TOWLOWER=0
28892 else
28893 ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
28894 included before <wchar.h>.
28895 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
28896 must be included before <wchar.h>. */
28897 #include <stddef.h>
28898 #include <stdio.h>
28899 #include <time.h>
28900 #include <wchar.h>
28901 #if HAVE_WCTYPE_H
28902 # include <wctype.h>
28903 #endif
28904
28905"
d0ac1c44 28906if test "x$ac_cv_have_decl_towlower" = xyes; then :
8690e634
JK
28907 ac_have_decl=1
28908else
28909 ac_have_decl=0
28910fi
28911
28912cat >>confdefs.h <<_ACEOF
28913#define HAVE_DECL_TOWLOWER $ac_have_decl
28914_ACEOF
28915
28916 if test $ac_cv_have_decl_towlower = yes; then
28917 REPLACE_TOWLOWER=1
28918 else
28919 REPLACE_TOWLOWER=0
28920 fi
28921 fi
28922 fi
28923
28924
28925 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
28926 :
28927 fi
28928
28929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
28930$as_echo_n "checking for wctype_t... " >&6; }
d0ac1c44 28931if ${gl_cv_type_wctype_t+:} false; then :
8690e634
JK
28932 $as_echo_n "(cached) " >&6
28933else
28934 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28935/* end confdefs.h. */
28936/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
28937 included before <wchar.h>.
28938 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
28939 must be included before <wchar.h>. */
28940 #include <stddef.h>
28941 #include <stdio.h>
28942 #include <time.h>
28943 #include <wchar.h>
28944 #if HAVE_WCTYPE_H
28945 # include <wctype.h>
28946 #endif
28947 wctype_t a;
28948
28949int
28950main ()
28951{
28952
28953 ;
28954 return 0;
28955}
28956_ACEOF
28957if ac_fn_c_try_compile "$LINENO"; then :
28958 gl_cv_type_wctype_t=yes
28959else
28960 gl_cv_type_wctype_t=no
28961fi
28962rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 28963
8690e634
JK
28964fi
28965{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
28966$as_echo "$gl_cv_type_wctype_t" >&6; }
28967 if test $gl_cv_type_wctype_t = no; then
28968 HAVE_WCTYPE_T=0
28969 fi
28970
28971 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
28972$as_echo_n "checking for wctrans_t... " >&6; }
d0ac1c44 28973if ${gl_cv_type_wctrans_t+:} false; then :
8690e634
JK
28974 $as_echo_n "(cached) " >&6
28975else
28976 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28977/* end confdefs.h. */
28978/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
28979 included before <wchar.h>.
28980 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
28981 must be included before <wchar.h>. */
28982 #include <stddef.h>
28983 #include <stdio.h>
28984 #include <time.h>
28985 #include <wchar.h>
28986 #include <wctype.h>
28987 wctrans_t a;
c971b7fa 28988
8690e634
JK
28989int
28990main ()
28991{
c971b7fa 28992
8690e634
JK
28993 ;
28994 return 0;
28995}
28996_ACEOF
28997if ac_fn_c_try_compile "$LINENO"; then :
28998 gl_cv_type_wctrans_t=yes
28999else
29000 gl_cv_type_wctrans_t=no
29001fi
29002rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 29003
8690e634
JK
29004fi
29005{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
29006$as_echo "$gl_cv_type_wctrans_t" >&6; }
29007 if test $gl_cv_type_wctrans_t = no; then
29008 HAVE_WCTRANS_T=0
c971b7fa
PA
29009 fi
29010
29011
5e8754f9 29012
5e8754f9 29013
c971b7fa 29014
c0c3707f
CB
29015
29016 case "$host_os" in
29017 mingw*)
29018
29019
29020
29021
29022
29023
29024
29025
29026 gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext"
29027
29028 ;;
29029 esac
29030
29031 case "$host_os" in
29032 mingw*)
29033
29034
29035
29036
29037
29038
29039
29040
29041 gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext"
29042
29043 ;;
29044 esac
29045
29046 case "$host_os" in
29047 mingw*)
29048
29049
c971b7fa
PA
29050
29051
c0c3707f
CB
29052
29053
29054
29055
29056 gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext"
29057
29058 ;;
29059 esac
29060
29061 case "$host_os" in
29062 mingw*)
29063
29064
29065
29066
29067
29068
29069
29070
29071 gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext"
29072
29073 ;;
29074 esac
c971b7fa
PA
29075 # End of code from modules
29076
29077
29078
29079
29080
29081
29082
29083
29084
29085 gltests_libdeps=
29086 gltests_ltlibdeps=
29087
29088
29089
29090
29091
29092
29093
29094
29095
5df4cba6 29096
c971b7fa
PA
29097 gl_source_base='tests'
29098 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
29099
29100 gl_module_indicator_condition=$gltests_WITNESS
29101
29102
29103
29104
29105
29106
29107
29108
29109
29110 LIBGNU_LIBDEPS="$gl_libdeps"
29111
29112 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
29113
29114
29115
d0ac1c44 29116am__api_version='1.15'
c971b7fa
PA
29117
29118# Find a good install program. We prefer a C program (faster),
29119# so one script is as good as another. But avoid the broken or
29120# incompatible versions:
29121# SysV /etc/install, /usr/sbin/install
29122# SunOS /usr/etc/install
29123# IRIX /sbin/install
29124# AIX /bin/install
29125# AmigaOS /C/install, which installs bootblocks on floppy discs
29126# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
29127# AFS /usr/afsws/bin/install, which mishandles nonexistent args
29128# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
29129# OS/2's system install, which has a completely different semantic
29130# ./install, which can be erroneously created by make from ./install.sh.
29131# Reject install programs that cannot install multiple files.
29132{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
29133$as_echo_n "checking for a BSD-compatible install... " >&6; }
29134if test -z "$INSTALL"; then
d0ac1c44 29135if ${ac_cv_path_install+:} false; then :
c971b7fa
PA
29136 $as_echo_n "(cached) " >&6
29137else
29138 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29139for as_dir in $PATH
29140do
29141 IFS=$as_save_IFS
29142 test -z "$as_dir" && as_dir=.
29143 # Account for people who put trailing slashes in PATH elements.
29144case $as_dir/ in #((
29145 ./ | .// | /[cC]/* | \
29146 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
29147 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
29148 /usr/ucb/* ) ;;
29149 *)
29150 # OSF1 and SCO ODT 3.0 have their own names for install.
29151 # Don't use installbsd from OSF since it installs stuff as root
29152 # by default.
29153 for ac_prog in ginstall scoinst install; do
29154 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 29155 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
c971b7fa
PA
29156 if test $ac_prog = install &&
29157 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
29158 # AIX install. It has an incompatible calling convention.
29159 :
29160 elif test $ac_prog = install &&
29161 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
29162 # program-specific install script used by HP pwplus--don't use.
29163 :
29164 else
29165 rm -rf conftest.one conftest.two conftest.dir
29166 echo one > conftest.one
29167 echo two > conftest.two
29168 mkdir conftest.dir
29169 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
29170 test -s conftest.one && test -s conftest.two &&
29171 test -s conftest.dir/conftest.one &&
29172 test -s conftest.dir/conftest.two
29173 then
29174 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
29175 break 3
29176 fi
29177 fi
29178 fi
29179 done
29180 done
29181 ;;
29182esac
29183
29184 done
29185IFS=$as_save_IFS
29186
29187rm -rf conftest.one conftest.two conftest.dir
29188
29189fi
29190 if test "${ac_cv_path_install+set}" = set; then
29191 INSTALL=$ac_cv_path_install
29192 else
29193 # As a last resort, use the slow shell script. Don't cache a
29194 # value for INSTALL within a source directory, because that will
29195 # break other packages using the cache if that directory is
29196 # removed, or if the value is a relative name.
29197 INSTALL=$ac_install_sh
29198 fi
29199fi
29200{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
29201$as_echo "$INSTALL" >&6; }
29202
29203# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
29204# It thinks the first close brace ends the variable substitution.
29205test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
29206
29207test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
29208
29209test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
29210
29211{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
29212$as_echo_n "checking whether build environment is sane... " >&6; }
c971b7fa
PA
29213# Reject unsafe characters in $srcdir or the absolute working directory
29214# name. Accept space and tab only in the latter.
29215am_lf='
29216'
29217case `pwd` in
29218 *[\\\"\#\$\&\'\`$am_lf]*)
d0ac1c44 29219 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
c971b7fa
PA
29220esac
29221case $srcdir in
29222 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
d0ac1c44 29223 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
c971b7fa
PA
29224esac
29225
d0ac1c44 29226# Do 'set' in a subshell so we don't clobber the current shell's
c971b7fa
PA
29227# arguments. Must try -L first in case configure is actually a
29228# symlink; some systems play weird games with the mod time of symlinks
29229# (eg FreeBSD returns the mod time of the symlink's containing
29230# directory).
29231if (
d0ac1c44
SM
29232 am_has_slept=no
29233 for am_try in 1 2; do
29234 echo "timestamp, slept: $am_has_slept" > conftest.file
29235 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
29236 if test "$*" = "X"; then
29237 # -L didn't work.
29238 set X `ls -t "$srcdir/configure" conftest.file`
29239 fi
29240 if test "$*" != "X $srcdir/configure conftest.file" \
29241 && test "$*" != "X conftest.file $srcdir/configure"; then
29242
29243 # If neither matched, then we have a broken ls. This can happen
29244 # if, for instance, CONFIG_SHELL is bash and it inherits a
29245 # broken ls alias from the environment. This has actually
29246 # happened. Such a system could not be considered "sane".
29247 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
29248 alias in your environment" "$LINENO" 5
29249 fi
29250 if test "$2" = conftest.file || test $am_try -eq 2; then
29251 break
29252 fi
29253 # Just in case.
29254 sleep 1
29255 am_has_slept=yes
29256 done
c971b7fa
PA
29257 test "$2" = conftest.file
29258 )
29259then
29260 # Ok.
29261 :
29262else
d0ac1c44 29263 as_fn_error $? "newly created file is older than distributed files!
c971b7fa
PA
29264Check your system clock" "$LINENO" 5
29265fi
29266{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29267$as_echo "yes" >&6; }
d0ac1c44
SM
29268# If we didn't sleep, we still need to ensure time stamps of config.status and
29269# generated files are strictly newer.
29270am_sleep_pid=
29271if grep 'slept: no' conftest.file >/dev/null 2>&1; then
29272 ( sleep 1 ) &
29273 am_sleep_pid=$!
29274fi
29275
29276rm -f conftest.file
29277
c971b7fa
PA
29278test "$program_prefix" != NONE &&
29279 program_transform_name="s&^&$program_prefix&;$program_transform_name"
29280# Use a double $ so make ignores it.
29281test "$program_suffix" != NONE &&
29282 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
29283# Double any \ or $.
29284# By default was `s,x,x', remove it if useless.
29285ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
29286program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
29287
c0c3707f
CB
29288# Expand $ac_aux_dir to an absolute path.
29289am_aux_dir=`cd "$ac_aux_dir" && pwd`
29290
c971b7fa
PA
29291if test x"${MISSING+set}" != xset; then
29292 case $am_aux_dir in
29293 *\ * | *\ *)
29294 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
29295 *)
29296 MISSING="\${SHELL} $am_aux_dir/missing" ;;
29297 esac
29298fi
29299# Use eval to expand $SHELL
d0ac1c44
SM
29300if eval "$MISSING --is-lightweight"; then
29301 am_missing_run="$MISSING "
c971b7fa
PA
29302else
29303 am_missing_run=
d0ac1c44
SM
29304 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
29305$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
c971b7fa
PA
29306fi
29307
d0ac1c44 29308if test x"${install_sh+set}" != xset; then
c971b7fa
PA
29309 case $am_aux_dir in
29310 *\ * | *\ *)
29311 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
29312 *)
29313 install_sh="\${SHELL} $am_aux_dir/install-sh"
29314 esac
29315fi
29316
d0ac1c44
SM
29317# Installed binaries are usually stripped using 'strip' when the user
29318# run "make install-strip". However 'strip' might not be the right
c971b7fa 29319# tool to use in cross-compilation environments, therefore Automake
d0ac1c44 29320# will honor the 'STRIP' environment variable to overrule this program.
c971b7fa
PA
29321if test "$cross_compiling" != no; then
29322 if test -n "$ac_tool_prefix"; then
29323 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
29324set dummy ${ac_tool_prefix}strip; ac_word=$2
29325{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29326$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 29327if ${ac_cv_prog_STRIP+:} false; then :
c971b7fa
PA
29328 $as_echo_n "(cached) " >&6
29329else
29330 if test -n "$STRIP"; then
29331 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
29332else
29333as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29334for as_dir in $PATH
29335do
29336 IFS=$as_save_IFS
29337 test -z "$as_dir" && as_dir=.
29338 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 29339 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
29340 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
29341 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
29342 break 2
29343 fi
29344done
29345 done
29346IFS=$as_save_IFS
29347
29348fi
29349fi
29350STRIP=$ac_cv_prog_STRIP
29351if test -n "$STRIP"; then
29352 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
29353$as_echo "$STRIP" >&6; }
29354else
29355 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29356$as_echo "no" >&6; }
29357fi
29358
29359
29360fi
29361if test -z "$ac_cv_prog_STRIP"; then
29362 ac_ct_STRIP=$STRIP
29363 # Extract the first word of "strip", so it can be a program name with args.
29364set dummy strip; ac_word=$2
29365{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29366$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 29367if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
c971b7fa
PA
29368 $as_echo_n "(cached) " >&6
29369else
29370 if test -n "$ac_ct_STRIP"; then
29371 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
29372else
29373as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29374for as_dir in $PATH
29375do
29376 IFS=$as_save_IFS
29377 test -z "$as_dir" && as_dir=.
29378 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 29379 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
29380 ac_cv_prog_ac_ct_STRIP="strip"
29381 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
29382 break 2
29383 fi
29384done
29385 done
29386IFS=$as_save_IFS
29387
29388fi
29389fi
29390ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
29391if test -n "$ac_ct_STRIP"; then
29392 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
29393$as_echo "$ac_ct_STRIP" >&6; }
29394else
29395 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29396$as_echo "no" >&6; }
29397fi
29398
29399 if test "x$ac_ct_STRIP" = x; then
29400 STRIP=":"
29401 else
29402 case $cross_compiling:$ac_tool_warned in
29403yes:)
29404{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
29405$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
29406ac_tool_warned=yes ;;
29407esac
29408 STRIP=$ac_ct_STRIP
29409 fi
29410else
29411 STRIP="$ac_cv_prog_STRIP"
29412fi
29413
29414fi
29415INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
29416
c971b7fa
PA
29417for ac_prog in gawk mawk nawk awk
29418do
29419 # Extract the first word of "$ac_prog", so it can be a program name with args.
29420set dummy $ac_prog; ac_word=$2
29421{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29422$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 29423if ${ac_cv_prog_AWK+:} false; then :
c971b7fa
PA
29424 $as_echo_n "(cached) " >&6
29425else
29426 if test -n "$AWK"; then
29427 ac_cv_prog_AWK="$AWK" # Let the user override the test.
29428else
29429as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29430for as_dir in $PATH
29431do
29432 IFS=$as_save_IFS
29433 test -z "$as_dir" && as_dir=.
29434 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 29435 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
29436 ac_cv_prog_AWK="$ac_prog"
29437 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
29438 break 2
29439 fi
29440done
29441 done
29442IFS=$as_save_IFS
29443
29444fi
29445fi
29446AWK=$ac_cv_prog_AWK
29447if test -n "$AWK"; then
29448 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
29449$as_echo "$AWK" >&6; }
29450else
29451 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29452$as_echo "no" >&6; }
29453fi
29454
29455
29456 test -n "$AWK" && break
29457done
29458
29459{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
29460$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
29461set x ${MAKE-make}
29462ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
d0ac1c44 29463if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
c971b7fa
PA
29464 $as_echo_n "(cached) " >&6
29465else
29466 cat >conftest.make <<\_ACEOF
29467SHELL = /bin/sh
29468all:
29469 @echo '@@@%%%=$(MAKE)=@@@%%%'
29470_ACEOF
d0ac1c44 29471# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
c971b7fa
PA
29472case `${MAKE-make} -f conftest.make 2>/dev/null` in
29473 *@@@%%%=?*=@@@%%%*)
29474 eval ac_cv_prog_make_${ac_make}_set=yes;;
29475 *)
29476 eval ac_cv_prog_make_${ac_make}_set=no;;
29477esac
29478rm -f conftest.make
29479fi
29480if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
29481 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29482$as_echo "yes" >&6; }
29483 SET_MAKE=
29484else
29485 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29486$as_echo "no" >&6; }
29487 SET_MAKE="MAKE=${MAKE-make}"
29488fi
29489
29490rm -rf .tst 2>/dev/null
29491mkdir .tst 2>/dev/null
29492if test -d .tst; then
29493 am__leading_dot=.
29494else
29495 am__leading_dot=_
29496fi
29497rmdir .tst 2>/dev/null
29498
29499DEPDIR="${am__leading_dot}deps"
29500
29501ac_config_commands="$ac_config_commands depfiles"
29502
29503
29504am_make=${MAKE-make}
29505cat > confinc << 'END'
29506am__doit:
29507 @echo this is the am__doit target
29508.PHONY: am__doit
29509END
29510# If we don't find an include directive, just comment out the code.
29511{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
29512$as_echo_n "checking for style of include used by $am_make... " >&6; }
29513am__include="#"
29514am__quote=
29515_am_result=none
29516# First try GNU make style include.
29517echo "include confinc" > confmf
d0ac1c44 29518# Ignore all kinds of additional output from 'make'.
c971b7fa
PA
29519case `$am_make -s -f confmf 2> /dev/null` in #(
29520*the\ am__doit\ target*)
29521 am__include=include
29522 am__quote=
29523 _am_result=GNU
29524 ;;
29525esac
29526# Now try BSD make style include.
29527if test "$am__include" = "#"; then
29528 echo '.include "confinc"' > confmf
29529 case `$am_make -s -f confmf 2> /dev/null` in #(
29530 *the\ am__doit\ target*)
29531 am__include=.include
29532 am__quote="\""
29533 _am_result=BSD
29534 ;;
29535 esac
29536fi
29537
29538
29539{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
29540$as_echo "$_am_result" >&6; }
29541rm -f confinc confmf
29542
29543# Check whether --enable-dependency-tracking was given.
29544if test "${enable_dependency_tracking+set}" = set; then :
29545 enableval=$enable_dependency_tracking;
29546fi
29547
29548if test "x$enable_dependency_tracking" != xno; then
29549 am_depcomp="$ac_aux_dir/depcomp"
29550 AMDEPBACKSLASH='\'
d0ac1c44 29551 am__nodep='_no'
c971b7fa
PA
29552fi
29553 if test "x$enable_dependency_tracking" != xno; then
29554 AMDEP_TRUE=
29555 AMDEP_FALSE='#'
29556else
29557 AMDEP_TRUE='#'
29558 AMDEP_FALSE=
29559fi
29560
29561
d0ac1c44
SM
29562# Check whether --enable-silent-rules was given.
29563if test "${enable_silent_rules+set}" = set; then :
29564 enableval=$enable_silent_rules;
29565fi
29566
29567case $enable_silent_rules in # (((
29568 yes) AM_DEFAULT_VERBOSITY=0;;
29569 no) AM_DEFAULT_VERBOSITY=1;;
29570 *) AM_DEFAULT_VERBOSITY=1;;
29571esac
29572am_make=${MAKE-make}
29573{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
29574$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
29575if ${am_cv_make_support_nested_variables+:} false; then :
29576 $as_echo_n "(cached) " >&6
29577else
29578 if $as_echo 'TRUE=$(BAR$(V))
29579BAR0=false
29580BAR1=true
29581V=1
29582am__doit:
29583 @$(TRUE)
29584.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
29585 am_cv_make_support_nested_variables=yes
29586else
29587 am_cv_make_support_nested_variables=no
29588fi
29589fi
29590{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
29591$as_echo "$am_cv_make_support_nested_variables" >&6; }
29592if test $am_cv_make_support_nested_variables = yes; then
29593 AM_V='$(V)'
29594 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
29595else
29596 AM_V=$AM_DEFAULT_VERBOSITY
29597 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
29598fi
29599AM_BACKSLASH='\'
29600
c971b7fa
PA
29601if test "`cd $srcdir && pwd`" != "`pwd`"; then
29602 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
29603 # is not polluted with repeated "-I."
29604 am__isrc=' -I$(srcdir)'
29605 # test to see if srcdir already configured
29606 if test -f $srcdir/config.status; then
d0ac1c44 29607 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
c971b7fa
PA
29608 fi
29609fi
29610
29611# test whether we have cygpath
29612if test -z "$CYGPATH_W"; then
29613 if (cygpath --version) >/dev/null 2>/dev/null; then
29614 CYGPATH_W='cygpath -w'
29615 else
29616 CYGPATH_W=echo
29617 fi
29618fi
29619
29620
29621# Define the identity of the package.
d0ac1c44
SM
29622 PACKAGE='libgnu'
29623 VERSION='UNUSED-VERSION'
c971b7fa
PA
29624
29625
29626# Some tools Automake needs.
29627
29628ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
29629
29630
29631AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
29632
29633
29634AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
29635
29636
29637AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
29638
29639
29640MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
29641
d0ac1c44
SM
29642# For better backward compatibility. To be removed once Automake 1.9.x
29643# dies out for good. For more background, see:
29644# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
29645# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
29646mkdir_p='$(MKDIR_P)'
29647
29648# We need awk for the "check" target (and possibly the TAP driver). The
29649# system "awk" is bad on some platforms.
29650# Always define AMTAR for backward compatibility. Yes, it's still used
29651# in the wild :-( We should find a proper way to deprecate it ...
29652AMTAR='$${TAR-tar}'
29653
29654
29655# We'll loop over all known methods to create a tar archive until one works.
29656_am_tools='gnutar pax cpio none'
c971b7fa 29657
d0ac1c44 29658am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
c971b7fa 29659
c971b7fa
PA
29660
29661
29662
29663
29664depcc="$CC" am_compiler_list=
29665
29666{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
29667$as_echo_n "checking dependency style of $depcc... " >&6; }
d0ac1c44 29668if ${am_cv_CC_dependencies_compiler_type+:} false; then :
c971b7fa
PA
29669 $as_echo_n "(cached) " >&6
29670else
29671 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
29672 # We make a subdir and do the tests there. Otherwise we can end up
29673 # making bogus files that we don't know about and never remove. For
29674 # instance it was reported that on HP-UX the gcc test will end up
d0ac1c44
SM
29675 # making a dummy file named 'D' -- because '-MD' means "put the output
29676 # in D".
29677 rm -rf conftest.dir
c971b7fa
PA
29678 mkdir conftest.dir
29679 # Copy depcomp to subdir because otherwise we won't find it if we're
29680 # using a relative directory.
29681 cp "$am_depcomp" conftest.dir
29682 cd conftest.dir
29683 # We will build objects and dependencies in a subdirectory because
29684 # it helps to detect inapplicable dependency modes. For instance
29685 # both Tru64's cc and ICC support -MD to output dependencies as a
29686 # side effect of compilation, but ICC will put the dependencies in
29687 # the current directory while Tru64 will put them in the object
29688 # directory.
29689 mkdir sub
29690
29691 am_cv_CC_dependencies_compiler_type=none
29692 if test "$am_compiler_list" = ""; then
29693 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
29694 fi
29695 am__universal=false
29696 case " $depcc " in #(
29697 *\ -arch\ *\ -arch\ *) am__universal=true ;;
29698 esac
29699
29700 for depmode in $am_compiler_list; do
29701 # Setup a source with many dependencies, because some compilers
29702 # like to wrap large dependency lists on column 80 (with \), and
29703 # we should not choose a depcomp mode which is confused by this.
29704 #
29705 # We need to recreate these files for each test, as the compiler may
29706 # overwrite some of them when testing with obscure command lines.
29707 # This happens at least with the AIX C compiler.
29708 : > sub/conftest.c
29709 for i in 1 2 3 4 5 6; do
29710 echo '#include "conftst'$i'.h"' >> sub/conftest.c
d0ac1c44
SM
29711 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
29712 # Solaris 10 /bin/sh.
29713 echo '/* dummy */' > sub/conftst$i.h
c971b7fa
PA
29714 done
29715 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
29716
d0ac1c44 29717 # We check with '-c' and '-o' for the sake of the "dashmstdout"
c971b7fa 29718 # mode. It turns out that the SunPro C++ compiler does not properly
d0ac1c44
SM
29719 # handle '-M -o', and we need to detect this. Also, some Intel
29720 # versions had trouble with output in subdirs.
c971b7fa
PA
29721 am__obj=sub/conftest.${OBJEXT-o}
29722 am__minus_obj="-o $am__obj"
29723 case $depmode in
29724 gcc)
29725 # This depmode causes a compiler race in universal mode.
29726 test "$am__universal" = false || continue
29727 ;;
29728 nosideeffect)
d0ac1c44
SM
29729 # After this tag, mechanisms are not by side-effect, so they'll
29730 # only be used when explicitly requested.
c971b7fa
PA
29731 if test "x$enable_dependency_tracking" = xyes; then
29732 continue
29733 else
29734 break
29735 fi
29736 ;;
d0ac1c44
SM
29737 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
29738 # This compiler won't grok '-c -o', but also, the minuso test has
c971b7fa
PA
29739 # not run yet. These depmodes are late enough in the game, and
29740 # so weak that their functioning should not be impacted.
29741 am__obj=conftest.${OBJEXT-o}
29742 am__minus_obj=
29743 ;;
29744 none) break ;;
29745 esac
29746 if depmode=$depmode \
29747 source=sub/conftest.c object=$am__obj \
29748 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
29749 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
29750 >/dev/null 2>conftest.err &&
29751 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
29752 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
29753 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
29754 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
29755 # icc doesn't choke on unknown options, it will just issue warnings
29756 # or remarks (even with -Werror). So we grep stderr for any message
29757 # that says an option was ignored or not supported.
29758 # When given -MP, icc 7.0 and 7.1 complain thusly:
29759 # icc: Command line warning: ignoring option '-M'; no argument required
29760 # The diagnosis changed in icc 8.0:
29761 # icc: Command line remark: option '-MP' not supported
29762 if (grep 'ignoring option' conftest.err ||
29763 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
29764 am_cv_CC_dependencies_compiler_type=$depmode
29765 break
29766 fi
29767 fi
29768 done
29769
29770 cd ..
29771 rm -rf conftest.dir
29772else
29773 am_cv_CC_dependencies_compiler_type=none
29774fi
29775
29776fi
29777{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
29778$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
29779CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
29780
29781 if
29782 test "x$enable_dependency_tracking" != xno \
29783 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
29784 am__fastdepCC_TRUE=
29785 am__fastdepCC_FALSE='#'
29786else
29787 am__fastdepCC_TRUE='#'
29788 am__fastdepCC_FALSE=
29789fi
29790
29791
29792
d0ac1c44
SM
29793# POSIX will say in a future version that running "rm -f" with no argument
29794# is OK; and we want to be able to make that assumption in our Makefile
29795# recipes. So use an aggressive probe to check that the usage we want is
29796# actually supported "in the wild" to an acceptable degree.
29797# See automake bug#10828.
29798# To make any issue more visible, cause the running configure to be aborted
29799# by default if the 'rm' program in use doesn't match our expectations; the
29800# user can still override this though.
29801if rm -f && rm -fr && rm -rf; then : OK; else
29802 cat >&2 <<'END'
29803Oops!
29804
29805Your 'rm' program seems unable to run without file operands specified
29806on the command line, even when the '-f' option is present. This is contrary
29807to the behaviour of most rm programs out there, and not conforming with
29808the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
29809
29810Please tell bug-automake@gnu.org about your system, including the value
29811of your $PATH and any error possibly output before this message. This
29812can help us improve future automake versions.
29813
29814END
29815 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
29816 echo 'Configuration will proceed anyway, since you have set the' >&2
29817 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
29818 echo >&2
29819 else
29820 cat >&2 <<'END'
29821Aborting the configuration process, to ensure you take notice of the issue.
29822
29823You can download and install GNU coreutils to get an 'rm' implementation
29824that behaves properly: <http://www.gnu.org/software/coreutils/>.
29825
29826If you want to complete the configuration process using your problematic
29827'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
29828to "yes", and re-run configure.
29829
29830END
29831 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
29832 fi
29833fi
29834
c971b7fa 29835
39be3c7e
SM
29836# Check whether --enable-silent-rules was given.
29837if test "${enable_silent_rules+set}" = set; then :
29838 enableval=$enable_silent_rules;
29839fi
29840
d0ac1c44
SM
29841case $enable_silent_rules in # (((
29842 yes) AM_DEFAULT_VERBOSITY=0;;
29843 no) AM_DEFAULT_VERBOSITY=1;;
29844 *) AM_DEFAULT_VERBOSITY=0;;
39be3c7e 29845esac
d0ac1c44
SM
29846am_make=${MAKE-make}
29847{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
29848$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
29849if ${am_cv_make_support_nested_variables+:} false; then :
29850 $as_echo_n "(cached) " >&6
29851else
29852 if $as_echo 'TRUE=$(BAR$(V))
29853BAR0=false
29854BAR1=true
29855V=1
29856am__doit:
29857 @$(TRUE)
29858.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
29859 am_cv_make_support_nested_variables=yes
29860else
29861 am_cv_make_support_nested_variables=no
29862fi
29863fi
29864{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
29865$as_echo "$am_cv_make_support_nested_variables" >&6; }
29866if test $am_cv_make_support_nested_variables = yes; then
29867 AM_V='$(V)'
29868 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
29869else
29870 AM_V=$AM_DEFAULT_VERBOSITY
29871 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
29872fi
39be3c7e
SM
29873AM_BACKSLASH='\'
29874
29875
c971b7fa
PA
29876# --------------------- #
29877# Checks for programs. #
29878# --------------------- #
29879
29880
29881{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
29882$as_echo_n "checking whether ln -s works... " >&6; }
29883LN_S=$as_ln_s
29884if test "$LN_S" = "ln -s"; then
29885 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29886$as_echo "yes" >&6; }
29887else
29888 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
29889$as_echo "no, using $LN_S" >&6; }
29890fi
29891
29892if test -n "$ac_tool_prefix"; then
29893 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
29894set dummy ${ac_tool_prefix}ranlib; ac_word=$2
29895{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29896$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 29897if ${ac_cv_prog_RANLIB+:} false; then :
c971b7fa
PA
29898 $as_echo_n "(cached) " >&6
29899else
29900 if test -n "$RANLIB"; then
29901 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
29902else
29903as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29904for as_dir in $PATH
29905do
29906 IFS=$as_save_IFS
29907 test -z "$as_dir" && as_dir=.
29908 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 29909 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
29910 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
29911 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
29912 break 2
29913 fi
29914done
29915 done
29916IFS=$as_save_IFS
29917
29918fi
29919fi
29920RANLIB=$ac_cv_prog_RANLIB
29921if test -n "$RANLIB"; then
29922 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
29923$as_echo "$RANLIB" >&6; }
29924else
29925 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29926$as_echo "no" >&6; }
29927fi
29928
29929
29930fi
29931if test -z "$ac_cv_prog_RANLIB"; then
29932 ac_ct_RANLIB=$RANLIB
29933 # Extract the first word of "ranlib", so it can be a program name with args.
29934set dummy ranlib; ac_word=$2
29935{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29936$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 29937if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
29938 $as_echo_n "(cached) " >&6
29939else
29940 if test -n "$ac_ct_RANLIB"; then
29941 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
29942else
29943as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29944for as_dir in $PATH
29945do
29946 IFS=$as_save_IFS
29947 test -z "$as_dir" && as_dir=.
29948 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 29949 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
29950 ac_cv_prog_ac_ct_RANLIB="ranlib"
29951 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
29952 break 2
29953 fi
29954done
29955 done
29956IFS=$as_save_IFS
29957
29958fi
29959fi
29960ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
29961if test -n "$ac_ct_RANLIB"; then
29962 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
29963$as_echo "$ac_ct_RANLIB" >&6; }
29964else
29965 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29966$as_echo "no" >&6; }
29967fi
29968
29969 if test "x$ac_ct_RANLIB" = x; then
29970 RANLIB=":"
29971 else
29972 case $cross_compiling:$ac_tool_warned in
29973yes:)
29974{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
29975$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
29976ac_tool_warned=yes ;;
29977esac
29978 RANLIB=$ac_ct_RANLIB
29979 fi
29980else
29981 RANLIB="$ac_cv_prog_RANLIB"
29982fi
29983
29984
29985if test -n "$ac_tool_prefix"; then
29986 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
29987set dummy ${ac_tool_prefix}ar; ac_word=$2
29988{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29989$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 29990if ${ac_cv_prog_AR+:} false; then :
c971b7fa
PA
29991 $as_echo_n "(cached) " >&6
29992else
29993 if test -n "$AR"; then
29994 ac_cv_prog_AR="$AR" # Let the user override the test.
29995else
29996as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29997for as_dir in $PATH
29998do
29999 IFS=$as_save_IFS
30000 test -z "$as_dir" && as_dir=.
30001 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30002 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30003 ac_cv_prog_AR="${ac_tool_prefix}ar"
30004 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30005 break 2
30006 fi
30007done
30008 done
30009IFS=$as_save_IFS
30010
30011fi
30012fi
30013AR=$ac_cv_prog_AR
30014if test -n "$AR"; then
30015 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
30016$as_echo "$AR" >&6; }
30017else
30018 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30019$as_echo "no" >&6; }
30020fi
30021
30022
30023fi
30024if test -z "$ac_cv_prog_AR"; then
30025 ac_ct_AR=$AR
30026 # Extract the first word of "ar", so it can be a program name with args.
30027set dummy ar; ac_word=$2
30028{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30029$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30030if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
30031 $as_echo_n "(cached) " >&6
30032else
30033 if test -n "$ac_ct_AR"; then
30034 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
30035else
30036as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30037for as_dir in $PATH
30038do
30039 IFS=$as_save_IFS
30040 test -z "$as_dir" && as_dir=.
30041 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30042 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30043 ac_cv_prog_ac_ct_AR="ar"
30044 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30045 break 2
30046 fi
30047done
30048 done
30049IFS=$as_save_IFS
30050
30051fi
30052fi
30053ac_ct_AR=$ac_cv_prog_ac_ct_AR
30054if test -n "$ac_ct_AR"; then
30055 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
30056$as_echo "$ac_ct_AR" >&6; }
30057else
30058 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30059$as_echo "no" >&6; }
30060fi
30061
30062 if test "x$ac_ct_AR" = x; then
30063 AR=""
30064 else
30065 case $cross_compiling:$ac_tool_warned in
30066yes:)
30067{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
30068$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
30069ac_tool_warned=yes ;;
30070esac
30071 AR=$ac_ct_AR
30072 fi
30073else
30074 AR="$ac_cv_prog_AR"
30075fi
30076
30077
30078# ---------------------- #
30079# Checks for libraries. #
30080# ---------------------- #
30081
30082ac_config_files="$ac_config_files Makefile import/Makefile"
30083
30084ac_config_commands="$ac_config_commands default"
30085
30086cat >confcache <<\_ACEOF
30087# This file is a shell script that caches the results of configure
30088# tests run on this system so they can be shared between configure
30089# scripts and configure runs, see configure's option --config-cache.
30090# It is not useful on other systems. If it contains results you don't
30091# want to keep, you may remove or edit it.
30092#
30093# config.status only pays attention to the cache file if you give it
30094# the --recheck option to rerun configure.
30095#
30096# `ac_cv_env_foo' variables (set or unset) will be overridden when
30097# loading this file, other *unset* `ac_cv_foo' will be assigned the
30098# following values.
30099
30100_ACEOF
30101
30102# The following way of writing the cache mishandles newlines in values,
30103# but we know of no workaround that is simple, portable, and efficient.
30104# So, we kill variables containing newlines.
30105# Ultrix sh set writes to stderr and can't be redirected directly,
30106# and sets the high bit in the cache file unless we assign to the vars.
30107(
30108 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
30109 eval ac_val=\$$ac_var
30110 case $ac_val in #(
30111 *${as_nl}*)
30112 case $ac_var in #(
30113 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
30114$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
30115 esac
30116 case $ac_var in #(
30117 _ | IFS | as_nl) ;; #(
30118 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
30119 *) { eval $ac_var=; unset $ac_var;} ;;
30120 esac ;;
30121 esac
30122 done
30123
30124 (set) 2>&1 |
30125 case $as_nl`(ac_space=' '; set) 2>&1` in #(
30126 *${as_nl}ac_space=\ *)
30127 # `set' does not quote correctly, so add quotes: double-quote
30128 # substitution turns \\\\ into \\, and sed turns \\ into \.
30129 sed -n \
30130 "s/'/'\\\\''/g;
30131 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
30132 ;; #(
30133 *)
30134 # `set' quotes correctly as required by POSIX, so do not add quotes.
30135 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
30136 ;;
30137 esac |
30138 sort
30139) |
30140 sed '
30141 /^ac_cv_env_/b end
30142 t clear
30143 :clear
30144 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
30145 t end
30146 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
30147 :end' >>confcache
30148if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
30149 if test -w "$cache_file"; then
d0ac1c44 30150 if test "x$cache_file" != "x/dev/null"; then
c971b7fa
PA
30151 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
30152$as_echo "$as_me: updating cache $cache_file" >&6;}
d0ac1c44
SM
30153 if test ! -f "$cache_file" || test -h "$cache_file"; then
30154 cat confcache >"$cache_file"
30155 else
30156 case $cache_file in #(
30157 */* | ?:*)
30158 mv -f confcache "$cache_file"$$ &&
30159 mv -f "$cache_file"$$ "$cache_file" ;; #(
30160 *)
30161 mv -f confcache "$cache_file" ;;
30162 esac
30163 fi
30164 fi
c971b7fa
PA
30165 else
30166 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
30167$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
30168 fi
30169fi
30170rm -f confcache
30171
30172test "x$prefix" = xNONE && prefix=$ac_default_prefix
30173# Let make expand exec_prefix.
30174test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
30175
30176DEFS=-DHAVE_CONFIG_H
30177
30178ac_libobjs=
30179ac_ltlibobjs=
30180for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
30181 # 1. Remove the extension, and $U if already installed.
30182 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
30183 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
30184 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
30185 # will be set to the directory where LIBOBJS objects are built.
30186 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
30187 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
30188done
30189LIBOBJS=$ac_libobjs
30190
30191LTLIBOBJS=$ac_ltlibobjs
30192
30193
30194if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
d0ac1c44 30195 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
c971b7fa
PA
30196Usually this means the macro was only invoked conditionally." "$LINENO" 5
30197fi
30198if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
d0ac1c44 30199 as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
c971b7fa
PA
30200Usually this means the macro was only invoked conditionally." "$LINENO" 5
30201fi
8690e634 30202if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
d0ac1c44 30203 as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
8690e634
JK
30204Usually this means the macro was only invoked conditionally." "$LINENO" 5
30205fi
18848e28 30206if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
d0ac1c44 30207 as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
18848e28
GF
30208Usually this means the macro was only invoked conditionally." "$LINENO" 5
30209fi
88b48903 30210if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
d0ac1c44 30211 as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
88b48903
WN
30212Usually this means the macro was only invoked conditionally." "$LINENO" 5
30213fi
8690e634 30214if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
d0ac1c44 30215 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
8690e634
JK
30216Usually this means the macro was only invoked conditionally." "$LINENO" 5
30217fi
c0c3707f
CB
30218if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
30219 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
30220Usually this means the macro was only invoked conditionally." "$LINENO" 5
30221fi
30222if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
30223 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
30224Usually this means the macro was only invoked conditionally." "$LINENO" 5
30225fi
6ec2e0f5 30226if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
d0ac1c44 30227 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
6ec2e0f5
SDJ
30228Usually this means the macro was only invoked conditionally." "$LINENO" 5
30229fi
49e4877c 30230if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 30231 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
30232Usually this means the macro was only invoked conditionally." "$LINENO" 5
30233fi
30234if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 30235 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
30236Usually this means the macro was only invoked conditionally." "$LINENO" 5
30237fi
c971b7fa 30238if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
d0ac1c44 30239 as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
c971b7fa
PA
30240Usually this means the macro was only invoked conditionally." "$LINENO" 5
30241fi
88b48903
WN
30242
30243
5df4cba6
SM
30244if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
30245 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
30246Usually this means the macro was only invoked conditionally." "$LINENO" 5
30247fi
725e2999
JB
30248if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
30249 as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
30250Usually this means the macro was only invoked conditionally." "$LINENO" 5
30251fi
30252if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
30253 as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
30254Usually this means the macro was only invoked conditionally." "$LINENO" 5
30255fi
8690e634 30256if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
d0ac1c44 30257 as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
8690e634
JK
30258Usually this means the macro was only invoked conditionally." "$LINENO" 5
30259fi
c971b7fa 30260if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
d0ac1c44 30261 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
c971b7fa
PA
30262Usually this means the macro was only invoked conditionally." "$LINENO" 5
30263fi
30264
30265 gl_libobjs=
30266 gl_ltlibobjs=
30267 if test -n "$gl_LIBOBJS"; then
30268 # Remove the extension.
30269 sed_drop_objext='s/\.o$//;s/\.obj$//'
30270 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
30271 gl_libobjs="$gl_libobjs $i.$ac_objext"
30272 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
30273 done
30274 fi
30275 gl_LIBOBJS=$gl_libobjs
30276
30277 gl_LTLIBOBJS=$gl_ltlibobjs
30278
30279
30280
30281 gltests_libobjs=
30282 gltests_ltlibobjs=
30283 if test -n "$gltests_LIBOBJS"; then
30284 # Remove the extension.
30285 sed_drop_objext='s/\.o$//;s/\.obj$//'
30286 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
30287 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
30288 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
30289 done
30290 fi
30291 gltests_LIBOBJS=$gltests_libobjs
30292
30293 gltests_LTLIBOBJS=$gltests_ltlibobjs
30294
30295
d0ac1c44
SM
30296{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
30297$as_echo_n "checking that generated files are newer than configure... " >&6; }
30298 if test -n "$am_sleep_pid"; then
30299 # Hide warnings about reused PIDs.
30300 wait $am_sleep_pid 2>/dev/null
30301 fi
30302 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
30303$as_echo "done" >&6; }
c971b7fa 30304if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
d0ac1c44 30305 as_fn_error $? "conditional \"AMDEP\" was never defined.
c971b7fa
PA
30306Usually this means the macro was only invoked conditionally." "$LINENO" 5
30307fi
30308if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
d0ac1c44 30309 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
c971b7fa
PA
30310Usually this means the macro was only invoked conditionally." "$LINENO" 5
30311fi
30312 if test -n "$EXEEXT"; then
30313 am__EXEEXT_TRUE=
30314 am__EXEEXT_FALSE='#'
30315else
30316 am__EXEEXT_TRUE='#'
30317 am__EXEEXT_FALSE=
30318fi
30319
30320
d0ac1c44 30321: "${CONFIG_STATUS=./config.status}"
c971b7fa
PA
30322ac_write_fail=0
30323ac_clean_files_save=$ac_clean_files
30324ac_clean_files="$ac_clean_files $CONFIG_STATUS"
30325{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
30326$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
30327as_write_fail=0
30328cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
30329#! $SHELL
30330# Generated by $as_me.
30331# Run this file to recreate the current configuration.
30332# Compiler output produced by configure, useful for debugging
30333# configure, is in config.log if it exists.
30334
30335debug=false
30336ac_cs_recheck=false
30337ac_cs_silent=false
30338
30339SHELL=\${CONFIG_SHELL-$SHELL}
30340export SHELL
30341_ASEOF
30342cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
30343## -------------------- ##
30344## M4sh Initialization. ##
30345## -------------------- ##
30346
30347# Be more Bourne compatible
30348DUALCASE=1; export DUALCASE # for MKS sh
30349if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
30350 emulate sh
30351 NULLCMD=:
30352 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
30353 # is contrary to our usage. Disable this feature.
30354 alias -g '${1+"$@"}'='"$@"'
30355 setopt NO_GLOB_SUBST
30356else
30357 case `(set -o) 2>/dev/null` in #(
30358 *posix*) :
30359 set -o posix ;; #(
30360 *) :
30361 ;;
30362esac
30363fi
30364
30365
30366as_nl='
30367'
30368export as_nl
30369# Printing a long string crashes Solaris 7 /usr/bin/printf.
30370as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
30371as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
30372as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
30373# Prefer a ksh shell builtin over an external printf program on Solaris,
30374# but without wasting forks for bash or zsh.
30375if test -z "$BASH_VERSION$ZSH_VERSION" \
30376 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
30377 as_echo='print -r --'
30378 as_echo_n='print -rn --'
30379elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
30380 as_echo='printf %s\n'
30381 as_echo_n='printf %s'
30382else
30383 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
30384 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
30385 as_echo_n='/usr/ucb/echo -n'
30386 else
30387 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
30388 as_echo_n_body='eval
30389 arg=$1;
30390 case $arg in #(
30391 *"$as_nl"*)
30392 expr "X$arg" : "X\\(.*\\)$as_nl";
30393 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
30394 esac;
30395 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
30396 '
30397 export as_echo_n_body
30398 as_echo_n='sh -c $as_echo_n_body as_echo'
30399 fi
30400 export as_echo_body
30401 as_echo='sh -c $as_echo_body as_echo'
30402fi
30403
30404# The user is always right.
30405if test "${PATH_SEPARATOR+set}" != set; then
30406 PATH_SEPARATOR=:
30407 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
30408 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
30409 PATH_SEPARATOR=';'
30410 }
30411fi
30412
30413
30414# IFS
30415# We need space, tab and new line, in precisely that order. Quoting is
30416# there to prevent editors from complaining about space-tab.
30417# (If _AS_PATH_WALK were called with IFS unset, it would disable word
30418# splitting by setting IFS to empty value.)
30419IFS=" "" $as_nl"
30420
30421# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 30422as_myself=
c971b7fa
PA
30423case $0 in #((
30424 *[\\/]* ) as_myself=$0 ;;
30425 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30426for as_dir in $PATH
30427do
30428 IFS=$as_save_IFS
30429 test -z "$as_dir" && as_dir=.
30430 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
30431 done
30432IFS=$as_save_IFS
30433
30434 ;;
30435esac
30436# We did not find ourselves, most probably we were run as `sh COMMAND'
30437# in which case we are not to be found in the path.
30438if test "x$as_myself" = x; then
30439 as_myself=$0
30440fi
30441if test ! -f "$as_myself"; then
30442 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
30443 exit 1
30444fi
30445
30446# Unset variables that we do not need and which cause bugs (e.g. in
30447# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
30448# suppresses any "Segmentation fault" message there. '((' could
30449# trigger a bug in pdksh 5.2.14.
30450for as_var in BASH_ENV ENV MAIL MAILPATH
30451do eval test x\${$as_var+set} = xset \
30452 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
30453done
30454PS1='$ '
30455PS2='> '
30456PS4='+ '
30457
30458# NLS nuisances.
30459LC_ALL=C
30460export LC_ALL
30461LANGUAGE=C
30462export LANGUAGE
30463
30464# CDPATH.
30465(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
30466
30467
d0ac1c44
SM
30468# as_fn_error STATUS ERROR [LINENO LOG_FD]
30469# ----------------------------------------
c971b7fa
PA
30470# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
30471# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 30472# script with STATUS, using 1 if that was 0.
c971b7fa
PA
30473as_fn_error ()
30474{
d0ac1c44
SM
30475 as_status=$1; test $as_status -eq 0 && as_status=1
30476 if test "$4"; then
30477 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
30478 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 30479 fi
d0ac1c44 30480 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
30481 as_fn_exit $as_status
30482} # as_fn_error
30483
30484
30485# as_fn_set_status STATUS
30486# -----------------------
30487# Set $? to STATUS, without forking.
30488as_fn_set_status ()
30489{
30490 return $1
30491} # as_fn_set_status
30492
30493# as_fn_exit STATUS
30494# -----------------
30495# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
30496as_fn_exit ()
30497{
30498 set +e
30499 as_fn_set_status $1
30500 exit $1
30501} # as_fn_exit
30502
30503# as_fn_unset VAR
30504# ---------------
30505# Portably unset VAR.
30506as_fn_unset ()
30507{
30508 { eval $1=; unset $1;}
30509}
30510as_unset=as_fn_unset
30511# as_fn_append VAR VALUE
30512# ----------------------
30513# Append the text in VALUE to the end of the definition contained in VAR. Take
30514# advantage of any shell optimizations that allow amortized linear growth over
30515# repeated appends, instead of the typical quadratic growth present in naive
30516# implementations.
30517if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
30518 eval 'as_fn_append ()
30519 {
30520 eval $1+=\$2
30521 }'
30522else
30523 as_fn_append ()
30524 {
30525 eval $1=\$$1\$2
30526 }
30527fi # as_fn_append
30528
30529# as_fn_arith ARG...
30530# ------------------
30531# Perform arithmetic evaluation on the ARGs, and store the result in the
30532# global $as_val. Take advantage of shells that can avoid forks. The arguments
30533# must be portable across $(()) and expr.
30534if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
30535 eval 'as_fn_arith ()
30536 {
30537 as_val=$(( $* ))
30538 }'
30539else
30540 as_fn_arith ()
30541 {
30542 as_val=`expr "$@" || test $? -eq 1`
30543 }
30544fi # as_fn_arith
30545
30546
30547if expr a : '\(a\)' >/dev/null 2>&1 &&
30548 test "X`expr 00001 : '.*\(...\)'`" = X001; then
30549 as_expr=expr
30550else
30551 as_expr=false
30552fi
30553
30554if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
30555 as_basename=basename
30556else
30557 as_basename=false
30558fi
30559
30560if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
30561 as_dirname=dirname
30562else
30563 as_dirname=false
30564fi
30565
30566as_me=`$as_basename -- "$0" ||
30567$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
30568 X"$0" : 'X\(//\)$' \| \
30569 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
30570$as_echo X/"$0" |
30571 sed '/^.*\/\([^/][^/]*\)\/*$/{
30572 s//\1/
30573 q
30574 }
30575 /^X\/\(\/\/\)$/{
30576 s//\1/
30577 q
30578 }
30579 /^X\/\(\/\).*/{
30580 s//\1/
30581 q
30582 }
30583 s/.*/./; q'`
30584
30585# Avoid depending upon Character Ranges.
30586as_cr_letters='abcdefghijklmnopqrstuvwxyz'
30587as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
30588as_cr_Letters=$as_cr_letters$as_cr_LETTERS
30589as_cr_digits='0123456789'
30590as_cr_alnum=$as_cr_Letters$as_cr_digits
30591
30592ECHO_C= ECHO_N= ECHO_T=
30593case `echo -n x` in #(((((
30594-n*)
30595 case `echo 'xy\c'` in
30596 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
30597 xy) ECHO_C='\c';;
30598 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
30599 ECHO_T=' ';;
30600 esac;;
30601*)
30602 ECHO_N='-n';;
30603esac
30604
30605rm -f conf$$ conf$$.exe conf$$.file
30606if test -d conf$$.dir; then
30607 rm -f conf$$.dir/conf$$.file
30608else
30609 rm -f conf$$.dir
30610 mkdir conf$$.dir 2>/dev/null
30611fi
30612if (echo >conf$$.file) 2>/dev/null; then
30613 if ln -s conf$$.file conf$$ 2>/dev/null; then
30614 as_ln_s='ln -s'
30615 # ... but there are two gotchas:
30616 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
30617 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 30618 # In both cases, we have to default to `cp -pR'.
c971b7fa 30619 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 30620 as_ln_s='cp -pR'
c971b7fa
PA
30621 elif ln conf$$.file conf$$ 2>/dev/null; then
30622 as_ln_s=ln
30623 else
d0ac1c44 30624 as_ln_s='cp -pR'
c971b7fa
PA
30625 fi
30626else
d0ac1c44 30627 as_ln_s='cp -pR'
c971b7fa
PA
30628fi
30629rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
30630rmdir conf$$.dir 2>/dev/null
30631
30632
30633# as_fn_mkdir_p
30634# -------------
30635# Create "$as_dir" as a directory, including parents if necessary.
30636as_fn_mkdir_p ()
30637{
30638
30639 case $as_dir in #(
30640 -*) as_dir=./$as_dir;;
30641 esac
30642 test -d "$as_dir" || eval $as_mkdir_p || {
30643 as_dirs=
30644 while :; do
30645 case $as_dir in #(
30646 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
30647 *) as_qdir=$as_dir;;
30648 esac
30649 as_dirs="'$as_qdir' $as_dirs"
30650 as_dir=`$as_dirname -- "$as_dir" ||
30651$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
30652 X"$as_dir" : 'X\(//\)[^/]' \| \
30653 X"$as_dir" : 'X\(//\)$' \| \
30654 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
30655$as_echo X"$as_dir" |
30656 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
30657 s//\1/
30658 q
30659 }
30660 /^X\(\/\/\)[^/].*/{
30661 s//\1/
30662 q
30663 }
30664 /^X\(\/\/\)$/{
30665 s//\1/
30666 q
30667 }
30668 /^X\(\/\).*/{
30669 s//\1/
30670 q
30671 }
30672 s/.*/./; q'`
30673 test -d "$as_dir" && break
30674 done
30675 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 30676 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
30677
30678
30679} # as_fn_mkdir_p
30680if mkdir -p . 2>/dev/null; then
30681 as_mkdir_p='mkdir -p "$as_dir"'
30682else
30683 test -d ./-p && rmdir ./-p
30684 as_mkdir_p=false
30685fi
30686
d0ac1c44
SM
30687
30688# as_fn_executable_p FILE
30689# -----------------------
30690# Test if FILE is an executable regular file.
30691as_fn_executable_p ()
30692{
30693 test -f "$1" && test -x "$1"
30694} # as_fn_executable_p
30695as_test_x='test -x'
30696as_executable_p=as_fn_executable_p
c971b7fa
PA
30697
30698# Sed expression to map a string onto a valid CPP name.
30699as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
30700
30701# Sed expression to map a string onto a valid variable name.
30702as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
30703
30704
30705exec 6>&1
30706## ----------------------------------- ##
30707## Main body of $CONFIG_STATUS script. ##
30708## ----------------------------------- ##
30709_ASEOF
30710test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
30711
30712cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
30713# Save the log message, to keep $0 and so on meaningful, and to
30714# report actual input values of CONFIG_FILES etc. instead of their
30715# values after options handling.
30716ac_log="
d0ac1c44
SM
30717This file was extended by libgnu $as_me UNUSED-VERSION, which was
30718generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
30719
30720 CONFIG_FILES = $CONFIG_FILES
30721 CONFIG_HEADERS = $CONFIG_HEADERS
30722 CONFIG_LINKS = $CONFIG_LINKS
30723 CONFIG_COMMANDS = $CONFIG_COMMANDS
30724 $ $0 $@
30725
30726on `(hostname || uname -n) 2>/dev/null | sed 1q`
30727"
30728
30729_ACEOF
30730
30731case $ac_config_files in *"
30732"*) set x $ac_config_files; shift; ac_config_files=$*;;
30733esac
30734
30735case $ac_config_headers in *"
30736"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
30737esac
30738
30739
30740cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
30741# Files that config.status was made for.
30742config_files="$ac_config_files"
30743config_headers="$ac_config_headers"
30744config_commands="$ac_config_commands"
30745
30746_ACEOF
30747
30748cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
30749ac_cs_usage="\
30750\`$as_me' instantiates files and other configuration actions
30751from templates according to the current configuration. Unless the files
30752and actions are specified as TAGs, all are instantiated by default.
30753
30754Usage: $0 [OPTION]... [TAG]...
30755
30756 -h, --help print this help, then exit
30757 -V, --version print version number and configuration settings, then exit
d0ac1c44 30758 --config print configuration, then exit
c971b7fa
PA
30759 -q, --quiet, --silent
30760 do not print progress messages
30761 -d, --debug don't remove temporary files
30762 --recheck update $as_me by reconfiguring in the same conditions
30763 --file=FILE[:TEMPLATE]
30764 instantiate the configuration file FILE
30765 --header=FILE[:TEMPLATE]
30766 instantiate the configuration header FILE
30767
30768Configuration files:
30769$config_files
30770
30771Configuration headers:
30772$config_headers
30773
30774Configuration commands:
30775$config_commands
30776
30777Report bugs to the package provider."
30778
30779_ACEOF
30780cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 30781ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
c971b7fa 30782ac_cs_version="\\
d0ac1c44
SM
30783libgnu config.status UNUSED-VERSION
30784configured by $0, generated by GNU Autoconf 2.69,
30785 with options \\"\$ac_cs_config\\"
c971b7fa 30786
d0ac1c44 30787Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
30788This config.status script is free software; the Free Software Foundation
30789gives unlimited permission to copy, distribute and modify it."
30790
30791ac_pwd='$ac_pwd'
30792srcdir='$srcdir'
30793INSTALL='$INSTALL'
30794MKDIR_P='$MKDIR_P'
30795AWK='$AWK'
30796test -n "\$AWK" || AWK=awk
30797_ACEOF
30798
30799cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
30800# The default lists apply if the user does not specify any file.
30801ac_need_defaults=:
30802while test $# != 0
30803do
30804 case $1 in
d0ac1c44 30805 --*=?*)
c971b7fa
PA
30806 ac_option=`expr "X$1" : 'X\([^=]*\)='`
30807 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
30808 ac_shift=:
30809 ;;
d0ac1c44
SM
30810 --*=)
30811 ac_option=`expr "X$1" : 'X\([^=]*\)='`
30812 ac_optarg=
30813 ac_shift=:
30814 ;;
c971b7fa
PA
30815 *)
30816 ac_option=$1
30817 ac_optarg=$2
30818 ac_shift=shift
30819 ;;
30820 esac
30821
30822 case $ac_option in
30823 # Handling of the options.
30824 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
30825 ac_cs_recheck=: ;;
30826 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
30827 $as_echo "$ac_cs_version"; exit ;;
d0ac1c44
SM
30828 --config | --confi | --conf | --con | --co | --c )
30829 $as_echo "$ac_cs_config"; exit ;;
c971b7fa
PA
30830 --debug | --debu | --deb | --de | --d | -d )
30831 debug=: ;;
30832 --file | --fil | --fi | --f )
30833 $ac_shift
30834 case $ac_optarg in
30835 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
d0ac1c44 30836 '') as_fn_error $? "missing file argument" ;;
c971b7fa
PA
30837 esac
30838 as_fn_append CONFIG_FILES " '$ac_optarg'"
30839 ac_need_defaults=false;;
30840 --header | --heade | --head | --hea )
30841 $ac_shift
30842 case $ac_optarg in
30843 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
30844 esac
30845 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
30846 ac_need_defaults=false;;
30847 --he | --h)
30848 # Conflict between --help and --header
d0ac1c44 30849 as_fn_error $? "ambiguous option: \`$1'
c971b7fa
PA
30850Try \`$0 --help' for more information.";;
30851 --help | --hel | -h )
30852 $as_echo "$ac_cs_usage"; exit ;;
30853 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
30854 | -silent | --silent | --silen | --sile | --sil | --si | --s)
30855 ac_cs_silent=: ;;
30856
30857 # This is an error.
d0ac1c44 30858 -*) as_fn_error $? "unrecognized option: \`$1'
c971b7fa
PA
30859Try \`$0 --help' for more information." ;;
30860
30861 *) as_fn_append ac_config_targets " $1"
30862 ac_need_defaults=false ;;
30863
30864 esac
30865 shift
30866done
30867
30868ac_configure_extra_args=
30869
30870if $ac_cs_silent; then
30871 exec 6>/dev/null
30872 ac_configure_extra_args="$ac_configure_extra_args --silent"
30873fi
30874
30875_ACEOF
30876cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
30877if \$ac_cs_recheck; then
d0ac1c44 30878 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
c971b7fa
PA
30879 shift
30880 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
30881 CONFIG_SHELL='$SHELL'
30882 export CONFIG_SHELL
30883 exec "\$@"
30884fi
30885
30886_ACEOF
30887cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
30888exec 5>>config.log
30889{
30890 echo
30891 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
30892## Running $as_me. ##
30893_ASBOX
30894 $as_echo "$ac_log"
30895} >&5
30896
30897_ACEOF
30898cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
30899#
30900# INIT-COMMANDS
30901#
30902AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
30903
30904_ACEOF
30905
30906cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
30907
30908# Handling of arguments.
30909for ac_config_target in $ac_config_targets
30910do
30911 case $ac_config_target in
30912 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
30913 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
30914 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
30915 "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;;
30916 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
30917
d0ac1c44 30918 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
c971b7fa
PA
30919 esac
30920done
30921
30922
30923# If the user did not use the arguments to specify the items to instantiate,
30924# then the envvar interface is used. Set only those that are not.
30925# We use the long form for the default assignment because of an extremely
30926# bizarre bug on SunOS 4.1.3.
30927if $ac_need_defaults; then
30928 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
30929 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
30930 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
30931fi
30932
30933# Have a temporary directory for convenience. Make it in the build tree
30934# simply because there is no reason against having it here, and in addition,
30935# creating and moving files from /tmp can sometimes cause problems.
30936# Hook for its removal unless debugging.
30937# Note that there is a small window in which the directory will not be cleaned:
30938# after its creation but before its name has been assigned to `$tmp'.
30939$debug ||
30940{
d0ac1c44 30941 tmp= ac_tmp=
c971b7fa 30942 trap 'exit_status=$?
d0ac1c44
SM
30943 : "${ac_tmp:=$tmp}"
30944 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
c971b7fa
PA
30945' 0
30946 trap 'as_fn_exit 1' 1 2 13 15
30947}
30948# Create a (secure) tmp directory for tmp files.
30949
30950{
30951 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
d0ac1c44 30952 test -d "$tmp"
c971b7fa
PA
30953} ||
30954{
30955 tmp=./conf$$-$RANDOM
30956 (umask 077 && mkdir "$tmp")
d0ac1c44
SM
30957} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
30958ac_tmp=$tmp
c971b7fa
PA
30959
30960# Set up the scripts for CONFIG_FILES section.
30961# No need to generate them if there are no CONFIG_FILES.
30962# This happens for instance with `./config.status config.h'.
30963if test -n "$CONFIG_FILES"; then
30964
30965
30966ac_cr=`echo X | tr X '\015'`
30967# On cygwin, bash can eat \r inside `` if the user requested igncr.
30968# But we know of no other shell where ac_cr would be empty at this
30969# point, so we can use a bashism as a fallback.
30970if test "x$ac_cr" = x; then
30971 eval ac_cr=\$\'\\r\'
30972fi
30973ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
30974if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
d0ac1c44 30975 ac_cs_awk_cr='\\r'
c971b7fa
PA
30976else
30977 ac_cs_awk_cr=$ac_cr
30978fi
30979
d0ac1c44 30980echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
c971b7fa
PA
30981_ACEOF
30982
30983
30984{
30985 echo "cat >conf$$subs.awk <<_ACEOF" &&
30986 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
30987 echo "_ACEOF"
30988} >conf$$subs.sh ||
d0ac1c44
SM
30989 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
30990ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
c971b7fa
PA
30991ac_delim='%!_!# '
30992for ac_last_try in false false false false false :; do
30993 . ./conf$$subs.sh ||
d0ac1c44 30994 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
30995
30996 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
30997 if test $ac_delim_n = $ac_delim_num; then
30998 break
30999 elif $ac_last_try; then
d0ac1c44 31000 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
31001 else
31002 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
31003 fi
31004done
31005rm -f conf$$subs.sh
31006
31007cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 31008cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
c971b7fa
PA
31009_ACEOF
31010sed -n '
31011h
31012s/^/S["/; s/!.*/"]=/
31013p
31014g
31015s/^[^!]*!//
31016:repl
31017t repl
31018s/'"$ac_delim"'$//
31019t delim
31020:nl
31021h
d0ac1c44 31022s/\(.\{148\}\)..*/\1/
c971b7fa
PA
31023t more1
31024s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
31025p
31026n
31027b repl
31028:more1
31029s/["\\]/\\&/g; s/^/"/; s/$/"\\/
31030p
31031g
31032s/.\{148\}//
31033t nl
31034:delim
31035h
d0ac1c44 31036s/\(.\{148\}\)..*/\1/
c971b7fa
PA
31037t more2
31038s/["\\]/\\&/g; s/^/"/; s/$/"/
31039p
31040b
31041:more2
31042s/["\\]/\\&/g; s/^/"/; s/$/"\\/
31043p
31044g
31045s/.\{148\}//
31046t delim
31047' <conf$$subs.awk | sed '
31048/^[^""]/{
31049 N
31050 s/\n//
31051}
31052' >>$CONFIG_STATUS || ac_write_fail=1
31053rm -f conf$$subs.awk
31054cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31055_ACAWK
d0ac1c44 31056cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
c971b7fa
PA
31057 for (key in S) S_is_set[key] = 1
31058 FS = "\a"
31059
31060}
31061{
31062 line = $ 0
31063 nfields = split(line, field, "@")
31064 substed = 0
31065 len = length(field[1])
31066 for (i = 2; i < nfields; i++) {
31067 key = field[i]
31068 keylen = length(key)
31069 if (S_is_set[key]) {
31070 value = S[key]
31071 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
31072 len += length(value) + length(field[++i])
31073 substed = 1
31074 } else
31075 len += 1 + keylen
31076 }
31077
31078 print line
31079}
31080
31081_ACAWK
31082_ACEOF
31083cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31084if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
31085 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
31086else
31087 cat
d0ac1c44
SM
31088fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
31089 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
c971b7fa
PA
31090_ACEOF
31091
d0ac1c44
SM
31092# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
31093# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
c971b7fa
PA
31094# trailing colons and then remove the whole line if VPATH becomes empty
31095# (actually we leave an empty line to preserve line numbers).
31096if test "x$srcdir" = x.; then
d0ac1c44
SM
31097 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
31098h
31099s///
31100s/^/:/
31101s/[ ]*$/:/
31102s/:\$(srcdir):/:/g
31103s/:\${srcdir}:/:/g
31104s/:@srcdir@:/:/g
31105s/^:*//
c971b7fa 31106s/:*$//
d0ac1c44
SM
31107x
31108s/\(=[ ]*\).*/\1/
31109G
31110s/\n//
c971b7fa
PA
31111s/^[^=]*=[ ]*$//
31112}'
31113fi
31114
31115cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31116fi # test -n "$CONFIG_FILES"
31117
31118# Set up the scripts for CONFIG_HEADERS section.
31119# No need to generate them if there are no CONFIG_HEADERS.
31120# This happens for instance with `./config.status Makefile'.
31121if test -n "$CONFIG_HEADERS"; then
d0ac1c44 31122cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
c971b7fa
PA
31123BEGIN {
31124_ACEOF
31125
31126# Transform confdefs.h into an awk script `defines.awk', embedded as
31127# here-document in config.status, that substitutes the proper values into
31128# config.h.in to produce config.h.
31129
31130# Create a delimiter string that does not exist in confdefs.h, to ease
31131# handling of long lines.
31132ac_delim='%!_!# '
31133for ac_last_try in false false :; do
d0ac1c44
SM
31134 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
31135 if test -z "$ac_tt"; then
c971b7fa
PA
31136 break
31137 elif $ac_last_try; then
d0ac1c44 31138 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
c971b7fa
PA
31139 else
31140 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
31141 fi
31142done
31143
31144# For the awk script, D is an array of macro values keyed by name,
31145# likewise P contains macro parameters if any. Preserve backslash
31146# newline sequences.
31147
31148ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
31149sed -n '
31150s/.\{148\}/&'"$ac_delim"'/g
31151t rset
31152:rset
31153s/^[ ]*#[ ]*define[ ][ ]*/ /
31154t def
31155d
31156:def
31157s/\\$//
31158t bsnl
31159s/["\\]/\\&/g
31160s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
31161D["\1"]=" \3"/p
31162s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
31163d
31164:bsnl
31165s/["\\]/\\&/g
31166s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
31167D["\1"]=" \3\\\\\\n"\\/p
31168t cont
31169s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
31170t cont
31171d
31172:cont
31173n
31174s/.\{148\}/&'"$ac_delim"'/g
31175t clear
31176:clear
31177s/\\$//
31178t bsnlc
31179s/["\\]/\\&/g; s/^/"/; s/$/"/p
31180d
31181:bsnlc
31182s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
31183b cont
31184' <confdefs.h | sed '
31185s/'"$ac_delim"'/"\\\
31186"/g' >>$CONFIG_STATUS || ac_write_fail=1
31187
31188cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31189 for (key in D) D_is_set[key] = 1
31190 FS = "\a"
31191}
31192/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
31193 line = \$ 0
31194 split(line, arg, " ")
31195 if (arg[1] == "#") {
31196 defundef = arg[2]
31197 mac1 = arg[3]
31198 } else {
31199 defundef = substr(arg[1], 2)
31200 mac1 = arg[2]
31201 }
31202 split(mac1, mac2, "(") #)
31203 macro = mac2[1]
31204 prefix = substr(line, 1, index(line, defundef) - 1)
31205 if (D_is_set[macro]) {
31206 # Preserve the white space surrounding the "#".
31207 print prefix "define", macro P[macro] D[macro]
31208 next
31209 } else {
31210 # Replace #undef with comments. This is necessary, for example,
31211 # in the case of _POSIX_SOURCE, which is predefined and required
31212 # on some systems where configure will not decide to define it.
31213 if (defundef == "undef") {
31214 print "/*", prefix defundef, macro, "*/"
31215 next
31216 }
31217 }
31218}
31219{ print }
31220_ACAWK
31221_ACEOF
31222cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
d0ac1c44 31223 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
c971b7fa
PA
31224fi # test -n "$CONFIG_HEADERS"
31225
31226
31227eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
31228shift
31229for ac_tag
31230do
31231 case $ac_tag in
31232 :[FHLC]) ac_mode=$ac_tag; continue;;
31233 esac
31234 case $ac_mode$ac_tag in
31235 :[FHL]*:*);;
d0ac1c44 31236 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
c971b7fa
PA
31237 :[FH]-) ac_tag=-:-;;
31238 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
31239 esac
31240 ac_save_IFS=$IFS
31241 IFS=:
31242 set x $ac_tag
31243 IFS=$ac_save_IFS
31244 shift
31245 ac_file=$1
31246 shift
31247
31248 case $ac_mode in
31249 :L) ac_source=$1;;
31250 :[FH])
31251 ac_file_inputs=
31252 for ac_f
31253 do
31254 case $ac_f in
d0ac1c44 31255 -) ac_f="$ac_tmp/stdin";;
c971b7fa
PA
31256 *) # Look for the file first in the build tree, then in the source tree
31257 # (if the path is not absolute). The absolute path cannot be DOS-style,
31258 # because $ac_f cannot contain `:'.
31259 test -f "$ac_f" ||
31260 case $ac_f in
31261 [\\/$]*) false;;
31262 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
31263 esac ||
d0ac1c44 31264 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
c971b7fa
PA
31265 esac
31266 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
31267 as_fn_append ac_file_inputs " '$ac_f'"
31268 done
31269
31270 # Let's still pretend it is `configure' which instantiates (i.e., don't
31271 # use $as_me), people would be surprised to read:
31272 # /* config.h. Generated by config.status. */
31273 configure_input='Generated from '`
31274 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
31275 `' by configure.'
31276 if test x"$ac_file" != x-; then
31277 configure_input="$ac_file. $configure_input"
31278 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
31279$as_echo "$as_me: creating $ac_file" >&6;}
31280 fi
31281 # Neutralize special characters interpreted by sed in replacement strings.
31282 case $configure_input in #(
31283 *\&* | *\|* | *\\* )
31284 ac_sed_conf_input=`$as_echo "$configure_input" |
31285 sed 's/[\\\\&|]/\\\\&/g'`;; #(
31286 *) ac_sed_conf_input=$configure_input;;
31287 esac
31288
31289 case $ac_tag in
d0ac1c44
SM
31290 *:-:* | *:-) cat >"$ac_tmp/stdin" \
31291 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
c971b7fa
PA
31292 esac
31293 ;;
31294 esac
31295
31296 ac_dir=`$as_dirname -- "$ac_file" ||
31297$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
31298 X"$ac_file" : 'X\(//\)[^/]' \| \
31299 X"$ac_file" : 'X\(//\)$' \| \
31300 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
31301$as_echo X"$ac_file" |
31302 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
31303 s//\1/
31304 q
31305 }
31306 /^X\(\/\/\)[^/].*/{
31307 s//\1/
31308 q
31309 }
31310 /^X\(\/\/\)$/{
31311 s//\1/
31312 q
31313 }
31314 /^X\(\/\).*/{
31315 s//\1/
31316 q
31317 }
31318 s/.*/./; q'`
31319 as_dir="$ac_dir"; as_fn_mkdir_p
31320 ac_builddir=.
31321
31322case "$ac_dir" in
31323.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
31324*)
31325 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
31326 # A ".." for each directory in $ac_dir_suffix.
31327 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
31328 case $ac_top_builddir_sub in
31329 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
31330 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
31331 esac ;;
31332esac
31333ac_abs_top_builddir=$ac_pwd
31334ac_abs_builddir=$ac_pwd$ac_dir_suffix
31335# for backward compatibility:
31336ac_top_builddir=$ac_top_build_prefix
31337
31338case $srcdir in
31339 .) # We are building in place.
31340 ac_srcdir=.
31341 ac_top_srcdir=$ac_top_builddir_sub
31342 ac_abs_top_srcdir=$ac_pwd ;;
31343 [\\/]* | ?:[\\/]* ) # Absolute name.
31344 ac_srcdir=$srcdir$ac_dir_suffix;
31345 ac_top_srcdir=$srcdir
31346 ac_abs_top_srcdir=$srcdir ;;
31347 *) # Relative name.
31348 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
31349 ac_top_srcdir=$ac_top_build_prefix$srcdir
31350 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
31351esac
31352ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
31353
31354
31355 case $ac_mode in
31356 :F)
31357 #
31358 # CONFIG_FILE
31359 #
31360
31361 case $INSTALL in
31362 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
31363 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
31364 esac
31365 ac_MKDIR_P=$MKDIR_P
31366 case $MKDIR_P in
31367 [\\/$]* | ?:[\\/]* ) ;;
31368 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
31369 esac
31370_ACEOF
31371
31372cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31373# If the template does not know about datarootdir, expand it.
31374# FIXME: This hack should be removed a few years after 2.60.
31375ac_datarootdir_hack=; ac_datarootdir_seen=
31376ac_sed_dataroot='
31377/datarootdir/ {
31378 p
31379 q
31380}
31381/@datadir@/p
31382/@docdir@/p
31383/@infodir@/p
31384/@localedir@/p
31385/@mandir@/p'
31386case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
31387*datarootdir*) ac_datarootdir_seen=yes;;
31388*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
31389 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
31390$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
31391_ACEOF
31392cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31393 ac_datarootdir_hack='
31394 s&@datadir@&$datadir&g
31395 s&@docdir@&$docdir&g
31396 s&@infodir@&$infodir&g
31397 s&@localedir@&$localedir&g
31398 s&@mandir@&$mandir&g
31399 s&\\\${datarootdir}&$datarootdir&g' ;;
31400esac
31401_ACEOF
31402
31403# Neutralize VPATH when `$srcdir' = `.'.
31404# Shell code in configure.ac might set extrasub.
31405# FIXME: do we really want to maintain this feature?
31406cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31407ac_sed_extra="$ac_vpsub
31408$extrasub
31409_ACEOF
31410cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31411:t
31412/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
31413s|@configure_input@|$ac_sed_conf_input|;t t
31414s&@top_builddir@&$ac_top_builddir_sub&;t t
31415s&@top_build_prefix@&$ac_top_build_prefix&;t t
31416s&@srcdir@&$ac_srcdir&;t t
31417s&@abs_srcdir@&$ac_abs_srcdir&;t t
31418s&@top_srcdir@&$ac_top_srcdir&;t t
31419s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
31420s&@builddir@&$ac_builddir&;t t
31421s&@abs_builddir@&$ac_abs_builddir&;t t
31422s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
31423s&@INSTALL@&$ac_INSTALL&;t t
31424s&@MKDIR_P@&$ac_MKDIR_P&;t t
31425$ac_datarootdir_hack
31426"
d0ac1c44
SM
31427eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
31428 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
31429
31430test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
d0ac1c44
SM
31431 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
31432 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
31433 "$ac_tmp/out"`; test -z "$ac_out"; } &&
c971b7fa 31434 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 31435which seems to be undefined. Please make sure it is defined" >&5
c971b7fa 31436$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 31437which seems to be undefined. Please make sure it is defined" >&2;}
c971b7fa 31438
d0ac1c44 31439 rm -f "$ac_tmp/stdin"
c971b7fa 31440 case $ac_file in
d0ac1c44
SM
31441 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
31442 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
c971b7fa 31443 esac \
d0ac1c44 31444 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
31445 ;;
31446 :H)
31447 #
31448 # CONFIG_HEADER
31449 #
31450 if test x"$ac_file" != x-; then
31451 {
31452 $as_echo "/* $configure_input */" \
d0ac1c44
SM
31453 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
31454 } >"$ac_tmp/config.h" \
31455 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
31456 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
c971b7fa
PA
31457 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
31458$as_echo "$as_me: $ac_file is unchanged" >&6;}
31459 else
31460 rm -f "$ac_file"
d0ac1c44
SM
31461 mv "$ac_tmp/config.h" "$ac_file" \
31462 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
31463 fi
31464 else
31465 $as_echo "/* $configure_input */" \
d0ac1c44
SM
31466 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
31467 || as_fn_error $? "could not create -" "$LINENO" 5
c971b7fa
PA
31468 fi
31469# Compute "$ac_file"'s index in $config_headers.
31470_am_arg="$ac_file"
31471_am_stamp_count=1
31472for _am_header in $config_headers :; do
31473 case $_am_header in
31474 $_am_arg | $_am_arg:* )
31475 break ;;
31476 * )
31477 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
31478 esac
31479done
31480echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
31481$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
31482 X"$_am_arg" : 'X\(//\)[^/]' \| \
31483 X"$_am_arg" : 'X\(//\)$' \| \
31484 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
31485$as_echo X"$_am_arg" |
31486 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
31487 s//\1/
31488 q
31489 }
31490 /^X\(\/\/\)[^/].*/{
31491 s//\1/
31492 q
31493 }
31494 /^X\(\/\/\)$/{
31495 s//\1/
31496 q
31497 }
31498 /^X\(\/\).*/{
31499 s//\1/
31500 q
31501 }
31502 s/.*/./; q'`/stamp-h$_am_stamp_count
31503 ;;
31504
31505 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
31506$as_echo "$as_me: executing $ac_file commands" >&6;}
31507 ;;
31508 esac
31509
31510
31511 case $ac_file$ac_mode in
31512 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
d0ac1c44 31513 # Older Autoconf quotes --file arguments for eval, but not when files
c971b7fa
PA
31514 # are listed without --file. Let's play safe and only enable the eval
31515 # if we detect the quoting.
31516 case $CONFIG_FILES in
31517 *\'*) eval set x "$CONFIG_FILES" ;;
31518 *) set x $CONFIG_FILES ;;
31519 esac
31520 shift
31521 for mf
31522 do
31523 # Strip MF so we end up with the name of the file.
31524 mf=`echo "$mf" | sed -e 's/:.*$//'`
31525 # Check whether this is an Automake generated Makefile or not.
d0ac1c44 31526 # We used to match only the files named 'Makefile.in', but
c971b7fa
PA
31527 # some people rename them; so instead we look at the file content.
31528 # Grep'ing the first line is not enough: some people post-process
31529 # each Makefile.in and add a new line on top of each file to say so.
31530 # Grep'ing the whole file is not good either: AIX grep has a line
31531 # limit of 2048, but all sed's we know have understand at least 4000.
31532 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
31533 dirpart=`$as_dirname -- "$mf" ||
31534$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
31535 X"$mf" : 'X\(//\)[^/]' \| \
31536 X"$mf" : 'X\(//\)$' \| \
31537 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
31538$as_echo X"$mf" |
31539 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
31540 s//\1/
31541 q
31542 }
31543 /^X\(\/\/\)[^/].*/{
31544 s//\1/
31545 q
31546 }
31547 /^X\(\/\/\)$/{
31548 s//\1/
31549 q
31550 }
31551 /^X\(\/\).*/{
31552 s//\1/
31553 q
31554 }
31555 s/.*/./; q'`
31556 else
31557 continue
31558 fi
31559 # Extract the definition of DEPDIR, am__include, and am__quote
d0ac1c44 31560 # from the Makefile without running 'make'.
c971b7fa
PA
31561 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
31562 test -z "$DEPDIR" && continue
31563 am__include=`sed -n 's/^am__include = //p' < "$mf"`
d0ac1c44 31564 test -z "$am__include" && continue
c971b7fa 31565 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
c971b7fa
PA
31566 # Find all dependency output files, they are included files with
31567 # $(DEPDIR) in their names. We invoke sed twice because it is the
31568 # simplest approach to changing $(DEPDIR) to its actual value in the
31569 # expansion.
31570 for file in `sed -n "
31571 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
d0ac1c44 31572 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
c971b7fa
PA
31573 # Make sure the directory exists.
31574 test -f "$dirpart/$file" && continue
31575 fdir=`$as_dirname -- "$file" ||
31576$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
31577 X"$file" : 'X\(//\)[^/]' \| \
31578 X"$file" : 'X\(//\)$' \| \
31579 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
31580$as_echo X"$file" |
31581 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
31582 s//\1/
31583 q
31584 }
31585 /^X\(\/\/\)[^/].*/{
31586 s//\1/
31587 q
31588 }
31589 /^X\(\/\/\)$/{
31590 s//\1/
31591 q
31592 }
31593 /^X\(\/\).*/{
31594 s//\1/
31595 q
31596 }
31597 s/.*/./; q'`
31598 as_dir=$dirpart/$fdir; as_fn_mkdir_p
31599 # echo "creating $dirpart/$file"
31600 echo '# dummy' > "$dirpart/$file"
31601 done
31602 done
31603}
31604 ;;
31605 "default":C)
31606case x$CONFIG_HEADERS in
31607xconfig.h:config.in)
31608echo > stamp-h ;;
31609esac
31610 ;;
31611
31612 esac
31613done # for ac_tag
31614
31615
31616as_fn_exit 0
31617_ACEOF
31618ac_clean_files=$ac_clean_files_save
31619
31620test $ac_write_fail = 0 ||
d0ac1c44 31621 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
31622
31623
31624# configure is writing to config.log, and then calls config.status.
31625# config.status does its own redirection, appending to config.log.
31626# Unfortunately, on DOS this fails, as config.log is still kept open
31627# by configure, so config.status won't be able to write to it; its
31628# output is simply discarded. So we exec the FD to /dev/null,
31629# effectively closing config.log, so it can be properly (re)opened and
31630# appended to by config.status. When coming back to configure, we
31631# need to make the FD available again.
31632if test "$no_create" != yes; then
31633 ac_cs_success=:
31634 ac_config_status_args=
31635 test "$silent" = yes &&
31636 ac_config_status_args="$ac_config_status_args --quiet"
31637 exec 5>/dev/null
31638 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
31639 exec 5>>config.log
31640 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
31641 # would make configure fail if this is the last instruction.
d0ac1c44 31642 $ac_cs_success || as_fn_exit 1
c971b7fa
PA
31643fi
31644if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
31645 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
31646$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
31647fi
31648
31649
31650exit 0
This page took 2.316964 seconds and 4 git commands to generate.