Update gnulib to current trunk
[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
698be2d8
CB
714HAVE_SYS_RANDOM_H
715NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H
716NEXT_SYS_RANDOM_H
2196f55f
YQ
717NEXT_AS_FIRST_DIRECTIVE_STRING_H
718NEXT_STRING_H
98399780
YQ
719NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
720NEXT_STDLIB_H
6a29c58e
YQ
721NEXT_AS_FIRST_DIRECTIVE_STDIO_H
722NEXT_STDIO_H
2196f55f
YQ
723HAVE__BOOL
724GL_GENERATE_STDBOOL_H_FALSE
725GL_GENERATE_STDBOOL_H_TRUE
726STDBOOL_H
725e2999
JB
727GL_GENERATE_STDALIGN_H_FALSE
728GL_GENERATE_STDALIGN_H_TRUE
729STDALIGN_H
0750520d
PA
730NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
731NEXT_SIGNAL_H
732REPLACE_RAISE
733REPLACE_PTHREAD_SIGMASK
734HAVE_SIGHANDLER_T
735HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
736HAVE_STRUCT_SIGACTION_SA_SIGACTION
737HAVE_SIGACTION
738HAVE_SIGINFO_T
739HAVE_SIGSET_T
740HAVE_RAISE
741HAVE_PTHREAD_SIGMASK
742HAVE_POSIX_SIGNALBLOCKING
743GNULIB_SIGACTION
744GNULIB_SIGPROCMASK
745GNULIB_SIGNAL_H_SIGPIPE
746GNULIB_RAISE
747GNULIB_PTHREAD_SIGMASK
6a29c58e
YQ
748REPLACE_VSPRINTF
749REPLACE_VSNPRINTF
750REPLACE_VPRINTF
751REPLACE_VFPRINTF
752REPLACE_VDPRINTF
753REPLACE_VASPRINTF
754REPLACE_TMPFILE
755REPLACE_STDIO_WRITE_FUNCS
756REPLACE_STDIO_READ_FUNCS
757REPLACE_SPRINTF
758REPLACE_SNPRINTF
759REPLACE_RENAMEAT
760REPLACE_RENAME
761REPLACE_REMOVE
762REPLACE_PRINTF
763REPLACE_POPEN
764REPLACE_PERROR
765REPLACE_OBSTACK_PRINTF
766REPLACE_GETLINE
767REPLACE_GETDELIM
768REPLACE_FTELLO
769REPLACE_FTELL
770REPLACE_FSEEKO
771REPLACE_FSEEK
772REPLACE_FREOPEN
773REPLACE_FPURGE
774REPLACE_FPRINTF
775REPLACE_FOPEN
776REPLACE_FFLUSH
777REPLACE_FDOPEN
778REPLACE_FCLOSE
779REPLACE_DPRINTF
780HAVE_VDPRINTF
781HAVE_VASPRINTF
782HAVE_RENAMEAT
783HAVE_POPEN
784HAVE_PCLOSE
785HAVE_FTELLO
786HAVE_FSEEKO
787HAVE_DPRINTF
788HAVE_DECL_VSNPRINTF
789HAVE_DECL_SNPRINTF
790HAVE_DECL_OBSTACK_PRINTF
791HAVE_DECL_GETLINE
792HAVE_DECL_GETDELIM
793HAVE_DECL_FTELLO
794HAVE_DECL_FSEEKO
795HAVE_DECL_FPURGE
796GNULIB_VSPRINTF_POSIX
797GNULIB_VSNPRINTF
798GNULIB_VPRINTF_POSIX
799GNULIB_VPRINTF
800GNULIB_VFPRINTF_POSIX
801GNULIB_VFPRINTF
802GNULIB_VDPRINTF
803GNULIB_VSCANF
804GNULIB_VFSCANF
805GNULIB_VASPRINTF
806GNULIB_TMPFILE
807GNULIB_STDIO_H_SIGPIPE
808GNULIB_STDIO_H_NONBLOCKING
809GNULIB_SPRINTF_POSIX
810GNULIB_SNPRINTF
811GNULIB_SCANF
812GNULIB_RENAMEAT
813GNULIB_RENAME
814GNULIB_REMOVE
815GNULIB_PUTS
816GNULIB_PUTCHAR
817GNULIB_PUTC
818GNULIB_PRINTF_POSIX
819GNULIB_PRINTF
820GNULIB_POPEN
821GNULIB_PERROR
822GNULIB_PCLOSE
823GNULIB_OBSTACK_PRINTF_POSIX
824GNULIB_OBSTACK_PRINTF
825GNULIB_GETLINE
826GNULIB_GETDELIM
827GNULIB_GETCHAR
828GNULIB_GETC
829GNULIB_FWRITE
830GNULIB_FTELLO
831GNULIB_FTELL
832GNULIB_FSEEKO
833GNULIB_FSEEK
834GNULIB_FSCANF
835GNULIB_FREOPEN
836GNULIB_FREAD
837GNULIB_FPUTS
838GNULIB_FPUTC
839GNULIB_FPURGE
840GNULIB_FPRINTF_POSIX
841GNULIB_FPRINTF
842GNULIB_FOPEN
843GNULIB_FGETS
844GNULIB_FGETC
845GNULIB_FFLUSH
846GNULIB_FDOPEN
847GNULIB_FCLOSE
848GNULIB_DPRINTF
725e2999
JB
849GL_GENERATE_NETINET_IN_H_FALSE
850GL_GENERATE_NETINET_IN_H_TRUE
851NETINET_IN_H
852HAVE_NETINET_IN_H
853NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
854NEXT_NETINET_IN_H
c971b7fa 855UNDEFINE_STRTOK_R
c971b7fa 856REPLACE_STRSIGNAL
c971b7fa
PA
857REPLACE_STRERROR_R
858REPLACE_STRERROR
c0c3707f 859REPLACE_STRTOK_R
c971b7fa
PA
860REPLACE_STRCASESTR
861REPLACE_STRSTR
c0c3707f
CB
862REPLACE_STRNLEN
863REPLACE_STRNDUP
864REPLACE_STRNCAT
c971b7fa 865REPLACE_STRDUP
c0c3707f 866REPLACE_STRCHRNUL
c971b7fa
PA
867REPLACE_STPNCPY
868REPLACE_MEMMEM
869REPLACE_MEMCHR
870HAVE_STRVERSCMP
871HAVE_DECL_STRSIGNAL
872HAVE_DECL_STRERROR_R
873HAVE_DECL_STRTOK_R
874HAVE_STRCASESTR
875HAVE_STRSEP
876HAVE_STRPBRK
877HAVE_DECL_STRNLEN
878HAVE_DECL_STRNDUP
879HAVE_DECL_STRDUP
880HAVE_STRCHRNUL
881HAVE_STPNCPY
882HAVE_STPCPY
883HAVE_RAWMEMCHR
884HAVE_DECL_MEMRCHR
885HAVE_MEMPCPY
886HAVE_DECL_MEMMEM
887HAVE_MEMCHR
888HAVE_FFSLL
889HAVE_FFSL
c0c3707f 890HAVE_EXPLICIT_BZERO
c971b7fa
PA
891HAVE_MBSLEN
892GNULIB_STRVERSCMP
893GNULIB_STRSIGNAL
894GNULIB_STRERROR_R
895GNULIB_STRERROR
896GNULIB_MBSTOK_R
897GNULIB_MBSSEP
898GNULIB_MBSSPN
899GNULIB_MBSPBRK
900GNULIB_MBSCSPN
901GNULIB_MBSCASESTR
902GNULIB_MBSPCASECMP
903GNULIB_MBSNCASECMP
904GNULIB_MBSCASECMP
905GNULIB_MBSSTR
906GNULIB_MBSRCHR
907GNULIB_MBSCHR
908GNULIB_MBSNLEN
909GNULIB_MBSLEN
910GNULIB_STRTOK_R
911GNULIB_STRCASESTR
912GNULIB_STRSTR
913GNULIB_STRSEP
914GNULIB_STRPBRK
915GNULIB_STRNLEN
916GNULIB_STRNDUP
917GNULIB_STRNCAT
918GNULIB_STRDUP
919GNULIB_STRCHRNUL
920GNULIB_STPNCPY
921GNULIB_STPCPY
922GNULIB_RAWMEMCHR
923GNULIB_MEMRCHR
924GNULIB_MEMPCPY
925GNULIB_MEMMEM
926GNULIB_MEMCHR
927GNULIB_FFSLL
928GNULIB_FFSL
c0c3707f 929GNULIB_EXPLICIT_BZERO
5df4cba6
SM
930HAVE_VISIBILITY
931CFLAG_VISIBILITY
932LIB_MBRTOWC
8690e634 933LOCALE_ZH_CN
c0c3707f 934LOCALE_FR_UTF8
8690e634 935LOCALE_JA
88b48903
WN
936NEXT_AS_FIRST_DIRECTIVE_MATH_H
937NEXT_MATH_H
5abebf3c
CB
938LTLIBMULTITHREAD
939LIBMULTITHREAD
940LTLIBTHREAD
941LIBTHREAD
5df4cba6
SM
942LIBSTDTHREAD
943NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
944NEXT_LOCALE_H
945HAVE_XLOCALE_H
946NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
947NEXT_STDDEF_H
948GL_GENERATE_STDDEF_H_FALSE
949GL_GENERATE_STDDEF_H_TRUE
950STDDEF_H
951HAVE_WCHAR_T
952HAVE_MAX_ALIGN_T
953REPLACE_NULL
954REPLACE_STRUCT_LCONV
955REPLACE_FREELOCALE
956REPLACE_DUPLOCALE
957REPLACE_NEWLOCALE
958REPLACE_SETLOCALE
959REPLACE_LOCALECONV
960HAVE_FREELOCALE
961HAVE_DUPLOCALE
962HAVE_NEWLOCALE
963GNULIB_LOCALENAME
964GNULIB_DUPLOCALE
965GNULIB_SETLOCALE_NULL
966GNULIB_SETLOCALE
967GNULIB_LOCALECONV
8690e634 968LOCALCHARSET_TESTS_ENVIRONMENT
c971b7fa
PA
969NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
970NEXT_INTTYPES_H
971UINT64_MAX_EQ_ULONG_MAX
972UINT32_MAX_LT_UINTMAX_MAX
973PRIPTR_PREFIX
974PRI_MACROS_BROKEN
975INT64_MAX_EQ_LONG_MAX
976INT32_MAX_LT_INTMAX_MAX
4a626d0a 977REPLACE_STRTOUMAX
c971b7fa 978REPLACE_STRTOIMAX
c0c3707f 979HAVE_IMAXDIV_T
c971b7fa
PA
980HAVE_DECL_STRTOUMAX
981HAVE_DECL_STRTOIMAX
982HAVE_DECL_IMAXDIV
983HAVE_DECL_IMAXABS
984GNULIB_STRTOUMAX
985GNULIB_STRTOIMAX
986GNULIB_IMAXDIV
987GNULIB_IMAXABS
988GL_GENERATE_STDINT_H_FALSE
989GL_GENERATE_STDINT_H_TRUE
990STDINT_H
49e4877c
PA
991HAVE_SYS_INTTYPES_H
992HAVE_SYS_BITYPES_H
993HAVE_C99_STDINT_H
c971b7fa
PA
994WINT_T_SUFFIX
995WCHAR_T_SUFFIX
996SIG_ATOMIC_T_SUFFIX
997SIZE_T_SUFFIX
998PTRDIFF_T_SUFFIX
999HAVE_SIGNED_WINT_T
1000HAVE_SIGNED_WCHAR_T
1001HAVE_SIGNED_SIG_ATOMIC_T
1002BITSIZEOF_WINT_T
1003BITSIZEOF_WCHAR_T
1004BITSIZEOF_SIG_ATOMIC_T
1005BITSIZEOF_SIZE_T
1006BITSIZEOF_PTRDIFF_T
1007APPLE_UNIVERSAL_BUILD
c971b7fa
PA
1008HAVE_STDINT_H
1009NEXT_AS_FIRST_DIRECTIVE_STDINT_H
1010NEXT_STDINT_H
c971b7fa
PA
1011HAVE_SYS_TYPES_H
1012HAVE_INTTYPES_H
1013HAVE_WCHAR_H
c0c3707f 1014GNULIB_OVERRIDES_WINT_T
49e4877c
PA
1015GL_GENERATE_LIMITS_H_FALSE
1016GL_GENERATE_LIMITS_H_TRUE
1017LIMITS_H
1018NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
1019NEXT_LIMITS_H
725e2999
JB
1020HAVE_SYS_SOCKET_H
1021NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
1022NEXT_SYS_SOCKET_H
1023HAVE_ACCEPT4
1024HAVE_SA_FAMILY_T
1025HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
1026HAVE_STRUCT_SOCKADDR_STORAGE
1027GNULIB_ACCEPT4
1028GNULIB_SHUTDOWN
1029GNULIB_SETSOCKOPT
1030GNULIB_SENDTO
1031GNULIB_RECVFROM
1032GNULIB_SEND
1033GNULIB_RECV
1034GNULIB_LISTEN
1035GNULIB_GETSOCKOPT
1036GNULIB_GETSOCKNAME
1037GNULIB_GETPEERNAME
1038GNULIB_BIND
1039GNULIB_ACCEPT
1040GNULIB_CONNECT
1041GNULIB_SOCKET
1042INET_NTOP_LIB
5df4cba6
SM
1043LIB_HARD_LOCALE
1044LIB_SETLOCALE_NULL
1045LIB_SCHED_YIELD
1046LIBPMULTITHREAD
1047LIBPTHREAD
6ec2e0f5
SDJ
1048GL_GENERATE_GLOB_H_FALSE
1049GL_GENERATE_GLOB_H_TRUE
1050GLOB_H
c0c3707f
CB
1051HAVE_GLOB_H
1052NEXT_AS_FIRST_DIRECTIVE_GLOB_H
1053NEXT_GLOB_H
1054REPLACE_GLOB_PATTERN_P
1055REPLACE_GLOB
1056HAVE_GLOB_PATTERN_P
1057HAVE_GLOB
1058GNULIB_GLOB
1059REPLACE_LOCALTIME
1060REPLACE_GMTIME
1061REPLACE_TZSET
1062REPLACE_TIMEGM
1063REPLACE_STRFTIME
1064REPLACE_NANOSLEEP
1065REPLACE_MKTIME
1066REPLACE_LOCALTIME_R
1067REPLACE_CTIME
1068HAVE_TIMEZONE_T
1069HAVE_TZSET
1070HAVE_TIMEGM
1071HAVE_STRPTIME
1072HAVE_NANOSLEEP
1073HAVE_DECL_LOCALTIME_R
1074GNULIB_TZSET
1075GNULIB_TIME_RZ
1076GNULIB_TIME_R
1077GNULIB_TIMEGM
1078GNULIB_STRPTIME
1079GNULIB_STRFTIME
1080GNULIB_NANOSLEEP
1081GNULIB_LOCALTIME
1082GNULIB_MKTIME
1083GNULIB_CTIME
4a626d0a
PA
1084NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
1085NEXT_SYS_TIME_H
1086REPLACE_STRUCT_TIMEVAL
1087REPLACE_GETTIMEOFDAY
4a626d0a
PA
1088HAVE_SYS_TIME_H
1089HAVE_STRUCT_TIMEVAL
1090HAVE_GETTIMEOFDAY
1091GNULIB_GETTIMEOFDAY
6ec2e0f5
SDJ
1092LTLIBINTL
1093LIBINTL
698be2d8
CB
1094LIB_GETRANDOM
1095REPLACE_GETRANDOM
1096HAVE_GETRANDOM
1097GNULIB_GETRANDOM
c0c3707f 1098LIB_GETLOGIN
6ec2e0f5 1099WINDOWS_64_BIT_ST_SIZE
c0c3707f 1100WINDOWS_STAT_TIMESPEC
6ec2e0f5
SDJ
1101NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
1102NEXT_SYS_STAT_H
1103REPLACE_UTIMENSAT
1104REPLACE_STAT
1105REPLACE_MKNOD
1106REPLACE_MKFIFO
1107REPLACE_MKDIR
1108REPLACE_LSTAT
1109REPLACE_FUTIMENS
1110REPLACE_FSTATAT
1111REPLACE_FSTAT
5df4cba6 1112REPLACE_FCHMODAT
6ec2e0f5
SDJ
1113HAVE_UTIMENSAT
1114HAVE_MKNODAT
1115HAVE_MKNOD
1116HAVE_MKFIFOAT
1117HAVE_MKFIFO
1118HAVE_MKDIRAT
1119HAVE_LSTAT
1120HAVE_LCHMOD
1121HAVE_FUTIMENS
1122HAVE_FSTATAT
1123HAVE_FCHMODAT
c0c3707f 1124GNULIB_OVERRIDES_STRUCT_STAT
6ec2e0f5
SDJ
1125GNULIB_UTIMENSAT
1126GNULIB_STAT
1127GNULIB_MKNODAT
1128GNULIB_MKNOD
1129GNULIB_MKFIFOAT
1130GNULIB_MKFIFO
1131GNULIB_MKDIRAT
1132GNULIB_LSTAT
1133GNULIB_LCHMOD
1134GNULIB_FUTIMENS
1135GNULIB_FSTATAT
1136GNULIB_FSTAT
1137GNULIB_FCHMODAT
88b48903
WN
1138FREXPL_LIBM
1139HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
1140FREXP_LIBM
1141REPLACE_TRUNCL
1142REPLACE_TRUNCF
1143REPLACE_TRUNC
c0c3707f
CB
1144REPLACE_TANHF
1145REPLACE_TANF
88b48903 1146REPLACE_SQRTL
c0c3707f
CB
1147REPLACE_SQRTF
1148REPLACE_SINHF
1149REPLACE_SINF
88b48903
WN
1150REPLACE_SIGNBIT_USING_GCC
1151REPLACE_SIGNBIT
1152REPLACE_ROUNDL
1153REPLACE_ROUNDF
1154REPLACE_ROUND
c0c3707f 1155REPLACE_RINTL
88b48903
WN
1156REPLACE_REMAINDERL
1157REPLACE_REMAINDERF
1158REPLACE_REMAINDER
1159REPLACE_NAN
1160REPLACE_MODFL
1161REPLACE_MODFF
1162REPLACE_MODF
1163REPLACE_LOGBL
1164REPLACE_LOGBF
1165REPLACE_LOGB
1166REPLACE_LOG2L
1167REPLACE_LOG2F
1168REPLACE_LOG2
1169REPLACE_LOG1PL
1170REPLACE_LOG1PF
1171REPLACE_LOG1P
1172REPLACE_LOG10L
1173REPLACE_LOG10F
1174REPLACE_LOG10
1175REPLACE_LOGL
1176REPLACE_LOGF
1177REPLACE_LOG
1178REPLACE_LDEXPL
1179REPLACE_ISNAN
1180REPLACE_ISINF
1181REPLACE_ISFINITE
c0c3707f 1182REPLACE_ILOGBL
88b48903
WN
1183REPLACE_ILOGBF
1184REPLACE_ILOGB
1185REPLACE_HYPOTL
1186REPLACE_HYPOTF
1187REPLACE_HYPOT
1188REPLACE_HUGE_VAL
1189REPLACE_FREXPL
1190REPLACE_FREXP
1191REPLACE_FREXPF
1192REPLACE_FMODL
1193REPLACE_FMODF
1194REPLACE_FMOD
1195REPLACE_FMAL
1196REPLACE_FMAF
1197REPLACE_FMA
1198REPLACE_FLOORL
1199REPLACE_FLOORF
1200REPLACE_FLOOR
1201REPLACE_FABSL
1202REPLACE_EXP2L
1203REPLACE_EXP2
c0c3707f 1204REPLACE_EXPM1L
88b48903
WN
1205REPLACE_EXPM1F
1206REPLACE_EXPM1
c0c3707f
CB
1207REPLACE_EXPL
1208REPLACE_EXPF
1209REPLACE_COSHF
1210REPLACE_COSF
88b48903
WN
1211REPLACE_CEILL
1212REPLACE_CEILF
1213REPLACE_CEIL
1214REPLACE_CBRTL
1215REPLACE_CBRTF
c0c3707f
CB
1216REPLACE_ATAN2F
1217REPLACE_ATANF
1218REPLACE_ASINF
1219REPLACE_ACOSF
88b48903
WN
1220HAVE_DECL_TRUNCL
1221HAVE_DECL_TRUNCF
1222HAVE_DECL_TRUNC
1223HAVE_DECL_TANL
1224HAVE_DECL_SQRTL
1225HAVE_DECL_SINL
1226HAVE_DECL_ROUNDL
1227HAVE_DECL_ROUNDF
1228HAVE_DECL_ROUND
1229HAVE_DECL_RINTF
1230HAVE_DECL_REMAINDERL
1231HAVE_DECL_REMAINDER
1232HAVE_DECL_LOGB
1233HAVE_DECL_LOG2L
1234HAVE_DECL_LOG2F
1235HAVE_DECL_LOG2
1236HAVE_DECL_LOG10L
1237HAVE_DECL_LOGL
1238HAVE_DECL_LDEXPL
1239HAVE_DECL_FREXPL
1240HAVE_DECL_FLOORL
1241HAVE_DECL_FLOORF
1242HAVE_DECL_EXPM1L
1243HAVE_DECL_EXP2L
1244HAVE_DECL_EXP2F
1245HAVE_DECL_EXP2
1246HAVE_DECL_EXPL
1247HAVE_DECL_COSL
1248HAVE_DECL_COPYSIGNF
1249HAVE_DECL_CEILL
1250HAVE_DECL_CEILF
1251HAVE_DECL_CBRTL
1252HAVE_DECL_CBRTF
1253HAVE_DECL_ATANL
1254HAVE_DECL_ASINL
1255HAVE_DECL_ACOSL
1256HAVE_TANHF
1257HAVE_TANL
1258HAVE_TANF
1259HAVE_SQRTL
1260HAVE_SQRTF
1261HAVE_SINHF
1262HAVE_SINL
1263HAVE_SINF
1264HAVE_RINTL
1265HAVE_RINT
1266HAVE_REMAINDERF
1267HAVE_REMAINDER
1268HAVE_POWF
1269HAVE_MODFL
1270HAVE_MODFF
1271HAVE_LOGBL
1272HAVE_LOGBF
1273HAVE_LOG1PL
1274HAVE_LOG1PF
1275HAVE_LOG1P
1276HAVE_LOG10L
1277HAVE_LOG10F
1278HAVE_LOGL
1279HAVE_LOGF
1280HAVE_LDEXPF
1281HAVE_ISNANL
1282HAVE_ISNAND
1283HAVE_ISNANF
1284HAVE_ILOGBL
1285HAVE_ILOGBF
1286HAVE_ILOGB
1287HAVE_HYPOTL
1288HAVE_HYPOTF
1289HAVE_FREXPF
1290HAVE_FMODL
1291HAVE_FMODF
1292HAVE_FMAL
1293HAVE_FMAF
1294HAVE_FMA
1295HAVE_FABSL
1296HAVE_FABSF
1297HAVE_EXPM1F
1298HAVE_EXPM1
1299HAVE_EXPL
1300HAVE_EXPF
1301HAVE_COSHF
1302HAVE_COSL
1303HAVE_COSF
1304HAVE_COPYSIGNL
1305HAVE_COPYSIGN
1306HAVE_CBRTL
1307HAVE_CBRTF
1308HAVE_CBRT
1309HAVE_ATAN2F
1310HAVE_ATANL
1311HAVE_ATANF
1312HAVE_ASINL
1313HAVE_ASINF
1314HAVE_ACOSL
1315HAVE_ACOSF
1316GNULIB_TRUNCL
1317GNULIB_TRUNCF
1318GNULIB_TRUNC
1319GNULIB_TANHF
1320GNULIB_TANL
1321GNULIB_TANF
1322GNULIB_SQRTL
1323GNULIB_SQRTF
1324GNULIB_SINHF
1325GNULIB_SINL
1326GNULIB_SINF
1327GNULIB_SIGNBIT
1328GNULIB_ROUNDL
1329GNULIB_ROUNDF
1330GNULIB_ROUND
1331GNULIB_RINTL
1332GNULIB_RINTF
1333GNULIB_RINT
1334GNULIB_REMAINDERL
1335GNULIB_REMAINDERF
1336GNULIB_REMAINDER
1337GNULIB_POWF
1338GNULIB_MODFL
1339GNULIB_MODFF
1340GNULIB_MODF
1341GNULIB_LOGBL
1342GNULIB_LOGBF
1343GNULIB_LOGB
1344GNULIB_LOG2L
1345GNULIB_LOG2F
1346GNULIB_LOG2
1347GNULIB_LOG1PL
1348GNULIB_LOG1PF
1349GNULIB_LOG1P
1350GNULIB_LOG10L
1351GNULIB_LOG10F
1352GNULIB_LOG10
1353GNULIB_LOGL
1354GNULIB_LOGF
1355GNULIB_LOG
1356GNULIB_LDEXPL
1357GNULIB_LDEXPF
1358GNULIB_ISNANL
1359GNULIB_ISNAND
1360GNULIB_ISNANF
1361GNULIB_ISNAN
1362GNULIB_ISINF
1363GNULIB_ISFINITE
1364GNULIB_ILOGBL
1365GNULIB_ILOGBF
1366GNULIB_ILOGB
1367GNULIB_HYPOTL
1368GNULIB_HYPOTF
1369GNULIB_HYPOT
1370GNULIB_FREXPL
1371GNULIB_FREXP
1372GNULIB_FREXPF
1373GNULIB_FMODL
1374GNULIB_FMODF
1375GNULIB_FMOD
1376GNULIB_FMAL
1377GNULIB_FMAF
1378GNULIB_FMA
1379GNULIB_FLOORL
1380GNULIB_FLOORF
1381GNULIB_FLOOR
1382GNULIB_FABSL
1383GNULIB_FABSF
1384GNULIB_EXPM1L
1385GNULIB_EXPM1F
1386GNULIB_EXPM1
1387GNULIB_EXP2L
1388GNULIB_EXP2F
1389GNULIB_EXP2
1390GNULIB_EXPL
1391GNULIB_EXPF
1392GNULIB_COSHF
1393GNULIB_COSL
1394GNULIB_COSF
1395GNULIB_COPYSIGNL
1396GNULIB_COPYSIGNF
1397GNULIB_COPYSIGN
1398GNULIB_CEILL
1399GNULIB_CEILF
1400GNULIB_CEIL
1401GNULIB_CBRTL
1402GNULIB_CBRTF
1403GNULIB_CBRT
1404GNULIB_ATAN2F
1405GNULIB_ATANL
1406GNULIB_ATANF
1407GNULIB_ASINL
1408GNULIB_ASINF
1409GNULIB_ACOSL
1410GNULIB_ACOSF
8690e634
JK
1411GL_GENERATE_FNMATCH_H_FALSE
1412GL_GENERATE_FNMATCH_H_TRUE
1413FNMATCH_H
c0c3707f
CB
1414HAVE_FNMATCH_H
1415NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H
1416NEXT_FNMATCH_H
1417REPLACE_FNMATCH
1418HAVE_FNMATCH
1419GNULIB_FNMATCH
88b48903
WN
1420REPLACE_ITOLD
1421GL_GENERATE_FLOAT_H_FALSE
1422GL_GENERATE_FLOAT_H_TRUE
1423FLOAT_H
1424NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
1425NEXT_FLOAT_H
6ec2e0f5
SDJ
1426NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
1427NEXT_FCNTL_H
1428REPLACE_OPENAT
1429REPLACE_OPEN
1430REPLACE_FCNTL
c0c3707f 1431REPLACE_CREAT
6ec2e0f5
SDJ
1432HAVE_OPENAT
1433HAVE_FCNTL
1434GNULIB_OPENAT
1435GNULIB_OPEN
1436GNULIB_NONBLOCKING
1437GNULIB_FCNTL
c0c3707f 1438GNULIB_CREAT
18848e28
GF
1439EOVERFLOW_VALUE
1440EOVERFLOW_HIDDEN
1441ENOLINK_VALUE
1442ENOLINK_HIDDEN
1443EMULTIHOP_VALUE
1444EMULTIHOP_HIDDEN
1445GL_GENERATE_ERRNO_H_FALSE
1446GL_GENERATE_ERRNO_H_TRUE
1447ERRNO_H
1448NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
1449NEXT_ERRNO_H
e26b6bb0
TT
1450HAVE_DIRENT_H
1451NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
1452NEXT_DIRENT_H
698be2d8
CB
1453NEXT_AS_FIRST_DIRECTIVE_CTYPE_H
1454NEXT_CTYPE_H
1455HAVE_ISBLANK
1456GNULIB_ISBLANK
e26b6bb0
TT
1457REPLACE_FDOPENDIR
1458REPLACE_DIRFD
1459REPLACE_CLOSEDIR
1460REPLACE_OPENDIR
1461HAVE_ALPHASORT
1462HAVE_SCANDIR
1463HAVE_FDOPENDIR
1464HAVE_DECL_FDOPENDIR
1465HAVE_DECL_DIRFD
1466HAVE_CLOSEDIR
1467HAVE_REWINDDIR
1468HAVE_READDIR
1469HAVE_OPENDIR
1470GNULIB_ALPHASORT
1471GNULIB_SCANDIR
1472GNULIB_FDOPENDIR
1473GNULIB_DIRFD
1474GNULIB_CLOSEDIR
1475GNULIB_REWINDDIR
1476GNULIB_READDIR
1477GNULIB_OPENDIR
6ec2e0f5
SDJ
1478HAVE_WINSOCK2_H
1479HAVE_MSVC_INVALID_PARAMETER_HANDLER
e26b6bb0
TT
1480UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
1481UNISTD_H_HAVE_WINSOCK2_H
698be2d8 1482UNISTD_H_HAVE_SYS_RANDOM_H
e26b6bb0
TT
1483REPLACE_WRITE
1484REPLACE_USLEEP
1485REPLACE_UNLINKAT
1486REPLACE_UNLINK
1487REPLACE_TTYNAME_R
c0c3707f 1488REPLACE_TRUNCATE
4a626d0a 1489REPLACE_SYMLINKAT
e26b6bb0
TT
1490REPLACE_SYMLINK
1491REPLACE_SLEEP
1492REPLACE_RMDIR
4a626d0a 1493REPLACE_READLINKAT
e26b6bb0
TT
1494REPLACE_READLINK
1495REPLACE_READ
1496REPLACE_PWRITE
1497REPLACE_PREAD
1498REPLACE_LSEEK
1499REPLACE_LINKAT
1500REPLACE_LINK
1501REPLACE_LCHOWN
1502REPLACE_ISATTY
c0c3707f 1503REPLACE_GETPASS
e26b6bb0
TT
1504REPLACE_GETPAGESIZE
1505REPLACE_GETGROUPS
1506REPLACE_GETLOGIN_R
4a626d0a 1507REPLACE_GETDTABLESIZE
e26b6bb0
TT
1508REPLACE_GETDOMAINNAME
1509REPLACE_GETCWD
1510REPLACE_FTRUNCATE
1511REPLACE_FCHOWNAT
c0c3707f 1512REPLACE_FACCESSAT
e26b6bb0
TT
1513REPLACE_DUP2
1514REPLACE_DUP
1515REPLACE_CLOSE
1516REPLACE_CHOWN
c0c3707f 1517REPLACE_ACCESS
e26b6bb0
TT
1518HAVE_SYS_PARAM_H
1519HAVE_OS_H
1520HAVE_DECL_TTYNAME_R
c0c3707f 1521HAVE_DECL_TRUNCATE
e26b6bb0
TT
1522HAVE_DECL_SETHOSTNAME
1523HAVE_DECL_GETUSERSHELL
1524HAVE_DECL_GETPAGESIZE
1525HAVE_DECL_GETLOGIN_R
c0c3707f 1526HAVE_DECL_GETLOGIN
e26b6bb0
TT
1527HAVE_DECL_GETDOMAINNAME
1528HAVE_DECL_FDATASYNC
1529HAVE_DECL_FCHDIR
1530HAVE_DECL_ENVIRON
1531HAVE_USLEEP
1532HAVE_UNLINKAT
1533HAVE_SYMLINKAT
1534HAVE_SYMLINK
1535HAVE_SLEEP
1536HAVE_SETHOSTNAME
1537HAVE_READLINKAT
1538HAVE_READLINK
1539HAVE_PWRITE
1540HAVE_PREAD
1541HAVE_PIPE2
1542HAVE_PIPE
1543HAVE_LINKAT
1544HAVE_LINK
1545HAVE_LCHOWN
1546HAVE_GROUP_MEMBER
c0c3707f 1547HAVE_GETPASS
e26b6bb0
TT
1548HAVE_GETPAGESIZE
1549HAVE_GETLOGIN
1550HAVE_GETHOSTNAME
1551HAVE_GETGROUPS
698be2d8 1552HAVE_GETENTROPY
e26b6bb0
TT
1553HAVE_GETDTABLESIZE
1554HAVE_FTRUNCATE
1555HAVE_FSYNC
1556HAVE_FDATASYNC
1557HAVE_FCHOWNAT
1558HAVE_FCHDIR
1559HAVE_FACCESSAT
1560HAVE_EUIDACCESS
1561HAVE_DUP3
1562HAVE_DUP2
c0c3707f 1563HAVE_COPY_FILE_RANGE
e26b6bb0
TT
1564HAVE_CHOWN
1565GNULIB_WRITE
1566GNULIB_USLEEP
1567GNULIB_UNLINKAT
1568GNULIB_UNLINK
1569GNULIB_UNISTD_H_SIGPIPE
1570GNULIB_UNISTD_H_NONBLOCKING
1571GNULIB_TTYNAME_R
c0c3707f 1572GNULIB_TRUNCATE
e26b6bb0
TT
1573GNULIB_SYMLINKAT
1574GNULIB_SYMLINK
1575GNULIB_SLEEP
1576GNULIB_SETHOSTNAME
1577GNULIB_RMDIR
1578GNULIB_READLINKAT
1579GNULIB_READLINK
1580GNULIB_READ
1581GNULIB_PWRITE
1582GNULIB_PREAD
1583GNULIB_PIPE2
1584GNULIB_PIPE
1585GNULIB_LSEEK
1586GNULIB_LINKAT
1587GNULIB_LINK
1588GNULIB_LCHOWN
1589GNULIB_ISATTY
1590GNULIB_GROUP_MEMBER
1591GNULIB_GETUSERSHELL
c0c3707f 1592GNULIB_GETPASS
e26b6bb0 1593GNULIB_GETPAGESIZE
5df4cba6 1594GNULIB_GETOPT_POSIX
e26b6bb0
TT
1595GNULIB_GETLOGIN_R
1596GNULIB_GETLOGIN
1597GNULIB_GETHOSTNAME
1598GNULIB_GETGROUPS
698be2d8 1599GNULIB_GETENTROPY
e26b6bb0
TT
1600GNULIB_GETDTABLESIZE
1601GNULIB_GETDOMAINNAME
1602GNULIB_GETCWD
1603GNULIB_FTRUNCATE
1604GNULIB_FSYNC
1605GNULIB_FDATASYNC
1606GNULIB_FCHOWNAT
1607GNULIB_FCHDIR
1608GNULIB_FACCESSAT
1609GNULIB_EUIDACCESS
1610GNULIB_ENVIRON
1611GNULIB_DUP3
1612GNULIB_DUP2
1613GNULIB_DUP
c0c3707f 1614GNULIB_COPY_FILE_RANGE
e26b6bb0
TT
1615GNULIB_CLOSE
1616GNULIB_CHOWN
1617GNULIB_CHDIR
c0c3707f 1618GNULIB_ACCESS
98399780
YQ
1619REPLACE_WCTOMB
1620REPLACE_UNSETENV
c0c3707f 1621REPLACE_STRTOLD
98399780 1622REPLACE_STRTOD
c0c3707f 1623REPLACE_SETSTATE
98399780
YQ
1624REPLACE_SETENV
1625REPLACE_REALPATH
1626REPLACE_REALLOC
1627REPLACE_RANDOM_R
c0c3707f 1628REPLACE_RANDOM
4a626d0a 1629REPLACE_QSORT_R
98399780
YQ
1630REPLACE_PUTENV
1631REPLACE_PTSNAME_R
1632REPLACE_PTSNAME
1633REPLACE_MKSTEMP
1634REPLACE_MBTOWC
1635REPLACE_MALLOC
c0c3707f 1636REPLACE_INITSTATE
98399780
YQ
1637REPLACE_CANONICALIZE_FILE_NAME
1638REPLACE_CALLOC
1639HAVE_DECL_UNSETENV
1640HAVE_UNLOCKPT
1641HAVE_SYS_LOADAVG_H
1642HAVE_STRUCT_RANDOM_DATA
1643HAVE_STRTOULL
1644HAVE_STRTOLL
c0c3707f 1645HAVE_STRTOLD
98399780 1646HAVE_STRTOD
c0c3707f
CB
1647HAVE_DECL_SETSTATE
1648HAVE_SETSTATE
98399780
YQ
1649HAVE_DECL_SETENV
1650HAVE_SETENV
4a626d0a 1651HAVE_SECURE_GETENV
98399780
YQ
1652HAVE_RPMATCH
1653HAVE_REALPATH
c0c3707f 1654HAVE_REALLOCARRAY
98399780
YQ
1655HAVE_RANDOM_R
1656HAVE_RANDOM_H
1657HAVE_RANDOM
4c62b19f 1658HAVE_QSORT_R
98399780
YQ
1659HAVE_PTSNAME_R
1660HAVE_PTSNAME
1661HAVE_POSIX_OPENPT
1662HAVE_MKSTEMPS
1663HAVE_MKSTEMP
1664HAVE_MKOSTEMPS
1665HAVE_MKOSTEMP
1666HAVE_MKDTEMP
c0c3707f
CB
1667HAVE_MBTOWC
1668HAVE_DECL_INITSTATE
1669HAVE_INITSTATE
98399780
YQ
1670HAVE_GRANTPT
1671HAVE_GETSUBOPT
1672HAVE_DECL_GETLOADAVG
1673HAVE_CANONICALIZE_FILE_NAME
1674HAVE_ATOLL
1675HAVE__EXIT
1676GNULIB_WCTOMB
1677GNULIB_UNSETENV
1678GNULIB_UNLOCKPT
1679GNULIB_SYSTEM_POSIX
1680GNULIB_STRTOULL
1681GNULIB_STRTOLL
c0c3707f 1682GNULIB_STRTOLD
98399780
YQ
1683GNULIB_STRTOD
1684GNULIB_SETENV
4a626d0a 1685GNULIB_SECURE_GETENV
98399780
YQ
1686GNULIB_RPMATCH
1687GNULIB_REALPATH
1688GNULIB_REALLOC_POSIX
c0c3707f 1689GNULIB_REALLOCARRAY
98399780
YQ
1690GNULIB_RANDOM_R
1691GNULIB_RANDOM
4a626d0a 1692GNULIB_QSORT_R
98399780
YQ
1693GNULIB_PUTENV
1694GNULIB_PTSNAME_R
1695GNULIB_PTSNAME
1696GNULIB_POSIX_OPENPT
1697GNULIB_MKSTEMPS
1698GNULIB_MKSTEMP
1699GNULIB_MKOSTEMPS
1700GNULIB_MKOSTEMP
1701GNULIB_MKDTEMP
1702GNULIB_MBTOWC
1703GNULIB_MALLOC_POSIX
1704GNULIB_GRANTPT
1705GNULIB_GETSUBOPT
1706GNULIB_GETLOADAVG
1707GNULIB_CANONICALIZE_FILE_NAME
1708GNULIB_CALLOC_POSIX
1709GNULIB_ATOLL
1710GNULIB__EXIT
698be2d8
CB
1711LOCALE_FR
1712REPLACE_WCSTOK
1713REPLACE_WCSFTIME
1714REPLACE_WCSWIDTH
1715REPLACE_WCWIDTH
1716REPLACE_WCSNRTOMBS
1717REPLACE_WCSRTOMBS
1718REPLACE_WCRTOMB
1719REPLACE_MBSNRTOWCS
1720REPLACE_MBSRTOWCS
1721REPLACE_MBRLEN
1722REPLACE_MBRTOWC
1723REPLACE_MBSINIT
1724REPLACE_WCTOB
1725REPLACE_BTOWC
1726REPLACE_MBSTATE_T
1727HAVE_DECL_WCWIDTH
1728HAVE_DECL_WCTOB
1729HAVE_WCSFTIME
1730HAVE_WCSWIDTH
1731HAVE_WCSTOK
1732HAVE_WCSSTR
1733HAVE_WCSPBRK
1734HAVE_WCSSPN
1735HAVE_WCSCSPN
1736HAVE_WCSRCHR
1737HAVE_WCSCHR
1738HAVE_WCSDUP
1739HAVE_WCSXFRM
1740HAVE_WCSCOLL
1741HAVE_WCSNCASECMP
1742HAVE_WCSCASECMP
1743HAVE_WCSNCMP
1744HAVE_WCSCMP
1745HAVE_WCSNCAT
1746HAVE_WCSCAT
1747HAVE_WCPNCPY
1748HAVE_WCSNCPY
1749HAVE_WCPCPY
1750HAVE_WCSCPY
1751HAVE_WCSNLEN
1752HAVE_WCSLEN
1753HAVE_WMEMSET
1754HAVE_WMEMPCPY
1755HAVE_WMEMMOVE
1756HAVE_WMEMCPY
1757HAVE_WMEMCMP
1758HAVE_WMEMCHR
1759HAVE_WCSNRTOMBS
1760HAVE_WCSRTOMBS
1761HAVE_WCRTOMB
1762HAVE_MBSNRTOWCS
1763HAVE_MBSRTOWCS
1764HAVE_MBRLEN
1765HAVE_MBRTOWC
1766HAVE_MBSINIT
1767HAVE_BTOWC
1768GNULIB_WCSFTIME
1769GNULIB_WCSWIDTH
1770GNULIB_WCSTOK
1771GNULIB_WCSSTR
1772GNULIB_WCSPBRK
1773GNULIB_WCSSPN
1774GNULIB_WCSCSPN
1775GNULIB_WCSRCHR
1776GNULIB_WCSCHR
1777GNULIB_WCSDUP
1778GNULIB_WCSXFRM
1779GNULIB_WCSCOLL
1780GNULIB_WCSNCASECMP
1781GNULIB_WCSCASECMP
1782GNULIB_WCSNCMP
1783GNULIB_WCSCMP
1784GNULIB_WCSNCAT
1785GNULIB_WCSCAT
1786GNULIB_WCPNCPY
1787GNULIB_WCSNCPY
1788GNULIB_WCPCPY
1789GNULIB_WCSCPY
1790GNULIB_WCSNLEN
1791GNULIB_WCSLEN
1792GNULIB_WMEMSET
1793GNULIB_WMEMPCPY
1794GNULIB_WMEMMOVE
1795GNULIB_WMEMCPY
1796GNULIB_WMEMCMP
1797GNULIB_WMEMCHR
1798GNULIB_WCWIDTH
1799GNULIB_WCSNRTOMBS
1800GNULIB_WCSRTOMBS
1801GNULIB_WCRTOMB
1802GNULIB_MBSNRTOWCS
1803GNULIB_MBSRTOWCS
1804GNULIB_MBRLEN
1805GNULIB_MBRTOWC
1806GNULIB_MBSINIT
1807GNULIB_WCTOB
1808GNULIB_BTOWC
725e2999 1809MKDIR_P
c0c3707f 1810HAVE_WS2TCPIP_H
725e2999
JB
1811HAVE_FEATURES_H
1812NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
1813NEXT_ARPA_INET_H
1814PRAGMA_COLUMNS
1815PRAGMA_SYSTEM_HEADER
1816INCLUDE_NEXT_AS_FIRST_DIRECTIVE
1817INCLUDE_NEXT
1818HAVE_ARPA_INET_H
1819REPLACE_INET_PTON
1820REPLACE_INET_NTOP
1821HAVE_DECL_INET_PTON
1822HAVE_DECL_INET_NTOP
1823GNULIB_INET_PTON
1824GNULIB_INET_NTOP
c0c3707f 1825HAVE_ALLOCA_H
8690e634
JK
1826GL_GENERATE_ALLOCA_H_FALSE
1827GL_GENERATE_ALLOCA_H_TRUE
1828ALLOCA_H
1829ALLOCA
c971b7fa
PA
1830GL_COND_LIBTOOL_FALSE
1831GL_COND_LIBTOOL_TRUE
c8693053
RO
1832RANLIB
1833ARFLAGS
1834AR
1835LARGEFILE_CPPFLAGS
c971b7fa
PA
1836target_os
1837target_vendor
1838target_cpu
1839target
c971b7fa
PA
1840host_os
1841host_vendor
1842host_cpu
1843host
1844build_os
1845build_vendor
1846build_cpu
1847build
4a626d0a
PA
1848EGREP
1849GREP
1850CPP
c971b7fa
PA
1851OBJEXT
1852EXEEXT
1853ac_ct_CC
1854CPPFLAGS
1855LDFLAGS
1856CFLAGS
1857CC
1858MAINT
1859MAINTAINER_MODE_FALSE
1860MAINTAINER_MODE_TRUE
1861target_alias
1862host_alias
1863build_alias
1864LIBS
1865ECHO_T
1866ECHO_N
1867ECHO_C
1868DEFS
1869mandir
1870localedir
1871libdir
1872psdir
1873pdfdir
1874dvidir
1875htmldir
1876infodir
1877docdir
1878oldincludedir
1879includedir
1880localstatedir
1881sharedstatedir
1882sysconfdir
1883datadir
1884datarootdir
1885libexecdir
1886sbindir
1887bindir
1888program_transform_name
1889prefix
1890exec_prefix
1891PACKAGE_URL
1892PACKAGE_BUGREPORT
1893PACKAGE_STRING
1894PACKAGE_VERSION
1895PACKAGE_TARNAME
1896PACKAGE_NAME
1897PATH_SEPARATOR
1898SHELL'
1899ac_subst_files=''
1900ac_user_opts='
1901enable_option_checking
1902enable_maintainer_mode
c8693053 1903enable_plugins
2196f55f 1904enable_largefile
5abebf3c 1905enable_threads
c0c3707f 1906enable_cross_guesses
c971b7fa 1907enable_dependency_tracking
39be3c7e 1908enable_silent_rules
c971b7fa
PA
1909'
1910 ac_precious_vars='build_alias
1911host_alias
1912target_alias
1913CC
1914CFLAGS
1915LDFLAGS
1916LIBS
1917CPPFLAGS
1918CPP'
1919
1920
1921# Initialize some variables set by options.
1922ac_init_help=
1923ac_init_version=false
1924ac_unrecognized_opts=
1925ac_unrecognized_sep=
1926# The variables have the same names as the options, with
1927# dashes changed to underlines.
1928cache_file=/dev/null
1929exec_prefix=NONE
1930no_create=
1931no_recursion=
1932prefix=NONE
1933program_prefix=NONE
1934program_suffix=NONE
1935program_transform_name=s,x,x,
1936silent=
1937site=
1938srcdir=
1939verbose=
1940x_includes=NONE
1941x_libraries=NONE
1942
1943# Installation directory options.
1944# These are left unexpanded so users can "make install exec_prefix=/foo"
1945# and all the variables that are supposed to be based on exec_prefix
1946# by default will actually change.
1947# Use braces instead of parens because sh, perl, etc. also accept them.
1948# (The list follows the same order as the GNU Coding Standards.)
1949bindir='${exec_prefix}/bin'
1950sbindir='${exec_prefix}/sbin'
1951libexecdir='${exec_prefix}/libexec'
1952datarootdir='${prefix}/share'
1953datadir='${datarootdir}'
1954sysconfdir='${prefix}/etc'
1955sharedstatedir='${prefix}/com'
1956localstatedir='${prefix}/var'
1957includedir='${prefix}/include'
1958oldincludedir='/usr/include'
d0ac1c44 1959docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
c971b7fa
PA
1960infodir='${datarootdir}/info'
1961htmldir='${docdir}'
1962dvidir='${docdir}'
1963pdfdir='${docdir}'
1964psdir='${docdir}'
1965libdir='${exec_prefix}/lib'
1966localedir='${datarootdir}/locale'
1967mandir='${datarootdir}/man'
1968
1969ac_prev=
1970ac_dashdash=
1971for ac_option
1972do
1973 # If the previous option needs an argument, assign it.
1974 if test -n "$ac_prev"; then
1975 eval $ac_prev=\$ac_option
1976 ac_prev=
1977 continue
1978 fi
1979
1980 case $ac_option in
d0ac1c44
SM
1981 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
1982 *=) ac_optarg= ;;
1983 *) ac_optarg=yes ;;
c971b7fa
PA
1984 esac
1985
1986 # Accept the important Cygnus configure options, so we can diagnose typos.
1987
1988 case $ac_dashdash$ac_option in
1989 --)
1990 ac_dashdash=yes ;;
1991
1992 -bindir | --bindir | --bindi | --bind | --bin | --bi)
1993 ac_prev=bindir ;;
1994 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
1995 bindir=$ac_optarg ;;
1996
1997 -build | --build | --buil | --bui | --bu)
1998 ac_prev=build_alias ;;
1999 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
2000 build_alias=$ac_optarg ;;
2001
2002 -cache-file | --cache-file | --cache-fil | --cache-fi \
2003 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
2004 ac_prev=cache_file ;;
2005 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
2006 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
2007 cache_file=$ac_optarg ;;
2008
2009 --config-cache | -C)
2010 cache_file=config.cache ;;
2011
2012 -datadir | --datadir | --datadi | --datad)
2013 ac_prev=datadir ;;
2014 -datadir=* | --datadir=* | --datadi=* | --datad=*)
2015 datadir=$ac_optarg ;;
2016
2017 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
2018 | --dataroo | --dataro | --datar)
2019 ac_prev=datarootdir ;;
2020 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
2021 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
2022 datarootdir=$ac_optarg ;;
2023
2024 -disable-* | --disable-*)
2025 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
2026 # Reject names that are not valid shell variable names.
2027 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2028 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2029 ac_useropt_orig=$ac_useropt
2030 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2031 case $ac_user_opts in
2032 *"
2033"enable_$ac_useropt"
2034"*) ;;
2035 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
2036 ac_unrecognized_sep=', ';;
2037 esac
2038 eval enable_$ac_useropt=no ;;
2039
2040 -docdir | --docdir | --docdi | --doc | --do)
2041 ac_prev=docdir ;;
2042 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
2043 docdir=$ac_optarg ;;
2044
2045 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
2046 ac_prev=dvidir ;;
2047 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
2048 dvidir=$ac_optarg ;;
2049
2050 -enable-* | --enable-*)
2051 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
2052 # Reject names that are not valid shell variable names.
2053 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2054 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2055 ac_useropt_orig=$ac_useropt
2056 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2057 case $ac_user_opts in
2058 *"
2059"enable_$ac_useropt"
2060"*) ;;
2061 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
2062 ac_unrecognized_sep=', ';;
2063 esac
2064 eval enable_$ac_useropt=\$ac_optarg ;;
2065
2066 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
2067 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
2068 | --exec | --exe | --ex)
2069 ac_prev=exec_prefix ;;
2070 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
2071 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
2072 | --exec=* | --exe=* | --ex=*)
2073 exec_prefix=$ac_optarg ;;
2074
2075 -gas | --gas | --ga | --g)
2076 # Obsolete; use --with-gas.
2077 with_gas=yes ;;
2078
2079 -help | --help | --hel | --he | -h)
2080 ac_init_help=long ;;
2081 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
2082 ac_init_help=recursive ;;
2083 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
2084 ac_init_help=short ;;
2085
2086 -host | --host | --hos | --ho)
2087 ac_prev=host_alias ;;
2088 -host=* | --host=* | --hos=* | --ho=*)
2089 host_alias=$ac_optarg ;;
2090
2091 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
2092 ac_prev=htmldir ;;
2093 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
2094 | --ht=*)
2095 htmldir=$ac_optarg ;;
2096
2097 -includedir | --includedir | --includedi | --included | --include \
2098 | --includ | --inclu | --incl | --inc)
2099 ac_prev=includedir ;;
2100 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
2101 | --includ=* | --inclu=* | --incl=* | --inc=*)
2102 includedir=$ac_optarg ;;
2103
2104 -infodir | --infodir | --infodi | --infod | --info | --inf)
2105 ac_prev=infodir ;;
2106 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
2107 infodir=$ac_optarg ;;
2108
2109 -libdir | --libdir | --libdi | --libd)
2110 ac_prev=libdir ;;
2111 -libdir=* | --libdir=* | --libdi=* | --libd=*)
2112 libdir=$ac_optarg ;;
2113
2114 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
2115 | --libexe | --libex | --libe)
2116 ac_prev=libexecdir ;;
2117 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
2118 | --libexe=* | --libex=* | --libe=*)
2119 libexecdir=$ac_optarg ;;
2120
2121 -localedir | --localedir | --localedi | --localed | --locale)
2122 ac_prev=localedir ;;
2123 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
2124 localedir=$ac_optarg ;;
2125
2126 -localstatedir | --localstatedir | --localstatedi | --localstated \
2127 | --localstate | --localstat | --localsta | --localst | --locals)
2128 ac_prev=localstatedir ;;
2129 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
2130 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
2131 localstatedir=$ac_optarg ;;
2132
2133 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
2134 ac_prev=mandir ;;
2135 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
2136 mandir=$ac_optarg ;;
2137
2138 -nfp | --nfp | --nf)
2139 # Obsolete; use --without-fp.
2140 with_fp=no ;;
2141
2142 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
2143 | --no-cr | --no-c | -n)
2144 no_create=yes ;;
2145
2146 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
2147 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
2148 no_recursion=yes ;;
2149
2150 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
2151 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
2152 | --oldin | --oldi | --old | --ol | --o)
2153 ac_prev=oldincludedir ;;
2154 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
2155 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
2156 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
2157 oldincludedir=$ac_optarg ;;
2158
2159 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
2160 ac_prev=prefix ;;
2161 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
2162 prefix=$ac_optarg ;;
2163
2164 -program-prefix | --program-prefix | --program-prefi | --program-pref \
2165 | --program-pre | --program-pr | --program-p)
2166 ac_prev=program_prefix ;;
2167 -program-prefix=* | --program-prefix=* | --program-prefi=* \
2168 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
2169 program_prefix=$ac_optarg ;;
2170
2171 -program-suffix | --program-suffix | --program-suffi | --program-suff \
2172 | --program-suf | --program-su | --program-s)
2173 ac_prev=program_suffix ;;
2174 -program-suffix=* | --program-suffix=* | --program-suffi=* \
2175 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
2176 program_suffix=$ac_optarg ;;
2177
2178 -program-transform-name | --program-transform-name \
2179 | --program-transform-nam | --program-transform-na \
2180 | --program-transform-n | --program-transform- \
2181 | --program-transform | --program-transfor \
2182 | --program-transfo | --program-transf \
2183 | --program-trans | --program-tran \
2184 | --progr-tra | --program-tr | --program-t)
2185 ac_prev=program_transform_name ;;
2186 -program-transform-name=* | --program-transform-name=* \
2187 | --program-transform-nam=* | --program-transform-na=* \
2188 | --program-transform-n=* | --program-transform-=* \
2189 | --program-transform=* | --program-transfor=* \
2190 | --program-transfo=* | --program-transf=* \
2191 | --program-trans=* | --program-tran=* \
2192 | --progr-tra=* | --program-tr=* | --program-t=*)
2193 program_transform_name=$ac_optarg ;;
2194
2195 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
2196 ac_prev=pdfdir ;;
2197 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
2198 pdfdir=$ac_optarg ;;
2199
2200 -psdir | --psdir | --psdi | --psd | --ps)
2201 ac_prev=psdir ;;
2202 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
2203 psdir=$ac_optarg ;;
2204
2205 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2206 | -silent | --silent | --silen | --sile | --sil)
2207 silent=yes ;;
2208
2209 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
2210 ac_prev=sbindir ;;
2211 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
2212 | --sbi=* | --sb=*)
2213 sbindir=$ac_optarg ;;
2214
2215 -sharedstatedir | --sharedstatedir | --sharedstatedi \
2216 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
2217 | --sharedst | --shareds | --shared | --share | --shar \
2218 | --sha | --sh)
2219 ac_prev=sharedstatedir ;;
2220 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
2221 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
2222 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
2223 | --sha=* | --sh=*)
2224 sharedstatedir=$ac_optarg ;;
2225
2226 -site | --site | --sit)
2227 ac_prev=site ;;
2228 -site=* | --site=* | --sit=*)
2229 site=$ac_optarg ;;
2230
2231 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
2232 ac_prev=srcdir ;;
2233 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
2234 srcdir=$ac_optarg ;;
2235
2236 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
2237 | --syscon | --sysco | --sysc | --sys | --sy)
2238 ac_prev=sysconfdir ;;
2239 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
2240 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
2241 sysconfdir=$ac_optarg ;;
2242
2243 -target | --target | --targe | --targ | --tar | --ta | --t)
2244 ac_prev=target_alias ;;
2245 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
2246 target_alias=$ac_optarg ;;
2247
2248 -v | -verbose | --verbose | --verbos | --verbo | --verb)
2249 verbose=yes ;;
2250
2251 -version | --version | --versio | --versi | --vers | -V)
2252 ac_init_version=: ;;
2253
2254 -with-* | --with-*)
2255 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
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--with-$ac_useropt_orig"
2266 ac_unrecognized_sep=', ';;
2267 esac
2268 eval with_$ac_useropt=\$ac_optarg ;;
2269
2270 -without-* | --without-*)
2271 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
2272 # Reject names that are not valid shell variable names.
2273 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2274 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2275 ac_useropt_orig=$ac_useropt
2276 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2277 case $ac_user_opts in
2278 *"
2279"with_$ac_useropt"
2280"*) ;;
2281 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
2282 ac_unrecognized_sep=', ';;
2283 esac
2284 eval with_$ac_useropt=no ;;
2285
2286 --x)
2287 # Obsolete; use --with-x.
2288 with_x=yes ;;
2289
2290 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
2291 | --x-incl | --x-inc | --x-in | --x-i)
2292 ac_prev=x_includes ;;
2293 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
2294 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
2295 x_includes=$ac_optarg ;;
2296
2297 -x-libraries | --x-libraries | --x-librarie | --x-librari \
2298 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
2299 ac_prev=x_libraries ;;
2300 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
2301 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
2302 x_libraries=$ac_optarg ;;
2303
d0ac1c44
SM
2304 -*) as_fn_error $? "unrecognized option: \`$ac_option'
2305Try \`$0 --help' for more information"
c971b7fa
PA
2306 ;;
2307
2308 *=*)
2309 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
2310 # Reject names that are not valid shell variable names.
2311 case $ac_envvar in #(
2312 '' | [0-9]* | *[!_$as_cr_alnum]* )
d0ac1c44 2313 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
c971b7fa
PA
2314 esac
2315 eval $ac_envvar=\$ac_optarg
2316 export $ac_envvar ;;
2317
2318 *)
2319 # FIXME: should be removed in autoconf 3.0.
2320 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
2321 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
2322 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
d0ac1c44 2323 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
c971b7fa
PA
2324 ;;
2325
2326 esac
2327done
2328
2329if test -n "$ac_prev"; then
2330 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
d0ac1c44 2331 as_fn_error $? "missing argument to $ac_option"
c971b7fa
PA
2332fi
2333
2334if test -n "$ac_unrecognized_opts"; then
2335 case $enable_option_checking in
2336 no) ;;
d0ac1c44 2337 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
c971b7fa
PA
2338 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
2339 esac
2340fi
2341
2342# Check all directory arguments for consistency.
2343for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
2344 datadir sysconfdir sharedstatedir localstatedir includedir \
2345 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
2346 libdir localedir mandir
2347do
2348 eval ac_val=\$$ac_var
2349 # Remove trailing slashes.
2350 case $ac_val in
2351 */ )
2352 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
2353 eval $ac_var=\$ac_val;;
2354 esac
2355 # Be sure to have absolute directory names.
2356 case $ac_val in
2357 [\\/$]* | ?:[\\/]* ) continue;;
2358 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
2359 esac
d0ac1c44 2360 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
c971b7fa
PA
2361done
2362
2363# There might be people who depend on the old broken behavior: `$host'
2364# used to hold the argument of --host etc.
2365# FIXME: To remove some day.
2366build=$build_alias
2367host=$host_alias
2368target=$target_alias
2369
2370# FIXME: To remove some day.
2371if test "x$host_alias" != x; then
2372 if test "x$build_alias" = x; then
2373 cross_compiling=maybe
c971b7fa
PA
2374 elif test "x$build_alias" != "x$host_alias"; then
2375 cross_compiling=yes
2376 fi
2377fi
2378
2379ac_tool_prefix=
2380test -n "$host_alias" && ac_tool_prefix=$host_alias-
2381
2382test "$silent" = yes && exec 6>/dev/null
2383
2384
2385ac_pwd=`pwd` && test -n "$ac_pwd" &&
2386ac_ls_di=`ls -di .` &&
2387ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
d0ac1c44 2388 as_fn_error $? "working directory cannot be determined"
c971b7fa 2389test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
d0ac1c44 2390 as_fn_error $? "pwd does not report name of working directory"
c971b7fa
PA
2391
2392
2393# Find the source files, if location was not specified.
2394if test -z "$srcdir"; then
2395 ac_srcdir_defaulted=yes
2396 # Try the directory containing this script, then the parent directory.
2397 ac_confdir=`$as_dirname -- "$as_myself" ||
2398$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2399 X"$as_myself" : 'X\(//\)[^/]' \| \
2400 X"$as_myself" : 'X\(//\)$' \| \
2401 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
2402$as_echo X"$as_myself" |
2403 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
2404 s//\1/
2405 q
2406 }
2407 /^X\(\/\/\)[^/].*/{
2408 s//\1/
2409 q
2410 }
2411 /^X\(\/\/\)$/{
2412 s//\1/
2413 q
2414 }
2415 /^X\(\/\).*/{
2416 s//\1/
2417 q
2418 }
2419 s/.*/./; q'`
2420 srcdir=$ac_confdir
2421 if test ! -r "$srcdir/$ac_unique_file"; then
2422 srcdir=..
2423 fi
2424else
2425 ac_srcdir_defaulted=no
2426fi
2427if test ! -r "$srcdir/$ac_unique_file"; then
2428 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
d0ac1c44 2429 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
c971b7fa
PA
2430fi
2431ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
2432ac_abs_confdir=`(
d0ac1c44 2433 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
c971b7fa
PA
2434 pwd)`
2435# When building in place, set srcdir=.
2436if test "$ac_abs_confdir" = "$ac_pwd"; then
2437 srcdir=.
2438fi
2439# Remove unnecessary trailing slashes from srcdir.
2440# Double slashes in file names in object file debugging info
2441# mess up M-x gdb in Emacs.
2442case $srcdir in
2443*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
2444esac
2445for ac_var in $ac_precious_vars; do
2446 eval ac_env_${ac_var}_set=\${${ac_var}+set}
2447 eval ac_env_${ac_var}_value=\$${ac_var}
2448 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
2449 eval ac_cv_env_${ac_var}_value=\$${ac_var}
2450done
2451
2452#
2453# Report the --help message.
2454#
2455if test "$ac_init_help" = "long"; then
2456 # Omit some internal or obsolete options to make the list less imposing.
2457 # This message is too long to be a string in the A/UX 3.1 sh.
2458 cat <<_ACEOF
d0ac1c44 2459\`configure' configures libgnu UNUSED-VERSION to adapt to many kinds of systems.
c971b7fa
PA
2460
2461Usage: $0 [OPTION]... [VAR=VALUE]...
2462
2463To assign environment variables (e.g., CC, CFLAGS...), specify them as
2464VAR=VALUE. See below for descriptions of some of the useful variables.
2465
2466Defaults for the options are specified in brackets.
2467
2468Configuration:
2469 -h, --help display this help and exit
2470 --help=short display options specific to this package
2471 --help=recursive display the short help of all the included packages
2472 -V, --version display version information and exit
d0ac1c44 2473 -q, --quiet, --silent do not print \`checking ...' messages
c971b7fa
PA
2474 --cache-file=FILE cache test results in FILE [disabled]
2475 -C, --config-cache alias for \`--cache-file=config.cache'
2476 -n, --no-create do not create output files
2477 --srcdir=DIR find the sources in DIR [configure dir or \`..']
2478
2479Installation directories:
2480 --prefix=PREFIX install architecture-independent files in PREFIX
2481 [$ac_default_prefix]
2482 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
2483 [PREFIX]
2484
2485By default, \`make install' will install all the files in
2486\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
2487an installation prefix other than \`$ac_default_prefix' using \`--prefix',
2488for instance \`--prefix=\$HOME'.
2489
2490For better control, use the options below.
2491
2492Fine tuning of the installation directories:
2493 --bindir=DIR user executables [EPREFIX/bin]
2494 --sbindir=DIR system admin executables [EPREFIX/sbin]
2495 --libexecdir=DIR program executables [EPREFIX/libexec]
2496 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
2497 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
2498 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
2499 --libdir=DIR object code libraries [EPREFIX/lib]
2500 --includedir=DIR C header files [PREFIX/include]
2501 --oldincludedir=DIR C header files for non-gcc [/usr/include]
2502 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
2503 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
2504 --infodir=DIR info documentation [DATAROOTDIR/info]
2505 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
2506 --mandir=DIR man documentation [DATAROOTDIR/man]
d0ac1c44 2507 --docdir=DIR documentation root [DATAROOTDIR/doc/libgnu]
c971b7fa
PA
2508 --htmldir=DIR html documentation [DOCDIR]
2509 --dvidir=DIR dvi documentation [DOCDIR]
2510 --pdfdir=DIR pdf documentation [DOCDIR]
2511 --psdir=DIR ps documentation [DOCDIR]
2512_ACEOF
2513
2514 cat <<\_ACEOF
2515
2516Program names:
2517 --program-prefix=PREFIX prepend PREFIX to installed program names
2518 --program-suffix=SUFFIX append SUFFIX to installed program names
2519 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
2520
2521System types:
2522 --build=BUILD configure for building on BUILD [guessed]
2523 --host=HOST cross-compile to build programs to run on HOST [BUILD]
2524 --target=TARGET configure for building compilers for TARGET [HOST]
2525_ACEOF
2526fi
2527
2528if test -n "$ac_init_help"; then
d0ac1c44
SM
2529 case $ac_init_help in
2530 short | recursive ) echo "Configuration of libgnu UNUSED-VERSION:";;
2531 esac
c971b7fa
PA
2532 cat <<\_ACEOF
2533
2534Optional Features:
2535 --disable-option-checking ignore unrecognized --enable/--with options
2536 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
2537 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
d0ac1c44
SM
2538 --enable-maintainer-mode
2539 enable make rules and dependencies not useful (and
2540 sometimes confusing) to the casual installer
c8693053 2541 --enable-plugins Enable support for plugins
2196f55f 2542 --disable-largefile omit support for large files
c0c3707f 2543 --enable-threads={isoc|posix|isoc+posix|windows}
5abebf3c
CB
2544 specify multithreading API
2545 --disable-threads build without multithread safety
c0c3707f
CB
2546 --enable-cross-guesses={conservative|risky}
2547 specify policy for cross-compilation guesses
d0ac1c44
SM
2548 --enable-dependency-tracking
2549 do not reject slow dependency extractors
2550 --disable-dependency-tracking
2551 speeds up one-time build
2552 --enable-silent-rules less verbose build output (undo: "make V=1")
2553 --disable-silent-rules verbose build output (undo: "make V=0")
c971b7fa
PA
2554
2555Some influential environment variables:
2556 CC C compiler command
2557 CFLAGS C compiler flags
2558 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
2559 nonstandard directory <lib dir>
2560 LIBS libraries to pass to the linker, e.g. -l<library>
d0ac1c44 2561 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
c971b7fa
PA
2562 you have headers in a nonstandard directory <include dir>
2563 CPP C preprocessor
2564
2565Use these variables to override the choices made by `configure' or to help
2566it to find libraries and programs with nonstandard names/locations.
2567
2568Report bugs to the package provider.
2569_ACEOF
2570ac_status=$?
2571fi
2572
2573if test "$ac_init_help" = "recursive"; then
2574 # If there are subdirs, report their specific --help.
2575 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
2576 test -d "$ac_dir" ||
2577 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
2578 continue
2579 ac_builddir=.
2580
2581case "$ac_dir" in
2582.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
2583*)
2584 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
2585 # A ".." for each directory in $ac_dir_suffix.
2586 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
2587 case $ac_top_builddir_sub in
2588 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
2589 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
2590 esac ;;
2591esac
2592ac_abs_top_builddir=$ac_pwd
2593ac_abs_builddir=$ac_pwd$ac_dir_suffix
2594# for backward compatibility:
2595ac_top_builddir=$ac_top_build_prefix
2596
2597case $srcdir in
2598 .) # We are building in place.
2599 ac_srcdir=.
2600 ac_top_srcdir=$ac_top_builddir_sub
2601 ac_abs_top_srcdir=$ac_pwd ;;
2602 [\\/]* | ?:[\\/]* ) # Absolute name.
2603 ac_srcdir=$srcdir$ac_dir_suffix;
2604 ac_top_srcdir=$srcdir
2605 ac_abs_top_srcdir=$srcdir ;;
2606 *) # Relative name.
2607 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
2608 ac_top_srcdir=$ac_top_build_prefix$srcdir
2609 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
2610esac
2611ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
2612
2613 cd "$ac_dir" || { ac_status=$?; continue; }
2614 # Check for guested configure.
2615 if test -f "$ac_srcdir/configure.gnu"; then
2616 echo &&
2617 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
2618 elif test -f "$ac_srcdir/configure"; then
2619 echo &&
2620 $SHELL "$ac_srcdir/configure" --help=recursive
2621 else
2622 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
2623 fi || ac_status=$?
2624 cd "$ac_pwd" || { ac_status=$?; break; }
2625 done
2626fi
2627
2628test -n "$ac_init_help" && exit $ac_status
2629if $ac_init_version; then
2630 cat <<\_ACEOF
d0ac1c44
SM
2631libgnu configure UNUSED-VERSION
2632generated by GNU Autoconf 2.69
c971b7fa 2633
d0ac1c44 2634Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
2635This configure script is free software; the Free Software Foundation
2636gives unlimited permission to copy, distribute and modify it.
2637_ACEOF
2638 exit
2639fi
2640
2641## ------------------------ ##
2642## Autoconf initialization. ##
2643## ------------------------ ##
2644
2645# ac_fn_c_try_compile LINENO
2646# --------------------------
2647# Try to compile conftest.$ac_ext, and return whether this succeeded.
2648ac_fn_c_try_compile ()
2649{
2650 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2651 rm -f conftest.$ac_objext
2652 if { { ac_try="$ac_compile"
2653case "(($ac_try" in
2654 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2655 *) ac_try_echo=$ac_try;;
2656esac
2657eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2658$as_echo "$ac_try_echo"; } >&5
2659 (eval "$ac_compile") 2>conftest.err
2660 ac_status=$?
2661 if test -s conftest.err; then
2662 grep -v '^ *+' conftest.err >conftest.er1
2663 cat conftest.er1 >&5
2664 mv -f conftest.er1 conftest.err
2665 fi
2666 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2667 test $ac_status = 0; } && {
2668 test -z "$ac_c_werror_flag" ||
2669 test ! -s conftest.err
2670 } && test -s conftest.$ac_objext; then :
2671 ac_retval=0
2672else
2673 $as_echo "$as_me: failed program was:" >&5
2674sed 's/^/| /' conftest.$ac_ext >&5
2675
2676 ac_retval=1
2677fi
d0ac1c44
SM
2678 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2679 as_fn_set_status $ac_retval
c971b7fa
PA
2680
2681} # ac_fn_c_try_compile
2682
2683# ac_fn_c_try_cpp LINENO
2684# ----------------------
2685# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
2686ac_fn_c_try_cpp ()
2687{
2688 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2689 if { { ac_try="$ac_cpp conftest.$ac_ext"
2690case "(($ac_try" in
2691 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2692 *) ac_try_echo=$ac_try;;
2693esac
2694eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2695$as_echo "$ac_try_echo"; } >&5
2696 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
2697 ac_status=$?
2698 if test -s conftest.err; then
2699 grep -v '^ *+' conftest.err >conftest.er1
2700 cat conftest.er1 >&5
2701 mv -f conftest.er1 conftest.err
2702 fi
2703 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
d0ac1c44 2704 test $ac_status = 0; } > conftest.i && {
c971b7fa
PA
2705 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
2706 test ! -s conftest.err
2707 }; then :
2708 ac_retval=0
2709else
2710 $as_echo "$as_me: failed program was:" >&5
2711sed 's/^/| /' conftest.$ac_ext >&5
2712
2713 ac_retval=1
2714fi
d0ac1c44
SM
2715 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2716 as_fn_set_status $ac_retval
c971b7fa
PA
2717
2718} # ac_fn_c_try_cpp
2719
2720# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
2721# -------------------------------------------------------
2722# Tests whether HEADER exists, giving a warning if it cannot be compiled using
2723# the include files in INCLUDES and setting the cache variable VAR
2724# accordingly.
2725ac_fn_c_check_header_mongrel ()
2726{
2727 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
d0ac1c44 2728 if eval \${$3+:} false; then :
c971b7fa
PA
2729 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2730$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2731if eval \${$3+:} false; then :
c971b7fa
PA
2732 $as_echo_n "(cached) " >&6
2733fi
2734eval ac_res=\$$3
2735 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2736$as_echo "$ac_res" >&6; }
2737else
2738 # Is the header compilable?
2739{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
2740$as_echo_n "checking $2 usability... " >&6; }
2741cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2742/* end confdefs.h. */
2743$4
2744#include <$2>
2745_ACEOF
2746if ac_fn_c_try_compile "$LINENO"; then :
2747 ac_header_compiler=yes
2748else
2749 ac_header_compiler=no
2750fi
2751rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2752{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
2753$as_echo "$ac_header_compiler" >&6; }
2754
2755# Is the header present?
2756{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
2757$as_echo_n "checking $2 presence... " >&6; }
2758cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2759/* end confdefs.h. */
2760#include <$2>
2761_ACEOF
2762if ac_fn_c_try_cpp "$LINENO"; then :
2763 ac_header_preproc=yes
2764else
2765 ac_header_preproc=no
2766fi
d0ac1c44 2767rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
2768{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
2769$as_echo "$ac_header_preproc" >&6; }
2770
2771# So? What about this header?
2772case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
2773 yes:no: )
2774 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
2775$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
2776 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2777$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2778 ;;
2779 no:yes:* )
2780 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
2781$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
2782 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
2783$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
2784 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
2785$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
2786 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
2787$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
2788 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2789$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2790 ;;
2791esac
2792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2793$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2794if eval \${$3+:} false; then :
c971b7fa
PA
2795 $as_echo_n "(cached) " >&6
2796else
2797 eval "$3=\$ac_header_compiler"
2798fi
2799eval ac_res=\$$3
2800 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2801$as_echo "$ac_res" >&6; }
2802fi
d0ac1c44 2803 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
c971b7fa
PA
2804
2805} # ac_fn_c_check_header_mongrel
2806
2807# ac_fn_c_try_run LINENO
2808# ----------------------
2809# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
2810# that executables *can* be run.
2811ac_fn_c_try_run ()
2812{
2813 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2814 if { { ac_try="$ac_link"
2815case "(($ac_try" in
2816 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2817 *) ac_try_echo=$ac_try;;
2818esac
2819eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2820$as_echo "$ac_try_echo"; } >&5
2821 (eval "$ac_link") 2>&5
2822 ac_status=$?
2823 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2824 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
2825 { { case "(($ac_try" in
2826 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2827 *) ac_try_echo=$ac_try;;
2828esac
2829eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2830$as_echo "$ac_try_echo"; } >&5
2831 (eval "$ac_try") 2>&5
2832 ac_status=$?
2833 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2834 test $ac_status = 0; }; }; then :
2835 ac_retval=0
2836else
2837 $as_echo "$as_me: program exited with status $ac_status" >&5
2838 $as_echo "$as_me: failed program was:" >&5
2839sed 's/^/| /' conftest.$ac_ext >&5
2840
2841 ac_retval=$ac_status
2842fi
2843 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
d0ac1c44
SM
2844 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2845 as_fn_set_status $ac_retval
c971b7fa
PA
2846
2847} # ac_fn_c_try_run
2848
2849# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
2850# -------------------------------------------------------
2851# Tests whether HEADER exists and can be compiled using the include files in
2852# INCLUDES, setting the cache variable VAR accordingly.
2853ac_fn_c_check_header_compile ()
2854{
2855 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2856 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2857$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2858if eval \${$3+:} false; then :
c971b7fa
PA
2859 $as_echo_n "(cached) " >&6
2860else
2861 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2862/* end confdefs.h. */
2863$4
2864#include <$2>
2865_ACEOF
2866if ac_fn_c_try_compile "$LINENO"; then :
2867 eval "$3=yes"
2868else
2869 eval "$3=no"
2870fi
2871rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2872fi
2873eval ac_res=\$$3
2874 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2875$as_echo "$ac_res" >&6; }
d0ac1c44 2876 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
c971b7fa
PA
2877
2878} # ac_fn_c_check_header_compile
2879
73cc7272
TT
2880# ac_fn_c_try_link LINENO
2881# -----------------------
2882# Try to link conftest.$ac_ext, and return whether this succeeded.
2883ac_fn_c_try_link ()
2884{
2885 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2886 rm -f conftest.$ac_objext conftest$ac_exeext
2887 if { { ac_try="$ac_link"
2888case "(($ac_try" in
2889 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2890 *) ac_try_echo=$ac_try;;
2891esac
2892eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2893$as_echo "$ac_try_echo"; } >&5
2894 (eval "$ac_link") 2>conftest.err
2895 ac_status=$?
2896 if test -s conftest.err; then
2897 grep -v '^ *+' conftest.err >conftest.er1
2898 cat conftest.er1 >&5
2899 mv -f conftest.er1 conftest.err
2900 fi
2901 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2902 test $ac_status = 0; } && {
2903 test -z "$ac_c_werror_flag" ||
2904 test ! -s conftest.err
2905 } && test -s conftest$ac_exeext && {
2906 test "$cross_compiling" = yes ||
2907 test -x conftest$ac_exeext
2908 }; then :
2909 ac_retval=0
2910else
2911 $as_echo "$as_me: failed program was:" >&5
2912sed 's/^/| /' conftest.$ac_ext >&5
2913
2914 ac_retval=1
2915fi
2916 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2917 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2918 # interfere with the next link command; also delete a directory that is
2919 # left behind by Apple's compiler. We do this before executing the actions.
2920 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2921 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2922 as_fn_set_status $ac_retval
2923
2924} # ac_fn_c_try_link
2925
d0ac1c44
SM
2926# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2927# -------------------------------------------
2928# Tests whether TYPE exists after having included INCLUDES, setting cache
2929# variable VAR accordingly.
2930ac_fn_c_check_type ()
2931{
2932 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2933 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2934$as_echo_n "checking for $2... " >&6; }
2935if eval \${$3+:} false; then :
2936 $as_echo_n "(cached) " >&6
2937else
2938 eval "$3=no"
2939 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2940/* end confdefs.h. */
2941$4
2942int
2943main ()
2944{
2945if (sizeof ($2))
2946 return 0;
2947 ;
2948 return 0;
2949}
2950_ACEOF
2951if ac_fn_c_try_compile "$LINENO"; then :
2952 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2953/* end confdefs.h. */
2954$4
2955int
2956main ()
2957{
2958if (sizeof (($2)))
2959 return 0;
2960 ;
2961 return 0;
2962}
2963_ACEOF
2964if ac_fn_c_try_compile "$LINENO"; then :
2965
2966else
2967 eval "$3=yes"
2968fi
2969rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2970fi
2971rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2972fi
2973eval ac_res=\$$3
2974 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2975$as_echo "$ac_res" >&6; }
2976 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2977
2978} # ac_fn_c_check_type
2979
8690e634
JK
2980# ac_fn_c_check_func LINENO FUNC VAR
2981# ----------------------------------
2982# Tests whether FUNC exists, setting the cache variable VAR accordingly
2983ac_fn_c_check_func ()
2984{
2985 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2986 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2987$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2988if eval \${$3+:} false; then :
8690e634
JK
2989 $as_echo_n "(cached) " >&6
2990else
2991 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2992/* end confdefs.h. */
2993/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
2994 For example, HP-UX 11i <limits.h> declares gettimeofday. */
2995#define $2 innocuous_$2
2996
2997/* System header to define __stub macros and hopefully few prototypes,
2998 which can conflict with char $2 (); below.
2999 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3000 <limits.h> exists even on freestanding compilers. */
3001
3002#ifdef __STDC__
3003# include <limits.h>
3004#else
3005# include <assert.h>
3006#endif
3007
3008#undef $2
3009
3010/* Override any GCC internal prototype to avoid an error.
3011 Use char because int might match the return type of a GCC
3012 builtin and then its argument prototype would still apply. */
3013#ifdef __cplusplus
3014extern "C"
3015#endif
3016char $2 ();
3017/* The GNU C library defines this for functions which it implements
3018 to always fail with ENOSYS. Some functions are actually named
3019 something starting with __ and the normal name is an alias. */
3020#if defined __stub_$2 || defined __stub___$2
3021choke me
3022#endif
3023
3024int
3025main ()
3026{
3027return $2 ();
3028 ;
3029 return 0;
3030}
3031_ACEOF
3032if ac_fn_c_try_link "$LINENO"; then :
3033 eval "$3=yes"
3034else
3035 eval "$3=no"
3036fi
3037rm -f core conftest.err conftest.$ac_objext \
3038 conftest$ac_exeext conftest.$ac_ext
3039fi
3040eval ac_res=\$$3
3041 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3042$as_echo "$ac_res" >&6; }
d0ac1c44 3043 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
8690e634
JK
3044
3045} # ac_fn_c_check_func
3046
d0ac1c44
SM
3047# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
3048# ---------------------------------------------
3049# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
3050# accordingly.
8986e351
TT
3051ac_fn_c_check_decl ()
3052{
5df4cba6
SM
3053 ac_save_ac_compile="$ac_compile"
3054 if test -n "$ac_compile_for_check_decl"; then
3055 ac_compile="$ac_compile_for_check_decl"
3056 fi
8986e351 3057 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
d0ac1c44
SM
3058 as_decl_name=`echo $2|sed 's/ *(.*//'`
3059 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
3060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
3061$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
3062if eval \${$3+:} false; then :
8986e351
TT
3063 $as_echo_n "(cached) " >&6
3064else
3065 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3066/* end confdefs.h. */
3067$4
3068int
3069main ()
3070{
d0ac1c44
SM
3071#ifndef $as_decl_name
3072#ifdef __cplusplus
3073 (void) $as_decl_use;
3074#else
3075 (void) $as_decl_name;
3076#endif
8986e351
TT
3077#endif
3078
3079 ;
3080 return 0;
3081}
3082_ACEOF
3083if ac_fn_c_try_compile "$LINENO"; then :
3084 eval "$3=yes"
3085else
3086 eval "$3=no"
3087fi
3088rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3089fi
3090eval ac_res=\$$3
3091 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3092$as_echo "$ac_res" >&6; }
d0ac1c44 3093 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
5df4cba6 3094 ac_compile="$ac_save_ac_compile"
8986e351
TT
3095
3096} # ac_fn_c_check_decl
3097
c971b7fa
PA
3098# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
3099# --------------------------------------------
3100# Tries to find the compile-time value of EXPR in a program that includes
3101# INCLUDES, setting VAR accordingly. Returns whether the value could be
3102# computed
3103ac_fn_c_compute_int ()
3104{
3105 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3106 if test "$cross_compiling" = yes; then
3107 # Depending upon the size, compute the lo and hi bounds.
3108cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3109/* end confdefs.h. */
3110$4
3111int
3112main ()
3113{
3114static int test_array [1 - 2 * !(($2) >= 0)];
d0ac1c44
SM
3115test_array [0] = 0;
3116return test_array [0];
c971b7fa
PA
3117
3118 ;
3119 return 0;
3120}
3121_ACEOF
3122if ac_fn_c_try_compile "$LINENO"; then :
3123 ac_lo=0 ac_mid=0
3124 while :; do
3125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3126/* end confdefs.h. */
3127$4
3128int
3129main ()
3130{
3131static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3132test_array [0] = 0;
3133return test_array [0];
c971b7fa
PA
3134
3135 ;
3136 return 0;
3137}
3138_ACEOF
3139if ac_fn_c_try_compile "$LINENO"; then :
3140 ac_hi=$ac_mid; break
3141else
3142 as_fn_arith $ac_mid + 1 && ac_lo=$as_val
3143 if test $ac_lo -le $ac_mid; then
3144 ac_lo= ac_hi=
3145 break
3146 fi
3147 as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
3148fi
3149rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3150 done
3151else
3152 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3153/* end confdefs.h. */
3154$4
3155int
3156main ()
3157{
3158static int test_array [1 - 2 * !(($2) < 0)];
d0ac1c44
SM
3159test_array [0] = 0;
3160return test_array [0];
c971b7fa
PA
3161
3162 ;
3163 return 0;
3164}
3165_ACEOF
3166if ac_fn_c_try_compile "$LINENO"; then :
3167 ac_hi=-1 ac_mid=-1
3168 while :; do
3169 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3170/* end confdefs.h. */
3171$4
3172int
3173main ()
3174{
3175static int test_array [1 - 2 * !(($2) >= $ac_mid)];
d0ac1c44
SM
3176test_array [0] = 0;
3177return test_array [0];
c971b7fa
PA
3178
3179 ;
3180 return 0;
3181}
3182_ACEOF
3183if ac_fn_c_try_compile "$LINENO"; then :
3184 ac_lo=$ac_mid; break
3185else
3186 as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
3187 if test $ac_mid -le $ac_hi; then
3188 ac_lo= ac_hi=
3189 break
3190 fi
3191 as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
3192fi
3193rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3194 done
3195else
3196 ac_lo= ac_hi=
3197fi
3198rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3199fi
3200rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3201# Binary search between lo and hi bounds.
3202while test "x$ac_lo" != "x$ac_hi"; do
3203 as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
3204 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3205/* end confdefs.h. */
3206$4
3207int
3208main ()
3209{
3210static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3211test_array [0] = 0;
3212return test_array [0];
c971b7fa
PA
3213
3214 ;
3215 return 0;
3216}
3217_ACEOF
3218if ac_fn_c_try_compile "$LINENO"; then :
3219 ac_hi=$ac_mid
3220else
3221 as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
3222fi
3223rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3224done
3225case $ac_lo in #((
3226?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
3227'') ac_retval=1 ;;
3228esac
3229 else
3230 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3231/* end confdefs.h. */
3232$4
3233static long int longval () { return $2; }
3234static unsigned long int ulongval () { return $2; }
3235#include <stdio.h>
3236#include <stdlib.h>
3237int
3238main ()
3239{
3240
3241 FILE *f = fopen ("conftest.val", "w");
3242 if (! f)
3243 return 1;
3244 if (($2) < 0)
3245 {
3246 long int i = longval ();
3247 if (i != ($2))
3248 return 1;
3249 fprintf (f, "%ld", i);
3250 }
3251 else
3252 {
3253 unsigned long int i = ulongval ();
3254 if (i != ($2))
3255 return 1;
3256 fprintf (f, "%lu", i);
3257 }
3258 /* Do not output a trailing newline, as this causes \r\n confusion
3259 on some platforms. */
3260 return ferror (f) || fclose (f) != 0;
3261
3262 ;
3263 return 0;
3264}
3265_ACEOF
3266if ac_fn_c_try_run "$LINENO"; then :
3267 echo >>conftest.val; read $3 <conftest.val; ac_retval=0
3268else
3269 ac_retval=1
3270fi
3271rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3272 conftest.$ac_objext conftest.beam conftest.$ac_ext
3273rm -f conftest.val
3274
3275 fi
d0ac1c44
SM
3276 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3277 as_fn_set_status $ac_retval
c971b7fa
PA
3278
3279} # ac_fn_c_compute_int
725e2999
JB
3280
3281# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
3282# ----------------------------------------------------
3283# Tries to find if the field MEMBER exists in type AGGR, after including
3284# INCLUDES, setting cache variable VAR accordingly.
3285ac_fn_c_check_member ()
3286{
3287 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3288 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
3289$as_echo_n "checking for $2.$3... " >&6; }
3290if eval \${$4+:} false; then :
3291 $as_echo_n "(cached) " >&6
3292else
3293 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3294/* end confdefs.h. */
3295$5
3296int
3297main ()
3298{
3299static $2 ac_aggr;
3300if (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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3310/* end confdefs.h. */
3311$5
3312int
3313main ()
3314{
3315static $2 ac_aggr;
3316if (sizeof ac_aggr.$3)
3317return 0;
3318 ;
3319 return 0;
3320}
3321_ACEOF
3322if ac_fn_c_try_compile "$LINENO"; then :
3323 eval "$4=yes"
3324else
3325 eval "$4=no"
3326fi
3327rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3328fi
3329rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3330fi
3331eval ac_res=\$$4
3332 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3333$as_echo "$ac_res" >&6; }
3334 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3335
3336} # ac_fn_c_check_member
c971b7fa
PA
3337cat >config.log <<_ACEOF
3338This file contains any messages produced by compilers while
3339running configure, to aid debugging if configure makes a mistake.
3340
d0ac1c44
SM
3341It was created by libgnu $as_me UNUSED-VERSION, which was
3342generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
3343
3344 $ $0 $@
3345
3346_ACEOF
3347exec 5>>config.log
3348{
3349cat <<_ASUNAME
3350## --------- ##
3351## Platform. ##
3352## --------- ##
3353
3354hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
3355uname -m = `(uname -m) 2>/dev/null || echo unknown`
3356uname -r = `(uname -r) 2>/dev/null || echo unknown`
3357uname -s = `(uname -s) 2>/dev/null || echo unknown`
3358uname -v = `(uname -v) 2>/dev/null || echo unknown`
3359
3360/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
3361/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
3362
3363/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
3364/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
3365/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
3366/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
3367/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
3368/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
3369/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
3370
3371_ASUNAME
3372
3373as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3374for as_dir in $PATH
3375do
3376 IFS=$as_save_IFS
3377 test -z "$as_dir" && as_dir=.
3378 $as_echo "PATH: $as_dir"
3379 done
3380IFS=$as_save_IFS
3381
3382} >&5
3383
3384cat >&5 <<_ACEOF
3385
3386
3387## ----------- ##
3388## Core tests. ##
3389## ----------- ##
3390
3391_ACEOF
3392
3393
3394# Keep a trace of the command line.
3395# Strip out --no-create and --no-recursion so they do not pile up.
3396# Strip out --silent because we don't want to record it for future runs.
3397# Also quote any args containing shell meta-characters.
3398# Make two passes to allow for proper duplicate-argument suppression.
3399ac_configure_args=
3400ac_configure_args0=
3401ac_configure_args1=
3402ac_must_keep_next=false
3403for ac_pass in 1 2
3404do
3405 for ac_arg
3406 do
3407 case $ac_arg in
3408 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
3409 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
3410 | -silent | --silent | --silen | --sile | --sil)
3411 continue ;;
3412 *\'*)
3413 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
3414 esac
3415 case $ac_pass in
3416 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
3417 2)
3418 as_fn_append ac_configure_args1 " '$ac_arg'"
3419 if test $ac_must_keep_next = true; then
3420 ac_must_keep_next=false # Got value, back to normal.
3421 else
3422 case $ac_arg in
3423 *=* | --config-cache | -C | -disable-* | --disable-* \
3424 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
3425 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
3426 | -with-* | --with-* | -without-* | --without-* | --x)
3427 case "$ac_configure_args0 " in
3428 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
3429 esac
3430 ;;
3431 -* ) ac_must_keep_next=true ;;
3432 esac
3433 fi
3434 as_fn_append ac_configure_args " '$ac_arg'"
3435 ;;
3436 esac
3437 done
3438done
3439{ ac_configure_args0=; unset ac_configure_args0;}
3440{ ac_configure_args1=; unset ac_configure_args1;}
3441
3442# When interrupted or exit'd, cleanup temporary files, and complete
3443# config.log. We remove comments because anyway the quotes in there
3444# would cause problems or look ugly.
3445# WARNING: Use '\'' to represent an apostrophe within the trap.
3446# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
3447trap 'exit_status=$?
3448 # Save into config.log some information that might help in debugging.
3449 {
3450 echo
3451
d0ac1c44 3452 $as_echo "## ---------------- ##
c971b7fa 3453## Cache variables. ##
d0ac1c44 3454## ---------------- ##"
c971b7fa
PA
3455 echo
3456 # The following way of writing the cache mishandles newlines in values,
3457(
3458 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
3459 eval ac_val=\$$ac_var
3460 case $ac_val in #(
3461 *${as_nl}*)
3462 case $ac_var in #(
3463 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
3464$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
3465 esac
3466 case $ac_var in #(
3467 _ | IFS | as_nl) ;; #(
3468 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
3469 *) { eval $ac_var=; unset $ac_var;} ;;
3470 esac ;;
3471 esac
3472 done
3473 (set) 2>&1 |
3474 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
3475 *${as_nl}ac_space=\ *)
3476 sed -n \
3477 "s/'\''/'\''\\\\'\'''\''/g;
3478 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
3479 ;; #(
3480 *)
3481 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
3482 ;;
3483 esac |
3484 sort
3485)
3486 echo
3487
d0ac1c44 3488 $as_echo "## ----------------- ##
c971b7fa 3489## Output variables. ##
d0ac1c44 3490## ----------------- ##"
c971b7fa
PA
3491 echo
3492 for ac_var in $ac_subst_vars
3493 do
3494 eval ac_val=\$$ac_var
3495 case $ac_val in
3496 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3497 esac
3498 $as_echo "$ac_var='\''$ac_val'\''"
3499 done | sort
3500 echo
3501
3502 if test -n "$ac_subst_files"; then
d0ac1c44 3503 $as_echo "## ------------------- ##
c971b7fa 3504## File substitutions. ##
d0ac1c44 3505## ------------------- ##"
c971b7fa
PA
3506 echo
3507 for ac_var in $ac_subst_files
3508 do
3509 eval ac_val=\$$ac_var
3510 case $ac_val in
3511 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3512 esac
3513 $as_echo "$ac_var='\''$ac_val'\''"
3514 done | sort
3515 echo
3516 fi
3517
3518 if test -s confdefs.h; then
d0ac1c44 3519 $as_echo "## ----------- ##
c971b7fa 3520## confdefs.h. ##
d0ac1c44 3521## ----------- ##"
c971b7fa
PA
3522 echo
3523 cat confdefs.h
3524 echo
3525 fi
3526 test "$ac_signal" != 0 &&
3527 $as_echo "$as_me: caught signal $ac_signal"
3528 $as_echo "$as_me: exit $exit_status"
3529 } >&5
3530 rm -f core *.core core.conftest.* &&
3531 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
3532 exit $exit_status
3533' 0
3534for ac_signal in 1 2 13 15; do
3535 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
3536done
3537ac_signal=0
3538
3539# confdefs.h avoids OS command line length limits that DEFS can exceed.
3540rm -f -r conftest* confdefs.h
3541
3542$as_echo "/* confdefs.h */" > confdefs.h
3543
3544# Predefined preprocessor variables.
3545
3546cat >>confdefs.h <<_ACEOF
3547#define PACKAGE_NAME "$PACKAGE_NAME"
3548_ACEOF
3549
3550cat >>confdefs.h <<_ACEOF
3551#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
3552_ACEOF
3553
3554cat >>confdefs.h <<_ACEOF
3555#define PACKAGE_VERSION "$PACKAGE_VERSION"
3556_ACEOF
3557
3558cat >>confdefs.h <<_ACEOF
3559#define PACKAGE_STRING "$PACKAGE_STRING"
3560_ACEOF
3561
3562cat >>confdefs.h <<_ACEOF
3563#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
3564_ACEOF
3565
3566cat >>confdefs.h <<_ACEOF
3567#define PACKAGE_URL "$PACKAGE_URL"
3568_ACEOF
3569
3570
3571# Let the site file select an alternate cache file if it wants to.
3572# Prefer an explicitly selected file to automatically selected ones.
3573ac_site_file1=NONE
3574ac_site_file2=NONE
3575if test -n "$CONFIG_SITE"; then
d0ac1c44
SM
3576 # We do not want a PATH search for config.site.
3577 case $CONFIG_SITE in #((
3578 -*) ac_site_file1=./$CONFIG_SITE;;
3579 */*) ac_site_file1=$CONFIG_SITE;;
3580 *) ac_site_file1=./$CONFIG_SITE;;
3581 esac
c971b7fa
PA
3582elif test "x$prefix" != xNONE; then
3583 ac_site_file1=$prefix/share/config.site
3584 ac_site_file2=$prefix/etc/config.site
3585else
3586 ac_site_file1=$ac_default_prefix/share/config.site
3587 ac_site_file2=$ac_default_prefix/etc/config.site
3588fi
3589for ac_site_file in "$ac_site_file1" "$ac_site_file2"
3590do
3591 test "x$ac_site_file" = xNONE && continue
d0ac1c44 3592 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
c971b7fa
PA
3593 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
3594$as_echo "$as_me: loading site script $ac_site_file" >&6;}
3595 sed 's/^/| /' "$ac_site_file" >&5
d0ac1c44
SM
3596 . "$ac_site_file" \
3597 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3598$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3599as_fn_error $? "failed to load site script $ac_site_file
3600See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
3601 fi
3602done
3603
3604if test -r "$cache_file"; then
d0ac1c44
SM
3605 # Some versions of bash will fail to source /dev/null (special files
3606 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
3607 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
c971b7fa
PA
3608 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
3609$as_echo "$as_me: loading cache $cache_file" >&6;}
3610 case $cache_file in
3611 [\\/]* | ?:[\\/]* ) . "$cache_file";;
3612 *) . "./$cache_file";;
3613 esac
3614 fi
3615else
3616 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
3617$as_echo "$as_me: creating cache $cache_file" >&6;}
3618 >$cache_file
3619fi
3620
c0c3707f
CB
3621as_fn_append ac_header_list " arpa/inet.h"
3622as_fn_append ac_header_list " features.h"
3623as_fn_append ac_header_list " sys/socket.h"
698be2d8 3624as_fn_append ac_func_list " btowc"
c0c3707f
CB
3625as_fn_append ac_func_list " canonicalize_file_name"
3626as_fn_append ac_func_list " getcwd"
3627as_fn_append ac_func_list " readlink"
3628as_fn_append ac_func_list " realpath"
3629as_fn_append ac_header_list " sys/param.h"
3630as_fn_append ac_header_list " unistd.h"
3631as_fn_append ac_func_list " _set_invalid_parameter_handler"
3632as_fn_append ac_func_list " fchdir"
3633as_fn_append ac_header_list " dirent.h"
3634as_fn_append ac_func_list " fcntl"
3635as_fn_append ac_func_list " symlink"
3636as_fn_append ac_func_list " fdopendir"
3637as_fn_append ac_func_list " mempcpy"
3638as_fn_append ac_header_list " fnmatch.h"
3639as_fn_append ac_func_list " fnmatch"
c0c3707f 3640as_fn_append ac_func_list " mbsrtowcs"
8690e634 3641gl_fnmatch_required=GNU
c0c3707f
CB
3642as_fn_append ac_header_list " sys/stat.h"
3643as_fn_append ac_func_list " fstatat"
3644as_fn_append ac_func_list " getdtablesize"
3645as_fn_append ac_func_list " getlogin_r"
3646as_fn_append ac_func_list " getprogname"
3647as_fn_append ac_func_list " getexecname"
698be2d8 3648as_fn_append ac_func_list " getrandom"
c0c3707f
CB
3649as_fn_append ac_header_list " sys/time.h"
3650as_fn_append ac_func_list " gettimeofday"
3651as_fn_append ac_header_list " glob.h"
3652as_fn_append ac_func_list " glob"
3653as_fn_append ac_func_list " glob_pattern_p"
3654as_fn_append ac_func_list " getpwnam_r"
5df4cba6 3655as_fn_append ac_header_list " threads.h"
c0c3707f
CB
3656as_fn_append ac_header_list " netdb.h"
3657as_fn_append ac_header_list " netinet/in.h"
3658as_fn_append ac_header_list " limits.h"
3659as_fn_append ac_header_list " wchar.h"
3660as_fn_append ac_header_list " stdint.h"
3661as_fn_append ac_header_list " inttypes.h"
698be2d8 3662as_fn_append ac_func_list " isblank"
5df4cba6 3663as_fn_append ac_header_list " xlocale.h"
c0c3707f
CB
3664as_fn_append ac_func_list " lstat"
3665as_fn_append ac_header_list " math.h"
3666as_fn_append ac_func_list " mbsinit"
3667as_fn_append ac_func_list " mbrtowc"
3668as_fn_append ac_header_list " sys/mman.h"
3669as_fn_append ac_func_list " mprotect"
3670as_fn_append ac_func_list " mkostemp"
3671as_fn_append ac_func_list " openat"
3672as_fn_append ac_func_list " link"
3673as_fn_append ac_func_list " setenv"
3674as_fn_append ac_func_list " strdup"
3675as_fn_append ac_func_list " strerror_r"
3676as_fn_append ac_func_list " __xpg_strerror_r"
3677as_fn_append ac_func_list " catgets"
3678as_fn_append ac_func_list " snprintf"
698be2d8 3679as_fn_append ac_header_list " sys/random.h"
c0c3707f
CB
3680as_fn_append ac_header_list " sys/uio.h"
3681as_fn_append ac_func_list " localtime_r"
3682as_fn_append ac_func_list " pipe"
3683as_fn_append ac_header_list " crtdefs.h"
3684as_fn_append ac_func_list " iswcntrl"
698be2d8
CB
3685as_fn_append ac_header_list " wctype.h"
3686as_fn_append ac_func_list " wmempcpy"
c971b7fa
PA
3687# Check that the precious variables saved in the cache have kept the same
3688# value.
3689ac_cache_corrupted=false
3690for ac_var in $ac_precious_vars; do
3691 eval ac_old_set=\$ac_cv_env_${ac_var}_set
3692 eval ac_new_set=\$ac_env_${ac_var}_set
3693 eval ac_old_val=\$ac_cv_env_${ac_var}_value
3694 eval ac_new_val=\$ac_env_${ac_var}_value
3695 case $ac_old_set,$ac_new_set in
3696 set,)
3697 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
3698$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
3699 ac_cache_corrupted=: ;;
3700 ,set)
3701 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
3702$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
3703 ac_cache_corrupted=: ;;
3704 ,);;
3705 *)
3706 if test "x$ac_old_val" != "x$ac_new_val"; then
3707 # differences in whitespace do not lead to failure.
3708 ac_old_val_w=`echo x $ac_old_val`
3709 ac_new_val_w=`echo x $ac_new_val`
3710 if test "$ac_old_val_w" != "$ac_new_val_w"; then
3711 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
3712$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
3713 ac_cache_corrupted=:
3714 else
3715 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
3716$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
3717 eval $ac_var=\$ac_old_val
3718 fi
3719 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
3720$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
3721 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
3722$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
3723 fi;;
3724 esac
3725 # Pass precious variables to config.status.
3726 if test "$ac_new_set" = set; then
3727 case $ac_new_val in
3728 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
3729 *) ac_arg=$ac_var=$ac_new_val ;;
3730 esac
3731 case " $ac_configure_args " in
3732 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
3733 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
3734 esac
3735 fi
3736done
3737if $ac_cache_corrupted; then
3738 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3739$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3740 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
3741$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
d0ac1c44 3742 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
c971b7fa
PA
3743fi
3744## -------------------- ##
3745## Main body of script. ##
3746## -------------------- ##
3747
3748ac_ext=c
3749ac_cpp='$CPP $CPPFLAGS'
3750ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3751ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3752ac_compiler_gnu=$ac_cv_c_compiler_gnu
3753
3754
d0ac1c44 3755
73cc7272
TT
3756
3757
3758
c971b7fa
PA
3759ac_config_headers="$ac_config_headers config.h:config.in"
3760
3761
5abebf3c
CB
3762
3763
c971b7fa
PA
3764{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
3765$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
3766 # Check whether --enable-maintainer-mode was given.
3767if test "${enable_maintainer_mode+set}" = set; then :
3768 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
3769else
3770 USE_MAINTAINER_MODE=no
3771fi
3772
3773 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
3774$as_echo "$USE_MAINTAINER_MODE" >&6; }
3775 if test $USE_MAINTAINER_MODE = yes; then
3776 MAINTAINER_MODE_TRUE=
3777 MAINTAINER_MODE_FALSE='#'
3778else
3779 MAINTAINER_MODE_TRUE='#'
3780 MAINTAINER_MODE_FALSE=
3781fi
3782
3783 MAINT=$MAINTAINER_MODE_TRUE
3784
3785
3786
3787ac_ext=c
3788ac_cpp='$CPP $CPPFLAGS'
3789ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3790ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3791ac_compiler_gnu=$ac_cv_c_compiler_gnu
3792if test -n "$ac_tool_prefix"; then
3793 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3794set dummy ${ac_tool_prefix}gcc; ac_word=$2
3795{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3796$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3797if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3798 $as_echo_n "(cached) " >&6
3799else
3800 if test -n "$CC"; then
3801 ac_cv_prog_CC="$CC" # Let the user override the test.
3802else
3803as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3804for as_dir in $PATH
3805do
3806 IFS=$as_save_IFS
3807 test -z "$as_dir" && as_dir=.
3808 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3809 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3810 ac_cv_prog_CC="${ac_tool_prefix}gcc"
3811 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3812 break 2
3813 fi
3814done
3815 done
3816IFS=$as_save_IFS
3817
3818fi
3819fi
3820CC=$ac_cv_prog_CC
3821if test -n "$CC"; then
3822 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3823$as_echo "$CC" >&6; }
3824else
3825 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3826$as_echo "no" >&6; }
3827fi
3828
3829
3830fi
3831if test -z "$ac_cv_prog_CC"; then
3832 ac_ct_CC=$CC
3833 # Extract the first word of "gcc", so it can be a program name with args.
3834set dummy gcc; ac_word=$2
3835{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3836$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3837if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
3838 $as_echo_n "(cached) " >&6
3839else
3840 if test -n "$ac_ct_CC"; then
3841 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3842else
3843as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3844for as_dir in $PATH
3845do
3846 IFS=$as_save_IFS
3847 test -z "$as_dir" && as_dir=.
3848 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3849 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3850 ac_cv_prog_ac_ct_CC="gcc"
3851 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3852 break 2
3853 fi
3854done
3855 done
3856IFS=$as_save_IFS
3857
3858fi
3859fi
3860ac_ct_CC=$ac_cv_prog_ac_ct_CC
3861if test -n "$ac_ct_CC"; then
3862 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3863$as_echo "$ac_ct_CC" >&6; }
3864else
3865 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3866$as_echo "no" >&6; }
3867fi
3868
3869 if test "x$ac_ct_CC" = x; then
3870 CC=""
3871 else
3872 case $cross_compiling:$ac_tool_warned in
3873yes:)
3874{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3875$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3876ac_tool_warned=yes ;;
3877esac
3878 CC=$ac_ct_CC
3879 fi
3880else
3881 CC="$ac_cv_prog_CC"
3882fi
3883
3884if test -z "$CC"; then
3885 if test -n "$ac_tool_prefix"; then
3886 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3887set dummy ${ac_tool_prefix}cc; ac_word=$2
3888{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3889$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3890if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3891 $as_echo_n "(cached) " >&6
3892else
3893 if test -n "$CC"; then
3894 ac_cv_prog_CC="$CC" # Let the user override the test.
3895else
3896as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3897for as_dir in $PATH
3898do
3899 IFS=$as_save_IFS
3900 test -z "$as_dir" && as_dir=.
3901 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3902 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3903 ac_cv_prog_CC="${ac_tool_prefix}cc"
3904 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3905 break 2
3906 fi
3907done
3908 done
3909IFS=$as_save_IFS
3910
3911fi
3912fi
3913CC=$ac_cv_prog_CC
3914if test -n "$CC"; then
3915 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3916$as_echo "$CC" >&6; }
3917else
3918 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3919$as_echo "no" >&6; }
3920fi
3921
3922
3923 fi
3924fi
3925if test -z "$CC"; then
3926 # Extract the first word of "cc", so it can be a program name with args.
3927set dummy cc; ac_word=$2
3928{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3929$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3930if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3931 $as_echo_n "(cached) " >&6
3932else
3933 if test -n "$CC"; then
3934 ac_cv_prog_CC="$CC" # Let the user override the test.
3935else
3936 ac_prog_rejected=no
3937as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3938for as_dir in $PATH
3939do
3940 IFS=$as_save_IFS
3941 test -z "$as_dir" && as_dir=.
3942 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3943 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3944 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3945 ac_prog_rejected=yes
3946 continue
3947 fi
3948 ac_cv_prog_CC="cc"
3949 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3950 break 2
3951 fi
3952done
3953 done
3954IFS=$as_save_IFS
3955
3956if test $ac_prog_rejected = yes; then
3957 # We found a bogon in the path, so make sure we never use it.
3958 set dummy $ac_cv_prog_CC
3959 shift
3960 if test $# != 0; then
3961 # We chose a different compiler from the bogus one.
3962 # However, it has the same basename, so the bogon will be chosen
3963 # first if we set CC to just the basename; use the full file name.
3964 shift
3965 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
3966 fi
3967fi
3968fi
3969fi
3970CC=$ac_cv_prog_CC
3971if test -n "$CC"; then
3972 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3973$as_echo "$CC" >&6; }
3974else
3975 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3976$as_echo "no" >&6; }
3977fi
3978
3979
3980fi
3981if test -z "$CC"; then
3982 if test -n "$ac_tool_prefix"; then
3983 for ac_prog in cl.exe
3984 do
3985 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3986set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3987{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3988$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3989if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3990 $as_echo_n "(cached) " >&6
3991else
3992 if test -n "$CC"; then
3993 ac_cv_prog_CC="$CC" # Let the user override the test.
3994else
3995as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3996for as_dir in $PATH
3997do
3998 IFS=$as_save_IFS
3999 test -z "$as_dir" && as_dir=.
4000 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4001 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4002 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
4003 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4004 break 2
4005 fi
4006done
4007 done
4008IFS=$as_save_IFS
4009
4010fi
4011fi
4012CC=$ac_cv_prog_CC
4013if test -n "$CC"; then
4014 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4015$as_echo "$CC" >&6; }
4016else
4017 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4018$as_echo "no" >&6; }
4019fi
4020
4021
4022 test -n "$CC" && break
4023 done
4024fi
4025if test -z "$CC"; then
4026 ac_ct_CC=$CC
4027 for ac_prog in cl.exe
4028do
4029 # Extract the first word of "$ac_prog", so it can be a program name with args.
4030set dummy $ac_prog; ac_word=$2
4031{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4032$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4033if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
4034 $as_echo_n "(cached) " >&6
4035else
4036 if test -n "$ac_ct_CC"; then
4037 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4038else
4039as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4040for as_dir in $PATH
4041do
4042 IFS=$as_save_IFS
4043 test -z "$as_dir" && as_dir=.
4044 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4045 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4046 ac_cv_prog_ac_ct_CC="$ac_prog"
4047 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4048 break 2
4049 fi
4050done
4051 done
4052IFS=$as_save_IFS
4053
4054fi
4055fi
4056ac_ct_CC=$ac_cv_prog_ac_ct_CC
4057if test -n "$ac_ct_CC"; then
4058 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4059$as_echo "$ac_ct_CC" >&6; }
4060else
4061 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4062$as_echo "no" >&6; }
4063fi
4064
4065
4066 test -n "$ac_ct_CC" && break
4067done
4068
4069 if test "x$ac_ct_CC" = x; then
4070 CC=""
4071 else
4072 case $cross_compiling:$ac_tool_warned in
4073yes:)
4074{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4075$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4076ac_tool_warned=yes ;;
4077esac
4078 CC=$ac_ct_CC
4079 fi
4080fi
4081
c0c3707f
CB
4082fi
4083if test -z "$CC"; then
4084 if test -n "$ac_tool_prefix"; then
4085 # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
4086set dummy ${ac_tool_prefix}clang; ac_word=$2
4087{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4088$as_echo_n "checking for $ac_word... " >&6; }
4089if ${ac_cv_prog_CC+:} false; then :
4090 $as_echo_n "(cached) " >&6
4091else
4092 if test -n "$CC"; then
4093 ac_cv_prog_CC="$CC" # Let the user override the test.
4094else
4095as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4096for as_dir in $PATH
4097do
4098 IFS=$as_save_IFS
4099 test -z "$as_dir" && as_dir=.
4100 for ac_exec_ext in '' $ac_executable_extensions; do
4101 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4102 ac_cv_prog_CC="${ac_tool_prefix}clang"
4103 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4104 break 2
4105 fi
4106done
4107 done
4108IFS=$as_save_IFS
4109
4110fi
4111fi
4112CC=$ac_cv_prog_CC
4113if test -n "$CC"; then
4114 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4115$as_echo "$CC" >&6; }
4116else
4117 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4118$as_echo "no" >&6; }
4119fi
4120
4121
4122fi
4123if test -z "$ac_cv_prog_CC"; then
4124 ac_ct_CC=$CC
4125 # Extract the first word of "clang", so it can be a program name with args.
4126set dummy clang; ac_word=$2
4127{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4128$as_echo_n "checking for $ac_word... " >&6; }
4129if ${ac_cv_prog_ac_ct_CC+:} false; then :
4130 $as_echo_n "(cached) " >&6
4131else
4132 if test -n "$ac_ct_CC"; then
4133 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4134else
4135as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4136for as_dir in $PATH
4137do
4138 IFS=$as_save_IFS
4139 test -z "$as_dir" && as_dir=.
4140 for ac_exec_ext in '' $ac_executable_extensions; do
4141 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4142 ac_cv_prog_ac_ct_CC="clang"
4143 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4144 break 2
4145 fi
4146done
4147 done
4148IFS=$as_save_IFS
4149
4150fi
4151fi
4152ac_ct_CC=$ac_cv_prog_ac_ct_CC
4153if test -n "$ac_ct_CC"; then
4154 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4155$as_echo "$ac_ct_CC" >&6; }
4156else
4157 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4158$as_echo "no" >&6; }
4159fi
4160
4161 if test "x$ac_ct_CC" = x; then
4162 CC=""
4163 else
4164 case $cross_compiling:$ac_tool_warned in
4165yes:)
4166{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4167$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4168ac_tool_warned=yes ;;
4169esac
4170 CC=$ac_ct_CC
4171 fi
4172else
4173 CC="$ac_cv_prog_CC"
4174fi
4175
c971b7fa
PA
4176fi
4177
4178
4179test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4180$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4181as_fn_error $? "no acceptable C compiler found in \$PATH
4182See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4183
4184# Provide some information about the compiler.
4185$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4186set X $ac_compile
4187ac_compiler=$2
c0c3707f 4188for ac_option in --version -v -V -qversion -version; do
c971b7fa
PA
4189 { { ac_try="$ac_compiler $ac_option >&5"
4190case "(($ac_try" in
4191 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4192 *) ac_try_echo=$ac_try;;
4193esac
4194eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4195$as_echo "$ac_try_echo"; } >&5
4196 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4197 ac_status=$?
4198 if test -s conftest.err; then
4199 sed '10a\
4200... rest of stderr output deleted ...
4201 10q' conftest.err >conftest.er1
4202 cat conftest.er1 >&5
c971b7fa 4203 fi
d0ac1c44 4204 rm -f conftest.er1 conftest.err
c971b7fa
PA
4205 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4206 test $ac_status = 0; }
4207done
4208
4209cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4210/* end confdefs.h. */
d0ac1c44 4211
c971b7fa
PA
4212int
4213main ()
4214{
c971b7fa
PA
4215
4216 ;
4217 return 0;
4218}
4219_ACEOF
4220ac_clean_files_save=$ac_clean_files
d0ac1c44 4221ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
c971b7fa
PA
4222# Try to create an executable without -o first, disregard a.out.
4223# It will help us diagnose broken compilers, and finding out an intuition
4224# of exeext.
d0ac1c44
SM
4225{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
4226$as_echo_n "checking whether the C compiler works... " >&6; }
c971b7fa
PA
4227ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
4228
4229# The possible output files:
4230ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
4231
4232ac_rmfiles=
4233for ac_file in $ac_files
4234do
4235 case $ac_file in
4236 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4237 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
4238 esac
4239done
4240rm -f $ac_rmfiles
4241
4242if { { ac_try="$ac_link_default"
4243case "(($ac_try" in
4244 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4245 *) ac_try_echo=$ac_try;;
4246esac
4247eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4248$as_echo "$ac_try_echo"; } >&5
4249 (eval "$ac_link_default") 2>&5
4250 ac_status=$?
4251 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4252 test $ac_status = 0; }; then :
4253 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
4254# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
4255# in a Makefile. We should not override ac_cv_exeext if it was cached,
4256# so that the user can short-circuit this test for compilers unknown to
4257# Autoconf.
4258for ac_file in $ac_files ''
4259do
4260 test -f "$ac_file" || continue
4261 case $ac_file in
4262 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
4263 ;;
4264 [ab].out )
4265 # We found the default executable, but exeext='' is most
4266 # certainly right.
4267 break;;
4268 *.* )
4269 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
4270 then :; else
4271 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4272 fi
4273 # We set ac_cv_exeext here because the later test for it is not
4274 # safe: cross compilers may not add the suffix if given an `-o'
4275 # argument, so we may need to know it at that point already.
4276 # Even if this section looks crufty: it has the advantage of
4277 # actually working.
4278 break;;
4279 * )
4280 break;;
4281 esac
4282done
4283test "$ac_cv_exeext" = no && ac_cv_exeext=
4284
4285else
4286 ac_file=''
4287fi
c971b7fa 4288if test -z "$ac_file"; then :
d0ac1c44
SM
4289 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4290$as_echo "no" >&6; }
4291$as_echo "$as_me: failed program was:" >&5
c971b7fa
PA
4292sed 's/^/| /' conftest.$ac_ext >&5
4293
4294{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4295$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4296as_fn_error 77 "C compiler cannot create executables
4297See \`config.log' for more details" "$LINENO" 5; }
4298else
4299 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4300$as_echo "yes" >&6; }
c971b7fa 4301fi
d0ac1c44
SM
4302{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
4303$as_echo_n "checking for C compiler default output file name... " >&6; }
4304{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
4305$as_echo "$ac_file" >&6; }
c971b7fa
PA
4306ac_exeext=$ac_cv_exeext
4307
d0ac1c44 4308rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
c971b7fa 4309ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4310{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
4311$as_echo_n "checking for suffix of executables... " >&6; }
4312if { { ac_try="$ac_link"
4313case "(($ac_try" in
4314 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4315 *) ac_try_echo=$ac_try;;
4316esac
4317eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4318$as_echo "$ac_try_echo"; } >&5
4319 (eval "$ac_link") 2>&5
4320 ac_status=$?
4321 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4322 test $ac_status = 0; }; then :
4323 # If both `conftest.exe' and `conftest' are `present' (well, observable)
4324# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
4325# work properly (i.e., refer to `conftest.exe'), while it won't with
4326# `rm'.
4327for ac_file in conftest.exe conftest conftest.*; do
4328 test -f "$ac_file" || continue
4329 case $ac_file in
4330 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4331 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4332 break;;
4333 * ) break;;
4334 esac
4335done
4336else
4337 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4338$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4339as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4340See \`config.log' for more details" "$LINENO" 5; }
c971b7fa 4341fi
d0ac1c44 4342rm -f conftest conftest$ac_cv_exeext
c971b7fa
PA
4343{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4344$as_echo "$ac_cv_exeext" >&6; }
4345
4346rm -f conftest.$ac_ext
4347EXEEXT=$ac_cv_exeext
4348ac_exeext=$EXEEXT
d0ac1c44
SM
4349cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4350/* end confdefs.h. */
4351#include <stdio.h>
4352int
4353main ()
4354{
4355FILE *f = fopen ("conftest.out", "w");
4356 return ferror (f) || fclose (f) != 0;
4357
4358 ;
4359 return 0;
4360}
4361_ACEOF
4362ac_clean_files="$ac_clean_files conftest.out"
4363# Check that the compiler produces executables we can run. If not, either
4364# the compiler is broken, or we cross compile.
4365{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4366$as_echo_n "checking whether we are cross compiling... " >&6; }
4367if test "$cross_compiling" != yes; then
4368 { { ac_try="$ac_link"
4369case "(($ac_try" in
4370 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4371 *) ac_try_echo=$ac_try;;
4372esac
4373eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4374$as_echo "$ac_try_echo"; } >&5
4375 (eval "$ac_link") 2>&5
4376 ac_status=$?
4377 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4378 test $ac_status = 0; }
4379 if { ac_try='./conftest$ac_cv_exeext'
4380 { { case "(($ac_try" in
4381 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4382 *) ac_try_echo=$ac_try;;
4383esac
4384eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4385$as_echo "$ac_try_echo"; } >&5
4386 (eval "$ac_try") 2>&5
4387 ac_status=$?
4388 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4389 test $ac_status = 0; }; }; then
4390 cross_compiling=no
4391 else
4392 if test "$cross_compiling" = maybe; then
4393 cross_compiling=yes
4394 else
4395 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4396$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4397as_fn_error $? "cannot run C compiled programs.
4398If you meant to cross compile, use \`--host'.
4399See \`config.log' for more details" "$LINENO" 5; }
4400 fi
4401 fi
4402fi
4403{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4404$as_echo "$cross_compiling" >&6; }
4405
4406rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4407ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4408{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4409$as_echo_n "checking for suffix of object files... " >&6; }
d0ac1c44 4410if ${ac_cv_objext+:} false; then :
c971b7fa
PA
4411 $as_echo_n "(cached) " >&6
4412else
4413 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4414/* end confdefs.h. */
4415
4416int
4417main ()
4418{
4419
4420 ;
4421 return 0;
4422}
4423_ACEOF
4424rm -f conftest.o conftest.obj
4425if { { ac_try="$ac_compile"
4426case "(($ac_try" in
4427 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4428 *) ac_try_echo=$ac_try;;
4429esac
4430eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4431$as_echo "$ac_try_echo"; } >&5
4432 (eval "$ac_compile") 2>&5
4433 ac_status=$?
4434 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4435 test $ac_status = 0; }; then :
4436 for ac_file in conftest.o conftest.obj conftest.*; do
4437 test -f "$ac_file" || continue;
4438 case $ac_file in
4439 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4440 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4441 break;;
4442 esac
4443done
4444else
4445 $as_echo "$as_me: failed program was:" >&5
4446sed 's/^/| /' conftest.$ac_ext >&5
4447
4448{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4449$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4450as_fn_error $? "cannot compute suffix of object files: cannot compile
4451See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4452fi
4453rm -f conftest.$ac_cv_objext conftest.$ac_ext
4454fi
4455{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4456$as_echo "$ac_cv_objext" >&6; }
4457OBJEXT=$ac_cv_objext
4458ac_objext=$OBJEXT
4459{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4460$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
d0ac1c44 4461if ${ac_cv_c_compiler_gnu+:} false; then :
c971b7fa
PA
4462 $as_echo_n "(cached) " >&6
4463else
4464 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4465/* end confdefs.h. */
4466
4467int
4468main ()
4469{
4470#ifndef __GNUC__
4471 choke me
4472#endif
4473
4474 ;
4475 return 0;
4476}
4477_ACEOF
4478if ac_fn_c_try_compile "$LINENO"; then :
4479 ac_compiler_gnu=yes
4480else
4481 ac_compiler_gnu=no
4482fi
4483rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4484ac_cv_c_compiler_gnu=$ac_compiler_gnu
4485
4486fi
4487{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4488$as_echo "$ac_cv_c_compiler_gnu" >&6; }
4489if test $ac_compiler_gnu = yes; then
4490 GCC=yes
4491else
4492 GCC=
4493fi
4494ac_test_CFLAGS=${CFLAGS+set}
4495ac_save_CFLAGS=$CFLAGS
4496{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4497$as_echo_n "checking whether $CC accepts -g... " >&6; }
d0ac1c44 4498if ${ac_cv_prog_cc_g+:} false; then :
c971b7fa
PA
4499 $as_echo_n "(cached) " >&6
4500else
4501 ac_save_c_werror_flag=$ac_c_werror_flag
4502 ac_c_werror_flag=yes
4503 ac_cv_prog_cc_g=no
4504 CFLAGS="-g"
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 ac_cv_prog_cc_g=yes
4518else
4519 CFLAGS=""
4520 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4521/* end confdefs.h. */
4522
4523int
4524main ()
4525{
4526
4527 ;
4528 return 0;
4529}
4530_ACEOF
4531if ac_fn_c_try_compile "$LINENO"; then :
4532
4533else
4534 ac_c_werror_flag=$ac_save_c_werror_flag
4535 CFLAGS="-g"
4536 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4537/* end confdefs.h. */
4538
4539int
4540main ()
4541{
4542
4543 ;
4544 return 0;
4545}
4546_ACEOF
4547if ac_fn_c_try_compile "$LINENO"; then :
4548 ac_cv_prog_cc_g=yes
4549fi
4550rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4551fi
4552rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4553fi
4554rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4555 ac_c_werror_flag=$ac_save_c_werror_flag
4556fi
4557{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4558$as_echo "$ac_cv_prog_cc_g" >&6; }
4559if test "$ac_test_CFLAGS" = set; then
4560 CFLAGS=$ac_save_CFLAGS
4561elif test $ac_cv_prog_cc_g = yes; then
4562 if test "$GCC" = yes; then
4563 CFLAGS="-g -O2"
4564 else
4565 CFLAGS="-g"
4566 fi
4567else
4568 if test "$GCC" = yes; then
4569 CFLAGS="-O2"
4570 else
4571 CFLAGS=
4572 fi
4573fi
c0c3707f
CB
4574{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
4575$as_echo_n "checking for $CC option to enable C11 features... " >&6; }
4576if ${ac_cv_prog_cc_c11+:} false; then :
c971b7fa
PA
4577 $as_echo_n "(cached) " >&6
4578else
c0c3707f 4579 ac_cv_prog_cc_c11=no
c971b7fa
PA
4580ac_save_CC=$CC
4581cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4582/* end confdefs.h. */
4583#include <stdarg.h>
c0c3707f
CB
4584#include <stdbool.h>
4585#include <stddef.h>
4586#include <stdlib.h>
4587#include <wchar.h>
c971b7fa 4588#include <stdio.h>
c0c3707f
CB
4589
4590// Check varargs macros. These examples are taken from C99 6.10.3.5.
4591#define debug(...) fprintf (stderr, __VA_ARGS__)
4592#define showlist(...) puts (#__VA_ARGS__)
4593#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4594static void
4595test_varargs_macros (void)
7a6dbc2f 4596{
c0c3707f
CB
4597 int x = 1234;
4598 int y = 5678;
4599 debug ("Flag");
4600 debug ("X = %d\n", x);
4601 showlist (The first, second, and third items.);
4602 report (x>y, "x is %d but y is %d", x, y);
c971b7fa 4603}
c0c3707f
CB
4604
4605// Check long long types.
4606#define BIG64 18446744073709551615ull
4607#define BIG32 4294967295ul
4608#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4609#if !BIG_OK
4610 your preprocessor is broken;
4611#endif
4612#if BIG_OK
4613#else
4614 your preprocessor is broken;
4615#endif
4616static long long int bignum = -9223372036854775807LL;
4617static unsigned long long int ubignum = BIG64;
4618
4619struct incomplete_array
7a6dbc2f 4620{
c0c3707f
CB
4621 int datasize;
4622 double data[];
4623};
4624
4625struct named_init {
4626 int number;
4627 const wchar_t *name;
4628 double average;
4629};
4630
4631typedef const char *ccp;
4632
4633static inline int
4634test_restrict (ccp restrict text)
4635{
4636 // See if C++-style comments work.
4637 // Iterate through items via the restricted pointer.
4638 // Also check for declarations in for loops.
4639 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4640 continue;
4641 return 0;
7a6dbc2f 4642}
7a6dbc2f 4643
c0c3707f
CB
4644// Check varargs and va_copy.
4645static bool
4646test_varargs (const char *format, ...)
4647{
4648 va_list args;
4649 va_start (args, format);
4650 va_list args_copy;
4651 va_copy (args_copy, args);
7a6dbc2f 4652
c0c3707f
CB
4653 const char *str = "";
4654 int number = 0;
4655 float fnumber = 0;
4656
4657 while (*format)
4658 {
4659 switch (*format++)
4660 {
4661 case 's': // string
4662 str = va_arg (args_copy, const char *);
4663 break;
4664 case 'd': // int
4665 number = va_arg (args_copy, int);
4666 break;
4667 case 'f': // float
4668 fnumber = va_arg (args_copy, double);
4669 break;
4670 default:
4671 break;
4672 }
4673 }
4674 va_end (args_copy);
4675 va_end (args);
4676
4677 return *str && number && fnumber;
4678}
4679// Check _Alignas.
4680char _Alignas (double) aligned_as_double;
4681char _Alignas (0) no_special_alignment;
4682extern char aligned_as_int;
4683char _Alignas (0) _Alignas (int) aligned_as_int;
4684
4685// Check _Alignof.
4686enum
4687{
4688 int_alignment = _Alignof (int),
4689 int_array_alignment = _Alignof (int[100]),
4690 char_alignment = _Alignof (char)
4691};
4692_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
4693
4694// Check _Noreturn.
4695int _Noreturn does_not_return (void) { for (;;) continue; }
4696
4697// Check _Static_assert.
4698struct test_static_assert
4699{
4700 int x;
4701 _Static_assert (sizeof (int) <= sizeof (long int),
4702 "_Static_assert does not work in struct");
4703 long int y;
4704};
4705
4706// Check UTF-8 literals.
4707#define u8 syntax error!
4708char const utf8_literal[] = u8"happens to be ASCII" "another string";
4709
4710// Check duplicate typedefs.
4711typedef long *long_ptr;
4712typedef long int *long_ptr;
4713typedef long_ptr long_ptr;
4714
4715// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
4716struct anonymous
4717{
4718 union {
4719 struct { int i; int j; };
4720 struct { int k; long int l; } w;
4721 };
4722 int m;
4723} v1;
c971b7fa 4724
c971b7fa
PA
4725int
4726main ()
4727{
c0c3707f
CB
4728
4729 // Check bool.
4730 _Bool success = false;
4731
4732 // Check restrict.
4733 if (test_restrict ("String literal") == 0)
4734 success = true;
4735 char *restrict newvar = "Another string";
4736
4737 // Check varargs.
4738 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4739 test_varargs_macros ();
4740
4741 // Check flexible array members.
4742 struct incomplete_array *ia =
4743 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4744 ia->datasize = 10;
4745 for (int i = 0; i < ia->datasize; ++i)
4746 ia->data[i] = i * 1.234;
4747
4748 // Check named initializers.
4749 struct named_init ni = {
4750 .number = 34,
4751 .name = L"Test wide string",
4752 .average = 543.34343,
4753 };
4754
4755 ni.number = 58;
4756
4757 int dynamic_array[ni.number];
4758 dynamic_array[ni.number - 1] = 543;
4759
4760 // work around unused variable warnings
4761 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4762 || dynamic_array[ni.number - 1] != 543);
4763
4764 v1.i = 2;
4765 v1.w.k = 5;
4766 _Static_assert ((offsetof (struct anonymous, i)
4767 == offsetof (struct anonymous, w.k)),
4768 "Anonymous union alignment botch");
4769
c971b7fa
PA
4770 ;
4771 return 0;
4772}
4773_ACEOF
c0c3707f 4774for ac_arg in '' -std=gnu11
c971b7fa
PA
4775do
4776 CC="$ac_save_CC $ac_arg"
4777 if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 4778 ac_cv_prog_cc_c11=$ac_arg
c971b7fa
PA
4779fi
4780rm -f core conftest.err conftest.$ac_objext
c0c3707f 4781 test "x$ac_cv_prog_cc_c11" != "xno" && break
c971b7fa
PA
4782done
4783rm -f conftest.$ac_ext
4784CC=$ac_save_CC
4785
4786fi
4787# AC_CACHE_VAL
c0c3707f
CB
4788ac_prog_cc_stdc_options=
4789case "x$ac_cv_prog_cc_c11" in
c971b7fa
PA
4790 x)
4791 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4792$as_echo "none needed" >&6; } ;;
4793 xno)
4794 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4795$as_echo "unsupported" >&6; } ;;
4796 *)
c0c3707f
CB
4797 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
4798 CC=$CC$ac_prog_cc_stdc_options
4799 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
4800$as_echo "$ac_cv_prog_cc_c11" >&6; } ;;
c971b7fa 4801esac
c0c3707f
CB
4802if test "x$ac_cv_prog_cc_c11" != xno; then :
4803 ac_prog_cc_stdc=c11
4804 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
4805else
4806 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
4807$as_echo_n "checking for $CC option to enable C99 features... " >&6; }
4808if ${ac_cv_prog_cc_c99+:} false; then :
4809 $as_echo_n "(cached) " >&6
4810else
4811 ac_cv_prog_cc_c99=no
4812ac_save_CC=$CC
4813cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4814/* end confdefs.h. */
4815#include <stdarg.h>
4816#include <stdbool.h>
4817#include <stddef.h>
4818#include <stdlib.h>
4819#include <wchar.h>
4820#include <stdio.h>
7a6dbc2f 4821
c0c3707f
CB
4822// Check varargs macros. These examples are taken from C99 6.10.3.5.
4823#define debug(...) fprintf (stderr, __VA_ARGS__)
4824#define showlist(...) puts (#__VA_ARGS__)
4825#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4826static void
4827test_varargs_macros (void)
4828{
4829 int x = 1234;
4830 int y = 5678;
4831 debug ("Flag");
4832 debug ("X = %d\n", x);
4833 showlist (The first, second, and third items.);
4834 report (x>y, "x is %d but y is %d", x, y);
4835}
7a6dbc2f 4836
c0c3707f
CB
4837// Check long long types.
4838#define BIG64 18446744073709551615ull
4839#define BIG32 4294967295ul
4840#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4841#if !BIG_OK
4842 your preprocessor is broken;
4843#endif
4844#if BIG_OK
4845#else
4846 your preprocessor is broken;
4847#endif
4848static long long int bignum = -9223372036854775807LL;
4849static unsigned long long int ubignum = BIG64;
7a6dbc2f 4850
c0c3707f
CB
4851struct incomplete_array
4852{
4853 int datasize;
4854 double data[];
4855};
7a6dbc2f 4856
c0c3707f
CB
4857struct named_init {
4858 int number;
4859 const wchar_t *name;
4860 double average;
4861};
7a6dbc2f 4862
c0c3707f 4863typedef const char *ccp;
7a6dbc2f 4864
c0c3707f
CB
4865static inline int
4866test_restrict (ccp restrict text)
4867{
4868 // See if C++-style comments work.
4869 // Iterate through items via the restricted pointer.
4870 // Also check for declarations in for loops.
4871 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4872 continue;
4873 return 0;
4874}
7a6dbc2f 4875
c0c3707f
CB
4876// Check varargs and va_copy.
4877static bool
4878test_varargs (const char *format, ...)
4879{
4880 va_list args;
4881 va_start (args, format);
4882 va_list args_copy;
4883 va_copy (args_copy, args);
4884
4885 const char *str = "";
4886 int number = 0;
4887 float fnumber = 0;
4888
4889 while (*format)
4890 {
4891 switch (*format++)
4892 {
4893 case 's': // string
4894 str = va_arg (args_copy, const char *);
4895 break;
4896 case 'd': // int
4897 number = va_arg (args_copy, int);
4898 break;
4899 case 'f': // float
4900 fnumber = va_arg (args_copy, double);
4901 break;
4902 default:
4903 break;
4904 }
4905 }
4906 va_end (args_copy);
4907 va_end (args);
4908
4909 return *str && number && fnumber;
4910}
4911int
4912main ()
4913{
4914
4915 // Check bool.
4916 _Bool success = false;
4917
4918 // Check restrict.
4919 if (test_restrict ("String literal") == 0)
4920 success = true;
4921 char *restrict newvar = "Another string";
4922
4923 // Check varargs.
4924 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4925 test_varargs_macros ();
4926
4927 // Check flexible array members.
4928 struct incomplete_array *ia =
4929 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4930 ia->datasize = 10;
4931 for (int i = 0; i < ia->datasize; ++i)
4932 ia->data[i] = i * 1.234;
4933
4934 // Check named initializers.
4935 struct named_init ni = {
4936 .number = 34,
4937 .name = L"Test wide string",
4938 .average = 543.34343,
4939 };
4940
4941 ni.number = 58;
4942
4943 int dynamic_array[ni.number];
4944 dynamic_array[ni.number - 1] = 543;
4945
4946 // work around unused variable warnings
4947 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4948 || dynamic_array[ni.number - 1] != 543);
4949
4950 ;
4951 return 0;
4952}
4953_ACEOF
4954for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
4955do
4956 CC="$ac_save_CC $ac_arg"
4957 if ac_fn_c_try_compile "$LINENO"; then :
4958 ac_cv_prog_cc_c99=$ac_arg
4959fi
4960rm -f core conftest.err conftest.$ac_objext
4961 test "x$ac_cv_prog_cc_c99" != "xno" && break
4962done
4963rm -f conftest.$ac_ext
4964CC=$ac_save_CC
4965
4966fi
4967# AC_CACHE_VAL
4968ac_prog_cc_stdc_options=
4969case "x$ac_cv_prog_cc_c99" in
4970 x)
4971 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4972$as_echo "none needed" >&6; } ;;
4973 xno)
4974 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4975$as_echo "unsupported" >&6; } ;;
4976 *)
4977 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
4978 CC=$CC$ac_prog_cc_stdc_options
4979 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
4980$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
4981esac
4982if test "x$ac_cv_prog_cc_c99" != xno; then :
4983 ac_prog_cc_stdc=c99
4984 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
4985else
4986 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
4987$as_echo_n "checking for $CC option to enable C89 features... " >&6; }
4988if ${ac_cv_prog_cc_c89+:} false; then :
d0ac1c44
SM
4989 $as_echo_n "(cached) " >&6
4990else
c0c3707f
CB
4991 ac_cv_prog_cc_c89=no
4992ac_save_CC=$CC
4993cat confdefs.h - <<_ACEOF >conftest.$ac_ext
d0ac1c44 4994/* end confdefs.h. */
c0c3707f
CB
4995#include <stdarg.h>
4996#include <stdio.h>
4997struct stat;
4998/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
4999struct buf { int x; };
5000FILE * (*rcsopen) (struct buf *, struct stat *, int);
5001static char *e (p, i)
5002 char **p;
5003 int i;
5004{
5005 return p[i];
5006}
5007static char *f (char * (*g) (char **, int), char **p, ...)
5008{
5009 char *s;
5010 va_list v;
5011 va_start (v,p);
5012 s = g (p, va_arg (v,int));
5013 va_end (v);
5014 return s;
5015}
5016
5017/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
5018 function prototypes and stuff, but not '\xHH' hex character constants.
5019 These don't provoke an error unfortunately, instead are silently treated
5020 as 'x'. The following induces an error, until -std is added to get
5021 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
5022 array size at least. It's necessary to write '\x00'==0 to get something
5023 that's true only with -std. */
5024int osf4_cc_array ['\x00' == 0 ? 1 : -1];
5025
5026/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
5027 inside strings and character constants. */
5028#define FOO(x) 'x'
5029int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
d0ac1c44 5030
c0c3707f
CB
5031int test (int i, double x);
5032struct s1 {int (*f) (int a);};
5033struct s2 {int (*f) (double a);};
5034int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
5035int argc;
5036char **argv;
d0ac1c44
SM
5037int
5038main ()
5039{
c0c3707f 5040return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
d0ac1c44
SM
5041 ;
5042 return 0;
5043}
5044_ACEOF
c0c3707f
CB
5045for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
5046 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
5047do
5048 CC="$ac_save_CC $ac_arg"
5049 if ac_fn_c_try_compile "$LINENO"; then :
5050 ac_cv_prog_cc_c89=$ac_arg
5051fi
5052rm -f core conftest.err conftest.$ac_objext
5053 test "x$ac_cv_prog_cc_c89" != "xno" && break
5054done
5055rm -f conftest.$ac_ext
5056CC=$ac_save_CC
5057
5058fi
5059# AC_CACHE_VAL
5060ac_prog_cc_stdc_options=
5061case "x$ac_cv_prog_cc_c89" in
5062 x)
5063 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5064$as_echo "none needed" >&6; } ;;
5065 xno)
5066 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5067$as_echo "unsupported" >&6; } ;;
5068 *)
5069 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
5070 CC=$CC$ac_prog_cc_stdc_options
5071 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
5072$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
5073esac
5074if test "x$ac_cv_prog_cc_c89" != xno; then :
5075 ac_prog_cc_stdc=c89
5076 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
5077else
5078 ac_prog_cc_stdc=no
5079 ac_cv_prog_cc_stdc=no
5080fi
5081
5082fi
5083
7a6dbc2f 5084fi
c0c3707f 5085
d0ac1c44
SM
5086ac_ext=c
5087ac_cpp='$CPP $CPPFLAGS'
5088ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5089ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5090ac_compiler_gnu=$ac_cv_c_compiler_gnu
5091
5092
5df4cba6
SM
5093 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
5094$as_echo_n "checking whether the compiler is clang... " >&6; }
5095if ${gl_cv_compiler_clang+:} false; then :
5096 $as_echo_n "(cached) " >&6
5097else
5098 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5099/* end confdefs.h. */
5100
5101 #ifdef __clang__
5102 barfbarf
5103 #endif
5104
5105int
5106main ()
5107{
5108
5109 ;
5110 return 0;
5111}
5112
5113_ACEOF
5114if ac_fn_c_try_compile "$LINENO"; then :
5115 gl_cv_compiler_clang=no
5116else
5117 gl_cv_compiler_clang=yes
5118fi
5119rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5120
5121fi
5122{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5
5123$as_echo "$gl_cv_compiler_clang" >&6; }
5124
5125
5126 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5
5127$as_echo_n "checking for compiler option needed when checking for declarations... " >&6; }
5128if ${gl_cv_compiler_check_decl_option+:} false; then :
5129 $as_echo_n "(cached) " >&6
5130else
5131 if test $gl_cv_compiler_clang = yes; then
5132 save_ac_compile="$ac_compile"
5133 ac_compile="$ac_compile -Werror=implicit-function-declaration"
5134 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5135/* end confdefs.h. */
5136
5137int
5138main ()
5139{
5140
5141 ;
5142 return 0;
5143}
5144_ACEOF
5145if ac_fn_c_try_compile "$LINENO"; then :
5146 gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'
5147else
5148 gl_cv_compiler_check_decl_option=none
5149fi
5150rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5151 ac_compile="$save_ac_compile"
5152 else
5153 gl_cv_compiler_check_decl_option=none
5154 fi
5155
5156fi
5157{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5
5158$as_echo "$gl_cv_compiler_check_decl_option" >&6; }
5159 if test "x$gl_cv_compiler_check_decl_option" != xnone; then
5160 ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
5161 else
5162 ac_compile_for_check_decl="$ac_compile"
5163 fi
5164
5165
5166
c971b7fa
PA
5167ac_ext=c
5168ac_cpp='$CPP $CPPFLAGS'
5169ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5170ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5171ac_compiler_gnu=$ac_cv_c_compiler_gnu
5172{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5173$as_echo_n "checking how to run the C preprocessor... " >&6; }
5174# On Suns, sometimes $CPP names a directory.
5175if test -n "$CPP" && test -d "$CPP"; then
5176 CPP=
5177fi
5178if test -z "$CPP"; then
d0ac1c44 5179 if ${ac_cv_prog_CPP+:} false; then :
c971b7fa
PA
5180 $as_echo_n "(cached) " >&6
5181else
5182 # Double quotes because CPP needs to be expanded
5183 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5184 do
5185 ac_preproc_ok=false
5186for ac_c_preproc_warn_flag in '' yes
5187do
5188 # Use a header file that comes with gcc, so configuring glibc
5189 # with a fresh cross-compiler works.
5190 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5191 # <limits.h> exists even on freestanding compilers.
5192 # On the NeXT, cc -E runs the code through the compiler's parser,
5193 # not just through cpp. "Syntax error" is here to catch this case.
5194 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5195/* end confdefs.h. */
5196#ifdef __STDC__
5197# include <limits.h>
5198#else
5199# include <assert.h>
5200#endif
5201 Syntax error
5202_ACEOF
5203if ac_fn_c_try_cpp "$LINENO"; then :
5204
5205else
5206 # Broken: fails on valid input.
5207continue
5208fi
d0ac1c44 5209rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5210
5211 # OK, works on sane cases. Now check whether nonexistent headers
5212 # can be detected and how.
5213 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5214/* end confdefs.h. */
5215#include <ac_nonexistent.h>
5216_ACEOF
5217if ac_fn_c_try_cpp "$LINENO"; then :
5218 # Broken: success on invalid input.
5219continue
5220else
5221 # Passes both tests.
5222ac_preproc_ok=:
5223break
5224fi
d0ac1c44 5225rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5226
5227done
5228# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5229rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5230if $ac_preproc_ok; then :
5231 break
5232fi
5233
5234 done
5235 ac_cv_prog_CPP=$CPP
5236
5237fi
5238 CPP=$ac_cv_prog_CPP
5239else
5240 ac_cv_prog_CPP=$CPP
5241fi
5242{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5243$as_echo "$CPP" >&6; }
5244ac_preproc_ok=false
5245for ac_c_preproc_warn_flag in '' yes
5246do
5247 # Use a header file that comes with gcc, so configuring glibc
5248 # with a fresh cross-compiler works.
5249 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5250 # <limits.h> exists even on freestanding compilers.
5251 # On the NeXT, cc -E runs the code through the compiler's parser,
5252 # not just through cpp. "Syntax error" is here to catch this case.
5253 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5254/* end confdefs.h. */
5255#ifdef __STDC__
5256# include <limits.h>
5257#else
5258# include <assert.h>
5259#endif
5260 Syntax error
5261_ACEOF
5262if ac_fn_c_try_cpp "$LINENO"; then :
5263
5264else
5265 # Broken: fails on valid input.
5266continue
5267fi
d0ac1c44 5268rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5269
5270 # OK, works on sane cases. Now check whether nonexistent headers
5271 # can be detected and how.
5272 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5273/* end confdefs.h. */
5274#include <ac_nonexistent.h>
5275_ACEOF
5276if ac_fn_c_try_cpp "$LINENO"; then :
5277 # Broken: success on invalid input.
5278continue
5279else
5280 # Passes both tests.
5281ac_preproc_ok=:
5282break
5283fi
d0ac1c44 5284rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5285
5286done
5287# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5288rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5289if $ac_preproc_ok; then :
5290
5291else
5292 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5293$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
5294as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5295See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
5296fi
5297
5298ac_ext=c
5299ac_cpp='$CPP $CPPFLAGS'
5300ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5301ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5302ac_compiler_gnu=$ac_cv_c_compiler_gnu
5303
5304
5305{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
5306$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
d0ac1c44 5307if ${ac_cv_path_GREP+:} false; then :
c971b7fa
PA
5308 $as_echo_n "(cached) " >&6
5309else
5310 if test -z "$GREP"; then
5311 ac_path_GREP_found=false
5312 # Loop through the user's path and test for each of PROGNAME-LIST
5313 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5314for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5315do
5316 IFS=$as_save_IFS
5317 test -z "$as_dir" && as_dir=.
5318 for ac_prog in grep ggrep; do
5319 for ac_exec_ext in '' $ac_executable_extensions; do
5320 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5321 as_fn_executable_p "$ac_path_GREP" || continue
c971b7fa
PA
5322# Check for GNU ac_path_GREP and select it if it is found.
5323 # Check for GNU $ac_path_GREP
5324case `"$ac_path_GREP" --version 2>&1` in
5325*GNU*)
5326 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
5327*)
5328 ac_count=0
5329 $as_echo_n 0123456789 >"conftest.in"
5330 while :
5331 do
5332 cat "conftest.in" "conftest.in" >"conftest.tmp"
5333 mv "conftest.tmp" "conftest.in"
5334 cp "conftest.in" "conftest.nl"
5335 $as_echo 'GREP' >> "conftest.nl"
5336 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5337 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5338 as_fn_arith $ac_count + 1 && ac_count=$as_val
5339 if test $ac_count -gt ${ac_path_GREP_max-0}; then
5340 # Best one so far, save it but keep looking for a better one
5341 ac_cv_path_GREP="$ac_path_GREP"
5342 ac_path_GREP_max=$ac_count
5343 fi
5344 # 10*(2^10) chars as input seems more than enough
5345 test $ac_count -gt 10 && break
5346 done
5347 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5348esac
5349
5350 $ac_path_GREP_found && break 3
5351 done
5352 done
5353 done
5354IFS=$as_save_IFS
5355 if test -z "$ac_cv_path_GREP"; then
d0ac1c44 5356 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5357 fi
5358else
5359 ac_cv_path_GREP=$GREP
5360fi
5361
5362fi
5363{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
5364$as_echo "$ac_cv_path_GREP" >&6; }
5365 GREP="$ac_cv_path_GREP"
5366
5367
5368{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
5369$as_echo_n "checking for egrep... " >&6; }
d0ac1c44 5370if ${ac_cv_path_EGREP+:} false; then :
c971b7fa
PA
5371 $as_echo_n "(cached) " >&6
5372else
5373 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
5374 then ac_cv_path_EGREP="$GREP -E"
5375 else
5376 if test -z "$EGREP"; then
5377 ac_path_EGREP_found=false
5378 # Loop through the user's path and test for each of PROGNAME-LIST
5379 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5380for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5381do
5382 IFS=$as_save_IFS
5383 test -z "$as_dir" && as_dir=.
5384 for ac_prog in egrep; do
5385 for ac_exec_ext in '' $ac_executable_extensions; do
5386 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5387 as_fn_executable_p "$ac_path_EGREP" || continue
c971b7fa
PA
5388# Check for GNU ac_path_EGREP and select it if it is found.
5389 # Check for GNU $ac_path_EGREP
5390case `"$ac_path_EGREP" --version 2>&1` in
5391*GNU*)
5392 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
5393*)
5394 ac_count=0
5395 $as_echo_n 0123456789 >"conftest.in"
5396 while :
5397 do
5398 cat "conftest.in" "conftest.in" >"conftest.tmp"
5399 mv "conftest.tmp" "conftest.in"
5400 cp "conftest.in" "conftest.nl"
5401 $as_echo 'EGREP' >> "conftest.nl"
5402 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5403 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5404 as_fn_arith $ac_count + 1 && ac_count=$as_val
5405 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
5406 # Best one so far, save it but keep looking for a better one
5407 ac_cv_path_EGREP="$ac_path_EGREP"
5408 ac_path_EGREP_max=$ac_count
5409 fi
5410 # 10*(2^10) chars as input seems more than enough
5411 test $ac_count -gt 10 && break
5412 done
5413 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5414esac
5415
5416 $ac_path_EGREP_found && break 3
5417 done
5418 done
5419 done
5420IFS=$as_save_IFS
5421 if test -z "$ac_cv_path_EGREP"; then
d0ac1c44 5422 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5423 fi
5424else
5425 ac_cv_path_EGREP=$EGREP
5426fi
5427
5428 fi
5429fi
5430{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
5431$as_echo "$ac_cv_path_EGREP" >&6; }
5432 EGREP="$ac_cv_path_EGREP"
5433
5434
5435{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
5436$as_echo_n "checking for ANSI C header files... " >&6; }
d0ac1c44 5437if ${ac_cv_header_stdc+:} false; then :
c971b7fa
PA
5438 $as_echo_n "(cached) " >&6
5439else
5440 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5441/* end confdefs.h. */
5442#include <stdlib.h>
5443#include <stdarg.h>
5444#include <string.h>
5445#include <float.h>
5446
5447int
5448main ()
5449{
5450
5451 ;
5452 return 0;
5453}
5454_ACEOF
5455if ac_fn_c_try_compile "$LINENO"; then :
5456 ac_cv_header_stdc=yes
5457else
5458 ac_cv_header_stdc=no
5459fi
5460rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5461
5462if test $ac_cv_header_stdc = yes; then
5463 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5464 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5465/* end confdefs.h. */
5466#include <string.h>
5467
5468_ACEOF
5469if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5470 $EGREP "memchr" >/dev/null 2>&1; then :
5471
5472else
5473 ac_cv_header_stdc=no
5474fi
5475rm -f conftest*
5476
5477fi
5478
5479if test $ac_cv_header_stdc = yes; then
5480 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5481 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5482/* end confdefs.h. */
5483#include <stdlib.h>
5484
5485_ACEOF
5486if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5487 $EGREP "free" >/dev/null 2>&1; then :
5488
5489else
5490 ac_cv_header_stdc=no
5491fi
5492rm -f conftest*
5493
5494fi
5495
5496if test $ac_cv_header_stdc = yes; then
5497 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5498 if test "$cross_compiling" = yes; then :
5499 :
5500else
5501 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5502/* end confdefs.h. */
5503#include <ctype.h>
5504#include <stdlib.h>
5505#if ((' ' & 0x0FF) == 0x020)
5506# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5507# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5508#else
5509# define ISLOWER(c) \
5510 (('a' <= (c) && (c) <= 'i') \
5511 || ('j' <= (c) && (c) <= 'r') \
5512 || ('s' <= (c) && (c) <= 'z'))
5513# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
5514#endif
5515
5516#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5517int
5518main ()
5519{
5520 int i;
5521 for (i = 0; i < 256; i++)
5522 if (XOR (islower (i), ISLOWER (i))
5523 || toupper (i) != TOUPPER (i))
5524 return 2;
5525 return 0;
5526}
5527_ACEOF
5528if ac_fn_c_try_run "$LINENO"; then :
5529
5530else
5531 ac_cv_header_stdc=no
5532fi
5533rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5534 conftest.$ac_objext conftest.beam conftest.$ac_ext
5535fi
5536
5537fi
5538fi
5539{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
5540$as_echo "$ac_cv_header_stdc" >&6; }
5541if test $ac_cv_header_stdc = yes; then
5542
5543$as_echo "#define STDC_HEADERS 1" >>confdefs.h
5544
5545fi
5546
5547# On IRIX 5.3, sys/types and inttypes.h are conflicting.
5548for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
5549 inttypes.h stdint.h unistd.h
5550do :
5551 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5552ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5553"
d0ac1c44 5554if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
c971b7fa
PA
5555 cat >>confdefs.h <<_ACEOF
5556#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5557_ACEOF
5558
5559fi
5560
5561done
5562
5563
5564
c971b7fa 5565 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
d0ac1c44 5566if test "x$ac_cv_header_minix_config_h" = xyes; then :
c971b7fa
PA
5567 MINIX=yes
5568else
5569 MINIX=
5570fi
5571
5572
5573 if test "$MINIX" = yes; then
5574
5575$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
5576
5577
5578$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
5579
5580
5581$as_echo "#define _MINIX 1" >>confdefs.h
5582
c971b7fa 5583
4a626d0a 5584$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
c971b7fa 5585
4a626d0a 5586 fi
c971b7fa
PA
5587
5588
5589 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
5590$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
d0ac1c44 5591if ${ac_cv_safe_to_define___extensions__+:} false; then :
c971b7fa
PA
5592 $as_echo_n "(cached) " >&6
5593else
5594 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5595/* end confdefs.h. */
5596
5597# define __EXTENSIONS__ 1
5598 $ac_includes_default
5599int
5600main ()
5601{
5602
5603 ;
5604 return 0;
5605}
5606_ACEOF
5607if ac_fn_c_try_compile "$LINENO"; then :
5608 ac_cv_safe_to_define___extensions__=yes
5609else
5610 ac_cv_safe_to_define___extensions__=no
5611fi
5612rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5613fi
5614{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
5615$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
5616 test $ac_cv_safe_to_define___extensions__ = yes &&
5617 $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
5618
5619 $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
5620
5621 $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
5622
5623 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
5624
c0c3707f
CB
5625 $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
5626
5627 $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h
5628
c971b7fa
PA
5629 $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
5630
49e4877c
PA
5631 $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
5632
5633 $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
5634
5635 $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
5636
5637 $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
5638
5639 $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
5640
5641 $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
5642
5643 $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
5644
c971b7fa
PA
5645 $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
5646
4a626d0a
PA
5647 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
5648$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
d0ac1c44 5649if ${ac_cv_should_define__xopen_source+:} false; then :
4a626d0a
PA
5650 $as_echo_n "(cached) " >&6
5651else
5652 ac_cv_should_define__xopen_source=no
5653 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5654/* end confdefs.h. */
5655
5656 #include <wchar.h>
5657 mbstate_t x;
5658int
5659main ()
5660{
5661
5662 ;
5663 return 0;
5664}
5665_ACEOF
5666if ac_fn_c_try_compile "$LINENO"; then :
5667
5668else
5669 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5670/* end confdefs.h. */
5671
5672 #define _XOPEN_SOURCE 500
5673 #include <wchar.h>
5674 mbstate_t x;
5675int
5676main ()
5677{
5678
5679 ;
5680 return 0;
5681}
5682_ACEOF
5683if ac_fn_c_try_compile "$LINENO"; then :
5684 ac_cv_should_define__xopen_source=yes
5685fi
d0ac1c44
SM
5686rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5687fi
5688rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5689fi
5690{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
5691$as_echo "$ac_cv_should_define__xopen_source" >&6; }
5692 test $ac_cv_should_define__xopen_source = yes &&
5693 $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
5694
c0c3707f
CB
5695 $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
5696
d0ac1c44 5697
c8693053
RO
5698# Needs to run before gl_EARLY so it can override AC_SYS_LARGEFILE included
5699# there.
c0c3707f
CB
5700ac_aux_dir=
5701for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
5702 if test -f "$ac_dir/install-sh"; then
5703 ac_aux_dir=$ac_dir
5704 ac_install_sh="$ac_aux_dir/install-sh -c"
5705 break
5706 elif test -f "$ac_dir/install.sh"; then
5707 ac_aux_dir=$ac_dir
5708 ac_install_sh="$ac_aux_dir/install.sh -c"
5709 break
5710 elif test -f "$ac_dir/shtool"; then
5711 ac_aux_dir=$ac_dir
5712 ac_install_sh="$ac_aux_dir/shtool install -c"
5713 break
5714 fi
5715done
5716if test -z "$ac_aux_dir"; then
5717 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
5718fi
5719
5720# These three variables are undocumented and unsupported,
5721# and are intended to be withdrawn in a future Autoconf release.
5722# They can cause serious problems if a builder's source tree is in a directory
5723# whose full name contains unusual characters.
5724ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
5725ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
5726ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
5727
5728
4a626d0a
PA
5729# Make sure we can run config.sub.
5730$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
d0ac1c44 5731 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4a626d0a
PA
5732
5733{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
5734$as_echo_n "checking build system type... " >&6; }
d0ac1c44 5735if ${ac_cv_build+:} false; then :
4a626d0a
PA
5736 $as_echo_n "(cached) " >&6
5737else
5738 ac_build_alias=$build_alias
5739test "x$ac_build_alias" = x &&
5740 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
5741test "x$ac_build_alias" = x &&
d0ac1c44 5742 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4a626d0a 5743ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
d0ac1c44 5744 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4a626d0a
PA
5745
5746fi
5747{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
5748$as_echo "$ac_cv_build" >&6; }
5749case $ac_cv_build in
5750*-*-*) ;;
d0ac1c44 5751*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4a626d0a
PA
5752esac
5753build=$ac_cv_build
5754ac_save_IFS=$IFS; IFS='-'
5755set x $ac_cv_build
5756shift
5757build_cpu=$1
5758build_vendor=$2
5759shift; shift
5760# Remember, the first character of IFS is used to create $*,
5761# except with old shells:
5762build_os=$*
5763IFS=$ac_save_IFS
5764case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
5765
5766
5767{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
5768$as_echo_n "checking host system type... " >&6; }
d0ac1c44 5769if ${ac_cv_host+:} false; then :
4a626d0a
PA
5770 $as_echo_n "(cached) " >&6
5771else
5772 if test "x$host_alias" = x; then
5773 ac_cv_host=$ac_cv_build
5774else
5775 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
d0ac1c44 5776 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4a626d0a
PA
5777fi
5778
5779fi
5780{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
5781$as_echo "$ac_cv_host" >&6; }
5782case $ac_cv_host in
5783*-*-*) ;;
d0ac1c44 5784*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4a626d0a
PA
5785esac
5786host=$ac_cv_host
5787ac_save_IFS=$IFS; IFS='-'
5788set x $ac_cv_host
5789shift
5790host_cpu=$1
5791host_vendor=$2
5792shift; shift
5793# Remember, the first character of IFS is used to create $*,
5794# except with old shells:
5795host_os=$*
5796IFS=$ac_save_IFS
5797case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
5798
5799
c8693053
RO
5800{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
5801$as_echo_n "checking target system type... " >&6; }
5802if ${ac_cv_target+:} false; then :
5803 $as_echo_n "(cached) " >&6
5804else
5805 if test "x$target_alias" = x; then
5806 ac_cv_target=$ac_cv_host
5807else
5808 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
5809 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
5810fi
c971b7fa 5811
c8693053
RO
5812fi
5813{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
5814$as_echo "$ac_cv_target" >&6; }
5815case $ac_cv_target in
5816*-*-*) ;;
5817*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
5818esac
5819target=$ac_cv_target
5820ac_save_IFS=$IFS; IFS='-'
5821set x $ac_cv_target
5822shift
5823target_cpu=$1
5824target_vendor=$2
5825shift; shift
5826# Remember, the first character of IFS is used to create $*,
5827# except with old shells:
5828target_os=$*
5829IFS=$ac_save_IFS
5830case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
c971b7fa 5831
88b48903 5832
c8693053
RO
5833# The aliases save the names the user supplied, while $host etc.
5834# will get canonicalized.
5835test -n "$target_alias" &&
5836 test "$program_prefix$program_suffix$program_transform_name" = \
5837 NONENONEs,x,x, &&
5838 program_prefix=${target_alias}-
5839
5840# The tests for host and target for $enable_largefile require
5841# canonical names.
5842
5843
5844
5845# As the $enable_largefile decision depends on --enable-plugins we must set it
5846# even in directories otherwise not depending on the $plugins option.
5847
5848
5849 maybe_plugins=no
5850 for ac_header in dlfcn.h
5851do :
5852 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
5853"
5854if test "x$ac_cv_header_dlfcn_h" = xyes; then :
5855 cat >>confdefs.h <<_ACEOF
5856#define HAVE_DLFCN_H 1
5857_ACEOF
5858 maybe_plugins=yes
5859fi
5860
5861done
5862
5863 for ac_header in windows.h
5864do :
5865 ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
5866"
5867if test "x$ac_cv_header_windows_h" = xyes; then :
5868 cat >>confdefs.h <<_ACEOF
5869#define HAVE_WINDOWS_H 1
5870_ACEOF
5871 maybe_plugins=yes
5872fi
5873
5874done
5875
5876
5877 # Check whether --enable-plugins was given.
5878if test "${enable_plugins+set}" = set; then :
5879 enableval=$enable_plugins; case "${enableval}" in
5880 no) plugins=no ;;
5881 *) plugins=yes
5882 if test "$maybe_plugins" != "yes" ; then
5883 as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
5884 fi ;;
5885 esac
5886else
5887 plugins=$maybe_plugins
5888
5889fi
5890
5891 if test "$plugins" = "yes"; then
5892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5
5893$as_echo_n "checking for library containing dlsym... " >&6; }
5894if ${ac_cv_search_dlsym+:} false; then :
5895 $as_echo_n "(cached) " >&6
5896else
5897 ac_func_search_save_LIBS=$LIBS
5898cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5899/* end confdefs.h. */
5900
5901/* Override any GCC internal prototype to avoid an error.
5902 Use char because int might match the return type of a GCC
5903 builtin and then its argument prototype would still apply. */
5904#ifdef __cplusplus
5905extern "C"
5906#endif
5907char dlsym ();
5908int
5909main ()
5910{
5911return dlsym ();
5912 ;
5913 return 0;
5914}
5915_ACEOF
5916for ac_lib in '' dl; do
5917 if test -z "$ac_lib"; then
5918 ac_res="none required"
5919 else
5920 ac_res=-l$ac_lib
5921 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5922 fi
5923 if ac_fn_c_try_link "$LINENO"; then :
5924 ac_cv_search_dlsym=$ac_res
5925fi
5926rm -f core conftest.err conftest.$ac_objext \
5927 conftest$ac_exeext
5928 if ${ac_cv_search_dlsym+:} false; then :
5929 break
5930fi
5931done
5932if ${ac_cv_search_dlsym+:} false; then :
5933
5934else
5935 ac_cv_search_dlsym=no
5936fi
5937rm conftest.$ac_ext
5938LIBS=$ac_func_search_save_LIBS
5939fi
5940{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5
5941$as_echo "$ac_cv_search_dlsym" >&6; }
5942ac_res=$ac_cv_search_dlsym
5943if test "$ac_res" != no; then :
5944 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
5945
5946fi
5947
5948 fi
5949
5950
5951case "${host}" in
5952 sparc-*-solaris*|i?86-*-solaris*)
5953 # On native 32-bit Solaris/SPARC and x86, large-file and procfs support
5954 # were mutually exclusive until Solaris 11.3. Without procfs support,
5955 # the bfd/ elf module cannot provide certain routines such as
5956 # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user
5957 # explicitly requested large-file support through the
5958 # --enable-largefile switch, disable large-file support in favor of
5959 # procfs support.
5960 #
5961 # Check if <sys/procfs.h> is incompatible with large-file support.
5962 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5963/* end confdefs.h. */
5964#define _FILE_OFFSET_BITS 64
5965#define _STRUCTURED_PROC 1
5966#include <sys/procfs.h>
5967int
5968main ()
5969{
5970
5971 ;
5972 return 0;
5973}
5974_ACEOF
5975if ac_fn_c_try_compile "$LINENO"; then :
5976 acx_cv_procfs_lfs=yes
5977else
5978 acx_cv_procfs_lfs=no
5979fi
5980rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5981 #
5982 # Forcefully disable large-file support only if necessary, gdb is in
5983 # tree and enabled.
5984 if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \
5985 -a -d $srcdir/../gdb -a "$enable_gdb" != no; then
5986 : ${enable_largefile="no"}
5987 if test "$plugins" = yes; then
5988 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
5989plugin support disabled; require large-file support which is incompatible with GDB." >&5
5990$as_echo "$as_me: WARNING:
5991plugin support disabled; require large-file support which is incompatible with GDB." >&2;}
5992 plugins=no
88b48903 5993 fi
c8693053
RO
5994 fi
5995 #
5996 # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the
5997 # benefit of g++ 9+ which predefines it on Solaris.
5998 if test "$enable_largefile" = no; then
5999 LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS"
6000
6001 fi
6002 ;;
6003esac
88b48903 6004
2196f55f
YQ
6005# Check whether --enable-largefile was given.
6006if test "${enable_largefile+set}" = set; then :
6007 enableval=$enable_largefile;
6008fi
6009
6010if test "$enable_largefile" != no; then
6011
6012 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
6013$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
d0ac1c44 6014if ${ac_cv_sys_largefile_CC+:} false; then :
2196f55f
YQ
6015 $as_echo_n "(cached) " >&6
6016else
6017 ac_cv_sys_largefile_CC=no
6018 if test "$GCC" != yes; then
6019 ac_save_CC=$CC
6020 while :; do
6021 # IRIX 6.2 and later do not support large files by default,
6022 # so use the C compiler's -n32 option if that helps.
6023 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6024/* end confdefs.h. */
6025#include <sys/types.h>
6026 /* Check that off_t can represent 2**63 - 1 correctly.
6027 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6028 since some C++ compilers masquerading as C compilers
6029 incorrectly reject 9223372036854775807. */
6030#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6031 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6032 && LARGE_OFF_T % 2147483647 == 1)
6033 ? 1 : -1];
6034int
6035main ()
6036{
6037
6038 ;
6039 return 0;
6040}
6041_ACEOF
6042 if ac_fn_c_try_compile "$LINENO"; then :
6043 break
6044fi
6045rm -f core conftest.err conftest.$ac_objext
6046 CC="$CC -n32"
6047 if ac_fn_c_try_compile "$LINENO"; then :
6048 ac_cv_sys_largefile_CC=' -n32'; break
6049fi
6050rm -f core conftest.err conftest.$ac_objext
6051 break
6052 done
6053 CC=$ac_save_CC
6054 rm -f conftest.$ac_ext
6055 fi
6056fi
6057{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6058$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6059 if test "$ac_cv_sys_largefile_CC" != no; then
6060 CC=$CC$ac_cv_sys_largefile_CC
6061 fi
6062
6063 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6064$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
d0ac1c44 6065if ${ac_cv_sys_file_offset_bits+:} false; then :
2196f55f
YQ
6066 $as_echo_n "(cached) " >&6
6067else
6068 while :; do
6069 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6070/* end confdefs.h. */
6071#include <sys/types.h>
6072 /* Check that off_t can represent 2**63 - 1 correctly.
6073 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6074 since some C++ compilers masquerading as C compilers
6075 incorrectly reject 9223372036854775807. */
6076#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6077 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6078 && LARGE_OFF_T % 2147483647 == 1)
6079 ? 1 : -1];
6080int
6081main ()
6082{
6083
6084 ;
6085 return 0;
6086}
6087_ACEOF
6088if ac_fn_c_try_compile "$LINENO"; then :
6089 ac_cv_sys_file_offset_bits=no; break
6090fi
6091rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6092 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6093/* end confdefs.h. */
6094#define _FILE_OFFSET_BITS 64
6095#include <sys/types.h>
6096 /* Check that off_t can represent 2**63 - 1 correctly.
6097 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6098 since some C++ compilers masquerading as C compilers
6099 incorrectly reject 9223372036854775807. */
6100#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6101 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6102 && LARGE_OFF_T % 2147483647 == 1)
6103 ? 1 : -1];
6104int
6105main ()
6106{
6107
6108 ;
6109 return 0;
6110}
6111_ACEOF
6112if ac_fn_c_try_compile "$LINENO"; then :
6113 ac_cv_sys_file_offset_bits=64; break
6114fi
6115rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6116 ac_cv_sys_file_offset_bits=unknown
6117 break
6118done
6119fi
6120{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6121$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6122case $ac_cv_sys_file_offset_bits in #(
6123 no | unknown) ;;
6124 *)
6125cat >>confdefs.h <<_ACEOF
6126#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6127_ACEOF
6128;;
6129esac
6130rm -rf conftest*
6131 if test $ac_cv_sys_file_offset_bits = unknown; then
6132 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6133$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
d0ac1c44 6134if ${ac_cv_sys_large_files+:} false; then :
2196f55f
YQ
6135 $as_echo_n "(cached) " >&6
6136else
6137 while :; do
6138 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6139/* end confdefs.h. */
6140#include <sys/types.h>
6141 /* Check that off_t can represent 2**63 - 1 correctly.
6142 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6143 since some C++ compilers masquerading as C compilers
6144 incorrectly reject 9223372036854775807. */
6145#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6146 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6147 && LARGE_OFF_T % 2147483647 == 1)
6148 ? 1 : -1];
6149int
6150main ()
6151{
6152
6153 ;
6154 return 0;
6155}
6156_ACEOF
6157if ac_fn_c_try_compile "$LINENO"; then :
6158 ac_cv_sys_large_files=no; break
6159fi
6160rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6161 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6162/* end confdefs.h. */
6163#define _LARGE_FILES 1
6164#include <sys/types.h>
6165 /* Check that off_t can represent 2**63 - 1 correctly.
6166 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6167 since some C++ compilers masquerading as C compilers
6168 incorrectly reject 9223372036854775807. */
6169#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6170 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6171 && LARGE_OFF_T % 2147483647 == 1)
6172 ? 1 : -1];
6173int
6174main ()
6175{
6176
6177 ;
6178 return 0;
6179}
6180_ACEOF
6181if ac_fn_c_try_compile "$LINENO"; then :
6182 ac_cv_sys_large_files=1; break
6183fi
6184rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6185 ac_cv_sys_large_files=unknown
6186 break
6187done
6188fi
6189{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6190$as_echo "$ac_cv_sys_large_files" >&6; }
6191case $ac_cv_sys_large_files in #(
6192 no | unknown) ;;
6193 *)
6194cat >>confdefs.h <<_ACEOF
6195#define _LARGE_FILES $ac_cv_sys_large_files
6196_ACEOF
6197;;
6198esac
6199rm -rf conftest*
6200 fi
2196f55f
YQ
6201fi
6202
88b48903
WN
6203
6204
5abebf3c
CB
6205
6206
6207
c0c3707f 6208
5abebf3c 6209
5abebf3c 6210
c0c3707f
CB
6211
6212
c8693053
RO
6213 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
6214$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
6215if ${gl_cv_c_amsterdam_compiler+:} false; then :
6216 $as_echo_n "(cached) " >&6
6217else
c0c3707f 6218
c8693053
RO
6219 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6220/* end confdefs.h. */
5abebf3c 6221
c8693053
RO
6222#ifdef __ACK__
6223Amsterdam
6224#endif
5abebf3c 6225
c8693053
RO
6226_ACEOF
6227if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6228 $EGREP "Amsterdam" >/dev/null 2>&1; then :
6229 gl_cv_c_amsterdam_compiler=yes
6230else
6231 gl_cv_c_amsterdam_compiler=no
6232fi
6233rm -f conftest*
5abebf3c
CB
6234
6235
c8693053
RO
6236fi
6237{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
6238$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
5abebf3c 6239
c8693053
RO
6240 if test $gl_cv_c_amsterdam_compiler = yes; then
6241 if test -z "$AR"; then
6242 AR='cc -c.a'
6243 fi
6244 if test -z "$ARFLAGS"; then
6245 ARFLAGS='-o'
6246 fi
6247 else
6248 :
6249 fi
c971b7fa 6250
c8693053
RO
6251 if test -n "$ac_tool_prefix"; then
6252 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6253set dummy ${ac_tool_prefix}ar; ac_word=$2
6254{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6255$as_echo_n "checking for $ac_word... " >&6; }
6256if ${ac_cv_prog_AR+:} false; then :
6257 $as_echo_n "(cached) " >&6
6258else
6259 if test -n "$AR"; then
6260 ac_cv_prog_AR="$AR" # Let the user override the test.
6261else
6262as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6263for as_dir in $PATH
6264do
6265 IFS=$as_save_IFS
6266 test -z "$as_dir" && as_dir=.
6267 for ac_exec_ext in '' $ac_executable_extensions; do
6268 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6269 ac_cv_prog_AR="${ac_tool_prefix}ar"
6270 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6271 break 2
6272 fi
6273done
6274 done
6275IFS=$as_save_IFS
c971b7fa 6276
c8693053
RO
6277fi
6278fi
6279AR=$ac_cv_prog_AR
6280if test -n "$AR"; then
6281 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
6282$as_echo "$AR" >&6; }
6283else
6284 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6285$as_echo "no" >&6; }
6286fi
c971b7fa 6287
c971b7fa 6288
c8693053
RO
6289fi
6290if test -z "$ac_cv_prog_AR"; then
6291 ac_ct_AR=$AR
6292 # Extract the first word of "ar", so it can be a program name with args.
6293set dummy ar; ac_word=$2
6294{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6295$as_echo_n "checking for $ac_word... " >&6; }
6296if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
6297 $as_echo_n "(cached) " >&6
6298else
c8693053
RO
6299 if test -n "$ac_ct_AR"; then
6300 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5e8754f9 6301else
c8693053
RO
6302as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6303for as_dir in $PATH
6304do
6305 IFS=$as_save_IFS
6306 test -z "$as_dir" && as_dir=.
6307 for ac_exec_ext in '' $ac_executable_extensions; do
6308 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6309 ac_cv_prog_ac_ct_AR="ar"
6310 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6311 break 2
6312 fi
6313done
6314 done
6315IFS=$as_save_IFS
7a6dbc2f 6316
c971b7fa 6317fi
c8693053
RO
6318fi
6319ac_ct_AR=$ac_cv_prog_ac_ct_AR
6320if test -n "$ac_ct_AR"; then
6321 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
6322$as_echo "$ac_ct_AR" >&6; }
6323else
6324 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6325$as_echo "no" >&6; }
6326fi
5e8754f9 6327
c8693053
RO
6328 if test "x$ac_ct_AR" = x; then
6329 AR="ar"
6330 else
6331 case $cross_compiling:$ac_tool_warned in
6332yes:)
6333{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6334$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6335ac_tool_warned=yes ;;
6336esac
6337 AR=$ac_ct_AR
6338 fi
6339else
6340 AR="$ac_cv_prog_AR"
6341fi
c0c3707f 6342
c8693053
RO
6343 if test -z "$ARFLAGS"; then
6344 ARFLAGS='cr'
6345 fi
7a6dbc2f 6346
7a6dbc2f 6347
c0c3707f 6348
c8693053
RO
6349 if test -z "$RANLIB"; then
6350 if test $gl_cv_c_amsterdam_compiler = yes; then
6351 RANLIB=':'
6352 else
6353 if test -n "$ac_tool_prefix"; then
6354 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6355set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6356{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6357$as_echo_n "checking for $ac_word... " >&6; }
6358if ${ac_cv_prog_RANLIB+:} false; then :
6359 $as_echo_n "(cached) " >&6
6360else
6361 if test -n "$RANLIB"; then
6362 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6363else
6364as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6365for as_dir in $PATH
6366do
6367 IFS=$as_save_IFS
6368 test -z "$as_dir" && as_dir=.
6369 for ac_exec_ext in '' $ac_executable_extensions; do
6370 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6371 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6372 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6373 break 2
6374 fi
5e8754f9 6375done
c8693053
RO
6376 done
6377IFS=$as_save_IFS
5e8754f9 6378
c971b7fa 6379fi
c8693053
RO
6380fi
6381RANLIB=$ac_cv_prog_RANLIB
6382if test -n "$RANLIB"; then
6383 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6384$as_echo "$RANLIB" >&6; }
c0c3707f 6385else
c8693053
RO
6386 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6387$as_echo "no" >&6; }
5e8754f9 6388fi
c0c3707f 6389
c8693053
RO
6390
6391fi
6392if test -z "$ac_cv_prog_RANLIB"; then
6393 ac_ct_RANLIB=$RANLIB
6394 # Extract the first word of "ranlib", so it can be a program name with args.
6395set dummy ranlib; ac_word=$2
6396{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6397$as_echo_n "checking for $ac_word... " >&6; }
6398if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
6399 $as_echo_n "(cached) " >&6
6400else
c8693053
RO
6401 if test -n "$ac_ct_RANLIB"; then
6402 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6403else
6404as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6405for as_dir in $PATH
6406do
6407 IFS=$as_save_IFS
6408 test -z "$as_dir" && as_dir=.
6409 for ac_exec_ext in '' $ac_executable_extensions; do
6410 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6411 ac_cv_prog_ac_ct_RANLIB="ranlib"
6412 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6413 break 2
5e8754f9
SDJ
6414 fi
6415done
c8693053
RO
6416 done
6417IFS=$as_save_IFS
5e8754f9
SDJ
6418
6419fi
6420fi
c8693053
RO
6421ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6422if test -n "$ac_ct_RANLIB"; then
6423 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6424$as_echo "$ac_ct_RANLIB" >&6; }
6425else
6426 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6427$as_echo "no" >&6; }
6428fi
c0c3707f 6429
c8693053
RO
6430 if test "x$ac_ct_RANLIB" = x; then
6431 RANLIB=":"
6432 else
6433 case $cross_compiling:$ac_tool_warned in
6434yes:)
6435{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6436$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6437ac_tool_warned=yes ;;
6438esac
6439 RANLIB=$ac_ct_RANLIB
6440 fi
6441else
6442 RANLIB="$ac_cv_prog_RANLIB"
5e8754f9
SDJ
6443fi
6444
c8693053 6445 fi
c0c3707f 6446 fi
5e8754f9 6447
5e8754f9 6448
5e8754f9 6449
5e8754f9
SDJ
6450
6451
5e8754f9 6452
c8693053
RO
6453 # IEEE behaviour is the default on all CPUs except Alpha and SH
6454 # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
6455 # and the GCC 4.1.2 manual).
6456 case "$host_cpu" in
6457 alpha*)
6458 # On Alpha systems, a compiler option provides the behaviour.
6459 # See the ieee(3) manual page, also available at
6460 # <https://backdrift.org/man/tru64/man3/ieee.3.html>
6461 if test -n "$GCC"; then
6462 # GCC has the option -mieee.
6463 # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
6464 CPPFLAGS="$CPPFLAGS -mieee"
6465 else
6466 # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
6467 # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
6468 CPPFLAGS="$CPPFLAGS -ieee"
6469 fi
6470 ;;
6471 sh*)
6472 if test -n "$GCC"; then
6473 # GCC has the option -mieee.
6474 CPPFLAGS="$CPPFLAGS -mieee"
6475 fi
6476 ;;
6477 esac
c0c3707f 6478
c971b7fa 6479
c971b7fa 6480
c8693053
RO
6481
6482
6483
6484
6485 # Check whether --enable-threads was given.
6486if test "${enable_threads+set}" = set; then :
6487 enableval=$enable_threads; gl_use_threads=$enableval
5e8754f9 6488else
c8693053
RO
6489 if test -n "$gl_use_threads_default"; then
6490 gl_use_threads="$gl_use_threads_default"
6491 else
6492 case "$host_os" in
6493 osf*) gl_use_threads=no ;;
6494 cygwin*)
6495 case `uname -r` in
6496 1.[0-5].*) gl_use_threads=no ;;
6497 *) gl_use_threads=yes ;;
6498 esac
6499 ;;
6500 mingw*)
6501 case "$gl_use_winpthreads_default" in
6502 yes) gl_use_threads=posix ;;
6503 no) gl_use_threads=windows ;;
6504 *) gl_use_threads=yes ;;
6505 esac
6506 ;;
6507 *) gl_use_threads=yes ;;
6508 esac
6509 fi
c971b7fa 6510
5e8754f9 6511fi
c0c3707f 6512
c8693053
RO
6513 if test "$gl_use_threads" = yes \
6514 || test "$gl_use_threads" = isoc \
6515 || test "$gl_use_threads" = posix \
6516 || test "$gl_use_threads" = isoc+posix; then
6517 # For using <threads.h> or <pthread.h>:
6518
6519
6520 if test -z "$gl_anythreadlib_early_done"; then
6521 case "$host_os" in
6522 osf*)
6523 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
6524 # groks <pthread.h>. cc also understands the flag -pthread, but
6525 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
6526 # 2. putting a flag into CPPFLAGS that has an effect on the linker
6527 # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
6528 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
6529 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
6530 ;;
6531 esac
6532 # Some systems optimize for single-threaded programs by default, and
6533 # need special flags to disable these optimizations. For example, the
6534 # definition of 'errno' in <errno.h>.
6535 case "$host_os" in
6536 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
6537 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
6538 esac
6539 gl_anythreadlib_early_done=done
5e8754f9 6540 fi
c0c3707f 6541
c8693053 6542 fi
c0c3707f 6543
c0c3707f 6544
c971b7fa 6545
c8693053
RO
6546 # Pre-early section.
6547
6548
6549
6550
6551 # Code from module absolute-header:
6552 # Code from module alloca:
6553 # Code from module alloca-opt:
6554 # Code from module arpa_inet:
6555 # Code from module assure:
6556 # Code from module at-internal:
698be2d8
CB
6557 # Code from module attribute:
6558 # Code from module btowc:
c8693053
RO
6559 # Code from module builtin-expect:
6560 # Code from module c99:
6561 # Code from module canonicalize-lgpl:
6562 # Code from module chdir:
6563 # Code from module chdir-long:
6564 # Code from module cloexec:
6565 # Code from module close:
6566 # Code from module closedir:
6567 # Code from module count-one-bits:
698be2d8 6568 # Code from module ctype:
c8693053
RO
6569 # Code from module d-ino:
6570 # Code from module d-type:
6571 # Code from module dirent:
6572 # Code from module dirfd:
6573 # Code from module dirname-lgpl:
c8693053
RO
6574 # Code from module double-slash-root:
6575 # Code from module dup:
6576 # Code from module dup2:
6577 # Code from module environ:
6578 # Code from module errno:
6579 # Code from module error:
6580 # Code from module exitfail:
6581 # Code from module extensions:
6582 # Code from module extern-inline:
6583 # Code from module fchdir:
6584 # Code from module fcntl:
6585 # Code from module fcntl-h:
6586 # Code from module fd-hook:
6587 # Code from module fd-safer-flag:
6588 # Code from module fdopendir:
6589 # Code from module filename:
6590 # Code from module filenamecat-lgpl:
6591 # Code from module flexmember:
6592 # Code from module float:
6593 # Code from module fnmatch:
6594 # Code from module fnmatch-gnu:
6595 # Code from module fnmatch-h:
6596 # Code from module fpieee:
6597
6598 # Code from module fpucw:
6599 # Code from module frexp:
6600 # Code from module frexpl:
6601 # Code from module fstat:
6602 # Code from module fstatat:
6603 # Code from module getcwd:
6604 # Code from module getcwd-lgpl:
6605 # Code from module getdtablesize:
6606 # Code from module getlogin_r:
6607 # Code from module getprogname:
698be2d8 6608 # Code from module getrandom:
c8693053
RO
6609 # Code from module gettext-h:
6610 # Code from module gettimeofday:
6611 # Code from module glob:
6612 # Code from module glob-h:
6613 # Code from module hard-locale:
6614 # Code from module include_next:
6615 # Code from module inet_ntop:
6616 # Code from module intprops:
6617 # Code from module inttypes:
6618 # Code from module inttypes-incomplete:
698be2d8 6619 # Code from module isblank:
c8693053
RO
6620 # Code from module isnand-nolibm:
6621 # Code from module isnanl-nolibm:
6622 # Code from module largefile:
6623
6624 # Code from module libc-config:
6625 # Code from module limits-h:
6626 # Code from module localcharset:
6627 # Code from module locale:
6628 # Code from module localtime-buffer:
6629 # Code from module lock:
6630 # Code from module lstat:
6631 # Code from module malloc-posix:
6632 # Code from module malloca:
6633 # Code from module math:
6634 # Code from module mbrtowc:
6635 # Code from module mbsinit:
6636 # Code from module mbsrtowcs:
698be2d8 6637 # Code from module mbtowc:
c8693053
RO
6638 # Code from module memchr:
6639 # Code from module memmem:
6640 # Code from module memmem-simple:
6641 # Code from module mempcpy:
6642 # Code from module memrchr:
698be2d8 6643 # Code from module minmax:
c8693053
RO
6644 # Code from module mkdir:
6645 # Code from module mkdtemp:
6646 # Code from module mkostemp:
6647 # Code from module msvc-inval:
6648 # Code from module msvc-nothrow:
6649 # Code from module multiarch:
6650 # Code from module netinet_in:
6651 # Code from module nocrash:
6652 # Code from module open:
6653 # Code from module openat:
6654 # Code from module openat-die:
6655 # Code from module openat-h:
6656 # Code from module opendir:
6657 # Code from module pathmax:
6658 # Code from module rawmemchr:
6659 # Code from module readdir:
6660 # Code from module readlink:
6661 # Code from module realloc-posix:
6662 # Code from module rename:
6663 # Code from module rewinddir:
6664 # Code from module rmdir:
6665 # Code from module same-inode:
6666 # Code from module save-cwd:
6667 # Code from module scratch_buffer:
6668 # Code from module setenv:
6669 # Code from module setlocale-null:
6670 # Code from module signal-h:
6671 # Code from module snippet/_Noreturn:
6672 # Code from module snippet/arg-nonnull:
6673 # Code from module snippet/c++defs:
6674 # Code from module snippet/warn-on-use:
6675 # Code from module socklen:
6676 # Code from module ssize_t:
6677 # Code from module stat:
6678 # Code from module stat-time:
6679 # Code from module std-gnu11:
6680 # Code from module stdalign:
6681 # Code from module stdbool:
6682 # Code from module stddef:
6683 # Code from module stdint:
6684 # Code from module stdio:
6685 # Code from module stdlib:
6686 # Code from module strchrnul:
6687 # Code from module strdup-posix:
6688 # Code from module streq:
6689 # Code from module strerror:
6690 # Code from module strerror-override:
6691 # Code from module strerror_r-posix:
6692 # Code from module string:
698be2d8 6693 # Code from module strnlen:
c8693053
RO
6694 # Code from module strnlen1:
6695 # Code from module strstr:
6696 # Code from module strstr-simple:
6697 # Code from module strtok_r:
698be2d8 6698 # Code from module sys_random:
c8693053
RO
6699 # Code from module sys_socket:
6700 # Code from module sys_stat:
6701 # Code from module sys_time:
6702 # Code from module sys_types:
6703 # Code from module sys_uio:
6704 # Code from module tempname:
6705 # Code from module threadlib:
6706
6707
6708
6709 # Code from module time:
6710 # Code from module time_r:
6711 # Code from module unistd:
6712 # Code from module unistd-safer:
6713 # Code from module unsetenv:
6714 # Code from module update-copyright:
6715 # Code from module verify:
6716 # Code from module wchar:
6717 # Code from module wctype-h:
6718 # Code from module windows-mutex:
6719 # Code from module windows-once:
6720 # Code from module windows-recmutex:
6721 # Code from module windows-rwlock:
698be2d8
CB
6722 # Code from module wmemchr:
6723 # Code from module wmempcpy:
c8693053
RO
6724 # Code from module xalloc-oversized:
6725
6726
6727am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
c971b7fa
PA
6728
6729
c0c3707f
CB
6730ac_aux_dir=
6731for ac_dir in .. "$srcdir"/..; do
6732 if test -f "$ac_dir/install-sh"; then
6733 ac_aux_dir=$ac_dir
6734 ac_install_sh="$ac_aux_dir/install-sh -c"
6735 break
6736 elif test -f "$ac_dir/install.sh"; then
6737 ac_aux_dir=$ac_dir
6738 ac_install_sh="$ac_aux_dir/install.sh -c"
6739 break
6740 elif test -f "$ac_dir/shtool"; then
6741 ac_aux_dir=$ac_dir
6742 ac_install_sh="$ac_aux_dir/shtool install -c"
6743 break
6744 fi
6745done
6746if test -z "$ac_aux_dir"; then
6747 as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5
6748fi
6749
6750# These three variables are undocumented and unsupported,
6751# and are intended to be withdrawn in a future Autoconf release.
6752# They can cause serious problems if a builder's source tree is in a directory
6753# whose full name contains unusual characters.
6754ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
6755ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
6756ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
698be2d8 6767
c0c3707f
CB
6768 # Check whether --enable-cross-guesses was given.
6769if test "${enable_cross_guesses+set}" = set; then :
6770 enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
6771 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
6772$as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
6773 enableval=conservative
6774 fi
6775 gl_cross_guesses="$enableval"
6776else
6777 gl_cross_guesses=conservative
6778fi
6779
6780 if test $gl_cross_guesses = risky; then
6781 gl_cross_guess_normal="guessing yes"
6782 gl_cross_guess_inverted="guessing no"
6783 else
6784 gl_cross_guess_normal="guessing no"
6785 gl_cross_guess_inverted="guessing yes"
6786 fi
6787 LIBC_FATAL_STDERR_=1
6788 export LIBC_FATAL_STDERR_
6789
5df4cba6 6790
c0c3707f
CB
6791ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
6792if test "x$ac_cv_type_size_t" = xyes; then :
6793
6794else
6795
6796cat >>confdefs.h <<_ACEOF
6797#define size_t unsigned int
6798_ACEOF
6799
6800fi
6801
6802# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
6803# for constant arguments. Useless!
6804{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
6805$as_echo_n "checking for working alloca.h... " >&6; }
6806if ${ac_cv_working_alloca_h+:} false; then :
6807 $as_echo_n "(cached) " >&6
6808else
6809 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6810/* end confdefs.h. */
6811#include <alloca.h>
5e8754f9
SDJ
6812int
6813main ()
6814{
c0c3707f
CB
6815char *p = (char *) alloca (2 * sizeof (int));
6816 if (p) return 0;
5e8754f9
SDJ
6817 ;
6818 return 0;
6819}
6820_ACEOF
c0c3707f
CB
6821if ac_fn_c_try_link "$LINENO"; then :
6822 ac_cv_working_alloca_h=yes
6823else
6824 ac_cv_working_alloca_h=no
5e8754f9 6825fi
c0c3707f
CB
6826rm -f core conftest.err conftest.$ac_objext \
6827 conftest$ac_exeext conftest.$ac_ext
5e8754f9 6828fi
c0c3707f
CB
6829{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
6830$as_echo "$ac_cv_working_alloca_h" >&6; }
6831if test $ac_cv_working_alloca_h = yes; then
c971b7fa 6832
c0c3707f 6833$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
c971b7fa 6834
c0c3707f 6835fi
d0ac1c44 6836
c0c3707f
CB
6837{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
6838$as_echo_n "checking for alloca... " >&6; }
6839if ${ac_cv_func_alloca_works+:} false; then :
5e8754f9
SDJ
6840 $as_echo_n "(cached) " >&6
6841else
6842 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6843/* end confdefs.h. */
c0c3707f
CB
6844#ifdef __GNUC__
6845# define alloca __builtin_alloca
6846#else
6847# ifdef _MSC_VER
6848# include <malloc.h>
6849# define alloca _alloca
6850# else
6851# ifdef HAVE_ALLOCA_H
6852# include <alloca.h>
6853# else
6854# ifdef _AIX
6855 #pragma alloca
6856# else
6857# ifndef alloca /* predefined by HP cc +Olibcalls */
6858void *alloca (size_t);
6859# endif
6860# endif
6861# endif
6862# endif
6863#endif
d0ac1c44 6864
5e8754f9
SDJ
6865int
6866main ()
6867{
c0c3707f
CB
6868char *p = (char *) alloca (1);
6869 if (p) return 0;
5e8754f9
SDJ
6870 ;
6871 return 0;
6872}
6873_ACEOF
c0c3707f
CB
6874if ac_fn_c_try_link "$LINENO"; then :
6875 ac_cv_func_alloca_works=yes
6876else
6877 ac_cv_func_alloca_works=no
5e8754f9 6878fi
c0c3707f
CB
6879rm -f core conftest.err conftest.$ac_objext \
6880 conftest$ac_exeext conftest.$ac_ext
6881fi
6882{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
6883$as_echo "$ac_cv_func_alloca_works" >&6; }
7a6dbc2f 6884
c0c3707f 6885if test $ac_cv_func_alloca_works = yes; then
7a6dbc2f 6886
c0c3707f 6887$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
7a6dbc2f 6888
5e8754f9 6889else
c0c3707f
CB
6890 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
6891# that cause trouble. Some versions do not even contain alloca or
6892# contain a buggy version. If you still want to use their alloca,
6893# use ar to extract alloca.o from them instead of compiling alloca.c.
c971b7fa
PA
6894
6895
7a6dbc2f 6896
73cc7272
TT
6897
6898
c0c3707f 6899ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
73cc7272 6900
c0c3707f 6901$as_echo "#define C_ALLOCA 1" >>confdefs.h
73cc7272
TT
6902
6903
c0c3707f
CB
6904{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
6905$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
6906if ${ac_cv_os_cray+:} false; then :
6907 $as_echo_n "(cached) " >&6
6908else
6909 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6910/* end confdefs.h. */
6911#if defined CRAY && ! defined CRAY2
6912webecray
6913#else
6914wenotbecray
6915#endif
73cc7272 6916
73cc7272 6917_ACEOF
c0c3707f
CB
6918if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6919 $EGREP "webecray" >/dev/null 2>&1; then :
6920 ac_cv_os_cray=yes
6921else
6922 ac_cv_os_cray=no
73cc7272 6923fi
c0c3707f 6924rm -f conftest*
73cc7272 6925
c0c3707f
CB
6926fi
6927{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
6928$as_echo "$ac_cv_os_cray" >&6; }
6929if test $ac_cv_os_cray = yes; then
6930 for ac_func in _getb67 GETB67 getb67; do
6931 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
6932ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
6933if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
73cc7272 6934
c0c3707f
CB
6935cat >>confdefs.h <<_ACEOF
6936#define CRAY_STACKSEG_END $ac_func
6937_ACEOF
73cc7272 6938
c0c3707f
CB
6939 break
6940fi
73cc7272 6941
c0c3707f 6942 done
73cc7272
TT
6943fi
6944
c0c3707f
CB
6945{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
6946$as_echo_n "checking stack direction for C alloca... " >&6; }
6947if ${ac_cv_c_stack_direction+:} false; then :
73cc7272
TT
6948 $as_echo_n "(cached) " >&6
6949else
c0c3707f
CB
6950 if test "$cross_compiling" = yes; then :
6951 ac_cv_c_stack_direction=0
6952else
6953 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 6954/* end confdefs.h. */
c0c3707f
CB
6955$ac_includes_default
6956int
6957find_stack_direction (int *addr, int depth)
6958{
6959 int dir, dummy = 0;
6960 if (! addr)
6961 addr = &dummy;
6962 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
6963 dir = depth ? find_stack_direction (addr, depth - 1) : 0;
6964 return dir + dummy;
6965}
73cc7272 6966
73cc7272 6967int
c0c3707f 6968main (int argc, char **argv)
73cc7272 6969{
c0c3707f 6970 return find_stack_direction (0, argc + !argv + 20) < 0;
73cc7272
TT
6971}
6972_ACEOF
c0c3707f
CB
6973if ac_fn_c_try_run "$LINENO"; then :
6974 ac_cv_c_stack_direction=1
6975else
6976 ac_cv_c_stack_direction=-1
73cc7272 6977fi
c0c3707f
CB
6978rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
6979 conftest.$ac_objext conftest.beam conftest.$ac_ext
73cc7272 6980fi
73cc7272 6981
73cc7272 6982fi
c0c3707f
CB
6983{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
6984$as_echo "$ac_cv_c_stack_direction" >&6; }
6985cat >>confdefs.h <<_ACEOF
6986#define STACK_DIRECTION $ac_cv_c_stack_direction
6987_ACEOF
6988
73cc7272
TT
6989
6990fi
6991
73cc7272 6992
c0c3707f
CB
6993 GNULIB_INET_NTOP=0;
6994 GNULIB_INET_PTON=0;
6995 HAVE_DECL_INET_NTOP=1;
6996 HAVE_DECL_INET_PTON=1;
6997 REPLACE_INET_NTOP=0;
6998 REPLACE_INET_PTON=0;
73cc7272 6999
73cc7272 7000
c0c3707f
CB
7001
7002
7003 for ac_header in $ac_header_list
7004do :
7005 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7006ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7007"
7008if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7009 cat >>confdefs.h <<_ACEOF
7010#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7011_ACEOF
7012
73cc7272
TT
7013fi
7014
c0c3707f 7015done
73cc7272 7016
c0c3707f
CB
7017
7018
7019
7020
7021 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
7022$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
7023if ${gl_cv_have_include_next+:} false; then :
73cc7272
TT
7024 $as_echo_n "(cached) " >&6
7025else
c0c3707f
CB
7026 rm -rf conftestd1a conftestd1b conftestd2
7027 mkdir conftestd1a conftestd1b conftestd2
7028 cat <<EOF > conftestd1a/conftest.h
7029#define DEFINED_IN_CONFTESTD1
7030#include_next <conftest.h>
7031#ifdef DEFINED_IN_CONFTESTD2
7032int foo;
7033#else
7034#error "include_next doesn't work"
7035#endif
7036EOF
7037 cat <<EOF > conftestd1b/conftest.h
7038#define DEFINED_IN_CONFTESTD1
7039#include <stdio.h>
7040#include_next <conftest.h>
7041#ifdef DEFINED_IN_CONFTESTD2
7042int foo;
7043#else
7044#error "include_next doesn't work"
7045#endif
7046EOF
7047 cat <<EOF > conftestd2/conftest.h
7048#ifndef DEFINED_IN_CONFTESTD1
7049#error "include_next test doesn't work"
7050#endif
7051#define DEFINED_IN_CONFTESTD2
7052EOF
7053 gl_save_CPPFLAGS="$CPPFLAGS"
7054 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
7055 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7056/* end confdefs.h. */
c0c3707f 7057#include <conftest.h>
73cc7272 7058_ACEOF
c0c3707f
CB
7059if ac_fn_c_try_compile "$LINENO"; then :
7060 gl_cv_have_include_next=yes
7061else
7062 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
7063 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7064/* end confdefs.h. */
7065#include <conftest.h>
7066_ACEOF
7067if ac_fn_c_try_compile "$LINENO"; then :
7068 gl_cv_have_include_next=buggy
7069else
7070 gl_cv_have_include_next=no
73cc7272 7071fi
c0c3707f
CB
7072rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7073
73cc7272 7074fi
c0c3707f
CB
7075rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7076 CPPFLAGS="$gl_save_CPPFLAGS"
7077 rm -rf conftestd1a conftestd1b conftestd2
7078
73cc7272 7079fi
c0c3707f
CB
7080{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
7081$as_echo "$gl_cv_have_include_next" >&6; }
7082 PRAGMA_SYSTEM_HEADER=
7083 if test $gl_cv_have_include_next = yes; then
7084 INCLUDE_NEXT=include_next
7085 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7086 if test -n "$GCC"; then
7087 PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
7088 fi
7089 else
7090 if test $gl_cv_have_include_next = buggy; then
7091 INCLUDE_NEXT=include
7092 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7093 else
7094 INCLUDE_NEXT=include
7095 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
7096 fi
73cc7272
TT
7097 fi
7098
73cc7272 7099
73cc7272 7100
c0c3707f
CB
7101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
7102$as_echo_n "checking whether system header files limit the line length... " >&6; }
7103if ${gl_cv_pragma_columns+:} false; then :
73cc7272
TT
7104 $as_echo_n "(cached) " >&6
7105else
c0c3707f 7106 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7107/* end confdefs.h. */
73cc7272 7108
c0c3707f
CB
7109#ifdef __TANDEM
7110choke me
7111#endif
73cc7272 7112
73cc7272 7113_ACEOF
c0c3707f
CB
7114if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7115 $EGREP "choke me" >/dev/null 2>&1; then :
7116 gl_cv_pragma_columns=yes
7117else
7118 gl_cv_pragma_columns=no
73cc7272 7119fi
c0c3707f 7120rm -f conftest*
73cc7272 7121
73cc7272
TT
7122
7123fi
c0c3707f
CB
7124{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
7125$as_echo "$gl_cv_pragma_columns" >&6; }
7126 if test $gl_cv_pragma_columns = yes; then
7127 PRAGMA_COLUMNS="#pragma COLUMNS 10000"
7128 else
7129 PRAGMA_COLUMNS=
7130 fi
73cc7272
TT
7131
7132
7133
73cc7272 7134
73cc7272
TT
7135
7136
c0c3707f
CB
7137 if test $ac_cv_header_features_h = yes; then
7138 HAVE_FEATURES_H=1
7139 else
7140 HAVE_FEATURES_H=0
7141 fi
73cc7272 7142
7a6dbc2f
SDJ
7143
7144
7145
7146
c0c3707f
CB
7147 if test $ac_cv_header_sys_socket_h = no; then
7148 for ac_header in ws2tcpip.h
7149do :
7150 ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
7151if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
7152 cat >>confdefs.h <<_ACEOF
7153#define HAVE_WS2TCPIP_H 1
7154_ACEOF
7a6dbc2f 7155
c0c3707f 7156fi
7a6dbc2f 7157
c0c3707f 7158done
7a6dbc2f 7159
c0c3707f 7160 fi
7a6dbc2f 7161
c0c3707f
CB
7162{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7163$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7164if test -z "$MKDIR_P"; then
7165 if ${ac_cv_path_mkdir+:} false; then :
7166 $as_echo_n "(cached) " >&6
5e8754f9 7167else
c0c3707f
CB
7168 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7169for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7170do
7171 IFS=$as_save_IFS
7172 test -z "$as_dir" && as_dir=.
7173 for ac_prog in mkdir gmkdir; do
7174 for ac_exec_ext in '' $ac_executable_extensions; do
7175 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7176 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7177 'mkdir (GNU coreutils) '* | \
7178 'mkdir (coreutils) '* | \
7179 'mkdir (fileutils) '4.1*)
7180 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7181 break 3;;
7182 esac
7183 done
7184 done
7185 done
7186IFS=$as_save_IFS
7a6dbc2f 7187
5e8754f9 7188fi
7a6dbc2f 7189
c0c3707f
CB
7190 test -d ./--version && rmdir ./--version
7191 if test "${ac_cv_path_mkdir+set}" = set; then
7192 MKDIR_P="$ac_cv_path_mkdir -p"
7193 else
7194 # As a last resort, use the slow shell script. Don't cache a
7195 # value for MKDIR_P within a source directory, because that will
7196 # break other packages using the cache if that directory is
7197 # removed, or if the value is a relative name.
7198 MKDIR_P="$ac_install_sh -d"
7199 fi
5e8754f9 7200fi
c0c3707f
CB
7201{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7202$as_echo "$MKDIR_P" >&6; }
7a6dbc2f 7203
5e8754f9 7204
698be2d8
CB
7205 GNULIB_BTOWC=0;
7206 GNULIB_WCTOB=0;
7207 GNULIB_MBSINIT=0;
7208 GNULIB_MBRTOWC=0;
7209 GNULIB_MBRLEN=0;
7210 GNULIB_MBSRTOWCS=0;
7211 GNULIB_MBSNRTOWCS=0;
7212 GNULIB_WCRTOMB=0;
7213 GNULIB_WCSRTOMBS=0;
7214 GNULIB_WCSNRTOMBS=0;
7215 GNULIB_WCWIDTH=0;
7216 GNULIB_WMEMCHR=0;
7217 GNULIB_WMEMCMP=0;
7218 GNULIB_WMEMCPY=0;
7219 GNULIB_WMEMMOVE=0;
7220 GNULIB_WMEMPCPY=0;
7221 GNULIB_WMEMSET=0;
7222 GNULIB_WCSLEN=0;
7223 GNULIB_WCSNLEN=0;
7224 GNULIB_WCSCPY=0;
7225 GNULIB_WCPCPY=0;
7226 GNULIB_WCSNCPY=0;
7227 GNULIB_WCPNCPY=0;
7228 GNULIB_WCSCAT=0;
7229 GNULIB_WCSNCAT=0;
7230 GNULIB_WCSCMP=0;
7231 GNULIB_WCSNCMP=0;
7232 GNULIB_WCSCASECMP=0;
7233 GNULIB_WCSNCASECMP=0;
7234 GNULIB_WCSCOLL=0;
7235 GNULIB_WCSXFRM=0;
7236 GNULIB_WCSDUP=0;
7237 GNULIB_WCSCHR=0;
7238 GNULIB_WCSRCHR=0;
7239 GNULIB_WCSCSPN=0;
7240 GNULIB_WCSSPN=0;
7241 GNULIB_WCSPBRK=0;
7242 GNULIB_WCSSTR=0;
7243 GNULIB_WCSTOK=0;
7244 GNULIB_WCSWIDTH=0;
7245 GNULIB_WCSFTIME=0;
7246 HAVE_BTOWC=1;
7247 HAVE_MBSINIT=1;
7248 HAVE_MBRTOWC=1;
7249 HAVE_MBRLEN=1;
7250 HAVE_MBSRTOWCS=1;
7251 HAVE_MBSNRTOWCS=1;
7252 HAVE_WCRTOMB=1;
7253 HAVE_WCSRTOMBS=1;
7254 HAVE_WCSNRTOMBS=1;
7255 HAVE_WMEMCHR=1;
7256 HAVE_WMEMCMP=1;
7257 HAVE_WMEMCPY=1;
7258 HAVE_WMEMMOVE=1;
7259 HAVE_WMEMPCPY=1;
7260 HAVE_WMEMSET=1;
7261 HAVE_WCSLEN=1;
7262 HAVE_WCSNLEN=1;
7263 HAVE_WCSCPY=1;
7264 HAVE_WCPCPY=1;
7265 HAVE_WCSNCPY=1;
7266 HAVE_WCPNCPY=1;
7267 HAVE_WCSCAT=1;
7268 HAVE_WCSNCAT=1;
7269 HAVE_WCSCMP=1;
7270 HAVE_WCSNCMP=1;
7271 HAVE_WCSCASECMP=1;
7272 HAVE_WCSNCASECMP=1;
7273 HAVE_WCSCOLL=1;
7274 HAVE_WCSXFRM=1;
7275 HAVE_WCSDUP=1;
7276 HAVE_WCSCHR=1;
7277 HAVE_WCSRCHR=1;
7278 HAVE_WCSCSPN=1;
7279 HAVE_WCSSPN=1;
7280 HAVE_WCSPBRK=1;
7281 HAVE_WCSSTR=1;
7282 HAVE_WCSTOK=1;
7283 HAVE_WCSWIDTH=1;
7284 HAVE_WCSFTIME=1;
7285 HAVE_DECL_WCTOB=1;
7286 HAVE_DECL_WCWIDTH=1;
7287 REPLACE_MBSTATE_T=0;
7288 REPLACE_BTOWC=0;
7289 REPLACE_WCTOB=0;
7290 REPLACE_MBSINIT=0;
7291 REPLACE_MBRTOWC=0;
7292 REPLACE_MBRLEN=0;
7293 REPLACE_MBSRTOWCS=0;
7294 REPLACE_MBSNRTOWCS=0;
7295 REPLACE_WCRTOMB=0;
7296 REPLACE_WCSRTOMBS=0;
7297 REPLACE_WCSNRTOMBS=0;
7298 REPLACE_WCWIDTH=0;
7299 REPLACE_WCSWIDTH=0;
7300 REPLACE_WCSFTIME=0;
7301 REPLACE_WCSTOK=0;
7302
7303
7304 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
7305$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
7306if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
7307 $as_echo_n "(cached) " >&6
7308else
7309 gl_cv_header_wchar_h_correct_inline=yes
7310 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7311/* end confdefs.h. */
7312
7313 #define wcstod renamed_wcstod
7314/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
7315 <wchar.h>.
7316 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
7317 included before <wchar.h>. */
7318#include <stddef.h>
7319#include <stdio.h>
7320#include <time.h>
7321#include <wchar.h>
7322extern int zero (void);
7323int main () { return zero(); }
7324
7325_ACEOF
7326 save_ac_compile="$ac_compile"
7327 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
7328 if echo '#include "conftest.c"' >conftest1.c &&
7329 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
7330 (eval $ac_compile) 2>&5
7331 ac_status=$?
7332 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7333 test $ac_status = 0; }; then
7334 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7335/* end confdefs.h. */
7336
7337 #define wcstod renamed_wcstod
7338/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
7339 <wchar.h>.
7340 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
7341 included before <wchar.h>. */
7342#include <stddef.h>
7343#include <stdio.h>
7344#include <time.h>
7345#include <wchar.h>
7346int zero (void) { return 0; }
7347
7348_ACEOF
7349 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
7350 if echo '#include "conftest.c"' >conftest2.c &&
7351 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
7352 (eval $ac_compile) 2>&5
7353 ac_status=$?
7354 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7355 test $ac_status = 0; }; then
7356 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
7357 :
7358 else
7359 gl_cv_header_wchar_h_correct_inline=no
7360 fi
7361 fi
7362 fi
7363 ac_compile="$save_ac_compile"
7364 rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
7365
7366fi
7367{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
7368$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
7369 if test $gl_cv_header_wchar_h_correct_inline = no; then
7370 as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
7371This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
7372C99 mode. You have four options:
7373 - Add the flag -fgnu89-inline to CC and reconfigure, or
7374 - Fix your include files, using parts of
7375 <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
7376 - Use a gcc version older than 4.3, or
7377 - Don't use the flags -std=c99 or -std=gnu99.
7378Configuration aborted." "$LINENO" 5
7379 fi
7380
7381
7382
7383
7384 for ac_func in $ac_func_list
7385do :
7386 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
7387ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
7388if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
7389 cat >>confdefs.h <<_ACEOF
7390#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
7391_ACEOF
7392
7393fi
7394done
7395
7396
7397
7398
7399 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
7400$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
7401if ${am_cv_langinfo_codeset+:} false; then :
7402 $as_echo_n "(cached) " >&6
7403else
7404 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7405/* end confdefs.h. */
7406#include <langinfo.h>
7407int
7408main ()
7409{
7410char* cs = nl_langinfo(CODESET); return !cs;
7411 ;
7412 return 0;
7413}
7414_ACEOF
7415if ac_fn_c_try_link "$LINENO"; then :
7416 am_cv_langinfo_codeset=yes
7417else
7418 am_cv_langinfo_codeset=no
7419fi
7420rm -f core conftest.err conftest.$ac_objext \
7421 conftest$ac_exeext conftest.$ac_ext
7422
7423fi
7424{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
7425$as_echo "$am_cv_langinfo_codeset" >&6; }
7426 if test $am_cv_langinfo_codeset = yes; then
7427
7428$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
7429
7430 fi
7431
7432
7433
7434
7435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
7436$as_echo_n "checking for a traditional french locale... " >&6; }
7437if ${gt_cv_locale_fr+:} false; then :
7438 $as_echo_n "(cached) " >&6
7439else
7440
7441 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7442/* end confdefs.h. */
7443
7444#include <locale.h>
7445#include <time.h>
7446#if HAVE_LANGINFO_CODESET
7447# include <langinfo.h>
7448#endif
7449#include <stdlib.h>
7450#include <string.h>
7451struct tm t;
7452char buf[16];
7453int main () {
7454 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
7455 imitates locale dependent behaviour by looking at the environment
7456 variables, and all locales use the UTF-8 encoding. */
7457#if defined __BEOS__ || defined __HAIKU__
7458 return 1;
7459#else
7460 /* Check whether the given locale name is recognized by the system. */
7461# if defined _WIN32 && !defined __CYGWIN__
7462 /* On native Windows, setlocale(category, "") looks at the system settings,
7463 not at the environment variables. Also, when an encoding suffix such
7464 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
7465 category of the locale to "C". */
7466 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
7467 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
7468 return 1;
7469# else
7470 if (setlocale (LC_ALL, "") == NULL) return 1;
7471# endif
7472 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
7473 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
7474 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
7475 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
7476 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
7477 some unit tests fail.
7478 On MirBSD 10, when an unsupported locale is specified, setlocale()
7479 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
7480# if HAVE_LANGINFO_CODESET
7481 {
7482 const char *cs = nl_langinfo (CODESET);
7483 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
7484 || strcmp (cs, "UTF-8") == 0)
7485 return 1;
7486 }
7487# endif
7488# ifdef __CYGWIN__
7489 /* On Cygwin, avoid locale names without encoding suffix, because the
7490 locale_charset() function relies on the encoding suffix. Note that
7491 LC_ALL is set on the command line. */
7492 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
7493# endif
7494 /* Check whether in the abbreviation of the second month, the second
7495 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
7496 one byte long. This excludes the UTF-8 encoding. */
7497 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
7498 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
7499# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
7500 /* Check whether the decimal separator is a comma.
7501 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
7502 are nl_langinfo(RADIXCHAR) are both ".". */
7503 if (localeconv () ->decimal_point[0] != ',') return 1;
7504# endif
7505 return 0;
7506#endif
7507}
7508
7509_ACEOF
7510 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
7511 (eval $ac_link) 2>&5
7512 ac_status=$?
7513 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7514 test $ac_status = 0; } && test -s conftest$ac_exeext; then
7515 case "$host_os" in
7516 # Handle native Windows specially, because there setlocale() interprets
7517 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
7518 # "fr" or "fra" as "French" or "French_France.1252",
7519 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
7520 # "ja" as "Japanese" or "Japanese_Japan.932",
7521 # and similar.
7522 mingw*)
7523 # Test for the native Windows locale name.
7524 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7525 gt_cv_locale_fr=French_France.1252
7526 else
7527 # None found.
7528 gt_cv_locale_fr=none
7529 fi
7530 ;;
7531 *)
7532 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
7533 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
7534 # configure script would override the LC_ALL setting. Likewise for
7535 # LC_CTYPE, which is also set at the beginning of the configure script.
7536 # Test for the usual locale name.
7537 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7538 gt_cv_locale_fr=fr_FR
7539 else
7540 # Test for the locale name with explicit encoding suffix.
7541 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7542 gt_cv_locale_fr=fr_FR.ISO-8859-1
7543 else
7544 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
7545 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7546 gt_cv_locale_fr=fr_FR.ISO8859-1
7547 else
7548 # Test for the HP-UX locale name.
7549 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7550 gt_cv_locale_fr=fr_FR.iso88591
7551 else
7552 # Test for the Solaris 7 locale name.
7553 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7554 gt_cv_locale_fr=fr
7555 else
7556 # None found.
7557 gt_cv_locale_fr=none
7558 fi
7559 fi
7560 fi
7561 fi
7562 fi
7563 ;;
7564 esac
7565 fi
7566 rm -fr conftest*
7567
7568fi
7569{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
7570$as_echo "$gt_cv_locale_fr" >&6; }
7571 LOCALE_FR=$gt_cv_locale_fr
7572
7573
7574
7575 GNULIB__EXIT=0;
7576 GNULIB_ATOLL=0;
7577 GNULIB_CALLOC_POSIX=0;
7578 GNULIB_CANONICALIZE_FILE_NAME=0;
7579 GNULIB_GETLOADAVG=0;
7580 GNULIB_GETSUBOPT=0;
7581 GNULIB_GRANTPT=0;
7582 GNULIB_MALLOC_POSIX=0;
7583 GNULIB_MBTOWC=0;
7584 GNULIB_MKDTEMP=0;
7585 GNULIB_MKOSTEMP=0;
7586 GNULIB_MKOSTEMPS=0;
7587 GNULIB_MKSTEMP=0;
7588 GNULIB_MKSTEMPS=0;
7589 GNULIB_POSIX_OPENPT=0;
7590 GNULIB_PTSNAME=0;
7591 GNULIB_PTSNAME_R=0;
7592 GNULIB_PUTENV=0;
7593 GNULIB_QSORT_R=0;
7594 GNULIB_RANDOM=0;
7595 GNULIB_RANDOM_R=0;
7596 GNULIB_REALLOCARRAY=0;
7597 GNULIB_REALLOC_POSIX=0;
7598 GNULIB_REALPATH=0;
7599 GNULIB_RPMATCH=0;
7600 GNULIB_SECURE_GETENV=0;
7601 GNULIB_SETENV=0;
7602 GNULIB_STRTOD=0;
7603 GNULIB_STRTOLD=0;
7604 GNULIB_STRTOLL=0;
7605 GNULIB_STRTOULL=0;
7606 GNULIB_SYSTEM_POSIX=0;
7607 GNULIB_UNLOCKPT=0;
7608 GNULIB_UNSETENV=0;
7609 GNULIB_WCTOMB=0;
7610 HAVE__EXIT=1;
7611 HAVE_ATOLL=1;
7612 HAVE_CANONICALIZE_FILE_NAME=1;
7613 HAVE_DECL_GETLOADAVG=1;
7614 HAVE_GETSUBOPT=1;
7615 HAVE_GRANTPT=1;
7616 HAVE_INITSTATE=1;
7617 HAVE_DECL_INITSTATE=1;
7618 HAVE_MBTOWC=1;
7619 HAVE_MKDTEMP=1;
7620 HAVE_MKOSTEMP=1;
7621 HAVE_MKOSTEMPS=1;
7622 HAVE_MKSTEMP=1;
7623 HAVE_MKSTEMPS=1;
7624 HAVE_POSIX_OPENPT=1;
7625 HAVE_PTSNAME=1;
7626 HAVE_PTSNAME_R=1;
c0c3707f
CB
7627 HAVE_QSORT_R=1;
7628 HAVE_RANDOM=1;
7629 HAVE_RANDOM_H=1;
7630 HAVE_RANDOM_R=1;
7631 HAVE_REALLOCARRAY=1;
7632 HAVE_REALPATH=1;
7633 HAVE_RPMATCH=1;
7634 HAVE_SECURE_GETENV=1;
7635 HAVE_SETENV=1;
7636 HAVE_DECL_SETENV=1;
7637 HAVE_SETSTATE=1;
7638 HAVE_DECL_SETSTATE=1;
7639 HAVE_STRTOD=1;
7640 HAVE_STRTOLD=1;
7641 HAVE_STRTOLL=1;
7642 HAVE_STRTOULL=1;
7643 HAVE_STRUCT_RANDOM_DATA=1;
7644 HAVE_SYS_LOADAVG_H=0;
7645 HAVE_UNLOCKPT=1;
7646 HAVE_DECL_UNSETENV=1;
7647 REPLACE_CALLOC=0;
7648 REPLACE_CANONICALIZE_FILE_NAME=0;
7649 REPLACE_INITSTATE=0;
7650 REPLACE_MALLOC=0;
7651 REPLACE_MBTOWC=0;
7652 REPLACE_MKSTEMP=0;
7653 REPLACE_PTSNAME=0;
7654 REPLACE_PTSNAME_R=0;
7655 REPLACE_PUTENV=0;
7656 REPLACE_QSORT_R=0;
7657 REPLACE_RANDOM=0;
7658 REPLACE_RANDOM_R=0;
7659 REPLACE_REALLOC=0;
7660 REPLACE_REALPATH=0;
7661 REPLACE_SETENV=0;
7662 REPLACE_SETSTATE=0;
7663 REPLACE_STRTOD=0;
7664 REPLACE_STRTOLD=0;
7665 REPLACE_UNSETENV=0;
7666 REPLACE_WCTOMB=0;
7a6dbc2f 7667
7a6dbc2f 7668
98399780 7669
98399780 7670
472fa5ee
SM
7671
7672
7673
7674
7675
c0c3707f
CB
7676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
7677$as_echo_n "checking whether // is distinct from /... " >&6; }
7678if ${gl_cv_double_slash_root+:} false; then :
7679 $as_echo_n "(cached) " >&6
5e8754f9 7680else
c0c3707f
CB
7681 if test x"$cross_compiling" = xyes ; then
7682 # When cross-compiling, there is no way to tell whether // is special
7683 # short of a list of hosts. However, the only known hosts to date
7684 # that have a distinct // are Apollo DomainOS (too old to port to),
7685 # Cygwin, and z/OS. If anyone knows of another system for which // has
7686 # special semantics and is distinct from /, please report it to
7687 # <bug-gnulib@gnu.org>.
7688 case $host in
7689 *-cygwin | i370-ibm-openedition)
7690 gl_cv_double_slash_root=yes ;;
7691 *)
7692 # Be optimistic and assume that / and // are the same when we
7693 # don't know.
7694 gl_cv_double_slash_root='unknown, assuming no' ;;
7695 esac
7696 else
7697 set x `ls -di / // 2>/dev/null`
7698 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
7699 gl_cv_double_slash_root=no
7700 else
7701 gl_cv_double_slash_root=yes
7702 fi
7703 fi
5e8754f9 7704fi
c0c3707f
CB
7705{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
7706$as_echo "$gl_cv_double_slash_root" >&6; }
7707 if test "$gl_cv_double_slash_root" = yes; then
472fa5ee 7708
c0c3707f 7709$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
472fa5ee 7710
c0c3707f 7711 fi
472fa5ee
SM
7712
7713
472fa5ee 7714
c0c3707f
CB
7715
7716
7717 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
7718$as_echo_n "checking whether realpath works... " >&6; }
7719if ${gl_cv_func_realpath_works+:} false; then :
5e8754f9
SDJ
7720 $as_echo_n "(cached) " >&6
7721else
c0c3707f
CB
7722
7723 touch conftest.a
7724 mkdir conftest.d
7725 if test "$cross_compiling" = yes; then :
7726 case "$host_os" in
7727 # Guess yes on glibc systems.
7728 *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
7729 # Guess yes on musl systems.
7730 *-musl*) gl_cv_func_realpath_works="guessing yes" ;;
7731 # Guess no on native Windows.
7732 mingw*) gl_cv_func_realpath_works="guessing no" ;;
7733 # If we don't know, obey --enable-cross-guesses.
7734 *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
7735 esac
7736
5e8754f9
SDJ
7737else
7738 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7739/* end confdefs.h. */
c0c3707f
CB
7740
7741
7742
7743#include <stdlib.h>
7744#if defined __MACH__ && defined __APPLE__
7745/* Avoid a crash on Mac OS X. */
7746#include <mach/mach.h>
7747#include <mach/mach_error.h>
7748#include <mach/thread_status.h>
7749#include <mach/exception.h>
7750#include <mach/task.h>
7751#include <pthread.h>
7752/* The exception port on which our thread listens. */
7753static mach_port_t our_exception_port;
7754/* The main function of the thread listening for exceptions of type
7755 EXC_BAD_ACCESS. */
7756static void *
7757mach_exception_thread (void *arg)
5e8754f9 7758{
c0c3707f
CB
7759 /* Buffer for a message to be received. */
7760 struct {
7761 mach_msg_header_t head;
7762 mach_msg_body_t msgh_body;
7763 char data[1024];
7764 } msg;
7765 mach_msg_return_t retval;
7766 /* Wait for a message on the exception port. */
7767 retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
7768 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
7769 if (retval != MACH_MSG_SUCCESS)
7770 abort ();
7771 exit (1);
7772}
7773static void
7774nocrash_init (void)
7775{
7776 mach_port_t self = mach_task_self ();
7777 /* Allocate a port on which the thread shall listen for exceptions. */
7778 if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
7779 == KERN_SUCCESS) {
7780 /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
7781 if (mach_port_insert_right (self, our_exception_port, our_exception_port,
7782 MACH_MSG_TYPE_MAKE_SEND)
7783 == KERN_SUCCESS) {
7784 /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
7785 for us. */
7786 exception_mask_t mask = EXC_MASK_BAD_ACCESS;
7787 /* Create the thread listening on the exception port. */
7788 pthread_attr_t attr;
7789 pthread_t thread;
7790 if (pthread_attr_init (&attr) == 0
7791 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
7792 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
7793 pthread_attr_destroy (&attr);
7794 /* Replace the exception port info for these exceptions with our own.
7795 Note that we replace the exception port for the entire task, not only
7796 for a particular thread. This has the effect that when our exception
7797 port gets the message, the thread specific exception port has already
7798 been asked, and we don't need to bother about it.
7799 See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
7800 task_set_exception_ports (self, mask, our_exception_port,
7801 EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
7802 }
7803 }
7804 }
7805}
7806#elif defined _WIN32 && ! defined __CYGWIN__
7807/* Avoid a crash on native Windows. */
7808#define WIN32_LEAN_AND_MEAN
7809#include <windows.h>
7810#include <winerror.h>
7811static LONG WINAPI
7812exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
7813{
7814 switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
7815 {
7816 case EXCEPTION_ACCESS_VIOLATION:
7817 case EXCEPTION_IN_PAGE_ERROR:
7818 case EXCEPTION_STACK_OVERFLOW:
7819 case EXCEPTION_GUARD_PAGE:
7820 case EXCEPTION_PRIV_INSTRUCTION:
7821 case EXCEPTION_ILLEGAL_INSTRUCTION:
7822 case EXCEPTION_DATATYPE_MISALIGNMENT:
7823 case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
7824 case EXCEPTION_NONCONTINUABLE_EXCEPTION:
7825 exit (1);
7826 }
7827 return EXCEPTION_CONTINUE_SEARCH;
7828}
7829static void
7830nocrash_init (void)
7831{
7832 SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
7833}
7834#else
7835/* Avoid a crash on POSIX systems. */
7836#include <signal.h>
7837#include <unistd.h>
7838/* A POSIX signal handler. */
7839static void
7840exception_handler (int sig)
7841{
7842 _exit (1);
7843}
7844static void
7845nocrash_init (void)
7846{
7847#ifdef SIGSEGV
7848 signal (SIGSEGV, exception_handler);
7849#endif
7850#ifdef SIGBUS
7851 signal (SIGBUS, exception_handler);
7852#endif
5e8754f9 7853}
c0c3707f
CB
7854#endif
7855
7856 #include <stdlib.h>
7857 #include <string.h>
472fa5ee 7858
5e8754f9 7859int
c0c3707f 7860main ()
5e8754f9 7861{
c0c3707f
CB
7862
7863 int result = 0;
7864 {
7865 char *name = realpath ("conftest.a", NULL);
7866 if (!(name && *name == '/'))
7867 result |= 1;
7868 free (name);
7869 }
7870 {
7871 char *name = realpath ("conftest.b/../conftest.a", NULL);
7872 if (name != NULL)
7873 result |= 2;
7874 free (name);
7875 }
7876 {
7877 char *name = realpath ("conftest.a/", NULL);
7878 if (name != NULL)
7879 result |= 4;
7880 free (name);
7881 }
7882 {
7883 char *name1 = realpath (".", NULL);
7884 char *name2 = realpath ("conftest.d//./..", NULL);
7885 if (! name1 || ! name2 || strcmp (name1, name2))
7886 result |= 8;
7887 free (name1);
7888 free (name2);
7889 }
7890 return result;
7891
7892 ;
7893 return 0;
5e8754f9 7894}
c0c3707f 7895
5e8754f9
SDJ
7896_ACEOF
7897if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 7898 gl_cv_func_realpath_works=yes
5e8754f9 7899else
c0c3707f 7900 gl_cv_func_realpath_works=no
5e8754f9
SDJ
7901fi
7902rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7903 conftest.$ac_objext conftest.beam conftest.$ac_ext
7904fi
472fa5ee 7905
c0c3707f 7906 rm -rf conftest.a conftest.d
98399780 7907
5e8754f9 7908fi
c0c3707f
CB
7909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
7910$as_echo "$gl_cv_func_realpath_works" >&6; }
7911 case "$gl_cv_func_realpath_works" in
7912 *yes)
98399780 7913
c0c3707f 7914$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
98399780 7915
c0c3707f
CB
7916 ;;
7917 esac
725e2999
JB
7918
7919
725e2999 7920
725e2999 7921
725e2999
JB
7922
7923
7924
7925
7926
7927
7928
c0c3707f
CB
7929 GNULIB_ACCESS=0;
7930 GNULIB_CHDIR=0;
7931 GNULIB_CHOWN=0;
7932 GNULIB_CLOSE=0;
7933 GNULIB_COPY_FILE_RANGE=0;
7934 GNULIB_DUP=0;
7935 GNULIB_DUP2=0;
7936 GNULIB_DUP3=0;
7937 GNULIB_ENVIRON=0;
7938 GNULIB_EUIDACCESS=0;
7939 GNULIB_FACCESSAT=0;
7940 GNULIB_FCHDIR=0;
7941 GNULIB_FCHOWNAT=0;
7942 GNULIB_FDATASYNC=0;
7943 GNULIB_FSYNC=0;
7944 GNULIB_FTRUNCATE=0;
7945 GNULIB_GETCWD=0;
7946 GNULIB_GETDOMAINNAME=0;
7947 GNULIB_GETDTABLESIZE=0;
698be2d8 7948 GNULIB_GETENTROPY=0;
c0c3707f
CB
7949 GNULIB_GETGROUPS=0;
7950 GNULIB_GETHOSTNAME=0;
7951 GNULIB_GETLOGIN=0;
7952 GNULIB_GETLOGIN_R=0;
5df4cba6 7953 GNULIB_GETOPT_POSIX=0;
c0c3707f
CB
7954 GNULIB_GETPAGESIZE=0;
7955 GNULIB_GETPASS=0;
7956 GNULIB_GETUSERSHELL=0;
7957 GNULIB_GROUP_MEMBER=0;
7958 GNULIB_ISATTY=0;
7959 GNULIB_LCHOWN=0;
7960 GNULIB_LINK=0;
7961 GNULIB_LINKAT=0;
7962 GNULIB_LSEEK=0;
7963 GNULIB_PIPE=0;
7964 GNULIB_PIPE2=0;
7965 GNULIB_PREAD=0;
7966 GNULIB_PWRITE=0;
7967 GNULIB_READ=0;
7968 GNULIB_READLINK=0;
7969 GNULIB_READLINKAT=0;
7970 GNULIB_RMDIR=0;
7971 GNULIB_SETHOSTNAME=0;
7972 GNULIB_SLEEP=0;
7973 GNULIB_SYMLINK=0;
7974 GNULIB_SYMLINKAT=0;
7975 GNULIB_TRUNCATE=0;
7976 GNULIB_TTYNAME_R=0;
7977 GNULIB_UNISTD_H_NONBLOCKING=0;
7978 GNULIB_UNISTD_H_SIGPIPE=0;
7979 GNULIB_UNLINK=0;
7980 GNULIB_UNLINKAT=0;
7981 GNULIB_USLEEP=0;
7982 GNULIB_WRITE=0;
7983 HAVE_CHOWN=1;
7984 HAVE_COPY_FILE_RANGE=1;
7985 HAVE_DUP2=1;
7986 HAVE_DUP3=1;
7987 HAVE_EUIDACCESS=1;
7988 HAVE_FACCESSAT=1;
7989 HAVE_FCHDIR=1;
7990 HAVE_FCHOWNAT=1;
7991 HAVE_FDATASYNC=1;
7992 HAVE_FSYNC=1;
7993 HAVE_FTRUNCATE=1;
7994 HAVE_GETDTABLESIZE=1;
698be2d8 7995 HAVE_GETENTROPY=1;
c0c3707f
CB
7996 HAVE_GETGROUPS=1;
7997 HAVE_GETHOSTNAME=1;
7998 HAVE_GETLOGIN=1;
7999 HAVE_GETPAGESIZE=1;
8000 HAVE_GETPASS=1;
8001 HAVE_GROUP_MEMBER=1;
8002 HAVE_LCHOWN=1;
8003 HAVE_LINK=1;
8004 HAVE_LINKAT=1;
8005 HAVE_PIPE=1;
8006 HAVE_PIPE2=1;
8007 HAVE_PREAD=1;
8008 HAVE_PWRITE=1;
8009 HAVE_READLINK=1;
8010 HAVE_READLINKAT=1;
8011 HAVE_SETHOSTNAME=1;
8012 HAVE_SLEEP=1;
8013 HAVE_SYMLINK=1;
8014 HAVE_SYMLINKAT=1;
8015 HAVE_UNLINKAT=1;
8016 HAVE_USLEEP=1;
8017 HAVE_DECL_ENVIRON=1;
8018 HAVE_DECL_FCHDIR=1;
8019 HAVE_DECL_FDATASYNC=1;
8020 HAVE_DECL_GETDOMAINNAME=1;
8021 HAVE_DECL_GETLOGIN=1;
8022 HAVE_DECL_GETLOGIN_R=1;
8023 HAVE_DECL_GETPAGESIZE=1;
8024 HAVE_DECL_GETUSERSHELL=1;
8025 HAVE_DECL_SETHOSTNAME=1;
8026 HAVE_DECL_TRUNCATE=1;
8027 HAVE_DECL_TTYNAME_R=1;
8028 HAVE_OS_H=0;
8029 HAVE_SYS_PARAM_H=0;
8030 REPLACE_ACCESS=0;
8031 REPLACE_CHOWN=0;
8032 REPLACE_CLOSE=0;
8033 REPLACE_DUP=0;
8034 REPLACE_DUP2=0;
8035 REPLACE_FACCESSAT=0;
8036 REPLACE_FCHOWNAT=0;
8037 REPLACE_FTRUNCATE=0;
8038 REPLACE_GETCWD=0;
8039 REPLACE_GETDOMAINNAME=0;
8040 REPLACE_GETDTABLESIZE=0;
8041 REPLACE_GETLOGIN_R=0;
8042 REPLACE_GETGROUPS=0;
8043 REPLACE_GETPAGESIZE=0;
8044 REPLACE_GETPASS=0;
8045 REPLACE_ISATTY=0;
8046 REPLACE_LCHOWN=0;
8047 REPLACE_LINK=0;
8048 REPLACE_LINKAT=0;
8049 REPLACE_LSEEK=0;
8050 REPLACE_PREAD=0;
8051 REPLACE_PWRITE=0;
8052 REPLACE_READ=0;
8053 REPLACE_READLINK=0;
8054 REPLACE_READLINKAT=0;
8055 REPLACE_RMDIR=0;
8056 REPLACE_SLEEP=0;
8057 REPLACE_SYMLINK=0;
8058 REPLACE_SYMLINKAT=0;
8059 REPLACE_TRUNCATE=0;
8060 REPLACE_TTYNAME_R=0;
8061 REPLACE_UNLINK=0;
8062 REPLACE_UNLINKAT=0;
8063 REPLACE_USLEEP=0;
8064 REPLACE_WRITE=0;
698be2d8 8065 UNISTD_H_HAVE_SYS_RANDOM_H=0;
c0c3707f
CB
8066 UNISTD_H_HAVE_WINSOCK2_H=0;
8067 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
725e2999 8068
725e2999 8069
725e2999
JB
8070
8071
8072
725e2999 8073
725e2999 8074
725e2999
JB
8075
8076
c0c3707f
CB
8077
8078
8079 if test $ac_cv_func__set_invalid_parameter_handler = yes; then
8080 HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
8081
8082$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
8083
725e2999 8084 else
c0c3707f 8085 HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
725e2999
JB
8086 fi
8087
8088
8089
8090
8091
c0c3707f
CB
8092 GNULIB_OPENDIR=0;
8093 GNULIB_READDIR=0;
8094 GNULIB_REWINDDIR=0;
8095 GNULIB_CLOSEDIR=0;
8096 GNULIB_DIRFD=0;
8097 GNULIB_FDOPENDIR=0;
8098 GNULIB_SCANDIR=0;
8099 GNULIB_ALPHASORT=0;
8100 HAVE_OPENDIR=1;
8101 HAVE_READDIR=1;
8102 HAVE_REWINDDIR=1;
8103 HAVE_CLOSEDIR=1;
8104 HAVE_DECL_DIRFD=1;
8105 HAVE_DECL_FDOPENDIR=1;
8106 HAVE_FDOPENDIR=1;
8107 HAVE_SCANDIR=1;
8108 HAVE_ALPHASORT=1;
8109 REPLACE_OPENDIR=0;
8110 REPLACE_CLOSEDIR=0;
8111 REPLACE_DIRFD=0;
8112 REPLACE_FDOPENDIR=0;
725e2999
JB
8113
8114
698be2d8
CB
8115 GNULIB_ISBLANK=0;
8116 HAVE_ISBLANK=1;
8117
8118
725e2999
JB
8119
8120
725e2999
JB
8121
8122
8123
8124
725e2999
JB
8125
8126
c0c3707f
CB
8127 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
8128$as_echo_n "checking if environ is properly declared... " >&6; }
8129if ${gt_cv_var_environ_declaration+:} false; then :
725e2999
JB
8130 $as_echo_n "(cached) " >&6
8131else
c0c3707f
CB
8132 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8133/* end confdefs.h. */
8134#if HAVE_UNISTD_H
8135 #include <unistd.h>
8136 #endif
8137 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
8138 #include <stdlib.h>
725e2999 8139
c0c3707f
CB
8140 extern struct { int foo; } environ;
8141int
8142main ()
8143{
8144environ.foo = 1;
8145 ;
8146 return 0;
8147}
8148_ACEOF
8149if ac_fn_c_try_compile "$LINENO"; then :
8150 gt_cv_var_environ_declaration=no
8151else
8152 gt_cv_var_environ_declaration=yes
725e2999 8153fi
c0c3707f
CB
8154rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8155fi
8156{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
8157$as_echo "$gt_cv_var_environ_declaration" >&6; }
8158 if test $gt_cv_var_environ_declaration = yes; then
8159
8160$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
725e2999 8161
725e2999 8162 fi
725e2999
JB
8163
8164
c0c3707f
CB
8165 if test $gt_cv_var_environ_declaration != yes; then
8166 HAVE_DECL_ENVIRON=0
8167 fi
6ec2e0f5
SDJ
8168
8169
8170
c0c3707f
CB
8171 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
8172$as_echo_n "checking for complete errno.h... " >&6; }
8173if ${gl_cv_header_errno_h_complete+:} false; then :
8174 $as_echo_n "(cached) " >&6
8175else
6ec2e0f5 8176
c0c3707f
CB
8177 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8178/* end confdefs.h. */
472fa5ee 8179
c0c3707f
CB
8180#include <errno.h>
8181#if !defined ETXTBSY
8182booboo
8183#endif
8184#if !defined ENOMSG
8185booboo
8186#endif
8187#if !defined EIDRM
8188booboo
8189#endif
8190#if !defined ENOLINK
8191booboo
8192#endif
8193#if !defined EPROTO
8194booboo
8195#endif
8196#if !defined EMULTIHOP
8197booboo
8198#endif
8199#if !defined EBADMSG
8200booboo
8201#endif
8202#if !defined EOVERFLOW
8203booboo
8204#endif
8205#if !defined ENOTSUP
8206booboo
8207#endif
8208#if !defined ENETRESET
8209booboo
8210#endif
8211#if !defined ECONNABORTED
8212booboo
8213#endif
8214#if !defined ESTALE
8215booboo
8216#endif
8217#if !defined EDQUOT
8218booboo
8219#endif
8220#if !defined ECANCELED
8221booboo
8222#endif
8223#if !defined EOWNERDEAD
8224booboo
8225#endif
8226#if !defined ENOTRECOVERABLE
8227booboo
8228#endif
8229#if !defined EILSEQ
8230booboo
8231#endif
472fa5ee 8232
c0c3707f
CB
8233_ACEOF
8234if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8235 $EGREP "booboo" >/dev/null 2>&1; then :
8236 gl_cv_header_errno_h_complete=no
8237else
8238 gl_cv_header_errno_h_complete=yes
5e8754f9 8239fi
c0c3707f 8240rm -f conftest*
472fa5ee
SM
8241
8242
c0c3707f
CB
8243fi
8244{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
8245$as_echo "$gl_cv_header_errno_h_complete" >&6; }
8246 if test $gl_cv_header_errno_h_complete = yes; then
8247 ERRNO_H=''
8248 else
472fa5ee
SM
8249
8250
8251
8252
8253
472fa5ee
SM
8254
8255
8256
c0c3707f
CB
8257 if test $gl_cv_have_include_next = yes; then
8258 gl_cv_next_errno_h='<'errno.h'>'
8259 else
8260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
8261$as_echo_n "checking absolute name of <errno.h>... " >&6; }
8262if ${gl_cv_next_errno_h+:} false; then :
5e8754f9
SDJ
8263 $as_echo_n "(cached) " >&6
8264else
6ec2e0f5 8265
6ec2e0f5 8266
6ec2e0f5 8267
c0c3707f
CB
8268 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8269/* end confdefs.h. */
8270#include <errno.h>
8271_ACEOF
8272 case "$host_os" in
8273 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8274 *) gl_absname_cpp="$ac_cpp" ;;
8275 esac
6ec2e0f5 8276
c0c3707f
CB
8277 case "$host_os" in
8278 mingw*)
8279 gl_dirsep_regex='[/\\]'
8280 ;;
8281 *)
8282 gl_dirsep_regex='\/'
8283 ;;
8284 esac
8285 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
8286 gl_header_literal_regex=`echo 'errno.h' \
8287 | sed -e "$gl_make_literal_regex_sed"`
8288 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8289 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8290 s|^/[^/]|//&|
8291 p
8292 q
8293 }'
6ec2e0f5 8294
c0c3707f
CB
8295 gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
8296 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 8297
c0c3707f
CB
8298 gl_header=$gl_cv_absolute_errno_h
8299 gl_cv_next_errno_h='"'$gl_header'"'
6ec2e0f5
SDJ
8300
8301
c0c3707f
CB
8302fi
8303{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
8304$as_echo "$gl_cv_next_errno_h" >&6; }
8305 fi
8306 NEXT_ERRNO_H=$gl_cv_next_errno_h
6ec2e0f5 8307
c0c3707f
CB
8308 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8309 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8310 gl_next_as_first_directive='<'errno.h'>'
8311 else
8312 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8313 gl_next_as_first_directive=$gl_cv_next_errno_h
8314 fi
8315 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
6ec2e0f5 8316
472fa5ee
SM
8317
8318
8319
c0c3707f
CB
8320 ERRNO_H='errno.h'
8321 fi
472fa5ee 8322
c0c3707f
CB
8323 if test -n "$ERRNO_H"; then
8324 GL_GENERATE_ERRNO_H_TRUE=
8325 GL_GENERATE_ERRNO_H_FALSE='#'
5e8754f9 8326else
c0c3707f
CB
8327 GL_GENERATE_ERRNO_H_TRUE='#'
8328 GL_GENERATE_ERRNO_H_FALSE=
8329fi
472fa5ee
SM
8330
8331
c0c3707f
CB
8332 if test -n "$ERRNO_H"; then
8333 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
8334$as_echo_n "checking for EMULTIHOP value... " >&6; }
8335if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
8336 $as_echo_n "(cached) " >&6
5e8754f9 8337else
e26b6bb0 8338
c0c3707f
CB
8339 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8340/* end confdefs.h. */
e26b6bb0 8341
c0c3707f
CB
8342#include <errno.h>
8343#ifdef EMULTIHOP
8344yes
88b48903 8345#endif
88b48903 8346
c0c3707f
CB
8347_ACEOF
8348if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8349 $EGREP "yes" >/dev/null 2>&1; then :
8350 gl_cv_header_errno_h_EMULTIHOP=yes
8351else
8352 gl_cv_header_errno_h_EMULTIHOP=no
8353fi
8354rm -f conftest*
88b48903 8355
c0c3707f
CB
8356 if test $gl_cv_header_errno_h_EMULTIHOP = no; then
8357 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8358/* end confdefs.h. */
88b48903 8359
c0c3707f
CB
8360#define _XOPEN_SOURCE_EXTENDED 1
8361#include <errno.h>
8362#ifdef EMULTIHOP
8363yes
8364#endif
88b48903
WN
8365
8366_ACEOF
c0c3707f
CB
8367if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8368 $EGREP "yes" >/dev/null 2>&1; then :
8369 gl_cv_header_errno_h_EMULTIHOP=hidden
88b48903 8370fi
c0c3707f 8371rm -f conftest*
88b48903 8372
c0c3707f
CB
8373 if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
8374 if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
8375#define _XOPEN_SOURCE_EXTENDED 1
8376#include <errno.h>
8377/* The following two lines are a workaround against an autoconf-2.52 bug. */
8378#include <stdio.h>
8379#include <stdlib.h>
8380"; then :
88b48903
WN
8381
8382fi
88b48903 8383
c0c3707f
CB
8384 fi
8385 fi
88b48903 8386
c0c3707f
CB
8387fi
8388{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
8389$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
8390 case $gl_cv_header_errno_h_EMULTIHOP in
8391 yes | no)
8392 EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
8393 ;;
8394 *)
8395 EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
8396 ;;
8397 esac
88b48903 8398
e26b6bb0 8399
c0c3707f 8400 fi
e26b6bb0 8401
3d99e817 8402
c0c3707f
CB
8403 if test -n "$ERRNO_H"; then
8404 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
8405$as_echo_n "checking for ENOLINK value... " >&6; }
8406if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
8407 $as_echo_n "(cached) " >&6
8408else
472fa5ee 8409
c0c3707f
CB
8410 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8411/* end confdefs.h. */
472fa5ee 8412
c0c3707f
CB
8413#include <errno.h>
8414#ifdef ENOLINK
8415yes
8416#endif
472fa5ee 8417
c0c3707f
CB
8418_ACEOF
8419if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8420 $EGREP "yes" >/dev/null 2>&1; then :
8421 gl_cv_header_errno_h_ENOLINK=yes
8422else
8423 gl_cv_header_errno_h_ENOLINK=no
8424fi
8425rm -f conftest*
472fa5ee 8426
c0c3707f
CB
8427 if test $gl_cv_header_errno_h_ENOLINK = no; then
8428 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8429/* end confdefs.h. */
3d99e817 8430
c0c3707f
CB
8431#define _XOPEN_SOURCE_EXTENDED 1
8432#include <errno.h>
8433#ifdef ENOLINK
8434yes
8435#endif
3d99e817 8436
c0c3707f
CB
8437_ACEOF
8438if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8439 $EGREP "yes" >/dev/null 2>&1; then :
8440 gl_cv_header_errno_h_ENOLINK=hidden
8441fi
8442rm -f conftest*
3d99e817 8443
c0c3707f
CB
8444 if test $gl_cv_header_errno_h_ENOLINK = hidden; then
8445 if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
8446#define _XOPEN_SOURCE_EXTENDED 1
8447#include <errno.h>
8448/* The following two lines are a workaround against an autoconf-2.52 bug. */
8449#include <stdio.h>
8450#include <stdlib.h>
8451"; then :
3d99e817 8452
c0c3707f 8453fi
3d99e817 8454
c0c3707f
CB
8455 fi
8456 fi
3d99e817 8457
c0c3707f
CB
8458fi
8459{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
8460$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
8461 case $gl_cv_header_errno_h_ENOLINK in
8462 yes | no)
8463 ENOLINK_HIDDEN=0; ENOLINK_VALUE=
8464 ;;
8465 *)
8466 ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
8467 ;;
8468 esac
18848e28 8469
18848e28 8470
c0c3707f 8471 fi
18848e28 8472
18848e28 8473
c0c3707f
CB
8474 if test -n "$ERRNO_H"; then
8475 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
8476$as_echo_n "checking for EOVERFLOW value... " >&6; }
8477if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
8478 $as_echo_n "(cached) " >&6
8479else
18848e28 8480
c0c3707f
CB
8481 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8482/* end confdefs.h. */
18848e28 8483
c0c3707f
CB
8484#include <errno.h>
8485#ifdef EOVERFLOW
8486yes
8487#endif
18848e28 8488
c0c3707f
CB
8489_ACEOF
8490if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8491 $EGREP "yes" >/dev/null 2>&1; then :
8492 gl_cv_header_errno_h_EOVERFLOW=yes
8493else
8494 gl_cv_header_errno_h_EOVERFLOW=no
8495fi
8496rm -f conftest*
18848e28 8497
c0c3707f
CB
8498 if test $gl_cv_header_errno_h_EOVERFLOW = no; then
8499 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8500/* end confdefs.h. */
18848e28 8501
c0c3707f
CB
8502#define _XOPEN_SOURCE_EXTENDED 1
8503#include <errno.h>
8504#ifdef EOVERFLOW
8505yes
8506#endif
18848e28 8507
c0c3707f
CB
8508_ACEOF
8509if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8510 $EGREP "yes" >/dev/null 2>&1; then :
8511 gl_cv_header_errno_h_EOVERFLOW=hidden
8512fi
8513rm -f conftest*
18848e28 8514
c0c3707f
CB
8515 if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
8516 if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
8517#define _XOPEN_SOURCE_EXTENDED 1
8518#include <errno.h>
8519/* The following two lines are a workaround against an autoconf-2.52 bug. */
8520#include <stdio.h>
8521#include <stdlib.h>
8522"; then :
18848e28 8523
c0c3707f 8524fi
18848e28 8525
c0c3707f
CB
8526 fi
8527 fi
18848e28 8528
c0c3707f
CB
8529fi
8530{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
8531$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
8532 case $gl_cv_header_errno_h_EOVERFLOW in
8533 yes | no)
8534 EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
8535 ;;
8536 *)
8537 EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
8538 ;;
8539 esac
4a626d0a
PA
8540
8541
c0c3707f 8542 fi
18848e28 8543
4a626d0a 8544
c0c3707f
CB
8545ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
8546if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
8547 ac_have_decl=1
8548else
8549 ac_have_decl=0
8550fi
4a626d0a 8551
c0c3707f
CB
8552cat >>confdefs.h <<_ACEOF
8553#define HAVE_DECL_STRERROR_R $ac_have_decl
8554_ACEOF
4a626d0a 8555
c0c3707f
CB
8556for ac_func in strerror_r
8557do :
8558 ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
8559if test "x$ac_cv_func_strerror_r" = xyes; then :
8560 cat >>confdefs.h <<_ACEOF
8561#define HAVE_STRERROR_R 1
8562_ACEOF
4a626d0a 8563
c0c3707f
CB
8564fi
8565done
18848e28 8566
c0c3707f
CB
8567{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
8568$as_echo_n "checking whether strerror_r returns char *... " >&6; }
8569if ${ac_cv_func_strerror_r_char_p+:} false; then :
8570 $as_echo_n "(cached) " >&6
8571else
18848e28 8572
c0c3707f
CB
8573 ac_cv_func_strerror_r_char_p=no
8574 if test $ac_cv_have_decl_strerror_r = yes; then
8575 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8576/* end confdefs.h. */
8577$ac_includes_default
8578int
8579main ()
8580{
18848e28 8581
c0c3707f
CB
8582 char buf[100];
8583 char x = *strerror_r (0, buf, sizeof buf);
8584 char *p = strerror_r (0, buf, sizeof buf);
8585 return !p || x;
18848e28 8586
c0c3707f
CB
8587 ;
8588 return 0;
8589}
8590_ACEOF
8591if ac_fn_c_try_compile "$LINENO"; then :
8592 ac_cv_func_strerror_r_char_p=yes
8593fi
8594rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8595 else
8596 # strerror_r is not declared. Choose between
8597 # systems that have relatively inaccessible declarations for the
8598 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
8599 # former has a strerror_r that returns char*, while the latter
8600 # has a strerror_r that returns `int'.
8601 # This test should segfault on the DEC system.
8602 if test "$cross_compiling" = yes; then :
8603 :
8604else
8605 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8606/* end confdefs.h. */
8607$ac_includes_default
8608 extern char *strerror_r ();
8609int
8610main ()
8611{
8612char buf[100];
8613 char x = *strerror_r (0, buf, sizeof buf);
8614 return ! isalpha (x);
8615 ;
8616 return 0;
8617}
8618_ACEOF
8619if ac_fn_c_try_run "$LINENO"; then :
8620 ac_cv_func_strerror_r_char_p=yes
8621fi
8622rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8623 conftest.$ac_objext conftest.beam conftest.$ac_ext
8624fi
18848e28 8625
c0c3707f 8626 fi
18848e28 8627
c0c3707f
CB
8628fi
8629{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
8630$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
8631if test $ac_cv_func_strerror_r_char_p = yes; then
18848e28 8632
c0c3707f 8633$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
18848e28 8634
c0c3707f 8635fi
18848e28 8636
18848e28 8637
18848e28 8638
18848e28 8639
c0c3707f
CB
8640ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
8641if test "x$ac_cv_have_decl_fchdir" = xyes; then :
8642 ac_have_decl=1
8643else
8644 ac_have_decl=0
8645fi
18848e28 8646
c0c3707f
CB
8647cat >>confdefs.h <<_ACEOF
8648#define HAVE_DECL_FCHDIR $ac_have_decl
8649_ACEOF
18848e28 8650
18848e28 8651
c0c3707f
CB
8652 GNULIB_CREAT=0;
8653 GNULIB_FCNTL=0;
8654 GNULIB_NONBLOCKING=0;
8655 GNULIB_OPEN=0;
8656 GNULIB_OPENAT=0;
8657 HAVE_FCNTL=1;
8658 HAVE_OPENAT=1;
8659 REPLACE_CREAT=0;
8660 REPLACE_FCNTL=0;
8661 REPLACE_OPEN=0;
8662 REPLACE_OPENAT=0;
18848e28 8663
18848e28 8664
18848e28 8665
18848e28
GF
8666
8667
18848e28
GF
8668
8669
18848e28 8670
18848e28 8671
18848e28 8672
c0c3707f
CB
8673 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
8674$as_echo_n "checking for working fcntl.h... " >&6; }
8675if ${gl_cv_header_working_fcntl_h+:} false; then :
8676 $as_echo_n "(cached) " >&6
8677else
8678 if test "$cross_compiling" = yes; then :
8679 case "$host_os" in
8680 # Guess 'no' on native Windows.
8681 mingw*) gl_cv_header_working_fcntl_h='no' ;;
8682 *) gl_cv_header_working_fcntl_h=cross-compiling ;;
8683 esac
18848e28 8684
c0c3707f
CB
8685else
8686 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8687/* end confdefs.h. */
8688#include <sys/types.h>
8689 #include <sys/stat.h>
8690 #if HAVE_UNISTD_H
8691 # include <unistd.h>
8692 #else /* on Windows with MSVC */
8693 # include <io.h>
8694 # include <stdlib.h>
8695 # defined sleep(n) _sleep ((n) * 1000)
8696 #endif
8697 #include <fcntl.h>
8698 #ifndef O_NOATIME
8699 #define O_NOATIME 0
8700 #endif
8701 #ifndef O_NOFOLLOW
8702 #define O_NOFOLLOW 0
8703 #endif
8704 static int const constants[] =
8705 {
8706 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
8707 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
8708 };
18848e28 8709
c0c3707f
CB
8710int
8711main ()
8712{
18848e28 8713
c0c3707f
CB
8714 int result = !constants;
8715 #if HAVE_SYMLINK
8716 {
8717 static char const sym[] = "conftest.sym";
8718 if (symlink ("/dev/null", sym) != 0)
8719 result |= 2;
8720 else
8721 {
8722 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
8723 if (fd >= 0)
8724 {
8725 close (fd);
8726 result |= 4;
8727 }
8728 }
8729 if (unlink (sym) != 0 || symlink (".", sym) != 0)
8730 result |= 2;
8731 else
8732 {
8733 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
8734 if (fd >= 0)
8735 {
8736 close (fd);
8737 result |= 4;
8738 }
8739 }
8740 unlink (sym);
8741 }
8742 #endif
8743 {
8744 static char const file[] = "confdefs.h";
8745 int fd = open (file, O_RDONLY | O_NOATIME);
8746 if (fd < 0)
8747 result |= 8;
8748 else
8749 {
8750 struct stat st0;
8751 if (fstat (fd, &st0) != 0)
8752 result |= 16;
8753 else
8754 {
8755 char c;
8756 sleep (1);
8757 if (read (fd, &c, 1) != 1)
8758 result |= 24;
8759 else
8760 {
8761 if (close (fd) != 0)
8762 result |= 32;
8763 else
8764 {
8765 struct stat st1;
8766 if (stat (file, &st1) != 0)
8767 result |= 40;
8768 else
8769 if (st0.st_atime != st1.st_atime)
8770 result |= 64;
8771 }
8772 }
8773 }
8774 }
8775 }
8776 return result;
8777 ;
8778 return 0;
8779}
8780_ACEOF
8781if ac_fn_c_try_run "$LINENO"; then :
8782 gl_cv_header_working_fcntl_h=yes
8783else
8784 case $? in #(
8785 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
8786 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
8787 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
8788 *) gl_cv_header_working_fcntl_h='no';;
8789 esac
8790fi
8791rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8792 conftest.$ac_objext conftest.beam conftest.$ac_ext
8793fi
18848e28 8794
18848e28 8795
c0c3707f
CB
8796fi
8797{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
8798$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
18848e28 8799
c0c3707f
CB
8800 case $gl_cv_header_working_fcntl_h in #(
8801 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
8802 *) ac_val=1;;
8803 esac
18848e28 8804
c0c3707f
CB
8805cat >>confdefs.h <<_ACEOF
8806#define HAVE_WORKING_O_NOATIME $ac_val
8807_ACEOF
18848e28
GF
8808
8809
c0c3707f
CB
8810 case $gl_cv_header_working_fcntl_h in #(
8811 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
8812 *) ac_val=1;;
8813 esac
18848e28 8814
c0c3707f
CB
8815cat >>confdefs.h <<_ACEOF
8816#define HAVE_WORKING_O_NOFOLLOW $ac_val
8817_ACEOF
18848e28 8818
63ce7108 8819
c0c3707f
CB
8820ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
8821if test "x$ac_cv_type_pid_t" = xyes; then :
63ce7108 8822
c0c3707f 8823else
63ce7108 8824
c0c3707f
CB
8825cat >>confdefs.h <<_ACEOF
8826#define pid_t int
8827_ACEOF
63ce7108 8828
c0c3707f 8829fi
63ce7108 8830
c0c3707f
CB
8831ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
8832if test "x$ac_cv_type_mode_t" = xyes; then :
63ce7108 8833
c0c3707f 8834else
63ce7108 8835
c0c3707f
CB
8836cat >>confdefs.h <<_ACEOF
8837#define mode_t int
8838_ACEOF
63ce7108 8839
c0c3707f 8840fi
63ce7108 8841
472fa5ee
SM
8842
8843
8844
8845
8846
c0c3707f
CB
8847 GNULIB_FNMATCH=0;
8848 HAVE_FNMATCH=1;
8849 REPLACE_FNMATCH=0;
472fa5ee
SM
8850
8851
8852
8853
8854
8855
472fa5ee
SM
8856
8857
472fa5ee
SM
8858
8859
8860
8861
8862
8863
8864
8865
7a6dbc2f 8866 if test $gl_cv_have_include_next = yes; then
c0c3707f 8867 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
7a6dbc2f 8868 else
c0c3707f
CB
8869 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5
8870$as_echo_n "checking absolute name of <fnmatch.h>... " >&6; }
8871if ${gl_cv_next_fnmatch_h+:} false; then :
7a6dbc2f
SDJ
8872 $as_echo_n "(cached) " >&6
8873else
472fa5ee 8874
c0c3707f
CB
8875 if test $ac_cv_header_fnmatch_h = yes; then
8876
8877
472fa5ee
SM
8878
8879
7a6dbc2f
SDJ
8880 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8881/* end confdefs.h. */
c0c3707f 8882#include <fnmatch.h>
7a6dbc2f
SDJ
8883_ACEOF
8884 case "$host_os" in
8885 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8886 *) gl_absname_cpp="$ac_cpp" ;;
8887 esac
472fa5ee 8888
7a6dbc2f
SDJ
8889 case "$host_os" in
8890 mingw*)
8891 gl_dirsep_regex='[/\\]'
8892 ;;
8893 *)
8894 gl_dirsep_regex='\/'
8895 ;;
8896 esac
8897 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 8898 gl_header_literal_regex=`echo 'fnmatch.h' \
7a6dbc2f
SDJ
8899 | sed -e "$gl_make_literal_regex_sed"`
8900 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8901 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8902 s|^/[^/]|//&|
8903 p
8904 q
8905 }'
8906
c0c3707f 8907 gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
7a6dbc2f
SDJ
8908 sed -n "$gl_absolute_header_sed"`
8909
c0c3707f
CB
8910 gl_header=$gl_cv_absolute_fnmatch_h
8911 gl_cv_next_fnmatch_h='"'$gl_header'"'
8912 else
8913 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
8914 fi
7a6dbc2f
SDJ
8915
8916
8917fi
c0c3707f
CB
8918{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5
8919$as_echo "$gl_cv_next_fnmatch_h" >&6; }
7a6dbc2f 8920 fi
c0c3707f 8921 NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h
7a6dbc2f
SDJ
8922
8923 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8924 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 8925 gl_next_as_first_directive='<'fnmatch.h'>'
7a6dbc2f
SDJ
8926 else
8927 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 8928 gl_next_as_first_directive=$gl_cv_next_fnmatch_h
7a6dbc2f 8929 fi
c0c3707f 8930 NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive
7a6dbc2f
SDJ
8931
8932
8933
8934
7a6dbc2f 8935
7a6dbc2f
SDJ
8936
8937
c0c3707f
CB
8938 if test $ac_cv_header_fnmatch_h = yes; then
8939 HAVE_FNMATCH_H=1
8940 else
8941 HAVE_FNMATCH_H=0
8942 fi
7a6dbc2f
SDJ
8943
8944
c0c3707f
CB
8945 FNMATCH_H=''
8946 if false; then
8947 FNMATCH_H=fnmatch.h
8948 else
8949 if test $ac_cv_header_fnmatch_h != yes; then
8950 FNMATCH_H=fnmatch.h
8951 fi
8952 fi
7a6dbc2f 8953
c0c3707f
CB
8954
8955 if test -n "$FNMATCH_H"; then
8956 GL_GENERATE_FNMATCH_H_TRUE=
8957 GL_GENERATE_FNMATCH_H_FALSE='#'
7a6dbc2f 8958else
c0c3707f
CB
8959 GL_GENERATE_FNMATCH_H_TRUE='#'
8960 GL_GENERATE_FNMATCH_H_FALSE=
7a6dbc2f 8961fi
7a6dbc2f 8962
7a6dbc2f 8963
7a6dbc2f 8964
7a6dbc2f
SDJ
8965
8966
8967
8968
8969
8970
8971
c0c3707f
CB
8972 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
8973$as_echo_n "checking for mbstate_t... " >&6; }
8974if ${ac_cv_type_mbstate_t+:} false; then :
5e8754f9
SDJ
8975 $as_echo_n "(cached) " >&6
8976else
c0c3707f 8977 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 8978/* end confdefs.h. */
c0c3707f
CB
8979$ac_includes_default
8980/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
8981 <wchar.h>.
8982 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
8983 included before <wchar.h>. */
8984#include <stddef.h>
8985#include <stdio.h>
8986#include <time.h>
8987#include <wchar.h>
8988int
8989main ()
8990{
8991mbstate_t x; return sizeof x;
8992 ;
8993 return 0;
8994}
5e8754f9 8995_ACEOF
c0c3707f
CB
8996if ac_fn_c_try_compile "$LINENO"; then :
8997 ac_cv_type_mbstate_t=yes
5e8754f9 8998else
c0c3707f 8999 ac_cv_type_mbstate_t=no
5e8754f9 9000fi
c0c3707f
CB
9001rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9002fi
9003{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
9004$as_echo "$ac_cv_type_mbstate_t" >&6; }
9005 if test $ac_cv_type_mbstate_t = yes; then
5e8754f9 9006
c0c3707f 9007$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
5e8754f9 9008
c0c3707f 9009 else
5e8754f9 9010
c0c3707f 9011$as_echo "#define mbstate_t int" >>confdefs.h
5e8754f9 9012
c0c3707f 9013 fi
5e8754f9
SDJ
9014
9015
9016
9017
5e8754f9
SDJ
9018 GNULIB_ACOSF=0;
9019 GNULIB_ACOSL=0;
9020 GNULIB_ASINF=0;
9021 GNULIB_ASINL=0;
9022 GNULIB_ATANF=0;
9023 GNULIB_ATANL=0;
9024 GNULIB_ATAN2F=0;
9025 GNULIB_CBRT=0;
9026 GNULIB_CBRTF=0;
9027 GNULIB_CBRTL=0;
9028 GNULIB_CEIL=0;
9029 GNULIB_CEILF=0;
9030 GNULIB_CEILL=0;
9031 GNULIB_COPYSIGN=0;
9032 GNULIB_COPYSIGNF=0;
9033 GNULIB_COPYSIGNL=0;
9034 GNULIB_COSF=0;
9035 GNULIB_COSL=0;
9036 GNULIB_COSHF=0;
9037 GNULIB_EXPF=0;
9038 GNULIB_EXPL=0;
9039 GNULIB_EXP2=0;
9040 GNULIB_EXP2F=0;
9041 GNULIB_EXP2L=0;
9042 GNULIB_EXPM1=0;
9043 GNULIB_EXPM1F=0;
9044 GNULIB_EXPM1L=0;
9045 GNULIB_FABSF=0;
9046 GNULIB_FABSL=0;
9047 GNULIB_FLOOR=0;
9048 GNULIB_FLOORF=0;
9049 GNULIB_FLOORL=0;
9050 GNULIB_FMA=0;
9051 GNULIB_FMAF=0;
9052 GNULIB_FMAL=0;
9053 GNULIB_FMOD=0;
9054 GNULIB_FMODF=0;
9055 GNULIB_FMODL=0;
9056 GNULIB_FREXPF=0;
9057 GNULIB_FREXP=0;
9058 GNULIB_FREXPL=0;
9059 GNULIB_HYPOT=0;
9060 GNULIB_HYPOTF=0;
9061 GNULIB_HYPOTL=0;
9062 GNULIB_ILOGB=0;
9063 GNULIB_ILOGBF=0;
9064 GNULIB_ILOGBL=0;
9065 GNULIB_ISFINITE=0;
9066 GNULIB_ISINF=0;
9067 GNULIB_ISNAN=0;
9068 GNULIB_ISNANF=0;
9069 GNULIB_ISNAND=0;
9070 GNULIB_ISNANL=0;
9071 GNULIB_LDEXPF=0;
9072 GNULIB_LDEXPL=0;
9073 GNULIB_LOG=0;
9074 GNULIB_LOGF=0;
9075 GNULIB_LOGL=0;
9076 GNULIB_LOG10=0;
9077 GNULIB_LOG10F=0;
9078 GNULIB_LOG10L=0;
9079 GNULIB_LOG1P=0;
9080 GNULIB_LOG1PF=0;
9081 GNULIB_LOG1PL=0;
9082 GNULIB_LOG2=0;
9083 GNULIB_LOG2F=0;
9084 GNULIB_LOG2L=0;
9085 GNULIB_LOGB=0;
9086 GNULIB_LOGBF=0;
9087 GNULIB_LOGBL=0;
9088 GNULIB_MODF=0;
9089 GNULIB_MODFF=0;
9090 GNULIB_MODFL=0;
9091 GNULIB_POWF=0;
9092 GNULIB_REMAINDER=0;
9093 GNULIB_REMAINDERF=0;
9094 GNULIB_REMAINDERL=0;
9095 GNULIB_RINT=0;
9096 GNULIB_RINTF=0;
9097 GNULIB_RINTL=0;
9098 GNULIB_ROUND=0;
9099 GNULIB_ROUNDF=0;
9100 GNULIB_ROUNDL=0;
9101 GNULIB_SIGNBIT=0;
9102 GNULIB_SINF=0;
9103 GNULIB_SINL=0;
9104 GNULIB_SINHF=0;
9105 GNULIB_SQRTF=0;
9106 GNULIB_SQRTL=0;
9107 GNULIB_TANF=0;
9108 GNULIB_TANL=0;
9109 GNULIB_TANHF=0;
9110 GNULIB_TRUNC=0;
9111 GNULIB_TRUNCF=0;
9112 GNULIB_TRUNCL=0;
9113 HAVE_ACOSF=1;
9114 HAVE_ACOSL=1;
9115 HAVE_ASINF=1;
9116 HAVE_ASINL=1;
9117 HAVE_ATANF=1;
9118 HAVE_ATANL=1;
9119 HAVE_ATAN2F=1;
9120 HAVE_CBRT=1;
9121 HAVE_CBRTF=1;
9122 HAVE_CBRTL=1;
9123 HAVE_COPYSIGN=1;
9124 HAVE_COPYSIGNL=1;
9125 HAVE_COSF=1;
9126 HAVE_COSL=1;
9127 HAVE_COSHF=1;
9128 HAVE_EXPF=1;
9129 HAVE_EXPL=1;
9130 HAVE_EXPM1=1;
9131 HAVE_EXPM1F=1;
9132 HAVE_FABSF=1;
9133 HAVE_FABSL=1;
9134 HAVE_FMA=1;
9135 HAVE_FMAF=1;
9136 HAVE_FMAL=1;
9137 HAVE_FMODF=1;
9138 HAVE_FMODL=1;
9139 HAVE_FREXPF=1;
9140 HAVE_HYPOTF=1;
9141 HAVE_HYPOTL=1;
9142 HAVE_ILOGB=1;
9143 HAVE_ILOGBF=1;
9144 HAVE_ILOGBL=1;
9145 HAVE_ISNANF=1;
9146 HAVE_ISNAND=1;
9147 HAVE_ISNANL=1;
9148 HAVE_LDEXPF=1;
9149 HAVE_LOGF=1;
9150 HAVE_LOGL=1;
9151 HAVE_LOG10F=1;
9152 HAVE_LOG10L=1;
9153 HAVE_LOG1P=1;
9154 HAVE_LOG1PF=1;
9155 HAVE_LOG1PL=1;
9156 HAVE_LOGBF=1;
9157 HAVE_LOGBL=1;
9158 HAVE_MODFF=1;
9159 HAVE_MODFL=1;
9160 HAVE_POWF=1;
9161 HAVE_REMAINDER=1;
9162 HAVE_REMAINDERF=1;
9163 HAVE_RINT=1;
9164 HAVE_RINTL=1;
9165 HAVE_SINF=1;
9166 HAVE_SINL=1;
9167 HAVE_SINHF=1;
9168 HAVE_SQRTF=1;
9169 HAVE_SQRTL=1;
9170 HAVE_TANF=1;
9171 HAVE_TANL=1;
9172 HAVE_TANHF=1;
9173 HAVE_DECL_ACOSL=1;
9174 HAVE_DECL_ASINL=1;
9175 HAVE_DECL_ATANL=1;
9176 HAVE_DECL_CBRTF=1;
9177 HAVE_DECL_CBRTL=1;
9178 HAVE_DECL_CEILF=1;
9179 HAVE_DECL_CEILL=1;
9180 HAVE_DECL_COPYSIGNF=1;
9181 HAVE_DECL_COSL=1;
9182 HAVE_DECL_EXPL=1;
9183 HAVE_DECL_EXP2=1;
9184 HAVE_DECL_EXP2F=1;
9185 HAVE_DECL_EXP2L=1;
9186 HAVE_DECL_EXPM1L=1;
9187 HAVE_DECL_FLOORF=1;
9188 HAVE_DECL_FLOORL=1;
9189 HAVE_DECL_FREXPL=1;
9190 HAVE_DECL_LDEXPL=1;
9191 HAVE_DECL_LOGL=1;
9192 HAVE_DECL_LOG10L=1;
9193 HAVE_DECL_LOG2=1;
9194 HAVE_DECL_LOG2F=1;
9195 HAVE_DECL_LOG2L=1;
9196 HAVE_DECL_LOGB=1;
9197 HAVE_DECL_REMAINDER=1;
9198 HAVE_DECL_REMAINDERL=1;
9199 HAVE_DECL_RINTF=1;
9200 HAVE_DECL_ROUND=1;
9201 HAVE_DECL_ROUNDF=1;
9202 HAVE_DECL_ROUNDL=1;
9203 HAVE_DECL_SINL=1;
9204 HAVE_DECL_SQRTL=1;
9205 HAVE_DECL_TANL=1;
9206 HAVE_DECL_TRUNC=1;
9207 HAVE_DECL_TRUNCF=1;
9208 HAVE_DECL_TRUNCL=1;
c0c3707f
CB
9209 REPLACE_ACOSF=0;
9210 REPLACE_ASINF=0;
9211 REPLACE_ATANF=0;
9212 REPLACE_ATAN2F=0;
5e8754f9
SDJ
9213 REPLACE_CBRTF=0;
9214 REPLACE_CBRTL=0;
9215 REPLACE_CEIL=0;
9216 REPLACE_CEILF=0;
9217 REPLACE_CEILL=0;
c0c3707f
CB
9218 REPLACE_COSF=0;
9219 REPLACE_COSHF=0;
9220 REPLACE_EXPF=0;
9221 REPLACE_EXPL=0;
5e8754f9
SDJ
9222 REPLACE_EXPM1=0;
9223 REPLACE_EXPM1F=0;
c0c3707f 9224 REPLACE_EXPM1L=0;
5e8754f9
SDJ
9225 REPLACE_EXP2=0;
9226 REPLACE_EXP2L=0;
9227 REPLACE_FABSL=0;
9228 REPLACE_FLOOR=0;
9229 REPLACE_FLOORF=0;
9230 REPLACE_FLOORL=0;
9231 REPLACE_FMA=0;
9232 REPLACE_FMAF=0;
9233 REPLACE_FMAL=0;
9234 REPLACE_FMOD=0;
9235 REPLACE_FMODF=0;
9236 REPLACE_FMODL=0;
9237 REPLACE_FREXPF=0;
9238 REPLACE_FREXP=0;
9239 REPLACE_FREXPL=0;
9240 REPLACE_HUGE_VAL=0;
9241 REPLACE_HYPOT=0;
9242 REPLACE_HYPOTF=0;
9243 REPLACE_HYPOTL=0;
9244 REPLACE_ILOGB=0;
9245 REPLACE_ILOGBF=0;
c0c3707f 9246 REPLACE_ILOGBL=0;
5e8754f9
SDJ
9247 REPLACE_ISFINITE=0;
9248 REPLACE_ISINF=0;
9249 REPLACE_ISNAN=0;
9250 REPLACE_LDEXPL=0;
9251 REPLACE_LOG=0;
9252 REPLACE_LOGF=0;
9253 REPLACE_LOGL=0;
9254 REPLACE_LOG10=0;
9255 REPLACE_LOG10F=0;
9256 REPLACE_LOG10L=0;
9257 REPLACE_LOG1P=0;
9258 REPLACE_LOG1PF=0;
9259 REPLACE_LOG1PL=0;
9260 REPLACE_LOG2=0;
9261 REPLACE_LOG2F=0;
9262 REPLACE_LOG2L=0;
9263 REPLACE_LOGB=0;
9264 REPLACE_LOGBF=0;
9265 REPLACE_LOGBL=0;
9266 REPLACE_MODF=0;
9267 REPLACE_MODFF=0;
9268 REPLACE_MODFL=0;
9269 REPLACE_NAN=0;
9270 REPLACE_REMAINDER=0;
9271 REPLACE_REMAINDERF=0;
9272 REPLACE_REMAINDERL=0;
c0c3707f 9273 REPLACE_RINTL=0;
5e8754f9 9274 REPLACE_ROUND=0;
c0c3707f
CB
9275 REPLACE_ROUNDF=0;
9276 REPLACE_ROUNDL=0;
9277 REPLACE_SIGNBIT=0;
9278 REPLACE_SIGNBIT_USING_GCC=0;
9279 REPLACE_SINF=0;
9280 REPLACE_SINHF=0;
9281 REPLACE_SQRTF=0;
9282 REPLACE_SQRTL=0;
9283 REPLACE_TANF=0;
9284 REPLACE_TANHF=0;
9285 REPLACE_TRUNC=0;
9286 REPLACE_TRUNCF=0;
9287 REPLACE_TRUNCL=0;
49e4877c 9288
49e4877c 9289
c0c3707f
CB
9290 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
9291$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
9292if ${gl_cv_func_frexp_no_libm+:} false; then :
9293 $as_echo_n "(cached) " >&6
9294else
8690e634 9295
c0c3707f
CB
9296 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9297/* end confdefs.h. */
9298#include <math.h>
9299 double x;
9300int
9301main ()
9302{
9303int e; return frexp (x, &e) > 0;
9304 ;
9305 return 0;
9306}
9307_ACEOF
9308if ac_fn_c_try_link "$LINENO"; then :
9309 gl_cv_func_frexp_no_libm=yes
9310else
9311 gl_cv_func_frexp_no_libm=no
9312fi
9313rm -f core conftest.err conftest.$ac_objext \
9314 conftest$ac_exeext conftest.$ac_ext
8690e634 9315
c0c3707f
CB
9316fi
9317{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
9318$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
8690e634 9319
c0c3707f
CB
9320ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
9321if test "x$ac_cv_have_decl_alarm" = xyes; then :
9322 ac_have_decl=1
9323else
9324 ac_have_decl=0
9325fi
472fa5ee 9326
c0c3707f
CB
9327cat >>confdefs.h <<_ACEOF
9328#define HAVE_DECL_ALARM $ac_have_decl
9329_ACEOF
472fa5ee
SM
9330
9331
9332
9333
c0c3707f
CB
9334 FREXP_LIBM=
9335 if test $gl_cv_func_frexp_no_libm = no; then
9336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5
9337$as_echo_n "checking whether frexp() can be used with libm... " >&6; }
9338if ${gl_cv_func_frexp_in_libm+:} false; then :
9339 $as_echo_n "(cached) " >&6
9340else
8690e634 9341
c0c3707f
CB
9342 save_LIBS="$LIBS"
9343 LIBS="$LIBS -lm"
9344 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9345/* end confdefs.h. */
9346#include <math.h>
9347 double x;
9348int
9349main ()
9350{
9351int e; return frexp (x, &e) > 0;
9352 ;
9353 return 0;
9354}
9355_ACEOF
9356if ac_fn_c_try_link "$LINENO"; then :
9357 gl_cv_func_frexp_in_libm=yes
9358else
9359 gl_cv_func_frexp_in_libm=no
9360fi
9361rm -f core conftest.err conftest.$ac_objext \
9362 conftest$ac_exeext conftest.$ac_ext
9363 LIBS="$save_LIBS"
8690e634 9364
c0c3707f
CB
9365fi
9366{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5
9367$as_echo "$gl_cv_func_frexp_in_libm" >&6; }
9368 if test $gl_cv_func_frexp_in_libm = yes; then
9369 FREXP_LIBM=-lm
9370 fi
6ec2e0f5 9371 fi
c0c3707f
CB
9372 if test $gl_cv_func_frexp_no_libm = yes \
9373 || test $gl_cv_func_frexp_in_libm = yes; then
9374 save_LIBS="$LIBS"
9375 LIBS="$LIBS $FREXP_LIBM"
8690e634
JK
9376
9377
8690e634 9378
c0c3707f
CB
9379 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
9380$as_echo_n "checking whether frexp works... " >&6; }
9381if ${gl_cv_func_frexp_works+:} false; then :
9382 $as_echo_n "(cached) " >&6
9383else
8690e634 9384
c0c3707f
CB
9385 if test "$cross_compiling" = yes; then :
9386 case "$host_os" in
9387 netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
9388 mingw*) # Guess yes with MSVC, no with mingw.
9389 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9390/* end confdefs.h. */
8690e634 9391
c0c3707f
CB
9392#ifdef _MSC_VER
9393 Good
9394#endif
8690e634 9395
c0c3707f
CB
9396_ACEOF
9397if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9398 $EGREP "Good" >/dev/null 2>&1; then :
9399 gl_cv_func_frexp_works="guessing yes"
9400else
9401 gl_cv_func_frexp_works="guessing no"
9402fi
9403rm -f conftest*
8690e634 9404
c0c3707f
CB
9405 ;;
9406 *) gl_cv_func_frexp_works="guessing yes" ;;
9407 esac
8690e634 9408
c0c3707f
CB
9409else
9410 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9411/* end confdefs.h. */
8690e634 9412
c0c3707f
CB
9413#include <float.h>
9414#include <math.h>
9415#include <string.h>
9416#if HAVE_DECL_ALARM
9417# include <signal.h>
9418# include <unistd.h>
9419#endif
9420/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
9421 ICC 10.0 has a bug when optimizing the expression -zero.
9422 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
9423 to PowerPC on Mac OS X 10.5. */
9424#if defined __hpux || defined __sgi || defined __ICC
9425static double
9426compute_minus_zero (void)
9427{
9428 return -DBL_MIN * DBL_MIN;
9429}
9430# define minus_zero compute_minus_zero ()
9431#else
9432double minus_zero = -0.0;
9433#endif
9434int main()
9435{
9436 int result = 0;
9437 int i;
9438 volatile double x;
9439 double zero = 0.0;
9440#if HAVE_DECL_ALARM
9441 /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
9442 number. Let the test fail in this case. */
9443 signal (SIGALRM, SIG_DFL);
9444 alarm (5);
9445#endif
9446 /* Test on denormalized numbers. */
9447 for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
9448 ;
9449 if (x > 0.0)
9450 {
9451 int exp;
9452 double y = frexp (x, &exp);
9453 /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
9454 On NetBSD: y = 0.75. Correct: y = 0.5. */
9455 if (y != 0.5)
9456 result |= 1;
9457 }
9458 /* Test on infinite numbers. */
9459 x = 1.0 / zero;
9460 {
9461 int exp;
9462 double y = frexp (x, &exp);
9463 if (y != x)
9464 result |= 2;
9465 }
9466 /* Test on negative zero. */
9467 x = minus_zero;
9468 {
9469 int exp;
9470 double y = frexp (x, &exp);
9471 if (memcmp (&y, &x, sizeof x))
9472 result |= 4;
9473 }
9474 return result;
9475}
9476_ACEOF
9477if ac_fn_c_try_run "$LINENO"; then :
9478 gl_cv_func_frexp_works=yes
9479else
9480 gl_cv_func_frexp_works=no
9481fi
9482rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9483 conftest.$ac_objext conftest.beam conftest.$ac_ext
9484fi
472fa5ee
SM
9485
9486
c0c3707f
CB
9487fi
9488{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
9489$as_echo "$gl_cv_func_frexp_works" >&6; }
472fa5ee 9490
c0c3707f
CB
9491 LIBS="$save_LIBS"
9492 case "$gl_cv_func_frexp_works" in
9493 *yes) gl_func_frexp=yes ;;
9494 *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
9495 esac
9496 else
9497 gl_func_frexp=no
9498 fi
9499 if test $gl_func_frexp = yes; then
472fa5ee 9500
c0c3707f 9501$as_echo "#define HAVE_FREXP 1" >>confdefs.h
472fa5ee 9502
c0c3707f 9503 fi
8690e634 9504
6ec2e0f5
SDJ
9505
9506
c0c3707f
CB
9507 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
9508$as_echo_n "checking whether long double and double are the same... " >&6; }
9509if ${gl_cv_long_double_equals_double+:} false; then :
8690e634
JK
9510 $as_echo_n "(cached) " >&6
9511else
c0c3707f
CB
9512 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9513/* end confdefs.h. */
9514#include <float.h>
9515int
9516main ()
9517{
9518typedef int check[sizeof (long double) == sizeof (double)
9519 && LDBL_MANT_DIG == DBL_MANT_DIG
9520 && LDBL_MAX_EXP == DBL_MAX_EXP
9521 && LDBL_MIN_EXP == DBL_MIN_EXP
9522 ? 1 : -1];
8690e634 9523
c0c3707f
CB
9524 ;
9525 return 0;
9526}
9527_ACEOF
9528if ac_fn_c_try_compile "$LINENO"; then :
9529 gl_cv_long_double_equals_double=yes
9530else
9531 gl_cv_long_double_equals_double=no
9532fi
9533rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9534
c0c3707f
CB
9535fi
9536{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
9537$as_echo "$gl_cv_long_double_equals_double" >&6; }
9538 if test $gl_cv_long_double_equals_double = yes; then
8690e634 9539
c0c3707f 9540$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
6ec2e0f5 9541
c0c3707f
CB
9542 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
9543 else
9544 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
9545 fi
8690e634 9546
6ec2e0f5 9547
6ec2e0f5 9548
6ec2e0f5
SDJ
9549
9550
6ec2e0f5 9551
8690e634
JK
9552
9553
c0c3707f
CB
9554 ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
9555"
9556if test "x$ac_cv_have_decl_frexpl" = xyes; then :
8690e634 9557
c0c3707f
CB
9558else
9559 HAVE_DECL_FREXPL=0
9560fi
8690e634 9561
6ec2e0f5 9562
c0c3707f
CB
9563 FREXPL_LIBM=
9564 if test $HAVE_DECL_FREXPL = 1; then
6ec2e0f5 9565
c0c3707f
CB
9566 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
9567$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
9568if ${gl_cv_func_frexpl_no_libm+:} false; then :
8690e634
JK
9569 $as_echo_n "(cached) " >&6
9570else
c0c3707f
CB
9571
9572 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9573/* end confdefs.h. */
c0c3707f
CB
9574#include <math.h>
9575 long double x;
9576int
9577main ()
9578{
9579int e; return frexpl (x, &e) > 0;
9580 ;
9581 return 0;
9582}
9583_ACEOF
9584if ac_fn_c_try_link "$LINENO"; then :
9585 gl_cv_func_frexpl_no_libm=yes
9586else
9587 gl_cv_func_frexpl_no_libm=no
9588fi
9589rm -f core conftest.err conftest.$ac_objext \
9590 conftest$ac_exeext conftest.$ac_ext
8690e634 9591
c0c3707f
CB
9592fi
9593{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
9594$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
6ec2e0f5 9595
c0c3707f
CB
9596 if test $gl_cv_func_frexpl_no_libm = no; then
9597 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5
9598$as_echo_n "checking whether frexpl() can be used with libm... " >&6; }
9599if ${gl_cv_func_frexpl_in_libm+:} false; then :
9600 $as_echo_n "(cached) " >&6
9601else
6ec2e0f5 9602
c0c3707f
CB
9603 save_LIBS="$LIBS"
9604 LIBS="$LIBS -lm"
9605 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9606/* end confdefs.h. */
9607#include <math.h>
9608 long double x;
9609int
9610main ()
9611{
9612int e; return frexpl (x, &e) > 0;
9613 ;
9614 return 0;
9615}
9616_ACEOF
9617if ac_fn_c_try_link "$LINENO"; then :
9618 gl_cv_func_frexpl_in_libm=yes
9619else
9620 gl_cv_func_frexpl_in_libm=no
9621fi
9622rm -f core conftest.err conftest.$ac_objext \
9623 conftest$ac_exeext conftest.$ac_ext
9624 LIBS="$save_LIBS"
6ec2e0f5 9625
c0c3707f
CB
9626fi
9627{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5
9628$as_echo "$gl_cv_func_frexpl_in_libm" >&6; }
9629 if test $gl_cv_func_frexpl_in_libm = yes; then
9630 FREXPL_LIBM=-lm
9631 fi
9632 fi
9633 if test $gl_cv_func_frexpl_no_libm = yes \
9634 || test $gl_cv_func_frexpl_in_libm = yes; then
9635 save_LIBS="$LIBS"
9636 LIBS="$LIBS $FREXPL_LIBM"
8690e634 9637
8690e634 9638
c0c3707f
CB
9639 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
9640$as_echo_n "checking whether frexpl works... " >&6; }
9641if ${gl_cv_func_frexpl_works+:} false; then :
9642 $as_echo_n "(cached) " >&6
9643else
8690e634 9644
c0c3707f 9645 if test "$cross_compiling" = yes; then :
8690e634 9646
c0c3707f
CB
9647 case "$host_os" in
9648 aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
9649 gl_cv_func_frexpl_works="guessing no";;
9650 *) gl_cv_func_frexpl_works="guessing yes";;
9651 esac
8690e634 9652
c0c3707f
CB
9653else
9654 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9655/* end confdefs.h. */
8690e634 9656
c0c3707f
CB
9657#include <float.h>
9658#include <math.h>
9659/* Override the values of <float.h>, like done in float.in.h. */
9660#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
9661# undef LDBL_MIN_EXP
9662# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9663#endif
c0c3707f
CB
9664#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
9665# undef LDBL_MIN_EXP
9666# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9667#endif
c0c3707f
CB
9668#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
9669# undef LDBL_MIN_EXP
9670# define LDBL_MIN_EXP DBL_MIN_EXP
6ec2e0f5 9671#endif
c0c3707f
CB
9672#if defined __sgi && (LDBL_MANT_DIG >= 106)
9673# if defined __GNUC__
9674# undef LDBL_MIN_EXP
9675# define LDBL_MIN_EXP DBL_MIN_EXP
9676# endif
6ec2e0f5 9677#endif
c0c3707f
CB
9678extern
9679#ifdef __cplusplus
9680"C"
9681#endif
9682long double frexpl (long double, int *);
9683int main()
8690e634 9684{
c0c3707f
CB
9685 int result = 0;
9686 volatile long double x;
9687 /* Test on finite numbers that fails on AIX 5.1. */
9688 x = 16.0L;
9689 {
9690 int exp = -9999;
9691 frexpl (x, &exp);
9692 if (exp != 5)
9693 result |= 1;
9694 }
9695 /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
9696 function returns an invalid (incorrectly normalized) value: it returns
9697 y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
9698 but the correct result is
9699 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
9700 x = 1.01L;
9701 {
9702 int exp = -9999;
9703 long double y = frexpl (x, &exp);
9704 if (!(exp == 1 && y == 0.505L))
9705 result |= 2;
9706 }
9707 /* Test on large finite numbers. This fails on BeOS at i = 16322, while
9708 LDBL_MAX_EXP = 16384.
9709 In the loop end test, we test x against Infinity, rather than comparing
9710 i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
9711 {
9712 int i;
9713 for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
9714 {
9715 int exp = -9999;
9716 frexpl (x, &exp);
9717 if (exp != i)
9718 {
9719 result |= 4;
9720 break;
9721 }
9722 }
9723 }
9724 /* Test on denormalized numbers. */
9725 {
9726 int i;
9727 for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
9728 ;
9729 if (x > 0.0L)
9730 {
9731 int exp;
9732 long double y = frexpl (x, &exp);
9733 /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
9734 exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
9735 if (exp != LDBL_MIN_EXP - 1)
9736 result |= 8;
9737 }
9738 }
9739 /* Test on infinite numbers. */
9740 x = 1.0L / 0.0L;
9741 {
9742 int exp;
9743 long double y = frexpl (x, &exp);
9744 if (y != x)
9745 result |= 16;
9746 }
9747 return result;
8690e634
JK
9748}
9749_ACEOF
c0c3707f
CB
9750if ac_fn_c_try_run "$LINENO"; then :
9751 gl_cv_func_frexpl_works=yes
6ec2e0f5 9752else
c0c3707f
CB
9753 gl_cv_func_frexpl_works=no
9754fi
9755rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9756 conftest.$ac_objext conftest.beam conftest.$ac_ext
9757fi
8690e634 9758
8690e634 9759
c0c3707f
CB
9760fi
9761{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
9762$as_echo "$gl_cv_func_frexpl_works" >&6; }
8690e634 9763
c0c3707f
CB
9764 LIBS="$save_LIBS"
9765 case "$gl_cv_func_frexpl_works" in
9766 *yes) gl_func_frexpl=yes ;;
9767 *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
9768 esac
9769 else
9770 gl_func_frexpl=no
9771 fi
9772 if test $gl_func_frexpl = yes; then
8690e634 9773
c0c3707f 9774$as_echo "#define HAVE_FREXPL 1" >>confdefs.h
8690e634 9775
c0c3707f
CB
9776 fi
9777 fi
9778 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
9779 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
8690e634 9780
c0c3707f
CB
9781 FREXPL_LIBM="$FREXP_LIBM"
9782 else
9783 FREXPL_LIBM=
9784 fi
9785 fi
6ec2e0f5 9786
6ec2e0f5 9787
6ec2e0f5 9788
c0c3707f
CB
9789 GNULIB_FCHMODAT=0;
9790 GNULIB_FSTAT=0;
9791 GNULIB_FSTATAT=0;
9792 GNULIB_FUTIMENS=0;
9793 GNULIB_LCHMOD=0;
9794 GNULIB_LSTAT=0;
9795 GNULIB_MKDIRAT=0;
9796 GNULIB_MKFIFO=0;
9797 GNULIB_MKFIFOAT=0;
9798 GNULIB_MKNOD=0;
9799 GNULIB_MKNODAT=0;
9800 GNULIB_STAT=0;
9801 GNULIB_UTIMENSAT=0;
9802 GNULIB_OVERRIDES_STRUCT_STAT=0;
9803 HAVE_FCHMODAT=1;
9804 HAVE_FSTATAT=1;
9805 HAVE_FUTIMENS=1;
9806 HAVE_LCHMOD=1;
9807 HAVE_LSTAT=1;
9808 HAVE_MKDIRAT=1;
9809 HAVE_MKFIFO=1;
9810 HAVE_MKFIFOAT=1;
9811 HAVE_MKNOD=1;
9812 HAVE_MKNODAT=1;
9813 HAVE_UTIMENSAT=1;
5df4cba6 9814 REPLACE_FCHMODAT=0;
c0c3707f
CB
9815 REPLACE_FSTAT=0;
9816 REPLACE_FSTATAT=0;
9817 REPLACE_FUTIMENS=0;
9818 REPLACE_LSTAT=0;
9819 REPLACE_MKDIR=0;
9820 REPLACE_MKFIFO=0;
9821 REPLACE_MKNOD=0;
9822 REPLACE_STAT=0;
9823 REPLACE_UTIMENSAT=0;
9824
9825{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
9826$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
9827if ${ac_cv_header_stat_broken+:} false; then :
9828 $as_echo_n "(cached) " >&6
9829else
9830 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9831/* end confdefs.h. */
9832#include <sys/types.h>
9833#include <sys/stat.h>
9834
9835#if defined S_ISBLK && defined S_IFDIR
9836extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
9837#endif
9838
9839#if defined S_ISBLK && defined S_IFCHR
9840extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
9841#endif
9842
9843#if defined S_ISLNK && defined S_IFREG
9844extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
9845#endif
8690e634 9846
c0c3707f
CB
9847#if defined S_ISSOCK && defined S_IFREG
9848extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
9849#endif
8690e634 9850
c0c3707f
CB
9851_ACEOF
9852if ac_fn_c_try_compile "$LINENO"; then :
9853 ac_cv_header_stat_broken=no
9854else
9855 ac_cv_header_stat_broken=yes
6ec2e0f5
SDJ
9856fi
9857rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 9858fi
c0c3707f
CB
9859{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
9860$as_echo "$ac_cv_header_stat_broken" >&6; }
9861if test $ac_cv_header_stat_broken = yes; then
8690e634 9862
c0c3707f 9863$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
49e4877c 9864
c0c3707f 9865fi
49e4877c
PA
9866
9867
9868
9869
8690e634 9870
c0c3707f
CB
9871 case "$host_os" in
9872 mingw*)
9873 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
9874$as_echo_n "checking for 64-bit off_t... " >&6; }
9875if ${gl_cv_type_off_t_64+:} false; then :
9876 $as_echo_n "(cached) " >&6
9877else
9878 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9879/* end confdefs.h. */
9880#include <sys/types.h>
9881 int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
8690e634 9882
6ec2e0f5
SDJ
9883int
9884main ()
9885{
8690e634 9886
6ec2e0f5
SDJ
9887 ;
9888 return 0;
9889}
9890_ACEOF
9891if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9892 gl_cv_type_off_t_64=yes
9893else
9894 gl_cv_type_off_t_64=no
6ec2e0f5
SDJ
9895fi
9896rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9897
c0c3707f
CB
9898fi
9899{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
9900$as_echo "$gl_cv_type_off_t_64" >&6; }
9901 if test $gl_cv_type_off_t_64 = no; then
9902 WINDOWS_64_BIT_OFF_T=1
9903 else
9904 WINDOWS_64_BIT_OFF_T=0
9905 fi
9906 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
9907$as_echo_n "checking for 64-bit st_size... " >&6; }
9908if ${gl_cv_member_st_size_64+:} false; then :
6ec2e0f5
SDJ
9909 $as_echo_n "(cached) " >&6
9910else
c0c3707f 9911 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 9912/* end confdefs.h. */
c0c3707f
CB
9913#include <sys/types.h>
9914 struct stat buf;
9915 int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
8690e634 9916
6ec2e0f5
SDJ
9917int
9918main ()
9919{
8690e634 9920
6ec2e0f5
SDJ
9921 ;
9922 return 0;
9923}
9924_ACEOF
9925if ac_fn_c_try_compile "$LINENO"; then :
698be2d8
CB
9926 gl_cv_member_st_size_64=yes
9927else
9928 gl_cv_member_st_size_64=no
9929fi
9930rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9931
9932fi
9933{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
9934$as_echo "$gl_cv_member_st_size_64" >&6; }
9935 if test $gl_cv_member_st_size_64 = no; then
9936 WINDOWS_64_BIT_ST_SIZE=1
9937 else
9938 WINDOWS_64_BIT_ST_SIZE=0
9939 fi
9940 ;;
9941 *)
9942 WINDOWS_64_BIT_OFF_T=0
9943 WINDOWS_64_BIT_ST_SIZE=0
9944 ;;
9945 esac
9946
9947{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
9948$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
9949if ${ac_cv_c_restrict+:} false; then :
9950 $as_echo_n "(cached) " >&6
9951else
9952 ac_cv_c_restrict=no
9953 # The order here caters to the fact that C++ does not require restrict.
9954 for ac_kw in __restrict __restrict__ _Restrict restrict; do
9955 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9956/* end confdefs.h. */
9957typedef int *int_ptr;
9958 int foo (int_ptr $ac_kw ip) { return ip[0]; }
9959 int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
9960 int bar (int ip[$ac_kw]) { return ip[0]; }
9961
9962int
9963main ()
9964{
9965int s[1];
9966 int *$ac_kw t = s;
9967 t[0] = 0;
9968 return foo (t) + bar (t);
9969
9970 ;
9971 return 0;
9972}
9973_ACEOF
9974if ac_fn_c_try_compile "$LINENO"; then :
9975 ac_cv_c_restrict=$ac_kw
6ec2e0f5
SDJ
9976fi
9977rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
698be2d8
CB
9978 test "$ac_cv_c_restrict" != no && break
9979 done
8690e634 9980
6ec2e0f5 9981fi
698be2d8
CB
9982{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
9983$as_echo "$ac_cv_c_restrict" >&6; }
9984
9985 case $ac_cv_c_restrict in
9986 restrict) ;;
9987 no) $as_echo "#define restrict /**/" >>confdefs.h
9988 ;;
9989 *) cat >>confdefs.h <<_ACEOF
9990#define restrict $ac_cv_c_restrict
9991_ACEOF
9992 ;;
9993 esac
8690e634
JK
9994
9995
9996
9997
9998
9999
c0c3707f
CB
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009 if test $gl_cv_have_include_next = yes; then
10010 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
10011 else
10012 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
10013$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
10014if ${gl_cv_next_sys_stat_h+:} false; then :
8690e634
JK
10015 $as_echo_n "(cached) " >&6
10016else
10017
c0c3707f 10018 if test $ac_cv_header_sys_stat_h = yes; then
4a626d0a
PA
10019
10020
4a626d0a 10021
c0c3707f
CB
10022
10023 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10024/* end confdefs.h. */
10025#include <sys/stat.h>
6ec2e0f5 10026_ACEOF
c0c3707f
CB
10027 case "$host_os" in
10028 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10029 *) gl_absname_cpp="$ac_cpp" ;;
10030 esac
10031
10032 case "$host_os" in
10033 mingw*)
10034 gl_dirsep_regex='[/\\]'
10035 ;;
10036 *)
10037 gl_dirsep_regex='\/'
10038 ;;
10039 esac
10040 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10041 gl_header_literal_regex=`echo 'sys/stat.h' \
10042 | sed -e "$gl_make_literal_regex_sed"`
10043 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10044 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10045 s|^/[^/]|//&|
10046 p
10047 q
10048 }'
10049
10050 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10051 sed -n "$gl_absolute_header_sed"`
10052
10053 gl_header=$gl_cv_absolute_sys_stat_h
10054 gl_cv_next_sys_stat_h='"'$gl_header'"'
10055 else
10056 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
10057 fi
10058
10059
10060fi
10061{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
10062$as_echo "$gl_cv_next_sys_stat_h" >&6; }
10063 fi
10064 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
10065
10066 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10067 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10068 gl_next_as_first_directive='<'sys/stat.h'>'
10069 else
10070 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10071 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
10072 fi
10073 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
10074
10075
10076
10077
10078
10079
10080
10081
10082 WINDOWS_STAT_TIMESPEC=0
10083
10084
10085
10086
4a626d0a 10087
4a626d0a 10088
8690e634
JK
10089
10090
c0c3707f
CB
10091 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
10092 #include <sys/stat.h>
10093"
10094if test "x$ac_cv_type_nlink_t" = xyes; then :
8690e634 10095
6ec2e0f5 10096else
8690e634 10097
c0c3707f 10098$as_echo "#define nlink_t int" >>confdefs.h
6ec2e0f5 10099
6ec2e0f5 10100fi
8690e634
JK
10101
10102
10103
10104
10105
10106
10107
698be2d8
CB
10108
10109
c0c3707f
CB
10110 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
10111$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
10112if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
8690e634 10113 $as_echo_n "(cached) " >&6
c0c3707f
CB
10114else
10115 rm -f conftest.sym conftest.file
10116 echo >conftest.file
10117 if test "$cross_compiling" = yes; then :
10118 case "$host_os" in
10119 linux-* | linux)
10120 # Guess yes on Linux systems.
10121 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
10122 *-gnu* | gnu*)
10123 # Guess yes on glibc systems.
10124 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
10125 mingw*)
10126 # Guess no on native Windows.
10127 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
10128 *)
10129 # If we don't know, obey --enable-cross-guesses.
10130 gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
10131 esac
10132
8690e634
JK
10133else
10134 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10135/* end confdefs.h. */
c0c3707f 10136$ac_includes_default
8690e634
JK
10137int
10138main ()
10139{
c0c3707f
CB
10140struct stat sbuf;
10141 if (symlink ("conftest.file", "conftest.sym") != 0)
10142 return 1;
10143 /* Linux will dereference the symlink and fail, as required by
10144 POSIX. That is better in the sense that it means we will not
10145 have to compile and use the lstat wrapper. */
10146 return lstat ("conftest.sym/", &sbuf) == 0;
6ec2e0f5 10147
8690e634
JK
10148 ;
10149 return 0;
10150}
10151_ACEOF
c0c3707f
CB
10152if ac_fn_c_try_run "$LINENO"; then :
10153 gl_cv_func_lstat_dereferences_slashed_symlink=yes
8690e634 10154else
c0c3707f 10155 gl_cv_func_lstat_dereferences_slashed_symlink=no
8690e634 10156fi
c0c3707f
CB
10157rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10158 conftest.$ac_objext conftest.beam conftest.$ac_ext
10159fi
10160
10161 rm -f conftest.sym conftest.file
6ec2e0f5 10162
8690e634 10163fi
c0c3707f
CB
10164{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
10165$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
10166 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
10167 *yes)
10168
10169cat >>confdefs.h <<_ACEOF
10170#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
8690e634
JK
10171_ACEOF
10172
c0c3707f
CB
10173 ;;
10174 esac
8690e634 10175
8690e634 10176
8690e634 10177
8690e634 10178
c0c3707f
CB
10179
10180 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
10181$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
10182if ${gl_cv_func_getcwd_null+:} false; then :
8690e634
JK
10183 $as_echo_n "(cached) " >&6
10184else
c0c3707f
CB
10185 if test "$cross_compiling" = yes; then :
10186 case "$host_os" in
10187 # Guess yes on glibc systems.
10188 *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
10189 # Guess yes on musl systems.
10190 *-musl*) gl_cv_func_getcwd_null="guessing yes";;
10191 # Guess yes on Cygwin.
10192 cygwin*) gl_cv_func_getcwd_null="guessing yes";;
10193 # If we don't know, obey --enable-cross-guesses.
10194 *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
10195 esac
10196
10197else
10198 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
10199/* end confdefs.h. */
10200
c0c3707f
CB
10201# include <stdlib.h>
10202# if HAVE_UNISTD_H
10203# include <unistd.h>
10204# else /* on Windows with MSVC */
10205# include <direct.h>
10206# endif
10207# ifndef getcwd
10208 char *getcwd ();
10209# endif
8690e634
JK
10210
10211int
10212main ()
10213{
10214
c0c3707f
CB
10215#if defined _WIN32 && ! defined __CYGWIN__
10216/* mingw cwd does not start with '/', but getcwd does allocate.
10217 However, mingw fails to honor non-zero size. */
10218#else
10219 if (chdir ("/") != 0)
10220 return 1;
10221 else
10222 {
10223 char *f = getcwd (NULL, 0);
10224 if (! f)
10225 return 2;
10226 if (f[0] != '/')
10227 { free (f); return 3; }
10228 if (f[1] != '\0')
10229 { free (f); return 4; }
10230 free (f);
10231 return 0;
10232 }
10233#endif
10234
8690e634
JK
10235 ;
10236 return 0;
10237}
10238_ACEOF
c0c3707f
CB
10239if ac_fn_c_try_run "$LINENO"; then :
10240 gl_cv_func_getcwd_null=yes
10241else
10242 gl_cv_func_getcwd_null=no
8690e634 10243fi
c0c3707f
CB
10244rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10245 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 10246fi
8690e634 10247
c0c3707f
CB
10248fi
10249{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
10250$as_echo "$gl_cv_func_getcwd_null" >&6; }
8690e634 10251
6ec2e0f5 10252
c0c3707f
CB
10253 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
10254$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
10255if ${gl_cv_func_getcwd_posix_signature+:} false; then :
8690e634
JK
10256 $as_echo_n "(cached) " >&6
10257else
c0c3707f 10258 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 10259/* end confdefs.h. */
c0c3707f 10260#include <unistd.h>
88b48903
WN
10261int
10262main ()
10263{
c0c3707f
CB
10264extern
10265 #ifdef __cplusplus
10266 "C"
10267 #endif
10268 char *getcwd (char *, size_t);
88b48903
WN
10269
10270 ;
10271 return 0;
10272}
c0c3707f 10273
88b48903
WN
10274_ACEOF
10275if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
10276 gl_cv_func_getcwd_posix_signature=yes
10277else
10278 gl_cv_func_getcwd_posix_signature=no
8690e634 10279fi
88b48903 10280rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 10281
c0c3707f
CB
10282fi
10283{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
10284$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
8690e634 10285
c0c3707f
CB
10286ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
10287if test "x$ac_cv_have_decl_getcwd" = xyes; then :
10288 ac_have_decl=1
10289else
10290 ac_have_decl=0
10291fi
8690e634 10292
c0c3707f
CB
10293cat >>confdefs.h <<_ACEOF
10294#define HAVE_DECL_GETCWD $ac_have_decl
10295_ACEOF
8690e634
JK
10296
10297
7a6dbc2f 10298
c0c3707f
CB
10299ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
10300if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
10301 ac_have_decl=1
88b48903 10302else
c0c3707f 10303 ac_have_decl=0
88b48903 10304fi
8690e634 10305
c0c3707f
CB
10306cat >>confdefs.h <<_ACEOF
10307#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
10308_ACEOF
8690e634 10309
c0c3707f
CB
10310ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default"
10311if test "x$ac_cv_have_decl_getlogin_r" = xyes; then :
10312 ac_have_decl=1
10313else
10314 ac_have_decl=0
10315fi
8690e634 10316
c0c3707f
CB
10317cat >>confdefs.h <<_ACEOF
10318#define HAVE_DECL_GETLOGIN_R $ac_have_decl
10319_ACEOF
8690e634
JK
10320
10321
6ec2e0f5 10322
c0c3707f
CB
10323ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default"
10324if test "x$ac_cv_have_decl_getlogin" = xyes; then :
10325 ac_have_decl=1
6ec2e0f5 10326else
c0c3707f 10327 ac_have_decl=0
88b48903 10328fi
8690e634 10329
c0c3707f
CB
10330cat >>confdefs.h <<_ACEOF
10331#define HAVE_DECL_GETLOGIN $ac_have_decl
10332_ACEOF
8690e634
JK
10333
10334
10335
c0c3707f
CB
10336 case $host_os in
10337 mingw*)
10338 LIB_GETLOGIN='-ladvapi32' ;;
10339 *)
10340 LIB_GETLOGIN= ;;
10341 esac
6ec2e0f5 10342
472fa5ee
SM
10343
10344
10345
6ec2e0f5
SDJ
10346
10347
10348
698be2d8
CB
10349 GNULIB_GETRANDOM=0;
10350 HAVE_GETRANDOM=1;
10351 REPLACE_GETRANDOM=0;
10352
10353
10354
10355
c0c3707f
CB
10356 GNULIB_GETTIMEOFDAY=0;
10357 HAVE_GETTIMEOFDAY=1;
10358 HAVE_STRUCT_TIMEVAL=1;
10359 HAVE_SYS_TIME_H=1;
10360 REPLACE_GETTIMEOFDAY=0;
10361 REPLACE_STRUCT_TIMEVAL=0;
472fa5ee 10362
472fa5ee 10363
6ec2e0f5
SDJ
10364
10365
10366
10367
10368
10369
472fa5ee
SM
10370
10371
10372
6ec2e0f5
SDJ
10373
10374
10375
10376
10377
10378 if test $gl_cv_have_include_next = yes; then
c0c3707f 10379 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10380 else
c0c3707f
CB
10381 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
10382$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
10383if ${gl_cv_next_sys_time_h+:} false; then :
6ec2e0f5 10384 $as_echo_n "(cached) " >&6
88b48903 10385else
8690e634 10386
c0c3707f 10387 if test $ac_cv_header_sys_time_h = yes; then
8690e634
JK
10388
10389
8690e634
JK
10390
10391
6ec2e0f5
SDJ
10392 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10393/* end confdefs.h. */
c0c3707f 10394#include <sys/time.h>
88b48903 10395_ACEOF
6ec2e0f5
SDJ
10396 case "$host_os" in
10397 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10398 *) gl_absname_cpp="$ac_cpp" ;;
10399 esac
8690e634 10400
6ec2e0f5
SDJ
10401 case "$host_os" in
10402 mingw*)
10403 gl_dirsep_regex='[/\\]'
10404 ;;
10405 *)
10406 gl_dirsep_regex='\/'
88b48903
WN
10407 ;;
10408 esac
6ec2e0f5 10409 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 10410 gl_header_literal_regex=`echo 'sys/time.h' \
6ec2e0f5
SDJ
10411 | sed -e "$gl_make_literal_regex_sed"`
10412 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10413 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10414 s|^/[^/]|//&|
10415 p
10416 q
10417 }'
8690e634 10418
c0c3707f 10419 gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5 10420 sed -n "$gl_absolute_header_sed"`
8690e634 10421
c0c3707f
CB
10422 gl_header=$gl_cv_absolute_sys_time_h
10423 gl_cv_next_sys_time_h='"'$gl_header'"'
6ec2e0f5 10424 else
c0c3707f 10425 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10426 fi
88b48903 10427
88b48903 10428
88b48903 10429fi
c0c3707f
CB
10430{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
10431$as_echo "$gl_cv_next_sys_time_h" >&6; }
6ec2e0f5 10432 fi
c0c3707f 10433 NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
88b48903 10434
6ec2e0f5
SDJ
10435 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10436 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 10437 gl_next_as_first_directive='<'sys/time.h'>'
6ec2e0f5
SDJ
10438 else
10439 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f
CB
10440 gl_next_as_first_directive=$gl_cv_next_sys_time_h
10441 fi
10442 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
6ec2e0f5 10443
6ec2e0f5
SDJ
10444
10445
10446
6ec2e0f5 10447
c0c3707f
CB
10448 if test $ac_cv_header_sys_time_h != yes; then
10449 HAVE_SYS_TIME_H=0
10450 fi
6ec2e0f5 10451
6ec2e0f5 10452
6ec2e0f5 10453
6ec2e0f5 10454
6ec2e0f5 10455
c0c3707f
CB
10456 if test $ac_cv_header_sys_socket_h != yes; then
10457 for ac_header in winsock2.h
10458do :
10459 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10460if test "x$ac_cv_header_winsock2_h" = xyes; then :
10461 cat >>confdefs.h <<_ACEOF
10462#define HAVE_WINSOCK2_H 1
6ec2e0f5 10463_ACEOF
6ec2e0f5 10464
6ec2e0f5 10465fi
6ec2e0f5 10466
c0c3707f 10467done
6ec2e0f5 10468
c0c3707f
CB
10469 fi
10470 if test "$ac_cv_header_winsock2_h" = yes; then
10471 HAVE_WINSOCK2_H=1
10472 UNISTD_H_HAVE_WINSOCK2_H=1
10473 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
10474 else
10475 HAVE_WINSOCK2_H=0
10476 fi
10477
10478
10479 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
10480$as_echo_n "checking for struct timeval... " >&6; }
10481if ${gl_cv_sys_struct_timeval+:} false; then :
10482 $as_echo_n "(cached) " >&6
10483else
10484 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10485/* end confdefs.h. */
c0c3707f
CB
10486#if HAVE_SYS_TIME_H
10487 #include <sys/time.h>
10488 #endif
10489 #include <time.h>
10490 #if HAVE_WINSOCK2_H
10491 # include <winsock2.h>
10492 #endif
6ec2e0f5
SDJ
10493
10494int
10495main ()
10496{
c0c3707f 10497static struct timeval x; x.tv_sec = x.tv_usec;
6ec2e0f5
SDJ
10498 ;
10499 return 0;
10500}
10501_ACEOF
10502if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10503 gl_cv_sys_struct_timeval=yes
6ec2e0f5 10504else
c0c3707f 10505 gl_cv_sys_struct_timeval=no
6ec2e0f5
SDJ
10506fi
10507rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903 10508
c0c3707f
CB
10509fi
10510{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
10511$as_echo "$gl_cv_sys_struct_timeval" >&6; }
10512 if test $gl_cv_sys_struct_timeval != yes; then
10513 HAVE_STRUCT_TIMEVAL=0
10514 else
10515 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
10516$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
10517if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
10518 $as_echo_n "(cached) " >&6
10519else
10520 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88b48903 10521/* end confdefs.h. */
c0c3707f
CB
10522#if HAVE_SYS_TIME_H
10523 #include <sys/time.h>
10524 #endif
10525 #include <time.h>
10526 #if HAVE_WINSOCK2_H
10527 # include <winsock2.h>
10528 #endif
88b48903
WN
10529
10530int
10531main ()
10532{
c0c3707f
CB
10533static struct timeval x;
10534 typedef int verify_tv_sec_type[
10535 sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
10536 ];
88b48903
WN
10537
10538 ;
10539 return 0;
10540}
10541_ACEOF
10542if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10543 gl_cv_sys_struct_timeval_tv_sec=yes
88b48903 10544else
c0c3707f 10545 gl_cv_sys_struct_timeval_tv_sec=no
88b48903
WN
10546fi
10547rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10548
88b48903 10549fi
c0c3707f
CB
10550{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
10551$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
10552 if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
10553 REPLACE_STRUCT_TIMEVAL=1
88b48903 10554 fi
c0c3707f 10555 fi
88b48903 10556
c0c3707f
CB
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567 NEED_LOCALTIME_BUFFER=0
10568
10569
10570 GNULIB_CTIME=0;
10571 GNULIB_MKTIME=0;
10572 GNULIB_LOCALTIME=0;
10573 GNULIB_NANOSLEEP=0;
10574 GNULIB_STRFTIME=0;
10575 GNULIB_STRPTIME=0;
10576 GNULIB_TIMEGM=0;
10577 GNULIB_TIME_R=0;
10578 GNULIB_TIME_RZ=0;
10579 GNULIB_TZSET=0;
10580 HAVE_DECL_LOCALTIME_R=1;
10581 HAVE_NANOSLEEP=1;
10582 HAVE_STRPTIME=1;
10583 HAVE_TIMEGM=1;
10584 HAVE_TZSET=1;
10585 HAVE_TIMEZONE_T=0;
10586 REPLACE_CTIME=GNULIB_PORTCHECK;
10587 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
10588 REPLACE_MKTIME=GNULIB_PORTCHECK;
10589 REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
10590 REPLACE_STRFTIME=GNULIB_PORTCHECK;
10591 REPLACE_TIMEGM=GNULIB_PORTCHECK;
10592 REPLACE_TZSET=GNULIB_PORTCHECK;
10593
10594 : ${GNULIB_GETTIMEOFDAY=0};
10595 REPLACE_GMTIME=0;
10596 REPLACE_LOCALTIME=0;
10597
10598
10599 GNULIB_GLOB=0;
10600 HAVE_GLOB=1;
10601 HAVE_GLOB_PATTERN_P=1;
10602 REPLACE_GLOB=0;
10603 REPLACE_GLOB_PATTERN_P=0;
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621 if test $gl_cv_have_include_next = yes; then
10622 gl_cv_next_glob_h='<'glob.h'>'
10623 else
10624 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5
10625$as_echo_n "checking absolute name of <glob.h>... " >&6; }
10626if ${gl_cv_next_glob_h+:} false; then :
10627 $as_echo_n "(cached) " >&6
88b48903 10628else
c0c3707f
CB
10629
10630 if test $ac_cv_header_glob_h = yes; then
10631
10632
10633
10634
88b48903
WN
10635 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10636/* end confdefs.h. */
c0c3707f
CB
10637#include <glob.h>
10638_ACEOF
10639 case "$host_os" in
10640 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10641 *) gl_absname_cpp="$ac_cpp" ;;
10642 esac
88b48903 10643
c0c3707f
CB
10644 case "$host_os" in
10645 mingw*)
10646 gl_dirsep_regex='[/\\]'
10647 ;;
10648 *)
10649 gl_dirsep_regex='\/'
10650 ;;
10651 esac
10652 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10653 gl_header_literal_regex=`echo 'glob.h' \
10654 | sed -e "$gl_make_literal_regex_sed"`
10655 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10656 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10657 s|^/[^/]|//&|
10658 p
10659 q
10660 }'
10661
10662 gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10663 sed -n "$gl_absolute_header_sed"`
10664
10665 gl_header=$gl_cv_absolute_glob_h
10666 gl_cv_next_glob_h='"'$gl_header'"'
10667 else
10668 gl_cv_next_glob_h='<'glob.h'>'
10669 fi
88b48903 10670
88b48903 10671
88b48903 10672fi
c0c3707f
CB
10673{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5
10674$as_echo "$gl_cv_next_glob_h" >&6; }
10675 fi
10676 NEXT_GLOB_H=$gl_cv_next_glob_h
88b48903 10677
c0c3707f
CB
10678 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10679 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10680 gl_next_as_first_directive='<'glob.h'>'
10681 else
10682 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10683 gl_next_as_first_directive=$gl_cv_next_glob_h
10684 fi
10685 NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive
88b48903 10686
88b48903
WN
10687
10688
10689
2196f55f 10690
c0c3707f
CB
10691 if test $ac_cv_header_glob_h = yes; then
10692 HAVE_GLOB_H=1
10693 else
10694 HAVE_GLOB_H=0
10695 fi
2196f55f 10696
6ec2e0f5 10697
c0c3707f
CB
10698 GLOB_H=''
10699 if false; then
10700 GLOB_H=glob.h
10701 else
10702 if test $ac_cv_header_glob_h != yes; then
10703 GLOB_H=glob.h
10704 fi
10705 fi
10706
10707
10708 if test -n "$GLOB_H"; then
10709 GL_GENERATE_GLOB_H_TRUE=
10710 GL_GENERATE_GLOB_H_FALSE='#'
88b48903 10711else
c0c3707f
CB
10712 GL_GENERATE_GLOB_H_TRUE='#'
10713 GL_GENERATE_GLOB_H_FALSE=
6ec2e0f5
SDJ
10714fi
10715
88b48903 10716
88b48903 10717
88b48903 10718
88b48903
WN
10719
10720
10721
10722
10723
10724
10725
10726
8690e634 10727
c0c3707f
CB
10728
10729
c0c3707f 10730
5df4cba6
SM
10731 if test -z "$gl_pthreadlib_body_done"; then
10732 gl_pthread_api=no
10733 LIBPTHREAD=
10734 LIBPMULTITHREAD=
10735 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
10736 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
10737 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
10738if test "x$ac_cv_header_pthread_h" = xyes; then :
10739 gl_have_pthread_h=yes
c0c3707f 10740else
5df4cba6
SM
10741 gl_have_pthread_h=no
10742fi
c0c3707f 10743
5df4cba6
SM
10744
10745 if test "$gl_have_pthread_h" = yes; then
10746 # Other possible tests:
10747 # -lpthreads (FSU threads, PCthreads)
10748 # -lgthreads
10749 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
10750 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
10751 # the second one only in libpthread, and lock.c needs it.
10752 #
10753 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
10754 # needs -pthread for some reason. See:
10755 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
10756 save_LIBS=$LIBS
10757 for gl_pthread in '' '-pthread'; do
10758 LIBS="$LIBS $gl_pthread"
10759 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 10760/* end confdefs.h. */
5df4cba6
SM
10761#include <pthread.h>
10762 pthread_mutex_t m;
10763 pthread_mutexattr_t ma;
10764
8690e634
JK
10765int
10766main ()
10767{
5df4cba6
SM
10768pthread_mutex_lock (&m);
10769 pthread_mutexattr_init (&ma);
8690e634
JK
10770 ;
10771 return 0;
10772}
10773_ACEOF
5df4cba6
SM
10774if ac_fn_c_try_link "$LINENO"; then :
10775 gl_pthread_api=yes
10776 LIBPTHREAD=$gl_pthread
10777 LIBPMULTITHREAD=$gl_pthread
c0c3707f 10778fi
5df4cba6
SM
10779rm -f core conftest.err conftest.$ac_objext \
10780 conftest$ac_exeext conftest.$ac_ext
10781 LIBS=$save_LIBS
10782 test $gl_pthread_api = yes && break
10783 done
6ec2e0f5 10784
5df4cba6
SM
10785 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
10786 # since it is defined as a macro on OSF/1.)
10787 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
10788 # The program links fine without libpthread. But it may actually
10789 # need to link with libpthread in order to create multiple threads.
10790 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
10791$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
10792if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
10793 $as_echo_n "(cached) " >&6
10794else
5df4cba6
SM
10795 ac_check_lib_save_LIBS=$LIBS
10796LIBS="-lpthread $LIBS"
10797cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 10798/* end confdefs.h. */
5df4cba6
SM
10799
10800/* Override any GCC internal prototype to avoid an error.
10801 Use char because int might match the return type of a GCC
10802 builtin and then its argument prototype would still apply. */
10803#ifdef __cplusplus
10804extern "C"
10805#endif
10806char pthread_kill ();
6ec2e0f5
SDJ
10807int
10808main ()
10809{
5df4cba6 10810return pthread_kill ();
6ec2e0f5
SDJ
10811 ;
10812 return 0;
10813}
10814_ACEOF
5df4cba6
SM
10815if ac_fn_c_try_link "$LINENO"; then :
10816 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 10817else
5df4cba6 10818 ac_cv_lib_pthread_pthread_kill=no
8690e634 10819fi
5df4cba6
SM
10820rm -f core conftest.err conftest.$ac_objext \
10821 conftest$ac_exeext conftest.$ac_ext
10822LIBS=$ac_check_lib_save_LIBS
10823fi
10824{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
10825$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
10826if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
10827 LIBPMULTITHREAD=-lpthread
10828 # On Solaris and HP-UX, most pthread functions exist also in libc.
10829 # Therefore pthread_in_use() needs to actually try to create a
10830 # thread: pthread_create from libc will fail, whereas
10831 # pthread_create will actually create a thread.
10832 # On Solaris 10 or newer, this test is no longer needed, because
10833 # libc contains the fully functional pthread functions.
10834 case "$host_os" in
10835 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
10836
10837$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
10838
10839 esac
c0c3707f 10840
6ec2e0f5 10841fi
8690e634 10842
5df4cba6
SM
10843 elif test $gl_pthread_api != yes; then
10844 # Some library is needed. Try libpthread and libc_r.
10845 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
10846$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
10847if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
10848 $as_echo_n "(cached) " >&6
10849else
10850 ac_check_lib_save_LIBS=$LIBS
10851LIBS="-lpthread $LIBS"
10852cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10853/* end confdefs.h. */
c0c3707f 10854
5df4cba6
SM
10855/* Override any GCC internal prototype to avoid an error.
10856 Use char because int might match the return type of a GCC
10857 builtin and then its argument prototype would still apply. */
10858#ifdef __cplusplus
10859extern "C"
10860#endif
10861char pthread_kill ();
10862int
10863main ()
10864{
10865return pthread_kill ();
10866 ;
10867 return 0;
10868}
10869_ACEOF
10870if ac_fn_c_try_link "$LINENO"; then :
10871 ac_cv_lib_pthread_pthread_kill=yes
10872else
10873 ac_cv_lib_pthread_pthread_kill=no
10874fi
10875rm -f core conftest.err conftest.$ac_objext \
10876 conftest$ac_exeext conftest.$ac_ext
10877LIBS=$ac_check_lib_save_LIBS
10878fi
10879{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
10880$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
10881if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
10882 gl_pthread_api=yes
10883 LIBPTHREAD=-lpthread
10884 LIBPMULTITHREAD=-lpthread
10885fi
c0c3707f 10886
5df4cba6
SM
10887 if test $gl_pthread_api != yes; then
10888 # For FreeBSD 4.
10889 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
10890$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
10891if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
10892 $as_echo_n "(cached) " >&6
10893else
10894 ac_check_lib_save_LIBS=$LIBS
10895LIBS="-lc_r $LIBS"
10896cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10897/* end confdefs.h. */
c0c3707f 10898
5df4cba6
SM
10899/* Override any GCC internal prototype to avoid an error.
10900 Use char because int might match the return type of a GCC
10901 builtin and then its argument prototype would still apply. */
10902#ifdef __cplusplus
10903extern "C"
10904#endif
10905char pthread_kill ();
10906int
10907main ()
10908{
10909return pthread_kill ();
10910 ;
10911 return 0;
10912}
10913_ACEOF
10914if ac_fn_c_try_link "$LINENO"; then :
10915 ac_cv_lib_c_r_pthread_kill=yes
10916else
10917 ac_cv_lib_c_r_pthread_kill=no
10918fi
10919rm -f core conftest.err conftest.$ac_objext \
10920 conftest$ac_exeext conftest.$ac_ext
10921LIBS=$ac_check_lib_save_LIBS
10922fi
10923{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
10924$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
10925if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
10926 gl_pthread_api=yes
10927 LIBPTHREAD=-lc_r
10928 LIBPMULTITHREAD=-lc_r
10929fi
c0c3707f 10930
5df4cba6
SM
10931 fi
10932 fi
10933 fi
10934 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
10935$as_echo_n "checking whether POSIX threads API is available... " >&6; }
10936 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
10937$as_echo "$gl_pthread_api" >&6; }
c0c3707f
CB
10938
10939
5df4cba6 10940 if test $gl_pthread_api = yes; then
c0c3707f 10941
5df4cba6 10942$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
c0c3707f 10943
5df4cba6 10944 fi
c0c3707f 10945
5df4cba6
SM
10946 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10947/* end confdefs.h. */
10948#include <sched.h>
10949int
10950main ()
10951{
10952sched_yield ();
10953 ;
10954 return 0;
10955}
10956_ACEOF
10957if ac_fn_c_try_link "$LINENO"; then :
10958 LIB_SCHED_YIELD=
c0c3707f 10959
5df4cba6
SM
10960else
10961 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
10962$as_echo_n "checking for sched_yield in -lrt... " >&6; }
10963if ${ac_cv_lib_rt_sched_yield+:} false; then :
c0c3707f 10964 $as_echo_n "(cached) " >&6
6ec2e0f5 10965else
5df4cba6
SM
10966 ac_check_lib_save_LIBS=$LIBS
10967LIBS="-lrt $LIBS"
10968cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10969/* end confdefs.h. */
6ec2e0f5 10970
5df4cba6
SM
10971/* Override any GCC internal prototype to avoid an error.
10972 Use char because int might match the return type of a GCC
10973 builtin and then its argument prototype would still apply. */
10974#ifdef __cplusplus
10975extern "C"
10976#endif
10977char sched_yield ();
10978int
10979main ()
10980{
10981return sched_yield ();
10982 ;
10983 return 0;
10984}
10985_ACEOF
10986if ac_fn_c_try_link "$LINENO"; then :
10987 ac_cv_lib_rt_sched_yield=yes
10988else
10989 ac_cv_lib_rt_sched_yield=no
10990fi
10991rm -f core conftest.err conftest.$ac_objext \
10992 conftest$ac_exeext conftest.$ac_ext
10993LIBS=$ac_check_lib_save_LIBS
10994fi
10995{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
10996$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
10997if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
10998 LIB_SCHED_YIELD=-lrt
10999else
11000 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
11001$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
11002if ${ac_cv_lib_posix4_sched_yield+:} false; then :
11003 $as_echo_n "(cached) " >&6
11004else
11005 ac_check_lib_save_LIBS=$LIBS
11006LIBS="-lposix4 $LIBS"
11007cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11008/* end confdefs.h. */
6ec2e0f5 11009
5df4cba6
SM
11010/* Override any GCC internal prototype to avoid an error.
11011 Use char because int might match the return type of a GCC
11012 builtin and then its argument prototype would still apply. */
11013#ifdef __cplusplus
11014extern "C"
11015#endif
11016char sched_yield ();
11017int
11018main ()
11019{
11020return sched_yield ();
11021 ;
11022 return 0;
11023}
11024_ACEOF
11025if ac_fn_c_try_link "$LINENO"; then :
11026 ac_cv_lib_posix4_sched_yield=yes
11027else
11028 ac_cv_lib_posix4_sched_yield=no
11029fi
11030rm -f core conftest.err conftest.$ac_objext \
11031 conftest$ac_exeext conftest.$ac_ext
11032LIBS=$ac_check_lib_save_LIBS
11033fi
11034{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
11035$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
11036if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
11037 LIB_SCHED_YIELD=-lposix4
6ec2e0f5 11038fi
8690e634 11039
5df4cba6 11040fi
8690e634 11041
8690e634 11042
5df4cba6
SM
11043fi
11044rm -f core conftest.err conftest.$ac_objext \
11045 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5
SDJ
11046
11047
5df4cba6 11048 gl_pthreadlib_body_done=done
c0c3707f 11049 fi
6ec2e0f5 11050
6ec2e0f5 11051
8690e634
JK
11052
11053
472fa5ee 11054
c0c3707f 11055
c0c3707f 11056
c0c3707f 11057
c0c3707f 11058
5df4cba6
SM
11059 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
11060$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
11061if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
11062 $as_echo_n "(cached) " >&6
11063else
11064 case "$host_os" in
11065 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
11066 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
11067 gl_cv_func_setlocale_null_all_mtsafe=no ;;
11068 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
11069 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
11070 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
11071 # If we don't know, obey --enable-cross-guesses.
11072 *)
11073 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
11074 esac
c0c3707f 11075
5e8754f9 11076fi
5df4cba6
SM
11077{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
11078$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
11079 case "$host_os" in
11080 mingw*) ;;
11081 *)
11082 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
11083 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
11084 fi
11085 ;;
11086 esac
11087 case "$gl_cv_func_setlocale_null_all_mtsafe" in
11088 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
11089 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
11090 esac
5e8754f9
SDJ
11091
11092cat >>confdefs.h <<_ACEOF
5df4cba6 11093#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
5e8754f9
SDJ
11094_ACEOF
11095
11096
5df4cba6
SM
11097 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
11098$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
11099if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
11100 $as_echo_n "(cached) " >&6
11101else
11102 case "$host_os" in
11103 # Guess no on OpenBSD, AIX.
11104 openbsd* | aix*)
11105 gl_cv_func_setlocale_null_one_mtsafe=no ;;
11106 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
11107 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
11108 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
11109 # If we don't know, obey --enable-cross-guesses.
11110 *)
11111 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
11112 esac
5abebf3c 11113
5df4cba6
SM
11114fi
11115{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
11116$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
11117 case "$host_os" in
11118 mingw*) ;;
11119 *)
11120 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
11121 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
11122 fi
11123 ;;
11124 esac
11125 case "$gl_cv_func_setlocale_null_one_mtsafe" in
11126 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
11127 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
11128 esac
5abebf3c 11129
c0c3707f 11130cat >>confdefs.h <<_ACEOF
5df4cba6 11131#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
5abebf3c 11132_ACEOF
c0c3707f
CB
11133
11134
5df4cba6
SM
11135 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
11136 case "$host_os" in
11137 mingw*) LIB_SETLOCALE_NULL= ;;
11138 *)
11139
11140
11141 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
11142$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
11143if ${gl_cv_have_weak+:} false; then :
11144 $as_echo_n "(cached) " >&6
5abebf3c 11145else
5df4cba6
SM
11146 gl_cv_have_weak=no
11147 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11148/* end confdefs.h. */
11149extern void xyzzy ();
11150#pragma weak xyzzy
11151int
11152main ()
11153{
11154xyzzy();
11155 ;
11156 return 0;
11157}
11158_ACEOF
11159if ac_fn_c_try_link "$LINENO"; then :
11160 gl_cv_have_weak=maybe
5abebf3c 11161fi
5df4cba6
SM
11162rm -f core conftest.err conftest.$ac_objext \
11163 conftest$ac_exeext conftest.$ac_ext
11164 if test $gl_cv_have_weak = maybe; then
11165 if test "$cross_compiling" = yes; then :
11166 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11167/* end confdefs.h. */
11168#ifdef __ELF__
11169 Extensible Linking Format
11170 #endif
c0c3707f 11171
5df4cba6
SM
11172_ACEOF
11173if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11174 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
11175 gl_cv_have_weak="guessing yes"
11176else
11177 gl_cv_have_weak="guessing no"
11178fi
11179rm -f conftest*
5abebf3c
CB
11180
11181
5df4cba6
SM
11182else
11183 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11184/* end confdefs.h. */
5abebf3c 11185
5df4cba6
SM
11186#include <stdio.h>
11187#pragma weak fputs
11188int main ()
11189{
11190 return (fputs == NULL);
11191}
c0c3707f 11192_ACEOF
5df4cba6
SM
11193if ac_fn_c_try_run "$LINENO"; then :
11194 gl_cv_have_weak=yes
11195else
11196 gl_cv_have_weak=no
11197fi
11198rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11199 conftest.$ac_objext conftest.beam conftest.$ac_ext
11200fi
11201
11202 fi
11203 case " $LDFLAGS " in
11204 *" -static "*) gl_cv_have_weak=no ;;
11205 esac
11206 case "$gl_cv_have_weak" in
11207 *yes)
11208 case "$host_os" in
11209 freebsd* | dragonfly*)
11210 : > conftest1.c
11211 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
11212 cat <<EOF > conftest2.c
11213#include <pthread.h>
11214#pragma weak pthread_mutexattr_gettype
11215int main ()
11216{
11217 return (pthread_mutexattr_gettype != NULL);
11218}
11219EOF
11220 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
11221 || gl_cv_have_weak=no
11222 rm -f conftest1.c libempty.so conftest2.c conftest
11223 ;;
11224 esac
11225 ;;
11226 esac
5abebf3c 11227
c0c3707f 11228fi
5df4cba6
SM
11229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
11230$as_echo "$gl_cv_have_weak" >&6; }
11231 case "$gl_cv_have_weak" in
11232 *yes)
5abebf3c 11233
5df4cba6 11234$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
5abebf3c 11235
5df4cba6
SM
11236 ;;
11237 esac
11238
11239 case "$gl_cv_have_weak" in
11240 *yes) LIB_SETLOCALE_NULL= ;;
11241 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
11242 esac
11243 ;;
11244 esac
5abebf3c 11245 else
5df4cba6 11246 LIB_SETLOCALE_NULL=
5abebf3c 11247 fi
5abebf3c
CB
11248
11249
11250
5abebf3c 11251
5abebf3c 11252
5df4cba6
SM
11253 GNULIB_SOCKET=0;
11254 GNULIB_CONNECT=0;
11255 GNULIB_ACCEPT=0;
11256 GNULIB_BIND=0;
11257 GNULIB_GETPEERNAME=0;
11258 GNULIB_GETSOCKNAME=0;
11259 GNULIB_GETSOCKOPT=0;
11260 GNULIB_LISTEN=0;
11261 GNULIB_RECV=0;
11262 GNULIB_SEND=0;
11263 GNULIB_RECVFROM=0;
11264 GNULIB_SENDTO=0;
11265 GNULIB_SETSOCKOPT=0;
11266 GNULIB_SHUTDOWN=0;
11267 GNULIB_ACCEPT4=0;
11268 HAVE_STRUCT_SOCKADDR_STORAGE=1;
11269 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
11270
11271 HAVE_SA_FAMILY_T=1;
11272 HAVE_ACCEPT4=1;
c0c3707f
CB
11273
11274
11275
11276
11277
5df4cba6
SM
11278 case "$host_os" in
11279 osf*)
c0c3707f 11280
5df4cba6 11281$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
c0c3707f 11282
5df4cba6
SM
11283 ;;
11284 esac
c0c3707f 11285
5df4cba6
SM
11286 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
11287$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
11288if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
5abebf3c
CB
11289 $as_echo_n "(cached) " >&6
11290else
5df4cba6
SM
11291
11292 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11293/* end confdefs.h. */
c0c3707f 11294#include <sys/socket.h>
c0c3707f
CB
11295int
11296main ()
11297{
5df4cba6 11298
c0c3707f
CB
11299 ;
11300 return 0;
11301}
11302_ACEOF
11303if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11304 gl_cv_header_sys_socket_h_selfcontained=yes
5abebf3c 11305else
5df4cba6 11306 gl_cv_header_sys_socket_h_selfcontained=no
5abebf3c 11307fi
c0c3707f 11308rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11309
5df4cba6
SM
11310fi
11311{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
11312$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
11313 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
11314 for ac_func in shutdown
11315do :
11316 ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
11317if test "x$ac_cv_func_shutdown" = xyes; then :
11318 cat >>confdefs.h <<_ACEOF
11319#define HAVE_SHUTDOWN 1
11320_ACEOF
c0c3707f 11321
5df4cba6
SM
11322fi
11323done
c0c3707f 11324
5df4cba6
SM
11325 if test $ac_cv_func_shutdown = yes; then
11326 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
11327$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
11328if ${gl_cv_header_sys_socket_h_shut+:} false; then :
5abebf3c
CB
11329 $as_echo_n "(cached) " >&6
11330else
5df4cba6
SM
11331
11332 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11333/* end confdefs.h. */
c0c3707f 11334#include <sys/socket.h>
c0c3707f
CB
11335int
11336main ()
11337{
5df4cba6 11338int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
c0c3707f
CB
11339 ;
11340 return 0;
11341}
11342_ACEOF
11343if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11344 gl_cv_header_sys_socket_h_shut=yes
c0c3707f 11345else
5df4cba6 11346 gl_cv_header_sys_socket_h_shut=no
c0c3707f
CB
11347fi
11348rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11349
5df4cba6
SM
11350fi
11351{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
11352$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
11353 if test $gl_cv_header_sys_socket_h_shut = no; then
11354 SYS_SOCKET_H='sys/socket.h'
11355 fi
11356 fi
c0c3707f 11357 fi
5df4cba6 11358 # We need to check for ws2tcpip.h now.
5abebf3c 11359
5abebf3c 11360
5abebf3c 11361
5abebf3c
CB
11362
11363
11364
11365
c0c3707f
CB
11366
11367
11368
11369
11370 if test $gl_cv_have_include_next = yes; then
5df4cba6 11371 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11372 else
5df4cba6
SM
11373 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
11374$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
11375if ${gl_cv_next_sys_socket_h+:} false; then :
5abebf3c
CB
11376 $as_echo_n "(cached) " >&6
11377else
5abebf3c 11378
5df4cba6 11379 if test $ac_cv_header_sys_socket_h = yes; then
5abebf3c 11380
5abebf3c
CB
11381
11382
c0c3707f
CB
11383
11384 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11385/* end confdefs.h. */
5df4cba6 11386#include <sys/socket.h>
c0c3707f
CB
11387_ACEOF
11388 case "$host_os" in
11389 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11390 *) gl_absname_cpp="$ac_cpp" ;;
11391 esac
11392
11393 case "$host_os" in
11394 mingw*)
11395 gl_dirsep_regex='[/\\]'
5abebf3c
CB
11396 ;;
11397 *)
c0c3707f 11398 gl_dirsep_regex='\/'
5abebf3c
CB
11399 ;;
11400 esac
c0c3707f 11401 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
5df4cba6 11402 gl_header_literal_regex=`echo 'sys/socket.h' \
c0c3707f
CB
11403 | sed -e "$gl_make_literal_regex_sed"`
11404 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11405 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11406 s|^/[^/]|//&|
11407 p
11408 q
11409 }'
5abebf3c 11410
5df4cba6 11411 gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
c0c3707f 11412 sed -n "$gl_absolute_header_sed"`
5abebf3c 11413
5df4cba6
SM
11414 gl_header=$gl_cv_absolute_sys_socket_h
11415 gl_cv_next_sys_socket_h='"'$gl_header'"'
c0c3707f 11416 else
5df4cba6 11417 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11418 fi
5abebf3c 11419
5abebf3c 11420
5abebf3c 11421fi
5df4cba6
SM
11422{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
11423$as_echo "$gl_cv_next_sys_socket_h" >&6; }
c0c3707f 11424 fi
5df4cba6 11425 NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
c0c3707f
CB
11426
11427 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11428 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
5df4cba6 11429 gl_next_as_first_directive='<'sys/socket.h'>'
c0c3707f
CB
11430 else
11431 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
5df4cba6 11432 gl_next_as_first_directive=$gl_cv_next_sys_socket_h
c0c3707f 11433 fi
5df4cba6 11434 NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
5abebf3c
CB
11435
11436
c0c3707f
CB
11437
11438
5df4cba6
SM
11439 if test $ac_cv_header_sys_socket_h = yes; then
11440 HAVE_SYS_SOCKET_H=1
11441 else
11442 HAVE_SYS_SOCKET_H=0
11443 fi
c0c3707f 11444
5abebf3c 11445
c0c3707f 11446
5df4cba6
SM
11447 if test $ac_cv_header_sys_socket_h = yes; then
11448 HAVE_WS2TCPIP_H=0
11449 else
11450 if test $ac_cv_header_ws2tcpip_h = yes; then
11451 HAVE_WS2TCPIP_H=1
11452 else
11453 HAVE_WS2TCPIP_H=0
11454 fi
11455 fi
11456
11457
11458
11459 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
11460 /* sys/types.h is not needed according to POSIX, but the
11461 sys/socket.h in i386-unknown-freebsd4.10 and
11462 powerpc-apple-darwin5.5 required it. */
11463#include <sys/types.h>
11464#ifdef HAVE_SYS_SOCKET_H
11465#include <sys/socket.h>
11466#endif
11467#ifdef HAVE_WS2TCPIP_H
11468#include <ws2tcpip.h>
11469#endif
11470
11471"
11472if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
11473
11474cat >>confdefs.h <<_ACEOF
11475#define HAVE_STRUCT_SOCKADDR_STORAGE 1
5abebf3c 11476_ACEOF
5df4cba6
SM
11477
11478
5abebf3c 11479fi
5df4cba6
SM
11480ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
11481 /* sys/types.h is not needed according to POSIX, but the
11482 sys/socket.h in i386-unknown-freebsd4.10 and
11483 powerpc-apple-darwin5.5 required it. */
11484#include <sys/types.h>
11485#ifdef HAVE_SYS_SOCKET_H
11486#include <sys/socket.h>
11487#endif
11488#ifdef HAVE_WS2TCPIP_H
11489#include <ws2tcpip.h>
11490#endif
11491
11492"
11493if test "x$ac_cv_type_sa_family_t" = xyes; then :
11494
11495cat >>confdefs.h <<_ACEOF
11496#define HAVE_SA_FAMILY_T 1
11497_ACEOF
11498
11499
5abebf3c 11500fi
5df4cba6
SM
11501
11502 if test $ac_cv_type_struct_sockaddr_storage = no; then
11503 HAVE_STRUCT_SOCKADDR_STORAGE=0
11504 fi
11505 if test $ac_cv_type_sa_family_t = no; then
11506 HAVE_SA_FAMILY_T=0
c0c3707f 11507 fi
5df4cba6
SM
11508 if test $ac_cv_type_struct_sockaddr_storage != no; then
11509 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
11510 #ifdef HAVE_SYS_SOCKET_H
11511 #include <sys/socket.h>
11512 #endif
11513 #ifdef HAVE_WS2TCPIP_H
11514 #include <ws2tcpip.h>
11515 #endif
11516
11517"
11518if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
11519
11520cat >>confdefs.h <<_ACEOF
11521#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
11522_ACEOF
11523
5abebf3c 11524
5abebf3c 11525else
5df4cba6 11526 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
5abebf3c
CB
11527fi
11528
5df4cba6
SM
11529 fi
11530 if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
11531 || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
11532 SYS_SOCKET_H='sys/socket.h'
11533 fi
5abebf3c 11534
5abebf3c 11535
5df4cba6
SM
11536
11537
11538 if test $ac_cv_header_sys_socket_h != yes; then
11539 for ac_header in winsock2.h
11540do :
11541 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
11542if test "x$ac_cv_header_winsock2_h" = xyes; then :
11543 cat >>confdefs.h <<_ACEOF
11544#define HAVE_WINSOCK2_H 1
11545_ACEOF
11546
11547fi
11548
11549done
11550
11551 fi
11552 if test "$ac_cv_header_winsock2_h" = yes; then
11553 HAVE_WINSOCK2_H=1
11554 UNISTD_H_HAVE_WINSOCK2_H=1
11555 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
11556 else
11557 HAVE_WINSOCK2_H=0
11558 fi
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
698be2d8
CB
11572
11573
5df4cba6
SM
11574 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
11575$as_echo_n "checking for IPv4 sockets... " >&6; }
11576if ${gl_cv_socket_ipv4+:} false; then :
5abebf3c
CB
11577 $as_echo_n "(cached) " >&6
11578else
c0c3707f 11579 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11580/* end confdefs.h. */
5df4cba6
SM
11581#include <sys/types.h>
11582#ifdef HAVE_SYS_SOCKET_H
11583#include <sys/socket.h>
11584#endif
11585#ifdef HAVE_NETINET_IN_H
11586#include <netinet/in.h>
11587#endif
11588#ifdef HAVE_WINSOCK2_H
11589#include <winsock2.h>
11590#endif
5abebf3c
CB
11591int
11592main ()
11593{
5df4cba6
SM
11594int x = AF_INET; struct in_addr y; struct sockaddr_in z;
11595 if (&x && &y && &z) return 0;
5abebf3c
CB
11596 ;
11597 return 0;
11598}
11599_ACEOF
c0c3707f 11600if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11601 gl_cv_socket_ipv4=yes
5abebf3c 11602else
5df4cba6 11603 gl_cv_socket_ipv4=no
5abebf3c 11604fi
c0c3707f 11605rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11606fi
5df4cba6
SM
11607{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
11608$as_echo "$gl_cv_socket_ipv4" >&6; }
11609 if test $gl_cv_socket_ipv4 = yes; then
5abebf3c 11610
5df4cba6 11611$as_echo "#define HAVE_IPV4 1" >>confdefs.h
5abebf3c 11612
5df4cba6 11613 fi
5abebf3c 11614
5df4cba6
SM
11615 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
11616$as_echo_n "checking for IPv6 sockets... " >&6; }
11617if ${gl_cv_socket_ipv6+:} false; then :
5abebf3c
CB
11618 $as_echo_n "(cached) " >&6
11619else
c0c3707f 11620 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11621/* end confdefs.h. */
5df4cba6
SM
11622#include <sys/types.h>
11623#ifdef HAVE_SYS_SOCKET_H
11624#include <sys/socket.h>
5abebf3c 11625#endif
5df4cba6
SM
11626#ifdef HAVE_NETINET_IN_H
11627#include <netinet/in.h>
11628#endif
11629#ifdef HAVE_WINSOCK2_H
11630#include <winsock2.h>
11631#endif
11632#ifdef HAVE_WS2TCPIP_H
11633#include <ws2tcpip.h>
11634#endif
11635int
11636main ()
11637{
11638int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
11639 if (&x && &y && &z) return 0;
11640 ;
11641 return 0;
11642}
11643_ACEOF
11644if ac_fn_c_try_compile "$LINENO"; then :
11645 gl_cv_socket_ipv6=yes
11646else
11647 gl_cv_socket_ipv6=no
11648fi
11649rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11650fi
11651{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
11652$as_echo "$gl_cv_socket_ipv6" >&6; }
11653 if test $gl_cv_socket_ipv6 = yes; then
11654
11655$as_echo "#define HAVE_IPV6 1" >>confdefs.h
11656
11657 fi
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671 if test $gl_cv_have_include_next = yes; then
11672 gl_cv_next_limits_h='<'limits.h'>'
11673 else
11674 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
11675$as_echo_n "checking absolute name of <limits.h>... " >&6; }
11676if ${gl_cv_next_limits_h+:} false; then :
11677 $as_echo_n "(cached) " >&6
11678else
11679
11680 if test $ac_cv_header_limits_h = yes; then
11681
11682
11683
11684
11685 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11686/* end confdefs.h. */
11687#include <limits.h>
11688_ACEOF
11689 case "$host_os" in
11690 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11691 *) gl_absname_cpp="$ac_cpp" ;;
11692 esac
11693
11694 case "$host_os" in
11695 mingw*)
11696 gl_dirsep_regex='[/\\]'
11697 ;;
11698 *)
11699 gl_dirsep_regex='\/'
11700 ;;
11701 esac
11702 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11703 gl_header_literal_regex=`echo 'limits.h' \
11704 | sed -e "$gl_make_literal_regex_sed"`
11705 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11706 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11707 s|^/[^/]|//&|
11708 p
11709 q
11710 }'
11711
11712 gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11713 sed -n "$gl_absolute_header_sed"`
11714
11715 gl_header=$gl_cv_absolute_limits_h
11716 gl_cv_next_limits_h='"'$gl_header'"'
11717 else
11718 gl_cv_next_limits_h='<'limits.h'>'
11719 fi
11720
11721
11722fi
11723{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
11724$as_echo "$gl_cv_next_limits_h" >&6; }
11725 fi
11726 NEXT_LIMITS_H=$gl_cv_next_limits_h
11727
11728 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11729 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11730 gl_next_as_first_directive='<'limits.h'>'
11731 else
11732 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11733 gl_next_as_first_directive=$gl_cv_next_limits_h
11734 fi
11735 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
11736
11737
11738
11739
11740
11741 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
11742$as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
11743if ${gl_cv_header_limits_width+:} false; then :
11744 $as_echo_n "(cached) " >&6
11745else
11746 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11747/* end confdefs.h. */
11748#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
11749 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
11750 #endif
11751 #include <limits.h>
11752 long long llm = LLONG_MAX;
11753 int wb = WORD_BIT;
11754 int ullw = ULLONG_WIDTH;
c0c3707f 11755
5abebf3c
CB
11756int
11757main ()
11758{
c0c3707f 11759
5abebf3c
CB
11760 ;
11761 return 0;
11762}
11763_ACEOF
c0c3707f 11764if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11765 gl_cv_header_limits_width=yes
5abebf3c 11766else
5df4cba6 11767 gl_cv_header_limits_width=no
5abebf3c 11768fi
c0c3707f 11769rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11770fi
5df4cba6
SM
11771{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
11772$as_echo "$gl_cv_header_limits_width" >&6; }
11773 if test "$gl_cv_header_limits_width" = yes; then
11774 LIMITS_H=
c0c3707f 11775 else
5df4cba6 11776 LIMITS_H=limits.h
c0c3707f 11777 fi
5abebf3c 11778
5df4cba6
SM
11779 if test -n "$LIMITS_H"; then
11780 GL_GENERATE_LIMITS_H_TRUE=
11781 GL_GENERATE_LIMITS_H_FALSE='#'
11782else
11783 GL_GENERATE_LIMITS_H_TRUE='#'
11784 GL_GENERATE_LIMITS_H_FALSE=
11785fi
c0c3707f
CB
11786
11787
5abebf3c 11788
5df4cba6
SM
11789 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
11790$as_echo_n "checking for wint_t... " >&6; }
11791if ${gt_cv_c_wint_t+:} false; then :
c0c3707f 11792 $as_echo_n "(cached) " >&6
c0c3707f
CB
11793else
11794 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11795/* end confdefs.h. */
5df4cba6
SM
11796
11797/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
11798 <wchar.h>.
11799 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
11800 before <wchar.h>. */
11801#include <stddef.h>
11802#include <stdio.h>
11803#include <time.h>
11804#include <wchar.h>
11805 wint_t foo = (wchar_t)'\0';
5abebf3c
CB
11806int
11807main ()
11808{
5df4cba6 11809
5abebf3c
CB
11810 ;
11811 return 0;
11812}
11813_ACEOF
5df4cba6
SM
11814if ac_fn_c_try_compile "$LINENO"; then :
11815 gt_cv_c_wint_t=yes
c0c3707f 11816else
5df4cba6 11817 gt_cv_c_wint_t=no
c0c3707f 11818fi
5df4cba6 11819rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 11820fi
5df4cba6
SM
11821{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
11822$as_echo "$gt_cv_c_wint_t" >&6; }
11823 if test $gt_cv_c_wint_t = yes; then
5abebf3c 11824
5df4cba6 11825$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
5abebf3c
CB
11826
11827
5df4cba6
SM
11828 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5
11829$as_echo_n "checking whether wint_t is too small... " >&6; }
11830if ${gl_cv_type_wint_t_too_small+:} false; then :
11831 $as_echo_n "(cached) " >&6
11832else
11833 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11834/* end confdefs.h. */
11835
11836/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
11837 <wchar.h>.
11838 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11839 included before <wchar.h>. */
11840#if !(defined __GLIBC__ && !defined __UCLIBC__)
11841# include <stddef.h>
11842# include <stdio.h>
11843# include <time.h>
11844#endif
11845#include <wchar.h>
698be2d8 11846 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
5df4cba6
SM
11847
11848int
11849main ()
11850{
11851
11852 ;
11853 return 0;
11854}
11855_ACEOF
11856if ac_fn_c_try_compile "$LINENO"; then :
11857 gl_cv_type_wint_t_too_small=no
11858else
11859 gl_cv_type_wint_t_too_small=yes
11860fi
11861rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11862fi
11863{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5
11864$as_echo "$gl_cv_type_wint_t_too_small" >&6; }
11865 if test $gl_cv_type_wint_t_too_small = yes; then
11866 GNULIB_OVERRIDES_WINT_T=1
11867 else
11868 GNULIB_OVERRIDES_WINT_T=0
11869 fi
11870 else
11871 GNULIB_OVERRIDES_WINT_T=0
c0c3707f 11872 fi
5abebf3c 11873
5abebf3c
CB
11874
11875
11876
11877
11878
5df4cba6 11879
c0c3707f
CB
11880 gl_cv_c_multiarch=no
11881 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11882/* end confdefs.h. */
11883#ifndef __APPLE_CC__
11884 not a universal capable compiler
11885 #endif
11886 typedef int dummy;
5abebf3c 11887
c0c3707f
CB
11888_ACEOF
11889if ac_fn_c_try_compile "$LINENO"; then :
5abebf3c 11890
c0c3707f
CB
11891 arch=
11892 prev=
11893 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
11894 if test -n "$prev"; then
11895 case $word in
11896 i?86 | x86_64 | ppc | ppc64)
11897 if test -z "$arch" || test "$arch" = "$word"; then
11898 arch="$word"
11899 else
11900 gl_cv_c_multiarch=yes
11901 fi
11902 ;;
11903 esac
11904 prev=
11905 else
11906 if test "x$word" = "x-arch"; then
11907 prev=arch
11908 fi
11909 fi
11910 done
5abebf3c 11911
c0c3707f
CB
11912fi
11913rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11914 if test $gl_cv_c_multiarch = yes; then
11915 APPLE_UNIVERSAL_BUILD=1
11916 else
11917 APPLE_UNIVERSAL_BUILD=0
11918 fi
5abebf3c 11919
5abebf3c 11920
5abebf3c 11921
5abebf3c
CB
11922
11923
5abebf3c 11924
5abebf3c 11925
5abebf3c 11926
5df4cba6 11927$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 11928
5abebf3c 11929
5df4cba6 11930$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 11931
c0c3707f
CB
11932
11933
11934 if test $ac_cv_header_wchar_h = yes; then
11935 HAVE_WCHAR_H=1
11936 else
11937 HAVE_WCHAR_H=0
5abebf3c 11938 fi
c0c3707f
CB
11939
11940
11941 if test $ac_cv_header_inttypes_h = yes; then
11942 HAVE_INTTYPES_H=1
11943 else
11944 HAVE_INTTYPES_H=0
5abebf3c
CB
11945 fi
11946
11947
c0c3707f
CB
11948 if test $ac_cv_header_sys_types_h = yes; then
11949 HAVE_SYS_TYPES_H=1
11950 else
11951 HAVE_SYS_TYPES_H=0
11952 fi
11953
5abebf3c
CB
11954
11955
11956
11957
5abebf3c 11958
5abebf3c 11959
5abebf3c 11960
5abebf3c 11961
5abebf3c
CB
11962
11963
c0c3707f
CB
11964 if test $gl_cv_have_include_next = yes; then
11965 gl_cv_next_stdint_h='<'stdint.h'>'
11966 else
11967 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
11968$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
11969if ${gl_cv_next_stdint_h+:} false; then :
11970 $as_echo_n "(cached) " >&6
11971else
5abebf3c 11972
c0c3707f 11973 if test $ac_cv_header_stdint_h = yes; then
5abebf3c 11974
5abebf3c
CB
11975
11976
11977
c0c3707f 11978 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11979/* end confdefs.h. */
c0c3707f 11980#include <stdint.h>
5abebf3c 11981_ACEOF
c0c3707f
CB
11982 case "$host_os" in
11983 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11984 *) gl_absname_cpp="$ac_cpp" ;;
11985 esac
5abebf3c 11986
c0c3707f
CB
11987 case "$host_os" in
11988 mingw*)
11989 gl_dirsep_regex='[/\\]'
11990 ;;
11991 *)
11992 gl_dirsep_regex='\/'
11993 ;;
11994 esac
11995 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11996 gl_header_literal_regex=`echo 'stdint.h' \
11997 | sed -e "$gl_make_literal_regex_sed"`
11998 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11999 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12000 s|^/[^/]|//&|
12001 p
12002 q
12003 }'
5abebf3c 12004
c0c3707f
CB
12005 gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12006 sed -n "$gl_absolute_header_sed"`
5abebf3c 12007
c0c3707f
CB
12008 gl_header=$gl_cv_absolute_stdint_h
12009 gl_cv_next_stdint_h='"'$gl_header'"'
12010 else
12011 gl_cv_next_stdint_h='<'stdint.h'>'
12012 fi
5abebf3c 12013
5abebf3c 12014
c0c3707f
CB
12015fi
12016{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
12017$as_echo "$gl_cv_next_stdint_h" >&6; }
12018 fi
12019 NEXT_STDINT_H=$gl_cv_next_stdint_h
5abebf3c 12020
c0c3707f
CB
12021 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12022 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12023 gl_next_as_first_directive='<'stdint.h'>'
12024 else
12025 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12026 gl_next_as_first_directive=$gl_cv_next_stdint_h
12027 fi
12028 NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
5abebf3c 12029
5e8754f9 12030
5e8754f9 12031
5e8754f9 12032
c0c3707f
CB
12033 if test $ac_cv_header_stdint_h = yes; then
12034 HAVE_STDINT_H=1
12035 else
12036 HAVE_STDINT_H=0
12037 fi
5e8754f9
SDJ
12038
12039
c0c3707f
CB
12040 if test $ac_cv_header_stdint_h = yes; then
12041 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
12042$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
12043if ${gl_cv_header_working_stdint_h+:} false; then :
12044 $as_echo_n "(cached) " >&6
12045else
12046 gl_cv_header_working_stdint_h=no
12047 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12048/* end confdefs.h. */
5e8754f9 12049
5e8754f9 12050
c0c3707f
CB
12051#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12052#define __STDC_CONSTANT_MACROS 1
12053#define __STDC_LIMIT_MACROS 1
12054#include <stdint.h>
12055/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
12056#if !(defined WCHAR_MIN && defined WCHAR_MAX)
12057#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
12058#endif
5e8754f9
SDJ
12059
12060
c0c3707f
CB
12061 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12062 included before <wchar.h>. */
12063 #include <stddef.h>
12064 #include <signal.h>
12065 #if HAVE_WCHAR_H
12066 # include <stdio.h>
12067 # include <time.h>
12068 # include <wchar.h>
12069 #endif
f45c62c4
YQ
12070
12071
c0c3707f
CB
12072#ifdef INT8_MAX
12073int8_t a1 = INT8_MAX;
12074int8_t a1min = INT8_MIN;
12075#endif
12076#ifdef INT16_MAX
12077int16_t a2 = INT16_MAX;
12078int16_t a2min = INT16_MIN;
12079#endif
12080#ifdef INT32_MAX
12081int32_t a3 = INT32_MAX;
12082int32_t a3min = INT32_MIN;
12083#endif
12084#ifdef INT64_MAX
12085int64_t a4 = INT64_MAX;
12086int64_t a4min = INT64_MIN;
12087#endif
12088#ifdef UINT8_MAX
12089uint8_t b1 = UINT8_MAX;
12090#else
12091typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
12092#endif
12093#ifdef UINT16_MAX
12094uint16_t b2 = UINT16_MAX;
12095#endif
12096#ifdef UINT32_MAX
12097uint32_t b3 = UINT32_MAX;
12098#endif
12099#ifdef UINT64_MAX
12100uint64_t b4 = UINT64_MAX;
12101#endif
12102int_least8_t c1 = INT8_C (0x7f);
12103int_least8_t c1max = INT_LEAST8_MAX;
12104int_least8_t c1min = INT_LEAST8_MIN;
12105int_least16_t c2 = INT16_C (0x7fff);
12106int_least16_t c2max = INT_LEAST16_MAX;
12107int_least16_t c2min = INT_LEAST16_MIN;
12108int_least32_t c3 = INT32_C (0x7fffffff);
12109int_least32_t c3max = INT_LEAST32_MAX;
12110int_least32_t c3min = INT_LEAST32_MIN;
12111int_least64_t c4 = INT64_C (0x7fffffffffffffff);
12112int_least64_t c4max = INT_LEAST64_MAX;
12113int_least64_t c4min = INT_LEAST64_MIN;
12114uint_least8_t d1 = UINT8_C (0xff);
12115uint_least8_t d1max = UINT_LEAST8_MAX;
12116uint_least16_t d2 = UINT16_C (0xffff);
12117uint_least16_t d2max = UINT_LEAST16_MAX;
12118uint_least32_t d3 = UINT32_C (0xffffffff);
12119uint_least32_t d3max = UINT_LEAST32_MAX;
12120uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
12121uint_least64_t d4max = UINT_LEAST64_MAX;
12122int_fast8_t e1 = INT_FAST8_MAX;
12123int_fast8_t e1min = INT_FAST8_MIN;
12124int_fast16_t e2 = INT_FAST16_MAX;
12125int_fast16_t e2min = INT_FAST16_MIN;
12126int_fast32_t e3 = INT_FAST32_MAX;
12127int_fast32_t e3min = INT_FAST32_MIN;
12128int_fast64_t e4 = INT_FAST64_MAX;
12129int_fast64_t e4min = INT_FAST64_MIN;
12130uint_fast8_t f1 = UINT_FAST8_MAX;
12131uint_fast16_t f2 = UINT_FAST16_MAX;
12132uint_fast32_t f3 = UINT_FAST32_MAX;
12133uint_fast64_t f4 = UINT_FAST64_MAX;
12134#ifdef INTPTR_MAX
12135intptr_t g = INTPTR_MAX;
12136intptr_t gmin = INTPTR_MIN;
12137#endif
12138#ifdef UINTPTR_MAX
12139uintptr_t h = UINTPTR_MAX;
12140#endif
12141intmax_t i = INTMAX_MAX;
12142uintmax_t j = UINTMAX_MAX;
472fa5ee 12143
c0c3707f
CB
12144/* Check that SIZE_MAX has the correct type, if possible. */
12145#if 201112 <= __STDC_VERSION__
12146int k = _Generic (SIZE_MAX, size_t: 0);
12147#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
12148 || (0x5110 <= __SUNPRO_C && !__STDC__))
12149extern size_t k;
12150extern __typeof__ (SIZE_MAX) k;
12151#endif
472fa5ee 12152
c0c3707f
CB
12153#include <limits.h> /* for CHAR_BIT */
12154#define TYPE_MINIMUM(t) \
12155 ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
12156#define TYPE_MAXIMUM(t) \
12157 ((t) ((t) 0 < (t) -1 \
12158 ? (t) -1 \
12159 : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
12160struct s {
12161 int check_PTRDIFF:
12162 PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
12163 && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
12164 ? 1 : -1;
12165 /* Detect bug in FreeBSD 6.0 / ia64. */
12166 int check_SIG_ATOMIC:
12167 SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
12168 && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
12169 ? 1 : -1;
12170 int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
12171 int check_WCHAR:
12172 WCHAR_MIN == TYPE_MINIMUM (wchar_t)
12173 && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
12174 ? 1 : -1;
12175 /* Detect bug in mingw. */
12176 int check_WINT:
12177 WINT_MIN == TYPE_MINIMUM (wint_t)
12178 && WINT_MAX == TYPE_MAXIMUM (wint_t)
12179 ? 1 : -1;
472fa5ee 12180
c0c3707f
CB
12181 /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
12182 int check_UINT8_C:
12183 (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
12184 int check_UINT16_C:
12185 (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
f45c62c4 12186
c0c3707f
CB
12187 /* Detect bugs in OpenBSD 3.9 stdint.h. */
12188#ifdef UINT8_MAX
12189 int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
12190#endif
12191#ifdef UINT16_MAX
12192 int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
12193#endif
12194#ifdef UINT32_MAX
12195 int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
12196#endif
12197#ifdef UINT64_MAX
12198 int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
12199#endif
12200 int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
12201 int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
12202 int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
12203 int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
12204 int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
12205 int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
12206 int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
12207 int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
12208 int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
12209 int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
12210 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
12211};
6ec2e0f5 12212
f45c62c4
YQ
12213int
12214main ()
12215{
f45c62c4
YQ
12216
12217 ;
12218 return 0;
12219}
12220_ACEOF
6ec2e0f5 12221if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 12222 if test "$cross_compiling" = yes; then :
6a29c58e 12223 case "$host_os" in
c0c3707f
CB
12224 # Guess yes on native Windows.
12225 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
12226 # In general, assume it works.
12227 *) gl_cv_header_working_stdint_h="guessing yes" ;;
12228 esac
6a29c58e 12229
98399780
YQ
12230else
12231 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12232/* end confdefs.h. */
98399780
YQ
12233
12234
c0c3707f
CB
12235#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12236#define __STDC_CONSTANT_MACROS 1
12237#define __STDC_LIMIT_MACROS 1
12238#include <stdint.h>
98399780 12239
88b48903 12240
c0c3707f
CB
12241 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12242 included before <wchar.h>. */
12243 #include <stddef.h>
12244 #include <signal.h>
12245 #if HAVE_WCHAR_H
12246 # include <stdio.h>
12247 # include <time.h>
12248 # include <wchar.h>
12249 #endif
88b48903 12250
472fa5ee 12251
c0c3707f
CB
12252#include <stdio.h>
12253#include <string.h>
12254#define MVAL(macro) MVAL1(macro)
12255#define MVAL1(expression) #expression
12256static const char *macro_values[] =
12257 {
12258#ifdef INT8_MAX
12259 MVAL (INT8_MAX),
12260#endif
12261#ifdef INT16_MAX
12262 MVAL (INT16_MAX),
12263#endif
12264#ifdef INT32_MAX
12265 MVAL (INT32_MAX),
12266#endif
12267#ifdef INT64_MAX
12268 MVAL (INT64_MAX),
12269#endif
12270#ifdef UINT8_MAX
12271 MVAL (UINT8_MAX),
12272#endif
12273#ifdef UINT16_MAX
12274 MVAL (UINT16_MAX),
12275#endif
12276#ifdef UINT32_MAX
12277 MVAL (UINT32_MAX),
12278#endif
12279#ifdef UINT64_MAX
12280 MVAL (UINT64_MAX),
12281#endif
12282 NULL
12283 };
472fa5ee 12284
c0c3707f
CB
12285int
12286main ()
12287{
472fa5ee 12288
c0c3707f
CB
12289 const char **mv;
12290 for (mv = macro_values; *mv != NULL; mv++)
12291 {
12292 const char *value = *mv;
12293 /* Test whether it looks like a cast expression. */
12294 if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
12295 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
12296 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
12297 || strncmp (value, "((int)"/*)*/, 6) == 0
12298 || strncmp (value, "((signed short)"/*)*/, 15) == 0
12299 || strncmp (value, "((signed char)"/*)*/, 14) == 0)
12300 return mv - macro_values + 1;
12301 }
12302 return 0;
12303
12304 ;
12305 return 0;
12306}
12307_ACEOF
12308if ac_fn_c_try_run "$LINENO"; then :
12309 gl_cv_header_working_stdint_h=yes
12310fi
12311rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12312 conftest.$ac_objext conftest.beam conftest.$ac_ext
12313fi
12314
12315
12316fi
12317rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 12318
c0c3707f
CB
12319fi
12320{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
12321$as_echo "$gl_cv_header_working_stdint_h" >&6; }
12322 fi
8690e634 12323
c0c3707f
CB
12324 HAVE_C99_STDINT_H=0
12325 HAVE_SYS_BITYPES_H=0
12326 HAVE_SYS_INTTYPES_H=0
12327 STDINT_H=stdint.h
12328 case "$gl_cv_header_working_stdint_h" in
12329 *yes)
12330 HAVE_C99_STDINT_H=1
12331 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5
12332$as_echo_n "checking whether stdint.h predates C++11... " >&6; }
12333if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then :
12334 $as_echo_n "(cached) " >&6
12335else
12336 gl_cv_header_stdint_predates_cxx11_h=yes
12337 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12338/* end confdefs.h. */
8690e634
JK
12339
12340
c0c3707f
CB
12341#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12342#include <stdint.h>
8690e634
JK
12343
12344
c0c3707f
CB
12345 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12346 included before <wchar.h>. */
12347 #include <stddef.h>
12348 #include <signal.h>
12349 #if HAVE_WCHAR_H
12350 # include <stdio.h>
12351 # include <time.h>
12352 # include <wchar.h>
12353 #endif
8690e634
JK
12354
12355
c0c3707f
CB
12356intmax_t im = INTMAX_MAX;
12357int32_t i32 = INT32_C (0x7fffffff);
472fa5ee 12358
c0c3707f
CB
12359int
12360main ()
12361{
472fa5ee 12362
c0c3707f
CB
12363 ;
12364 return 0;
12365}
12366_ACEOF
12367if ac_fn_c_try_compile "$LINENO"; then :
12368 gl_cv_header_stdint_predates_cxx11_h=no
12369fi
12370rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12371fi
12372{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5
12373$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; }
472fa5ee 12374
c0c3707f 12375 if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
472fa5ee 12376
c0c3707f 12377$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
472fa5ee
SM
12378
12379
c0c3707f
CB
12380$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
12381
12382 fi
12383 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
12384$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
12385if ${gl_cv_header_stdint_width+:} false; then :
8690e634
JK
12386 $as_echo_n "(cached) " >&6
12387else
c0c3707f
CB
12388 gl_cv_header_stdint_width=no
12389 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12390/* end confdefs.h. */
12391
c0c3707f
CB
12392 /* Work if build is not clean. */
12393 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
12394 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
12395 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
12396 #endif
12397 #include <stdint.h>
12398
12399 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12400 included before <wchar.h>. */
12401 #include <stddef.h>
12402 #include <signal.h>
12403 #if HAVE_WCHAR_H
12404 # include <stdio.h>
12405 # include <time.h>
12406 # include <wchar.h>
12407 #endif
12408
12409 int iw = UINTMAX_WIDTH;
12410
12411int
12412main ()
8690e634 12413{
c0c3707f
CB
12414
12415 ;
8690e634
JK
12416 return 0;
12417}
8690e634 12418_ACEOF
c0c3707f
CB
12419if ac_fn_c_try_compile "$LINENO"; then :
12420 gl_cv_header_stdint_width=yes
12421fi
12422rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12423fi
12424{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
12425$as_echo "$gl_cv_header_stdint_width" >&6; }
12426 if test "$gl_cv_header_stdint_width" = yes; then
12427 STDINT_H=
12428 fi
12429 ;;
12430 *)
12431 for ac_header in sys/inttypes.h sys/bitypes.h
12432do :
12433 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12434ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
12435if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12436 cat >>confdefs.h <<_ACEOF
12437#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12438_ACEOF
12439
12440fi
12441
12442done
12443
12444 if test $ac_cv_header_sys_inttypes_h = yes; then
12445 HAVE_SYS_INTTYPES_H=1
12446 fi
12447 if test $ac_cv_header_sys_bitypes_h = yes; then
12448 HAVE_SYS_BITYPES_H=1
12449 fi
12450
12451
12452 if test $APPLE_UNIVERSAL_BUILD = 0; then
12453
12454
12455 for gltype in ptrdiff_t size_t ; do
12456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12457$as_echo_n "checking for bit size of $gltype... " >&6; }
12458if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
12459 $as_echo_n "(cached) " >&6
12460else
12461 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
12462 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12463 included before <wchar.h>. */
12464 #include <stddef.h>
12465 #include <signal.h>
12466 #if HAVE_WCHAR_H
12467 # include <stdio.h>
12468 # include <time.h>
12469 # include <wchar.h>
12470 #endif
12471
12472#include <limits.h>"; then :
12473
12474else
12475 result=unknown
12476fi
12477
12478 eval gl_cv_bitsizeof_${gltype}=\$result
12479
12480fi
12481eval ac_res=\$gl_cv_bitsizeof_${gltype}
12482 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12483$as_echo "$ac_res" >&6; }
12484 eval result=\$gl_cv_bitsizeof_${gltype}
12485 if test $result = unknown; then
12486 result=0
8690e634 12487 fi
c0c3707f
CB
12488 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12489 cat >>confdefs.h <<_ACEOF
12490#define BITSIZEOF_${GLTYPE} $result
12491_ACEOF
8690e634 12492
c0c3707f
CB
12493 eval BITSIZEOF_${GLTYPE}=\$result
12494 done
8690e634
JK
12495
12496
c0c3707f 12497 fi
8690e634
JK
12498
12499
c0c3707f
CB
12500 for gltype in sig_atomic_t wchar_t wint_t ; do
12501 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12502$as_echo_n "checking for bit size of $gltype... " >&6; }
12503if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
8690e634
JK
12504 $as_echo_n "(cached) " >&6
12505else
c0c3707f
CB
12506 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
12507 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12508 included before <wchar.h>. */
12509 #include <stddef.h>
12510 #include <signal.h>
12511 #if HAVE_WCHAR_H
12512 # include <stdio.h>
12513 # include <time.h>
12514 # include <wchar.h>
12515 #endif
8690e634 12516
c0c3707f 12517#include <limits.h>"; then :
8690e634 12518
c0c3707f
CB
12519else
12520 result=unknown
12521fi
8690e634 12522
c0c3707f 12523 eval gl_cv_bitsizeof_${gltype}=\$result
8690e634
JK
12524
12525fi
c0c3707f
CB
12526eval ac_res=\$gl_cv_bitsizeof_${gltype}
12527 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12528$as_echo "$ac_res" >&6; }
12529 eval result=\$gl_cv_bitsizeof_${gltype}
12530 if test $result = unknown; then
12531 result=0
12532 fi
12533 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12534 cat >>confdefs.h <<_ACEOF
12535#define BITSIZEOF_${GLTYPE} $result
12536_ACEOF
12537
12538 eval BITSIZEOF_${GLTYPE}=\$result
12539 done
8690e634
JK
12540
12541
12542
12543
c0c3707f
CB
12544 for gltype in sig_atomic_t wchar_t wint_t ; do
12545 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
12546$as_echo_n "checking whether $gltype is signed... " >&6; }
12547if eval \${gl_cv_type_${gltype}_signed+:} false; then :
8690e634
JK
12548 $as_echo_n "(cached) " >&6
12549else
c0c3707f 12550 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12551/* end confdefs.h. */
12552
c0c3707f
CB
12553 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12554 included before <wchar.h>. */
12555 #include <stddef.h>
12556 #include <signal.h>
12557 #if HAVE_WCHAR_H
12558 # include <stdio.h>
12559 # include <time.h>
12560 # include <wchar.h>
12561 #endif
12562
12563 int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
12564int
12565main ()
12566{
12567
12568 ;
8690e634
JK
12569 return 0;
12570}
c0c3707f
CB
12571_ACEOF
12572if ac_fn_c_try_compile "$LINENO"; then :
12573 result=yes
12574else
12575 result=no
12576fi
12577rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12578 eval gl_cv_type_${gltype}_signed=\$result
8690e634 12579
c0c3707f
CB
12580fi
12581eval ac_res=\$gl_cv_type_${gltype}_signed
12582 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12583$as_echo "$ac_res" >&6; }
12584 eval result=\$gl_cv_type_${gltype}_signed
12585 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12586 if test "$result" = yes; then
12587 cat >>confdefs.h <<_ACEOF
12588#define HAVE_SIGNED_${GLTYPE} 1
8690e634 12589_ACEOF
c0c3707f
CB
12590
12591 eval HAVE_SIGNED_${GLTYPE}=1
12592 else
12593 eval HAVE_SIGNED_${GLTYPE}=0
8690e634 12594 fi
c0c3707f
CB
12595 done
12596
12597
12598 gl_cv_type_ptrdiff_t_signed=yes
12599 gl_cv_type_size_t_signed=no
12600 if test $APPLE_UNIVERSAL_BUILD = 0; then
12601
12602
12603 for gltype in ptrdiff_t size_t ; do
12604 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12605$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
12606if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
12607 $as_echo_n "(cached) " >&6
12608else
12609 eval gl_cv_type_${gltype}_suffix=no
12610 eval result=\$gl_cv_type_${gltype}_signed
12611 if test "$result" = yes; then
12612 glsufu=
12613 else
12614 glsufu=u
12615 fi
12616 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
12617 case $glsuf in
12618 '') gltype1='int';;
12619 l) gltype1='long int';;
12620 ll) gltype1='long long int';;
12621 i64) gltype1='__int64';;
12622 u) gltype1='unsigned int';;
12623 ul) gltype1='unsigned long int';;
12624 ull) gltype1='unsigned long long int';;
12625 ui64)gltype1='unsigned __int64';;
12626 esac
12627 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12628/* end confdefs.h. */
12629
12630 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12631 included before <wchar.h>. */
12632 #include <stddef.h>
12633 #include <signal.h>
12634 #if HAVE_WCHAR_H
12635 # include <stdio.h>
12636 # include <time.h>
12637 # include <wchar.h>
12638 #endif
8690e634 12639
c0c3707f
CB
12640 extern $gltype foo;
12641 extern $gltype1 foo;
12642int
12643main ()
12644{
12645
12646 ;
12647 return 0;
12648}
12649_ACEOF
12650if ac_fn_c_try_compile "$LINENO"; then :
12651 eval gl_cv_type_${gltype}_suffix=\$glsuf
8690e634 12652fi
c0c3707f
CB
12653rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12654 eval result=\$gl_cv_type_${gltype}_suffix
12655 test "$result" != no && break
12656 done
12657fi
12658eval ac_res=\$gl_cv_type_${gltype}_suffix
12659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12660$as_echo "$ac_res" >&6; }
12661 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12662 eval result=\$gl_cv_type_${gltype}_suffix
12663 test "$result" = no && result=
12664 eval ${GLTYPE}_SUFFIX=\$result
12665 cat >>confdefs.h <<_ACEOF
12666#define ${GLTYPE}_SUFFIX $result
12667_ACEOF
8690e634 12668
c0c3707f 12669 done
8690e634
JK
12670
12671
c0c3707f 12672 fi
8690e634
JK
12673
12674
c0c3707f
CB
12675 for gltype in sig_atomic_t wchar_t wint_t ; do
12676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12677$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
12678if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
8690e634
JK
12679 $as_echo_n "(cached) " >&6
12680else
c0c3707f
CB
12681 eval gl_cv_type_${gltype}_suffix=no
12682 eval result=\$gl_cv_type_${gltype}_signed
12683 if test "$result" = yes; then
12684 glsufu=
12685 else
12686 glsufu=u
12687 fi
12688 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
12689 case $glsuf in
12690 '') gltype1='int';;
12691 l) gltype1='long int';;
12692 ll) gltype1='long long int';;
12693 i64) gltype1='__int64';;
12694 u) gltype1='unsigned int';;
12695 ul) gltype1='unsigned long int';;
12696 ull) gltype1='unsigned long long int';;
12697 ui64)gltype1='unsigned __int64';;
12698 esac
12699 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12700/* end confdefs.h. */
12701
c0c3707f
CB
12702 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12703 included before <wchar.h>. */
12704 #include <stddef.h>
12705 #include <signal.h>
12706 #if HAVE_WCHAR_H
12707 # include <stdio.h>
12708 # include <time.h>
12709 # include <wchar.h>
12710 #endif
12711
12712 extern $gltype foo;
12713 extern $gltype1 foo;
12714int
12715main ()
12716{
12717
12718 ;
5e8754f9 12719 return 0;
8690e634 12720}
c0c3707f
CB
12721_ACEOF
12722if ac_fn_c_try_compile "$LINENO"; then :
12723 eval gl_cv_type_${gltype}_suffix=\$glsuf
12724fi
12725rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12726 eval result=\$gl_cv_type_${gltype}_suffix
12727 test "$result" != no && break
12728 done
12729fi
12730eval ac_res=\$gl_cv_type_${gltype}_suffix
12731 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12732$as_echo "$ac_res" >&6; }
12733 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12734 eval result=\$gl_cv_type_${gltype}_suffix
12735 test "$result" = no && result=
12736 eval ${GLTYPE}_SUFFIX=\$result
12737 cat >>confdefs.h <<_ACEOF
12738#define ${GLTYPE}_SUFFIX $result
12739_ACEOF
12740
12741 done
12742
12743
12744
12745 if test $GNULIB_OVERRIDES_WINT_T = 1; then
12746 BITSIZEOF_WINT_T=32
12747 fi
12748
12749 ;;
12750 esac
8690e634 12751
8690e634 12752
c0c3707f
CB
12753
12754 LIMITS_H='limits.h'
12755 if test -n "$LIMITS_H"; then
12756 GL_GENERATE_LIMITS_H_TRUE=
12757 GL_GENERATE_LIMITS_H_FALSE='#'
12758else
12759 GL_GENERATE_LIMITS_H_TRUE='#'
12760 GL_GENERATE_LIMITS_H_FALSE=
8690e634 12761fi
6ec2e0f5
SDJ
12762
12763
12764
12765
12766
12767
12768
c0c3707f
CB
12769 if test -n "$STDINT_H"; then
12770 GL_GENERATE_STDINT_H_TRUE=
12771 GL_GENERATE_STDINT_H_FALSE='#'
12772else
12773 GL_GENERATE_STDINT_H_TRUE='#'
12774 GL_GENERATE_STDINT_H_FALSE=
12775fi
472fa5ee
SM
12776
12777
12778
12779
12780
c0c3707f
CB
12781 GNULIB_IMAXABS=0;
12782 GNULIB_IMAXDIV=0;
12783 GNULIB_STRTOIMAX=0;
12784 GNULIB_STRTOUMAX=0;
12785 HAVE_DECL_IMAXABS=1;
12786 HAVE_DECL_IMAXDIV=1;
12787 HAVE_DECL_STRTOIMAX=1;
12788 HAVE_DECL_STRTOUMAX=1;
12789 HAVE_IMAXDIV_T=1;
12790 REPLACE_STRTOIMAX=0;
12791 REPLACE_STRTOUMAX=0;
12792 INT32_MAX_LT_INTMAX_MAX=1;
12793 INT64_MAX_EQ_LONG_MAX='defined _LP64';
12794 PRI_MACROS_BROKEN=0;
12795 PRIPTR_PREFIX=__PRIPTR_PREFIX;
12796 UINT32_MAX_LT_UINTMAX_MAX=1;
12797 UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
472fa5ee 12798
6ec2e0f5
SDJ
12799
12800
12801
12802
12803
6ec2e0f5
SDJ
12804
12805
6ec2e0f5 12806
6ec2e0f5 12807
6ec2e0f5 12808
6ec2e0f5 12809
6ec2e0f5 12810
c0c3707f
CB
12811
12812
12813 if test $gl_cv_have_include_next = yes; then
12814 gl_cv_next_inttypes_h='<'inttypes.h'>'
12815 else
12816 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
12817$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
12818if ${gl_cv_next_inttypes_h+:} false; then :
12819 $as_echo_n "(cached) " >&6
12820else
12821
12822 if test $ac_cv_header_inttypes_h = yes; then
12823
12824
12825
12826
12827 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12828/* end confdefs.h. */
12829#include <inttypes.h>
6ec2e0f5 12830_ACEOF
c0c3707f
CB
12831 case "$host_os" in
12832 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12833 *) gl_absname_cpp="$ac_cpp" ;;
12834 esac
6ec2e0f5 12835
c0c3707f
CB
12836 case "$host_os" in
12837 mingw*)
12838 gl_dirsep_regex='[/\\]'
12839 ;;
12840 *)
12841 gl_dirsep_regex='\/'
12842 ;;
12843 esac
12844 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12845 gl_header_literal_regex=`echo 'inttypes.h' \
12846 | sed -e "$gl_make_literal_regex_sed"`
12847 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12848 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12849 s|^/[^/]|//&|
12850 p
12851 q
12852 }'
6ec2e0f5 12853
c0c3707f
CB
12854 gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12855 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 12856
c0c3707f
CB
12857 gl_header=$gl_cv_absolute_inttypes_h
12858 gl_cv_next_inttypes_h='"'$gl_header'"'
12859 else
12860 gl_cv_next_inttypes_h='<'inttypes.h'>'
12861 fi
6ec2e0f5 12862
6ec2e0f5 12863
c0c3707f
CB
12864fi
12865{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
12866$as_echo "$gl_cv_next_inttypes_h" >&6; }
12867 fi
12868 NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
6ec2e0f5 12869
c0c3707f
CB
12870 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12871 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12872 gl_next_as_first_directive='<'inttypes.h'>'
12873 else
12874 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12875 gl_next_as_first_directive=$gl_cv_next_inttypes_h
12876 fi
12877 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
6ec2e0f5 12878
472fa5ee
SM
12879
12880
12881
12882
12883
12884
472fa5ee
SM
12885
12886
12887
12888
6ec2e0f5 12889
698be2d8
CB
12890
12891
c0c3707f
CB
12892 for ac_header in inttypes.h
12893do :
12894 ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
12895if test "x$ac_cv_header_inttypes_h" = xyes; then :
12896 cat >>confdefs.h <<_ACEOF
12897#define HAVE_INTTYPES_H 1
12898_ACEOF
6ec2e0f5 12899
c0c3707f 12900fi
6ec2e0f5 12901
c0c3707f 12902done
6ec2e0f5 12903
c0c3707f
CB
12904 if test $ac_cv_header_inttypes_h = yes; then
12905 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
12906$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
12907if ${gt_cv_inttypes_pri_broken+:} false; then :
6ec2e0f5
SDJ
12908 $as_echo_n "(cached) " >&6
12909else
c0c3707f
CB
12910
12911 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
12912/* end confdefs.h. */
12913
c0c3707f
CB
12914#include <inttypes.h>
12915#ifdef PRId32
12916char *p = PRId32;
6ec2e0f5
SDJ
12917#endif
12918
12919int
12920main ()
12921{
12922
6ec2e0f5
SDJ
12923 ;
12924 return 0;
12925}
12926_ACEOF
c0c3707f
CB
12927if ac_fn_c_try_compile "$LINENO"; then :
12928 gt_cv_inttypes_pri_broken=no
6ec2e0f5 12929else
5df4cba6
SM
12930 gt_cv_inttypes_pri_broken=yes
12931fi
12932rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12933
12934fi
12935{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
12936$as_echo "$gt_cv_inttypes_pri_broken" >&6; }
12937 fi
12938 if test "$gt_cv_inttypes_pri_broken" = yes; then
12939
12940cat >>confdefs.h <<_ACEOF
12941#define PRI_MACROS_BROKEN 1
12942_ACEOF
12943
12944 PRI_MACROS_BROKEN=1
12945 else
12946 PRI_MACROS_BROKEN=0
12947 fi
12948
12949
12950
698be2d8
CB
12951
12952
5df4cba6
SM
12953 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
12954$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
12955if ${gl_cv_cc_double_expbit0+:} false; then :
12956 $as_echo_n "(cached) " >&6
12957else
12958
12959 if test "$cross_compiling" = yes; then :
12960
12961 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12962/* end confdefs.h. */
12963
12964#if defined arm || defined __arm || defined __arm__
12965 mixed_endianness
12966#endif
12967
12968_ACEOF
12969if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12970 $EGREP "mixed_endianness" >/dev/null 2>&1; then :
12971 gl_cv_cc_double_expbit0="unknown"
12972else
12973
12974 :
12975if ${ac_cv_c_bigendian+:} false; then :
12976 $as_echo_n "(cached) " >&6
12977else
12978 ac_cv_c_bigendian=unknown
12979 # See if we're dealing with a universal compiler.
12980 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12981/* end confdefs.h. */
12982#ifndef __APPLE_CC__
12983 not a universal capable compiler
12984 #endif
12985 typedef int dummy;
12986
12987_ACEOF
12988if ac_fn_c_try_compile "$LINENO"; then :
12989
12990 # Check for potential -arch flags. It is not universal unless
12991 # there are at least two -arch flags with different values.
12992 ac_arch=
12993 ac_prev=
12994 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
12995 if test -n "$ac_prev"; then
12996 case $ac_word in
12997 i?86 | x86_64 | ppc | ppc64)
12998 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
12999 ac_arch=$ac_word
13000 else
13001 ac_cv_c_bigendian=universal
13002 break
13003 fi
13004 ;;
13005 esac
13006 ac_prev=
13007 elif test "x$ac_word" = "x-arch"; then
13008 ac_prev=arch
13009 fi
13010 done
13011fi
13012rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13013 if test $ac_cv_c_bigendian = unknown; then
13014 # See if sys/param.h defines the BYTE_ORDER macro.
13015 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13016/* end confdefs.h. */
13017#include <sys/types.h>
13018 #include <sys/param.h>
13019
13020int
13021main ()
13022{
13023#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13024 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13025 && LITTLE_ENDIAN)
13026 bogus endian macros
13027 #endif
13028
13029 ;
13030 return 0;
13031}
13032_ACEOF
13033if ac_fn_c_try_compile "$LINENO"; then :
13034 # It does; now see whether it defined to BIG_ENDIAN or not.
13035 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13036/* end confdefs.h. */
13037#include <sys/types.h>
13038 #include <sys/param.h>
13039
13040int
13041main ()
13042{
13043#if BYTE_ORDER != BIG_ENDIAN
13044 not big endian
13045 #endif
13046
13047 ;
13048 return 0;
13049}
13050_ACEOF
13051if ac_fn_c_try_compile "$LINENO"; then :
13052 ac_cv_c_bigendian=yes
13053else
13054 ac_cv_c_bigendian=no
13055fi
13056rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13057fi
13058rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13059 fi
13060 if test $ac_cv_c_bigendian = unknown; then
13061 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13062 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13063/* end confdefs.h. */
13064#include <limits.h>
13065
13066int
13067main ()
13068{
13069#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13070 bogus endian macros
13071 #endif
13072
13073 ;
13074 return 0;
13075}
13076_ACEOF
13077if ac_fn_c_try_compile "$LINENO"; then :
13078 # It does; now see whether it defined to _BIG_ENDIAN or not.
13079 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13080/* end confdefs.h. */
13081#include <limits.h>
13082
13083int
13084main ()
13085{
13086#ifndef _BIG_ENDIAN
13087 not big endian
13088 #endif
13089
13090 ;
13091 return 0;
13092}
13093_ACEOF
13094if ac_fn_c_try_compile "$LINENO"; then :
13095 ac_cv_c_bigendian=yes
13096else
13097 ac_cv_c_bigendian=no
13098fi
13099rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13100fi
13101rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13102 fi
13103 if test $ac_cv_c_bigendian = unknown; then
13104 # Compile a test program.
13105 if test "$cross_compiling" = yes; then :
13106 # Try to guess by grepping values from an object file.
13107 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13108/* end confdefs.h. */
13109short int ascii_mm[] =
13110 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13111 short int ascii_ii[] =
13112 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13113 int use_ascii (int i) {
13114 return ascii_mm[i] + ascii_ii[i];
13115 }
13116 short int ebcdic_ii[] =
13117 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13118 short int ebcdic_mm[] =
13119 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13120 int use_ebcdic (int i) {
13121 return ebcdic_mm[i] + ebcdic_ii[i];
13122 }
13123 extern int foo;
13124
13125int
13126main ()
13127{
13128return use_ascii (foo) == use_ebcdic (foo);
13129 ;
13130 return 0;
13131}
13132_ACEOF
13133if ac_fn_c_try_compile "$LINENO"; then :
13134 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13135 ac_cv_c_bigendian=yes
13136 fi
13137 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13138 if test "$ac_cv_c_bigendian" = unknown; then
13139 ac_cv_c_bigendian=no
13140 else
13141 # finding both strings is unlikely to happen, but who knows?
13142 ac_cv_c_bigendian=unknown
13143 fi
13144 fi
13145fi
13146rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13147else
13148 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13149/* end confdefs.h. */
13150$ac_includes_default
13151int
13152main ()
13153{
13154
13155 /* Are we little or big endian? From Harbison&Steele. */
13156 union
13157 {
13158 long int l;
13159 char c[sizeof (long int)];
13160 } u;
13161 u.l = 1;
13162 return u.c[sizeof (long int) - 1] == 1;
13163
13164 ;
13165 return 0;
13166}
13167_ACEOF
13168if ac_fn_c_try_run "$LINENO"; then :
13169 ac_cv_c_bigendian=no
13170else
13171 ac_cv_c_bigendian=yes
13172fi
13173rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13174 conftest.$ac_objext conftest.beam conftest.$ac_ext
13175fi
13176
13177 fi
13178fi
13179:
13180 case $ac_cv_c_bigendian in #(
13181 yes)
13182 gl_cv_cc_double_expbit0="word 0 bit 20";; #(
13183 no)
13184 gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
13185 universal)
13186
13187$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13188
13189 ;; #(
13190 *)
13191 gl_cv_cc_double_expbit0="unknown" ;;
13192 esac
13193
13194
13195fi
13196rm -f conftest*
13197
13198
13199else
13200 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13201/* end confdefs.h. */
13202
13203#include <float.h>
13204#include <stddef.h>
13205#include <stdio.h>
13206#include <string.h>
13207#define NWORDS \
13208 ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
13209typedef union { double value; unsigned int word[NWORDS]; } memory_double;
13210static unsigned int ored_words[NWORDS];
13211static unsigned int anded_words[NWORDS];
13212static void add_to_ored_words (double x)
13213{
13214 memory_double m;
13215 size_t i;
13216 /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
13217 memset (&m, 0, sizeof (memory_double));
13218 m.value = x;
13219 for (i = 0; i < NWORDS; i++)
13220 {
13221 ored_words[i] |= m.word[i];
13222 anded_words[i] &= m.word[i];
13223 }
13224}
13225int main ()
13226{
13227 size_t j;
13228 FILE *fp = fopen ("conftest.out", "w");
13229 if (fp == NULL)
13230 return 1;
13231 for (j = 0; j < NWORDS; j++)
13232 anded_words[j] = ~ (unsigned int) 0;
13233 add_to_ored_words (0.25);
13234 add_to_ored_words (0.5);
13235 add_to_ored_words (1.0);
13236 add_to_ored_words (2.0);
13237 add_to_ored_words (4.0);
13238 /* Remove bits that are common (e.g. if representation of the first mantissa
13239 bit is explicit). */
13240 for (j = 0; j < NWORDS; j++)
13241 ored_words[j] &= ~anded_words[j];
13242 /* Now find the nonzero word. */
13243 for (j = 0; j < NWORDS; j++)
13244 if (ored_words[j] != 0)
13245 break;
13246 if (j < NWORDS)
13247 {
13248 size_t i;
13249 for (i = j + 1; i < NWORDS; i++)
13250 if (ored_words[i] != 0)
13251 {
13252 fprintf (fp, "unknown");
13253 return (fclose (fp) != 0);
13254 }
13255 for (i = 0; ; i++)
13256 if ((ored_words[j] >> i) & 1)
13257 {
13258 fprintf (fp, "word %d bit %d", (int) j, (int) i);
13259 return (fclose (fp) != 0);
13260 }
13261 }
13262 fprintf (fp, "unknown");
13263 return (fclose (fp) != 0);
13264}
13265
13266_ACEOF
13267if ac_fn_c_try_run "$LINENO"; then :
13268 gl_cv_cc_double_expbit0=`cat conftest.out`
13269else
13270 gl_cv_cc_double_expbit0="unknown"
6ec2e0f5 13271fi
5df4cba6
SM
13272rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13273 conftest.$ac_objext conftest.beam conftest.$ac_ext
13274fi
13275
13276 rm -f conftest.out
6ec2e0f5
SDJ
13277
13278fi
5df4cba6
SM
13279{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
13280$as_echo "$gl_cv_cc_double_expbit0" >&6; }
13281 case "$gl_cv_cc_double_expbit0" in
13282 word*bit*)
13283 word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
13284 bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
6ec2e0f5
SDJ
13285
13286cat >>confdefs.h <<_ACEOF
5df4cba6 13287#define DBL_EXPBIT0_WORD $word
6ec2e0f5
SDJ
13288_ACEOF
13289
c0c3707f 13290
5df4cba6
SM
13291cat >>confdefs.h <<_ACEOF
13292#define DBL_EXPBIT0_BIT $bit
13293_ACEOF
6ec2e0f5 13294
5df4cba6
SM
13295 ;;
13296 esac
6ec2e0f5 13297
6ec2e0f5 13298
5df4cba6
SM
13299 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
13300$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
c0c3707f
CB
13301if ${ac_cv_c_bigendian+:} false; then :
13302 $as_echo_n "(cached) " >&6
6ec2e0f5 13303else
c0c3707f
CB
13304 ac_cv_c_bigendian=unknown
13305 # See if we're dealing with a universal compiler.
13306 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13307/* end confdefs.h. */
c0c3707f
CB
13308#ifndef __APPLE_CC__
13309 not a universal capable compiler
13310 #endif
13311 typedef int dummy;
6ec2e0f5 13312
c0c3707f
CB
13313_ACEOF
13314if ac_fn_c_try_compile "$LINENO"; then :
13315
13316 # Check for potential -arch flags. It is not universal unless
13317 # there are at least two -arch flags with different values.
13318 ac_arch=
13319 ac_prev=
13320 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13321 if test -n "$ac_prev"; then
13322 case $ac_word in
13323 i?86 | x86_64 | ppc | ppc64)
13324 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13325 ac_arch=$ac_word
13326 else
13327 ac_cv_c_bigendian=universal
13328 break
13329 fi
13330 ;;
13331 esac
13332 ac_prev=
13333 elif test "x$ac_word" = "x-arch"; then
13334 ac_prev=arch
13335 fi
13336 done
13337fi
13338rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13339 if test $ac_cv_c_bigendian = unknown; then
13340 # See if sys/param.h defines the BYTE_ORDER macro.
13341 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13342/* end confdefs.h. */
13343#include <sys/types.h>
13344 #include <sys/param.h>
6ec2e0f5
SDJ
13345
13346int
13347main ()
13348{
c0c3707f
CB
13349#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13350 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13351 && LITTLE_ENDIAN)
13352 bogus endian macros
13353 #endif
6ec2e0f5 13354
c0c3707f
CB
13355 ;
13356 return 0;
13357}
13358_ACEOF
13359if ac_fn_c_try_compile "$LINENO"; then :
13360 # It does; now see whether it defined to BIG_ENDIAN or not.
13361 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13362/* end confdefs.h. */
13363#include <sys/types.h>
13364 #include <sys/param.h>
13365
13366int
13367main ()
13368{
13369#if BYTE_ORDER != BIG_ENDIAN
13370 not big endian
13371 #endif
6ec2e0f5
SDJ
13372
13373 ;
13374 return 0;
13375}
13376_ACEOF
c0c3707f
CB
13377if ac_fn_c_try_compile "$LINENO"; then :
13378 ac_cv_c_bigendian=yes
6ec2e0f5 13379else
c0c3707f 13380 ac_cv_c_bigendian=no
6ec2e0f5 13381fi
c0c3707f 13382rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13383fi
c0c3707f
CB
13384rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13385 fi
13386 if test $ac_cv_c_bigendian = unknown; then
13387 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13388 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13389/* end confdefs.h. */
13390#include <limits.h>
472fa5ee 13391
c0c3707f
CB
13392int
13393main ()
13394{
13395#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13396 bogus endian macros
13397 #endif
6ec2e0f5 13398
c0c3707f
CB
13399 ;
13400 return 0;
13401}
6ec2e0f5 13402_ACEOF
c0c3707f
CB
13403if ac_fn_c_try_compile "$LINENO"; then :
13404 # It does; now see whether it defined to _BIG_ENDIAN or not.
13405 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13406/* end confdefs.h. */
c0c3707f
CB
13407#include <limits.h>
13408
6ec2e0f5
SDJ
13409int
13410main ()
13411{
5df4cba6
SM
13412#ifndef _BIG_ENDIAN
13413 not big endian
13414 #endif
13415
13416 ;
13417 return 0;
13418}
13419_ACEOF
13420if ac_fn_c_try_compile "$LINENO"; then :
13421 ac_cv_c_bigendian=yes
13422else
13423 ac_cv_c_bigendian=no
13424fi
13425rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13426fi
13427rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13428 fi
13429 if test $ac_cv_c_bigendian = unknown; then
13430 # Compile a test program.
13431 if test "$cross_compiling" = yes; then :
13432 # Try to guess by grepping values from an object file.
13433 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13434/* end confdefs.h. */
13435short int ascii_mm[] =
13436 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13437 short int ascii_ii[] =
13438 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13439 int use_ascii (int i) {
13440 return ascii_mm[i] + ascii_ii[i];
13441 }
13442 short int ebcdic_ii[] =
13443 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13444 short int ebcdic_mm[] =
13445 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13446 int use_ebcdic (int i) {
13447 return ebcdic_mm[i] + ebcdic_ii[i];
13448 }
13449 extern int foo;
13450
13451int
13452main ()
13453{
13454return use_ascii (foo) == use_ebcdic (foo);
13455 ;
13456 return 0;
13457}
13458_ACEOF
13459if ac_fn_c_try_compile "$LINENO"; then :
13460 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13461 ac_cv_c_bigendian=yes
13462 fi
13463 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13464 if test "$ac_cv_c_bigendian" = unknown; then
13465 ac_cv_c_bigendian=no
13466 else
13467 # finding both strings is unlikely to happen, but who knows?
13468 ac_cv_c_bigendian=unknown
13469 fi
13470 fi
13471fi
13472rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13473else
13474 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13475/* end confdefs.h. */
13476$ac_includes_default
13477int
13478main ()
13479{
13480
13481 /* Are we little or big endian? From Harbison&Steele. */
13482 union
13483 {
13484 long int l;
13485 char c[sizeof (long int)];
13486 } u;
13487 u.l = 1;
13488 return u.c[sizeof (long int) - 1] == 1;
13489
13490 ;
13491 return 0;
13492}
13493_ACEOF
13494if ac_fn_c_try_run "$LINENO"; then :
13495 ac_cv_c_bigendian=no
13496else
13497 ac_cv_c_bigendian=yes
13498fi
13499rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13500 conftest.$ac_objext conftest.beam conftest.$ac_ext
13501fi
13502
13503 fi
13504fi
13505{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
13506$as_echo "$ac_cv_c_bigendian" >&6; }
13507 case $ac_cv_c_bigendian in #(
13508 yes)
13509 $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
13510;; #(
13511 no)
13512 ;; #(
13513 universal)
13514
13515$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13516
13517 ;; #(
13518 *)
13519 as_fn_error $? "unknown endianness
13520 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
13521 esac
13522
13523
13524
5df4cba6
SM
13525 GNULIB_LOCALECONV=0;
13526 GNULIB_SETLOCALE=0;
13527 GNULIB_SETLOCALE_NULL=0;
13528 GNULIB_DUPLOCALE=0;
13529 GNULIB_LOCALENAME=0;
13530 HAVE_NEWLOCALE=1;
13531 HAVE_DUPLOCALE=1;
13532 HAVE_FREELOCALE=1;
13533 REPLACE_LOCALECONV=0;
13534 REPLACE_SETLOCALE=0;
13535 REPLACE_NEWLOCALE=0;
13536 REPLACE_DUPLOCALE=0;
13537 REPLACE_FREELOCALE=0;
13538 REPLACE_STRUCT_LCONV=0;
13539
13540
13541 REPLACE_NULL=0;
13542 HAVE_MAX_ALIGN_T=1;
13543 HAVE_WCHAR_T=1;
13544
13545
13546 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
13547$as_echo_n "checking for wchar_t... " >&6; }
13548if ${gt_cv_c_wchar_t+:} false; then :
13549 $as_echo_n "(cached) " >&6
13550else
13551 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13552/* end confdefs.h. */
13553#include <stddef.h>
13554 wchar_t foo = (wchar_t)'\0';
13555int
13556main ()
13557{
13558
13559 ;
13560 return 0;
13561}
13562_ACEOF
13563if ac_fn_c_try_compile "$LINENO"; then :
13564 gt_cv_c_wchar_t=yes
13565else
13566 gt_cv_c_wchar_t=no
13567fi
13568rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13569fi
13570{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
13571$as_echo "$gt_cv_c_wchar_t" >&6; }
13572 if test $gt_cv_c_wchar_t = yes; then
13573
13574$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
13575
13576 fi
13577
13578
13579
13580
13581 STDDEF_H=
13582
13583 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
13584$as_echo_n "checking for good max_align_t... " >&6; }
13585if ${gl_cv_type_max_align_t+:} false; then :
13586 $as_echo_n "(cached) " >&6
13587else
13588 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13589/* end confdefs.h. */
13590#include <stddef.h>
13591 unsigned int s = sizeof (max_align_t);
13592 #if defined __GNUC__ || defined __IBM__ALIGNOF__
13593 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
13594 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
13595 #endif
13596
13597int
13598main ()
13599{
c0c3707f 13600
6ec2e0f5
SDJ
13601 ;
13602 return 0;
13603}
13604_ACEOF
13605if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 13606 gl_cv_type_max_align_t=yes
6ec2e0f5 13607else
5df4cba6 13608 gl_cv_type_max_align_t=no
6ec2e0f5 13609fi
c0c3707f 13610rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13611
c0c3707f 13612fi
5df4cba6
SM
13613{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
13614$as_echo "$gl_cv_type_max_align_t" >&6; }
13615 if test $gl_cv_type_max_align_t = no; then
13616 HAVE_MAX_ALIGN_T=0
13617 STDDEF_H=stddef.h
13618 fi
13619
13620 if test $gt_cv_c_wchar_t = no; then
13621 HAVE_WCHAR_T=0
13622 STDDEF_H=stddef.h
13623 fi
13624
13625 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
13626$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
13627if ${gl_cv_decl_null_works+:} false; then :
13628 $as_echo_n "(cached) " >&6
c0c3707f
CB
13629else
13630 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13631/* end confdefs.h. */
5df4cba6
SM
13632#include <stddef.h>
13633 int test[2 * (sizeof NULL == sizeof (void *)) -1];
13634
c0c3707f
CB
13635int
13636main ()
13637{
6ec2e0f5 13638
c0c3707f
CB
13639 ;
13640 return 0;
13641}
13642_ACEOF
5df4cba6
SM
13643if ac_fn_c_try_compile "$LINENO"; then :
13644 gl_cv_decl_null_works=yes
c0c3707f 13645else
5df4cba6 13646 gl_cv_decl_null_works=no
c0c3707f 13647fi
5df4cba6 13648rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 13649fi
5df4cba6
SM
13650{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
13651$as_echo "$gl_cv_decl_null_works" >&6; }
13652 if test $gl_cv_decl_null_works = no; then
13653 REPLACE_NULL=1
13654 STDDEF_H=stddef.h
13655 fi
6ec2e0f5 13656
5df4cba6
SM
13657
13658 if test -n "$STDDEF_H"; then
13659 GL_GENERATE_STDDEF_H_TRUE=
13660 GL_GENERATE_STDDEF_H_FALSE='#'
13661else
13662 GL_GENERATE_STDDEF_H_TRUE='#'
13663 GL_GENERATE_STDDEF_H_FALSE=
c0c3707f 13664fi
6ec2e0f5 13665
5df4cba6 13666 if test -n "$STDDEF_H"; then
6ec2e0f5 13667
472fa5ee
SM
13668
13669
5e8754f9
SDJ
13670
13671
5df4cba6
SM
13672
13673
13674
13675 if test $gl_cv_have_include_next = yes; then
13676 gl_cv_next_stddef_h='<'stddef.h'>'
13677 else
13678 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
13679$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
13680if ${gl_cv_next_stddef_h+:} false; then :
13681 $as_echo_n "(cached) " >&6
c0c3707f 13682else
5df4cba6
SM
13683
13684
13685
c0c3707f
CB
13686 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13687/* end confdefs.h. */
c0c3707f 13688#include <stddef.h>
c0c3707f 13689_ACEOF
5df4cba6
SM
13690 case "$host_os" in
13691 aix*) gl_absname_cpp="$ac_cpp -C" ;;
13692 *) gl_absname_cpp="$ac_cpp" ;;
13693 esac
13694
13695 case "$host_os" in
13696 mingw*)
13697 gl_dirsep_regex='[/\\]'
13698 ;;
13699 *)
13700 gl_dirsep_regex='\/'
13701 ;;
13702 esac
13703 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13704 gl_header_literal_regex=`echo 'stddef.h' \
13705 | sed -e "$gl_make_literal_regex_sed"`
13706 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13707 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13708 s|^/[^/]|//&|
13709 p
13710 q
13711 }'
13712
13713 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13714 sed -n "$gl_absolute_header_sed"`
13715
13716 gl_header=$gl_cv_absolute_stddef_h
13717 gl_cv_next_stddef_h='"'$gl_header'"'
5e8754f9
SDJ
13718
13719
c0c3707f 13720fi
5df4cba6
SM
13721{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
13722$as_echo "$gl_cv_next_stddef_h" >&6; }
13723 fi
13724 NEXT_STDDEF_H=$gl_cv_next_stddef_h
13725
13726 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13727 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13728 gl_next_as_first_directive='<'stddef.h'>'
13729 else
13730 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13731 gl_next_as_first_directive=$gl_cv_next_stddef_h
13732 fi
13733 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
5e8754f9
SDJ
13734
13735
13736
13737
5df4cba6 13738 fi
5e8754f9
SDJ
13739
13740
13741
13742
13743
13744
5df4cba6
SM
13745 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
13746$as_echo_n "checking whether locale.h defines locale_t... " >&6; }
13747if ${gl_cv_header_locale_has_locale_t+:} false; then :
13748 $as_echo_n "(cached) " >&6
13749else
13750 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13751/* end confdefs.h. */
5df4cba6
SM
13752#include <locale.h>
13753 locale_t x;
c0c3707f
CB
13754int
13755main ()
13756{
5e8754f9 13757
c0c3707f
CB
13758 ;
13759 return 0;
13760}
13761_ACEOF
13762if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 13763 gl_cv_header_locale_has_locale_t=yes
c0c3707f 13764else
5df4cba6 13765 gl_cv_header_locale_has_locale_t=no
c0c3707f
CB
13766fi
13767rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 13768
c0c3707f 13769fi
5df4cba6
SM
13770{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
13771$as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
13772
13773
13774 if test $ac_cv_header_xlocale_h = yes; then
13775 HAVE_XLOCALE_H=1
13776 if test $gl_cv_header_locale_has_locale_t = yes; then
13777 gl_cv_header_locale_h_needs_xlocale_h=no
13778 else
13779 gl_cv_header_locale_h_needs_xlocale_h=yes
c0c3707f 13780 fi
5df4cba6
SM
13781 HAVE_LOCALE_T=1
13782 else
13783 HAVE_XLOCALE_H=0
13784 gl_cv_header_locale_h_needs_xlocale_h=no
13785 if test $gl_cv_header_locale_has_locale_t = yes; then
13786 HAVE_LOCALE_T=1
13787 else
13788 HAVE_LOCALE_T=0
13789 fi
13790 fi
13791
13792
5e8754f9 13793
5df4cba6
SM
13794
13795 gl_threads_api=none
13796 LIBTHREAD=
13797 LTLIBTHREAD=
13798 LIBMULTITHREAD=
13799 LTLIBMULTITHREAD=
13800 if test "$gl_use_threads" != no; then
13801
13802
13803 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
13804$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
13805if ${gl_cv_have_weak+:} false; then :
13806 $as_echo_n "(cached) " >&6
13807else
13808 gl_cv_have_weak=no
13809 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13810/* end confdefs.h. */
13811extern void xyzzy ();
13812#pragma weak xyzzy
c0c3707f
CB
13813int
13814main ()
13815{
5df4cba6 13816xyzzy();
c0c3707f
CB
13817 ;
13818 return 0;
13819}
13820_ACEOF
5df4cba6
SM
13821if ac_fn_c_try_link "$LINENO"; then :
13822 gl_cv_have_weak=maybe
13823fi
13824rm -f core conftest.err conftest.$ac_objext \
13825 conftest$ac_exeext conftest.$ac_ext
13826 if test $gl_cv_have_weak = maybe; then
13827 if test "$cross_compiling" = yes; then :
13828 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13829/* end confdefs.h. */
5df4cba6
SM
13830#ifdef __ELF__
13831 Extensible Linking Format
13832 #endif
5e8754f9 13833
5df4cba6
SM
13834_ACEOF
13835if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13836 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
13837 gl_cv_have_weak="guessing yes"
13838else
13839 gl_cv_have_weak="guessing no"
13840fi
13841rm -f conftest*
5e8754f9 13842
5df4cba6
SM
13843
13844else
13845 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13846/* end confdefs.h. */
13847
13848#include <stdio.h>
13849#pragma weak fputs
13850int main ()
13851{
13852 return (fputs == NULL);
c0c3707f
CB
13853}
13854_ACEOF
5df4cba6
SM
13855if ac_fn_c_try_run "$LINENO"; then :
13856 gl_cv_have_weak=yes
c0c3707f 13857else
5df4cba6 13858 gl_cv_have_weak=no
c0c3707f 13859fi
5df4cba6
SM
13860rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13861 conftest.$ac_objext conftest.beam conftest.$ac_ext
c0c3707f 13862fi
5df4cba6
SM
13863
13864 fi
13865 case " $LDFLAGS " in
13866 *" -static "*) gl_cv_have_weak=no ;;
13867 esac
13868 case "$gl_cv_have_weak" in
13869 *yes)
13870 case "$host_os" in
13871 freebsd* | dragonfly*)
13872 : > conftest1.c
13873 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
13874 cat <<EOF > conftest2.c
13875#include <pthread.h>
13876#pragma weak pthread_mutexattr_gettype
13877int main ()
13878{
13879 return (pthread_mutexattr_gettype != NULL);
13880}
13881EOF
13882 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
13883 || gl_cv_have_weak=no
13884 rm -f conftest1.c libempty.so conftest2.c conftest
13885 ;;
13886 esac
13887 ;;
13888 esac
13889
13890fi
13891{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
13892$as_echo "$gl_cv_have_weak" >&6; }
13893 case "$gl_cv_have_weak" in
13894 *yes)
13895
13896$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
13897
13898 ;;
13899 esac
13900
13901 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
13902
13903 :
c0c3707f 13904 fi
5df4cba6
SM
13905 if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
13906
13907 gl_have_isoc_threads="$ac_cv_header_threads_h"
13908 fi
13909 if test "$gl_use_threads" = yes \
13910 || test "$gl_use_threads" = posix \
13911 || test "$gl_use_threads" = isoc+posix; then
13912
13913
13914 if test -z "$gl_pthreadlib_body_done"; then
13915 gl_pthread_api=no
13916 LIBPTHREAD=
13917 LIBPMULTITHREAD=
13918 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
13919 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
13920 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
13921if test "x$ac_cv_header_pthread_h" = xyes; then :
13922 gl_have_pthread_h=yes
13923else
13924 gl_have_pthread_h=no
13925fi
13926
13927
13928 if test "$gl_have_pthread_h" = yes; then
13929 # Other possible tests:
13930 # -lpthreads (FSU threads, PCthreads)
13931 # -lgthreads
13932 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
13933 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
13934 # the second one only in libpthread, and lock.c needs it.
13935 #
13936 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
13937 # needs -pthread for some reason. See:
13938 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
13939 save_LIBS=$LIBS
13940 for gl_pthread in '' '-pthread'; do
13941 LIBS="$LIBS $gl_pthread"
13942 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13943/* end confdefs.h. */
13944#include <pthread.h>
13945 pthread_mutex_t m;
13946 pthread_mutexattr_t ma;
5e8754f9 13947
c0c3707f
CB
13948int
13949main ()
13950{
5df4cba6
SM
13951pthread_mutex_lock (&m);
13952 pthread_mutexattr_init (&ma);
c0c3707f
CB
13953 ;
13954 return 0;
13955}
13956_ACEOF
5df4cba6
SM
13957if ac_fn_c_try_link "$LINENO"; then :
13958 gl_pthread_api=yes
13959 LIBPTHREAD=$gl_pthread
13960 LIBPMULTITHREAD=$gl_pthread
c0c3707f 13961fi
5df4cba6
SM
13962rm -f core conftest.err conftest.$ac_objext \
13963 conftest$ac_exeext conftest.$ac_ext
13964 LIBS=$save_LIBS
13965 test $gl_pthread_api = yes && break
13966 done
13967
13968 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
13969 # since it is defined as a macro on OSF/1.)
13970 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
13971 # The program links fine without libpthread. But it may actually
13972 # need to link with libpthread in order to create multiple threads.
13973 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
13974$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
13975if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
13976 $as_echo_n "(cached) " >&6
c0c3707f 13977else
5df4cba6
SM
13978 ac_check_lib_save_LIBS=$LIBS
13979LIBS="-lpthread $LIBS"
13980cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13981/* end confdefs.h. */
5df4cba6
SM
13982
13983/* Override any GCC internal prototype to avoid an error.
13984 Use char because int might match the return type of a GCC
13985 builtin and then its argument prototype would still apply. */
13986#ifdef __cplusplus
13987extern "C"
13988#endif
13989char pthread_kill ();
c0c3707f
CB
13990int
13991main ()
13992{
5df4cba6 13993return pthread_kill ();
c0c3707f
CB
13994 ;
13995 return 0;
13996}
13997_ACEOF
5df4cba6
SM
13998if ac_fn_c_try_link "$LINENO"; then :
13999 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 14000else
5df4cba6 14001 ac_cv_lib_pthread_pthread_kill=no
6ec2e0f5 14002fi
5df4cba6
SM
14003rm -f core conftest.err conftest.$ac_objext \
14004 conftest$ac_exeext conftest.$ac_ext
14005LIBS=$ac_check_lib_save_LIBS
c0c3707f 14006fi
5df4cba6
SM
14007{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14008$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14009if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14010 LIBPMULTITHREAD=-lpthread
14011 # On Solaris and HP-UX, most pthread functions exist also in libc.
14012 # Therefore pthread_in_use() needs to actually try to create a
14013 # thread: pthread_create from libc will fail, whereas
14014 # pthread_create will actually create a thread.
14015 # On Solaris 10 or newer, this test is no longer needed, because
14016 # libc contains the fully functional pthread functions.
14017 case "$host_os" in
14018 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
472fa5ee 14019
5df4cba6 14020$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
472fa5ee 14021
5df4cba6 14022 esac
472fa5ee 14023
5df4cba6 14024fi
472fa5ee 14025
5df4cba6
SM
14026 elif test $gl_pthread_api != yes; then
14027 # Some library is needed. Try libpthread and libc_r.
14028 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14029$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14030if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
14031 $as_echo_n "(cached) " >&6
14032else
5df4cba6
SM
14033 ac_check_lib_save_LIBS=$LIBS
14034LIBS="-lpthread $LIBS"
14035cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14036/* end confdefs.h. */
5df4cba6
SM
14037
14038/* Override any GCC internal prototype to avoid an error.
14039 Use char because int might match the return type of a GCC
14040 builtin and then its argument prototype would still apply. */
14041#ifdef __cplusplus
14042extern "C"
14043#endif
14044char pthread_kill ();
c0c3707f
CB
14045int
14046main ()
14047{
5df4cba6 14048return pthread_kill ();
c0c3707f
CB
14049 ;
14050 return 0;
14051}
14052_ACEOF
14053if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14054 ac_cv_lib_pthread_pthread_kill=yes
c0c3707f 14055else
5df4cba6 14056 ac_cv_lib_pthread_pthread_kill=no
c0c3707f
CB
14057fi
14058rm -f core conftest.err conftest.$ac_objext \
14059 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14060LIBS=$ac_check_lib_save_LIBS
14061fi
14062{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14063$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14064if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14065 gl_pthread_api=yes
14066 LIBPTHREAD=-lpthread
14067 LIBPMULTITHREAD=-lpthread
c0c3707f 14068fi
472fa5ee 14069
5df4cba6
SM
14070 if test $gl_pthread_api != yes; then
14071 # For FreeBSD 4.
14072 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14073$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14074if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14075 $as_echo_n "(cached) " >&6
14076else
14077 ac_check_lib_save_LIBS=$LIBS
14078LIBS="-lc_r $LIBS"
14079cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14080/* end confdefs.h. */
472fa5ee 14081
5df4cba6
SM
14082/* Override any GCC internal prototype to avoid an error.
14083 Use char because int might match the return type of a GCC
14084 builtin and then its argument prototype would still apply. */
14085#ifdef __cplusplus
14086extern "C"
14087#endif
14088char pthread_kill ();
14089int
14090main ()
14091{
14092return pthread_kill ();
14093 ;
14094 return 0;
14095}
14096_ACEOF
14097if ac_fn_c_try_link "$LINENO"; then :
14098 ac_cv_lib_c_r_pthread_kill=yes
14099else
14100 ac_cv_lib_c_r_pthread_kill=no
14101fi
14102rm -f core conftest.err conftest.$ac_objext \
14103 conftest$ac_exeext conftest.$ac_ext
14104LIBS=$ac_check_lib_save_LIBS
14105fi
14106{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14107$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14108if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14109 gl_pthread_api=yes
14110 LIBPTHREAD=-lc_r
14111 LIBPMULTITHREAD=-lc_r
14112fi
6ec2e0f5 14113
5df4cba6
SM
14114 fi
14115 fi
14116 fi
14117 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14118$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14119 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14120$as_echo "$gl_pthread_api" >&6; }
472fa5ee
SM
14121
14122
5df4cba6 14123 if test $gl_pthread_api = yes; then
472fa5ee 14124
5df4cba6 14125$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
472fa5ee 14126
5df4cba6 14127 fi
472fa5ee 14128
5df4cba6 14129 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14130/* end confdefs.h. */
5df4cba6 14131#include <sched.h>
c0c3707f
CB
14132int
14133main ()
14134{
5df4cba6 14135sched_yield ();
c0c3707f
CB
14136 ;
14137 return 0;
14138}
14139_ACEOF
14140if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14141 LIB_SCHED_YIELD=
6ec2e0f5 14142
c0c3707f 14143else
5df4cba6
SM
14144 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14145$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14146if ${ac_cv_lib_rt_sched_yield+:} false; then :
14147 $as_echo_n "(cached) " >&6
c0c3707f 14148else
5df4cba6
SM
14149 ac_check_lib_save_LIBS=$LIBS
14150LIBS="-lrt $LIBS"
14151cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14152/* end confdefs.h. */
6ec2e0f5 14153
5df4cba6
SM
14154/* Override any GCC internal prototype to avoid an error.
14155 Use char because int might match the return type of a GCC
14156 builtin and then its argument prototype would still apply. */
14157#ifdef __cplusplus
14158extern "C"
14159#endif
14160char sched_yield ();
14161int
14162main ()
c0c3707f 14163{
5df4cba6
SM
14164return sched_yield ();
14165 ;
14166 return 0;
c0c3707f 14167}
6ec2e0f5 14168_ACEOF
5df4cba6
SM
14169if ac_fn_c_try_link "$LINENO"; then :
14170 ac_cv_lib_rt_sched_yield=yes
c0c3707f 14171else
5df4cba6 14172 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14173fi
5df4cba6
SM
14174rm -f core conftest.err conftest.$ac_objext \
14175 conftest$ac_exeext conftest.$ac_ext
14176LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14177fi
5df4cba6
SM
14178{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14179$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14180if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14181 LIB_SCHED_YIELD=-lrt
14182else
14183 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14184$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14185if ${ac_cv_lib_posix4_sched_yield+:} false; then :
14186 $as_echo_n "(cached) " >&6
14187else
14188 ac_check_lib_save_LIBS=$LIBS
14189LIBS="-lposix4 $LIBS"
14190cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14191/* end confdefs.h. */
6ec2e0f5 14192
5df4cba6
SM
14193/* Override any GCC internal prototype to avoid an error.
14194 Use char because int might match the return type of a GCC
14195 builtin and then its argument prototype would still apply. */
14196#ifdef __cplusplus
14197extern "C"
14198#endif
14199char sched_yield ();
c0c3707f
CB
14200int
14201main ()
14202{
5df4cba6 14203return sched_yield ();
c0c3707f
CB
14204 ;
14205 return 0;
14206}
14207_ACEOF
14208if ac_fn_c_try_link "$LINENO"; then :
5df4cba6
SM
14209 ac_cv_lib_posix4_sched_yield=yes
14210else
14211 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14212fi
14213rm -f core conftest.err conftest.$ac_objext \
14214 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14215LIBS=$ac_check_lib_save_LIBS
14216fi
14217{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14218$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14219if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14220 LIB_SCHED_YIELD=-lposix4
14221fi
14222
14223fi
14224
14225
14226fi
14227rm -f core conftest.err conftest.$ac_objext \
14228 conftest$ac_exeext conftest.$ac_ext
14229
14230
14231 gl_pthreadlib_body_done=done
14232 fi
14233
14234 LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
14235 LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
14236 if test $gl_pthread_api = yes; then
14237 if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
14238 gl_threads_api='isoc+posix'
14239
14240$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
14241
14242 LIBTHREAD= LTLIBTHREAD=
14243 else
14244 gl_threads_api=posix
14245
14246$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
14247
14248 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
14249 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
14250
14251$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
14252
14253 LIBTHREAD= LTLIBTHREAD=
14254 fi
14255 fi
14256 fi
c0c3707f
CB
14257 fi
14258 fi
5df4cba6
SM
14259 if test $gl_threads_api = none; then
14260 if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
14261
14262
14263
14264 if test -z "$gl_stdthreadlib_body_done"; then
14265
14266
14267 case "$host_os" in
14268 mingw*)
14269 LIBSTDTHREAD=
14270 ;;
14271 *)
c0c3707f
CB
14272
14273
5df4cba6 14274 if test -z "$gl_pthreadlib_body_done"; then
c0c3707f
CB
14275 gl_pthread_api=no
14276 LIBPTHREAD=
14277 LIBPMULTITHREAD=
14278 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
14279 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
14280 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
14281if test "x$ac_cv_header_pthread_h" = xyes; then :
14282 gl_have_pthread_h=yes
14283else
14284 gl_have_pthread_h=no
14285fi
6ec2e0f5 14286
6ec2e0f5 14287
c0c3707f
CB
14288 if test "$gl_have_pthread_h" = yes; then
14289 # Other possible tests:
14290 # -lpthreads (FSU threads, PCthreads)
14291 # -lgthreads
14292 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
14293 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
14294 # the second one only in libpthread, and lock.c needs it.
14295 #
14296 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
14297 # needs -pthread for some reason. See:
14298 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
14299 save_LIBS=$LIBS
14300 for gl_pthread in '' '-pthread'; do
14301 LIBS="$LIBS $gl_pthread"
14302 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14303/* end confdefs.h. */
14304#include <pthread.h>
14305 pthread_mutex_t m;
14306 pthread_mutexattr_t ma;
6ec2e0f5 14307
c0c3707f
CB
14308int
14309main ()
14310{
14311pthread_mutex_lock (&m);
14312 pthread_mutexattr_init (&ma);
14313 ;
14314 return 0;
14315}
6ec2e0f5 14316_ACEOF
c0c3707f
CB
14317if ac_fn_c_try_link "$LINENO"; then :
14318 gl_pthread_api=yes
14319 LIBPTHREAD=$gl_pthread
14320 LIBPMULTITHREAD=$gl_pthread
6ec2e0f5 14321fi
c0c3707f
CB
14322rm -f core conftest.err conftest.$ac_objext \
14323 conftest$ac_exeext conftest.$ac_ext
14324 LIBS=$save_LIBS
14325 test $gl_pthread_api = yes && break
14326 done
6ec2e0f5 14327
c0c3707f
CB
14328 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
14329 # since it is defined as a macro on OSF/1.)
14330 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
14331 # The program links fine without libpthread. But it may actually
14332 # need to link with libpthread in order to create multiple threads.
14333 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14334$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14335if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
14336 $as_echo_n "(cached) " >&6
14337else
c0c3707f 14338 ac_check_lib_save_LIBS=$LIBS
5df4cba6
SM
14339LIBS="-lpthread $LIBS"
14340cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14341/* end confdefs.h. */
14342
14343/* Override any GCC internal prototype to avoid an error.
14344 Use char because int might match the return type of a GCC
14345 builtin and then its argument prototype would still apply. */
14346#ifdef __cplusplus
14347extern "C"
14348#endif
14349char pthread_kill ();
14350int
14351main ()
14352{
14353return pthread_kill ();
14354 ;
14355 return 0;
14356}
14357_ACEOF
14358if ac_fn_c_try_link "$LINENO"; then :
14359 ac_cv_lib_pthread_pthread_kill=yes
14360else
14361 ac_cv_lib_pthread_pthread_kill=no
14362fi
14363rm -f core conftest.err conftest.$ac_objext \
14364 conftest$ac_exeext conftest.$ac_ext
14365LIBS=$ac_check_lib_save_LIBS
14366fi
14367{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14368$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14369if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14370 LIBPMULTITHREAD=-lpthread
14371 # On Solaris and HP-UX, most pthread functions exist also in libc.
14372 # Therefore pthread_in_use() needs to actually try to create a
14373 # thread: pthread_create from libc will fail, whereas
14374 # pthread_create will actually create a thread.
14375 # On Solaris 10 or newer, this test is no longer needed, because
14376 # libc contains the fully functional pthread functions.
14377 case "$host_os" in
14378 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
14379
14380$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
14381
14382 esac
14383
14384fi
14385
14386 elif test $gl_pthread_api != yes; then
14387 # Some library is needed. Try libpthread and libc_r.
14388 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14389$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14390if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
14391 $as_echo_n "(cached) " >&6
14392else
14393 ac_check_lib_save_LIBS=$LIBS
14394LIBS="-lpthread $LIBS"
14395cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14396/* end confdefs.h. */
14397
14398/* Override any GCC internal prototype to avoid an error.
14399 Use char because int might match the return type of a GCC
14400 builtin and then its argument prototype would still apply. */
14401#ifdef __cplusplus
14402extern "C"
14403#endif
14404char pthread_kill ();
14405int
14406main ()
14407{
14408return pthread_kill ();
14409 ;
14410 return 0;
14411}
14412_ACEOF
14413if ac_fn_c_try_link "$LINENO"; then :
14414 ac_cv_lib_pthread_pthread_kill=yes
14415else
14416 ac_cv_lib_pthread_pthread_kill=no
14417fi
14418rm -f core conftest.err conftest.$ac_objext \
14419 conftest$ac_exeext conftest.$ac_ext
14420LIBS=$ac_check_lib_save_LIBS
14421fi
14422{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14423$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14424if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14425 gl_pthread_api=yes
14426 LIBPTHREAD=-lpthread
14427 LIBPMULTITHREAD=-lpthread
14428fi
14429
14430 if test $gl_pthread_api != yes; then
14431 # For FreeBSD 4.
14432 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14433$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14434if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14435 $as_echo_n "(cached) " >&6
14436else
14437 ac_check_lib_save_LIBS=$LIBS
14438LIBS="-lc_r $LIBS"
14439cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14440/* end confdefs.h. */
14441
14442/* Override any GCC internal prototype to avoid an error.
14443 Use char because int might match the return type of a GCC
14444 builtin and then its argument prototype would still apply. */
14445#ifdef __cplusplus
14446extern "C"
14447#endif
14448char pthread_kill ();
14449int
14450main ()
14451{
14452return pthread_kill ();
14453 ;
14454 return 0;
14455}
14456_ACEOF
14457if ac_fn_c_try_link "$LINENO"; then :
14458 ac_cv_lib_c_r_pthread_kill=yes
14459else
14460 ac_cv_lib_c_r_pthread_kill=no
14461fi
14462rm -f core conftest.err conftest.$ac_objext \
14463 conftest$ac_exeext conftest.$ac_ext
14464LIBS=$ac_check_lib_save_LIBS
14465fi
14466{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14467$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14468if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14469 gl_pthread_api=yes
14470 LIBPTHREAD=-lc_r
14471 LIBPMULTITHREAD=-lc_r
14472fi
14473
14474 fi
14475 fi
14476 fi
14477 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14478$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14479 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14480$as_echo "$gl_pthread_api" >&6; }
14481
14482
14483 if test $gl_pthread_api = yes; then
14484
14485$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
14486
14487 fi
14488
14489 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14490/* end confdefs.h. */
14491#include <sched.h>
14492int
14493main ()
14494{
14495sched_yield ();
14496 ;
14497 return 0;
14498}
14499_ACEOF
14500if ac_fn_c_try_link "$LINENO"; then :
14501 LIB_SCHED_YIELD=
14502
14503else
14504 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14505$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14506if ${ac_cv_lib_rt_sched_yield+:} false; then :
14507 $as_echo_n "(cached) " >&6
14508else
14509 ac_check_lib_save_LIBS=$LIBS
14510LIBS="-lrt $LIBS"
c0c3707f 14511cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14512/* end confdefs.h. */
6ec2e0f5 14513
c0c3707f
CB
14514/* Override any GCC internal prototype to avoid an error.
14515 Use char because int might match the return type of a GCC
14516 builtin and then its argument prototype would still apply. */
14517#ifdef __cplusplus
14518extern "C"
14519#endif
5df4cba6 14520char sched_yield ();
c0c3707f
CB
14521int
14522main ()
14523{
5df4cba6 14524return sched_yield ();
c0c3707f
CB
14525 ;
14526 return 0;
14527}
6ec2e0f5 14528_ACEOF
c0c3707f 14529if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14530 ac_cv_lib_rt_sched_yield=yes
6ec2e0f5 14531else
5df4cba6 14532 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14533fi
c0c3707f
CB
14534rm -f core conftest.err conftest.$ac_objext \
14535 conftest$ac_exeext conftest.$ac_ext
14536LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14537fi
5df4cba6
SM
14538{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14539$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14540if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14541 LIB_SCHED_YIELD=-lrt
14542else
14543 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14544$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14545if ${ac_cv_lib_posix4_sched_yield+:} false; then :
6ec2e0f5
SDJ
14546 $as_echo_n "(cached) " >&6
14547else
c0c3707f 14548 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14549LIBS="-lposix4 $LIBS"
c0c3707f 14550cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
14551/* end confdefs.h. */
14552
c0c3707f
CB
14553/* Override any GCC internal prototype to avoid an error.
14554 Use char because int might match the return type of a GCC
14555 builtin and then its argument prototype would still apply. */
14556#ifdef __cplusplus
14557extern "C"
14558#endif
5df4cba6 14559char sched_yield ();
6ec2e0f5
SDJ
14560int
14561main ()
14562{
5df4cba6 14563return sched_yield ();
c0c3707f
CB
14564 ;
14565 return 0;
14566}
14567_ACEOF
14568if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14569 ac_cv_lib_posix4_sched_yield=yes
c0c3707f 14570else
5df4cba6 14571 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14572fi
14573rm -f core conftest.err conftest.$ac_objext \
14574 conftest$ac_exeext conftest.$ac_ext
14575LIBS=$ac_check_lib_save_LIBS
14576fi
5df4cba6
SM
14577{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14578$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14579if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14580 LIB_SCHED_YIELD=-lposix4
c0c3707f 14581fi
6ec2e0f5 14582
5df4cba6
SM
14583fi
14584
14585
14586fi
14587rm -f core conftest.err conftest.$ac_objext \
14588 conftest$ac_exeext conftest.$ac_ext
14589
14590
14591 gl_pthreadlib_body_done=done
14592 fi
14593
14594 if test $ac_cv_header_threads_h = yes; then
14595 for ac_func in thrd_create
14596do :
14597 ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create"
14598if test "x$ac_cv_func_thrd_create" = xyes; then :
14599 cat >>confdefs.h <<_ACEOF
14600#define HAVE_THRD_CREATE 1
14601_ACEOF
14602
14603fi
14604done
14605
14606 if test $ac_cv_func_thrd_create = yes; then
14607 LIBSTDTHREAD=
14608 else
14609 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5
14610$as_echo_n "checking for thrd_create in -lstdthreads... " >&6; }
14611if ${ac_cv_lib_stdthreads_thrd_create+:} false; then :
c0c3707f
CB
14612 $as_echo_n "(cached) " >&6
14613else
14614 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14615LIBS="-lstdthreads $LIBS"
c0c3707f
CB
14616cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14617/* end confdefs.h. */
6ec2e0f5 14618
c0c3707f
CB
14619/* Override any GCC internal prototype to avoid an error.
14620 Use char because int might match the return type of a GCC
14621 builtin and then its argument prototype would still apply. */
14622#ifdef __cplusplus
14623extern "C"
14624#endif
5df4cba6 14625char thrd_create ();
c0c3707f
CB
14626int
14627main ()
14628{
5df4cba6 14629return thrd_create ();
6ec2e0f5
SDJ
14630 ;
14631 return 0;
14632}
14633_ACEOF
c0c3707f 14634if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14635 ac_cv_lib_stdthreads_thrd_create=yes
6ec2e0f5 14636else
5df4cba6 14637 ac_cv_lib_stdthreads_thrd_create=no
6ec2e0f5 14638fi
c0c3707f
CB
14639rm -f core conftest.err conftest.$ac_objext \
14640 conftest$ac_exeext conftest.$ac_ext
14641LIBS=$ac_check_lib_save_LIBS
14642fi
5df4cba6
SM
14643{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5
14644$as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; }
14645if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then :
6ec2e0f5 14646
5df4cba6 14647 LIBSTDTHREAD='-lstdthreads -lpthread'
6ec2e0f5 14648
5df4cba6 14649else
6ec2e0f5 14650
5df4cba6 14651 LIBSTDTHREAD="$LIBPMULTITHREAD"
6ec2e0f5 14652
5df4cba6 14653fi
6ec2e0f5 14654
5df4cba6 14655 fi
c0c3707f 14656 else
5df4cba6
SM
14657 LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
14658 fi
14659 ;;
14660 esac
c0c3707f 14661
c0c3707f 14662
5df4cba6
SM
14663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5
14664$as_echo_n "checking whether ISO C threads API is available... " >&6; }
14665 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5
14666$as_echo "$ac_cv_header_threads_h" >&6; }
14667 gl_stdthreadlib_body_done=done
14668 fi
c0c3707f 14669
5df4cba6
SM
14670 LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
14671 LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
c0c3707f
CB
14672 gl_threads_api=isoc
14673
14674$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
14675
14676 fi
14677 fi
14678 if test $gl_threads_api = none; then
14679 case "$gl_use_threads" in
14680 yes | windows | win32) # The 'win32' is for backward compatibility.
14681 if { case "$host_os" in
14682 mingw*) true;;
14683 *) false;;
14684 esac
14685 }; then
14686 gl_threads_api=windows
14687
14688$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
14689
14690 fi
14691 ;;
14692 esac
14693 fi
14694 fi
14695 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
14696$as_echo_n "checking for multithread API to use... " >&6; }
14697 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
14698$as_echo "$gl_threads_api" >&6; }
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
14712$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
14713if ${gl_cv_func_malloc_posix+:} false; then :
6ec2e0f5
SDJ
14714 $as_echo_n "(cached) " >&6
14715else
c0c3707f
CB
14716
14717 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14718/* end confdefs.h. */
c0c3707f 14719
6ec2e0f5
SDJ
14720int
14721main ()
14722{
c0c3707f
CB
14723#if defined _WIN32 && ! defined __CYGWIN__
14724 choke me
14725 #endif
6ec2e0f5
SDJ
14726
14727 ;
14728 return 0;
14729}
14730_ACEOF
14731if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 14732 gl_cv_func_malloc_posix=yes
6ec2e0f5 14733else
c0c3707f 14734 gl_cv_func_malloc_posix=no
6ec2e0f5
SDJ
14735fi
14736rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
472fa5ee 14737
c0c3707f
CB
14738fi
14739{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
14740$as_echo "$gl_cv_func_malloc_posix" >&6; }
472fa5ee
SM
14741
14742
6ec2e0f5 14743
c0c3707f
CB
14744 for ac_header in stdlib.h
14745do :
14746 ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
14747if test "x$ac_cv_header_stdlib_h" = xyes; then :
14748 cat >>confdefs.h <<_ACEOF
14749#define HAVE_STDLIB_H 1
6ec2e0f5
SDJ
14750_ACEOF
14751
c0c3707f 14752fi
6ec2e0f5 14753
c0c3707f 14754done
472fa5ee 14755
c0c3707f
CB
14756 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
14757$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
14758if ${ac_cv_func_malloc_0_nonnull+:} false; then :
6ec2e0f5
SDJ
14759 $as_echo_n "(cached) " >&6
14760else
14761 if test "$cross_compiling" = yes; then :
14762 case "$host_os" in
c0c3707f
CB
14763 # Guess yes on platforms where we know the result.
14764 *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
14765 | hpux* | solaris* | cygwin* | mingw*)
14766 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
14767 # If we don't know, obey --enable-cross-guesses.
14768 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
14769 esac
6ec2e0f5
SDJ
14770
14771else
14772 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14773/* end confdefs.h. */
c0c3707f
CB
14774#if defined STDC_HEADERS || defined HAVE_STDLIB_H
14775 # include <stdlib.h>
14776 #else
14777 char *malloc ();
14778 #endif
6ec2e0f5
SDJ
14779
14780int
14781main ()
14782{
c0c3707f
CB
14783char *p = malloc (0);
14784 int result = !p;
14785 free (p);
14786 return result;
6ec2e0f5
SDJ
14787 ;
14788 return 0;
698be2d8
CB
14789}
14790
14791_ACEOF
14792if ac_fn_c_try_run "$LINENO"; then :
14793 ac_cv_func_malloc_0_nonnull=yes
14794else
14795 ac_cv_func_malloc_0_nonnull=no
14796fi
14797rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14798 conftest.$ac_objext conftest.beam conftest.$ac_ext
14799fi
14800
14801
14802fi
14803{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
14804$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
14805 case "$ac_cv_func_malloc_0_nonnull" in
14806 *yes)
14807 gl_cv_func_malloc_0_nonnull=1
14808 ;;
14809 *)
14810 gl_cv_func_malloc_0_nonnull=0
14811 ;;
14812 esac
14813
14814
14815cat >>confdefs.h <<_ACEOF
14816#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
14817_ACEOF
14818
14819
14820
c0c3707f
CB
14821
14822
6ec2e0f5
SDJ
14823
14824
14825
14826
14827
14828
c0c3707f
CB
14829 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
14830$as_echo_n "checking for a traditional japanese locale... " >&6; }
14831if ${gt_cv_locale_ja+:} false; then :
14832 $as_echo_n "(cached) " >&6
14833else
14834
14835 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14836/* end confdefs.h. */
6ec2e0f5 14837
c0c3707f
CB
14838#include <locale.h>
14839#include <time.h>
14840#if HAVE_LANGINFO_CODESET
14841# include <langinfo.h>
14842#endif
14843#include <stdlib.h>
14844#include <string.h>
14845struct tm t;
14846char buf[16];
14847int main ()
14848{
14849 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
14850 imitates locale dependent behaviour by looking at the environment
14851 variables, and all locales use the UTF-8 encoding. */
14852#if defined __BEOS__ || defined __HAIKU__
14853 return 1;
14854#else
14855 /* Check whether the given locale name is recognized by the system. */
14856# if defined _WIN32 && !defined __CYGWIN__
14857 /* On native Windows, setlocale(category, "") looks at the system settings,
14858 not at the environment variables. Also, when an encoding suffix such
14859 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
14860 category of the locale to "C". */
14861 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
14862 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
14863 return 1;
14864# else
14865 if (setlocale (LC_ALL, "") == NULL) return 1;
14866# endif
14867 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
14868 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
14869 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
14870 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
14871 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
14872 some unit tests fail.
14873 On MirBSD 10, when an unsupported locale is specified, setlocale()
14874 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
14875# if HAVE_LANGINFO_CODESET
14876 {
14877 const char *cs = nl_langinfo (CODESET);
14878 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
14879 || strcmp (cs, "UTF-8") == 0)
14880 return 1;
14881 }
14882# endif
14883# ifdef __CYGWIN__
14884 /* On Cygwin, avoid locale names without encoding suffix, because the
14885 locale_charset() function relies on the encoding suffix. Note that
14886 LC_ALL is set on the command line. */
14887 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
14888# endif
14889 /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
14890 on Cygwin 1.5.x. */
14891 if (MB_CUR_MAX == 1)
14892 return 1;
14893 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
14894 This excludes the UTF-8 encoding (except on MirBSD). */
14895 {
14896 const char *p;
14897 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
14898 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
14899 for (p = buf; *p != '\0'; p++)
14900 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
14901 return 1;
14902 }
14903 return 0;
14904#endif
14905}
6ec2e0f5 14906
c0c3707f
CB
14907_ACEOF
14908 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
14909 (eval $ac_link) 2>&5
14910 ac_status=$?
14911 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14912 test $ac_status = 0; } && test -s conftest$ac_exeext; then
14913 case "$host_os" in
14914 # Handle native Windows specially, because there setlocale() interprets
14915 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
14916 # "fr" or "fra" as "French" or "French_France.1252",
14917 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
14918 # "ja" as "Japanese" or "Japanese_Japan.932",
14919 # and similar.
14920 mingw*)
14921 # Note that on native Windows, the Japanese locale is
14922 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
14923 # cannot use it here.
14924 gt_cv_locale_ja=none
14925 ;;
14926 *)
14927 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
14928 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
14929 # configure script would override the LC_ALL setting. Likewise for
14930 # LC_CTYPE, which is also set at the beginning of the configure script.
14931 # Test for the AIX locale name.
14932 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14933 gt_cv_locale_ja=ja_JP
14934 else
14935 # Test for the locale name with explicit encoding suffix.
14936 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14937 gt_cv_locale_ja=ja_JP.EUC-JP
14938 else
14939 # Test for the HP-UX, OSF/1, NetBSD locale name.
14940 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14941 gt_cv_locale_ja=ja_JP.eucJP
14942 else
14943 # Test for the IRIX, FreeBSD locale name.
14944 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14945 gt_cv_locale_ja=ja_JP.EUC
14946 else
14947 # Test for the Solaris 7 locale name.
14948 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14949 gt_cv_locale_ja=ja
14950 else
14951 # Special test for NetBSD 1.6.
14952 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
14953 gt_cv_locale_ja=ja_JP.eucJP
14954 else
14955 # None found.
14956 gt_cv_locale_ja=none
14957 fi
14958 fi
14959 fi
14960 fi
14961 fi
14962 fi
14963 ;;
14964 esac
14965 fi
14966 rm -fr conftest*
5abebf3c
CB
14967
14968fi
c0c3707f
CB
14969{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
14970$as_echo "$gt_cv_locale_ja" >&6; }
14971 LOCALE_JA=$gt_cv_locale_ja
5abebf3c 14972
5abebf3c 14973
5abebf3c 14974
5abebf3c 14975
c0c3707f
CB
14976 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
14977$as_echo_n "checking for a french Unicode locale... " >&6; }
14978if ${gt_cv_locale_fr_utf8+:} false; then :
5abebf3c
CB
14979 $as_echo_n "(cached) " >&6
14980else
5abebf3c 14981
c0c3707f 14982 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 14983/* end confdefs.h. */
5abebf3c 14984
c0c3707f
CB
14985#include <locale.h>
14986#include <time.h>
14987#if HAVE_LANGINFO_CODESET
14988# include <langinfo.h>
14989#endif
14990#include <stdlib.h>
14991#include <string.h>
14992struct tm t;
14993char buf[16];
14994int main () {
14995 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
14996 imitates locale dependent behaviour by looking at the environment
14997 variables, and all locales use the UTF-8 encoding. */
14998#if !(defined __BEOS__ || defined __HAIKU__)
14999 /* Check whether the given locale name is recognized by the system. */
15000# if defined _WIN32 && !defined __CYGWIN__
15001 /* On native Windows, setlocale(category, "") looks at the system settings,
15002 not at the environment variables. Also, when an encoding suffix such
15003 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15004 category of the locale to "C". */
15005 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15006 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15007 return 1;
15008# else
15009 if (setlocale (LC_ALL, "") == NULL) return 1;
15010# endif
15011 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15012 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15013 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15014 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15015 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15016 some unit tests fail. */
15017# if HAVE_LANGINFO_CODESET
15018 {
15019 const char *cs = nl_langinfo (CODESET);
15020 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
15021 return 1;
15022 }
15023# endif
15024# ifdef __CYGWIN__
15025 /* On Cygwin, avoid locale names without encoding suffix, because the
15026 locale_charset() function relies on the encoding suffix. Note that
15027 LC_ALL is set on the command line. */
15028 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15029# endif
15030 /* Check whether in the abbreviation of the second month, the second
15031 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
15032 two bytes long, with UTF-8 encoding. */
15033 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15034 if (strftime (buf, sizeof (buf), "%b", &t) < 4
15035 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
15036 return 1;
15037#endif
15038#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
15039 /* Check whether the decimal separator is a comma.
15040 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
15041 are nl_langinfo(RADIXCHAR) are both ".". */
15042 if (localeconv () ->decimal_point[0] != ',') return 1;
15043#endif
5abebf3c
CB
15044 return 0;
15045}
5abebf3c 15046
c0c3707f
CB
15047_ACEOF
15048 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15049 (eval $ac_link) 2>&5
15050 ac_status=$?
15051 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15052 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15053 case "$host_os" in
15054 # Handle native Windows specially, because there setlocale() interprets
15055 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15056 # "fr" or "fra" as "French" or "French_France.1252",
15057 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15058 # "ja" as "Japanese" or "Japanese_Japan.932",
15059 # and similar.
15060 mingw*)
15061 # Test for the hypothetical native Windows locale name.
15062 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15063 gt_cv_locale_fr_utf8=French_France.65001
15064 else
15065 # None found.
15066 gt_cv_locale_fr_utf8=none
15067 fi
15068 ;;
15069 *)
15070 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15071 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15072 # configure script would override the LC_ALL setting. Likewise for
15073 # LC_CTYPE, which is also set at the beginning of the configure script.
15074 # Test for the usual locale name.
15075 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15076 gt_cv_locale_fr_utf8=fr_FR
15077 else
15078 # Test for the locale name with explicit encoding suffix.
15079 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15080 gt_cv_locale_fr_utf8=fr_FR.UTF-8
15081 else
15082 # Test for the Solaris 7 locale name.
15083 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15084 gt_cv_locale_fr_utf8=fr.UTF-8
15085 else
15086 # None found.
15087 gt_cv_locale_fr_utf8=none
15088 fi
15089 fi
15090 fi
15091 ;;
15092 esac
15093 fi
15094 rm -fr conftest*
5abebf3c
CB
15095
15096fi
c0c3707f
CB
15097{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
15098$as_echo "$gt_cv_locale_fr_utf8" >&6; }
15099 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
5abebf3c
CB
15100
15101
15102
15103
15104
c0c3707f
CB
15105 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
15106$as_echo_n "checking for a transitional chinese locale... " >&6; }
15107if ${gt_cv_locale_zh_CN+:} false; then :
5abebf3c
CB
15108 $as_echo_n "(cached) " >&6
15109else
5abebf3c 15110
c0c3707f 15111 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 15112/* end confdefs.h. */
5abebf3c 15113
c0c3707f
CB
15114#include <locale.h>
15115#include <stdlib.h>
15116#include <time.h>
15117#if HAVE_LANGINFO_CODESET
15118# include <langinfo.h>
15119#endif
15120#include <stdlib.h>
15121#include <string.h>
15122struct tm t;
15123char buf[16];
15124int main ()
5abebf3c 15125{
c0c3707f
CB
15126 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15127 imitates locale dependent behaviour by looking at the environment
15128 variables, and all locales use the UTF-8 encoding. */
15129#if defined __BEOS__ || defined __HAIKU__
15130 return 1;
15131#else
15132 /* Check whether the given locale name is recognized by the system. */
15133# if defined _WIN32 && !defined __CYGWIN__
15134 /* On native Windows, setlocale(category, "") looks at the system settings,
15135 not at the environment variables. Also, when an encoding suffix such
15136 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15137 category of the locale to "C". */
15138 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15139 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15140 return 1;
15141# else
15142 if (setlocale (LC_ALL, "") == NULL) return 1;
15143# endif
15144 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15145 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15146 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15147 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15148 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15149 some unit tests fail.
15150 On MirBSD 10, when an unsupported locale is specified, setlocale()
15151 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
15152# if HAVE_LANGINFO_CODESET
15153 {
15154 const char *cs = nl_langinfo (CODESET);
15155 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15156 || strcmp (cs, "UTF-8") == 0)
15157 return 1;
15158 }
15159# endif
15160# ifdef __CYGWIN__
15161 /* On Cygwin, avoid locale names without encoding suffix, because the
15162 locale_charset() function relies on the encoding suffix. Note that
15163 LC_ALL is set on the command line. */
15164 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15165# endif
15166 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
15167 This excludes the UTF-8 encoding (except on MirBSD). */
15168 {
15169 const char *p;
15170 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15171 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
15172 for (p = buf; *p != '\0'; p++)
15173 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
15174 return 1;
15175 }
15176 /* Check whether a typical GB18030 multibyte sequence is recognized as a
15177 single wide character. This excludes the GB2312 and GBK encodings. */
15178 if (mblen ("\203\062\332\066", 5) != 4)
15179 return 1;
5abebf3c 15180 return 0;
c0c3707f 15181#endif
5abebf3c 15182}
c0c3707f 15183
5abebf3c 15184_ACEOF
c0c3707f
CB
15185 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15186 (eval $ac_link) 2>&5
15187 ac_status=$?
15188 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15189 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15190 case "$host_os" in
15191 # Handle native Windows specially, because there setlocale() interprets
15192 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15193 # "fr" or "fra" as "French" or "French_France.1252",
15194 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15195 # "ja" as "Japanese" or "Japanese_Japan.932",
15196 # and similar.
15197 mingw*)
15198 # Test for the hypothetical native Windows locale name.
15199 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15200 gt_cv_locale_zh_CN=Chinese_China.54936
15201 else
15202 # None found.
15203 gt_cv_locale_zh_CN=none
15204 fi
15205 ;;
15206 solaris2.8)
15207 # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
15208 # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
15209 # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
15210 gt_cv_locale_zh_CN=none
15211 ;;
15212 *)
15213 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15214 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15215 # configure script would override the LC_ALL setting. Likewise for
15216 # LC_CTYPE, which is also set at the beginning of the configure script.
15217 # Test for the locale name without encoding suffix.
15218 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15219 gt_cv_locale_zh_CN=zh_CN
15220 else
15221 # Test for the locale name with explicit encoding suffix.
15222 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15223 gt_cv_locale_zh_CN=zh_CN.GB18030
15224 else
15225 # None found.
15226 gt_cv_locale_zh_CN=none
15227 fi
15228 fi
15229 ;;
15230 esac
15231 else
15232 # If there was a link error, due to mblen(), the system is so old that
15233 # it certainly doesn't have a chinese locale.
15234 gt_cv_locale_zh_CN=none
15235 fi
15236 rm -fr conftest*
15237
5abebf3c 15238fi
c0c3707f
CB
15239{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
15240$as_echo "$gt_cv_locale_zh_CN" >&6; }
15241 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
15242
15243
15244{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
15245$as_echo_n "checking for inline... " >&6; }
15246if ${ac_cv_c_inline+:} false; then :
15247 $as_echo_n "(cached) " >&6
15248else
15249 ac_cv_c_inline=no
15250for ac_kw in inline __inline__ __inline; do
15251 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15252/* end confdefs.h. */
15253#ifndef __cplusplus
15254typedef int foo_t;
15255static $ac_kw foo_t static_foo () {return 0; }
15256$ac_kw foo_t foo () {return 0; }
15257#endif
5abebf3c 15258
c0c3707f
CB
15259_ACEOF
15260if ac_fn_c_try_compile "$LINENO"; then :
15261 ac_cv_c_inline=$ac_kw
15262fi
15263rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15264 test "$ac_cv_c_inline" != no && break
15265done
5abebf3c
CB
15266
15267fi
c0c3707f
CB
15268{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
15269$as_echo "$ac_cv_c_inline" >&6; }
5abebf3c 15270
c0c3707f
CB
15271case $ac_cv_c_inline in
15272 inline | yes) ;;
15273 *)
15274 case $ac_cv_c_inline in
15275 no) ac_val=;;
15276 *) ac_val=$ac_cv_c_inline;;
15277 esac
15278 cat >>confdefs.h <<_ACEOF
15279#ifndef __cplusplus
15280#define inline $ac_val
15281#endif
15282_ACEOF
15283 ;;
15284esac
5abebf3c
CB
15285
15286
15287
15288
5abebf3c
CB
15289
15290
c0c3707f
CB
15291 GNULIB_EXPLICIT_BZERO=0;
15292 GNULIB_FFSL=0;
15293 GNULIB_FFSLL=0;
15294 GNULIB_MEMCHR=0;
15295 GNULIB_MEMMEM=0;
15296 GNULIB_MEMPCPY=0;
15297 GNULIB_MEMRCHR=0;
15298 GNULIB_RAWMEMCHR=0;
15299 GNULIB_STPCPY=0;
15300 GNULIB_STPNCPY=0;
15301 GNULIB_STRCHRNUL=0;
15302 GNULIB_STRDUP=0;
15303 GNULIB_STRNCAT=0;
15304 GNULIB_STRNDUP=0;
15305 GNULIB_STRNLEN=0;
15306 GNULIB_STRPBRK=0;
15307 GNULIB_STRSEP=0;
15308 GNULIB_STRSTR=0;
15309 GNULIB_STRCASESTR=0;
15310 GNULIB_STRTOK_R=0;
15311 GNULIB_MBSLEN=0;
15312 GNULIB_MBSNLEN=0;
15313 GNULIB_MBSCHR=0;
15314 GNULIB_MBSRCHR=0;
15315 GNULIB_MBSSTR=0;
15316 GNULIB_MBSCASECMP=0;
15317 GNULIB_MBSNCASECMP=0;
15318 GNULIB_MBSPCASECMP=0;
15319 GNULIB_MBSCASESTR=0;
15320 GNULIB_MBSCSPN=0;
15321 GNULIB_MBSPBRK=0;
15322 GNULIB_MBSSPN=0;
15323 GNULIB_MBSSEP=0;
15324 GNULIB_MBSTOK_R=0;
15325 GNULIB_STRERROR=0;
15326 GNULIB_STRERROR_R=0;
15327 GNULIB_STRSIGNAL=0;
15328 GNULIB_STRVERSCMP=0;
15329 HAVE_MBSLEN=0;
15330 HAVE_EXPLICIT_BZERO=1;
15331 HAVE_FFSL=1;
15332 HAVE_FFSLL=1;
15333 HAVE_MEMCHR=1;
15334 HAVE_DECL_MEMMEM=1;
15335 HAVE_MEMPCPY=1;
15336 HAVE_DECL_MEMRCHR=1;
15337 HAVE_RAWMEMCHR=1;
15338 HAVE_STPCPY=1;
15339 HAVE_STPNCPY=1;
15340 HAVE_STRCHRNUL=1;
15341 HAVE_DECL_STRDUP=1;
15342 HAVE_DECL_STRNDUP=1;
15343 HAVE_DECL_STRNLEN=1;
15344 HAVE_STRPBRK=1;
15345 HAVE_STRSEP=1;
15346 HAVE_STRCASESTR=1;
15347 HAVE_DECL_STRTOK_R=1;
15348 HAVE_DECL_STRERROR_R=1;
15349 HAVE_DECL_STRSIGNAL=1;
15350 HAVE_STRVERSCMP=1;
15351 REPLACE_MEMCHR=0;
15352 REPLACE_MEMMEM=0;
15353 REPLACE_STPNCPY=0;
15354 REPLACE_STRCHRNUL=0;
15355 REPLACE_STRDUP=0;
15356 REPLACE_STRNCAT=0;
15357 REPLACE_STRNDUP=0;
15358 REPLACE_STRNLEN=0;
15359 REPLACE_STRSTR=0;
15360 REPLACE_STRCASESTR=0;
15361 REPLACE_STRTOK_R=0;
15362 REPLACE_STRERROR=0;
15363 REPLACE_STRERROR_R=0;
15364 REPLACE_STRSIGNAL=0;
15365 UNDEFINE_STRTOK_R=0;
5abebf3c
CB
15366
15367
15368
15369
6ec2e0f5
SDJ
15370
15371
c0c3707f
CB
15372 # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
15373 # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
15374 # irrelevant for anonymous mappings.
15375 ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
15376if test "x$ac_cv_func_mmap" = xyes; then :
15377 gl_have_mmap=yes
6ec2e0f5 15378else
c0c3707f
CB
15379 gl_have_mmap=no
15380fi
6ec2e0f5
SDJ
15381
15382
c0c3707f
CB
15383 # Try to allow MAP_ANONYMOUS.
15384 gl_have_mmap_anonymous=no
15385 if test $gl_have_mmap = yes; then
15386 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
15387$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
15388 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15389/* end confdefs.h. */
6ec2e0f5 15390
c0c3707f
CB
15391#include <sys/mman.h>
15392#ifdef MAP_ANONYMOUS
15393 I cannot identify this map
15394#endif
6ec2e0f5 15395
c0c3707f
CB
15396_ACEOF
15397if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15398 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
15399 gl_have_mmap_anonymous=yes
6ec2e0f5 15400fi
c0c3707f 15401rm -f conftest*
6ec2e0f5 15402
c0c3707f
CB
15403 if test $gl_have_mmap_anonymous != yes; then
15404 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15405/* end confdefs.h. */
6ec2e0f5 15406
c0c3707f
CB
15407#include <sys/mman.h>
15408#ifdef MAP_ANON
15409 I cannot identify this map
15410#endif
6ec2e0f5 15411
c0c3707f
CB
15412_ACEOF
15413if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15414 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
6ec2e0f5 15415
c0c3707f 15416$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
5e8754f9 15417
c0c3707f 15418 gl_have_mmap_anonymous=yes
5e8754f9 15419fi
c0c3707f
CB
15420rm -f conftest*
15421
15422 fi
15423 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
15424$as_echo "$gl_have_mmap_anonymous" >&6; }
15425 if test $gl_have_mmap_anonymous = yes; then
6ec2e0f5 15426
c0c3707f 15427$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
6ec2e0f5 15428
c0c3707f
CB
15429 fi
15430 fi
6ec2e0f5
SDJ
15431
15432
15433
15434
6ec2e0f5 15435
6ec2e0f5 15436
c0c3707f
CB
15437 if test $HAVE_MEMCHR = 1; then
15438 # Detect platform-specific bugs in some versions of glibc:
15439 # memchr should not dereference anything with length 0
15440 # https://bugzilla.redhat.com/show_bug.cgi?id=499689
15441 # memchr should not dereference overestimated length after a match
15442 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
15443 # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
15444 # memchr should cast the second argument to 'unsigned char'.
15445 # This bug exists in Android 4.3.
15446 # Assume that memchr works on platforms that lack mprotect.
15447 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
15448$as_echo_n "checking whether memchr works... " >&6; }
15449if ${gl_cv_func_memchr_works+:} false; then :
15450 $as_echo_n "(cached) " >&6
6ec2e0f5 15451else
c0c3707f
CB
15452 if test "$cross_compiling" = yes; then :
15453 case "$host_os" in
15454 # Guess no on Android.
15455 linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
15456 # Guess yes on native Windows.
15457 mingw*) gl_cv_func_memchr_works="guessing yes" ;;
15458 # If we don't know, obey --enable-cross-guesses.
15459 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
15460 esac
6ec2e0f5
SDJ
15461
15462else
15463 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15464/* end confdefs.h. */
15465
c0c3707f
CB
15466#include <string.h>
15467#if HAVE_SYS_MMAN_H
15468# include <fcntl.h>
15469# include <unistd.h>
15470# include <sys/types.h>
15471# include <sys/mman.h>
15472# ifndef MAP_FILE
15473# define MAP_FILE 0
15474# endif
15475#endif
6ec2e0f5
SDJ
15476
15477int
15478main ()
15479{
c0c3707f
CB
15480
15481 int result = 0;
15482 char *fence = NULL;
15483#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
15484# if HAVE_MAP_ANONYMOUS
15485 const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
15486 const int fd = -1;
15487# else /* !HAVE_MAP_ANONYMOUS */
15488 const int flags = MAP_FILE | MAP_PRIVATE;
15489 int fd = open ("/dev/zero", O_RDONLY, 0666);
15490 if (fd >= 0)
15491# endif
15492 {
15493 int pagesize = getpagesize ();
15494 char *two_pages =
15495 (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
15496 flags, fd, 0);
15497 if (two_pages != (char *)(-1)
15498 && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
15499 fence = two_pages + pagesize;
15500 }
15501#endif
15502 if (fence)
15503 {
15504 if (memchr (fence, 0, 0))
15505 result |= 1;
15506 strcpy (fence - 9, "12345678");
15507 if (memchr (fence - 9, 0, 79) != fence - 1)
15508 result |= 2;
15509 if (memchr (fence - 1, 0, 3) != fence - 1)
15510 result |= 4;
15511 }
15512 /* Test against bug on Android 4.3. */
15513 {
15514 char input[3];
15515 input[0] = 'a';
15516 input[1] = 'b';
15517 input[2] = 'c';
15518 if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
15519 result |= 8;
15520 }
15521 return result;
6ec2e0f5
SDJ
15522
15523 ;
15524 return 0;
15525}
15526_ACEOF
15527if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 15528 gl_cv_func_memchr_works=yes
6ec2e0f5 15529else
c0c3707f 15530 gl_cv_func_memchr_works=no
6ec2e0f5
SDJ
15531fi
15532rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15533 conftest.$ac_objext conftest.beam conftest.$ac_ext
15534fi
15535
15536
15537fi
c0c3707f
CB
15538{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
15539$as_echo "$gl_cv_func_memchr_works" >&6; }
15540 case "$gl_cv_func_memchr_works" in
6ec2e0f5 15541 *yes) ;;
c0c3707f 15542 *) REPLACE_MEMCHR=1 ;;
6ec2e0f5
SDJ
15543 esac
15544 fi
15545
c0c3707f
CB
15546ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default"
15547if test "x$ac_cv_have_decl_memmem" = xyes; then :
6ec2e0f5
SDJ
15548 ac_have_decl=1
15549else
15550 ac_have_decl=0
15551fi
15552
15553cat >>confdefs.h <<_ACEOF
c0c3707f 15554#define HAVE_DECL_MEMMEM $ac_have_decl
6ec2e0f5
SDJ
15555_ACEOF
15556
472fa5ee 15557
6ec2e0f5
SDJ
15558
15559
15560
c0c3707f
CB
15561 for ac_func in memmem
15562do :
15563 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
15564if test "x$ac_cv_func_memmem" = xyes; then :
15565 cat >>confdefs.h <<_ACEOF
15566#define HAVE_MEMMEM 1
15567_ACEOF
6ec2e0f5 15568
c0c3707f
CB
15569fi
15570done
6ec2e0f5 15571
c0c3707f
CB
15572 if test $ac_cv_func_memmem = yes; then
15573 HAVE_MEMMEM=1
15574 else
15575 HAVE_MEMMEM=0
15576 fi
6ec2e0f5 15577
c0c3707f
CB
15578 if test $ac_cv_have_decl_memmem = no; then
15579 HAVE_DECL_MEMMEM=0
15580 else
15581 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
15582$as_echo_n "checking whether memmem works... " >&6; }
15583if ${gl_cv_func_memmem_works_always+:} false; then :
6ec2e0f5
SDJ
15584 $as_echo_n "(cached) " >&6
15585else
c0c3707f
CB
15586 if test "$cross_compiling" = yes; then :
15587 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15588/* end confdefs.h. */
472fa5ee 15589
c0c3707f
CB
15590#ifdef __GNU_LIBRARY__
15591 #include <features.h>
15592 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
15593 || __GLIBC_MINOR__ > 12)) \
15594 || (__GLIBC__ > 2)) \
15595 || defined __UCLIBC__
15596 Lucky user
15597 #endif
15598#elif defined __CYGWIN__
15599 #include <cygwin/version.h>
15600 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
15601 Lucky user
15602 #endif
15603#else
15604 Lucky user
15605#endif
472fa5ee 15606
c0c3707f
CB
15607_ACEOF
15608if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15609 $EGREP "Lucky user" >/dev/null 2>&1; then :
15610 gl_cv_func_memmem_works_always="guessing yes"
15611else
15612 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
15613fi
15614rm -f conftest*
472fa5ee
SM
15615
15616
6ec2e0f5
SDJ
15617else
15618 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15619/* end confdefs.h. */
c0c3707f
CB
15620
15621#include <string.h> /* for memmem */
15622#define P "_EF_BF_BD"
15623#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
15624#define NEEDLE P P P P P
6ec2e0f5
SDJ
15625
15626int
15627main ()
15628{
c0c3707f 15629
698be2d8
CB
15630 int result = 0;
15631 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
15632 result |= 1;
15633 /* Check for empty needle behavior. */
15634 {
15635 const char *haystack = "AAA";
15636 if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
15637 result |= 2;
15638 }
15639 return result;
15640
15641 ;
15642 return 0;
15643}
15644_ACEOF
15645if ac_fn_c_try_run "$LINENO"; then :
15646 gl_cv_func_memmem_works_always=yes
15647else
15648 gl_cv_func_memmem_works_always=no
15649fi
15650rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15651 conftest.$ac_objext conftest.beam conftest.$ac_ext
15652fi
15653
15654
15655fi
15656{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
15657$as_echo "$gl_cv_func_memmem_works_always" >&6; }
15658 case "$gl_cv_func_memmem_works_always" in
15659 *yes) ;;
15660 *)
15661 REPLACE_MEMMEM=1
15662 ;;
15663 esac
15664 fi
15665 :
15666
15667ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
15668if test "x$ac_cv_have_decl_memrchr" = xyes; then :
15669 ac_have_decl=1
15670else
15671 ac_have_decl=0
15672fi
15673
15674cat >>confdefs.h <<_ACEOF
15675#define HAVE_DECL_MEMRCHR $ac_have_decl
15676_ACEOF
15677
15678
15679
15680
15681
15682 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5
15683$as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; }
15684if ${gl_cv_minmax_in_limits_h+:} false; then :
15685 $as_echo_n "(cached) " >&6
15686else
15687 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15688/* end confdefs.h. */
15689#include <limits.h>
15690 int x = MIN (42, 17);
15691int
15692main ()
15693{
15694
15695 ;
15696 return 0;
15697}
15698_ACEOF
15699if ac_fn_c_try_compile "$LINENO"; then :
15700 gl_cv_minmax_in_limits_h=yes
15701else
15702 gl_cv_minmax_in_limits_h=no
15703fi
15704rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15705fi
15706{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5
15707$as_echo "$gl_cv_minmax_in_limits_h" >&6; }
15708 if test $gl_cv_minmax_in_limits_h = yes; then
15709
15710$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h
15711
15712 fi
15713
15714
15715
15716
15717
15718
15719 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5
15720$as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; }
15721if ${gl_cv_minmax_in_sys_param_h+:} false; then :
15722 $as_echo_n "(cached) " >&6
15723else
15724 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15725/* end confdefs.h. */
15726#include <sys/param.h>
15727 int x = MIN (42, 17);
15728int
15729main ()
15730{
15731
6ec2e0f5
SDJ
15732 ;
15733 return 0;
15734}
15735_ACEOF
698be2d8
CB
15736if ac_fn_c_try_compile "$LINENO"; then :
15737 gl_cv_minmax_in_sys_param_h=yes
6ec2e0f5 15738else
698be2d8 15739 gl_cv_minmax_in_sys_param_h=no
6ec2e0f5 15740fi
698be2d8 15741rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 15742fi
698be2d8
CB
15743{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5
15744$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; }
15745 if test $gl_cv_minmax_in_sys_param_h = yes; then
6ec2e0f5 15746
698be2d8 15747$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
c0c3707f 15748
c0c3707f 15749 fi
c0c3707f 15750
c0c3707f 15751
698be2d8 15752
c0c3707f
CB
15753
15754
15755
15756
15757
15758
15759
15760 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
15761$as_echo_n "checking for O_CLOEXEC... " >&6; }
15762if ${gl_cv_macro_O_CLOEXEC+:} false; then :
6ec2e0f5
SDJ
15763 $as_echo_n "(cached) " >&6
15764else
15765 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15766/* end confdefs.h. */
c0c3707f
CB
15767#include <fcntl.h>
15768 #ifndef O_CLOEXEC
15769 choke me;
15770 #endif
6ec2e0f5
SDJ
15771
15772int
15773main ()
15774{
c0c3707f 15775return O_CLOEXEC;
6ec2e0f5
SDJ
15776 ;
15777 return 0;
15778}
15779_ACEOF
15780if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 15781 gl_cv_macro_O_CLOEXEC=yes
6ec2e0f5 15782else
c0c3707f 15783 gl_cv_macro_O_CLOEXEC=no
6ec2e0f5
SDJ
15784fi
15785rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15786fi
c0c3707f
CB
15787{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
15788$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
15789
15790
15791
15792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
15793$as_echo_n "checking for promoted mode_t type... " >&6; }
15794if ${gl_cv_promoted_mode_t+:} false; then :
6ec2e0f5
SDJ
15795 $as_echo_n "(cached) " >&6
15796else
6ec2e0f5 15797
c0c3707f
CB
15798 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15799/* end confdefs.h. */
15800#include <sys/types.h>
6ec2e0f5
SDJ
15801int
15802main ()
15803{
c0c3707f 15804typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
6ec2e0f5
SDJ
15805 ;
15806 return 0;
15807}
15808_ACEOF
15809if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 15810 gl_cv_promoted_mode_t='int'
6ec2e0f5 15811else
c0c3707f 15812 gl_cv_promoted_mode_t='mode_t'
6ec2e0f5
SDJ
15813fi
15814rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 15815
6ec2e0f5 15816fi
c0c3707f
CB
15817{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
15818$as_echo "$gl_cv_promoted_mode_t" >&6; }
6ec2e0f5 15819
c0c3707f
CB
15820cat >>confdefs.h <<_ACEOF
15821#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
6ec2e0f5 15822_ACEOF
c0c3707f
CB
15823
15824
15825
15826
15827
15828 GNULIB_DPRINTF=0;
15829 GNULIB_FCLOSE=0;
15830 GNULIB_FDOPEN=0;
15831 GNULIB_FFLUSH=0;
15832 GNULIB_FGETC=0;
15833 GNULIB_FGETS=0;
15834 GNULIB_FOPEN=0;
15835 GNULIB_FPRINTF=0;
15836 GNULIB_FPRINTF_POSIX=0;
15837 GNULIB_FPURGE=0;
15838 GNULIB_FPUTC=0;
15839 GNULIB_FPUTS=0;
15840 GNULIB_FREAD=0;
15841 GNULIB_FREOPEN=0;
15842 GNULIB_FSCANF=0;
15843 GNULIB_FSEEK=0;
15844 GNULIB_FSEEKO=0;
15845 GNULIB_FTELL=0;
15846 GNULIB_FTELLO=0;
15847 GNULIB_FWRITE=0;
15848 GNULIB_GETC=0;
15849 GNULIB_GETCHAR=0;
15850 GNULIB_GETDELIM=0;
15851 GNULIB_GETLINE=0;
15852 GNULIB_OBSTACK_PRINTF=0;
15853 GNULIB_OBSTACK_PRINTF_POSIX=0;
15854 GNULIB_PCLOSE=0;
15855 GNULIB_PERROR=0;
15856 GNULIB_POPEN=0;
15857 GNULIB_PRINTF=0;
15858 GNULIB_PRINTF_POSIX=0;
15859 GNULIB_PUTC=0;
15860 GNULIB_PUTCHAR=0;
15861 GNULIB_PUTS=0;
15862 GNULIB_REMOVE=0;
15863 GNULIB_RENAME=0;
15864 GNULIB_RENAMEAT=0;
15865 GNULIB_SCANF=0;
15866 GNULIB_SNPRINTF=0;
15867 GNULIB_SPRINTF_POSIX=0;
15868 GNULIB_STDIO_H_NONBLOCKING=0;
15869 GNULIB_STDIO_H_SIGPIPE=0;
15870 GNULIB_TMPFILE=0;
15871 GNULIB_VASPRINTF=0;
15872 GNULIB_VFSCANF=0;
15873 GNULIB_VSCANF=0;
15874 GNULIB_VDPRINTF=0;
15875 GNULIB_VFPRINTF=0;
15876 GNULIB_VFPRINTF_POSIX=0;
15877 GNULIB_VPRINTF=0;
15878 GNULIB_VPRINTF_POSIX=0;
15879 GNULIB_VSNPRINTF=0;
15880 GNULIB_VSPRINTF_POSIX=0;
15881 HAVE_DECL_FPURGE=1;
15882 HAVE_DECL_FSEEKO=1;
15883 HAVE_DECL_FTELLO=1;
15884 HAVE_DECL_GETDELIM=1;
15885 HAVE_DECL_GETLINE=1;
15886 HAVE_DECL_OBSTACK_PRINTF=1;
15887 HAVE_DECL_SNPRINTF=1;
15888 HAVE_DECL_VSNPRINTF=1;
15889 HAVE_DPRINTF=1;
15890 HAVE_FSEEKO=1;
15891 HAVE_FTELLO=1;
15892 HAVE_PCLOSE=1;
15893 HAVE_POPEN=1;
15894 HAVE_RENAMEAT=1;
15895 HAVE_VASPRINTF=1;
15896 HAVE_VDPRINTF=1;
15897 REPLACE_DPRINTF=0;
15898 REPLACE_FCLOSE=0;
15899 REPLACE_FDOPEN=0;
15900 REPLACE_FFLUSH=0;
15901 REPLACE_FOPEN=0;
15902 REPLACE_FPRINTF=0;
15903 REPLACE_FPURGE=0;
15904 REPLACE_FREOPEN=0;
15905 REPLACE_FSEEK=0;
15906 REPLACE_FSEEKO=0;
15907 REPLACE_FTELL=0;
15908 REPLACE_FTELLO=0;
15909 REPLACE_GETDELIM=0;
15910 REPLACE_GETLINE=0;
15911 REPLACE_OBSTACK_PRINTF=0;
15912 REPLACE_PERROR=0;
15913 REPLACE_POPEN=0;
15914 REPLACE_PRINTF=0;
15915 REPLACE_REMOVE=0;
15916 REPLACE_RENAME=0;
15917 REPLACE_RENAMEAT=0;
15918 REPLACE_SNPRINTF=0;
15919 REPLACE_SPRINTF=0;
15920 REPLACE_STDIO_READ_FUNCS=0;
15921 REPLACE_STDIO_WRITE_FUNCS=0;
15922 REPLACE_TMPFILE=0;
15923 REPLACE_VASPRINTF=0;
15924 REPLACE_VDPRINTF=0;
15925 REPLACE_VFPRINTF=0;
15926 REPLACE_VPRINTF=0;
15927 REPLACE_VSNPRINTF=0;
15928 REPLACE_VSPRINTF=0;
15929
15930
15931
15932ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
15933if test "x$ac_cv_have_decl_setenv" = xyes; then :
15934 ac_have_decl=1
6ec2e0f5 15935else
c0c3707f 15936 ac_have_decl=0
6ec2e0f5 15937fi
c0c3707f
CB
15938
15939cat >>confdefs.h <<_ACEOF
15940#define HAVE_DECL_SETENV $ac_have_decl
15941_ACEOF
15942
15943
15944
15945
15946
15947
15948 if test $ac_cv_have_decl_setenv = no; then
15949 HAVE_DECL_SETENV=0
6ec2e0f5
SDJ
15950 fi
15951
15952
15953
15954
15955
c0c3707f
CB
15956 for ac_header in search.h
15957do :
15958 ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
15959if test "x$ac_cv_header_search_h" = xyes; then :
15960 cat >>confdefs.h <<_ACEOF
15961#define HAVE_SEARCH_H 1
15962_ACEOF
6ec2e0f5 15963
c0c3707f 15964fi
6ec2e0f5 15965
c0c3707f 15966done
6ec2e0f5 15967
c0c3707f
CB
15968 for ac_func in tsearch
15969do :
15970 ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
15971if test "x$ac_cv_func_tsearch" = xyes; then :
15972 cat >>confdefs.h <<_ACEOF
15973#define HAVE_TSEARCH 1
15974_ACEOF
6ec2e0f5 15975
c0c3707f
CB
15976fi
15977done
6ec2e0f5
SDJ
15978
15979
15980
15981
c0c3707f
CB
15982 GNULIB_PTHREAD_SIGMASK=0;
15983 GNULIB_RAISE=0;
15984 GNULIB_SIGNAL_H_SIGPIPE=0;
15985 GNULIB_SIGPROCMASK=0;
15986 GNULIB_SIGACTION=0;
15987 HAVE_POSIX_SIGNALBLOCKING=1;
15988 HAVE_PTHREAD_SIGMASK=1;
15989 HAVE_RAISE=1;
15990 HAVE_SIGSET_T=1;
15991 HAVE_SIGINFO_T=1;
15992 HAVE_SIGACTION=1;
15993 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
6ec2e0f5 15994
c0c3707f 15995 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
6ec2e0f5 15996
c0c3707f
CB
15997 HAVE_SIGHANDLER_T=1;
15998 REPLACE_PTHREAD_SIGMASK=0;
15999 REPLACE_RAISE=0;
6ec2e0f5 16000
6ec2e0f5 16001
c0c3707f
CB
16002 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
16003 #include <signal.h>
16004 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
16005 #include <sys/types.h>
16006
16007"
16008if test "x$ac_cv_type_sigset_t" = xyes; then :
16009
16010cat >>confdefs.h <<_ACEOF
16011#define HAVE_SIGSET_T 1
16012_ACEOF
16013
16014gl_cv_type_sigset_t=yes
16015else
16016 gl_cv_type_sigset_t=no
16017fi
6ec2e0f5 16018
c0c3707f
CB
16019 if test $gl_cv_type_sigset_t != yes; then
16020 HAVE_SIGSET_T=0
16021 fi
6ec2e0f5 16022
c0c3707f
CB
16023{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
16024$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
16025if ${ac_cv_type_uid_t+:} false; then :
16026 $as_echo_n "(cached) " >&6
16027else
6ec2e0f5
SDJ
16028 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16029/* end confdefs.h. */
c0c3707f
CB
16030#include <sys/types.h>
16031
6ec2e0f5 16032_ACEOF
c0c3707f
CB
16033if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16034 $EGREP "uid_t" >/dev/null 2>&1; then :
16035 ac_cv_type_uid_t=yes
16036else
16037 ac_cv_type_uid_t=no
16038fi
16039rm -f conftest*
6ec2e0f5 16040
c0c3707f
CB
16041fi
16042{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
16043$as_echo "$ac_cv_type_uid_t" >&6; }
16044if test $ac_cv_type_uid_t = no; then
6ec2e0f5 16045
c0c3707f 16046$as_echo "#define uid_t int" >>confdefs.h
6ec2e0f5 16047
6ec2e0f5 16048
c0c3707f 16049$as_echo "#define gid_t int" >>confdefs.h
6ec2e0f5
SDJ
16050
16051fi
6ec2e0f5 16052
c0c3707f
CB
16053{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
16054$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
16055if ${ac_cv_header_stdbool_h+:} false; then :
16056 $as_echo_n "(cached) " >&6
16057else
16058 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16059/* end confdefs.h. */
16060
16061 #include <stdbool.h>
16062
16063 #ifdef __cplusplus
16064 typedef bool Bool;
16065 #else
16066 typedef _Bool Bool;
16067 #ifndef bool
16068 "error: bool is not defined"
16069 #endif
16070 #ifndef false
16071 "error: false is not defined"
16072 #endif
16073 #if false
16074 "error: false is not 0"
16075 #endif
16076 #ifndef true
16077 "error: true is not defined"
16078 #endif
16079 #if true != 1
16080 "error: true is not 1"
16081 #endif
16082 #endif
16083
16084 #ifndef __bool_true_false_are_defined
16085 "error: __bool_true_false_are_defined is not defined"
16086 #endif
16087
16088 struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
16089
16090 char a[true == 1 ? 1 : -1];
16091 char b[false == 0 ? 1 : -1];
16092 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
16093 char d[(bool) 0.5 == true ? 1 : -1];
16094 /* See body of main program for 'e'. */
16095 char f[(Bool) 0.0 == false ? 1 : -1];
16096 char g[true];
16097 char h[sizeof (Bool)];
16098 char i[sizeof s.t];
16099 enum { j = false, k = true, l = false * true, m = true * 256 };
16100 /* The following fails for
16101 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
16102 Bool n[m];
16103 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
16104 char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
16105 /* Catch a bug in an HP-UX C compiler. See
16106 https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
16107 https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
16108 */
16109 Bool q = true;
16110 Bool *pq = &q;
16111 bool *qq = &q;
6ec2e0f5 16112
c0c3707f
CB
16113int
16114main ()
16115{
6ec2e0f5 16116
c0c3707f
CB
16117 bool e = &s;
16118 *pq |= q; *pq |= ! q;
16119 *qq |= q; *qq |= ! q;
16120 /* Refer to every declared value, to avoid compiler optimizations. */
16121 return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
16122 + !m + !n + !o + !p + !q + !pq + !qq);
6ec2e0f5 16123
c0c3707f
CB
16124 ;
16125 return 0;
16126}
16127_ACEOF
16128if ac_fn_c_try_compile "$LINENO"; then :
16129 ac_cv_header_stdbool_h=yes
16130else
16131 ac_cv_header_stdbool_h=no
16132fi
16133rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16134fi
16135{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
16136$as_echo "$ac_cv_header_stdbool_h" >&6; }
16137 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
16138if test "x$ac_cv_type__Bool" = xyes; then :
6ec2e0f5 16139
c0c3707f
CB
16140cat >>confdefs.h <<_ACEOF
16141#define HAVE__BOOL 1
16142_ACEOF
6ec2e0f5
SDJ
16143
16144
c0c3707f 16145fi
6ec2e0f5
SDJ
16146
16147
472fa5ee 16148
f8e27d88 16149
c0c3707f
CB
16150ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
16151if test "x$ac_cv_have_decl_strdup" = xyes; then :
6ec2e0f5
SDJ
16152 ac_have_decl=1
16153else
16154 ac_have_decl=0
16155fi
16156
16157cat >>confdefs.h <<_ACEOF
c0c3707f 16158#define HAVE_DECL_STRDUP $ac_have_decl
6ec2e0f5
SDJ
16159_ACEOF
16160
16161
c0c3707f
CB
16162 REPLACE_STRERROR_0=0
16163 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
16164$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
16165if ${gl_cv_func_strerror_0_works+:} false; then :
6ec2e0f5
SDJ
16166 $as_echo_n "(cached) " >&6
16167else
c0c3707f
CB
16168 if test "$cross_compiling" = yes; then :
16169 case "$host_os" in
16170 # Guess yes on glibc systems.
16171 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
16172 # Guess yes on musl systems.
16173 *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
16174 # Guess yes on native Windows.
16175 mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
16176 # If we don't know, obey --enable-cross-guesses.
16177 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
16178 esac
6ec2e0f5 16179
5e8754f9
SDJ
16180else
16181 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16182/* end confdefs.h. */
c0c3707f
CB
16183#include <string.h>
16184 #include <errno.h>
6ec2e0f5 16185
5e8754f9
SDJ
16186int
16187main ()
16188{
c0c3707f
CB
16189int result = 0;
16190 char *str;
16191 errno = 0;
16192 str = strerror (0);
16193 if (!*str) result |= 1;
16194 if (errno) result |= 2;
16195 if (strstr (str, "nknown") || strstr (str, "ndefined"))
16196 result |= 4;
16197 return result;
5e8754f9
SDJ
16198 ;
16199 return 0;
16200}
16201_ACEOF
c0c3707f
CB
16202if ac_fn_c_try_run "$LINENO"; then :
16203 gl_cv_func_strerror_0_works=yes
5e8754f9 16204else
c0c3707f 16205 gl_cv_func_strerror_0_works=no
5e8754f9 16206fi
c0c3707f
CB
16207rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16208 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 16209fi
6ec2e0f5 16210
6ec2e0f5 16211
c0c3707f
CB
16212fi
16213{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
16214$as_echo "$gl_cv_func_strerror_0_works" >&6; }
16215 case "$gl_cv_func_strerror_0_works" in
16216 *yes) ;;
16217 *)
16218 REPLACE_STRERROR_0=1
6ec2e0f5 16219
c0c3707f 16220$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
6ec2e0f5 16221
c0c3707f
CB
16222 ;;
16223 esac
6ec2e0f5
SDJ
16224
16225
16226
16227
472fa5ee
SM
16228
16229
16230
725e2999 16231
725e2999
JB
16232
16233
c0c3707f
CB
16234 if test $ac_cv_func_strerror_r = yes; then
16235 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
16236 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
16237$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
16238if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
16239 $as_echo_n "(cached) " >&6
16240else
16241 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16242/* end confdefs.h. */
16243#include <string.h>
16244 int strerror_r (int, char *, size_t);
725e2999 16245
c0c3707f
CB
16246int
16247main ()
16248{
725e2999 16249
c0c3707f
CB
16250 ;
16251 return 0;
16252}
16253_ACEOF
16254if ac_fn_c_try_compile "$LINENO"; then :
16255 gl_cv_func_strerror_r_posix_signature=yes
16256else
16257 gl_cv_func_strerror_r_posix_signature=no
16258fi
16259rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
725e2999 16260
c0c3707f
CB
16261fi
16262{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
16263$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
16264 if test $gl_cv_func_strerror_r_posix_signature = yes; then
16265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
16266$as_echo_n "checking whether strerror_r works... " >&6; }
16267if ${gl_cv_func_strerror_r_works+:} false; then :
16268 $as_echo_n "(cached) " >&6
16269else
16270 if test "$cross_compiling" = yes; then :
725e2999 16271
c0c3707f
CB
16272 case "$host_os" in
16273 # Guess no on AIX.
16274 aix*) gl_cv_func_strerror_r_works="guessing no";;
16275 # Guess no on HP-UX.
16276 hpux*) gl_cv_func_strerror_r_works="guessing no";;
16277 # Guess no on BSD variants.
16278 *bsd*) gl_cv_func_strerror_r_works="guessing no";;
16279 # Guess yes otherwise.
16280 *) gl_cv_func_strerror_r_works="guessing yes";;
16281 esac
725e2999 16282
c0c3707f
CB
16283else
16284 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16285/* end confdefs.h. */
16286#include <errno.h>
16287 #include <string.h>
725e2999 16288
c0c3707f
CB
16289int
16290main ()
16291{
16292int result = 0;
16293 char buf[79];
16294 if (strerror_r (EACCES, buf, 0) < 0)
16295 result |= 1;
16296 errno = 0;
16297 if (strerror_r (EACCES, buf, sizeof buf) != 0)
16298 result |= 2;
16299 strcpy (buf, "Unknown");
16300 if (strerror_r (0, buf, sizeof buf) != 0)
16301 result |= 4;
16302 if (errno)
16303 result |= 8;
16304 if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
16305 result |= 0x10;
16306 errno = 0;
16307 *buf = 0;
16308 if (strerror_r (-3, buf, sizeof buf) < 0)
16309 result |= 0x20;
16310 if (errno)
16311 result |= 0x40;
16312 if (!*buf)
16313 result |= 0x80;
16314 return result;
725e2999 16315
c0c3707f
CB
16316 ;
16317 return 0;
16318}
16319_ACEOF
16320if ac_fn_c_try_run "$LINENO"; then :
16321 gl_cv_func_strerror_r_works=yes
16322else
16323 gl_cv_func_strerror_r_works=no
16324fi
16325rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16326 conftest.$ac_objext conftest.beam conftest.$ac_ext
16327fi
725e2999
JB
16328
16329
c0c3707f
CB
16330fi
16331{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16332$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16333 else
725e2999 16334
c0c3707f
CB
16335 if test $ac_cv_func___xpg_strerror_r = yes; then
16336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
16337$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
16338if ${gl_cv_func_strerror_r_works+:} false; then :
725e2999
JB
16339 $as_echo_n "(cached) " >&6
16340else
c0c3707f
CB
16341 if test "$cross_compiling" = yes; then :
16342 gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
725e2999 16343
c0c3707f
CB
16344else
16345 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
725e2999 16346/* end confdefs.h. */
c0c3707f
CB
16347#include <errno.h>
16348 #include <string.h>
16349 extern
16350 #ifdef __cplusplus
16351 "C"
16352 #endif
16353 int __xpg_strerror_r(int, char *, size_t);
725e2999 16354
c0c3707f
CB
16355int
16356main ()
16357{
16358int result = 0;
16359 char buf[256] = "^";
16360 char copy[256];
16361 char *str = strerror (-1);
16362 strcpy (copy, str);
16363 if (__xpg_strerror_r (-2, buf, 1) == 0)
16364 result |= 1;
16365 if (*buf)
16366 result |= 2;
16367 __xpg_strerror_r (-2, buf, 256);
16368 if (strcmp (str, copy))
16369 result |= 4;
16370 return result;
725e2999 16371
c0c3707f
CB
16372 ;
16373 return 0;
16374}
725e2999 16375_ACEOF
c0c3707f
CB
16376if ac_fn_c_try_run "$LINENO"; then :
16377 gl_cv_func_strerror_r_works=yes
725e2999 16378else
c0c3707f 16379 gl_cv_func_strerror_r_works=no
725e2999 16380fi
c0c3707f
CB
16381rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16382 conftest.$ac_objext conftest.beam conftest.$ac_ext
725e2999 16383fi
725e2999 16384
725e2999 16385
c0c3707f
CB
16386fi
16387{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16388$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16389 fi
16390 fi
725e2999 16391 fi
725e2999
JB
16392 fi
16393
c0c3707f
CB
16394ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
16395if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
16396 ac_have_decl=1
725e2999 16397else
c0c3707f 16398 ac_have_decl=0
725e2999
JB
16399fi
16400
c0c3707f
CB
16401cat >>confdefs.h <<_ACEOF
16402#define HAVE_DECL_STRERROR_R $ac_have_decl
16403_ACEOF
725e2999
JB
16404
16405
16406
16407
16408
725e2999
JB
16409
16410
16411
725e2999
JB
16412
16413
16414
16415
16416
16417
16418
725e2999 16419 if test $gl_cv_have_include_next = yes; then
c0c3707f 16420 gl_cv_next_string_h='<'string.h'>'
725e2999 16421 else
c0c3707f
CB
16422 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
16423$as_echo_n "checking absolute name of <string.h>... " >&6; }
16424if ${gl_cv_next_string_h+:} false; then :
725e2999
JB
16425 $as_echo_n "(cached) " >&6
16426else
16427
725e2999
JB
16428
16429
16430 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16431/* end confdefs.h. */
c0c3707f 16432#include <string.h>
725e2999
JB
16433_ACEOF
16434 case "$host_os" in
16435 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16436 *) gl_absname_cpp="$ac_cpp" ;;
16437 esac
16438
16439 case "$host_os" in
16440 mingw*)
16441 gl_dirsep_regex='[/\\]'
16442 ;;
16443 *)
16444 gl_dirsep_regex='\/'
16445 ;;
16446 esac
16447 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 16448 gl_header_literal_regex=`echo 'string.h' \
725e2999
JB
16449 | sed -e "$gl_make_literal_regex_sed"`
16450 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16451 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16452 s|^/[^/]|//&|
16453 p
16454 q
16455 }'
6ec2e0f5 16456
c0c3707f 16457 gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
725e2999 16458 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16459
c0c3707f
CB
16460 gl_header=$gl_cv_absolute_string_h
16461 gl_cv_next_string_h='"'$gl_header'"'
6ec2e0f5
SDJ
16462
16463
725e2999 16464fi
c0c3707f
CB
16465{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
16466$as_echo "$gl_cv_next_string_h" >&6; }
725e2999 16467 fi
c0c3707f 16468 NEXT_STRING_H=$gl_cv_next_string_h
6ec2e0f5 16469
725e2999
JB
16470 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16471 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 16472 gl_next_as_first_directive='<'string.h'>'
725e2999
JB
16473 else
16474 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 16475 gl_next_as_first_directive=$gl_cv_next_string_h
725e2999 16476 fi
c0c3707f
CB
16477 NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
16478
16479
16480
6ec2e0f5
SDJ
16481
16482
16483
16484
16485
6ec2e0f5
SDJ
16486
16487
6ec2e0f5 16488
698be2d8
CB
16489ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
16490if test "x$ac_cv_have_decl_strnlen" = xyes; then :
16491 ac_have_decl=1
16492else
16493 ac_have_decl=0
16494fi
16495
16496cat >>confdefs.h <<_ACEOF
16497#define HAVE_DECL_STRNLEN $ac_have_decl
16498_ACEOF
16499
16500
16501
c0c3707f
CB
16502
16503 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
16504 REPLACE_STRSTR=1
16505 else
16506 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
16507$as_echo_n "checking whether strstr works... " >&6; }
16508if ${gl_cv_func_strstr_works_always+:} false; then :
6ec2e0f5
SDJ
16509 $as_echo_n "(cached) " >&6
16510else
c0c3707f
CB
16511 if test "$cross_compiling" = yes; then :
16512 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
16513/* end confdefs.h. */
16514
c0c3707f
CB
16515#ifdef __GNU_LIBRARY__
16516 #include <features.h>
16517 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
16518 || defined __UCLIBC__
16519 Lucky user
16520 #endif
16521#elif defined __CYGWIN__
16522 #include <cygwin/version.h>
16523 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
16524 Lucky user
16525 #endif
16526#else
16527 Lucky user
6ec2e0f5 16528#endif
c0c3707f
CB
16529
16530_ACEOF
16531if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16532 $EGREP "Lucky user" >/dev/null 2>&1; then :
16533 gl_cv_func_strstr_works_always="guessing yes"
16534else
16535 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
16536fi
16537rm -f conftest*
16538
16539
16540else
16541 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16542/* end confdefs.h. */
16543
16544#include <string.h> /* for strstr */
16545#ifdef __GNU_LIBRARY__
16546 #include <features.h>
16547 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
16548 Unlucky user
16549 #endif
725e2999 16550#endif
c0c3707f
CB
16551#define P "_EF_BF_BD"
16552#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
16553#define NEEDLE P P P P P
6ec2e0f5 16554
725e2999
JB
16555int
16556main ()
16557{
c0c3707f
CB
16558return !!strstr (HAYSTACK, NEEDLE);
16559
725e2999
JB
16560 ;
16561 return 0;
16562}
6ec2e0f5 16563_ACEOF
c0c3707f
CB
16564if ac_fn_c_try_run "$LINENO"; then :
16565 gl_cv_func_strstr_works_always=yes
6ec2e0f5 16566else
c0c3707f 16567 gl_cv_func_strstr_works_always=no
6ec2e0f5 16568fi
c0c3707f
CB
16569rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16570 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 16571fi
6ec2e0f5
SDJ
16572
16573
c0c3707f
CB
16574fi
16575{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
16576$as_echo "$gl_cv_func_strstr_works_always" >&6; }
16577 case "$gl_cv_func_strstr_works_always" in
16578 *yes) ;;
16579 *)
16580 REPLACE_STRSTR=1
16581 ;;
16582 esac
16583 fi
6ec2e0f5 16584
c0c3707f
CB
16585ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default"
16586if test "x$ac_cv_have_decl_strtok_r" = xyes; then :
16587 ac_have_decl=1
16588else
16589 ac_have_decl=0
16590fi
6ec2e0f5 16591
c0c3707f
CB
16592cat >>confdefs.h <<_ACEOF
16593#define HAVE_DECL_STRTOK_R $ac_have_decl
16594_ACEOF
6ec2e0f5
SDJ
16595
16596
16597
16598
6ec2e0f5
SDJ
16599
16600
16601
16602
16603
16604
16605
698be2d8
CB
16606
16607
c0c3707f 16608$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
6ec2e0f5 16609
6ec2e0f5
SDJ
16610
16611
16612
16613
16614
6ec2e0f5
SDJ
16615
16616
16617
16618
16619
c0c3707f
CB
16620 if test $gl_cv_have_include_next = yes; then
16621 gl_cv_next_sys_types_h='<'sys/types.h'>'
16622 else
16623 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
16624$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
16625if ${gl_cv_next_sys_types_h+:} false; then :
6ec2e0f5
SDJ
16626 $as_echo_n "(cached) " >&6
16627else
6ec2e0f5 16628
6ec2e0f5 16629
c0c3707f
CB
16630
16631 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16632/* end confdefs.h. */
16633#include <sys/types.h>
6ec2e0f5 16634_ACEOF
c0c3707f
CB
16635 case "$host_os" in
16636 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16637 *) gl_absname_cpp="$ac_cpp" ;;
16638 esac
6ec2e0f5 16639
c0c3707f
CB
16640 case "$host_os" in
16641 mingw*)
16642 gl_dirsep_regex='[/\\]'
16643 ;;
16644 *)
16645 gl_dirsep_regex='\/'
16646 ;;
16647 esac
16648 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16649 gl_header_literal_regex=`echo 'sys/types.h' \
16650 | sed -e "$gl_make_literal_regex_sed"`
16651 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16652 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16653 s|^/[^/]|//&|
16654 p
16655 q
16656 }'
6ec2e0f5 16657
c0c3707f
CB
16658 gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16659 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16660
c0c3707f
CB
16661 gl_header=$gl_cv_absolute_sys_types_h
16662 gl_cv_next_sys_types_h='"'$gl_header'"'
6ec2e0f5
SDJ
16663
16664
c0c3707f
CB
16665fi
16666{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
16667$as_echo "$gl_cv_next_sys_types_h" >&6; }
16668 fi
16669 NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
6ec2e0f5 16670
c0c3707f
CB
16671 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16672 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16673 gl_next_as_first_directive='<'sys/types.h'>'
16674 else
16675 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16676 gl_next_as_first_directive=$gl_cv_next_sys_types_h
16677 fi
16678 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
16679
16680
16681
16682
6ec2e0f5 16683
6ec2e0f5
SDJ
16684
16685
6ec2e0f5
SDJ
16686
16687
16688
16689
16690
c0c3707f 16691 WINDOWS_STAT_INODES=0
6ec2e0f5
SDJ
16692
16693
16694
16695
16696
472fa5ee
SM
16697
16698
16699
16700
c0c3707f
CB
16701 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
16702$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
16703if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
16704 $as_echo_n "(cached) " >&6
16705else
16706 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16707/* end confdefs.h. */
16708#include <time.h>
472fa5ee 16709
c0c3707f
CB
16710int
16711main ()
16712{
16713static struct timespec x; x.tv_sec = x.tv_nsec;
16714 ;
16715 return 0;
16716}
6ec2e0f5 16717_ACEOF
c0c3707f
CB
16718if ac_fn_c_try_compile "$LINENO"; then :
16719 gl_cv_sys_struct_timespec_in_time_h=yes
16720else
16721 gl_cv_sys_struct_timespec_in_time_h=no
6ec2e0f5 16722fi
c0c3707f
CB
16723rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16724fi
16725{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
16726$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
6ec2e0f5 16727
c0c3707f
CB
16728 TIME_H_DEFINES_STRUCT_TIMESPEC=0
16729 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
16730 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
16731 UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
16732 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
16733 TIME_H_DEFINES_STRUCT_TIMESPEC=1
6ec2e0f5 16734 else
c0c3707f
CB
16735 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
16736$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
16737if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
16738 $as_echo_n "(cached) " >&6
16739else
16740 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16741/* end confdefs.h. */
16742#include <sys/time.h>
472fa5ee 16743
c0c3707f
CB
16744int
16745main ()
16746{
16747static struct timespec x; x.tv_sec = x.tv_nsec;
16748 ;
16749 return 0;
16750}
16751_ACEOF
16752if ac_fn_c_try_compile "$LINENO"; then :
16753 gl_cv_sys_struct_timespec_in_sys_time_h=yes
16754else
16755 gl_cv_sys_struct_timespec_in_sys_time_h=no
16756fi
16757rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16758fi
16759{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
16760$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
16761 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
16762 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
16763 else
16764 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
16765$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
16766if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
16767 $as_echo_n "(cached) " >&6
16768else
16769 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16770/* end confdefs.h. */
16771#include <pthread.h>
472fa5ee 16772
c0c3707f
CB
16773int
16774main ()
16775{
16776static struct timespec x; x.tv_sec = x.tv_nsec;
16777 ;
16778 return 0;
16779}
16780_ACEOF
16781if ac_fn_c_try_compile "$LINENO"; then :
16782 gl_cv_sys_struct_timespec_in_pthread_h=yes
16783else
16784 gl_cv_sys_struct_timespec_in_pthread_h=no
16785fi
16786rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16787fi
16788{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
16789$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
16790 if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
16791 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
16792 else
16793 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
16794$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
16795if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
16796 $as_echo_n "(cached) " >&6
16797else
16798 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16799/* end confdefs.h. */
16800#include <unistd.h>
6ec2e0f5 16801
c0c3707f
CB
16802int
16803main ()
16804{
16805static struct timespec x; x.tv_sec = x.tv_nsec;
16806 ;
16807 return 0;
16808}
16809_ACEOF
16810if ac_fn_c_try_compile "$LINENO"; then :
16811 gl_cv_sys_struct_timespec_in_unistd_h=yes
16812else
16813 gl_cv_sys_struct_timespec_in_unistd_h=no
16814fi
16815rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16816fi
16817{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
16818$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
16819 if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
16820 UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
16821 fi
6ec2e0f5
SDJ
16822 fi
16823 fi
c0c3707f 16824 fi
6ec2e0f5
SDJ
16825
16826
16827
16828
16829
16830
6ec2e0f5 16831
6ec2e0f5
SDJ
16832
16833
16834
16835
16836
6ec2e0f5
SDJ
16837
16838
16839
16840
c0c3707f
CB
16841 if test $gl_cv_have_include_next = yes; then
16842 gl_cv_next_time_h='<'time.h'>'
16843 else
16844 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
16845$as_echo_n "checking absolute name of <time.h>... " >&6; }
16846if ${gl_cv_next_time_h+:} false; then :
16847 $as_echo_n "(cached) " >&6
16848else
6ec2e0f5 16849
6ec2e0f5
SDJ
16850
16851
c0c3707f
CB
16852 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16853/* end confdefs.h. */
16854#include <time.h>
16855_ACEOF
16856 case "$host_os" in
16857 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16858 *) gl_absname_cpp="$ac_cpp" ;;
16859 esac
6ec2e0f5 16860
c0c3707f
CB
16861 case "$host_os" in
16862 mingw*)
16863 gl_dirsep_regex='[/\\]'
16864 ;;
16865 *)
16866 gl_dirsep_regex='\/'
16867 ;;
16868 esac
16869 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16870 gl_header_literal_regex=`echo 'time.h' \
16871 | sed -e "$gl_make_literal_regex_sed"`
16872 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16873 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16874 s|^/[^/]|//&|
16875 p
16876 q
16877 }'
6ec2e0f5 16878
c0c3707f
CB
16879 gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16880 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16881
c0c3707f
CB
16882 gl_header=$gl_cv_absolute_time_h
16883 gl_cv_next_time_h='"'$gl_header'"'
6ec2e0f5 16884
6ec2e0f5
SDJ
16885
16886fi
c0c3707f
CB
16887{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
16888$as_echo "$gl_cv_next_time_h" >&6; }
16889 fi
16890 NEXT_TIME_H=$gl_cv_next_time_h
6ec2e0f5 16891
c0c3707f
CB
16892 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16893 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16894 gl_next_as_first_directive='<'time.h'>'
16895 else
16896 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16897 gl_next_as_first_directive=$gl_cv_next_time_h
16898 fi
16899 NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
6ec2e0f5 16900
472fa5ee
SM
16901
16902
16903
16904
16905
6ec2e0f5 16906
6ec2e0f5 16907
6ec2e0f5 16908
6ec2e0f5 16909
698be2d8
CB
16910
16911
c0c3707f
CB
16912ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
16913if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
16914 ac_have_decl=1
16915else
16916 ac_have_decl=0
16917fi
6ec2e0f5 16918
c0c3707f
CB
16919cat >>confdefs.h <<_ACEOF
16920#define HAVE_DECL_UNSETENV $ac_have_decl
16921_ACEOF
6ec2e0f5
SDJ
16922
16923
6ec2e0f5
SDJ
16924
16925
16926
c0c3707f
CB
16927 if test $ac_cv_header_crtdefs_h = yes; then
16928 HAVE_CRTDEFS_H=1
16929 else
16930 HAVE_CRTDEFS_H=0
5e8754f9 16931 fi
5e8754f9 16932
5e8754f9 16933
5e8754f9 16934
c0c3707f 16935 GNULIB_ISWBLANK=0;
5df4cba6
SM
16936 GNULIB_ISWDIGIT=0;
16937 GNULIB_ISWXDIGIT=0;
c0c3707f
CB
16938 GNULIB_WCTYPE=0;
16939 GNULIB_ISWCTYPE=0;
16940 GNULIB_WCTRANS=0;
16941 GNULIB_TOWCTRANS=0;
16942 HAVE_ISWBLANK=1;
16943 HAVE_WCTYPE_T=1;
16944 HAVE_WCTRANS_T=1;
16945 REPLACE_ISWBLANK=0;
5df4cba6
SM
16946 REPLACE_ISWDIGIT=0;
16947 REPLACE_ISWXDIGIT=0;
5e8754f9 16948
5e8754f9 16949
5e8754f9 16950
5e8754f9 16951
698be2d8
CB
16952
16953
16954
16955
c0c3707f
CB
16956 if false; then
16957 GL_COND_LIBTOOL_TRUE=
16958 GL_COND_LIBTOOL_FALSE='#'
16959else
16960 GL_COND_LIBTOOL_TRUE='#'
16961 GL_COND_LIBTOOL_FALSE=
16962fi
5e8754f9 16963
c0c3707f
CB
16964 gl_cond_libtool=false
16965 gl_libdeps=
16966 gl_ltlibdeps=
16967 gl_m4_base='import/m4'
5e8754f9 16968
5e8754f9
SDJ
16969
16970
6ec2e0f5 16971
6ec2e0f5 16972
6ec2e0f5 16973
6ec2e0f5 16974
6ec2e0f5 16975
6ec2e0f5 16976
5df4cba6 16977
c0c3707f
CB
16978 gl_source_base='import'
16979
6ec2e0f5 16980
c0c3707f
CB
16981 if test $ac_cv_func_alloca_works = no; then
16982 :
16983 fi
6ec2e0f5 16984
c0c3707f
CB
16985 # Define an additional variable used in the Makefile substitution.
16986 if test $ac_cv_working_alloca_h = yes; then
16987 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
16988$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
16989if ${gl_cv_rpl_alloca+:} false; then :
6ec2e0f5
SDJ
16990 $as_echo_n "(cached) " >&6
16991else
c0c3707f
CB
16992
16993 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
16994/* end confdefs.h. */
16995
c0c3707f
CB
16996#if defined __GNUC__ || defined _AIX || defined _MSC_VER
16997 Need own alloca
16998#endif
6ec2e0f5 16999
6ec2e0f5 17000_ACEOF
c0c3707f
CB
17001if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17002 $EGREP "Need own alloca" >/dev/null 2>&1; then :
17003 gl_cv_rpl_alloca=yes
6ec2e0f5 17004else
c0c3707f 17005 gl_cv_rpl_alloca=no
6ec2e0f5 17006fi
c0c3707f 17007rm -f conftest*
6ec2e0f5
SDJ
17008
17009
17010fi
c0c3707f
CB
17011{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
17012$as_echo "$gl_cv_rpl_alloca" >&6; }
17013 if test $gl_cv_rpl_alloca = yes; then
6ec2e0f5 17014
c0c3707f 17015$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
6ec2e0f5 17016
c0c3707f
CB
17017 ALLOCA_H=alloca.h
17018 else
17019 ALLOCA_H=
17020 fi
17021 else
17022 ALLOCA_H=alloca.h
17023 fi
6ec2e0f5 17024
c0c3707f
CB
17025 if test -n "$ALLOCA_H"; then
17026 GL_GENERATE_ALLOCA_H_TRUE=
17027 GL_GENERATE_ALLOCA_H_FALSE='#'
17028else
17029 GL_GENERATE_ALLOCA_H_TRUE='#'
17030 GL_GENERATE_ALLOCA_H_FALSE=
17031fi
6ec2e0f5
SDJ
17032
17033
c0c3707f
CB
17034 if test $ac_cv_working_alloca_h = yes; then
17035 HAVE_ALLOCA_H=1
17036 else
17037 HAVE_ALLOCA_H=0
17038 fi
6ec2e0f5
SDJ
17039
17040
17041
17042
17043
17044
c0c3707f
CB
17045 if test $ac_cv_header_arpa_inet_h = yes; then
17046 HAVE_ARPA_INET_H=1
17047 else
17048 HAVE_ARPA_INET_H=0
17049 fi
6ec2e0f5
SDJ
17050
17051
472fa5ee
SM
17052
17053
17054
17055
17056
6ec2e0f5
SDJ
17057
17058
17059
17060 if test $gl_cv_have_include_next = yes; then
c0c3707f 17061 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5 17062 else
c0c3707f
CB
17063 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
17064$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
17065if ${gl_cv_next_arpa_inet_h+:} false; then :
6ec2e0f5
SDJ
17066 $as_echo_n "(cached) " >&6
17067else
17068
c0c3707f 17069 if test $ac_cv_header_arpa_inet_h = yes; then
6ec2e0f5
SDJ
17070
17071
17072
17073
17074 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17075/* end confdefs.h. */
c0c3707f 17076#include <arpa/inet.h>
6ec2e0f5
SDJ
17077_ACEOF
17078 case "$host_os" in
17079 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17080 *) gl_absname_cpp="$ac_cpp" ;;
17081 esac
17082
17083 case "$host_os" in
17084 mingw*)
17085 gl_dirsep_regex='[/\\]'
17086 ;;
17087 *)
17088 gl_dirsep_regex='\/'
17089 ;;
17090 esac
17091 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 17092 gl_header_literal_regex=`echo 'arpa/inet.h' \
6ec2e0f5
SDJ
17093 | sed -e "$gl_make_literal_regex_sed"`
17094 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17095 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17096 s|^/[^/]|//&|
17097 p
17098 q
17099 }'
17100
c0c3707f 17101 gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5
SDJ
17102 sed -n "$gl_absolute_header_sed"`
17103
c0c3707f
CB
17104 gl_header=$gl_cv_absolute_arpa_inet_h
17105 gl_cv_next_arpa_inet_h='"'$gl_header'"'
6ec2e0f5 17106 else
c0c3707f 17107 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5
SDJ
17108 fi
17109
c0c3707f 17110
6ec2e0f5 17111fi
c0c3707f
CB
17112{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
17113$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
17114 fi
17115 NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
6ec2e0f5 17116
c0c3707f
CB
17117 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17118 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17119 gl_next_as_first_directive='<'arpa/inet.h'>'
17120 else
17121 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17122 gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
17123 fi
17124 NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
17125
17126
6ec2e0f5 17127
6ec2e0f5 17128
6ec2e0f5
SDJ
17129
17130
6ec2e0f5
SDJ
17131
17132
17133
c0c3707f
CB
17134 if test $ac_cv_header_sys_socket_h = yes; then
17135 HAVE_WS2TCPIP_H=0
17136 else
17137 if test $ac_cv_header_ws2tcpip_h = yes; then
17138 HAVE_WS2TCPIP_H=1
17139 else
17140 HAVE_WS2TCPIP_H=0
17141 fi
17142 fi
17143
17144
6ec2e0f5
SDJ
17145
17146
6ec2e0f5
SDJ
17147
17148
17149
17150
17151
698be2d8
CB
17152
17153
17154
17155
17156
17157
17158 if test $ac_cv_func_btowc = no; then
17159 HAVE_BTOWC=0
17160 else
17161
17162
17163
17164
17165 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
17166$as_echo_n "checking whether btowc(0) is correct... " >&6; }
17167if ${gl_cv_func_btowc_nul+:} false; then :
17168 $as_echo_n "(cached) " >&6
17169else
17170
17171 if test "$cross_compiling" = yes; then :
17172
17173 case "$host_os" in
17174 # Guess no on Cygwin.
17175 cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
17176 # Guess yes on native Windows.
17177 mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
17178 # Guess yes otherwise.
17179 *) gl_cv_func_btowc_nul="guessing yes" ;;
17180 esac
17181
17182else
17183 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17184/* end confdefs.h. */
17185
17186#include <string.h>
17187/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
17188 <wchar.h>.
17189 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17190 included before <wchar.h>. */
17191#include <stddef.h>
17192#include <stdio.h>
17193#include <time.h>
17194#include <wchar.h>
17195int main ()
17196{
17197 if (btowc ('\0') != 0)
17198 return 1;
17199 return 0;
17200}
17201_ACEOF
17202if ac_fn_c_try_run "$LINENO"; then :
17203 gl_cv_func_btowc_nul=yes
17204else
17205 gl_cv_func_btowc_nul=no
17206fi
17207rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17208 conftest.$ac_objext conftest.beam conftest.$ac_ext
17209fi
17210
17211
17212fi
17213{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
17214$as_echo "$gl_cv_func_btowc_nul" >&6; }
17215
17216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
17217$as_echo_n "checking whether btowc(EOF) is correct... " >&6; }
17218if ${gl_cv_func_btowc_eof+:} false; then :
17219 $as_echo_n "(cached) " >&6
17220else
17221
17222 case "$host_os" in
17223 # Guess no on IRIX.
17224 irix*) gl_cv_func_btowc_eof="guessing no" ;;
17225 # Guess yes on native Windows.
17226 mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
17227 # Guess yes otherwise.
17228 *) gl_cv_func_btowc_eof="guessing yes" ;;
17229 esac
17230 if test $LOCALE_FR != none; then
17231 if test "$cross_compiling" = yes; then :
17232 :
17233else
17234 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17235/* end confdefs.h. */
17236
17237#include <locale.h>
17238#include <string.h>
17239/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
17240 <wchar.h>.
17241 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17242 included before <wchar.h>. */
17243#include <stddef.h>
17244#include <stdio.h>
17245#include <time.h>
17246#include <wchar.h>
17247int main ()
17248{
17249 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
17250 {
17251 if (btowc (EOF) != WEOF)
17252 return 1;
17253 }
17254 return 0;
17255}
17256_ACEOF
17257if ac_fn_c_try_run "$LINENO"; then :
17258 gl_cv_func_btowc_eof=yes
17259else
17260 gl_cv_func_btowc_eof=no
17261fi
17262rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17263 conftest.$ac_objext conftest.beam conftest.$ac_ext
17264fi
17265
17266 fi
17267
17268fi
17269{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
17270$as_echo "$gl_cv_func_btowc_eof" >&6; }
17271
17272 case "$gl_cv_func_btowc_nul" in
17273 *yes) ;;
17274 *) REPLACE_BTOWC=1 ;;
17275 esac
17276 case "$gl_cv_func_btowc_eof" in
17277 *yes) ;;
17278 *) REPLACE_BTOWC=1 ;;
17279 esac
17280 fi
17281
17282 if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
17283
17284
17285
17286
17287
17288
17289
17290
17291 gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext"
17292
17293
17294 :
17295
17296 fi
17297
17298
17299
17300
17301
17302 GNULIB_BTOWC=1
17303
17304
17305
17306
17307
17308$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
17309
17310
17311
17312
c0c3707f
CB
17313 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
17314$as_echo_n "checking for __builtin_expect... " >&6; }
17315if ${gl_cv___builtin_expect+:} false; then :
6ec2e0f5
SDJ
17316 $as_echo_n "(cached) " >&6
17317else
c0c3707f
CB
17318 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17319/* end confdefs.h. */
17320
17321 int
17322 main (int argc, char **argv)
17323 {
17324 argc = __builtin_expect (argc, 100);
17325 return argv[argc != 100][0];
17326 }
17327_ACEOF
17328if ac_fn_c_try_link "$LINENO"; then :
17329 gl_cv___builtin_expect=yes
17330else
17331 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17332/* end confdefs.h. */
17333
17334 #include <builtins.h>
17335 int
17336 main (int argc, char **argv)
17337 {
17338 argc = __builtin_expect (argc, 100);
17339 return argv[argc != 100][0];
17340 }
17341_ACEOF
17342if ac_fn_c_try_link "$LINENO"; then :
17343 gl_cv___builtin_expect="in <builtins.h>"
17344else
17345 gl_cv___builtin_expect=no
6ec2e0f5 17346fi
c0c3707f
CB
17347rm -f core conftest.err conftest.$ac_objext \
17348 conftest$ac_exeext conftest.$ac_ext
17349fi
17350rm -f core conftest.err conftest.$ac_objext \
17351 conftest$ac_exeext conftest.$ac_ext
17352fi
17353{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
17354$as_echo "$gl_cv___builtin_expect" >&6; }
17355 if test "$gl_cv___builtin_expect" = yes; then
17356 $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
8690e634 17357
c0c3707f
CB
17358 elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
17359 $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
8690e634 17360
6ec2e0f5 17361 fi
8690e634
JK
17362
17363
17364
17365
c0c3707f
CB
17366
17367 if test $ac_cv_func_canonicalize_file_name = no; then
17368 HAVE_CANONICALIZE_FILE_NAME=0
17369 if test $ac_cv_func_realpath = no; then
17370 HAVE_REALPATH=0
17371 else
17372 case "$gl_cv_func_realpath_works" in
17373 *yes) ;;
17374 *) REPLACE_REALPATH=1 ;;
17375 esac
17376 fi
17377 else
17378 case "$gl_cv_func_realpath_works" in
17379 *yes)
17380 ;;
17381 *)
17382 REPLACE_CANONICALIZE_FILE_NAME=1
17383 REPLACE_REALPATH=1
17384 ;;
17385 esac
5e8754f9 17386 fi
8690e634 17387
c0c3707f 17388 if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
8690e634
JK
17389
17390
17391
472fa5ee
SM
17392
17393
17394
17395
17396
c0c3707f
CB
17397 gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
17398
6ec2e0f5 17399 fi
8690e634
JK
17400
17401
c0c3707f
CB
17402cat >>confdefs.h <<_ACEOF
17403#define GNULIB_CANONICALIZE_LGPL 1
17404_ACEOF
8690e634 17405
8690e634 17406
8690e634 17407
8690e634 17408
8690e634 17409
8690e634 17410
8690e634 17411
c0c3707f 17412 GNULIB_CANONICALIZE_FILE_NAME=1
8690e634 17413
8690e634 17414
8690e634 17415
6ec2e0f5
SDJ
17416
17417
c0c3707f 17418$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
6ec2e0f5 17419
6ec2e0f5 17420
8690e634
JK
17421
17422
8690e634
JK
17423
17424
17425
17426
c0c3707f 17427 GNULIB_REALPATH=1
6ec2e0f5
SDJ
17428
17429
17430
17431
6ec2e0f5 17432
c0c3707f 17433$as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
6ec2e0f5
SDJ
17434
17435
17436
17437
17438
17439
17440
6ec2e0f5 17441
c0c3707f 17442 GNULIB_CHDIR=1
6ec2e0f5 17443
8690e634 17444
8690e634 17445
6ec2e0f5 17446
6ec2e0f5 17447
c0c3707f
CB
17448$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
17449
17450
17451
17452
17453
17454 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5
17455$as_echo_n "checking whether this system has an arbitrary file name length limit... " >&6; }
17456if ${gl_cv_have_arbitrary_file_name_length_limit+:} false; then :
17457 $as_echo_n "(cached) " >&6
8690e634 17458else
c0c3707f
CB
17459 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17460/* end confdefs.h. */
8690e634 17461
c0c3707f
CB
17462/* Arrange to define PATH_MAX, like "pathmax.h" does. */
17463#if HAVE_UNISTD_H
17464# include <unistd.h>
17465#endif
17466#include <limits.h>
17467#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
17468# include <sys/param.h>
17469#endif
17470#if !defined PATH_MAX && defined MAXPATHLEN
17471# define PATH_MAX MAXPATHLEN
17472#endif
17473#ifdef __hpux
17474# undef PATH_MAX
17475# define PATH_MAX 1024
17476#endif
17477#if defined _WIN32 && ! defined __CYGWIN__
17478# undef PATH_MAX
17479# define PATH_MAX 260
17480#endif
6ec2e0f5 17481
c0c3707f
CB
17482#ifdef PATH_MAX
17483have_arbitrary_file_name_length_limit
17484#endif
6ec2e0f5 17485_ACEOF
c0c3707f
CB
17486if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17487 $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then :
17488 gl_cv_have_arbitrary_file_name_length_limit=yes
17489else
17490 gl_cv_have_arbitrary_file_name_length_limit=no
17491fi
17492rm -f conftest*
6ec2e0f5
SDJ
17493
17494fi
c0c3707f
CB
17495{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5
17496$as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; }
6ec2e0f5 17497
c0c3707f 17498 if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
6ec2e0f5
SDJ
17499
17500
17501
17502
472fa5ee
SM
17503
17504
17505
17506
c0c3707f 17507 gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext"
472fa5ee 17508
c0c3707f 17509 :
8690e634
JK
17510 fi
17511
8690e634 17512
c0c3707f 17513$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
8690e634
JK
17514
17515
17516
17517
17518
8690e634 17519
c0c3707f
CB
17520 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
17521 REPLACE_CLOSE=1
17522 fi
8690e634 17523
6ec2e0f5
SDJ
17524
17525
6ec2e0f5
SDJ
17526
17527
8690e634 17528
c0c3707f
CB
17529 if test $ac_cv_header_sys_socket_h != yes; then
17530 for ac_header in winsock2.h
17531do :
17532 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
17533if test "x$ac_cv_header_winsock2_h" = xyes; then :
17534 cat >>confdefs.h <<_ACEOF
17535#define HAVE_WINSOCK2_H 1
17536_ACEOF
8690e634 17537
c0c3707f 17538fi
8690e634 17539
c0c3707f 17540done
8690e634 17541
c0c3707f
CB
17542 fi
17543 if test "$ac_cv_header_winsock2_h" = yes; then
17544 HAVE_WINSOCK2_H=1
17545 UNISTD_H_HAVE_WINSOCK2_H=1
17546 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
17547 else
17548 HAVE_WINSOCK2_H=0
17549 fi
8690e634 17550
6ec2e0f5 17551
c0c3707f
CB
17552 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
17553 REPLACE_CLOSE=1
17554 fi
6ec2e0f5
SDJ
17555
17556
c0c3707f 17557 if test $REPLACE_CLOSE = 0; then
6ec2e0f5
SDJ
17558
17559
6ec2e0f5 17560
c0c3707f
CB
17561 if test $ac_cv_func_fchdir = no; then
17562 HAVE_FCHDIR=0
17563 fi
6ec2e0f5 17564
c0c3707f
CB
17565 if test $HAVE_FCHDIR = 0; then
17566 REPLACE_CLOSE=1
17567 fi
17568 fi
6ec2e0f5
SDJ
17569
17570
c0c3707f 17571 if test $REPLACE_CLOSE = 1; then
6ec2e0f5
SDJ
17572
17573
17574
17575
17576
6ec2e0f5
SDJ
17577
17578
17579
c0c3707f 17580 gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
6ec2e0f5 17581
c0c3707f 17582 fi
6ec2e0f5 17583
6ec2e0f5
SDJ
17584
17585
17586
17587
c0c3707f 17588 GNULIB_CLOSE=1
6ec2e0f5 17589
6ec2e0f5 17590
6ec2e0f5
SDJ
17591
17592
17593
c0c3707f 17594$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
6ec2e0f5
SDJ
17595
17596
17597
17598
17599
c0c3707f
CB
17600
17601 for ac_func in closedir
17602do :
17603 ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
17604if test "x$ac_cv_func_closedir" = xyes; then :
17605 cat >>confdefs.h <<_ACEOF
17606#define HAVE_CLOSEDIR 1
17607_ACEOF
17608
17609fi
17610done
17611
17612 if test $ac_cv_func_closedir = no; then
17613 HAVE_CLOSEDIR=0
17614 fi
6ec2e0f5 17615
8690e634
JK
17616
17617
8690e634 17618
c0c3707f
CB
17619 if test $ac_cv_func_fchdir = no; then
17620 HAVE_FCHDIR=0
6ec2e0f5 17621 fi
6a29c58e 17622
c0c3707f
CB
17623 if test $HAVE_FCHDIR = 0; then
17624 if test $HAVE_CLOSEDIR = 1; then
17625 REPLACE_CLOSEDIR=1
17626 fi
17627 fi
6a29c58e 17628
c0c3707f
CB
17629 case $host_os,$HAVE_CLOSEDIR in
17630 os2*,1)
17631 REPLACE_CLOSEDIR=1;;
17632 esac
d0ac1c44 17633
c0c3707f 17634 if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
d0ac1c44
SM
17635
17636
d0ac1c44
SM
17637
17638
6a29c58e
YQ
17639
17640
3d99e817 17641
6ec2e0f5 17642
c0c3707f 17643 gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
6ec2e0f5 17644
6ec2e0f5
SDJ
17645 fi
17646
17647
6ec2e0f5
SDJ
17648
17649
3d99e817 17650
c0c3707f 17651 GNULIB_CLOSEDIR=1
3d99e817
AK
17652
17653
17654
17655
17656
c0c3707f 17657$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
3d99e817
AK
17658
17659
17660
698be2d8
CB
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672 if test $gl_cv_have_include_next = yes; then
17673 gl_cv_next_ctype_h='<'ctype.h'>'
17674 else
17675 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5
17676$as_echo_n "checking absolute name of <ctype.h>... " >&6; }
17677if ${gl_cv_next_ctype_h+:} false; then :
17678 $as_echo_n "(cached) " >&6
17679else
17680
17681
17682
17683 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17684/* end confdefs.h. */
17685#include <ctype.h>
17686_ACEOF
17687 case "$host_os" in
17688 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17689 *) gl_absname_cpp="$ac_cpp" ;;
17690 esac
17691
17692 case "$host_os" in
17693 mingw*)
17694 gl_dirsep_regex='[/\\]'
17695 ;;
17696 *)
17697 gl_dirsep_regex='\/'
17698 ;;
17699 esac
17700 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17701 gl_header_literal_regex=`echo 'ctype.h' \
17702 | sed -e "$gl_make_literal_regex_sed"`
17703 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17704 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17705 s|^/[^/]|//&|
17706 p
17707 q
17708 }'
17709
17710 gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17711 sed -n "$gl_absolute_header_sed"`
17712
17713 gl_header=$gl_cv_absolute_ctype_h
17714 gl_cv_next_ctype_h='"'$gl_header'"'
17715
17716
17717fi
17718{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5
17719$as_echo "$gl_cv_next_ctype_h" >&6; }
17720 fi
17721 NEXT_CTYPE_H=$gl_cv_next_ctype_h
17722
17723 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17724 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17725 gl_next_as_first_directive='<'ctype.h'>'
17726 else
17727 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17728 gl_next_as_first_directive=$gl_cv_next_ctype_h
17729 fi
17730 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive
17731
17732
17733
17734
17735
17736
17737
17738
17739
c0c3707f
CB
17740 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
17741$as_echo_n "checking for d_ino member in directory struct... " >&6; }
17742if ${gl_cv_struct_dirent_d_ino+:} false; then :
6ec2e0f5
SDJ
17743 $as_echo_n "(cached) " >&6
17744else
17745 if test "$cross_compiling" = yes; then :
17746 case "$host_os" in
c0c3707f
CB
17747 # Guess yes on glibc systems with Linux kernel.
17748 linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
17749 # Guess yes on musl systems with Linux kernel.
17750 linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
17751 # Guess no on native Windows.
17752 mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
17753 # If we don't know, obey --enable-cross-guesses.
17754 *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
17755 esac
3d99e817 17756
6ec2e0f5
SDJ
17757else
17758 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17759/* end confdefs.h. */
c0c3707f
CB
17760#include <sys/types.h>
17761 #include <sys/stat.h>
17762 #include <dirent.h>
3d99e817 17763
6ec2e0f5
SDJ
17764int
17765main ()
17766{
c0c3707f
CB
17767DIR *dp = opendir (".");
17768 struct dirent *e;
17769 struct stat st;
17770 if (! dp)
17771 return 1;
17772 e = readdir (dp);
17773 if (! e)
17774 { closedir (dp); return 2; }
17775 if (lstat (e->d_name, &st) != 0)
17776 { closedir (dp); return 3; }
17777 if (e->d_ino != st.st_ino)
17778 { closedir (dp); return 4; }
17779 closedir (dp);
17780 return 0;
17781
6ec2e0f5
SDJ
17782 ;
17783 return 0;
17784}
3d99e817 17785_ACEOF
6ec2e0f5 17786if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
17787 gl_cv_struct_dirent_d_ino=yes
17788else
17789 gl_cv_struct_dirent_d_ino=no
17790fi
17791rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17792 conftest.$ac_objext conftest.beam conftest.$ac_ext
17793fi
17794
17795fi
17796{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
17797$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
17798 case "$gl_cv_struct_dirent_d_ino" in
17799 *yes)
17800
17801$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
17802
17803 ;;
17804 esac
17805
17806
17807 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5
17808$as_echo_n "checking for d_type member in directory struct... " >&6; }
17809if ${gl_cv_struct_dirent_d_type+:} false; then :
17810 $as_echo_n "(cached) " >&6
17811else
17812 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17813/* end confdefs.h. */
17814
17815#include <sys/types.h>
17816#include <dirent.h>
17817
17818int
17819main ()
17820{
17821struct dirent dp; dp.d_type = 0;
17822 ;
17823 return 0;
17824}
17825_ACEOF
17826if ac_fn_c_try_link "$LINENO"; then :
17827 gl_cv_struct_dirent_d_type=yes
6ec2e0f5 17828else
c0c3707f 17829 gl_cv_struct_dirent_d_type=no
3d99e817 17830fi
c0c3707f
CB
17831rm -f core conftest.err conftest.$ac_objext \
17832 conftest$ac_exeext conftest.$ac_ext
3d99e817 17833
3d99e817 17834
c0c3707f
CB
17835fi
17836{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5
17837$as_echo "$gl_cv_struct_dirent_d_type" >&6; }
17838 if test $gl_cv_struct_dirent_d_type = yes; then
3d99e817 17839
c0c3707f 17840$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
3d99e817 17841
c0c3707f 17842 fi
3d99e817 17843
0750520d 17844
0750520d 17845
0750520d 17846
0750520d
PA
17847
17848
0750520d 17849
0750520d 17850
0750520d 17851
0750520d 17852
0750520d 17853
0750520d 17854
0750520d 17855
0750520d 17856
c0c3707f
CB
17857 if test $gl_cv_have_include_next = yes; then
17858 gl_cv_next_dirent_h='<'dirent.h'>'
17859 else
17860 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
17861$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
17862if ${gl_cv_next_dirent_h+:} false; then :
17863 $as_echo_n "(cached) " >&6
17864else
0750520d 17865
c0c3707f 17866 if test $ac_cv_header_dirent_h = yes; then
6ec2e0f5 17867
472fa5ee
SM
17868
17869
17870
c0c3707f
CB
17871 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17872/* end confdefs.h. */
17873#include <dirent.h>
17874_ACEOF
17875 case "$host_os" in
17876 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17877 *) gl_absname_cpp="$ac_cpp" ;;
17878 esac
472fa5ee 17879
c0c3707f
CB
17880 case "$host_os" in
17881 mingw*)
17882 gl_dirsep_regex='[/\\]'
17883 ;;
17884 *)
17885 gl_dirsep_regex='\/'
17886 ;;
17887 esac
17888 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17889 gl_header_literal_regex=`echo 'dirent.h' \
17890 | sed -e "$gl_make_literal_regex_sed"`
17891 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17892 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17893 s|^/[^/]|//&|
17894 p
17895 q
17896 }'
472fa5ee 17897
c0c3707f
CB
17898 gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17899 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 17900
c0c3707f
CB
17901 gl_header=$gl_cv_absolute_dirent_h
17902 gl_cv_next_dirent_h='"'$gl_header'"'
17903 else
17904 gl_cv_next_dirent_h='<'dirent.h'>'
17905 fi
6ec2e0f5
SDJ
17906
17907
c0c3707f
CB
17908fi
17909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
17910$as_echo "$gl_cv_next_dirent_h" >&6; }
17911 fi
17912 NEXT_DIRENT_H=$gl_cv_next_dirent_h
472fa5ee 17913
c0c3707f
CB
17914 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17915 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17916 gl_next_as_first_directive='<'dirent.h'>'
17917 else
17918 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17919 gl_next_as_first_directive=$gl_cv_next_dirent_h
17920 fi
17921 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
472fa5ee
SM
17922
17923
17924
17925
c0c3707f
CB
17926 if test $ac_cv_header_dirent_h = yes; then
17927 HAVE_DIRENT_H=1
6ec2e0f5 17928 else
c0c3707f 17929 HAVE_DIRENT_H=0
6ec2e0f5
SDJ
17930 fi
17931
6ec2e0f5 17932
0750520d 17933
0750520d 17934
0750520d 17935
472fa5ee
SM
17936
17937
17938
17939
17940
0750520d 17941
c0c3707f
CB
17942 for ac_func in dirfd
17943do :
17944 ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
17945if test "x$ac_cv_func_dirfd" = xyes; then :
17946 cat >>confdefs.h <<_ACEOF
17947#define HAVE_DIRFD 1
17948_ACEOF
0750520d 17949
c0c3707f
CB
17950fi
17951done
0750520d 17952
c0c3707f
CB
17953 ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
17954 #include <dirent.h>
17955"
17956if test "x$ac_cv_have_decl_dirfd" = xyes; then :
17957 ac_have_decl=1
8690e634 17958else
c0c3707f
CB
17959 ac_have_decl=0
17960fi
8690e634 17961
c0c3707f
CB
17962cat >>confdefs.h <<_ACEOF
17963#define HAVE_DECL_DIRFD $ac_have_decl
17964_ACEOF
49e4877c 17965
c0c3707f
CB
17966 if test $ac_cv_have_decl_dirfd = no; then
17967 HAVE_DECL_DIRFD=0
17968 fi
8690e634 17969
c0c3707f
CB
17970 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
17971$as_echo_n "checking whether dirfd is a macro... " >&6; }
17972if ${gl_cv_func_dirfd_macro+:} false; then :
17973 $as_echo_n "(cached) " >&6
17974else
6ec2e0f5
SDJ
17975 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17976/* end confdefs.h. */
8690e634 17977
c0c3707f
CB
17978#include <sys/types.h>
17979#include <dirent.h>
17980#ifdef dirfd
17981 dirent_header_defines_dirfd
6ec2e0f5 17982#endif
8690e634 17983_ACEOF
c0c3707f
CB
17984if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17985 $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
17986 gl_cv_func_dirfd_macro=yes
6ec2e0f5 17987else
c0c3707f 17988 gl_cv_func_dirfd_macro=no
6ec2e0f5 17989fi
c0c3707f 17990rm -f conftest*
472fa5ee 17991
c0c3707f
CB
17992fi
17993{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
17994$as_echo "$gl_cv_func_dirfd_macro" >&6; }
472fa5ee 17995
c0c3707f
CB
17996 # Use the replacement if we have no function or macro with that name,
17997 # or if OS/2 kLIBC whose dirfd() does not work.
17998 # Replace only if the system declares dirfd already.
17999 case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
18000 no,no,*,yes | *,*,os2*,yes)
18001 REPLACE_DIRFD=1
472fa5ee 18002
c0c3707f
CB
18003$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
18004;;
18005 esac
472fa5ee 18006
c0c3707f
CB
18007 if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
18008 || test $REPLACE_DIRFD = 1; then
6ec2e0f5 18009
6ec2e0f5
SDJ
18010
18011
18012
18013
472fa5ee
SM
18014
18015
18016
c0c3707f 18017 gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
472fa5ee
SM
18018
18019
c0c3707f
CB
18020 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
18021$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
18022if ${gl_cv_sys_dir_fd_member_name+:} false; then :
18023 $as_echo_n "(cached) " >&6
18024else
6ec2e0f5 18025
c0c3707f
CB
18026 dirfd_save_CFLAGS=$CFLAGS
18027 for ac_expr in d_fd dd_fd; do
6ec2e0f5 18028
c0c3707f
CB
18029 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
18030 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18031/* end confdefs.h. */
6ec2e0f5 18032
c0c3707f
CB
18033 #include <sys/types.h>
18034 #include <dirent.h>
18035int
18036main ()
18037{
18038DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
18039 ;
18040 return 0;
18041}
18042_ACEOF
18043if ac_fn_c_try_compile "$LINENO"; then :
18044 dir_fd_found=yes
6ec2e0f5 18045
c0c3707f
CB
18046fi
18047rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18048 CFLAGS=$dirfd_save_CFLAGS
18049 test "$dir_fd_found" = yes && break
18050 done
18051 test "$dir_fd_found" = yes || ac_expr=no_such_member
472fa5ee 18052
c0c3707f 18053 gl_cv_sys_dir_fd_member_name=$ac_expr
472fa5ee
SM
18054
18055
c0c3707f
CB
18056fi
18057{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
18058$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
18059 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
472fa5ee 18060
c0c3707f
CB
18061cat >>confdefs.h <<_ACEOF
18062#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
18063_ACEOF
472fa5ee 18064
6ec2e0f5
SDJ
18065 fi
18066
6ec2e0f5 18067
c0c3707f 18068 fi
6ec2e0f5
SDJ
18069
18070
18071
18072
18073
c0c3707f 18074 GNULIB_DIRFD=1
6ec2e0f5
SDJ
18075
18076
18077
6ec2e0f5 18078
8690e634 18079
c0c3707f 18080$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
8690e634
JK
18081
18082
8690e634
JK
18083
18084
18085
8690e634
JK
18086
18087
8690e634 18088
8690e634 18089
c0c3707f
CB
18090 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
18091$as_echo_n "checking whether // is distinct from /... " >&6; }
18092if ${gl_cv_double_slash_root+:} false; then :
18093 $as_echo_n "(cached) " >&6
18094else
18095 if test x"$cross_compiling" = xyes ; then
18096 # When cross-compiling, there is no way to tell whether // is special
18097 # short of a list of hosts. However, the only known hosts to date
18098 # that have a distinct // are Apollo DomainOS (too old to port to),
18099 # Cygwin, and z/OS. If anyone knows of another system for which // has
18100 # special semantics and is distinct from /, please report it to
18101 # <bug-gnulib@gnu.org>.
18102 case $host in
18103 *-cygwin | i370-ibm-openedition)
18104 gl_cv_double_slash_root=yes ;;
18105 *)
18106 # Be optimistic and assume that / and // are the same when we
18107 # don't know.
18108 gl_cv_double_slash_root='unknown, assuming no' ;;
18109 esac
18110 else
18111 set x `ls -di / // 2>/dev/null`
18112 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
18113 gl_cv_double_slash_root=no
18114 else
18115 gl_cv_double_slash_root=yes
18116 fi
18117 fi
18118fi
18119{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
18120$as_echo "$gl_cv_double_slash_root" >&6; }
18121 if test "$gl_cv_double_slash_root" = yes; then
6ec2e0f5 18122
c0c3707f 18123$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
8690e634 18124
c0c3707f 18125 fi
8690e634 18126
63ce7108
TT
18127
18128
18129
18130
c0c3707f
CB
18131 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
18132 REPLACE_DUP=1
18133 fi
8690e634
JK
18134
18135
18136
18137
18138
c0c3707f
CB
18139 if test $ac_cv_func_fchdir = no; then
18140 HAVE_FCHDIR=0
18141 fi
8690e634 18142
c0c3707f
CB
18143 if test $HAVE_FCHDIR = 0; then
18144 REPLACE_DUP=1
18145 fi
8690e634 18146
c0c3707f
CB
18147 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
18148$as_echo_n "checking whether dup works... " >&6; }
18149if ${gl_cv_func_dup_works+:} false; then :
8690e634
JK
18150 $as_echo_n "(cached) " >&6
18151else
c0c3707f
CB
18152 if test "$cross_compiling" = yes; then :
18153 case "$host_os" in
18154 # Guess no on native Windows.
18155 mingw*) gl_cv_func_dup_works="guessing no" ;;
18156 *) gl_cv_func_dup_works="guessing yes" ;;
18157 esac
8690e634 18158
c0c3707f 18159else
4a626d0a 18160 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 18161/* end confdefs.h. */
c0c3707f
CB
18162#include <unistd.h>
18163 #include <fcntl.h>
18164 #include <errno.h>
18165int
18166main ()
18167{
18168/* On OS/2 kLIBC, dup does not work on a directory fd. */
18169 int fd = open (".", O_RDONLY);
18170 return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
8690e634 18171
c0c3707f
CB
18172 ;
18173 return 0;
18174}
8690e634 18175
c0c3707f
CB
18176_ACEOF
18177if ac_fn_c_try_run "$LINENO"; then :
18178 gl_cv_func_dup_works=yes
18179else
18180 gl_cv_func_dup_works=no
18181fi
18182rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18183 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 18184fi
8690e634 18185
8690e634 18186
c0c3707f
CB
18187fi
18188{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
18189$as_echo "$gl_cv_func_dup_works" >&6; }
18190 case "$gl_cv_func_dup_works" in
18191 *yes) ;;
18192 *)
18193 REPLACE_DUP=1
18194 ;;
18195 esac
8690e634 18196
c0c3707f 18197 if test $REPLACE_DUP = 1; then
8690e634
JK
18198
18199
18200
18201
6ec2e0f5
SDJ
18202
18203
18204
18205
c0c3707f 18206 gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
8690e634 18207
c0c3707f
CB
18208 :
18209 fi
8690e634 18210
5e8754f9 18211
8690e634
JK
18212
18213
8839a007 18214
c0c3707f 18215 GNULIB_DUP=1
63ce7108 18216
63ce7108 18217
63ce7108 18218
6ec2e0f5 18219
6ec2e0f5 18220
c0c3707f 18221$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
6ec2e0f5 18222
63ce7108
TT
18223
18224
472fa5ee
SM
18225
18226
18227
18228
18229
c0c3707f
CB
18230$as_echo "#define HAVE_DUP2 1" >>confdefs.h
18231
18232
18233 if test $HAVE_DUP2 = 1; then
18234 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
18235$as_echo_n "checking whether dup2 works... " >&6; }
18236if ${gl_cv_func_dup2_works+:} false; then :
6ec2e0f5
SDJ
18237 $as_echo_n "(cached) " >&6
18238else
18239 if test "$cross_compiling" = yes; then :
18240 case "$host_os" in
c0c3707f
CB
18241 mingw*) # on this platform, dup2 always returns 0 for success
18242 gl_cv_func_dup2_works="guessing no" ;;
18243 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
18244 gl_cv_func_dup2_works="guessing no" ;;
18245 aix* | freebsd*)
18246 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
18247 # not EBADF.
18248 gl_cv_func_dup2_works="guessing no" ;;
18249 haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
18250 gl_cv_func_dup2_works="guessing no" ;;
18251 *-android*) # implemented using dup3(), which fails if oldfd == newfd
18252 gl_cv_func_dup2_works="guessing no" ;;
18253 os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
18254 gl_cv_func_dup2_works="guessing no" ;;
18255 *) gl_cv_func_dup2_works="guessing yes" ;;
18256 esac
63ce7108
TT
18257else
18258 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18259/* end confdefs.h. */
18260
c0c3707f
CB
18261 #include <errno.h>
18262 #include <fcntl.h>
18263 #include <limits.h>
18264 #include <sys/resource.h>
18265 #include <unistd.h>
18266 #ifndef RLIM_SAVED_CUR
18267 # define RLIM_SAVED_CUR RLIM_INFINITY
18268 #endif
18269 #ifndef RLIM_SAVED_MAX
18270 # define RLIM_SAVED_MAX RLIM_INFINITY
18271 #endif
63ce7108
TT
18272
18273int
18274main ()
18275{
6ec2e0f5 18276int result = 0;
c0c3707f
CB
18277 int bad_fd = INT_MAX;
18278 struct rlimit rlim;
18279 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18280 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18281 && rlim.rlim_cur != RLIM_INFINITY
18282 && rlim.rlim_cur != RLIM_SAVED_MAX
18283 && rlim.rlim_cur != RLIM_SAVED_CUR)
18284 bad_fd = rlim.rlim_cur;
18285 #ifdef FD_CLOEXEC
18286 if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
18287 result |= 1;
18288 #endif
18289 if (dup2 (1, 1) != 1)
18290 result |= 2;
18291 #ifdef FD_CLOEXEC
18292 if (fcntl (1, F_GETFD) != FD_CLOEXEC)
18293 result |= 4;
18294 #endif
18295 close (0);
18296 if (dup2 (0, 0) != -1)
18297 result |= 8;
18298 /* Many gnulib modules require POSIX conformance of EBADF. */
18299 if (dup2 (2, bad_fd) == -1 && errno != EBADF)
18300 result |= 16;
18301 /* Flush out some cygwin core dumps. */
18302 if (dup2 (2, -1) != -1 || errno != EBADF)
18303 result |= 32;
18304 dup2 (2, 255);
18305 dup2 (2, 256);
18306 /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
18307 {
18308 int fd = open (".", O_RDONLY);
18309 if (fd == -1)
18310 result |= 64;
18311 else if (dup2 (fd, fd + 1) == -1)
18312 result |= 128;
18313
18314 close (fd);
18315 }
18316 return result;
63ce7108
TT
18317 ;
18318 return 0;
18319}
c0c3707f 18320
63ce7108
TT
18321_ACEOF
18322if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 18323 gl_cv_func_dup2_works=yes
63ce7108 18324else
c0c3707f 18325 gl_cv_func_dup2_works=no
63ce7108
TT
18326fi
18327rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18328 conftest.$ac_objext conftest.beam conftest.$ac_ext
18329fi
18330
c0c3707f 18331
63ce7108 18332fi
c0c3707f
CB
18333{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
18334$as_echo "$gl_cv_func_dup2_works" >&6; }
18335 case "$gl_cv_func_dup2_works" in
63ce7108
TT
18336 *yes) ;;
18337 *)
c0c3707f
CB
18338 REPLACE_DUP2=1
18339 for ac_func in setdtablesize
18340do :
18341 ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
18342if test "x$ac_cv_func_setdtablesize" = xyes; then :
18343 cat >>confdefs.h <<_ACEOF
18344#define HAVE_SETDTABLESIZE 1
18345_ACEOF
18346
18347fi
18348done
18349
63ce7108
TT
18350 ;;
18351 esac
18352 fi
18353
09607c9e
TT
18354
18355
18356
c0c3707f
CB
18357 if test $ac_cv_func_fchdir = no; then
18358 HAVE_FCHDIR=0
18359 fi
4a626d0a 18360
c0c3707f
CB
18361 if test $HAVE_FCHDIR = 0; then
18362 if test $HAVE_DUP2 = 1; then
18363 REPLACE_DUP2=1
18364 fi
18365 fi
4a626d0a
PA
18366
18367
c0c3707f 18368 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
4a626d0a
PA
18369
18370
18371
18372
18373
18374
4a626d0a 18375
4a626d0a 18376
c0c3707f 18377 gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
4a626d0a
PA
18378
18379
c0c3707f 18380 fi
4a626d0a
PA
18381
18382
18383
18384
18385
c0c3707f 18386 GNULIB_DUP2=1
4a626d0a
PA
18387
18388
18389
18390
09607c9e 18391
c0c3707f 18392$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
09607c9e
TT
18393
18394
472fa5ee
SM
18395
18396
18397
18398
18399
09607c9e 18400
6ec2e0f5 18401
c0c3707f 18402 GNULIB_ENVIRON=1
6ec2e0f5 18403
09607c9e 18404
09607c9e 18405
6ec2e0f5
SDJ
18406
18407
c0c3707f 18408$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
6ec2e0f5
SDJ
18409
18410
6ec2e0f5 18411
5e8754f9 18412
6ec2e0f5 18413
c0c3707f
CB
18414 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
18415$as_echo_n "checking for error_at_line... " >&6; }
18416if ${ac_cv_lib_error_at_line+:} false; then :
09607c9e 18417 $as_echo_n "(cached) " >&6
4a626d0a
PA
18418else
18419 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18420/* end confdefs.h. */
c0c3707f
CB
18421#include <error.h>
18422int
18423main ()
18424{
18425error_at_line (0, 0, "", 0, "an error occurred");
18426 ;
4a626d0a
PA
18427 return 0;
18428}
18429_ACEOF
c0c3707f
CB
18430if ac_fn_c_try_link "$LINENO"; then :
18431 ac_cv_lib_error_at_line=yes
4a626d0a 18432else
c0c3707f 18433 ac_cv_lib_error_at_line=no
6ec2e0f5 18434fi
c0c3707f
CB
18435rm -f core conftest.err conftest.$ac_objext \
18436 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5 18437fi
c0c3707f
CB
18438{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
18439$as_echo "$ac_cv_lib_error_at_line" >&6; }
09607c9e 18440
c0c3707f 18441 if test $ac_cv_lib_error_at_line = no; then
09607c9e
TT
18442
18443
18444
18445
18446
18447
18448
18449
c0c3707f 18450 gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
09607c9e 18451
4a626d0a 18452
09607c9e 18453
c0c3707f 18454 :
4a626d0a 18455
c0c3707f 18456 fi
4a626d0a 18457
4a626d0a 18458
09607c9e 18459
09607c9e 18460
09607c9e
TT
18461
18462
09607c9e 18463
c0c3707f
CB
18464 if test $ac_cv_have_decl_fchdir = no; then
18465 HAVE_DECL_FCHDIR=0
18466 fi
09607c9e
TT
18467
18468
c0c3707f 18469 if test $HAVE_FCHDIR = 0; then
09607c9e
TT
18470
18471
18472
c0c3707f
CB
18473
18474
18475
18476
18477
18478 gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
18479
18480 :
18481
18482$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
18483
18484 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
18485$as_echo_n "checking whether open can visit directories... " >&6; }
18486if ${gl_cv_func_open_directory_works+:} false; then :
18487 $as_echo_n "(cached) " >&6
3d99e817 18488else
c0c3707f
CB
18489 if test "$cross_compiling" = yes; then :
18490 case "$host_os" in
18491 # Guess yes on Linux systems.
18492 linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
18493 # Guess yes on glibc systems.
18494 *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
18495 # Guess no on native Windows.
18496 mingw*) gl_cv_func_open_directory_works="guessing no" ;;
18497 # If we don't know, obey --enable-cross-guesses.
18498 *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
18499 esac
18500
18501else
18502 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18503/* end confdefs.h. */
18504#include <fcntl.h>
18505
18506int
18507main ()
18508{
18509return open(".", O_RDONLY) < 0;
18510 ;
18511 return 0;
18512}
18513_ACEOF
18514if ac_fn_c_try_run "$LINENO"; then :
18515 gl_cv_func_open_directory_works=yes
18516else
18517 gl_cv_func_open_directory_works=no
18518fi
18519rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18520 conftest.$ac_objext conftest.beam conftest.$ac_ext
3d99e817
AK
18521fi
18522
c0c3707f
CB
18523fi
18524{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
18525$as_echo "$gl_cv_func_open_directory_works" >&6; }
18526 case "$gl_cv_func_open_directory_works" in
18527 *yes) ;;
18528 *)
3d99e817 18529
c0c3707f 18530$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
09607c9e 18531
c0c3707f
CB
18532 ;;
18533 esac
18534 fi
8690e634 18535
8690e634 18536
8690e634 18537
8690e634 18538
8690e634 18539
6ec2e0f5 18540
c0c3707f 18541 GNULIB_FCHDIR=1
6ec2e0f5
SDJ
18542
18543
6ec2e0f5 18544
8690e634
JK
18545
18546
c0c3707f 18547$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
8690e634
JK
18548
18549
18550
6ec2e0f5
SDJ
18551
18552
18553
6ec2e0f5 18554
8690e634 18555
c0c3707f 18556 if test $ac_cv_func_fcntl = no; then
8690e634
JK
18557
18558
6ec2e0f5 18559
c0c3707f
CB
18560 if test $ac_cv_func_fcntl = no; then
18561 HAVE_FCNTL=0
18562 else
18563 REPLACE_FCNTL=1
18564 fi
5e8754f9 18565
c0c3707f
CB
18566 else
18567 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
18568$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
18569if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
8690e634 18570 $as_echo_n "(cached) " >&6
6ec2e0f5 18571else
c0c3707f
CB
18572 if test "$cross_compiling" = yes; then :
18573 case $host_os in
18574 aix* | cygwin* | haiku*)
18575 gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
18576 *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
18577 esac
18578else
18579 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18580/* end confdefs.h. */
18581#include <errno.h>
18582 #include <fcntl.h>
18583 #include <limits.h>
18584 #include <sys/resource.h>
18585 #include <unistd.h>
18586 #ifndef RLIM_SAVED_CUR
18587 # define RLIM_SAVED_CUR RLIM_INFINITY
18588 #endif
18589 #ifndef RLIM_SAVED_MAX
18590 # define RLIM_SAVED_MAX RLIM_INFINITY
18591 #endif
18592
18593int
18594main ()
18595{
18596int result = 0;
18597 int bad_fd = INT_MAX;
18598 struct rlimit rlim;
18599 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18600 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18601 && rlim.rlim_cur != RLIM_INFINITY
18602 && rlim.rlim_cur != RLIM_SAVED_MAX
18603 && rlim.rlim_cur != RLIM_SAVED_CUR)
18604 bad_fd = rlim.rlim_cur;
18605 if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
18606 if (errno != EINVAL) result |= 2;
18607 if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
18608 if (errno != EINVAL) result |= 8;
18609 /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
18610 {
18611 int fd;
18612 fd = open (".", O_RDONLY);
18613 if (fd == -1)
18614 result |= 16;
18615 else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
18616 result |= 32;
18617
18618 close (fd);
18619 }
18620 return result;
18621 ;
18622 return 0;
18623}
18624_ACEOF
18625if ac_fn_c_try_run "$LINENO"; then :
18626 gl_cv_func_fcntl_f_dupfd_works=yes
18627else
18628 gl_cv_func_fcntl_f_dupfd_works=no
18629fi
18630rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18631 conftest.$ac_objext conftest.beam conftest.$ac_ext
18632fi
18633
18634fi
18635{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
18636$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
18637 case $gl_cv_func_fcntl_f_dupfd_works in
18638 *yes) ;;
18639 *)
18640
18641
18642 if test $ac_cv_func_fcntl = no; then
18643 HAVE_FCNTL=0
18644 else
18645 REPLACE_FCNTL=1
18646 fi
18647
18648
18649$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
18650 ;;
18651 esac
18652
18653 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
18654$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
18655if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
18656 $as_echo_n "(cached) " >&6
8690e634
JK
18657else
18658 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18659/* end confdefs.h. */
c0c3707f
CB
18660
18661#include <fcntl.h>
18662#ifndef F_DUPFD_CLOEXEC
18663choke me
18664#endif
18665
18666int
18667main ()
18668{
18669
18670 ;
18671 return 0;
18672}
18673_ACEOF
18674if ac_fn_c_try_compile "$LINENO"; then :
18675 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18676/* end confdefs.h. */
18677
18678#ifdef __linux__
18679/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
18680 it to support the semantics on older kernels that failed with EINVAL. */
18681choke me
18682#endif
8690e634 18683
8690e634
JK
18684int
18685main ()
18686{
18687
18688 ;
18689 return 0;
18690}
18691_ACEOF
c0c3707f
CB
18692if ac_fn_c_try_compile "$LINENO"; then :
18693 gl_cv_func_fcntl_f_dupfd_cloexec=yes
8690e634 18694else
c0c3707f 18695 gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
8690e634 18696fi
c0c3707f
CB
18697rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18698else
18699 gl_cv_func_fcntl_f_dupfd_cloexec=no
18700fi
18701rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 18702fi
c0c3707f
CB
18703{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
18704$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
18705 if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
8690e634 18706
8690e634 18707
c0c3707f
CB
18708
18709 if test $ac_cv_func_fcntl = no; then
18710 HAVE_FCNTL=0
5e8754f9 18711 else
c0c3707f
CB
18712 REPLACE_FCNTL=1
18713 fi
18714
18715 fi
8690e634
JK
18716 fi
18717
18718
8690e634 18719
8690e634 18720
c0c3707f
CB
18721 if test $ac_cv_func_fchdir = no; then
18722 HAVE_FCHDIR=0
18723 fi
6ec2e0f5 18724
c0c3707f 18725 if test $HAVE_FCHDIR = 0; then
6ec2e0f5
SDJ
18726
18727
18728
c0c3707f
CB
18729 if test $ac_cv_func_fcntl = no; then
18730 HAVE_FCNTL=0
18731 else
18732 REPLACE_FCNTL=1
18733 fi
6ec2e0f5 18734
c0c3707f 18735 fi
6ec2e0f5
SDJ
18736
18737
c0c3707f 18738 if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
6ec2e0f5 18739
6ec2e0f5
SDJ
18740
18741
5e8754f9
SDJ
18742
18743
8690e634 18744
8690e634
JK
18745
18746
c0c3707f 18747 gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
472fa5ee 18748
c0c3707f 18749 fi
472fa5ee
SM
18750
18751
18752
18753
18754
c0c3707f 18755 GNULIB_FCNTL=1
472fa5ee
SM
18756
18757
18758
18759
18760
c0c3707f 18761$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
472fa5ee
SM
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
c0c3707f
CB
18776 if test $gl_cv_have_include_next = yes; then
18777 gl_cv_next_fcntl_h='<'fcntl.h'>'
18778 else
18779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
18780$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
18781if ${gl_cv_next_fcntl_h+:} false; then :
18782 $as_echo_n "(cached) " >&6
18783else
472fa5ee
SM
18784
18785
472fa5ee 18786
c0c3707f
CB
18787 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18788/* end confdefs.h. */
18789#include <fcntl.h>
18790_ACEOF
18791 case "$host_os" in
18792 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18793 *) gl_absname_cpp="$ac_cpp" ;;
18794 esac
472fa5ee 18795
c0c3707f
CB
18796 case "$host_os" in
18797 mingw*)
18798 gl_dirsep_regex='[/\\]'
18799 ;;
18800 *)
18801 gl_dirsep_regex='\/'
18802 ;;
18803 esac
18804 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18805 gl_header_literal_regex=`echo 'fcntl.h' \
18806 | sed -e "$gl_make_literal_regex_sed"`
18807 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18808 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18809 s|^/[^/]|//&|
18810 p
18811 q
18812 }'
472fa5ee 18813
c0c3707f
CB
18814 gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18815 sed -n "$gl_absolute_header_sed"`
472fa5ee 18816
c0c3707f
CB
18817 gl_header=$gl_cv_absolute_fcntl_h
18818 gl_cv_next_fcntl_h='"'$gl_header'"'
8690e634
JK
18819
18820
c0c3707f
CB
18821fi
18822{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
18823$as_echo "$gl_cv_next_fcntl_h" >&6; }
18824 fi
18825 NEXT_FCNTL_H=$gl_cv_next_fcntl_h
8690e634 18826
c0c3707f
CB
18827 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18828 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18829 gl_next_as_first_directive='<'fcntl.h'>'
18830 else
18831 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18832 gl_next_as_first_directive=$gl_cv_next_fcntl_h
18833 fi
18834 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
8690e634
JK
18835
18836
18837
18838
5e8754f9
SDJ
18839
18840
18841
18842
472fa5ee
SM
18843
18844
18845
18846
18847
18848
18849
5e8754f9 18850cat >>confdefs.h <<_ACEOF
c0c3707f 18851#define GNULIB_FD_SAFER_FLAG 1
5e8754f9 18852_ACEOF
472fa5ee
SM
18853
18854
c0c3707f
CB
18855
18856
18857
18858
18859
18860 ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
18861#include <dirent.h>
18862
5e8754f9 18863"
c0c3707f 18864if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
5e8754f9
SDJ
18865 ac_have_decl=1
18866else
18867 ac_have_decl=0
18868fi
472fa5ee 18869
5e8754f9 18870cat >>confdefs.h <<_ACEOF
c0c3707f 18871#define HAVE_DECL_FDOPENDIR $ac_have_decl
5e8754f9 18872_ACEOF
c0c3707f 18873if test $ac_have_decl = 1; then :
472fa5ee 18874
c0c3707f
CB
18875else
18876 HAVE_DECL_FDOPENDIR=0
18877fi
472fa5ee
SM
18878
18879
c0c3707f
CB
18880 if test $ac_cv_func_fdopendir = no; then
18881 HAVE_FDOPENDIR=0
18882 else
18883 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
18884$as_echo_n "checking whether fdopendir works... " >&6; }
18885if ${gl_cv_func_fdopendir_works+:} false; then :
18886 $as_echo_n "(cached) " >&6
18887else
18888 if test "$cross_compiling" = yes; then :
18889 case "$host_os" in
18890 # Guess yes on glibc systems.
18891 *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
18892 # Guess yes on musl systems.
18893 *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
18894 # If we don't know, obey --enable-cross-guesses.
18895 *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
18896 esac
472fa5ee 18897
c0c3707f
CB
18898else
18899 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18900/* end confdefs.h. */
472fa5ee 18901
c0c3707f
CB
18902#include <dirent.h>
18903#include <fcntl.h>
18904#include <unistd.h>
18905#if !HAVE_DECL_FDOPENDIR
18906extern
18907# ifdef __cplusplus
18908"C"
18909# endif
18910DIR *fdopendir (int);
18911#endif
472fa5ee 18912
c0c3707f
CB
18913int
18914main ()
18915{
18916int result = 0;
18917 int fd = open ("conftest.c", O_RDONLY);
18918 if (fd < 0) result |= 1;
18919 if (fdopendir (fd)) result |= 2;
18920 if (close (fd)) result |= 4;
18921 return result;
18922 ;
18923 return 0;
18924}
18925_ACEOF
18926if ac_fn_c_try_run "$LINENO"; then :
18927 gl_cv_func_fdopendir_works=yes
18928else
18929 gl_cv_func_fdopendir_works=no
18930fi
18931rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18932 conftest.$ac_objext conftest.beam conftest.$ac_ext
18933fi
472fa5ee 18934
c0c3707f
CB
18935fi
18936{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
18937$as_echo "$gl_cv_func_fdopendir_works" >&6; }
18938 case "$gl_cv_func_fdopendir_works" in
18939 *yes) ;;
18940 *)
18941 REPLACE_FDOPENDIR=1
18942 ;;
18943 esac
18944 fi
472fa5ee 18945
c0c3707f 18946 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
472fa5ee
SM
18947
18948
18949
18950
18951
98399780 18952
5e8754f9
SDJ
18953
18954
c0c3707f 18955 gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
5e8754f9 18956
c0c3707f 18957 fi
5e8754f9
SDJ
18958
18959
18960
18961
18962
c0c3707f 18963 GNULIB_FDOPENDIR=1
5e8754f9
SDJ
18964
18965
18966
18967
18968
c0c3707f 18969$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
5e8754f9
SDJ
18970
18971
5e8754f9
SDJ
18972
18973
18974
c0c3707f
CB
18975cat >>confdefs.h <<_ACEOF
18976#define GNULIB_FDOPENDIR 1
18977_ACEOF
5e8754f9
SDJ
18978
18979
18980
5e8754f9
SDJ
18981
18982
18983
c0c3707f
CB
18984 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
18985$as_echo_n "checking for flexible array member... " >&6; }
18986if ${ac_cv_c_flexmember+:} false; then :
5e8754f9 18987 $as_echo_n "(cached) " >&6
6ec2e0f5 18988else
c0c3707f 18989 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 18990/* end confdefs.h. */
c0c3707f
CB
18991#include <stdlib.h>
18992 #include <stdio.h>
18993 #include <stddef.h>
18994 struct m { struct m *next, **list; char name[]; };
18995 struct s { struct s *p; struct m *m; int n; double d[]; };
5e8754f9
SDJ
18996int
18997main ()
18998{
c0c3707f
CB
18999int m = getchar ();
19000 size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
19001 nbytes += sizeof (struct s) - 1;
19002 nbytes -= nbytes % sizeof (struct s);
19003 struct s *p = malloc (nbytes);
19004 p->p = p;
19005 p->m = NULL;
19006 p->d[0] = 0.0;
19007 return p->d != (double *) NULL;
5e8754f9
SDJ
19008 ;
19009 return 0;
19010}
7a6dbc2f 19011_ACEOF
c0c3707f
CB
19012if ac_fn_c_try_compile "$LINENO"; then :
19013 ac_cv_c_flexmember=yes
5e8754f9 19014else
c0c3707f 19015 ac_cv_c_flexmember=no
5e8754f9 19016fi
c0c3707f 19017rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5e8754f9 19018fi
c0c3707f
CB
19019{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
19020$as_echo "$ac_cv_c_flexmember" >&6; }
19021 if test $ac_cv_c_flexmember = yes; then
19022
19023$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
5e8754f9 19024
c0c3707f
CB
19025 else
19026 $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
98399780 19027
c0c3707f 19028 fi
98399780 19029
472fa5ee
SM
19030
19031
19032
c0c3707f
CB
19033 FLOAT_H=
19034 REPLACE_FLOAT_LDBL=0
19035 case "$host_os" in
19036 aix* | beos* | openbsd* | mirbsd* | irix*)
19037 FLOAT_H=float.h
19038 ;;
19039 freebsd* | dragonfly*)
19040 case "$host_cpu" in
19041 i[34567]86 )
19042 FLOAT_H=float.h
19043 ;;
19044 x86_64 )
19045 # On x86_64 systems, the C compiler may still be generating
19046 # 32-bit code.
19047 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19048/* end confdefs.h. */
19049#if defined __LP64__ || defined __x86_64__ || defined __amd64__
19050 int ok;
19051 #else
19052 error fail
19053 #endif
472fa5ee 19054
c0c3707f
CB
19055_ACEOF
19056if ac_fn_c_try_compile "$LINENO"; then :
472fa5ee 19057
c0c3707f
CB
19058else
19059 FLOAT_H=float.h
19060fi
19061rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19062 ;;
19063 esac
19064 ;;
19065 linux*)
19066 case "$host_cpu" in
19067 powerpc*)
19068 FLOAT_H=float.h
19069 ;;
19070 esac
19071 ;;
19072 esac
19073 case "$host_os" in
19074 aix* | freebsd* | dragonfly* | linux*)
19075 if test -n "$FLOAT_H"; then
19076 REPLACE_FLOAT_LDBL=1
19077 fi
19078 ;;
19079 esac
19080
19081 REPLACE_ITOLD=0
19082 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
19083$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
19084if ${gl_cv_func_itold_works+:} false; then :
5e8754f9
SDJ
19085 $as_echo_n "(cached) " >&6
19086else
19087
19088 if test "$cross_compiling" = yes; then :
c0c3707f
CB
19089 case "$host" in
19090 sparc*-*-linux*)
19091 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19092/* end confdefs.h. */
19093#if defined __LP64__ || defined __arch64__
19094 int ok;
19095 #else
19096 error fail
19097 #endif
19098
19099_ACEOF
19100if ac_fn_c_try_compile "$LINENO"; then :
19101 gl_cv_func_itold_works="guessing no"
19102else
19103 gl_cv_func_itold_works="guessing yes"
19104fi
19105rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19106 ;;
19107 # Guess yes on native Windows.
19108 mingw*) gl_cv_func_itold_works="guessing yes" ;;
19109 *) gl_cv_func_itold_works="guessing yes" ;;
5e8754f9
SDJ
19110 esac
19111
19112else
19113 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19114/* end confdefs.h. */
19115
c0c3707f
CB
19116int i = -1;
19117volatile long double ld;
19118int main ()
5e8754f9 19119{
c0c3707f
CB
19120 ld += i * 1.0L;
19121 if (ld > 0)
19122 return 1;
19123 return 0;
5e8754f9
SDJ
19124}
19125_ACEOF
19126if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 19127 gl_cv_func_itold_works=yes
5e8754f9 19128else
c0c3707f 19129 gl_cv_func_itold_works=no
5e8754f9
SDJ
19130fi
19131rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19132 conftest.$ac_objext conftest.beam conftest.$ac_ext
19133fi
19134
98399780 19135
5e8754f9 19136fi
c0c3707f
CB
19137{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
19138$as_echo "$gl_cv_func_itold_works" >&6; }
19139 case "$gl_cv_func_itold_works" in
19140 *no)
19141 REPLACE_ITOLD=1
19142 FLOAT_H=float.h
19143 ;;
19144 esac
98399780 19145
c0c3707f 19146 if test -n "$FLOAT_H"; then
98399780
YQ
19147
19148
19149
19150
6a29c58e
YQ
19151
19152
19153
19154
c0c3707f
CB
19155 if test $gl_cv_have_include_next = yes; then
19156 gl_cv_next_float_h='<'float.h'>'
19157 else
19158 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
19159$as_echo_n "checking absolute name of <float.h>... " >&6; }
19160if ${gl_cv_next_float_h+:} false; then :
19161 $as_echo_n "(cached) " >&6
19162else
19163
19164
19165
19166 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19167/* end confdefs.h. */
19168#include <float.h>
19169_ACEOF
19170 case "$host_os" in
19171 aix*) gl_absname_cpp="$ac_cpp -C" ;;
19172 *) gl_absname_cpp="$ac_cpp" ;;
19173 esac
19174
19175 case "$host_os" in
19176 mingw*)
19177 gl_dirsep_regex='[/\\]'
19178 ;;
19179 *)
19180 gl_dirsep_regex='\/'
19181 ;;
19182 esac
19183 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
19184 gl_header_literal_regex=`echo 'float.h' \
19185 | sed -e "$gl_make_literal_regex_sed"`
19186 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
19187 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
19188 s|^/[^/]|//&|
19189 p
19190 q
19191 }'
19192
19193 gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
19194 sed -n "$gl_absolute_header_sed"`
19195
19196 gl_header=$gl_cv_absolute_float_h
19197 gl_cv_next_float_h='"'$gl_header'"'
19198
19199
19200fi
19201{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
19202$as_echo "$gl_cv_next_float_h" >&6; }
19203 fi
19204 NEXT_FLOAT_H=$gl_cv_next_float_h
19205
19206 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
19207 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
19208 gl_next_as_first_directive='<'float.h'>'
19209 else
19210 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
19211 gl_next_as_first_directive=$gl_cv_next_float_h
19212 fi
19213 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
19214
19215
19216
6a29c58e 19217
c0c3707f 19218 fi
6a29c58e 19219
c0c3707f
CB
19220 if test -n "$FLOAT_H"; then
19221 GL_GENERATE_FLOAT_H_TRUE=
19222 GL_GENERATE_FLOAT_H_FALSE='#'
19223else
19224 GL_GENERATE_FLOAT_H_TRUE='#'
19225 GL_GENERATE_FLOAT_H_FALSE=
19226fi
6a29c58e
YQ
19227
19228
8690e634 19229
c0c3707f 19230 if test $REPLACE_FLOAT_LDBL = 1; then
8690e634 19231
8690e634 19232
8690e634 19233
8690e634 19234
8690e634 19235
8690e634 19236
8690e634 19237
4a626d0a 19238
c0c3707f 19239 gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
8690e634 19240
c0c3707f
CB
19241 fi
19242 if test $REPLACE_ITOLD = 1; then
8690e634
JK
19243
19244
19245
19246
19247
19248
63ce7108 19249
e26b6bb0 19250
c0c3707f 19251 gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
e26b6bb0 19252
c0c3707f 19253 fi
e26b6bb0
TT
19254
19255
19256
19257
c0c3707f
CB
19258 gl_fnmatch_required_lowercase=`
19259 echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
19260 `
e26b6bb0 19261
c0c3707f
CB
19262 if test $ac_cv_func_fnmatch = no; then
19263 HAVE_FNMATCH=0
19264 else
19265 gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
19266 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
19267$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; }
19268if eval \${$gl_fnmatch_cache_var+:} false; then :
5e8754f9
SDJ
19269 $as_echo_n "(cached) " >&6
19270else
c0c3707f
CB
19271 if test $gl_fnmatch_required = GNU; then
19272 gl_fnmatch_gnu_start=
19273 gl_fnmatch_gnu_end=
19274 else
19275 gl_fnmatch_gnu_start='#if 0'
19276 gl_fnmatch_gnu_end='#endif'
19277 fi
19278 if test "$cross_compiling" = yes; then :
19279 case "$host_os" in
19280 # Guess yes on musl systems.
19281 *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
19282 # Guess no otherwise, even on glibc systems.
19283 *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
19284 esac
e26b6bb0 19285
c0c3707f
CB
19286else
19287 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 19288/* end confdefs.h. */
c0c3707f
CB
19289#include <fnmatch.h>
19290 static int
19291 y (char const *pattern, char const *string, int flags)
19292 {
19293 return fnmatch (pattern, string, flags) == 0;
19294 }
19295 static int
19296 n (char const *pattern, char const *string, int flags)
19297 {
19298 return fnmatch (pattern, string, flags) == FNM_NOMATCH;
19299 }
19300
5e8754f9
SDJ
19301int
19302main ()
19303{
c0c3707f
CB
19304char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
19305 char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
19306 static char const A_1[] = { 'A' - 1, 0 };
19307 static char const A01[] = { 'A' + 1, 0 };
19308 static char const a_1[] = { 'a' - 1, 0 };
19309 static char const a01[] = { 'a' + 1, 0 };
19310 static char const bs_1[] = { '\\\\' - 1, 0 };
19311 static char const bs01[] = { '\\\\' + 1, 0 };
19312 int result = 0;
19313 if (!n ("a*", "", 0))
19314 return 1;
19315 if (!y ("a*", "abc", 0))
19316 return 1;
19317 if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
19318 return 1;
19319 if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
19320 return 2;
19321 if (!y ("a\\\\bc", "abc", 0))
19322 return 3;
19323 if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
19324 return 3;
19325 if (!y ("*x", ".x", 0))
19326 return 4;
19327 if (!n ("*x", ".x", FNM_PERIOD))
19328 return 4;
19329 if (!y (Apat, "\\\\", 0))
19330 return 5;
19331 if (!y (Apat, "A", 0))
19332 return 5;
19333 if (!y (apat, "\\\\", 0))
19334 return 5;
19335 if (!y (apat, "a", 0))
19336 return 5;
19337 if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
19338 return 5;
19339 if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
19340 return 5;
19341 if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
19342 return 5;
19343 if (!(y (apat, a01, 0) == ('a' < '\\\\')))
19344 return 5;
19345 if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
19346 return 5;
19347 if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
19348 return 5;
19349 if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
19350 return 5;
19351 if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
19352 return 5;
19353 $gl_fnmatch_gnu_start
19354 if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
19355 result |= 8;
19356 if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
19357 result |= 16;
19358 if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
19359 result |= 32;
19360 if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
19361 result |= 64;
19362 if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
19363 result |= 64;
19364 if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
19365 result |= 64;
19366 $gl_fnmatch_gnu_end
19367 return result;
19368
5e8754f9
SDJ
19369 ;
19370 return 0;
19371}
19372_ACEOF
c0c3707f
CB
19373if ac_fn_c_try_run "$LINENO"; then :
19374 eval "$gl_fnmatch_cache_var=yes"
5e8754f9 19375else
c0c3707f
CB
19376 eval "$gl_fnmatch_cache_var=no"
19377fi
19378rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19379 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 19380fi
c0c3707f 19381
e26b6bb0 19382
5e8754f9 19383fi
c0c3707f
CB
19384eval ac_res=\$$gl_fnmatch_cache_var
19385 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
19386$as_echo "$ac_res" >&6; }
19387 eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
19388 case "$gl_fnmatch_result" in
19389 *yes) ;;
19390 *) REPLACE_FNMATCH=1 ;;
19391 esac
19392 fi
19393 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
e26b6bb0 19394
e26b6bb0 19395
c0c3707f
CB
19396 FNMATCH_H='fnmatch.h'
19397 if test -n "$FNMATCH_H"; then
19398 GL_GENERATE_FNMATCH_H_TRUE=
19399 GL_GENERATE_FNMATCH_H_FALSE='#'
5e8754f9 19400else
c0c3707f
CB
19401 GL_GENERATE_FNMATCH_H_TRUE='#'
19402 GL_GENERATE_FNMATCH_H_FALSE=
5e8754f9 19403fi
e26b6bb0 19404
18848e28 19405
c0c3707f 19406 fi
18848e28 19407
c0c3707f 19408 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18848e28 19409
18848e28 19410
18848e28 19411
c0c3707f
CB
19412
19413
19414
19415
19416
19417 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19418
19419
19420
c0c3707f
CB
19421
19422
19423 fi
19424
19425
19426
19427
19428
19429 GNULIB_FNMATCH=1
19430
19431
19432
19433
19434
19435$as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h
19436
19437
19438
19439
19440
19441
19442
19443
19444 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
19445
19446
19447
19448
19449
19450
19451
19452
19453 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19454
19455
19456
18848e28 19457
18848e28 19458
5e8754f9 19459 fi
18848e28 19460
18848e28 19461
c0c3707f
CB
19462cat >>confdefs.h <<_ACEOF
19463#define GNULIB_FNMATCH_GNU 1
19464_ACEOF
18848e28 19465
18848e28 19466
18848e28 19467
18848e28 19468
c0c3707f
CB
19469 if test $gl_func_frexp != yes; then
19470
19471
18848e28
GF
19472
19473
18848e28 19474
18848e28 19475
18848e28 19476
c0c3707f
CB
19477
19478 gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
18848e28
GF
19479
19480 fi
19481
19482
19483
19484
19485
c0c3707f 19486 GNULIB_FREXP=1
18848e28
GF
19487
19488
19489
19490
19491
c0c3707f 19492$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
18848e28
GF
19493
19494
19495
19496
c0c3707f
CB
19497 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
19498
19499
19500
18848e28
GF
19501
19502
19503
5e8754f9
SDJ
19504
19505
c0c3707f
CB
19506 gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
19507
5e8754f9 19508 fi
18848e28 19509
6a29c58e 19510
6a29c58e 19511
6a29c58e 19512
6ec2e0f5 19513
c0c3707f
CB
19514 GNULIB_FREXPL=1
19515
19516
19517
19518
19519
19520$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
19521
19522
19523
19524
19525
19526
19527
19528 case "$host_os" in
19529 mingw* | solaris*)
19530 REPLACE_FSTAT=1
19531 ;;
19532 esac
472fa5ee
SM
19533
19534
19535
19536
19537
6ec2e0f5
SDJ
19538 if test $ac_cv_func_fchdir = no; then
19539 HAVE_FCHDIR=0
6a29c58e
YQ
19540 fi
19541
6ec2e0f5
SDJ
19542 if test $HAVE_FCHDIR = 0; then
19543 case "$gl_cv_func_open_directory_works" in
19544 *yes) ;;
19545 *)
19546 REPLACE_FSTAT=1
19547 ;;
19548 esac
19549 fi
6a29c58e
YQ
19550
19551
6ec2e0f5 19552 if test $REPLACE_FSTAT = 1; then
6a29c58e 19553
3d99e817
AK
19554
19555
19556
3d99e817
AK
19557
19558
19559
19560
6ec2e0f5 19561 gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
3d99e817 19562
c0c3707f
CB
19563 case "$host_os" in
19564 mingw*)
3d99e817
AK
19565
19566
19567
19568
19569
19570
49e4877c 19571
49e4877c 19572
c0c3707f 19573 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
49e4877c 19574
c0c3707f
CB
19575 ;;
19576 esac
49e4877c
PA
19577
19578
c0c3707f
CB
19579 :
19580
19581 fi
6a29c58e
YQ
19582
19583
88b48903 19584
8690e634 19585
a512b375 19586
c0c3707f
CB
19587 GNULIB_FSTAT=1
19588
19589
19590
19591
19592
19593$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
19594
19595
88b48903 19596
88b48903 19597
472fa5ee
SM
19598
19599
19600
19601
19602
6ec2e0f5
SDJ
19603
19604 if test $ac_cv_func_fstatat = no; then
19605 HAVE_FSTATAT=0
19606 else
19607 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
19608$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
d0ac1c44 19609if ${gl_cv_func_fstatat_zero_flag+:} false; then :
6ec2e0f5
SDJ
19610 $as_echo_n "(cached) " >&6
19611else
19612 if test "$cross_compiling" = yes; then :
19613 case "$host_os" in
19614 aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
19615 *) gl_cv_func_fstatat_zero_flag="guessing yes";;
19616 esac
88b48903 19617
8690e634
JK
19618else
19619 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19620/* end confdefs.h. */
8690e634 19621
6ec2e0f5
SDJ
19622 #include <fcntl.h>
19623 #include <sys/stat.h>
19624 int
19625 main (void)
19626 {
19627 struct stat a;
19628 return fstatat (AT_FDCWD, ".", &a, 0) != 0;
19629 }
19630
88b48903
WN
19631_ACEOF
19632if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 19633 gl_cv_func_fstatat_zero_flag=yes
88b48903 19634else
6ec2e0f5 19635 gl_cv_func_fstatat_zero_flag=no
88b48903
WN
19636fi
19637rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19638 conftest.$ac_objext conftest.beam conftest.$ac_ext
19639fi
19640
19641
19642fi
6ec2e0f5
SDJ
19643{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
19644$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
88b48903 19645
6ec2e0f5
SDJ
19646 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
19647 *yes+*yes) ;;
c0c3707f
CB
19648 *) REPLACE_FSTATAT=1 ;;
19649 esac
19650
19651 case $host_os in
19652 solaris*)
19653 REPLACE_FSTATAT=1 ;;
19654 esac
19655
19656 case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
19657 1,*yes)
88b48903 19658
6ec2e0f5 19659$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
88b48903 19660
7a6dbc2f 19661 ;;
6ec2e0f5
SDJ
19662 esac
19663 fi
88b48903 19664
6ec2e0f5 19665 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
88b48903
WN
19666
19667
19668
19669
19670
88b48903 19671
4a626d0a
PA
19672
19673
6ec2e0f5
SDJ
19674 gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
19675
19676 fi
19677
19678
19679
4a626d0a 19680
6ec2e0f5
SDJ
19681
19682 GNULIB_FSTATAT=1
19683
19684
19685
19686
19687
19688$as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
19689
19690
19691
19692
19693
19694
19695
19696
19697 gl_abort_bug=no
4a626d0a
PA
19698 case "$host_os" in
19699 mingw*)
6ec2e0f5 19700 gl_cv_func_getcwd_path_max=yes
4a626d0a
PA
19701 ;;
19702 *)
88b48903 19703
88b48903 19704
88b48903
WN
19705
19706
88b48903 19707
6ec2e0f5
SDJ
19708 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
19709$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
d0ac1c44 19710if ${gl_cv_func_getcwd_path_max+:} false; then :
6ec2e0f5
SDJ
19711 $as_echo_n "(cached) " >&6
19712else
19713 # Arrange for deletion of the temporary directory this test creates.
19714 ac_clean_files="$ac_clean_files confdir3"
19715 if test "$cross_compiling" = yes; then :
b567ca63 19716 # Cross-compilation guesses:
c0c3707f
CB
19717 case "$host_os" in
19718 aix*) # On AIX, it has the AIX bug.
19719 gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
19720 gnu*) # On Hurd, it is 'yes'.
19721 gl_cv_func_getcwd_path_max='guessing yes' ;;
19722 linux* | kfreebsd*)
19723 # On older Linux+glibc it's 'no, but it is partly working',
19724 # on newer Linux+glibc it's 'yes'.
19725 # On Linux+musl libc, it's 'no, but it is partly working'.
19726 # On kFreeBSD+glibc, it's 'no, but it is partly working'.
19727 gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
19728 *) # If we don't know, obey --enable-cross-guesses.
19729 gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
19730 esac
b567ca63 19731
6ec2e0f5
SDJ
19732else
19733 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19734/* end confdefs.h. */
88b48903 19735
6ec2e0f5
SDJ
19736#include <errno.h>
19737#include <stdlib.h>
19738#if HAVE_UNISTD_H
19739# include <unistd.h>
19740#else
19741# include <direct.h>
19742#endif
19743#include <string.h>
19744#include <limits.h>
19745#include <sys/stat.h>
19746#include <sys/types.h>
19747#include <fcntl.h>
88b48903
WN
19748
19749
6ec2e0f5
SDJ
19750/* Arrange to define PATH_MAX, like "pathmax.h" does. */
19751#if HAVE_UNISTD_H
19752# include <unistd.h>
19753#endif
19754#include <limits.h>
19755#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
19756# include <sys/param.h>
19757#endif
19758#if !defined PATH_MAX && defined MAXPATHLEN
19759# define PATH_MAX MAXPATHLEN
19760#endif
19761#ifdef __hpux
19762# undef PATH_MAX
19763# define PATH_MAX 1024
19764#endif
c0c3707f 19765#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
19766# undef PATH_MAX
19767# define PATH_MAX 260
19768#endif
88b48903 19769
88b48903 19770
6ec2e0f5
SDJ
19771#ifndef AT_FDCWD
19772# define AT_FDCWD 0
19773#endif
19774#ifdef ENAMETOOLONG
19775# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
19776#else
19777# define is_ENAMETOOLONG(x) 0
19778#endif
88b48903 19779
6ec2e0f5
SDJ
19780/* Use the getcwd function, not any macro. */
19781#undef getcwd
88b48903 19782
6ec2e0f5
SDJ
19783/* Don't get link errors because mkdir is redefined to rpl_mkdir. */
19784#undef mkdir
88b48903 19785
6ec2e0f5
SDJ
19786#ifndef S_IRWXU
19787# define S_IRWXU 0700
19788#endif
88b48903 19789
6ec2e0f5
SDJ
19790/* The length of this name must be 8. */
19791#define DIR_NAME "confdir3"
19792#define DIR_NAME_LEN 8
19793#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
88b48903 19794
6ec2e0f5
SDJ
19795/* The length of "../". */
19796#define DOTDOTSLASH_LEN 3
88b48903 19797
6ec2e0f5
SDJ
19798/* Leftover bytes in the buffer, to work around library or OS bugs. */
19799#define BUF_SLOP 20
88b48903 19800
6ec2e0f5
SDJ
19801int
19802main ()
19803{
19804#ifndef PATH_MAX
19805 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
19806 at least not on a local file system. And if we were to start worrying
19807 about remote file systems, we'd have to enable the wrapper function
19808 all of the time, just to be safe. That's not worth the cost. */
19809 exit (0);
19810#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
19811 - DIR_NAME_SIZE - BUF_SLOP) \
19812 <= PATH_MAX)
19813 /* FIXME: Assuming there's a system for which this is true,
19814 this should be done in a compile test. */
19815 exit (0);
19816#else
19817 char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
19818 + DIR_NAME_SIZE + BUF_SLOP];
19819 char *cwd = getcwd (buf, PATH_MAX);
19820 size_t initial_cwd_len;
19821 size_t cwd_len;
19822 int fail = 0;
19823 size_t n_chdirs = 0;
88b48903 19824
6ec2e0f5
SDJ
19825 if (cwd == NULL)
19826 exit (10);
88b48903 19827
6ec2e0f5 19828 cwd_len = initial_cwd_len = strlen (cwd);
88b48903 19829
6ec2e0f5
SDJ
19830 while (1)
19831 {
19832 size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
19833 char *c = NULL;
19834
19835 cwd_len += DIR_NAME_SIZE;
19836 /* If mkdir or chdir fails, it could be that this system cannot create
19837 any file with an absolute name longer than PATH_MAX, such as cygwin.
19838 If so, leave fail as 0, because the current working directory can't
c0c3707f
CB
19839 be too long for getcwd if it can't even be created. On Linux with
19840 the 9p file system, mkdir fails with error EINVAL when cwd_len gets
19841 too long; ignore this failure because the getcwd() system call
19842 produces good results whereas the gnulib substitute calls getdents64
19843 which fails with error EPROTO.
19844 For other errors, be pessimistic and consider that as a failure,
19845 too. */
6ec2e0f5
SDJ
19846 if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
19847 {
19848 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
c0c3707f
CB
19849 #ifdef __linux__
19850 if (! (errno == EINVAL))
19851 #endif
19852 fail = 20;
6ec2e0f5
SDJ
19853 break;
19854 }
88b48903 19855
6ec2e0f5
SDJ
19856 if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
19857 {
19858 struct stat sb;
88b48903 19859
6ec2e0f5
SDJ
19860 c = getcwd (buf, PATH_MAX);
19861 if (!c && errno == ENOENT)
19862 {
19863 fail = 11;
19864 break;
19865 }
19866 if (c)
19867 {
19868 fail = 31;
19869 break;
19870 }
19871 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
19872 {
19873 fail = 21;
19874 break;
19875 }
88b48903 19876
6ec2e0f5
SDJ
19877 /* Our replacement needs to be able to stat() long ../../paths,
19878 so generate a path larger than PATH_MAX to check,
19879 avoiding the replacement if we can't stat(). */
19880 c = getcwd (buf, cwd_len + 1);
19881 if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
19882 {
19883 fail = 32;
19884 break;
19885 }
19886 }
88b48903 19887
6ec2e0f5
SDJ
19888 if (dotdot_max <= cwd_len - initial_cwd_len)
19889 {
19890 if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
19891 break;
19892 c = getcwd (buf, cwd_len + 1);
19893 if (!c)
19894 {
19895 if (! (errno == ERANGE || errno == ENOENT
19896 || is_ENAMETOOLONG (errno)))
19897 {
19898 fail = 22;
19899 break;
19900 }
19901 if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
19902 {
19903 fail = 12;
19904 break;
19905 }
19906 }
19907 }
88b48903 19908
6ec2e0f5
SDJ
19909 if (c && strlen (c) != cwd_len)
19910 {
19911 fail = 23;
19912 break;
19913 }
19914 ++n_chdirs;
19915 }
88b48903 19916
6ec2e0f5
SDJ
19917 /* Leaving behind such a deep directory is not polite.
19918 So clean up here, right away, even though the driving
19919 shell script would also clean up. */
19920 {
19921 size_t i;
88b48903 19922
6ec2e0f5
SDJ
19923 /* Try rmdir first, in case the chdir failed. */
19924 rmdir (DIR_NAME);
19925 for (i = 0; i <= n_chdirs; i++)
19926 {
19927 if (chdir ("..") < 0)
19928 break;
19929 if (rmdir (DIR_NAME) != 0)
19930 break;
19931 }
19932 }
88b48903 19933
6ec2e0f5
SDJ
19934 exit (fail);
19935#endif
19936}
88b48903 19937
6ec2e0f5
SDJ
19938_ACEOF
19939if ac_fn_c_try_run "$LINENO"; then :
19940 gl_cv_func_getcwd_path_max=yes
19941else
19942 case $? in
c0c3707f
CB
19943 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
19944 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
19945 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
19946 *) gl_cv_func_getcwd_path_max=no;;
19947 esac
6ec2e0f5
SDJ
19948fi
19949rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19950 conftest.$ac_objext conftest.beam conftest.$ac_ext
19951fi
88b48903 19952
88b48903 19953
6ec2e0f5
SDJ
19954fi
19955{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
19956$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
88b48903 19957
6ec2e0f5
SDJ
19958 case "$gl_cv_func_getcwd_null" in
19959 *yes)
88b48903
WN
19960
19961
472fa5ee
SM
19962
19963
19964
472fa5ee 19965
c0c3707f
CB
19966 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
19967$as_echo_n "checking for getpagesize... " >&6; }
19968if ${gl_cv_func_getpagesize+:} false; then :
19969 $as_echo_n "(cached) " >&6
19970else
19971 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19972/* end confdefs.h. */
19973#include <unistd.h>
19974int
19975main ()
19976{
19977return getpagesize();
19978 ;
19979 return 0;
19980}
472fa5ee 19981
c0c3707f
CB
19982_ACEOF
19983if ac_fn_c_try_link "$LINENO"; then :
19984 gl_cv_func_getpagesize=yes
19985else
19986 gl_cv_func_getpagesize=no
19987fi
19988rm -f core conftest.err conftest.$ac_objext \
19989 conftest$ac_exeext conftest.$ac_ext
472fa5ee 19990
c0c3707f
CB
19991fi
19992{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
19993$as_echo "$gl_cv_func_getpagesize" >&6; }
88b48903 19994
c0c3707f 19995 if test $gl_cv_func_getpagesize = yes; then
88b48903 19996
c0c3707f 19997cat >>confdefs.h <<_ACEOF
7a6dbc2f
SDJ
19998#define HAVE_GETPAGESIZE 1
19999_ACEOF
20000
c0c3707f 20001 fi
6ec2e0f5
SDJ
20002
20003 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5
20004$as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; }
d0ac1c44 20005if ${gl_cv_func_getcwd_abort_bug+:} false; then :
88b48903
WN
20006 $as_echo_n "(cached) " >&6
20007else
6ec2e0f5
SDJ
20008 # Remove any remnants of a previous test.
20009 rm -rf confdir-14B---
20010 # Arrange for deletion of the temporary directory this test creates.
20011 ac_clean_files="$ac_clean_files confdir-14B---"
20012 if test "$cross_compiling" = yes; then :
c0c3707f
CB
20013 case "$host_os" in
20014 # Guess no on musl systems.
20015 *-musl*) gl_cv_func_getcwd_abort_bug="guessing no" ;;
20016 # Guess yes otherwise, even on glibc systems.
20017 *) gl_cv_func_getcwd_abort_bug="guessing yes"
20018 esac
20019
88b48903
WN
20020else
20021 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20022/* end confdefs.h. */
6ec2e0f5
SDJ
20023
20024#include <errno.h>
20025#include <stdlib.h>
20026#if HAVE_UNISTD_H
20027# include <unistd.h>
20028#else /* on Windows with MSVC */
20029# include <direct.h>
20030#endif
20031#include <string.h>
20032#include <sys/stat.h>
20033
20034
20035/* Arrange to define PATH_MAX, like "pathmax.h" does. */
20036#if HAVE_UNISTD_H
20037# include <unistd.h>
20038#endif
20039#include <limits.h>
20040#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
20041# include <sys/param.h>
20042#endif
20043#if !defined PATH_MAX && defined MAXPATHLEN
20044# define PATH_MAX MAXPATHLEN
20045#endif
20046#ifdef __hpux
20047# undef PATH_MAX
20048# define PATH_MAX 1024
20049#endif
c0c3707f 20050#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
20051# undef PATH_MAX
20052# define PATH_MAX 260
20053#endif
20054
20055
20056/* Don't get link errors because mkdir is redefined to rpl_mkdir. */
20057#undef mkdir
20058
20059#ifndef S_IRWXU
20060# define S_IRWXU 0700
20061#endif
20062
20063/* FIXME: skip the run-test altogether on systems without getpagesize. */
20064#if ! HAVE_GETPAGESIZE
20065# define getpagesize() 0
20066#endif
20067
20068/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
20069 the 16kB pagesize on ia64 linux. Those conditions make the code below
20070 trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
20071#define TARGET_LEN (5 * 1024)
88b48903
WN
20072
20073int
20074main ()
20075{
6ec2e0f5
SDJ
20076 char *cwd;
20077 size_t initial_cwd_len;
20078 int fail = 0;
20079
20080 /* The bug is triggered when PATH_MAX < getpagesize (), so skip
20081 this relatively expensive and invasive test if that's not true. */
20082#ifdef PATH_MAX
20083 int bug_possible = PATH_MAX < getpagesize ();
20084#else
20085 int bug_possible = 0;
20086#endif
20087 if (! bug_possible)
20088 return 0;
8690e634 20089
6ec2e0f5
SDJ
20090 cwd = getcwd (NULL, 0);
20091 if (cwd == NULL)
20092 return 2;
20093
20094 initial_cwd_len = strlen (cwd);
20095 free (cwd);
20096
20097 if (1)
20098 {
20099 static char const dir_name[] = "confdir-14B---";
20100 size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
20101 / sizeof dir_name);
20102 size_t d;
20103 for (d = 0; d < desired_depth; d++)
20104 {
20105 if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
20106 {
20107 if (! (errno == ERANGE || errno == ENAMETOOLONG
20108 || errno == ENOENT))
20109 fail = 3; /* Unable to construct deep hierarchy. */
20110 break;
20111 }
20112 }
20113
20114 /* If libc has the bug in question, this invocation of getcwd
20115 results in a failed assertion. */
20116 cwd = getcwd (NULL, 0);
20117 if (cwd == NULL)
20118 fail = 4; /* getcwd didn't assert, but it failed for a long name
20119 where the answer could have been learned. */
20120 free (cwd);
20121
20122 /* Call rmdir first, in case the above chdir failed. */
20123 rmdir (dir_name);
20124 while (0 < d--)
20125 {
20126 if (chdir ("..") < 0)
20127 {
20128 fail = 5;
20129 break;
20130 }
20131 rmdir (dir_name);
20132 }
20133 }
20134
20135 return fail;
8690e634 20136}
6ec2e0f5 20137
8690e634
JK
20138_ACEOF
20139if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20140 gl_cv_func_getcwd_abort_bug=no
8690e634 20141else
c0c3707f
CB
20142 ret=$?
20143 if test $ret -ge 128 || test $ret = 4; then
20144 gl_cv_func_getcwd_abort_bug=yes
20145 else
20146 gl_cv_func_getcwd_abort_bug=no
20147 fi
20148
8690e634
JK
20149fi
20150rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20151 conftest.$ac_objext conftest.beam conftest.$ac_ext
20152fi
20153
20154
20155fi
6ec2e0f5
SDJ
20156{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_abort_bug" >&5
20157$as_echo "$gl_cv_func_getcwd_abort_bug" >&6; }
c0c3707f
CB
20158 case "$gl_cv_func_getcwd_abort_bug" in
20159 *yes)
20160 gl_abort_bug=yes
20161 ;;
20162 *)
20163
20164 ;;
20165 esac
6ec2e0f5
SDJ
20166
20167 ;;
20168 esac
20169 ;;
20170 esac
20171 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 20172 *"no" | *"no, it has the AIX bug") ;;
6ec2e0f5
SDJ
20173 *)
20174
20175$as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
20176
20177 ;;
20178 esac
20179 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 20180 *"no, but it is partly working")
6ec2e0f5
SDJ
20181
20182$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
20183
20184 ;;
c0c3707f 20185 *"yes, but with shorter paths")
6ec2e0f5
SDJ
20186
20187$as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
20188
20189 ;;
20190 esac
20191
20192 if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
20193 || test $gl_cv_func_getcwd_posix_signature != yes \
20194 || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
20195 || test $gl_abort_bug = yes; then
20196 REPLACE_GETCWD=1
8690e634
JK
20197 fi
20198
6ec2e0f5 20199 if test $REPLACE_GETCWD = 1; then
8690e634
JK
20200
20201
8690e634
JK
20202
20203
20204
20205
20206
20207
6ec2e0f5 20208 gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
8690e634
JK
20209
20210
8690e634
JK
20211
20212
6ec2e0f5
SDJ
20213 :
20214
20215 fi
20216
8690e634
JK
20217
20218cat >>confdefs.h <<_ACEOF
6ec2e0f5 20219#define GNULIB_GETCWD 1
8690e634
JK
20220_ACEOF
20221
20222
8690e634 20223
8690e634
JK
20224
20225
c971b7fa 20226
c971b7fa 20227
6ec2e0f5
SDJ
20228 GNULIB_GETCWD=1
20229
20230
20231
20232
20233
20234$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
20235
c971b7fa 20236
c971b7fa 20237
c971b7fa 20238
c971b7fa 20239
c971b7fa 20240
c971b7fa 20241
c971b7fa 20242
6ec2e0f5
SDJ
20243 case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
20244 *yes,yes) ;;
20245 *)
20246 REPLACE_GETCWD=1
20247 ;;
20248 esac
c971b7fa 20249
6ec2e0f5 20250 if test $REPLACE_GETCWD = 1; then
c971b7fa 20251
c971b7fa
PA
20252
20253
c971b7fa
PA
20254
20255
c971b7fa 20256
c971b7fa 20257
c971b7fa 20258
6ec2e0f5 20259 gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
c971b7fa 20260
6ec2e0f5 20261 fi
c971b7fa 20262
c971b7fa 20263
c971b7fa 20264
c971b7fa 20265
8690e634 20266
6ec2e0f5 20267 GNULIB_GETCWD=1
c971b7fa 20268
88b48903
WN
20269
20270
20271
88b48903 20272
6ec2e0f5 20273$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
88b48903 20274
88b48903
WN
20275
20276
20277
6ec2e0f5
SDJ
20278
20279
20280
20281
20282 if test $ac_cv_func_getdtablesize = yes &&
20283 test $ac_cv_have_decl_getdtablesize = yes; then
6ec2e0f5
SDJ
20284 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
20285$as_echo_n "checking whether getdtablesize works... " >&6; }
d0ac1c44 20286if ${gl_cv_func_getdtablesize_works+:} false; then :
88b48903
WN
20287 $as_echo_n "(cached) " >&6
20288else
c0c3707f
CB
20289 case "$host_os" in
20290 vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
20291 *)
20292 if test "$cross_compiling" = yes; then :
88b48903 20293 case "$host_os" in
c0c3707f
CB
20294 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
20295 gl_cv_func_getdtablesize_works="guessing no" ;;
20296 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
20297 esac
20298
88b48903
WN
20299else
20300 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20301/* end confdefs.h. */
20302
c0c3707f 20303 #include <unistd.h>
6ec2e0f5
SDJ
20304int
20305main ()
88b48903 20306{
6ec2e0f5 20307int size = getdtablesize();
c0c3707f
CB
20308 if (dup2 (0, getdtablesize()) != -1)
20309 return 1;
20310 if (size != getdtablesize())
20311 return 2;
6ec2e0f5
SDJ
20312
20313 ;
20314 return 0;
88b48903
WN
20315}
20316_ACEOF
20317if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20318 gl_cv_func_getdtablesize_works=yes
88b48903 20319else
6ec2e0f5 20320 gl_cv_func_getdtablesize_works=no
88b48903
WN
20321fi
20322rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20323 conftest.$ac_objext conftest.beam conftest.$ac_ext
20324fi
20325
c0c3707f
CB
20326 ;;
20327 esac
88b48903
WN
20328
20329fi
6ec2e0f5
SDJ
20330{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
20331$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
20332 case "$gl_cv_func_getdtablesize_works" in
c0c3707f 20333 *yes | "no (limitation)") ;;
6ec2e0f5 20334 *) REPLACE_GETDTABLESIZE=1 ;;
88b48903
WN
20335 esac
20336 else
6ec2e0f5 20337 HAVE_GETDTABLESIZE=0
88b48903
WN
20338 fi
20339
6ec2e0f5 20340 if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
88b48903
WN
20341
20342
20343
20344
20345
20346
20347
20348
6ec2e0f5 20349 gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
88b48903 20350
6ec2e0f5 20351 :
88b48903
WN
20352 fi
20353
20354
20355
20356
20357
6ec2e0f5 20358 GNULIB_GETDTABLESIZE=1
88b48903
WN
20359
20360
20361
88b48903 20362
88b48903 20363
6ec2e0f5 20364$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
88b48903 20365
88b48903 20366
88b48903 20367
88b48903 20368
88b48903 20369
88b48903 20370
88b48903 20371
88b48903
WN
20372
20373
6ec2e0f5
SDJ
20374 if test $ac_cv_have_decl_getlogin_r = no; then
20375 HAVE_DECL_GETLOGIN_R=0
20376 fi
88b48903 20377
88b48903 20378
6ec2e0f5
SDJ
20379 if test $ac_cv_func_getlogin_r = no; then
20380 HAVE_GETLOGIN_R=0
20381 else
20382 HAVE_GETLOGIN_R=1
20383
20384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5
20385$as_echo_n "checking whether getlogin_r works with small buffers... " >&6; }
d0ac1c44 20386if ${gl_cv_func_getlogin_r_works+:} false; then :
6ec2e0f5
SDJ
20387 $as_echo_n "(cached) " >&6
20388else
88b48903 20389
6ec2e0f5 20390 case "$host_os" in
c0c3707f
CB
20391 # Guess no on Mac OS X, OSF/1.
20392 darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;;
20393 # Guess yes otherwise.
20394 *) gl_cv_func_getlogin_r_works="guessing yes" ;;
6ec2e0f5
SDJ
20395 esac
20396 if test "$cross_compiling" = yes; then :
20397 :
88b48903
WN
20398else
20399 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20400/* end confdefs.h. */
20401
6ec2e0f5 20402#include <stddef.h>
c0c3707f 20403#include <string.h>
6ec2e0f5
SDJ
20404#include <unistd.h>
20405#if !HAVE_DECL_GETLOGIN_R
88b48903 20406extern
6ec2e0f5 20407# ifdef __cplusplus
88b48903 20408"C"
6ec2e0f5
SDJ
20409# endif
20410int getlogin_r (char *, size_t);
88b48903 20411#endif
6ec2e0f5
SDJ
20412int
20413main (void)
88b48903
WN
20414{
20415 int result = 0;
6ec2e0f5
SDJ
20416 char buf[100];
20417
20418 if (getlogin_r (buf, 0) == 0)
c0c3707f 20419 result |= 1;
6ec2e0f5 20420 if (getlogin_r (buf, 1) == 0)
c0c3707f
CB
20421 result |= 2;
20422 if (getlogin_r (buf, 100) == 0)
20423 {
20424 size_t n = strlen (buf);
20425 if (getlogin_r (buf, n) == 0)
20426 result |= 4;
20427 }
88b48903
WN
20428 return result;
20429}
20430_ACEOF
20431if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20432 gl_cv_func_getlogin_r_works=yes
88b48903 20433else
c0c3707f 20434 gl_cv_func_getlogin_r_works=no
88b48903
WN
20435fi
20436rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20437 conftest.$ac_objext conftest.beam conftest.$ac_ext
20438fi
20439
20440
4a626d0a 20441fi
6ec2e0f5
SDJ
20442{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5
20443$as_echo "$gl_cv_func_getlogin_r_works" >&6; }
20444 case "$gl_cv_func_getlogin_r_works" in
20445 *yes) ;;
20446 *) REPLACE_GETLOGIN_R=1 ;;
20447 esac
20448 fi
20449
20450 if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then
20451
20452
20453
20454
20455
20456
20457
20458
20459 gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext"
4a626d0a 20460
4a626d0a 20461
4a626d0a 20462
4a626d0a 20463
4a626d0a
PA
20464 fi
20465
20466
4a626d0a
PA
20467
20468
20469
6ec2e0f5 20470 GNULIB_GETLOGIN_R=1
4a626d0a
PA
20471
20472
20473
20474
20475
6ec2e0f5 20476$as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h
4a626d0a 20477
4a626d0a
PA
20478
20479
20480
20481
472fa5ee 20482
4a626d0a 20483
6ec2e0f5
SDJ
20484 ac_found=0
20485 ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
20486"
d0ac1c44 20487if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
6ec2e0f5
SDJ
20488 ac_have_decl=1
20489else
20490 ac_have_decl=0
20491fi
20492
20493cat >>confdefs.h <<_ACEOF
20494#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
20495_ACEOF
20496if test $ac_have_decl = 1; then :
20497 ac_found=1
20498fi
20499
20500 ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
20501"
d0ac1c44 20502if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
6ec2e0f5
SDJ
20503 ac_have_decl=1
20504else
20505 ac_have_decl=0
20506fi
20507
20508cat >>confdefs.h <<_ACEOF
20509#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
20510_ACEOF
20511if test $ac_have_decl = 1; then :
20512 ac_found=1
20513fi
4a626d0a 20514
6ec2e0f5
SDJ
20515 ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
20516"
d0ac1c44 20517if test "x$ac_cv_have_decl___argv" = xyes; then :
6ec2e0f5
SDJ
20518 ac_have_decl=1
20519else
20520 ac_have_decl=0
20521fi
4a626d0a 20522
6ec2e0f5
SDJ
20523cat >>confdefs.h <<_ACEOF
20524#define HAVE_DECL___ARGV $ac_have_decl
20525_ACEOF
20526if test $ac_have_decl = 1; then :
20527 ac_found=1
20528fi
4a626d0a
PA
20529
20530
6ec2e0f5
SDJ
20531 # Incur the cost of this test only if none of the above worked.
20532 if test $ac_found = 0; then
20533 # On OpenBSD 5.1, using the global __progname variable appears to be
20534 # the only way to implement getprogname.
20535 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
20536$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
d0ac1c44 20537if ${gl_cv_var___progname+:} false; then :
6ec2e0f5
SDJ
20538 $as_echo_n "(cached) " >&6
20539else
4a626d0a 20540
6ec2e0f5
SDJ
20541 gl_cv_var___progname=
20542 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20543/* end confdefs.h. */
20544extern char *__progname;
20545int
20546main ()
20547{
20548return *__progname;
20549
20550 ;
20551 return 0;
20552}
20553_ACEOF
20554if ac_fn_c_try_link "$LINENO"; then :
20555 gl_cv_var___progname=yes
20556
20557fi
20558rm -f core conftest.err conftest.$ac_objext \
20559 conftest$ac_exeext conftest.$ac_ext
20560
20561
20562fi
20563{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
20564$as_echo "$gl_cv_var___progname" >&6; }
20565 if test "$gl_cv_var___progname" = yes; then
20566
20567$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
20568
20569 fi
20570 fi
4a626d0a
PA
20571
20572
20573
20574
20575
698be2d8
CB
20576 if test "$ac_cv_func_getrandom" != yes; then
20577 HAVE_GETRANDOM=0
20578 else
20579 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getrandom is compatible with its GNU+BSD signature" >&5
20580$as_echo_n "checking whether getrandom is compatible with its GNU+BSD signature... " >&6; }
20581if ${gl_cv_func_getrandom_ok+:} false; then :
20582 $as_echo_n "(cached) " >&6
20583else
20584 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20585/* end confdefs.h. */
20586/* Additional includes are needed before <sys/random.h> on Mac OS X. */
20587 #include <sys/types.h>
20588 #include <stdlib.h>
20589 #include <sys/random.h>
20590 ssize_t getrandom (void *, size_t, unsigned int);
20591
20592int
20593main ()
20594{
20595
20596 ;
20597 return 0;
20598}
20599
20600_ACEOF
20601if ac_fn_c_try_compile "$LINENO"; then :
20602 gl_cv_func_getrandom_ok=yes
20603else
20604 gl_cv_func_getrandom_ok=no
20605fi
20606rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20607
20608fi
20609{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getrandom_ok" >&5
20610$as_echo "$gl_cv_func_getrandom_ok" >&6; }
20611 if test $gl_cv_func_getrandom_ok = no; then
20612 REPLACE_GETRANDOM=1
20613 fi
20614 fi
20615
20616 case "$host_os" in
20617 mingw*)
20618 for ac_header in bcrypt.h
20619do :
20620 ac_fn_c_check_header_mongrel "$LINENO" "bcrypt.h" "ac_cv_header_bcrypt_h" "$ac_includes_default"
20621if test "x$ac_cv_header_bcrypt_h" = xyes; then :
20622 cat >>confdefs.h <<_ACEOF
20623#define HAVE_BCRYPT_H 1
20624_ACEOF
20625
20626fi
20627
20628done
20629
20630 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the bcrypt library is guaranteed to be present" >&5
20631$as_echo_n "checking whether the bcrypt library is guaranteed to be present... " >&6; }
20632if ${gl_cv_lib_assume_bcrypt+:} false; then :
20633 $as_echo_n "(cached) " >&6
20634else
20635 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20636/* end confdefs.h. */
20637#include <windows.h>
20638int
20639main ()
20640{
20641#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
20642 cannot assume it
20643 #endif
20644
20645 ;
20646 return 0;
20647}
20648
20649_ACEOF
20650if ac_fn_c_try_compile "$LINENO"; then :
20651 gl_cv_lib_assume_bcrypt=yes
20652else
20653 gl_cv_lib_assume_bcrypt=no
20654fi
20655rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20656
20657fi
20658{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_assume_bcrypt" >&5
20659$as_echo "$gl_cv_lib_assume_bcrypt" >&6; }
20660 if test $gl_cv_lib_assume_bcrypt = yes; then
20661
20662$as_echo "#define HAVE_LIB_BCRYPT 1" >>confdefs.h
20663
20664 LIB_GETRANDOM='-lbcrypt'
20665 else
20666 LIB_GETRANDOM='-ladvapi32'
20667 fi
20668 ;;
20669 *)
20670 LIB_GETRANDOM= ;;
20671 esac
20672
20673
20674 if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
20675
20676
20677
20678
20679
20680
20681
20682
20683 gl_LIBOBJS="$gl_LIBOBJS getrandom.$ac_objext"
20684
20685 fi
20686
20687
20688
20689
20690
20691 GNULIB_GETRANDOM=1
20692
20693
20694
20695
20696
20697$as_echo "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.h
20698
20699
20700
20701
20702
20703
20704
4a626d0a
PA
20705
20706
20707
472fa5ee 20708
4a626d0a
PA
20709
20710 gl_gettimeofday_timezone=void
20711 if test $ac_cv_func_gettimeofday != yes; then
20712 HAVE_GETTIMEOFDAY=0
20713 else
20714
20715
20716
c0c3707f 20717
4a626d0a
PA
20718 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
20719$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
d0ac1c44 20720if ${gl_cv_func_gettimeofday_clobber+:} false; then :
4a626d0a
PA
20721 $as_echo_n "(cached) " >&6
20722else
20723 if test "$cross_compiling" = yes; then :
20724 # When cross-compiling:
20725 case "$host_os" in
c0c3707f
CB
20726 # Guess all is fine on glibc systems.
20727 *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
20728 # Guess all is fine on musl systems.
20729 *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
20730 # Guess no on native Windows.
20731 mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
20732 # If we don't know, obey --enable-cross-guesses.
20733 *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;;
4a626d0a
PA
20734 esac
20735
20736else
20737 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20738/* end confdefs.h. */
20739#include <string.h>
20740 #include <sys/time.h>
20741 #include <time.h>
20742 #include <stdlib.h>
20743
20744int
20745main ()
20746{
20747
20748 time_t t = 0;
20749 struct tm *lt;
20750 struct tm saved_lt;
20751 struct timeval tv;
20752 lt = localtime (&t);
20753 saved_lt = *lt;
20754 gettimeofday (&tv, NULL);
20755 return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
20756
20757 ;
20758 return 0;
20759}
20760_ACEOF
20761if ac_fn_c_try_run "$LINENO"; then :
20762 gl_cv_func_gettimeofday_clobber=no
20763else
20764 gl_cv_func_gettimeofday_clobber=yes
20765fi
20766rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20767 conftest.$ac_objext conftest.beam conftest.$ac_ext
20768fi
20769
20770fi
20771{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
20772$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
20773
20774 case "$gl_cv_func_gettimeofday_clobber" in
20775 *yes)
20776 REPLACE_GETTIMEOFDAY=1
20777
c0c3707f 20778$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
4a626d0a 20779
5e8754f9 20780
c0c3707f
CB
20781
20782
20783 NEED_LOCALTIME_BUFFER=1
20784 REPLACE_GMTIME=1
20785 REPLACE_LOCALTIME=1
5e8754f9 20786
4a626d0a
PA
20787 ;;
20788 esac
20789
20790 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
20791$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
d0ac1c44 20792if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
4a626d0a
PA
20793 $as_echo_n "(cached) " >&6
20794else
20795 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20796/* end confdefs.h. */
20797#include <sys/time.h>
20798 struct timeval c;
20799 int gettimeofday (struct timeval *restrict, void *restrict);
20800
20801int
20802main ()
20803{
20804/* glibc uses struct timezone * rather than the POSIX void *
20805 if _GNU_SOURCE is defined. However, since the only portable
20806 use of gettimeofday uses NULL as the second parameter, and
20807 since the glibc definition is actually more typesafe, it is
20808 not worth wrapping this to get a compliant signature. */
20809 int (*f) (struct timeval *restrict, void *restrict)
20810 = gettimeofday;
20811 int x = f (&c, 0);
20812 return !(x | c.tv_sec | c.tv_usec);
20813
20814 ;
20815 return 0;
20816}
20817_ACEOF
20818if ac_fn_c_try_compile "$LINENO"; then :
20819 gl_cv_func_gettimeofday_posix_signature=yes
20820else
20821 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20822/* end confdefs.h. */
20823#include <sys/time.h>
20824int gettimeofday (struct timeval *restrict, struct timezone *restrict);
20825
20826int
20827main ()
20828{
20829
20830 ;
20831 return 0;
20832}
20833_ACEOF
20834if ac_fn_c_try_compile "$LINENO"; then :
20835 gl_cv_func_gettimeofday_posix_signature=almost
20836else
20837 gl_cv_func_gettimeofday_posix_signature=no
20838fi
20839rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20840fi
20841rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20842fi
20843{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
20844$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
20845 if test $gl_cv_func_gettimeofday_posix_signature = almost; then
20846 gl_gettimeofday_timezone='struct timezone'
20847 elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
20848 REPLACE_GETTIMEOFDAY=1
20849 fi
20850 if test $REPLACE_STRUCT_TIMEVAL = 1; then
20851 REPLACE_GETTIMEOFDAY=1
20852 fi
c0c3707f
CB
20853 case "$host_os" in
20854 mingw*) REPLACE_GETTIMEOFDAY=1 ;;
20855 esac
4a626d0a
PA
20856 fi
20857
20858cat >>confdefs.h <<_ACEOF
c0c3707f
CB
20859#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
20860_ACEOF
88b48903
WN
20861
20862
c0c3707f 20863 if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
88b48903 20864
6ec2e0f5 20865
6ec2e0f5 20866
6ec2e0f5 20867
6ec2e0f5 20868
6ec2e0f5
SDJ
20869
20870
6ec2e0f5 20871
c0c3707f 20872 gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
6ec2e0f5 20873
c0c3707f 20874 :
5e8754f9 20875 fi
6ec2e0f5
SDJ
20876
20877
20878
6ec2e0f5
SDJ
20879
20880
5e8754f9 20881 GNULIB_GETTIMEOFDAY=1
6ec2e0f5
SDJ
20882
20883
20884
7a6dbc2f
SDJ
20885
20886
5e8754f9 20887$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
6ec2e0f5
SDJ
20888
20889
20890
6ec2e0f5 20891
6ec2e0f5 20892
6ec2e0f5
SDJ
20893
20894
c0c3707f
CB
20895 if test $ac_cv_func_glob = no; then
20896 HAVE_GLOB=0
20897 else
20898
20899 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5
20900$as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; }
20901if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then :
6ec2e0f5
SDJ
20902 $as_echo_n "(cached) " >&6
20903else
20904 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20905/* end confdefs.h. */
20906#include <gnu-versions.h>
c0c3707f 20907char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];
6ec2e0f5
SDJ
20908_ACEOF
20909if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 20910 gl_cv_gnu_glob_interface_version_1_2=yes
6ec2e0f5 20911else
c0c3707f 20912 gl_cv_gnu_glob_interface_version_1_2=no
6ec2e0f5
SDJ
20913fi
20914rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20915fi
c0c3707f
CB
20916{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5
20917$as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; }
20918 if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then
20919 REPLACE_GLOB=1
6ec2e0f5 20920 fi
6ec2e0f5 20921
c0c3707f
CB
20922 if test $REPLACE_GLOB = 0; then
20923 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5
6ec2e0f5 20924$as_echo_n "checking whether glob lists broken symlinks... " >&6; }
d0ac1c44 20925if ${gl_cv_glob_lists_symlinks+:} false; then :
6ec2e0f5
SDJ
20926 $as_echo_n "(cached) " >&6
20927else
c0c3707f
CB
20928 if test $cross_compiling != yes; then
20929 if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
20930 gl_cv_glob_lists_symlinks=maybe
20931 else
20932 # If we can't make a symlink, then we cannot test this issue. Be
20933 # pessimistic about this.
20934 gl_cv_glob_lists_symlinks=no
20935 fi
20936 if test $gl_cv_glob_lists_symlinks = maybe; then
20937 if test "$cross_compiling" = yes; then :
20938 :
5e8754f9 20939
6ec2e0f5
SDJ
20940else
20941 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20942/* end confdefs.h. */
6ec2e0f5 20943#include <stddef.h>
c0c3707f 20944 #include <glob.h>
6ec2e0f5
SDJ
20945int
20946main ()
20947{
20948glob_t found;
c0c3707f
CB
20949 if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
20950 return 1;
698be2d8 20951 globfree (&found);
c0c3707f 20952
6ec2e0f5
SDJ
20953 ;
20954 return 0;
20955}
4a626d0a 20956_ACEOF
6ec2e0f5
SDJ
20957if ac_fn_c_try_run "$LINENO"; then :
20958 gl_cv_glob_lists_symlinks=yes
20959else
20960 gl_cv_glob_lists_symlinks=no
20961fi
20962rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20963 conftest.$ac_objext conftest.beam conftest.$ac_ext
20964fi
88b48903 20965
c0c3707f
CB
20966 fi
20967 rm -f conf$$-globtest
20968 else
20969 gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
20970 fi
20971
4a626d0a 20972fi
6ec2e0f5
SDJ
20973{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5
20974$as_echo "$gl_cv_glob_lists_symlinks" >&6; }
c0c3707f
CB
20975 case "$gl_cv_glob_lists_symlinks" in
20976 *yes) ;;
20977 *) REPLACE_GLOB=1 ;;
20978 esac
20979 fi
20980
20981 fi
88b48903 20982
c0c3707f
CB
20983 if test $ac_cv_func_glob_pattern_p = no; then
20984 HAVE_GLOB_PATTERN_P=0
20985 else
20986 if test $REPLACE_GLOB = 1; then
20987 REPLACE_GLOB_PATTERN_P=1
6ec2e0f5
SDJ
20988 fi
20989 fi
4a626d0a 20990
c0c3707f 20991 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
4a626d0a 20992
88b48903 20993
c0c3707f 20994 GLOB_H='glob.h'
6ec2e0f5
SDJ
20995 if test -n "$GLOB_H"; then
20996 GL_GENERATE_GLOB_H_TRUE=
20997 GL_GENERATE_GLOB_H_FALSE='#'
20998else
20999 GL_GENERATE_GLOB_H_TRUE='#'
21000 GL_GENERATE_GLOB_H_FALSE=
21001fi
88b48903 21002
88b48903 21003
c0c3707f
CB
21004 fi
21005
21006 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
472fa5ee
SM
21007
21008
21009
21010
21011
21012
21013
21014
21015 gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext"
21016
21017
21018
7a6dbc2f
SDJ
21019
21020
21021
472fa5ee 21022
472fa5ee 21023
88b48903 21024
c0c3707f 21025 gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext"
88b48903
WN
21026
21027
21028
725e2999
JB
21029
21030
21031
c0c3707f
CB
21032 fi
21033 if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then
21034
725e2999
JB
21035
21036
21037
21038
21039
21040
21041
c0c3707f 21042 gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext"
725e2999
JB
21043
21044 fi
21045
725e2999
JB
21046
21047
21048
21049
c0c3707f
CB
21050 GNULIB_GLOB=1
21051
21052
21053
21054
21055
21056$as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h
21057
21058
725e2999
JB
21059
21060
21061
5df4cba6
SM
21062 LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
21063
21064
725e2999 21065
725e2999
JB
21066
21067
21068
21069
725e2999 21070
c0c3707f
CB
21071 HAVE_INET_NTOP=1
21072 INET_NTOP_LIB=
725e2999
JB
21073
21074
21075
21076
21077 if test $ac_cv_header_sys_socket_h != yes; then
21078 for ac_header in winsock2.h
21079do :
21080 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
21081if test "x$ac_cv_header_winsock2_h" = xyes; then :
21082 cat >>confdefs.h <<_ACEOF
21083#define HAVE_WINSOCK2_H 1
21084_ACEOF
21085
21086fi
21087
21088done
21089
21090 fi
21091 if test "$ac_cv_header_winsock2_h" = yes; then
21092 HAVE_WINSOCK2_H=1
21093 UNISTD_H_HAVE_WINSOCK2_H=1
21094 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
21095 else
21096 HAVE_WINSOCK2_H=0
21097 fi
21098
21099
21100 if test $HAVE_WINSOCK2_H = 1; then
c0c3707f 21101 REPLACE_INET_NTOP=1
725e2999
JB
21102 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
21103"
21104if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
21105 ac_have_decl=1
21106else
21107 ac_have_decl=0
21108fi
21109
21110cat >>confdefs.h <<_ACEOF
21111#define HAVE_DECL_INET_NTOP $ac_have_decl
21112_ACEOF
21113
21114 if test $ac_cv_have_decl_inet_ntop = yes; then
725e2999
JB
21115 INET_NTOP_LIB="-lws2_32"
21116 else
21117 HAVE_DECL_INET_NTOP=0
725e2999
JB
21118 fi
21119 else
21120 gl_save_LIBS=$LIBS
21121 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
21122$as_echo_n "checking for library containing inet_ntop... " >&6; }
21123if ${ac_cv_search_inet_ntop+:} false; then :
21124 $as_echo_n "(cached) " >&6
21125else
21126 ac_func_search_save_LIBS=$LIBS
21127cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21128/* end confdefs.h. */
21129
21130/* Override any GCC internal prototype to avoid an error.
21131 Use char because int might match the return type of a GCC
21132 builtin and then its argument prototype would still apply. */
21133#ifdef __cplusplus
21134extern "C"
21135#endif
21136char inet_ntop ();
21137int
21138main ()
21139{
21140return inet_ntop ();
21141 ;
21142 return 0;
21143}
21144_ACEOF
c0c3707f 21145for ac_lib in '' nsl resolv network; do
725e2999
JB
21146 if test -z "$ac_lib"; then
21147 ac_res="none required"
21148 else
21149 ac_res=-l$ac_lib
21150 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
21151 fi
21152 if ac_fn_c_try_link "$LINENO"; then :
21153 ac_cv_search_inet_ntop=$ac_res
21154fi
21155rm -f core conftest.err conftest.$ac_objext \
21156 conftest$ac_exeext
21157 if ${ac_cv_search_inet_ntop+:} false; then :
21158 break
21159fi
21160done
21161if ${ac_cv_search_inet_ntop+:} false; then :
21162
21163else
21164 ac_cv_search_inet_ntop=no
21165fi
21166rm conftest.$ac_ext
21167LIBS=$ac_func_search_save_LIBS
21168fi
21169{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
21170$as_echo "$ac_cv_search_inet_ntop" >&6; }
21171ac_res=$ac_cv_search_inet_ntop
21172if test "$ac_res" != no; then :
21173 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
21174
21175else
21176 for ac_func in inet_ntop
21177do :
21178 ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
21179if test "x$ac_cv_func_inet_ntop" = xyes; then :
21180 cat >>confdefs.h <<_ACEOF
21181#define HAVE_INET_NTOP 1
21182_ACEOF
21183
21184fi
21185done
21186
21187 if test $ac_cv_func_inet_ntop = no; then
21188 HAVE_INET_NTOP=0
21189 fi
21190
21191fi
21192
21193 LIBS=$gl_save_LIBS
21194
21195 if test "$ac_cv_search_inet_ntop" != "no" \
21196 && test "$ac_cv_search_inet_ntop" != "none required"; then
21197 INET_NTOP_LIB="$ac_cv_search_inet_ntop"
21198 fi
21199
21200
725e2999
JB
21201 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
21202 #if HAVE_NETDB_H
21203 # include <netdb.h>
21204 #endif
21205
21206"
21207if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
21208 ac_have_decl=1
21209else
21210 ac_have_decl=0
21211fi
21212
21213cat >>confdefs.h <<_ACEOF
21214#define HAVE_DECL_INET_NTOP $ac_have_decl
21215_ACEOF
21216
21217 if test $ac_cv_have_decl_inet_ntop = no; then
21218 HAVE_DECL_INET_NTOP=0
21219 fi
21220 fi
21221
21222
21223 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
21224
21225
21226
21227
21228
21229
21230
7a6dbc2f 21231
725e2999 21232 gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext"
7a6dbc2f
SDJ
21233
21234
21235
7a6dbc2f 21236
725e2999 21237 fi
7a6dbc2f
SDJ
21238
21239
21240
21241
7a6dbc2f 21242
725e2999
JB
21243 GNULIB_INET_NTOP=1
21244
7a6dbc2f
SDJ
21245
21246
49e4877c
PA
21247
21248
88b48903
WN
21249
21250
21251
21252
21253 PRIPTR_PREFIX=
21254 if test -n "$STDINT_H"; then
21255 PRIPTR_PREFIX='"l"'
21256 else
21257 for glpfx in '' l ll I64; do
21258 case $glpfx in
21259 '') gltype1='int';;
21260 l) gltype1='long int';;
21261 ll) gltype1='long long int';;
21262 I64) gltype1='__int64';;
21263 esac
21264 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21265/* end confdefs.h. */
21266#include <stdint.h>
21267 extern intptr_t foo;
21268 extern $gltype1 foo;
21269int
21270main ()
21271{
21272
21273 ;
21274 return 0;
21275}
21276_ACEOF
21277if ac_fn_c_try_compile "$LINENO"; then :
21278 PRIPTR_PREFIX='"'$glpfx'"'
21279fi
21280rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21281 test -n "$PRIPTR_PREFIX" && break
21282 done
21283 fi
21284
21285
21286
21287 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
21288$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
d0ac1c44 21289if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
88b48903
WN
21290 $as_echo_n "(cached) " >&6
21291else
21292 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21293/* end confdefs.h. */
21294/* Work also in C++ mode. */
21295 #define __STDC_LIMIT_MACROS 1
21296
21297 /* Work if build is not clean. */
21298 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21299
21300 #include <limits.h>
21301 #if HAVE_STDINT_H
21302 #include <stdint.h>
21303 #endif
21304
21305 #if defined INT32_MAX && defined INTMAX_MAX
21306 #define CONDITION (INT32_MAX < INTMAX_MAX)
88b48903 21307 #else
5df4cba6 21308 #define CONDITION (sizeof (int) < sizeof (long long int))
88b48903
WN
21309 #endif
21310 int test[CONDITION ? 1 : -1];
21311int
21312main ()
21313{
21314
21315 ;
21316 return 0;
21317}
21318_ACEOF
21319if ac_fn_c_try_compile "$LINENO"; then :
21320 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
21321else
21322 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
21323fi
21324rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21325fi
21326{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
21327$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
21328 if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
21329 INT32_MAX_LT_INTMAX_MAX=1;
21330 else
21331 INT32_MAX_LT_INTMAX_MAX=0;
21332 fi
21333
21334
21335 if test $APPLE_UNIVERSAL_BUILD = 0; then
21336
21337 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
21338$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
d0ac1c44 21339if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
88b48903
WN
21340 $as_echo_n "(cached) " >&6
21341else
21342 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21343/* end confdefs.h. */
21344/* Work also in C++ mode. */
21345 #define __STDC_LIMIT_MACROS 1
21346
21347 /* Work if build is not clean. */
21348 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21349
21350 #include <limits.h>
21351 #if HAVE_STDINT_H
21352 #include <stdint.h>
21353 #endif
21354
21355 #if defined INT64_MAX
21356 #define CONDITION (INT64_MAX == LONG_MAX)
88b48903 21357 #else
5df4cba6 21358 #define CONDITION (sizeof (long long int) == sizeof (long int))
88b48903
WN
21359 #endif
21360 int test[CONDITION ? 1 : -1];
21361int
21362main ()
21363{
21364
21365 ;
21366 return 0;
21367}
21368_ACEOF
21369if ac_fn_c_try_compile "$LINENO"; then :
21370 gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
21371else
21372 gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
21373fi
21374rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21375fi
21376{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
21377$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
21378 if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
21379 INT64_MAX_EQ_LONG_MAX=1;
21380 else
21381 INT64_MAX_EQ_LONG_MAX=0;
21382 fi
21383
21384
21385 else
21386 INT64_MAX_EQ_LONG_MAX=-1
21387 fi
21388
21389 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
21390$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
d0ac1c44 21391if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
88b48903
WN
21392 $as_echo_n "(cached) " >&6
21393else
21394 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21395/* end confdefs.h. */
21396/* Work also in C++ mode. */
21397 #define __STDC_LIMIT_MACROS 1
21398
21399 /* Work if build is not clean. */
21400 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21401
21402 #include <limits.h>
21403 #if HAVE_STDINT_H
21404 #include <stdint.h>
21405 #endif
21406
21407 #if defined UINT32_MAX && defined UINTMAX_MAX
21408 #define CONDITION (UINT32_MAX < UINTMAX_MAX)
88b48903 21409 #else
5df4cba6 21410 #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
88b48903
WN
21411 #endif
21412 int test[CONDITION ? 1 : -1];
21413int
21414main ()
21415{
21416
21417 ;
21418 return 0;
21419}
21420_ACEOF
21421if ac_fn_c_try_compile "$LINENO"; then :
21422 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
21423else
21424 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
21425fi
21426rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21427fi
21428{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
21429$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
21430 if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
21431 UINT32_MAX_LT_UINTMAX_MAX=1;
21432 else
21433 UINT32_MAX_LT_UINTMAX_MAX=0;
21434 fi
21435
21436
21437 if test $APPLE_UNIVERSAL_BUILD = 0; then
21438
21439 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
21440$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
d0ac1c44 21441if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
88b48903
WN
21442 $as_echo_n "(cached) " >&6
21443else
21444 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21445/* end confdefs.h. */
21446/* Work also in C++ mode. */
21447 #define __STDC_LIMIT_MACROS 1
21448
21449 /* Work if build is not clean. */
21450 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21451
21452 #include <limits.h>
21453 #if HAVE_STDINT_H
21454 #include <stdint.h>
21455 #endif
21456
21457 #if defined UINT64_MAX
21458 #define CONDITION (UINT64_MAX == ULONG_MAX)
88b48903 21459 #else
5df4cba6 21460 #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
88b48903
WN
21461 #endif
21462 int test[CONDITION ? 1 : -1];
21463int
21464main ()
21465{
21466
21467 ;
21468 return 0;
21469}
21470_ACEOF
21471if ac_fn_c_try_compile "$LINENO"; then :
21472 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
21473else
21474 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
21475fi
21476rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21477fi
21478{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
21479$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
21480 if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
21481 UINT64_MAX_EQ_ULONG_MAX=1;
21482 else
21483 UINT64_MAX_EQ_ULONG_MAX=0;
21484 fi
21485
21486
21487 else
21488 UINT64_MAX_EQ_ULONG_MAX=-1
21489 fi
21490
21491
21492
21493
21494
698be2d8
CB
21495
21496
21497
21498 if test $ac_cv_func_isblank = no; then
21499 HAVE_ISBLANK=0
21500 fi
21501
21502 if test $HAVE_ISBLANK = 0; then
21503
21504
21505
21506
21507
21508
21509
21510
21511 gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext"
21512
21513 fi
21514
21515
21516cat >>confdefs.h <<_ACEOF
21517#define GNULIB_ISBLANK 1
21518_ACEOF
21519
21520
21521
21522
21523
21524
21525
21526 GNULIB_ISBLANK=1
21527
21528
21529
21530
21531
21532
88b48903
WN
21533 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
21534$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
d0ac1c44 21535if ${gl_cv_func_isnand_no_libm+:} false; then :
88b48903
WN
21536 $as_echo_n "(cached) " >&6
21537else
21538
21539 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21540/* end confdefs.h. */
21541#include <math.h>
21542 #if __GNUC__ >= 4
21543 # undef isnand
21544 # define isnand(x) __builtin_isnan ((double)(x))
21545 #else
21546 # undef isnand
21547 # define isnand(x) isnan ((double)(x))
21548 #endif
21549 double x;
21550int
21551main ()
21552{
21553return isnand (x);
21554 ;
21555 return 0;
21556}
21557_ACEOF
21558if ac_fn_c_try_link "$LINENO"; then :
21559 gl_cv_func_isnand_no_libm=yes
21560else
21561 gl_cv_func_isnand_no_libm=no
21562fi
21563rm -f core conftest.err conftest.$ac_objext \
21564 conftest$ac_exeext conftest.$ac_ext
21565
21566fi
21567{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
21568$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
21569
21570 gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
21571 if test $gl_cv_func_isnand_no_libm = yes; then
21572
21573$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
21574
21575 fi
21576
21577 if test $gl_func_isnand_no_libm != yes; then
21578
21579
21580
21581
21582
21583
21584
21585
21586 gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
21587
21588
21589
21590
21591 fi
21592
21593
21594 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
21595$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
d0ac1c44 21596if ${gl_cv_func_isnanl_no_libm+:} false; then :
88b48903
WN
21597 $as_echo_n "(cached) " >&6
21598else
21599
21600 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21601/* end confdefs.h. */
21602#include <math.h>
698be2d8
CB
21603 #ifndef __has_builtin
21604 # define __has_builtin(name) 0
21605 #endif
21606 #if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl))
88b48903
WN
21607 # undef isnanl
21608 # define isnanl(x) __builtin_isnanl ((long double)(x))
21609 #elif defined isnan
21610 # undef isnanl
21611 # define isnanl(x) isnan ((long double)(x))
21612 #endif
21613 long double x;
21614int
21615main ()
21616{
21617return isnanl (x);
21618 ;
21619 return 0;
21620}
21621_ACEOF
21622if ac_fn_c_try_link "$LINENO"; then :
21623 gl_cv_func_isnanl_no_libm=yes
21624else
21625 gl_cv_func_isnanl_no_libm=no
21626fi
21627rm -f core conftest.err conftest.$ac_objext \
21628 conftest$ac_exeext conftest.$ac_ext
21629
21630fi
21631{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
21632$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
21633
21634 gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
21635 if test $gl_func_isnanl_no_libm = yes; then
21636
21637
21638
21639
21640 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
21641$as_echo_n "checking whether isnanl works... " >&6; }
d0ac1c44 21642if ${gl_cv_func_isnanl_works+:} false; then :
88b48903
WN
21643 $as_echo_n "(cached) " >&6
21644else
21645
21646 if test "$cross_compiling" = yes; then :
c0c3707f
CB
21647 case "$host_os" in
21648 mingw*) # Guess yes on mingw, no on MSVC.
21649 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21650/* end confdefs.h. */
21651
21652#ifdef __MINGW32__
21653 Known
21654#endif
21655
21656_ACEOF
21657if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21658 $EGREP "Known" >/dev/null 2>&1; then :
4a626d0a 21659 gl_cv_func_isnanl_works="guessing yes"
c0c3707f
CB
21660else
21661 gl_cv_func_isnanl_works="guessing no"
21662fi
21663rm -f conftest*
21664
21665 ;;
21666 *) gl_cv_func_isnanl_works="guessing yes" ;;
21667 esac
21668
88b48903
WN
21669else
21670 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21671/* end confdefs.h. */
21672
21673#include <float.h>
21674#include <limits.h>
21675#include <math.h>
698be2d8
CB
21676#ifndef __has_builtin
21677# define __has_builtin(name) 0
21678#endif
21679#if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl))
88b48903
WN
21680# undef isnanl
21681# define isnanl(x) __builtin_isnanl ((long double)(x))
21682#elif defined isnan
21683# undef isnanl
21684# define isnanl(x) isnan ((long double)(x))
21685#endif
21686#define NWORDS \
21687 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
21688typedef union { unsigned int word[NWORDS]; long double value; }
21689 memory_long_double;
21690/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
21691 runtime type conversion. */
21692#ifdef __sgi
21693static long double NaNl ()
21694{
21695 double zero = 0.0;
21696 return zero / zero;
21697}
21698#else
21699# define NaNl() (0.0L / 0.0L)
21700#endif
21701int main ()
21702{
21703 int result = 0;
21704
21705 if (!isnanl (NaNl ()))
21706 result |= 1;
21707
21708 {
21709 memory_long_double m;
21710 unsigned int i;
21711
21712 /* The isnanl function should be immune against changes in the sign bit and
21713 in the mantissa bits. The xor operation twiddles a bit that can only be
21714 a sign bit or a mantissa bit (since the exponent never extends to
21715 bit 31). */
21716 m.value = NaNl ();
21717 m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
21718 for (i = 0; i < NWORDS; i++)
21719 m.word[i] |= 1;
21720 if (!isnanl (m.value))
21721 result |= 1;
21722 }
21723
21724#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
21725/* Representation of an 80-bit 'long double' as an initializer for a sequence
21726 of 'unsigned int' words. */
21727# ifdef WORDS_BIGENDIAN
21728# define LDBL80_WORDS(exponent,manthi,mantlo) \
21729 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
4a626d0a 21730 ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
88b48903
WN
21731 (unsigned int) (mantlo) << 16 \
21732 }
21733# else
21734# define LDBL80_WORDS(exponent,manthi,mantlo) \
21735 { mantlo, manthi, exponent }
21736# endif
21737 { /* Quiet NaN. */
21738 static memory_long_double x =
21739 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
21740 if (!isnanl (x.value))
21741 result |= 2;
21742 }
21743 {
21744 /* Signalling NaN. */
21745 static memory_long_double x =
21746 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
21747 if (!isnanl (x.value))
21748 result |= 2;
21749 }
4a626d0a 21750 /* isnanl should return something even for noncanonical values. */
88b48903
WN
21751 { /* Pseudo-NaN. */
21752 static memory_long_double x =
21753 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
4a626d0a 21754 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21755 result |= 4;
21756 }
21757 { /* Pseudo-Infinity. */
21758 static memory_long_double x =
21759 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
4a626d0a 21760 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21761 result |= 8;
21762 }
21763 { /* Pseudo-Zero. */
21764 static memory_long_double x =
21765 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
4a626d0a 21766 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21767 result |= 16;
21768 }
21769 { /* Unnormalized number. */
21770 static memory_long_double x =
21771 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
4a626d0a 21772 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21773 result |= 32;
21774 }
21775 { /* Pseudo-Denormal. */
21776 static memory_long_double x =
21777 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
4a626d0a 21778 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
21779 result |= 64;
21780 }
21781#endif
21782
21783 return result;
21784}
21785_ACEOF
21786if ac_fn_c_try_run "$LINENO"; then :
21787 gl_cv_func_isnanl_works=yes
21788else
21789 gl_cv_func_isnanl_works=no
21790fi
21791rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21792 conftest.$ac_objext conftest.beam conftest.$ac_ext
21793fi
21794
21795
21796fi
21797{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
21798$as_echo "$gl_cv_func_isnanl_works" >&6; }
21799
21800 case "$gl_cv_func_isnanl_works" in
21801 *yes) ;;
21802 *) gl_func_isnanl_no_libm=no ;;
21803 esac
21804 fi
21805 if test $gl_func_isnanl_no_libm = yes; then
21806
21807$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
21808
21809 fi
21810
21811 if test $gl_func_isnanl_no_libm != yes; then
21812
21813
21814
21815
21816
21817
21818
21819
21820 gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext"
21821
21822
21823
21824
c0c3707f 21825 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
88b48903 21826$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
d0ac1c44 21827if ${gl_cv_cc_long_double_expbit0+:} false; then :
88b48903
WN
21828 $as_echo_n "(cached) " >&6
21829else
21830
21831 if test "$cross_compiling" = yes; then :
21832
21833 gl_cv_cc_long_double_expbit0="unknown"
c0c3707f
CB
21834 case "$host_os" in
21835 mingw*) # On native Windows (little-endian), we know the result
21836 # in two cases: mingw, MSVC.
21837 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21838/* end confdefs.h. */
21839
21840#ifdef __MINGW32__
21841 Known
21842#endif
21843
21844_ACEOF
21845if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21846 $EGREP "Known" >/dev/null 2>&1; then :
21847 gl_cv_cc_long_double_expbit0="word 2 bit 0"
21848fi
21849rm -f conftest*
21850
21851 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21852/* end confdefs.h. */
21853
21854#ifdef _MSC_VER
21855 Known
21856#endif
21857
21858_ACEOF
21859if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21860 $EGREP "Known" >/dev/null 2>&1; then :
21861 gl_cv_cc_long_double_expbit0="word 1 bit 20"
21862fi
21863rm -f conftest*
21864
21865 ;;
21866 esac
88b48903
WN
21867
21868else
21869 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21870/* end confdefs.h. */
21871
21872#include <float.h>
21873#include <stddef.h>
21874#include <stdio.h>
21875#include <string.h>
21876#define NWORDS \
21877 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
21878typedef union { long double value; unsigned int word[NWORDS]; }
21879 memory_long_double;
21880static unsigned int ored_words[NWORDS];
21881static unsigned int anded_words[NWORDS];
698be2d8 21882static void add_to_ored_words (long double *x)
88b48903
WN
21883{
21884 memory_long_double m;
21885 size_t i;
21886 /* Clear it first, in case
21887 sizeof (long double) < sizeof (memory_long_double). */
21888 memset (&m, 0, sizeof (memory_long_double));
698be2d8 21889 m.value = *x;
88b48903
WN
21890 for (i = 0; i < NWORDS; i++)
21891 {
21892 ored_words[i] |= m.word[i];
21893 anded_words[i] &= m.word[i];
21894 }
21895}
21896int main ()
21897{
698be2d8 21898 static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
88b48903
WN
21899 size_t j;
21900 FILE *fp = fopen ("conftest.out", "w");
21901 if (fp == NULL)
21902 return 1;
21903 for (j = 0; j < NWORDS; j++)
21904 anded_words[j] = ~ (unsigned int) 0;
698be2d8
CB
21905 for (j = 0; j < 5; j++)
21906 add_to_ored_words (&samples[j]);
88b48903
WN
21907 /* Remove bits that are common (e.g. if representation of the first mantissa
21908 bit is explicit). */
21909 for (j = 0; j < NWORDS; j++)
21910 ored_words[j] &= ~anded_words[j];
21911 /* Now find the nonzero word. */
21912 for (j = 0; j < NWORDS; j++)
21913 if (ored_words[j] != 0)
21914 break;
21915 if (j < NWORDS)
21916 {
21917 size_t i;
21918 for (i = j + 1; i < NWORDS; i++)
21919 if (ored_words[i] != 0)
21920 {
21921 fprintf (fp, "unknown");
21922 return (fclose (fp) != 0);
21923 }
21924 for (i = 0; ; i++)
21925 if ((ored_words[j] >> i) & 1)
21926 {
21927 fprintf (fp, "word %d bit %d", (int) j, (int) i);
21928 return (fclose (fp) != 0);
21929 }
21930 }
21931 fprintf (fp, "unknown");
21932 return (fclose (fp) != 0);
21933}
21934
21935_ACEOF
21936if ac_fn_c_try_run "$LINENO"; then :
21937 gl_cv_cc_long_double_expbit0=`cat conftest.out`
21938else
21939 gl_cv_cc_long_double_expbit0="unknown"
21940fi
21941rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21942 conftest.$ac_objext conftest.beam conftest.$ac_ext
21943fi
21944
21945 rm -f conftest.out
21946
21947fi
21948{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
21949$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
21950 case "$gl_cv_cc_long_double_expbit0" in
21951 word*bit*)
21952 word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
21953 bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
21954
21955cat >>confdefs.h <<_ACEOF
21956#define LDBL_EXPBIT0_WORD $word
21957_ACEOF
21958
21959
21960cat >>confdefs.h <<_ACEOF
21961#define LDBL_EXPBIT0_BIT $bit
21962_ACEOF
21963
21964 ;;
21965 esac
21966
21967
21968
21969 fi
21970
21971
5df4cba6
SM
21972 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
21973$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; }
21974if ${gl_cv_c___inline+:} false; then :
21975 $as_echo_n "(cached) " >&6
21976else
21977 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21978/* end confdefs.h. */
21979typedef int foo_t;
21980 static __inline foo_t foo (void) { return 0; }
21981int
21982main ()
21983{
21984return foo ();
21985 ;
21986 return 0;
21987}
21988_ACEOF
21989if ac_fn_c_try_compile "$LINENO"; then :
21990 gl_cv_c___inline=yes
21991else
21992 gl_cv_c___inline=no
21993fi
21994rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21995fi
21996{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
21997$as_echo "$gl_cv_c___inline" >&6; }
21998 if test $gl_cv_c___inline = yes; then
21999
22000$as_echo "#define HAVE___INLINE 1" >>confdefs.h
22001
22002 fi
22003
22004
22005
22006
22007
22008 LOCALCHARSET_TESTS_ENVIRONMENT=
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020 case "$host_os" in
22021 solaris*)
22022
22023$as_echo "#define _LCONV_C99 1" >>confdefs.h
22024
22025 ;;
22026 esac
22027
22028 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
22029$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; }
22030if ${gl_cv_header_locale_h_posix2001+:} false; then :
22031 $as_echo_n "(cached) " >&6
22032else
22033 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22034/* end confdefs.h. */
22035#include <locale.h>
22036 int x = LC_MESSAGES;
22037 int y = sizeof (((struct lconv *) 0)->decimal_point);
22038int
22039main ()
22040{
22041
22042 ;
22043 return 0;
22044}
22045_ACEOF
22046if ac_fn_c_try_compile "$LINENO"; then :
22047 gl_cv_header_locale_h_posix2001=yes
22048else
22049 gl_cv_header_locale_h_posix2001=no
22050fi
22051rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22052fi
22053{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
22054$as_echo "$gl_cv_header_locale_h_posix2001" >&6; }
22055
22056 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
22057$as_echo_n "checking whether struct lconv is properly defined... " >&6; }
22058if ${gl_cv_sys_struct_lconv_ok+:} false; then :
c0c3707f
CB
22059 $as_echo_n "(cached) " >&6
22060else
22061 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22062/* end confdefs.h. */
5df4cba6
SM
22063#include <locale.h>
22064 struct lconv l;
22065 int x = sizeof (l.decimal_point);
22066 int y = sizeof (l.int_p_cs_precedes);
c0c3707f
CB
22067int
22068main ()
22069{
5df4cba6 22070
c0c3707f
CB
22071 ;
22072 return 0;
22073}
22074_ACEOF
22075if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 22076 gl_cv_sys_struct_lconv_ok=yes
c0c3707f 22077else
5df4cba6 22078 gl_cv_sys_struct_lconv_ok=no
c0c3707f
CB
22079fi
22080rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 22081
c0c3707f 22082fi
5df4cba6
SM
22083{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
22084$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
22085 if test $gl_cv_sys_struct_lconv_ok = no; then
22086 case "$host_os" in
22087 mingw*)
22088 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22089/* end confdefs.h. */
c0c3707f 22090
5df4cba6
SM
22091#ifdef _MSC_VER
22092 Special
22093#endif
22094
22095_ACEOF
22096if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22097 $EGREP "Special" >/dev/null 2>&1; then :
22098
22099else
22100 REPLACE_STRUCT_LCONV=1
22101fi
22102rm -f conftest*
c0c3707f 22103
5df4cba6
SM
22104 ;;
22105 *) REPLACE_STRUCT_LCONV=1 ;;
22106 esac
c0c3707f 22107 fi
88b48903
WN
22108
22109
88b48903
WN
22110
22111
472fa5ee 22112
5df4cba6
SM
22113
22114
22115
22116
22117 if test $gl_cv_have_include_next = yes; then
22118 gl_cv_next_locale_h='<'locale.h'>'
22119 else
22120 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
22121$as_echo_n "checking absolute name of <locale.h>... " >&6; }
22122if ${gl_cv_next_locale_h+:} false; then :
22123 $as_echo_n "(cached) " >&6
22124else
22125
22126
22127
22128 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22129/* end confdefs.h. */
22130#include <locale.h>
22131_ACEOF
22132 case "$host_os" in
22133 aix*) gl_absname_cpp="$ac_cpp -C" ;;
22134 *) gl_absname_cpp="$ac_cpp" ;;
22135 esac
22136
22137 case "$host_os" in
22138 mingw*)
22139 gl_dirsep_regex='[/\\]'
22140 ;;
22141 *)
22142 gl_dirsep_regex='\/'
22143 ;;
22144 esac
22145 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
22146 gl_header_literal_regex=`echo 'locale.h' \
22147 | sed -e "$gl_make_literal_regex_sed"`
22148 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
22149 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
22150 s|^/[^/]|//&|
22151 p
22152 q
22153 }'
22154
22155 gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
22156 sed -n "$gl_absolute_header_sed"`
22157
22158 gl_header=$gl_cv_absolute_locale_h
22159 gl_cv_next_locale_h='"'$gl_header'"'
22160
22161
22162fi
22163{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
22164$as_echo "$gl_cv_next_locale_h" >&6; }
22165 fi
22166 NEXT_LOCALE_H=$gl_cv_next_locale_h
22167
22168 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
22169 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
22170 gl_next_as_first_directive='<'locale.h'>'
22171 else
22172 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
22173 gl_next_as_first_directive=$gl_cv_next_locale_h
22174 fi
22175 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
22176
22177
22178
22179
22180
22181
22182
22183
472fa5ee
SM
22184
22185
22186
22187
88b48903
WN
22188
22189
2196f55f 22190
49e4877c 22191
c0c3707f
CB
22192
22193
22194 gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext"
88b48903
WN
22195
22196
22197
5abebf3c
CB
22198 if test "$gl_threads_api" = posix; then
22199 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
22200 # pthread_rwlock_* functions.
c0c3707f 22201 has_rwlock=false
5abebf3c
CB
22202 ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
22203"
22204if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
c0c3707f 22205 has_rwlock=true
5abebf3c
CB
22206
22207$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
22208
22209fi
22210
c0c3707f
CB
22211 if $has_rwlock; then
22212
22213
22214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
22215$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
22216if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
22217 $as_echo_n "(cached) " >&6
22218else
22219 save_LIBS="$LIBS"
22220 LIBS="$LIBS $LIBMULTITHREAD"
22221 if test "$cross_compiling" = yes; then :
22222 case "$host_os" in
22223 # Guess no on glibc systems.
22224 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22225 # Guess no on musl systems.
22226 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22227 # Guess no on bionic systems.
22228 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22229 # Guess yes on native Windows with the mingw-w64 winpthreads library.
22230 # Guess no on native Windows with the gnulib windows-rwlock module.
22231 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
22232 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
22233 else
22234 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
22235 fi
22236 ;;
22237 # If we don't know, obey --enable-cross-guesses.
22238 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
22239 esac
22240
22241else
22242 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22243/* end confdefs.h. */
22244
22245#include <errno.h>
22246#include <pthread.h>
22247#include <stdlib.h>
22248#include <unistd.h>
22249
22250#define SUCCEED() exit (0)
22251#define FAILURE() exit (1)
22252#define UNEXPECTED(n) (exit (10 + (n)))
22253
22254/* The main thread creates the waiting writer and the requesting reader threads
22255 in the default way; this guarantees that they have the same priority.
22256 We can reuse the main thread as first reader thread. */
22257
22258static pthread_rwlock_t lock;
22259static pthread_t reader1;
22260static pthread_t writer;
22261static pthread_t reader2;
22262static pthread_t timer;
22263/* Used to pass control from writer to reader2 and from reader2 to timer,
22264 as in a relay race.
22265 Passing control from one running thread to another running thread
22266 is most likely faster than to create the second thread. */
22267static pthread_mutex_t baton;
22268
22269static void *
22270timer_func (void *ignored)
22271{
22272 /* Step 13 (can be before or after step 12):
22273 The timer thread takes the baton, then waits a moment to make sure
22274 it can tell whether the second reader thread is blocked at step 12. */
22275 if (pthread_mutex_lock (&baton))
22276 UNEXPECTED (13);
22277 usleep (100000);
22278 /* By the time we get here, it's clear that the second reader thread is
22279 blocked at step 12. This is the desired behaviour. */
22280 SUCCEED ();
22281}
22282
22283static void *
22284reader2_func (void *ignored)
22285{
22286 int err;
22287
22288 /* Step 8 (can be before or after step 7):
22289 The second reader thread takes the baton, then waits a moment to make sure
22290 the writer thread has reached step 7. */
22291 if (pthread_mutex_lock (&baton))
22292 UNEXPECTED (8);
22293 usleep (100000);
22294 /* Step 9: The second reader thread requests the lock. */
22295 err = pthread_rwlock_tryrdlock (&lock);
22296 if (err == 0)
22297 FAILURE ();
22298 else if (err != EBUSY)
22299 UNEXPECTED (9);
22300 /* Step 10: Launch a timer, to test whether the next call blocks. */
22301 if (pthread_create (&timer, NULL, timer_func, NULL))
22302 UNEXPECTED (10);
22303 /* Step 11: Release the baton. */
22304 if (pthread_mutex_unlock (&baton))
22305 UNEXPECTED (11);
22306 /* Step 12: The second reader thread requests the lock. */
22307 err = pthread_rwlock_rdlock (&lock);
22308 if (err == 0)
22309 FAILURE ();
22310 else
22311 UNEXPECTED (12);
22312}
22313
22314static void *
22315writer_func (void *ignored)
22316{
22317 /* Step 4: Take the baton, so that the second reader thread does not go ahead
22318 too early. */
22319 if (pthread_mutex_lock (&baton))
22320 UNEXPECTED (4);
22321 /* Step 5: Create the second reader thread. */
22322 if (pthread_create (&reader2, NULL, reader2_func, NULL))
22323 UNEXPECTED (5);
22324 /* Step 6: Release the baton. */
22325 if (pthread_mutex_unlock (&baton))
22326 UNEXPECTED (6);
22327 /* Step 7: The writer thread requests the lock. */
22328 if (pthread_rwlock_wrlock (&lock))
22329 UNEXPECTED (7);
22330 return NULL;
22331}
22332
22333int
22334main ()
22335{
22336 reader1 = pthread_self ();
22337
22338 /* Step 1: The main thread initializes the lock and the baton. */
22339 if (pthread_rwlock_init (&lock, NULL))
22340 UNEXPECTED (1);
22341 if (pthread_mutex_init (&baton, NULL))
22342 UNEXPECTED (1);
22343 /* Step 2: The main thread acquires the lock as a reader. */
22344 if (pthread_rwlock_rdlock (&lock))
22345 UNEXPECTED (2);
22346 /* Step 3: Create the writer thread. */
22347 if (pthread_create (&writer, NULL, writer_func, NULL))
22348 UNEXPECTED (3);
22349 /* Job done. Go to sleep. */
22350 for (;;)
22351 {
22352 sleep (1);
22353 }
22354}
22355
22356_ACEOF
22357if ac_fn_c_try_run "$LINENO"; then :
22358 gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
22359else
22360 gl_cv_pthread_rwlock_rdlock_prefer_writer=no
22361fi
22362rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22363 conftest.$ac_objext conftest.beam conftest.$ac_ext
22364fi
22365
22366 LIBS="$save_LIBS"
22367
22368fi
22369{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
22370$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
22371 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
22372 *yes)
22373
22374$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
22375
22376 ;;
22377 esac
22378
22379 fi
5abebf3c
CB
22380 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
22381 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22382/* end confdefs.h. */
22383
22384 #include <pthread.h>
22385int
22386main ()
22387{
22388
22389#if __FreeBSD__ == 4
22390error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
22391#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
22392 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
22393error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
22394#else
22395int x = (int)PTHREAD_MUTEX_RECURSIVE;
22396return !x;
22397#endif
22398
22399 ;
22400 return 0;
22401}
22402_ACEOF
22403if ac_fn_c_try_compile "$LINENO"; then :
22404
22405$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
22406
22407fi
22408rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22409 fi
22410 :
22411
22412
22413
22414cat >>confdefs.h <<_ACEOF
22415#define GNULIB_LOCK 1
22416_ACEOF
22417
22418
22419
22420
88b48903 22421
472fa5ee 22422
f45c62c4
YQ
22423 if test $ac_cv_func_lstat = yes; then
22424
c0c3707f
CB
22425 case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
22426 solaris* | *no)
f45c62c4
YQ
22427 REPLACE_LSTAT=1
22428 ;;
22429 esac
22430 else
22431 HAVE_LSTAT=0
22432 fi
22433
22434 if test $REPLACE_LSTAT = 1; then
22435
22436
22437
22438
22439
22440
22441
22442
22443 gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
22444
22445 :
22446 fi
22447
22448
22449
22450
22451
22452 GNULIB_LSTAT=1
22453
22454
22455
22456
22457
22458$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
22459
22460
22461
22462
22463
22464
6a29c58e
YQ
22465 if test $gl_cv_func_malloc_posix = yes; then
22466
22467$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
22468
22469 else
22470 REPLACE_MALLOC=1
22471 fi
22472
22473 if test $REPLACE_MALLOC = 1; then
22474
22475
22476
22477
22478
22479
22480
22481
22482 gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
22483
22484 fi
22485
22486
22487
22488
22489
22490 GNULIB_MALLOC_POSIX=1
22491
22492
22493
22494
22495
22496$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
22497
22498
22499
22500
22501
22502
88b48903
WN
22503
22504
22505
22506
22507
88b48903 22508
c971b7fa 22509
c971b7fa 22510
98399780
YQ
22511
22512
22513
88b48903
WN
22514 if test $gl_cv_have_include_next = yes; then
22515 gl_cv_next_math_h='<'math.h'>'
22516 else
22517 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
22518$as_echo_n "checking absolute name of <math.h>... " >&6; }
d0ac1c44 22519if ${gl_cv_next_math_h+:} false; then :
88b48903
WN
22520 $as_echo_n "(cached) " >&6
22521else
c971b7fa 22522
88b48903 22523 if test $ac_cv_header_math_h = yes; then
c971b7fa
PA
22524
22525
4a626d0a
PA
22526
22527
22528 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 22529/* end confdefs.h. */
88b48903 22530#include <math.h>
8690e634 22531_ACEOF
4a626d0a
PA
22532 case "$host_os" in
22533 aix*) gl_absname_cpp="$ac_cpp -C" ;;
22534 *) gl_absname_cpp="$ac_cpp" ;;
22535 esac
22536
22537 case "$host_os" in
22538 mingw*)
22539 gl_dirsep_regex='[/\\]'
22540 ;;
22541 *)
22542 gl_dirsep_regex='\/'
22543 ;;
22544 esac
22545 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
22546 gl_header_literal_regex=`echo 'math.h' \
22547 | sed -e "$gl_make_literal_regex_sed"`
22548 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
22549 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
22550 s|^/[^/]|//&|
22551 p
22552 q
22553 }'
22554
22555 gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
22556 sed -n "$gl_absolute_header_sed"`
22557
22558 gl_header=$gl_cv_absolute_math_h
22559 gl_cv_next_math_h='"'$gl_header'"'
88b48903
WN
22560 else
22561 gl_cv_next_math_h='<'math.h'>'
22562 fi
8690e634 22563
c971b7fa 22564
88b48903
WN
22565fi
22566{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
22567$as_echo "$gl_cv_next_math_h" >&6; }
22568 fi
22569 NEXT_MATH_H=$gl_cv_next_math_h
c971b7fa 22570
88b48903
WN
22571 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
22572 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
22573 gl_next_as_first_directive='<'math.h'>'
22574 else
22575 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
22576 gl_next_as_first_directive=$gl_cv_next_math_h
22577 fi
22578 NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
8690e634 22579
c971b7fa 22580
c971b7fa
PA
22581
22582
c971b7fa 22583
88b48903
WN
22584 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
22585$as_echo_n "checking whether NAN macro works... " >&6; }
d0ac1c44 22586if ${gl_cv_header_math_nan_works+:} false; then :
c971b7fa
PA
22587 $as_echo_n "(cached) " >&6
22588else
8690e634
JK
22589 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22590/* end confdefs.h. */
88b48903 22591#include <math.h>
c971b7fa
PA
22592int
22593main ()
22594{
88b48903
WN
22595/* Solaris 10 has a broken definition of NAN. Other platforms
22596 fail to provide NAN, or provide it only in C99 mode; this
22597 test only needs to fail when NAN is provided but wrong. */
22598 float f = 1.0f;
22599#ifdef NAN
22600 f = NAN;
22601#endif
22602 return f == 0;
c971b7fa
PA
22603 ;
22604 return 0;
22605}
22606_ACEOF
22607if ac_fn_c_try_compile "$LINENO"; then :
88b48903 22608 gl_cv_header_math_nan_works=yes
8690e634 22609else
88b48903 22610 gl_cv_header_math_nan_works=no
c971b7fa
PA
22611fi
22612rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 22613fi
88b48903
WN
22614{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
22615$as_echo "$gl_cv_header_math_nan_works" >&6; }
22616 if test $gl_cv_header_math_nan_works = no; then
22617 REPLACE_NAN=1
c971b7fa 22618 fi
88b48903
WN
22619 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
22620$as_echo_n "checking whether HUGE_VAL works... " >&6; }
d0ac1c44 22621if ${gl_cv_header_math_huge_val_works+:} false; then :
c971b7fa
PA
22622 $as_echo_n "(cached) " >&6
22623else
8690e634 22624 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 22625/* end confdefs.h. */
88b48903 22626#include <math.h>
c971b7fa
PA
22627int
22628main ()
22629{
88b48903
WN
22630/* Solaris 10 has a broken definition of HUGE_VAL. */
22631 double d = HUGE_VAL;
22632 return d == 0;
c971b7fa
PA
22633 ;
22634 return 0;
22635}
22636_ACEOF
22637if ac_fn_c_try_compile "$LINENO"; then :
88b48903 22638 gl_cv_header_math_huge_val_works=yes
8690e634 22639else
88b48903 22640 gl_cv_header_math_huge_val_works=no
c971b7fa
PA
22641fi
22642rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 22643fi
88b48903
WN
22644{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
22645$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
22646 if test $gl_cv_header_math_huge_val_works = no; then
22647 REPLACE_HUGE_VAL=1
8690e634 22648 fi
c971b7fa 22649
c971b7fa 22650
c971b7fa
PA
22651
22652
22653
22654
22655
22656
c971b7fa 22657
c971b7fa 22658
c971b7fa 22659
c971b7fa
PA
22660
22661
c971b7fa 22662
472fa5ee 22663
5df4cba6
SM
22664
22665
22666
22667 if case "$host_os" in
22668 mingw*) true ;;
22669 *) test $ac_cv_func_mbsinit = yes ;;
22670 esac \
22671 && test $ac_cv_func_mbrtowc = yes; then
472fa5ee
SM
22672
22673
22674
22675
c0c3707f
CB
22676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
22677$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
22678if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
22679 $as_echo_n "(cached) " >&6
22680else
472fa5ee 22681
c0c3707f
CB
22682 case "$host_os" in
22683 # Guess no on AIX and OSF/1.
22684 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
22685 # Guess yes otherwise.
22686 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
22687 esac
22688 if test $LOCALE_JA != none; then
22689 if test "$cross_compiling" = yes; then :
472fa5ee 22690 :
c0c3707f
CB
22691else
22692 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22693/* end confdefs.h. */
472fa5ee 22694
c0c3707f
CB
22695#include <locale.h>
22696#include <string.h>
22697/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22698 <wchar.h>.
22699 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22700 included before <wchar.h>. */
22701#include <stddef.h>
22702#include <stdio.h>
22703#include <time.h>
22704#include <wchar.h>
22705int main ()
22706{
22707 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
22708 {
22709 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
22710 mbstate_t state;
22711 wchar_t wc;
472fa5ee 22712
c0c3707f
CB
22713 memset (&state, '\0', sizeof (mbstate_t));
22714 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
22715 if (mbsinit (&state))
22716 return 2;
22717 }
22718 return 0;
22719}
22720_ACEOF
22721if ac_fn_c_try_run "$LINENO"; then :
22722 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 22723else
c0c3707f
CB
22724 gl_cv_func_mbrtowc_incomplete_state=no
22725fi
22726rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22727 conftest.$ac_objext conftest.beam conftest.$ac_ext
22728fi
8690e634 22729
c0c3707f
CB
22730 else
22731 if test $LOCALE_FR_UTF8 != none; then
22732 if test "$cross_compiling" = yes; then :
8690e634
JK
22733 :
22734else
c971b7fa
PA
22735 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22736/* end confdefs.h. */
c971b7fa 22737
8690e634
JK
22738#include <locale.h>
22739#include <string.h>
22740/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22741 <wchar.h>.
22742 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22743 included before <wchar.h>. */
22744#include <stddef.h>
22745#include <stdio.h>
22746#include <time.h>
22747#include <wchar.h>
22748int main ()
c971b7fa 22749{
c0c3707f 22750 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
8690e634 22751 {
c0c3707f 22752 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
8690e634
JK
22753 mbstate_t state;
22754 wchar_t wc;
22755
22756 memset (&state, '\0', sizeof (mbstate_t));
22757 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
22758 if (mbsinit (&state))
c0c3707f 22759 return 2;
8690e634 22760 }
c971b7fa
PA
22761 return 0;
22762}
22763_ACEOF
8690e634
JK
22764if ac_fn_c_try_run "$LINENO"; then :
22765 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 22766else
8690e634 22767 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa 22768fi
8690e634
JK
22769rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22770 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22771fi
c971b7fa 22772
c0c3707f 22773 fi
8690e634 22774 fi
c971b7fa 22775
8690e634
JK
22776fi
22777{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
22778$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa 22779
c971b7fa 22780
c971b7fa 22781
c971b7fa 22782
8690e634
JK
22783 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
22784$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 22785if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
22786 $as_echo_n "(cached) " >&6
22787else
22788
8690e634
JK
22789 case "$host_os" in
22790 # Guess no on Solaris 8.
22791 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
22792 # Guess yes otherwise.
22793 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
22794 esac
22795 if test $LOCALE_ZH_CN != none; then
22796 if test "$cross_compiling" = yes; then :
22797 :
22798else
22799 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
22800/* end confdefs.h. */
22801
8690e634
JK
22802#include <locale.h>
22803#include <stdlib.h>
22804#include <string.h>
22805/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22806 <wchar.h>.
22807 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22808 included before <wchar.h>. */
22809#include <stddef.h>
22810#include <stdio.h>
22811#include <time.h>
22812#include <wchar.h>
22813int main ()
c971b7fa 22814{
8690e634
JK
22815 /* This fails on Solaris 8:
22816 mbrtowc returns 2, and sets wc to 0x00F0.
22817 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
22818 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
22819 {
22820 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
22821 mbstate_t state;
22822 wchar_t wc;
22823
22824 memset (&state, '\0', sizeof (mbstate_t));
22825 if (mbrtowc (&wc, input + 3, 6, &state) != 4
22826 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 22827 return 2;
8690e634 22828 }
c971b7fa
PA
22829 return 0;
22830}
22831_ACEOF
8690e634
JK
22832if ac_fn_c_try_run "$LINENO"; then :
22833 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 22834else
8690e634 22835 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 22836fi
8690e634
JK
22837rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22838 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22839fi
c971b7fa 22840
8690e634 22841 fi
c971b7fa 22842
8690e634
JK
22843fi
22844{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
22845$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
22846
22847 REPLACE_MBSTATE_T=0
22848 case "$gl_cv_func_mbrtowc_incomplete_state" in
22849 *yes) ;;
22850 *) REPLACE_MBSTATE_T=1 ;;
22851 esac
22852 case "$gl_cv_func_mbrtowc_sanitycheck" in
22853 *yes) ;;
22854 *) REPLACE_MBSTATE_T=1 ;;
22855 esac
c971b7fa 22856 else
8690e634 22857 REPLACE_MBSTATE_T=1
c971b7fa
PA
22858 fi
22859
22860
22861
8690e634
JK
22862 if test $ac_cv_func_mbrtowc = no; then
22863 HAVE_MBRTOWC=0
22864 ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
22865/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22866 <wchar.h>.
22867 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22868 included before <wchar.h>. */
22869#include <stddef.h>
22870#include <stdio.h>
22871#include <time.h>
22872#include <wchar.h>
c971b7fa 22873
8690e634 22874"
d0ac1c44 22875if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
8690e634
JK
22876 ac_have_decl=1
22877else
22878 ac_have_decl=0
c971b7fa 22879fi
c971b7fa 22880
8690e634
JK
22881cat >>confdefs.h <<_ACEOF
22882#define HAVE_DECL_MBRTOWC $ac_have_decl
22883_ACEOF
c971b7fa 22884
8690e634
JK
22885 if test $ac_cv_have_decl_mbrtowc = yes; then
22886 REPLACE_MBRTOWC=1
22887 fi
22888 else
22889 if test $REPLACE_MBSTATE_T = 1; then
22890 REPLACE_MBRTOWC=1
22891 else
c971b7fa
PA
22892
22893
22894
8690e634
JK
22895 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
22896$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
d0ac1c44 22897if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
8690e634 22898 $as_echo_n "(cached) " >&6
c971b7fa 22899else
c971b7fa 22900
8690e634
JK
22901 case "$host_os" in
22902 # Guess no on Solaris.
22903 solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
22904 # Guess yes otherwise.
22905 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
22906 esac
22907 if test $LOCALE_FR_UTF8 != none; then
22908 if test "$cross_compiling" = yes; then :
22909 :
22910else
22911 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
22912/* end confdefs.h. */
22913
8690e634
JK
22914#include <locale.h>
22915#include <stdlib.h>
22916#include <string.h>
22917/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22918 <wchar.h>.
22919 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22920 included before <wchar.h>. */
22921#include <stddef.h>
22922#include <stdio.h>
22923#include <time.h>
22924#include <wchar.h>
22925int main ()
22926{
22927 int result = 0;
22928
22929 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
22930 {
22931 char input[] = "\303\237er";
22932 mbstate_t state;
22933 wchar_t wc;
22934 size_t ret;
22935
22936 memset (&state, '\0', sizeof (mbstate_t));
22937 wc = (wchar_t) 0xBADFACE;
22938 ret = mbrtowc (&wc, input, 5, &state);
22939 if (ret != 2)
22940 result |= 1;
22941 if (!mbsinit (&state))
22942 result |= 2;
c971b7fa 22943
8690e634
JK
22944 memset (&state, '\0', sizeof (mbstate_t));
22945 ret = mbrtowc (NULL, input, 5, &state);
22946 if (ret != 2) /* Solaris 7 fails here: ret is -1. */
22947 result |= 4;
22948 if (!mbsinit (&state))
22949 result |= 8;
22950 }
22951 return result;
22952}
c971b7fa 22953_ACEOF
8690e634
JK
22954if ac_fn_c_try_run "$LINENO"; then :
22955 gl_cv_func_mbrtowc_null_arg1=yes
22956else
22957 gl_cv_func_mbrtowc_null_arg1=no
22958fi
22959rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22960 conftest.$ac_objext conftest.beam conftest.$ac_ext
22961fi
c971b7fa 22962
8690e634 22963 fi
c971b7fa 22964
c971b7fa 22965fi
8690e634
JK
22966{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
22967$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
c971b7fa 22968
c971b7fa 22969
c971b7fa 22970
c971b7fa 22971
8690e634
JK
22972 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
22973$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
d0ac1c44 22974if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
8690e634
JK
22975 $as_echo_n "(cached) " >&6
22976else
c971b7fa 22977
8690e634
JK
22978 case "$host_os" in
22979 # Guess no on OSF/1.
22980 osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
22981 # Guess yes otherwise.
22982 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
22983 esac
22984 if test $LOCALE_FR_UTF8 != none; then
22985 if test "$cross_compiling" = yes; then :
c971b7fa 22986 :
8690e634
JK
22987else
22988 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22989/* end confdefs.h. */
22990
22991#include <locale.h>
22992#include <string.h>
22993/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22994 <wchar.h>.
22995 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22996 included before <wchar.h>. */
22997#include <stddef.h>
22998#include <stdio.h>
22999#include <time.h>
23000#include <wchar.h>
23001int main ()
23002{
23003 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23004 {
23005 mbstate_t state;
23006 wchar_t wc;
23007 int ret;
23008
23009 memset (&state, '\0', sizeof (mbstate_t));
23010 wc = (wchar_t) 0xBADFACE;
23011 mbrtowc (&wc, NULL, 5, &state);
23012 /* Check that wc was not modified. */
23013 if (wc != (wchar_t) 0xBADFACE)
c0c3707f 23014 return 2;
8690e634
JK
23015 }
23016 return 0;
23017}
23018_ACEOF
23019if ac_fn_c_try_run "$LINENO"; then :
23020 gl_cv_func_mbrtowc_null_arg2=yes
23021else
23022 gl_cv_func_mbrtowc_null_arg2=no
23023fi
23024rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23025 conftest.$ac_objext conftest.beam conftest.$ac_ext
23026fi
23027
23028 fi
23029
23030fi
23031{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
23032$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
c971b7fa
PA
23033
23034
23035
23036
23037
23038
8690e634
JK
23039 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
23040$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
d0ac1c44 23041if ${gl_cv_func_mbrtowc_retval+:} false; then :
8690e634
JK
23042 $as_echo_n "(cached) " >&6
23043else
23044
23045 case "$host_os" in
23046 # Guess no on HP-UX, Solaris, native Windows.
23047 hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
23048 # Guess yes otherwise.
23049 *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
23050 esac
23051 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
23052 || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
23053 if test "$cross_compiling" = yes; then :
c971b7fa 23054 :
8690e634
JK
23055else
23056 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23057/* end confdefs.h. */
c971b7fa 23058
8690e634
JK
23059#include <locale.h>
23060#include <string.h>
23061/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23062 <wchar.h>.
23063 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23064 included before <wchar.h>. */
23065#include <stddef.h>
23066#include <stdio.h>
23067#include <time.h>
23068#include <wchar.h>
23069int main ()
23070{
23071 int result = 0;
23072 int found_some_locale = 0;
23073 /* This fails on Solaris. */
23074 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23075 {
23076 char input[] = "B\303\274\303\237er"; /* "Büßer" */
23077 mbstate_t state;
23078 wchar_t wc;
23079
23080 memset (&state, '\0', sizeof (mbstate_t));
23081 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23082 {
23083 input[1] = '\0';
23084 if (mbrtowc (&wc, input + 2, 5, &state) != 1)
23085 result |= 1;
23086 }
23087 found_some_locale = 1;
23088 }
23089 /* This fails on HP-UX 11.11. */
23090 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23091 {
23092 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23093 mbstate_t state;
23094 wchar_t wc;
23095
23096 memset (&state, '\0', sizeof (mbstate_t));
23097 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23098 {
23099 input[1] = '\0';
23100 if (mbrtowc (&wc, input + 2, 5, &state) != 2)
23101 result |= 2;
23102 }
23103 found_some_locale = 1;
23104 }
5df4cba6
SM
23105 /* This fails on native Windows. */
23106 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
23107 {
23108 char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
23109 mbstate_t state;
23110 wchar_t wc;
23111
23112 memset (&state, '\0', sizeof (mbstate_t));
23113 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23114 {
23115 input[3] = '\0';
23116 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23117 result |= 4;
23118 }
23119 found_some_locale = 1;
23120 }
23121 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
23122 {
23123 char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
23124 mbstate_t state;
23125 wchar_t wc;
23126
23127 memset (&state, '\0', sizeof (mbstate_t));
23128 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23129 {
23130 input[3] = '\0';
23131 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23132 result |= 8;
23133 }
23134 found_some_locale = 1;
23135 }
23136 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
23137 {
23138 char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
23139 mbstate_t state;
23140 wchar_t wc;
23141
23142 memset (&state, '\0', sizeof (mbstate_t));
23143 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23144 {
23145 input[3] = '\0';
23146 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23147 result |= 16;
23148 }
23149 found_some_locale = 1;
23150 }
23151 return (found_some_locale ? result : 77);
23152}
23153_ACEOF
23154if ac_fn_c_try_run "$LINENO"; then :
23155 gl_cv_func_mbrtowc_retval=yes
23156else
23157 if test $? != 77; then
23158 gl_cv_func_mbrtowc_retval=no
23159 fi
23160
23161fi
23162rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23163 conftest.$ac_objext conftest.beam conftest.$ac_ext
23164fi
23165
23166 fi
23167
23168fi
23169{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
23170$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
23171
23172
23173
23174
23175 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
23176$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
23177if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
23178 $as_echo_n "(cached) " >&6
23179else
23180
23181 case "$host_os" in
23182 # Guess no on Solaris 8 and 9.
23183 solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
23184 # Guess yes otherwise.
23185 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
23186 esac
23187 if test $LOCALE_ZH_CN != none; then
23188 if test "$cross_compiling" = yes; then :
23189 :
23190else
23191 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23192/* end confdefs.h. */
23193
23194#include <locale.h>
23195#include <string.h>
23196/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23197 <wchar.h>.
23198 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23199 included before <wchar.h>. */
23200#include <stddef.h>
23201#include <stdio.h>
23202#include <time.h>
23203#include <wchar.h>
23204int main ()
23205{
23206 /* This fails on Solaris 8 and 9. */
23207 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23208 {
23209 mbstate_t state;
23210 wchar_t wc;
23211
23212 memset (&state, '\0', sizeof (mbstate_t));
23213 if (mbrtowc (&wc, "", 1, &state) != 0)
23214 return 2;
23215 }
23216 return 0;
23217}
23218_ACEOF
23219if ac_fn_c_try_run "$LINENO"; then :
23220 gl_cv_func_mbrtowc_nul_retval=yes
23221else
23222 gl_cv_func_mbrtowc_nul_retval=no
23223fi
23224rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23225 conftest.$ac_objext conftest.beam conftest.$ac_ext
23226fi
23227
23228 fi
23229
23230fi
23231{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
23232$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
23233
23234
23235
23236 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5
23237$as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; }
23238if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then :
23239 $as_echo_n "(cached) " >&6
23240else
23241
23242 case "$host_os" in
23243 # Guess yes on native Windows.
23244 mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
23245 *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
23246 esac
23247 case "$host_os" in
23248 mingw*)
23249 if test "$cross_compiling" = yes; then :
23250 :
23251else
23252 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23253/* end confdefs.h. */
23254
23255#include <locale.h>
23256#include <string.h>
23257/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23258 <wchar.h>.
23259 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23260 included before <wchar.h>. */
23261#include <stddef.h>
23262#include <stdio.h>
23263#include <time.h>
23264#include <wchar.h>
23265int main ()
23266{
23267 int result = 0;
23268 if (setlocale (LC_ALL, "French_France.65001") != NULL)
23269 {
23270 wchar_t wc = (wchar_t) 0xBADFACE;
23271 mbstate_t state;
23272
23273 memset (&state, '\0', sizeof (mbstate_t));
23274 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
23275 && wc != (wchar_t) 0xBADFACE)
23276 result |= 1;
23277 }
8690e634
JK
23278 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
23279 {
5df4cba6 23280 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23281 mbstate_t state;
8690e634
JK
23282
23283 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23284 if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
23285 && wc != (wchar_t) 0xBADFACE)
23286 result |= 2;
8690e634
JK
23287 }
23288 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
23289 {
5df4cba6 23290 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23291 mbstate_t state;
8690e634
JK
23292
23293 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23294 if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
23295 && wc != (wchar_t) 0xBADFACE)
23296 result |= 4;
8690e634
JK
23297 }
23298 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
23299 {
5df4cba6 23300 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23301 mbstate_t state;
8690e634
JK
23302
23303 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23304 if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
23305 && wc != (wchar_t) 0xBADFACE)
23306 result |= 8;
8690e634 23307 }
5df4cba6 23308 return result;
8690e634
JK
23309}
23310_ACEOF
23311if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23312 gl_cv_func_mbrtowc_stores_incomplete=no
8690e634 23313else
5df4cba6 23314 gl_cv_func_mbrtowc_stores_incomplete=yes
8690e634
JK
23315fi
23316rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23317 conftest.$ac_objext conftest.beam conftest.$ac_ext
23318fi
c971b7fa 23319
5df4cba6
SM
23320 ;;
23321 *)
8690e634 23322
5df4cba6
SM
23323 if test $LOCALE_FR_UTF8 != none; then
23324 if test "$cross_compiling" = yes; then :
8690e634 23325 :
c971b7fa
PA
23326else
23327 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23328/* end confdefs.h. */
23329
8690e634 23330#include <locale.h>
c971b7fa 23331#include <string.h>
8690e634
JK
23332/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23333 <wchar.h>.
23334 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23335 included before <wchar.h>. */
23336#include <stddef.h>
23337#include <stdio.h>
23338#include <time.h>
23339#include <wchar.h>
23340int main ()
c971b7fa 23341{
5df4cba6 23342 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
c971b7fa 23343 {
5df4cba6 23344 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23345 mbstate_t state;
c971b7fa 23346
8690e634 23347 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23348 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
23349 && wc != (wchar_t) 0xBADFACE)
23350 return 1;
8690e634 23351 }
c971b7fa
PA
23352 return 0;
23353}
23354_ACEOF
23355if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23356 gl_cv_func_mbrtowc_stores_incomplete=no
c971b7fa 23357else
5df4cba6 23358 gl_cv_func_mbrtowc_stores_incomplete=yes
c971b7fa
PA
23359fi
23360rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23361 conftest.$ac_objext conftest.beam conftest.$ac_ext
23362fi
23363
5df4cba6
SM
23364 fi
23365 ;;
23366 esac
8690e634 23367
c971b7fa 23368fi
5df4cba6
SM
23369{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5
23370$as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; }
8690e634 23371
4a626d0a
PA
23372
23373
23374 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
23375$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
d0ac1c44 23376if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
4a626d0a
PA
23377 $as_echo_n "(cached) " >&6
23378else
23379
23380 case "$host_os" in
c0c3707f
CB
23381 # Guess no on AIX and glibc systems.
23382 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
23383 # Guess yes on native Windows.
23384 mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
23385 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
4a626d0a
PA
23386 esac
23387 if test "$cross_compiling" = yes; then :
23388 :
23389else
23390 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23391/* end confdefs.h. */
23392
23393 #include <wchar.h>
23394 static wchar_t wc;
23395 static mbstate_t mbs;
23396 int
23397 main (void)
23398 {
49e4877c 23399 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
4a626d0a
PA
23400 }
23401_ACEOF
23402if ac_fn_c_try_run "$LINENO"; then :
4a626d0a 23403 gl_cv_func_mbrtowc_empty_input=yes
49e4877c
PA
23404else
23405 gl_cv_func_mbrtowc_empty_input=no
4a626d0a
PA
23406fi
23407rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23408 conftest.$ac_objext conftest.beam conftest.$ac_ext
23409fi
23410
23411
23412fi
23413{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
23414$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
23415
49e4877c 23416
c0c3707f 23417 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
49e4877c 23418$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
5df4cba6 23419if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then :
49e4877c
PA
23420 $as_echo_n "(cached) " >&6
23421else
23422
5df4cba6 23423 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
49e4877c
PA
23424
23425 if test "$cross_compiling" = yes; then :
c0c3707f
CB
23426 case "$host_os" in
23427 # Guess yes on native Windows.
5df4cba6 23428 mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
c0c3707f
CB
23429 esac
23430
49e4877c
PA
23431else
23432 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23433/* end confdefs.h. */
23434#include <limits.h>
23435 #include <locale.h>
23436 #include <wchar.h>
23437
23438int
23439main ()
23440{
23441
23442 int i;
23443 char *locale = setlocale (LC_ALL, "C");
23444 if (! locale)
c0c3707f 23445 return 2;
49e4877c
PA
23446 for (i = CHAR_MIN; i <= CHAR_MAX; i++)
23447 {
23448 char c = i;
23449 wchar_t wc;
23450 mbstate_t mbs = { 0, };
23451 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
23452 if (1 < ss)
c0c3707f 23453 return 3;
49e4877c
PA
23454 }
23455 return 0;
23456
6ec2e0f5
SDJ
23457 ;
23458 return 0;
23459}
23460_ACEOF
23461if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23462 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes
6ec2e0f5 23463else
5df4cba6 23464 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no
6ec2e0f5
SDJ
23465fi
23466rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23467 conftest.$ac_objext conftest.beam conftest.$ac_ext
23468fi
23469
c0c3707f 23470
6ec2e0f5 23471fi
5df4cba6
SM
23472{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5
23473$as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; }
6ec2e0f5
SDJ
23474
23475 case "$gl_cv_func_mbrtowc_null_arg1" in
23476 *yes) ;;
23477 *)
23478$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
23479
23480 REPLACE_MBRTOWC=1
23481 ;;
23482 esac
23483 case "$gl_cv_func_mbrtowc_null_arg2" in
23484 *yes) ;;
23485 *)
23486$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
23487
23488 REPLACE_MBRTOWC=1
23489 ;;
23490 esac
23491 case "$gl_cv_func_mbrtowc_retval" in
23492 *yes) ;;
23493 *)
23494$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
23495
23496 REPLACE_MBRTOWC=1
23497 ;;
23498 esac
23499 case "$gl_cv_func_mbrtowc_nul_retval" in
23500 *yes) ;;
23501 *)
23502$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
23503
5df4cba6
SM
23504 REPLACE_MBRTOWC=1
23505 ;;
23506 esac
23507 case "$gl_cv_func_mbrtowc_stores_incomplete" in
23508 *no) ;;
23509 *)
23510$as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h
23511
23512 REPLACE_MBRTOWC=1
23513 ;;
23514 esac
23515 case "$gl_cv_func_mbrtowc_empty_input" in
23516 *yes) ;;
23517 *)
23518$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
23519
23520 REPLACE_MBRTOWC=1
23521 ;;
23522 esac
23523 case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
23524 *yes) ;;
23525 *)
23526$as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
23527
23528 REPLACE_MBRTOWC=1
23529 ;;
23530 esac
23531 fi
23532 fi
23533 if test $REPLACE_MBSTATE_T = 1; then
23534 case "$host_os" in
23535 mingw*) LIB_MBRTOWC= ;;
23536 *)
23537
23538
23539 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
23540$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
23541if ${gl_cv_have_weak+:} false; then :
23542 $as_echo_n "(cached) " >&6
23543else
23544 gl_cv_have_weak=no
23545 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23546/* end confdefs.h. */
23547extern void xyzzy ();
23548#pragma weak xyzzy
23549int
23550main ()
23551{
23552xyzzy();
23553 ;
23554 return 0;
23555}
23556_ACEOF
23557if ac_fn_c_try_link "$LINENO"; then :
23558 gl_cv_have_weak=maybe
23559fi
23560rm -f core conftest.err conftest.$ac_objext \
23561 conftest$ac_exeext conftest.$ac_ext
23562 if test $gl_cv_have_weak = maybe; then
23563 if test "$cross_compiling" = yes; then :
23564 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23565/* end confdefs.h. */
23566#ifdef __ELF__
23567 Extensible Linking Format
23568 #endif
23569
23570_ACEOF
23571if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
23572 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
23573 gl_cv_have_weak="guessing yes"
23574else
23575 gl_cv_have_weak="guessing no"
23576fi
23577rm -f conftest*
23578
23579
23580else
23581 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23582/* end confdefs.h. */
23583
23584#include <stdio.h>
23585#pragma weak fputs
23586int main ()
23587{
23588 return (fputs == NULL);
23589}
23590_ACEOF
23591if ac_fn_c_try_run "$LINENO"; then :
23592 gl_cv_have_weak=yes
23593else
23594 gl_cv_have_weak=no
23595fi
23596rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23597 conftest.$ac_objext conftest.beam conftest.$ac_ext
23598fi
23599
23600 fi
23601 case " $LDFLAGS " in
23602 *" -static "*) gl_cv_have_weak=no ;;
23603 esac
23604 case "$gl_cv_have_weak" in
23605 *yes)
23606 case "$host_os" in
23607 freebsd* | dragonfly*)
23608 : > conftest1.c
23609 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
23610 cat <<EOF > conftest2.c
23611#include <pthread.h>
23612#pragma weak pthread_mutexattr_gettype
23613int main ()
23614{
23615 return (pthread_mutexattr_gettype != NULL);
23616}
23617EOF
23618 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
23619 || gl_cv_have_weak=no
23620 rm -f conftest1.c libempty.so conftest2.c conftest
23621 ;;
23622 esac
23623 ;;
23624 esac
23625
23626fi
23627{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
23628$as_echo "$gl_cv_have_weak" >&6; }
23629 case "$gl_cv_have_weak" in
23630 *yes)
23631
23632$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
23633
23634 ;;
23635 esac
23636
23637 case "$gl_cv_have_weak" in
23638 *yes) LIB_MBRTOWC= ;;
23639 *) LIB_MBRTOWC="$LIBPTHREAD" ;;
23640 esac
23641 ;;
23642 esac
23643 else
23644 LIB_MBRTOWC=
23645 fi
23646
23647
23648 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
23649
23650
23651
23652
23653
23654
23655
23656
23657 gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
23658
23659 if test $REPLACE_MBSTATE_T = 1; then
23660
23661
23662
23663
23664
23665
23666
23667
23668 gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext"
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678 gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext"
23679
23680
23681
23682
23683 CFLAG_VISIBILITY=
23684 HAVE_VISIBILITY=0
23685 if test -n "$GCC"; then
23686 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
23687$as_echo_n "checking whether the -Werror option is usable... " >&6; }
23688if ${gl_cv_cc_vis_werror+:} false; then :
23689 $as_echo_n "(cached) " >&6
23690else
23691 gl_save_CFLAGS="$CFLAGS"
23692 CFLAGS="$CFLAGS -Werror"
23693 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23694/* end confdefs.h. */
23695
23696int
23697main ()
23698{
23699
23700 ;
23701 return 0;
23702}
23703_ACEOF
23704if ac_fn_c_try_compile "$LINENO"; then :
23705 gl_cv_cc_vis_werror=yes
23706else
23707 gl_cv_cc_vis_werror=no
23708fi
23709rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23710 CFLAGS="$gl_save_CFLAGS"
23711
23712fi
23713{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
23714$as_echo "$gl_cv_cc_vis_werror" >&6; }
23715 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
23716$as_echo_n "checking for simple visibility declarations... " >&6; }
23717if ${gl_cv_cc_visibility+:} false; then :
23718 $as_echo_n "(cached) " >&6
23719else
23720 gl_save_CFLAGS="$CFLAGS"
23721 CFLAGS="$CFLAGS -fvisibility=hidden"
23722 if test $gl_cv_cc_vis_werror = yes; then
23723 CFLAGS="$CFLAGS -Werror"
23724 fi
23725 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23726/* end confdefs.h. */
23727extern __attribute__((__visibility__("hidden"))) int hiddenvar;
23728 extern __attribute__((__visibility__("default"))) int exportedvar;
23729 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
23730 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
23731 void dummyfunc (void) {}
23732
23733int
23734main ()
23735{
6ec2e0f5 23736
5df4cba6
SM
23737 ;
23738 return 0;
23739}
23740_ACEOF
23741if ac_fn_c_try_compile "$LINENO"; then :
23742 gl_cv_cc_visibility=yes
23743else
23744 gl_cv_cc_visibility=no
23745fi
23746rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23747 CFLAGS="$gl_save_CFLAGS"
6ec2e0f5 23748
5df4cba6
SM
23749fi
23750{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
23751$as_echo "$gl_cv_cc_visibility" >&6; }
23752 if test $gl_cv_cc_visibility = yes; then
23753 CFLAG_VISIBILITY="-fvisibility=hidden"
23754 HAVE_VISIBILITY=1
6ec2e0f5
SDJ
23755 fi
23756 fi
23757
6ec2e0f5
SDJ
23758
23759
5df4cba6
SM
23760cat >>confdefs.h <<_ACEOF
23761#define HAVE_VISIBILITY $HAVE_VISIBILITY
23762_ACEOF
6ec2e0f5
SDJ
23763
23764
6ec2e0f5 23765
5df4cba6 23766 fi
6ec2e0f5 23767
c0c3707f 23768
6ec2e0f5
SDJ
23769 :
23770
23771 fi
23772
23773
23774
23775
23776
23777 GNULIB_MBRTOWC=1
23778
23779
23780
23781
23782
23783$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
5df4cba6
SM
23798
23799 if case "$host_os" in
23800 mingw*) true ;;
23801 *) test $ac_cv_func_mbsinit = yes ;;
23802 esac \
23803 && test $ac_cv_func_mbrtowc = yes; then
6ec2e0f5
SDJ
23804
23805
23806
c0c3707f 23807
6ec2e0f5
SDJ
23808 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
23809$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 23810if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
6ec2e0f5
SDJ
23811 $as_echo_n "(cached) " >&6
23812else
23813
23814 case "$host_os" in
23815 # Guess no on AIX and OSF/1.
23816 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
23817 # Guess yes otherwise.
23818 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
23819 esac
23820 if test $LOCALE_JA != none; then
23821 if test "$cross_compiling" = yes; then :
23822 :
23823else
23824 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23825/* end confdefs.h. */
23826
23827#include <locale.h>
23828#include <string.h>
23829/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23830 <wchar.h>.
23831 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23832 included before <wchar.h>. */
23833#include <stddef.h>
23834#include <stdio.h>
23835#include <time.h>
23836#include <wchar.h>
23837int main ()
23838{
23839 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23840 {
23841 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23842 mbstate_t state;
23843 wchar_t wc;
23844
23845 memset (&state, '\0', sizeof (mbstate_t));
23846 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23847 if (mbsinit (&state))
c0c3707f
CB
23848 return 2;
23849 }
23850 return 0;
23851}
23852_ACEOF
23853if ac_fn_c_try_run "$LINENO"; then :
23854 gl_cv_func_mbrtowc_incomplete_state=yes
23855else
23856 gl_cv_func_mbrtowc_incomplete_state=no
23857fi
23858rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23859 conftest.$ac_objext conftest.beam conftest.$ac_ext
23860fi
23861
23862 else
23863 if test $LOCALE_FR_UTF8 != none; then
23864 if test "$cross_compiling" = yes; then :
23865 :
23866else
23867 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23868/* end confdefs.h. */
23869
23870#include <locale.h>
23871#include <string.h>
23872/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23873 <wchar.h>.
23874 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23875 included before <wchar.h>. */
23876#include <stddef.h>
23877#include <stdio.h>
23878#include <time.h>
23879#include <wchar.h>
23880int main ()
23881{
23882 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23883 {
23884 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
23885 mbstate_t state;
23886 wchar_t wc;
23887
23888 memset (&state, '\0', sizeof (mbstate_t));
23889 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23890 if (mbsinit (&state))
23891 return 2;
6ec2e0f5
SDJ
23892 }
23893 return 0;
23894}
23895_ACEOF
23896if ac_fn_c_try_run "$LINENO"; then :
23897 gl_cv_func_mbrtowc_incomplete_state=yes
23898else
23899 gl_cv_func_mbrtowc_incomplete_state=no
23900fi
23901rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23902 conftest.$ac_objext conftest.beam conftest.$ac_ext
23903fi
23904
c0c3707f 23905 fi
6ec2e0f5
SDJ
23906 fi
23907
23908fi
23909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
23910$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
23911
23912
23913
23914
23915 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
23916$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 23917if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
6ec2e0f5
SDJ
23918 $as_echo_n "(cached) " >&6
23919else
23920
23921 case "$host_os" in
23922 # Guess no on Solaris 8.
23923 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
23924 # Guess yes otherwise.
23925 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
23926 esac
23927 if test $LOCALE_ZH_CN != none; then
23928 if test "$cross_compiling" = yes; then :
23929 :
23930else
23931 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23932/* end confdefs.h. */
23933
23934#include <locale.h>
23935#include <stdlib.h>
23936#include <string.h>
23937/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23938 <wchar.h>.
23939 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
23940 included before <wchar.h>. */
23941#include <stddef.h>
23942#include <stdio.h>
23943#include <time.h>
23944#include <wchar.h>
23945int main ()
23946{
23947 /* This fails on Solaris 8:
23948 mbrtowc returns 2, and sets wc to 0x00F0.
23949 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
23950 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23951 {
23952 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
23953 mbstate_t state;
23954 wchar_t wc;
23955
23956 memset (&state, '\0', sizeof (mbstate_t));
23957 if (mbrtowc (&wc, input + 3, 6, &state) != 4
23958 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 23959 return 2;
6ec2e0f5 23960 }
49e4877c
PA
23961 return 0;
23962}
23963_ACEOF
23964if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 23965 gl_cv_func_mbrtowc_sanitycheck=yes
49e4877c 23966else
6ec2e0f5 23967 gl_cv_func_mbrtowc_sanitycheck=no
49e4877c
PA
23968fi
23969rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23970 conftest.$ac_objext conftest.beam conftest.$ac_ext
23971fi
23972
6ec2e0f5
SDJ
23973 fi
23974
49e4877c 23975fi
6ec2e0f5
SDJ
23976{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
23977$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
49e4877c 23978
6ec2e0f5
SDJ
23979 REPLACE_MBSTATE_T=0
23980 case "$gl_cv_func_mbrtowc_incomplete_state" in
23981 *yes) ;;
23982 *) REPLACE_MBSTATE_T=1 ;;
23983 esac
23984 case "$gl_cv_func_mbrtowc_sanitycheck" in
23985 *yes) ;;
23986 *) REPLACE_MBSTATE_T=1 ;;
23987 esac
23988 else
23989 REPLACE_MBSTATE_T=1
23990 fi
8690e634 23991
8690e634 23992
8690e634 23993
6ec2e0f5
SDJ
23994 if test $ac_cv_func_mbsinit = no; then
23995 HAVE_MBSINIT=0
23996 ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
23997/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
23998 <wchar.h>.
23999 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
24000 included before <wchar.h>. */
24001#include <stddef.h>
24002#include <stdio.h>
24003#include <time.h>
24004#include <wchar.h>
8690e634 24005
6ec2e0f5 24006"
d0ac1c44 24007if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
6ec2e0f5
SDJ
24008 ac_have_decl=1
24009else
24010 ac_have_decl=0
24011fi
4a626d0a 24012
6ec2e0f5
SDJ
24013cat >>confdefs.h <<_ACEOF
24014#define HAVE_DECL_MBSINIT $ac_have_decl
24015_ACEOF
49e4877c 24016
6ec2e0f5
SDJ
24017 if test $ac_cv_have_decl_mbsinit = yes; then
24018 REPLACE_MBSINIT=1
24019 fi
24020 else
24021 if test $REPLACE_MBSTATE_T = 1; then
24022 REPLACE_MBSINIT=1
24023 else
24024 case "$host_os" in
24025 mingw*) REPLACE_MBSINIT=1 ;;
8690e634 24026 esac
c971b7fa
PA
24027 fi
24028 fi
24029
6ec2e0f5 24030 if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
c971b7fa 24031
c971b7fa 24032
c971b7fa
PA
24033
24034
24035
24036
24037
24038
6ec2e0f5 24039 gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
8690e634
JK
24040
24041
24042 :
c971b7fa 24043
a512b375 24044 fi
c971b7fa 24045
8690e634
JK
24046
24047
24048
24049
6ec2e0f5 24050 GNULIB_MBSINIT=1
8690e634
JK
24051
24052
24053
24054
8690e634 24055
6ec2e0f5 24056$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
8690e634
JK
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
c971b7fa 24068
c971b7fa 24069
5df4cba6
SM
24070
24071 if case "$host_os" in
24072 mingw*) true ;;
24073 *) test $ac_cv_func_mbsinit = yes ;;
24074 esac \
24075 && test $ac_cv_func_mbrtowc = yes; then
c971b7fa 24076
8690e634
JK
24077
24078
c0c3707f 24079
8690e634
JK
24080 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
24081$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 24082if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
8690e634
JK
24083 $as_echo_n "(cached) " >&6
24084else
24085
24086 case "$host_os" in
24087 # Guess no on AIX and OSF/1.
24088 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
24089 # Guess yes otherwise.
24090 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
24091 esac
24092 if test $LOCALE_JA != none; then
24093 if test "$cross_compiling" = yes; then :
24094 :
c971b7fa
PA
24095else
24096 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24097/* end confdefs.h. */
24098
8690e634
JK
24099#include <locale.h>
24100#include <string.h>
24101/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
24102 <wchar.h>.
24103 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
24104 included before <wchar.h>. */
24105#include <stddef.h>
24106#include <stdio.h>
24107#include <time.h>
24108#include <wchar.h>
24109int main ()
c971b7fa 24110{
8690e634 24111 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
c971b7fa 24112 {
8690e634
JK
24113 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
24114 mbstate_t state;
24115 wchar_t wc;
24116
24117 memset (&state, '\0', sizeof (mbstate_t));
24118 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24119 if (mbsinit (&state))
c0c3707f
CB
24120 return 2;
24121 }
24122 return 0;
24123}
24124_ACEOF
24125if ac_fn_c_try_run "$LINENO"; then :
24126 gl_cv_func_mbrtowc_incomplete_state=yes
24127else
24128 gl_cv_func_mbrtowc_incomplete_state=no
24129fi
24130rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24131 conftest.$ac_objext conftest.beam conftest.$ac_ext
24132fi
24133
24134 else
24135 if test $LOCALE_FR_UTF8 != none; then
24136 if test "$cross_compiling" = yes; then :
24137 :
24138else
24139 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24140/* end confdefs.h. */
24141
24142#include <locale.h>
24143#include <string.h>
24144/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
24145 <wchar.h>.
24146 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
24147 included before <wchar.h>. */
24148#include <stddef.h>
24149#include <stdio.h>
24150#include <time.h>
24151#include <wchar.h>
24152int main ()
24153{
24154 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24155 {
24156 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
24157 mbstate_t state;
24158 wchar_t wc;
24159
24160 memset (&state, '\0', sizeof (mbstate_t));
24161 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24162 if (mbsinit (&state))
24163 return 2;
c971b7fa 24164 }
c971b7fa
PA
24165 return 0;
24166}
24167_ACEOF
24168if ac_fn_c_try_run "$LINENO"; then :
8690e634 24169 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 24170else
8690e634 24171 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa
PA
24172fi
24173rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24174 conftest.$ac_objext conftest.beam conftest.$ac_ext
24175fi
24176
c0c3707f 24177 fi
8690e634 24178 fi
c971b7fa
PA
24179
24180fi
8690e634
JK
24181{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
24182$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa
PA
24183
24184
c971b7fa
PA
24185
24186
8690e634
JK
24187 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
24188$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 24189if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
24190 $as_echo_n "(cached) " >&6
24191else
8690e634
JK
24192
24193 case "$host_os" in
24194 # Guess no on Solaris 8.
24195 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
24196 # Guess yes otherwise.
24197 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
24198 esac
24199 if test $LOCALE_ZH_CN != none; then
24200 if test "$cross_compiling" = yes; then :
24201 :
24202else
c971b7fa
PA
24203 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24204/* end confdefs.h. */
8690e634
JK
24205
24206#include <locale.h>
24207#include <stdlib.h>
24208#include <string.h>
24209/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
24210 <wchar.h>.
24211 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
24212 included before <wchar.h>. */
c971b7fa 24213#include <stddef.h>
8690e634
JK
24214#include <stdio.h>
24215#include <time.h>
24216#include <wchar.h>
24217int main ()
c971b7fa 24218{
8690e634
JK
24219 /* This fails on Solaris 8:
24220 mbrtowc returns 2, and sets wc to 0x00F0.
24221 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
24222 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24223 {
24224 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
24225 mbstate_t state;
24226 wchar_t wc;
24227
24228 memset (&state, '\0', sizeof (mbstate_t));
24229 if (mbrtowc (&wc, input + 3, 6, &state) != 4
24230 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 24231 return 2;
8690e634 24232 }
c971b7fa
PA
24233 return 0;
24234}
24235_ACEOF
8690e634
JK
24236if ac_fn_c_try_run "$LINENO"; then :
24237 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 24238else
8690e634 24239 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 24240fi
8690e634
JK
24241rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24242 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24243fi
c971b7fa 24244
8690e634
JK
24245 fi
24246
24247fi
24248{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
24249$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
c971b7fa 24250
8690e634
JK
24251 REPLACE_MBSTATE_T=0
24252 case "$gl_cv_func_mbrtowc_incomplete_state" in
24253 *yes) ;;
24254 *) REPLACE_MBSTATE_T=1 ;;
24255 esac
24256 case "$gl_cv_func_mbrtowc_sanitycheck" in
24257 *yes) ;;
24258 *) REPLACE_MBSTATE_T=1 ;;
24259 esac
24260 else
24261 REPLACE_MBSTATE_T=1
c971b7fa
PA
24262 fi
24263
c971b7fa 24264
8690e634 24265
6ec2e0f5
SDJ
24266 if test $ac_cv_func_mbsrtowcs = no; then
24267 HAVE_MBSRTOWCS=0
24268 ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
8690e634
JK
24269/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
24270 <wchar.h>.
24271 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
24272 included before <wchar.h>. */
24273#include <stddef.h>
24274#include <stdio.h>
24275#include <time.h>
24276#include <wchar.h>
24277
24278"
d0ac1c44 24279if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then :
8690e634
JK
24280 ac_have_decl=1
24281else
24282 ac_have_decl=0
c971b7fa 24283fi
c971b7fa 24284
8690e634 24285cat >>confdefs.h <<_ACEOF
6ec2e0f5 24286#define HAVE_DECL_MBSRTOWCS $ac_have_decl
c971b7fa 24287_ACEOF
c971b7fa 24288
6ec2e0f5
SDJ
24289 if test $ac_cv_have_decl_mbsrtowcs = yes; then
24290 REPLACE_MBSRTOWCS=1
8690e634
JK
24291 fi
24292 else
24293 if test $REPLACE_MBSTATE_T = 1; then
6ec2e0f5 24294 REPLACE_MBSRTOWCS=1
8690e634 24295 else
6ec2e0f5
SDJ
24296
24297
24298
24299
24300
24301
24302 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
24303$as_echo_n "checking whether mbsrtowcs works... " >&6; }
d0ac1c44 24304if ${gl_cv_func_mbsrtowcs_works+:} false; then :
6ec2e0f5
SDJ
24305 $as_echo_n "(cached) " >&6
24306else
24307
24308 case "$host_os" in
24309 # Guess no on HP-UX, Solaris, mingw.
24310 hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
24311 # Guess yes otherwise.
24312 *) gl_cv_func_mbsrtowcs_works="guessing yes" ;;
24313 esac
24314 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
24315 if test "$cross_compiling" = yes; then :
24316 :
24317else
24318 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24319/* end confdefs.h. */
24320
24321#include <locale.h>
24322#include <string.h>
24323/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
24324 <wchar.h>.
24325 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
24326 included before <wchar.h>. */
24327#include <stddef.h>
24328#include <stdio.h>
24329#include <time.h>
24330#include <wchar.h>
24331int main ()
24332{
24333 int result = 0;
24334 /* Test whether the function supports a NULL destination argument.
24335 This fails on native Windows. */
24336 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
24337 {
24338 const char input[] = "\337er";
24339 const char *src = input;
24340 mbstate_t state;
24341
24342 memset (&state, '\0', sizeof (mbstate_t));
24343 if (mbsrtowcs (NULL, &src, 1, &state) != 3
24344 || src != input)
24345 result |= 1;
24346 }
24347 /* Test whether the function works when started with a conversion state
24348 in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
24349 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24350 {
24351 const char input[] = "B\303\274\303\237er";
24352 mbstate_t state;
24353
24354 memset (&state, '\0', sizeof (mbstate_t));
24355 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24356 if (!mbsinit (&state))
24357 {
24358 const char *src = input + 2;
24359 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24360 result |= 2;
24361 }
24362 }
24363 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
24364 {
24365 const char input[] = "<\306\374\313\334\270\354>";
24366 mbstate_t state;
24367
24368 memset (&state, '\0', sizeof (mbstate_t));
24369 if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
24370 if (!mbsinit (&state))
24371 {
24372 const char *src = input + 4;
24373 if (mbsrtowcs (NULL, &src, 10, &state) != 3)
24374 result |= 4;
24375 }
24376 }
24377 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24378 {
24379 const char input[] = "B\250\271\201\060\211\070er";
24380 mbstate_t state;
24381
24382 memset (&state, '\0', sizeof (mbstate_t));
24383 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24384 if (!mbsinit (&state))
24385 {
24386 const char *src = input + 2;
24387 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24388 result |= 8;
24389 }
24390 }
24391 return result;
24392}
24393_ACEOF
24394if ac_fn_c_try_run "$LINENO"; then :
24395 gl_cv_func_mbsrtowcs_works=yes
24396else
24397 gl_cv_func_mbsrtowcs_works=no
24398fi
24399rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24400 conftest.$ac_objext conftest.beam conftest.$ac_ext
24401fi
24402
24403 fi
24404
24405fi
24406{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
24407$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
24408
24409 case "$gl_cv_func_mbsrtowcs_works" in
24410 *yes) ;;
24411 *) REPLACE_MBSRTOWCS=1 ;;
8690e634
JK
24412 esac
24413 fi
24414 fi
c971b7fa 24415
6ec2e0f5 24416 if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
c971b7fa
PA
24417
24418
24419
24420
24421
24422
24423
24424
698be2d8
CB
24425 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
24436
24437
24438 :
24439
24440 fi
24441
24442
24443
24444
24445
24446 GNULIB_MBSRTOWCS=1
24447
24448
24449
24450
24451
24452$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
24453
24454
24455
24456
24457
24458
24459 for ac_func in mbtowc
24460do :
24461 ac_fn_c_check_func "$LINENO" "mbtowc" "ac_cv_func_mbtowc"
24462if test "x$ac_cv_func_mbtowc" = xyes; then :
24463 cat >>confdefs.h <<_ACEOF
24464#define HAVE_MBTOWC 1
24465_ACEOF
24466
24467fi
24468done
24469
24470 if test $ac_cv_func_mbtowc = no; then
24471 HAVE_MBTOWC=0
24472 else
24473 if false; then
24474 REPLACE_MBTOWC=1
24475 fi
24476 fi
6ec2e0f5 24477
698be2d8 24478 if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
6ec2e0f5
SDJ
24479
24480
24481
24482
24483
24484
24485
24486
698be2d8 24487 gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext"
c971b7fa
PA
24488
24489
8690e634 24490 :
c971b7fa 24491
a512b375 24492 fi
c971b7fa 24493
c971b7fa 24494
c971b7fa 24495
c971b7fa
PA
24496
24497
698be2d8 24498 GNULIB_MBTOWC=1
c971b7fa 24499
c971b7fa
PA
24500
24501
24502
24503
698be2d8 24504$as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
c971b7fa
PA
24505
24506
c971b7fa 24507
c971b7fa 24508
6ec2e0f5 24509 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
c971b7fa
PA
24510
24511
24512
c971b7fa 24513
c971b7fa
PA
24514
24515
24516
24517
6ec2e0f5 24518 gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
8690e634 24519
c971b7fa 24520
6ec2e0f5
SDJ
24521 for ac_header in bp-sym.h
24522do :
24523 ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
d0ac1c44 24524if test "x$ac_cv_header_bp_sym_h" = xyes; then :
6ec2e0f5
SDJ
24525 cat >>confdefs.h <<_ACEOF
24526#define HAVE_BP_SYM_H 1
24527_ACEOF
c971b7fa 24528
6ec2e0f5 24529fi
c971b7fa 24530
6ec2e0f5
SDJ
24531done
24532
24533
24534 fi
24535
24536
24537
24538
24539
24540 GNULIB_MEMCHR=1
24541
24542
24543
24544
24545
24546$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
24547
24548
24549
24550
24551
24552 if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
24553 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5
24554$as_echo_n "checking whether memmem works in linear time... " >&6; }
d0ac1c44 24555if ${gl_cv_func_memmem_works_fast+:} false; then :
8690e634
JK
24556 $as_echo_n "(cached) " >&6
24557else
6ec2e0f5
SDJ
24558 if test "$cross_compiling" = yes; then :
24559 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24560/* end confdefs.h. */
24561
24562#include <features.h>
24563#ifdef __GNU_LIBRARY__
24564 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
24565 && !defined __UCLIBC__
24566 Lucky user
24567 #endif
24568#endif
24569#ifdef __CYGWIN__
24570 #include <cygwin/version.h>
24571 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
24572 Lucky user
24573 #endif
24574#endif
24575
24576_ACEOF
24577if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24578 $EGREP "Lucky user" >/dev/null 2>&1; then :
24579 gl_cv_func_memmem_works_fast="guessing yes"
24580else
c0c3707f 24581 gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"
6ec2e0f5
SDJ
24582fi
24583rm -f conftest*
24584
c971b7fa 24585
8690e634
JK
24586else
24587 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 24588/* end confdefs.h. */
c971b7fa 24589
6ec2e0f5
SDJ
24590#include <signal.h> /* for signal */
24591#include <string.h> /* for memmem */
24592#include <stdlib.h> /* for malloc */
24593#include <unistd.h> /* for alarm */
24594static void quit (int sig) { _exit (sig + 128); }
24595
24596int
24597main ()
8690e634 24598{
8690e634 24599
6ec2e0f5
SDJ
24600 int result = 0;
24601 size_t m = 1000000;
24602 char *haystack = (char *) malloc (2 * m + 1);
24603 char *needle = (char *) malloc (m + 1);
24604 /* Failure to compile this test due to missing alarm is okay,
24605 since all such platforms (mingw) also lack memmem. */
24606 signal (SIGALRM, quit);
24607 alarm (5);
24608 /* Check for quadratic performance. */
24609 if (haystack && needle)
24610 {
24611 memset (haystack, 'A', 2 * m);
24612 haystack[2 * m] = 'B';
24613 memset (needle, 'A', m);
24614 needle[m] = 'B';
24615 if (!memmem (haystack, 2 * m + 1, needle, m + 1))
24616 result |= 1;
24617 }
c0c3707f
CB
24618 /* Free allocated memory, in case some sanitizer is watching. */
24619 free (haystack);
24620 free (needle);
6ec2e0f5
SDJ
24621 return result;
24622
24623 ;
c971b7fa
PA
24624 return 0;
24625}
24626_ACEOF
8690e634 24627if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24628 gl_cv_func_memmem_works_fast=yes
8690e634 24629else
6ec2e0f5 24630 gl_cv_func_memmem_works_fast=no
8690e634
JK
24631fi
24632rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24633 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24634fi
c971b7fa
PA
24635
24636
8690e634 24637fi
6ec2e0f5
SDJ
24638{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5
24639$as_echo "$gl_cv_func_memmem_works_fast" >&6; }
24640 case "$gl_cv_func_memmem_works_fast" in
24641 *yes) ;;
24642 *)
24643 REPLACE_MEMMEM=1
24644 ;;
24645 esac
24646 fi
c971b7fa 24647
6ec2e0f5 24648 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
8690e634
JK
24649
24650
24651
6ec2e0f5
SDJ
24652
24653
24654
24655
24656
24657 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
24658
24659 fi
24660
24661
24662
24663
24664 for ac_func in memmem
24665do :
24666 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
d0ac1c44 24667if test "x$ac_cv_func_memmem" = xyes; then :
6ec2e0f5
SDJ
24668 cat >>confdefs.h <<_ACEOF
24669#define HAVE_MEMMEM 1
24670_ACEOF
24671
24672fi
24673done
24674
24675 if test $ac_cv_func_memmem = yes; then
24676 HAVE_MEMMEM=1
24677 else
24678 HAVE_MEMMEM=0
24679 fi
24680
24681 if test $ac_cv_have_decl_memmem = no; then
24682 HAVE_DECL_MEMMEM=0
24683 else
24684 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
24685$as_echo_n "checking whether memmem works... " >&6; }
d0ac1c44 24686if ${gl_cv_func_memmem_works_always+:} false; then :
c971b7fa
PA
24687 $as_echo_n "(cached) " >&6
24688else
6ec2e0f5
SDJ
24689 if test "$cross_compiling" = yes; then :
24690 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24691/* end confdefs.h. */
24692
24693#ifdef __GNU_LIBRARY__
24694 #include <features.h>
24695 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
24696 || __GLIBC_MINOR__ > 12)) \
24697 || (__GLIBC__ > 2)) \
24698 || defined __UCLIBC__
24699 Lucky user
24700 #endif
24701#elif defined __CYGWIN__
24702 #include <cygwin/version.h>
24703 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
24704 Lucky user
24705 #endif
24706#else
24707 Lucky user
24708#endif
24709
24710_ACEOF
24711if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24712 $EGREP "Lucky user" >/dev/null 2>&1; then :
24713 gl_cv_func_memmem_works_always="guessing yes"
24714else
c0c3707f 24715 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
6ec2e0f5
SDJ
24716fi
24717rm -f conftest*
24718
8690e634 24719
8690e634 24720else
c971b7fa
PA
24721 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24722/* end confdefs.h. */
c971b7fa 24723
6ec2e0f5
SDJ
24724#include <string.h> /* for memmem */
24725#define P "_EF_BF_BD"
24726#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
24727#define NEEDLE P P P P P
24728
24729int
24730main ()
c971b7fa 24731{
8690e634 24732
6ec2e0f5
SDJ
24733 int result = 0;
24734 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
24735 result |= 1;
24736 /* Check for empty needle behavior. */
24737 {
24738 const char *haystack = "AAA";
698be2d8 24739 if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
6ec2e0f5 24740 result |= 2;
8690e634 24741 }
6ec2e0f5
SDJ
24742 return result;
24743
24744 ;
c971b7fa
PA
24745 return 0;
24746}
24747_ACEOF
8690e634 24748if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24749 gl_cv_func_memmem_works_always=yes
c971b7fa 24750else
6ec2e0f5 24751 gl_cv_func_memmem_works_always=no
c971b7fa 24752fi
8690e634
JK
24753rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24754 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24755fi
8690e634 24756
8690e634
JK
24757
24758fi
6ec2e0f5
SDJ
24759{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
24760$as_echo "$gl_cv_func_memmem_works_always" >&6; }
24761 case "$gl_cv_func_memmem_works_always" in
8690e634 24762 *yes) ;;
6ec2e0f5
SDJ
24763 *)
24764 REPLACE_MEMMEM=1
24765 ;;
8690e634 24766 esac
c971b7fa 24767 fi
6ec2e0f5 24768 :
c971b7fa 24769
6ec2e0f5 24770 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
c971b7fa 24771
c971b7fa 24772
8690e634 24773
c971b7fa 24774
6ec2e0f5
SDJ
24775
24776
24777
24778
24779 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
24780
24781 fi
24782
24783
24784
24785
24786
24787 GNULIB_MEMMEM=1
24788
24789
24790
24791
24792
24793$as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803 for ac_func in mempcpy
24804do :
24805 ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
d0ac1c44 24806if test "x$ac_cv_func_mempcpy" = xyes; then :
6ec2e0f5
SDJ
24807 cat >>confdefs.h <<_ACEOF
24808#define HAVE_MEMPCPY 1
8690e634 24809_ACEOF
c971b7fa 24810
6ec2e0f5
SDJ
24811fi
24812done
c971b7fa 24813
6ec2e0f5
SDJ
24814 if test $ac_cv_func_mempcpy = no; then
24815 HAVE_MEMPCPY=0
24816 fi
8690e634 24817
6ec2e0f5 24818 if test $HAVE_MEMPCPY = 0; then
8690e634
JK
24819
24820
24821
24822
8690e634 24823
6ec2e0f5
SDJ
24824
24825
24826
24827 gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
24828
24829
8690e634 24830 :
c971b7fa 24831
6ec2e0f5 24832 fi
c971b7fa 24833
8690e634 24834
8690e634 24835
8690e634 24836
6ec2e0f5
SDJ
24837
24838 GNULIB_MEMPCPY=1
24839
24840
24841
24842
24843
24844$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
24845
24846
24847
24848
24849
24850
24851
24852
24853 if test $ac_cv_have_decl_memrchr = no; then
24854 HAVE_DECL_MEMRCHR=0
24855 fi
24856
24857 for ac_func in memrchr
24858do :
24859 ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
d0ac1c44 24860if test "x$ac_cv_func_memrchr" = xyes; then :
6ec2e0f5
SDJ
24861 cat >>confdefs.h <<_ACEOF
24862#define HAVE_MEMRCHR 1
c971b7fa 24863_ACEOF
6ec2e0f5 24864
c971b7fa 24865fi
6ec2e0f5 24866done
8690e634 24867
8690e634 24868
6ec2e0f5 24869 if test $ac_cv_func_memrchr = no; then
8690e634 24870
6ec2e0f5
SDJ
24871
24872
24873
24874
24875
24876
24877
24878 gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
24879
24880 :
c971b7fa
PA
24881 fi
24882
24883
c971b7fa 24884
c971b7fa 24885
c971b7fa 24886
6ec2e0f5
SDJ
24887 GNULIB_MEMRCHR=1
24888
24889
24890
24891
24892
24893$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
24894
24895
24896
24897
2d8adcbd 24898
698be2d8
CB
24899
24900
24901
8a99096f
SM
24902 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
24903$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
24904if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then :
24905 $as_echo_n "(cached) " >&6
24906else
24907 rm -rf conftest.dir
24908 if test "$cross_compiling" = yes; then :
24909 case "$host_os" in
c0c3707f
CB
24910 # Guess yes on Linux systems.
24911 linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
24912 # Guess yes on glibc systems.
24913 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
24914 # Guess yes on MSVC, no on mingw.
24915 mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24916/* end confdefs.h. */
24917
24918#ifdef _MSC_VER
24919 Known
24920#endif
24921
24922_ACEOF
24923if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24924 $EGREP "Known" >/dev/null 2>&1; then :
24925 gl_cv_func_mkdir_trailing_slash_works="guessing yes"
24926else
24927 gl_cv_func_mkdir_trailing_slash_works="guessing no"
24928fi
24929rm -f conftest*
24930
24931 ;;
24932 # If we don't know, obey --enable-cross-guesses.
24933 *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
8a99096f
SM
24934 esac
24935
24936else
24937 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24938/* end confdefs.h. */
24939
24940# include <sys/types.h>
24941# include <sys/stat.h>
24942
24943int
24944main ()
24945{
24946return mkdir ("conftest.dir/", 0700);
24947 ;
24948 return 0;
24949}
24950_ACEOF
24951if ac_fn_c_try_run "$LINENO"; then :
24952 gl_cv_func_mkdir_trailing_slash_works=yes
24953else
24954 gl_cv_func_mkdir_trailing_slash_works=no
24955fi
24956rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24957 conftest.$ac_objext conftest.beam conftest.$ac_ext
24958fi
24959
24960 rm -rf conftest.dir
24961
24962
24963fi
24964{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
24965$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
24966 case "$gl_cv_func_mkdir_trailing_slash_works" in
24967 *yes) ;;
24968 *)
24969 REPLACE_MKDIR=1
24970 ;;
24971 esac
24972
24973 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
24974$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
24975if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then :
24976 $as_echo_n "(cached) " >&6
24977else
24978 rm -rf conftest.dir
24979 if test "$cross_compiling" = yes; then :
24980 case "$host_os" in
c0c3707f
CB
24981 # Guess yes on glibc systems.
24982 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
24983 # Guess yes on musl systems.
24984 *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
24985 # Guess no on native Windows.
24986 mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
24987 # If we don't know, obey --enable-cross-guesses.
24988 *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
8a99096f
SM
24989 esac
24990
24991else
24992 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24993/* end confdefs.h. */
24994
24995# include <sys/types.h>
24996# include <sys/stat.h>
24997
24998int
24999main ()
25000{
25001return !mkdir ("conftest.dir/./", 0700);
25002 ;
25003 return 0;
25004}
25005_ACEOF
25006if ac_fn_c_try_run "$LINENO"; then :
25007 gl_cv_func_mkdir_trailing_dot_works=yes
25008else
25009 gl_cv_func_mkdir_trailing_dot_works=no
25010fi
25011rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25012 conftest.$ac_objext conftest.beam conftest.$ac_ext
25013fi
25014
25015 rm -rf conftest.dir
25016
25017
25018fi
25019{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
25020$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
25021 case "$gl_cv_func_mkdir_trailing_dot_works" in
25022 *yes) ;;
25023 *)
25024 REPLACE_MKDIR=1
25025
25026$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
25027
25028 ;;
25029 esac
25030
25031 if test $REPLACE_MKDIR = 1; then
25032
25033
25034
25035
25036
25037
25038
25039
25040 gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
25041
25042 fi
25043
25044
e8d8cce6
SM
25045 for ac_func in mkdtemp
25046do :
25047 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
25048if test "x$ac_cv_func_mkdtemp" = xyes; then :
25049 cat >>confdefs.h <<_ACEOF
25050#define HAVE_MKDTEMP 1
25051_ACEOF
25052
25053fi
25054done
25055
25056 if test $ac_cv_func_mkdtemp = no; then
25057 HAVE_MKDTEMP=0
25058 fi
25059
25060 if test $HAVE_MKDTEMP = 0; then
25061
25062
25063
25064
25065
25066
25067
25068
25069 gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext"
25070
25071 :
25072
25073 fi
25074
25075
25076
25077
25078
25079 GNULIB_MKDTEMP=1
25080
25081
25082
25083
25084
25085$as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
25086
25087
25088
25089
25090
2d8adcbd
MM
25091
25092
b3279b60
TT
25093
25094
b3279b60
TT
25095 if test $ac_cv_func_mkostemp != yes; then
25096 HAVE_MKOSTEMP=0
25097 fi
2d8adcbd 25098
b3279b60 25099 if test $HAVE_MKOSTEMP = 0; then
2d8adcbd 25100
2d8adcbd 25101
2d8adcbd 25102
2d8adcbd 25103
2d8adcbd
MM
25104
25105
25106
25107
b3279b60 25108 gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
2d8adcbd
MM
25109
25110
25111
b3279b60 25112 fi
2d8adcbd 25113
2d8adcbd 25114
b3279b60
TT
25115cat >>confdefs.h <<_ACEOF
25116#define GNULIB_MKOSTEMP 1
25117_ACEOF
2d8adcbd
MM
25118
25119
2d8adcbd
MM
25120
25121
25122
25123
25124
b3279b60 25125 GNULIB_MKOSTEMP=1
2d8adcbd
MM
25126
25127
25128
25129
25130
b3279b60 25131$as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h
2d8adcbd
MM
25132
25133
25134
25135
6ec2e0f5
SDJ
25136 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
25137
25138
25139
c971b7fa 25140
c971b7fa 25141
c971b7fa
PA
25142
25143
8690e634 25144
6ec2e0f5 25145 gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
8690e634 25146
6ec2e0f5 25147 fi
8690e634 25148
6ec2e0f5 25149 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
8690e634
JK
25150
25151
25152
25153
25154
25155
8690e634
JK
25156
25157
6ec2e0f5 25158 gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
8690e634 25159
a512b375 25160 fi
8690e634
JK
25161
25162
c0c3707f
CB
25163cat >>confdefs.h <<_ACEOF
25164#define GNULIB_MSVC_NOTHROW 1
25165_ACEOF
25166
25167
25168
25169
725e2999
JB
25170 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
25171$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
25172if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
25173 $as_echo_n "(cached) " >&6
25174else
25175
25176 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25177/* end confdefs.h. */
25178#include <netinet/in.h>
25179int
25180main ()
25181{
25182
25183 ;
25184 return 0;
25185}
25186_ACEOF
25187if ac_fn_c_try_compile "$LINENO"; then :
25188 gl_cv_header_netinet_in_h_selfcontained=yes
25189else
25190 gl_cv_header_netinet_in_h_selfcontained=no
25191fi
25192rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25193
25194fi
25195{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
25196$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
25197 if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
25198 NETINET_IN_H=''
25199 else
25200 NETINET_IN_H='netinet/in.h'
25201 for ac_header in netinet/in.h
25202do :
25203 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
25204if test "x$ac_cv_header_netinet_in_h" = xyes; then :
25205 cat >>confdefs.h <<_ACEOF
25206#define HAVE_NETINET_IN_H 1
25207_ACEOF
25208
25209fi
25210
25211done
25212
25213
25214
25215
25216
25217
25218
725e2999
JB
25219
25220
25221
25222 if test $gl_cv_have_include_next = yes; then
25223 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
25224 else
25225 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
25226$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
25227if ${gl_cv_next_netinet_in_h+:} false; then :
25228 $as_echo_n "(cached) " >&6
25229else
25230
25231 if test $ac_cv_header_netinet_in_h = yes; then
25232
25233
25234
25235
25236 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25237/* end confdefs.h. */
25238#include <netinet/in.h>
25239_ACEOF
25240 case "$host_os" in
25241 aix*) gl_absname_cpp="$ac_cpp -C" ;;
25242 *) gl_absname_cpp="$ac_cpp" ;;
25243 esac
25244
25245 case "$host_os" in
25246 mingw*)
25247 gl_dirsep_regex='[/\\]'
25248 ;;
25249 *)
25250 gl_dirsep_regex='\/'
25251 ;;
25252 esac
25253 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
25254 gl_header_literal_regex=`echo 'netinet/in.h' \
25255 | sed -e "$gl_make_literal_regex_sed"`
25256 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
25257 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
25258 s|^/[^/]|//&|
25259 p
25260 q
25261 }'
25262
25263 gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
25264 sed -n "$gl_absolute_header_sed"`
25265
25266 gl_header=$gl_cv_absolute_netinet_in_h
25267 gl_cv_next_netinet_in_h='"'$gl_header'"'
25268 else
25269 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
25270 fi
25271
25272
25273fi
25274{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
25275$as_echo "$gl_cv_next_netinet_in_h" >&6; }
25276 fi
25277 NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
25278
25279 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
25280 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
25281 gl_next_as_first_directive='<'netinet/in.h'>'
25282 else
25283 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
25284 gl_next_as_first_directive=$gl_cv_next_netinet_in_h
25285 fi
25286 NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
25287
25288
25289
25290
25291 if test $ac_cv_header_netinet_in_h = yes; then
25292 HAVE_NETINET_IN_H=1
25293 else
25294 HAVE_NETINET_IN_H=0
25295 fi
25296
25297 fi
25298
25299 if test -n "$NETINET_IN_H"; then
25300 GL_GENERATE_NETINET_IN_H_TRUE=
25301 GL_GENERATE_NETINET_IN_H_FALSE='#'
25302else
25303 GL_GENERATE_NETINET_IN_H_TRUE='#'
25304 GL_GENERATE_NETINET_IN_H_FALSE=
25305fi
25306
25307
25308
25309
8690e634 25310
c0c3707f 25311
6ec2e0f5
SDJ
25312 case "$host_os" in
25313 mingw* | pw*)
25314 REPLACE_OPEN=1
25315 ;;
25316 *)
25317
c0c3707f
CB
25318 if test "$gl_cv_macro_O_CLOEXEC" != yes; then
25319 REPLACE_OPEN=1
25320 fi
472fa5ee
SM
25321
25322
c0c3707f 25323 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
6ec2e0f5 25324$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
d0ac1c44 25325if ${gl_cv_func_open_slash+:} false; then :
6ec2e0f5
SDJ
25326 $as_echo_n "(cached) " >&6
25327else
25328 # Assume that if we have lstat, we can also check symlinks.
c0c3707f
CB
25329 if test $ac_cv_func_lstat = yes; then
25330 touch conftest.tmp
25331 ln -s conftest.tmp conftest.lnk
25332 fi
25333 if test "$cross_compiling" = yes; then :
8690e634 25334
c0c3707f
CB
25335 case "$host_os" in
25336 freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
25337 gl_cv_func_open_slash="guessing no" ;;
25338 *)
25339 gl_cv_func_open_slash="guessing yes" ;;
25340 esac
8690e634 25341
6ec2e0f5
SDJ
25342else
25343 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25344/* end confdefs.h. */
25345
25346#include <fcntl.h>
25347#if HAVE_UNISTD_H
25348# include <unistd.h>
25349#endif
25350int main ()
25351{
25352 int result = 0;
25353#if HAVE_LSTAT
25354 if (open ("conftest.lnk/", O_RDONLY) != -1)
25355 result |= 1;
25356#endif
25357 if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
25358 result |= 2;
25359 return result;
25360}
25361_ACEOF
25362if ac_fn_c_try_run "$LINENO"; then :
25363 gl_cv_func_open_slash=yes
25364else
25365 gl_cv_func_open_slash=no
25366fi
25367rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25368 conftest.$ac_objext conftest.beam conftest.$ac_ext
25369fi
8690e634 25370
c0c3707f 25371 rm -f conftest.sl conftest.tmp conftest.lnk
8690e634 25372
6ec2e0f5
SDJ
25373fi
25374{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
25375$as_echo "$gl_cv_func_open_slash" >&6; }
c0c3707f
CB
25376 case "$gl_cv_func_open_slash" in
25377 *no)
8690e634 25378
6ec2e0f5 25379$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
8690e634 25380
6ec2e0f5
SDJ
25381 ;;
25382 esac
8690e634 25383
c0c3707f
CB
25384 case "$gl_cv_func_open_slash" in
25385 *no)
25386 REPLACE_OPEN=1
25387 ;;
25388 esac
25389 ;;
25390 esac
472fa5ee 25391
c0c3707f 25392 if test $REPLACE_OPEN = 0; then
472fa5ee
SM
25393
25394
25395
6ec2e0f5
SDJ
25396 if test $ac_cv_func_fchdir = no; then
25397 HAVE_FCHDIR=0
25398 fi
c971b7fa 25399
6ec2e0f5
SDJ
25400 if test $HAVE_FCHDIR = 0; then
25401 REPLACE_OPEN=1
25402 fi
25403 fi
c971b7fa
PA
25404
25405
25406
6ec2e0f5 25407 if test $REPLACE_OPEN = 1; then
c971b7fa
PA
25408
25409
25410
25411
25412
c971b7fa
PA
25413
25414
c971b7fa 25415
6ec2e0f5 25416 gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
c971b7fa 25417
c971b7fa
PA
25418
25419
6ec2e0f5
SDJ
25420 :
25421
a512b375 25422 fi
c971b7fa
PA
25423
25424
25425
25426
25427
6ec2e0f5 25428 GNULIB_OPEN=1
c971b7fa
PA
25429
25430
25431
25432
25433
6ec2e0f5 25434$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
c971b7fa
PA
25435
25436
25437
25438
25439
c971b7fa 25440
c971b7fa 25441
472fa5ee 25442
63ce7108 25443
c0c3707f
CB
25444 case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
25445 yes+*yes+yes)
6ec2e0f5
SDJ
25446 ;;
25447 yes+*)
c0c3707f 25448 # Solaris 10 lacks O_CLOEXEC.
6ec2e0f5
SDJ
25449 # Solaris 9 has *at functions, but uniformly mishandles trailing
25450 # slash in all of them.
25451 REPLACE_OPENAT=1
25452 ;;
25453 *)
25454 HAVE_OPENAT=0
25455 ;;
25456 esac
63ce7108 25457
6ec2e0f5 25458 if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
63ce7108 25459
63ce7108 25460
63ce7108 25461
63ce7108 25462
63ce7108
TT
25463
25464
63ce7108 25465
63ce7108 25466
6ec2e0f5 25467 gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
63ce7108
TT
25468
25469
25470
6ec2e0f5 25471 :
63ce7108 25472
6ec2e0f5 25473 fi
63ce7108
TT
25474
25475
6ec2e0f5
SDJ
25476cat >>confdefs.h <<_ACEOF
25477#define GNULIB_OPENAT 1
25478_ACEOF
63ce7108 25479
63ce7108 25480
63ce7108
TT
25481
25482
25483
25484
6ec2e0f5 25485 GNULIB_OPENAT=1
63ce7108 25486
63ce7108 25487
63ce7108 25488
63ce7108 25489
63ce7108 25490
6ec2e0f5 25491$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
63ce7108
TT
25492
25493
63ce7108 25494
63ce7108 25495
63ce7108 25496
63ce7108 25497
6ec2e0f5
SDJ
25498 for ac_func in opendir
25499do :
25500 ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
d0ac1c44 25501if test "x$ac_cv_func_opendir" = xyes; then :
6ec2e0f5
SDJ
25502 cat >>confdefs.h <<_ACEOF
25503#define HAVE_OPENDIR 1
63ce7108 25504_ACEOF
6ec2e0f5 25505
63ce7108 25506fi
6ec2e0f5 25507done
63ce7108 25508
6ec2e0f5
SDJ
25509 if test $ac_cv_func_opendir = no; then
25510 HAVE_OPENDIR=0
25511 fi
63ce7108 25512
6ec2e0f5
SDJ
25513
25514
25515
25516 if test $ac_cv_func_fchdir = no; then
25517 HAVE_FCHDIR=0
63ce7108 25518 fi
63ce7108 25519
6ec2e0f5
SDJ
25520 if test $HAVE_FCHDIR = 0; then
25521 if test $HAVE_OPENDIR = 1; then
25522 REPLACE_OPENDIR=1
25523 fi
25524 fi
25525
25526 case $host_os,$HAVE_OPENDIR in
25527 os2*,1)
25528 REPLACE_OPENDIR=1;;
25529 esac
25530
25531 if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
63ce7108
TT
25532
25533
25534
25535
25536
25537
25538
25539
6ec2e0f5 25540 gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
63ce7108
TT
25541
25542 fi
25543
25544
25545
25546
25547
6ec2e0f5 25548 GNULIB_OPENDIR=1
63ce7108
TT
25549
25550
25551
25552
63ce7108 25553
6ec2e0f5 25554$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
63ce7108
TT
25555
25556
25557
25558
25559
25560
25561
2196f55f
YQ
25562
25563
8424cc97
SM
25564
25565 for ac_func in rawmemchr
25566do :
25567 ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
d0ac1c44 25568if test "x$ac_cv_func_rawmemchr" = xyes; then :
8424cc97
SM
25569 cat >>confdefs.h <<_ACEOF
25570#define HAVE_RAWMEMCHR 1
25571_ACEOF
25572
25573fi
25574done
25575
25576 if test $ac_cv_func_rawmemchr = no; then
25577 HAVE_RAWMEMCHR=0
25578 fi
25579
25580 if test $HAVE_RAWMEMCHR = 0; then
25581
25582
25583
25584
25585
25586
25587
25588
25589 gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
25590
25591 :
25592 fi
25593
25594
25595
25596
25597
25598 GNULIB_RAWMEMCHR=1
25599
25600
25601
25602
25603
25604$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
25605
25606
25607
25608
25609
25610
6ec2e0f5
SDJ
25611 for ac_func in readdir
25612do :
25613 ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
d0ac1c44 25614if test "x$ac_cv_func_readdir" = xyes; then :
6ec2e0f5
SDJ
25615 cat >>confdefs.h <<_ACEOF
25616#define HAVE_READDIR 1
25617_ACEOF
25618
25619fi
25620done
25621
25622 if test $ac_cv_func_readdir = no; then
25623 HAVE_READDIR=0
25624 fi
25625
25626 if test $HAVE_READDIR = 0; then
25627
25628
25629
25630
25631
25632
25633
25634
25635 gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
25636
25637 fi
25638
25639
25640
25641
25642
25643 GNULIB_READDIR=1
25644
25645
25646
25647
25648
25649$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
25650
25651
25652
25653
25654
25655
2196f55f
YQ
25656 if test $ac_cv_func_readlink = no; then
25657 HAVE_READLINK=0
25658 else
25659 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
25660$as_echo_n "checking whether readlink signature is correct... " >&6; }
d0ac1c44 25661if ${gl_cv_decl_readlink_works+:} false; then :
2196f55f
YQ
25662 $as_echo_n "(cached) " >&6
25663else
25664 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25665/* end confdefs.h. */
25666#include <unistd.h>
25667 /* Cause compilation failure if original declaration has wrong type. */
25668 ssize_t readlink (const char *, char *, size_t);
25669int
25670main ()
25671{
25672
25673 ;
25674 return 0;
25675}
25676_ACEOF
25677if ac_fn_c_try_compile "$LINENO"; then :
25678 gl_cv_decl_readlink_works=yes
25679else
25680 gl_cv_decl_readlink_works=no
25681fi
25682rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25683fi
25684{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
25685$as_echo "$gl_cv_decl_readlink_works" >&6; }
25686 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
25687$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
d0ac1c44 25688if ${gl_cv_func_readlink_works+:} false; then :
2196f55f
YQ
25689 $as_echo_n "(cached) " >&6
25690else
25691 # We have readlink, so assume ln -s works.
25692 ln -s conftest.no-such conftest.link
25693 ln -s conftest.link conftest.lnk2
25694 if test "$cross_compiling" = yes; then :
25695 case "$host_os" in
c0c3707f
CB
25696 # Guess yes on Linux systems.
25697 linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
25698 # Guess yes on glibc systems.
25699 *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;;
25700 # If we don't know, obey --enable-cross-guesses.
25701 *) gl_cv_func_readlink_works="$gl_cross_guess_normal" ;;
2196f55f
YQ
25702 esac
25703
25704else
25705 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25706/* end confdefs.h. */
25707#include <unistd.h>
25708
25709int
25710main ()
25711{
25712char buf[20];
25713 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
25714 ;
25715 return 0;
25716}
25717_ACEOF
25718if ac_fn_c_try_run "$LINENO"; then :
25719 gl_cv_func_readlink_works=yes
25720else
25721 gl_cv_func_readlink_works=no
25722fi
25723rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25724 conftest.$ac_objext conftest.beam conftest.$ac_ext
25725fi
25726
25727 rm -f conftest.link conftest.lnk2
25728fi
25729{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
25730$as_echo "$gl_cv_func_readlink_works" >&6; }
25731 case "$gl_cv_func_readlink_works" in
25732 *yes)
25733 if test "$gl_cv_decl_readlink_works" != yes; then
25734 REPLACE_READLINK=1
25735 fi
25736 ;;
25737 *)
25738
25739$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
25740
25741 REPLACE_READLINK=1
25742 ;;
25743 esac
25744 fi
25745
25746 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
25747
25748
25749
25750
25751
25752
25753
25754
25755 gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
25756
25757
25758 :
25759
25760 fi
25761
25762
25763
25764
25765
25766 GNULIB_READLINK=1
25767
25768
25769
25770
25771
25772$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
25773
25774
25775
25776
6a29c58e
YQ
25777
25778
6ec2e0f5
SDJ
25779 if test $gl_cv_func_malloc_posix = yes; then
25780
25781$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
25782
25783 else
25784 REPLACE_REALLOC=1
25785 fi
25786
25787 if test $REPLACE_REALLOC = 1; then
25788
25789
25790
25791
25792
25793
25794
25795
25796 gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
25797
25798 fi
25799
25800
25801
25802
25803
25804 GNULIB_REALLOC_POSIX=1
25805
25806
25807
25808
25809
25810$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
25811
25812
25813
25814
25815
25816
6a29c58e
YQ
25817
25818
25819 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
25820$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
d0ac1c44 25821if ${gl_cv_func_rename_slash_dst_works+:} false; then :
6a29c58e
YQ
25822 $as_echo_n "(cached) " >&6
25823else
25824 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
25825 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 25826 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
25827 # Assume that if we have lstat, we can also check symlinks.
25828 if test $ac_cv_func_lstat = yes; then
25829 ln -s conftest.f conftest.lnk
25830 fi
25831 if test "$cross_compiling" = yes; then :
25832 case "$host_os" in
c0c3707f
CB
25833 # Guess yes on Linux systems.
25834 linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
25835 # Guess yes on glibc systems.
25836 *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
25837 # Guess no on native Windows.
25838 mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
25839 # If we don't know, obey --enable-cross-guesses.
25840 *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
25841 esac
25842
25843else
25844 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25845/* end confdefs.h. */
25846
25847# include <stdio.h>
25848# include <stdlib.h>
25849
25850int
25851main ()
25852{
25853int result = 0;
25854 if (rename ("conftest.f1", "conftest.f2/") == 0)
25855 result |= 1;
25856 if (rename ("conftest.d1", "conftest.d2/") != 0)
25857 result |= 2;
25858#if HAVE_LSTAT
25859 if (rename ("conftest.f", "conftest.lnk/") == 0)
25860 result |= 4;
25861#endif
25862 return result;
25863
25864 ;
25865 return 0;
25866}
25867_ACEOF
25868if ac_fn_c_try_run "$LINENO"; then :
25869 gl_cv_func_rename_slash_dst_works=yes
25870else
25871 gl_cv_func_rename_slash_dst_works=no
25872fi
25873rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25874 conftest.$ac_objext conftest.beam conftest.$ac_ext
25875fi
25876
25877 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
25878
25879fi
25880{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
25881$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
25882 case "$gl_cv_func_rename_slash_dst_works" in
25883 *yes) ;;
25884 *)
25885 REPLACE_RENAME=1
25886
25887$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
25888
25889 ;;
25890 esac
25891
25892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
25893$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
d0ac1c44 25894if ${gl_cv_func_rename_slash_src_works+:} false; then :
6a29c58e
YQ
25895 $as_echo_n "(cached) " >&6
25896else
25897 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
25898 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 25899 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
25900 # Assume that if we have lstat, we can also check symlinks.
25901 if test $ac_cv_func_lstat = yes; then
25902 ln -s conftest.f conftest.lnk
25903 fi
25904 if test "$cross_compiling" = yes; then :
25905 case "$host_os" in
c0c3707f
CB
25906 # Guess yes on Linux systems.
25907 linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
25908 # Guess yes on glibc systems.
25909 *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
25910 # Guess yes on native Windows.
25911 mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
25912 # If we don't know, obey --enable-cross-guesses.
25913 *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
25914 esac
25915
25916else
25917 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25918/* end confdefs.h. */
25919
25920# include <stdio.h>
25921# include <stdlib.h>
25922
25923int
25924main ()
25925{
25926int result = 0;
25927 if (rename ("conftest.f1/", "conftest.d3") == 0)
25928 result |= 1;
25929 if (rename ("conftest.d1/", "conftest.d2") != 0)
25930 result |= 2;
25931#if HAVE_LSTAT
25932 if (rename ("conftest.lnk/", "conftest.f") == 0)
25933 result |= 4;
25934#endif
25935 return result;
25936
25937 ;
25938 return 0;
25939}
25940_ACEOF
25941if ac_fn_c_try_run "$LINENO"; then :
25942 gl_cv_func_rename_slash_src_works=yes
25943else
25944 gl_cv_func_rename_slash_src_works=no
25945fi
25946rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25947 conftest.$ac_objext conftest.beam conftest.$ac_ext
25948fi
25949
25950 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
25951
25952fi
25953{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
25954$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
25955 case "$gl_cv_func_rename_slash_src_works" in
25956 *yes) ;;
25957 *)
25958 REPLACE_RENAME=1
25959
25960$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
25961
25962 ;;
25963 esac
25964
25965
25966 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
25967$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
d0ac1c44 25968if ${gl_cv_func_rename_link_works+:} false; then :
6a29c58e
YQ
25969 $as_echo_n "(cached) " >&6
25970else
25971 if test $ac_cv_func_link = yes; then
c0c3707f
CB
25972 if test $cross_compiling != yes; then
25973 rm -rf conftest.f conftest.f1 conftest.f2
25974 if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
25975 set x `ls -i conftest.f conftest.f1` && test "" = ""; then
25976 if test "$cross_compiling" = yes; then :
25977 :
6a29c58e
YQ
25978
25979else
25980 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25981/* end confdefs.h. */
25982
c0c3707f
CB
25983# include <errno.h>
25984# include <stdio.h>
25985# include <stdlib.h>
25986# include <unistd.h>
6a29c58e
YQ
25987
25988int
25989main ()
25990{
25991int result = 0;
c0c3707f
CB
25992 if (rename ("conftest.f", "conftest.f1"))
25993 result |= 1;
25994 if (unlink ("conftest.f1"))
25995 result |= 2;
25996
25997 /* Allow either the POSIX-required behavior, where the
25998 previous rename kept conftest.f, or the (better) NetBSD
25999 behavior, where it removed conftest.f. */
26000 if (rename ("conftest.f", "conftest.f") != 0
26001 && errno != ENOENT)
26002 result |= 4;
26003
26004 if (rename ("conftest.f1", "conftest.f1") == 0)
26005 result |= 8;
26006 if (rename ("conftest.f2", "conftest.f2") != 0)
26007 result |= 16;
26008 return result;
6a29c58e
YQ
26009
26010 ;
26011 return 0;
26012}
26013_ACEOF
26014if ac_fn_c_try_run "$LINENO"; then :
26015 gl_cv_func_rename_link_works=yes
26016else
26017 gl_cv_func_rename_link_works=no
26018fi
26019rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26020 conftest.$ac_objext conftest.beam conftest.$ac_ext
26021fi
26022
c0c3707f
CB
26023 else
26024 gl_cv_func_rename_link_works="guessing no"
26025 fi
26026 rm -rf conftest.f conftest.f1 conftest.f2
6a29c58e 26027 else
c0c3707f
CB
26028 case "$host_os" in
26029 # Guess yes on Linux systems.
26030 linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
26031 # Guess yes on glibc systems.
26032 *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
26033 # Guess yes on native Windows.
26034 mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
26035 # If we don't know, obey --enable-cross-guesses.
26036 *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
26037 esac
6a29c58e 26038 fi
6a29c58e
YQ
26039 else
26040 gl_cv_func_rename_link_works=yes
26041 fi
26042
26043fi
26044{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
26045$as_echo "$gl_cv_func_rename_link_works" >&6; }
26046 case "$gl_cv_func_rename_link_works" in
26047 *yes) ;;
26048 *)
26049 REPLACE_RENAME=1
26050
26051$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
26052
26053 ;;
26054 esac
26055
26056 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
26057$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
d0ac1c44 26058if ${gl_cv_func_rename_dest_works+:} false; then :
6a29c58e
YQ
26059 $as_echo_n "(cached) " >&6
26060else
26061 rm -rf conftest.f conftest.d1 conftest.d2
26062 touch conftest.f && mkdir conftest.d1 conftest.d2 ||
d0ac1c44 26063 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26064 if test "$cross_compiling" = yes; then :
26065 case "$host_os" in
c0c3707f
CB
26066 # Guess yes on Linux systems.
26067 linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
26068 # Guess yes on glibc systems.
26069 *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
26070 # Guess no on native Windows.
26071 mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
26072 # If we don't know, obey --enable-cross-guesses.
26073 *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26074 esac
26075
26076else
26077 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26078/* end confdefs.h. */
26079
26080# include <stdio.h>
26081# include <stdlib.h>
26082
26083int
26084main ()
26085{
26086int result = 0;
26087 if (rename ("conftest.d1", "conftest.d2") != 0)
26088 result |= 1;
26089 if (rename ("conftest.d2", "conftest.f") == 0)
26090 result |= 2;
26091 return result;
26092
26093 ;
26094 return 0;
26095}
26096_ACEOF
26097if ac_fn_c_try_run "$LINENO"; then :
26098 gl_cv_func_rename_dest_works=yes
26099else
26100 gl_cv_func_rename_dest_works=no
26101fi
26102rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26103 conftest.$ac_objext conftest.beam conftest.$ac_ext
26104fi
26105
26106 rm -rf conftest.f conftest.d1 conftest.d2
26107
26108fi
26109{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
26110$as_echo "$gl_cv_func_rename_dest_works" >&6; }
26111 case "$gl_cv_func_rename_dest_works" in
26112 *yes) ;;
26113 *)
26114 REPLACE_RENAME=1
26115
26116$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
26117
26118 ;;
26119 esac
26120
26121 if test $REPLACE_RENAME = 1; then
26122
26123
26124
26125
26126
26127
26128
26129
26130 gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext"
26131
26132 fi
26133
26134
26135
26136
26137
26138 GNULIB_RENAME=1
26139
26140
26141
26142
26143
26144$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
26145
26146
26147
26148
26149
26150
6ec2e0f5
SDJ
26151 for ac_func in rewinddir
26152do :
26153 ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
d0ac1c44 26154if test "x$ac_cv_func_rewinddir" = xyes; then :
6ec2e0f5
SDJ
26155 cat >>confdefs.h <<_ACEOF
26156#define HAVE_REWINDDIR 1
26157_ACEOF
26158
26159fi
26160done
26161
26162 if test $ac_cv_func_rewinddir = no; then
26163 HAVE_REWINDDIR=0
26164 fi
26165
26166 if test $HAVE_REWINDDIR = 0; then
26167
26168
26169
26170
26171
26172
26173
26174
26175 gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext"
26176
26177 fi
26178
26179
26180
26181
26182
26183 GNULIB_REWINDDIR=1
26184
26185
26186
26187
26188
26189$as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
26190
26191
26192
26193
26194
26195
6a29c58e
YQ
26196 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
26197$as_echo_n "checking whether rmdir works... " >&6; }
d0ac1c44 26198if ${gl_cv_func_rmdir_works+:} false; then :
6a29c58e
YQ
26199 $as_echo_n "(cached) " >&6
26200else
26201 mkdir conftest.dir
26202 touch conftest.file
26203 if test "$cross_compiling" = yes; then :
26204 case "$host_os" in
c0c3707f
CB
26205 # Guess yes on Linux systems.
26206 linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
26207 # Guess yes on glibc systems.
26208 *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
26209 # Guess no on native Windows.
26210 mingw*) gl_cv_func_rmdir_works="guessing no" ;;
26211 # If we don't know, obey --enable-cross-guesses.
26212 *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26213 esac
26214
26215else
26216 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26217/* end confdefs.h. */
26218#include <stdio.h>
26219 #include <errno.h>
26220 #if HAVE_UNISTD_H
26221 # include <unistd.h>
26222 #else /* on Windows with MSVC */
26223 # include <direct.h>
26224 #endif
26225
26226int
26227main ()
26228{
26229int result = 0;
26230 if (!rmdir ("conftest.file/"))
26231 result |= 1;
26232 else if (errno != ENOTDIR)
26233 result |= 2;
26234 if (!rmdir ("conftest.dir/./"))
26235 result |= 4;
26236 return result;
26237
26238 ;
26239 return 0;
26240}
26241_ACEOF
26242if ac_fn_c_try_run "$LINENO"; then :
26243 gl_cv_func_rmdir_works=yes
26244else
26245 gl_cv_func_rmdir_works=no
26246fi
26247rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26248 conftest.$ac_objext conftest.beam conftest.$ac_ext
26249fi
26250
26251 rm -rf conftest.dir conftest.file
26252fi
26253{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
26254$as_echo "$gl_cv_func_rmdir_works" >&6; }
26255 case "$gl_cv_func_rmdir_works" in
26256 *yes) ;;
26257 *)
26258 REPLACE_RMDIR=1
26259 ;;
26260 esac
26261
26262 if test $REPLACE_RMDIR = 1; then
26263
26264
26265
26266
26267
26268
26269
26270
26271 gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
26272
26273 fi
26274
26275
26276
26277
26278
26279 GNULIB_RMDIR=1
26280
26281
26282
26283
26284
26285$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
26286
26287
26288
26289
0750520d 26290
5e8754f9
SDJ
26291
26292
26293
3d99e817
AK
26294 if test $ac_cv_func_setenv = no; then
26295 HAVE_SETENV=0
26296 else
26297 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
26298$as_echo_n "checking whether setenv validates arguments... " >&6; }
d0ac1c44 26299if ${gl_cv_func_setenv_works+:} false; then :
3d99e817
AK
26300 $as_echo_n "(cached) " >&6
26301else
26302 if test "$cross_compiling" = yes; then :
26303 case "$host_os" in
c0c3707f
CB
26304 # Guess yes on glibc systems.
26305 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
26306 # Guess yes on musl systems.
26307 *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
26308 # If we don't know, obey --enable-cross-guesses.
26309 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
26310 esac
26311
26312else
26313 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26314/* end confdefs.h. */
26315
26316 #include <stdlib.h>
26317 #include <errno.h>
26318 #include <string.h>
26319
26320int
26321main ()
26322{
26323
26324 int result = 0;
26325 {
26326 if (setenv ("", "", 0) != -1)
26327 result |= 1;
26328 else if (errno != EINVAL)
26329 result |= 2;
26330 }
26331 {
26332 if (setenv ("a", "=", 1) != 0)
26333 result |= 4;
26334 else if (strcmp (getenv ("a"), "=") != 0)
26335 result |= 8;
26336 }
26337 return result;
26338
26339 ;
26340 return 0;
26341}
26342_ACEOF
26343if ac_fn_c_try_run "$LINENO"; then :
26344 gl_cv_func_setenv_works=yes
26345else
26346 gl_cv_func_setenv_works=no
26347fi
26348rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26349 conftest.$ac_objext conftest.beam conftest.$ac_ext
26350fi
26351
26352fi
26353{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
26354$as_echo "$gl_cv_func_setenv_works" >&6; }
26355 case "$gl_cv_func_setenv_works" in
26356 *yes) ;;
26357 *)
26358 REPLACE_SETENV=1
26359 ;;
26360 esac
26361 fi
26362
26363 if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
26364
26365
26366
26367
26368
26369
26370
26371
26372 gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
26373
26374 fi
26375
26376
26377
26378
26379
26380 GNULIB_SETENV=1
26381
26382
26383
26384
26385
26386$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
26387
26388
26389
26390
26391
0750520d
PA
26392
26393
26394
5df4cba6
SM
26395 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
26396$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
26397if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
26398 $as_echo_n "(cached) " >&6
26399else
26400 case "$host_os" in
26401 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
26402 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
26403 gl_cv_func_setlocale_null_all_mtsafe=no ;;
26404 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
26405 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
26406 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
26407 # If we don't know, obey --enable-cross-guesses.
26408 *)
26409 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
26410 esac
26411
26412fi
26413{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
26414$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
26415 case "$host_os" in
26416 mingw*) ;;
26417 *)
26418 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
26419 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
26420 fi
26421 ;;
26422 esac
26423 case "$gl_cv_func_setlocale_null_all_mtsafe" in
26424 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
26425 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
26426 esac
26427
26428cat >>confdefs.h <<_ACEOF
26429#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
26430_ACEOF
26431
26432
26433 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
26434$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
26435if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
26436 $as_echo_n "(cached) " >&6
26437else
26438 case "$host_os" in
26439 # Guess no on OpenBSD, AIX.
26440 openbsd* | aix*)
26441 gl_cv_func_setlocale_null_one_mtsafe=no ;;
26442 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
26443 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
26444 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
26445 # If we don't know, obey --enable-cross-guesses.
26446 *)
26447 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
26448 esac
26449
26450fi
26451{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
26452$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
26453 case "$host_os" in
26454 mingw*) ;;
26455 *)
26456 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
26457 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
26458 fi
26459 ;;
26460 esac
26461 case "$gl_cv_func_setlocale_null_one_mtsafe" in
26462 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
26463 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
26464 esac
26465
26466cat >>confdefs.h <<_ACEOF
26467#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
26468_ACEOF
26469
26470
26471 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
26472 case "$host_os" in
26473 mingw*) LIB_SETLOCALE_NULL= ;;
26474 *)
26475
26476
26477 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
26478$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
26479if ${gl_cv_have_weak+:} false; then :
26480 $as_echo_n "(cached) " >&6
26481else
26482 gl_cv_have_weak=no
26483 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26484/* end confdefs.h. */
26485extern void xyzzy ();
26486#pragma weak xyzzy
26487int
26488main ()
26489{
26490xyzzy();
26491 ;
26492 return 0;
26493}
26494_ACEOF
26495if ac_fn_c_try_link "$LINENO"; then :
26496 gl_cv_have_weak=maybe
26497fi
26498rm -f core conftest.err conftest.$ac_objext \
26499 conftest$ac_exeext conftest.$ac_ext
26500 if test $gl_cv_have_weak = maybe; then
26501 if test "$cross_compiling" = yes; then :
26502 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26503/* end confdefs.h. */
26504#ifdef __ELF__
26505 Extensible Linking Format
26506 #endif
26507
26508_ACEOF
26509if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
26510 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
26511 gl_cv_have_weak="guessing yes"
26512else
26513 gl_cv_have_weak="guessing no"
26514fi
26515rm -f conftest*
26516
26517
26518else
26519 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26520/* end confdefs.h. */
26521
26522#include <stdio.h>
26523#pragma weak fputs
26524int main ()
26525{
26526 return (fputs == NULL);
26527}
26528_ACEOF
26529if ac_fn_c_try_run "$LINENO"; then :
26530 gl_cv_have_weak=yes
26531else
26532 gl_cv_have_weak=no
26533fi
26534rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26535 conftest.$ac_objext conftest.beam conftest.$ac_ext
26536fi
26537
26538 fi
26539 case " $LDFLAGS " in
26540 *" -static "*) gl_cv_have_weak=no ;;
26541 esac
26542 case "$gl_cv_have_weak" in
26543 *yes)
26544 case "$host_os" in
26545 freebsd* | dragonfly*)
26546 : > conftest1.c
26547 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
26548 cat <<EOF > conftest2.c
26549#include <pthread.h>
26550#pragma weak pthread_mutexattr_gettype
26551int main ()
26552{
26553 return (pthread_mutexattr_gettype != NULL);
26554}
26555EOF
26556 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
26557 || gl_cv_have_weak=no
26558 rm -f conftest1.c libempty.so conftest2.c conftest
26559 ;;
26560 esac
26561 ;;
26562 esac
26563
26564fi
26565{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
26566$as_echo "$gl_cv_have_weak" >&6; }
26567 case "$gl_cv_have_weak" in
26568 *yes)
26569
26570$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
26571
26572 ;;
26573 esac
26574
26575 case "$gl_cv_have_weak" in
26576 *yes) LIB_SETLOCALE_NULL= ;;
26577 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
26578 esac
26579 ;;
26580 esac
26581 else
26582 LIB_SETLOCALE_NULL=
26583 fi
26584
26585
26586 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
26587
26588
26589
26590
26591
26592
26593
26594
26595 gl_LIBOBJS="$gl_LIBOBJS setlocale-lock.$ac_objext"
26596
26597
26598
26599
26600 CFLAG_VISIBILITY=
26601 HAVE_VISIBILITY=0
26602 if test -n "$GCC"; then
26603 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
26604$as_echo_n "checking whether the -Werror option is usable... " >&6; }
26605if ${gl_cv_cc_vis_werror+:} false; then :
26606 $as_echo_n "(cached) " >&6
26607else
26608 gl_save_CFLAGS="$CFLAGS"
26609 CFLAGS="$CFLAGS -Werror"
26610 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26611/* end confdefs.h. */
26612
26613int
26614main ()
26615{
26616
26617 ;
26618 return 0;
26619}
26620_ACEOF
26621if ac_fn_c_try_compile "$LINENO"; then :
26622 gl_cv_cc_vis_werror=yes
26623else
26624 gl_cv_cc_vis_werror=no
26625fi
26626rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26627 CFLAGS="$gl_save_CFLAGS"
26628
26629fi
26630{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
26631$as_echo "$gl_cv_cc_vis_werror" >&6; }
26632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
26633$as_echo_n "checking for simple visibility declarations... " >&6; }
26634if ${gl_cv_cc_visibility+:} false; then :
26635 $as_echo_n "(cached) " >&6
26636else
26637 gl_save_CFLAGS="$CFLAGS"
26638 CFLAGS="$CFLAGS -fvisibility=hidden"
26639 if test $gl_cv_cc_vis_werror = yes; then
26640 CFLAGS="$CFLAGS -Werror"
26641 fi
26642 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26643/* end confdefs.h. */
26644extern __attribute__((__visibility__("hidden"))) int hiddenvar;
26645 extern __attribute__((__visibility__("default"))) int exportedvar;
26646 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
26647 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
26648 void dummyfunc (void) {}
26649
26650int
26651main ()
26652{
26653
26654 ;
26655 return 0;
26656}
26657_ACEOF
26658if ac_fn_c_try_compile "$LINENO"; then :
26659 gl_cv_cc_visibility=yes
26660else
26661 gl_cv_cc_visibility=no
26662fi
26663rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26664 CFLAGS="$gl_save_CFLAGS"
26665
26666fi
26667{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
26668$as_echo "$gl_cv_cc_visibility" >&6; }
26669 if test $gl_cv_cc_visibility = yes; then
26670 CFLAG_VISIBILITY="-fvisibility=hidden"
26671 HAVE_VISIBILITY=1
26672 fi
26673 fi
26674
26675
26676
26677cat >>confdefs.h <<_ACEOF
26678#define HAVE_VISIBILITY $HAVE_VISIBILITY
26679_ACEOF
26680
26681
26682
26683 fi
26684
26685
26686
26687
26688
26689 GNULIB_SETLOCALE_NULL=1
26690
26691
26692
26693
26694
26695$as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h
26696
26697
26698
26699
26700
26701
26702
26703
0750520d
PA
26704
26705
26706
26707
26708
26709
26710 if test $gl_cv_have_include_next = yes; then
26711 gl_cv_next_signal_h='<'signal.h'>'
26712 else
26713 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
26714$as_echo_n "checking absolute name of <signal.h>... " >&6; }
d0ac1c44 26715if ${gl_cv_next_signal_h+:} false; then :
0750520d
PA
26716 $as_echo_n "(cached) " >&6
26717else
26718
26719
26720
26721 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26722/* end confdefs.h. */
26723#include <signal.h>
26724_ACEOF
26725 case "$host_os" in
26726 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26727 *) gl_absname_cpp="$ac_cpp" ;;
26728 esac
26729
26730 case "$host_os" in
26731 mingw*)
26732 gl_dirsep_regex='[/\\]'
26733 ;;
26734 *)
26735 gl_dirsep_regex='\/'
26736 ;;
26737 esac
26738 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26739 gl_header_literal_regex=`echo 'signal.h' \
26740 | sed -e "$gl_make_literal_regex_sed"`
26741 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26742 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26743 s|^/[^/]|//&|
26744 p
26745 q
26746 }'
26747
26748 gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26749 sed -n "$gl_absolute_header_sed"`
26750
26751 gl_header=$gl_cv_absolute_signal_h
26752 gl_cv_next_signal_h='"'$gl_header'"'
26753
26754
26755fi
26756{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
26757$as_echo "$gl_cv_next_signal_h" >&6; }
26758 fi
26759 NEXT_SIGNAL_H=$gl_cv_next_signal_h
26760
26761 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26762 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
26763 gl_next_as_first_directive='<'signal.h'>'
26764 else
26765 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
26766 gl_next_as_first_directive=$gl_cv_next_signal_h
26767 fi
26768 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
26769
26770
26771
26772
26773
26774# AIX declares sig_atomic_t to already include volatile, and C89 compilers
26775# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
26776 ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
26777#include <signal.h>
26778
26779"
d0ac1c44 26780if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
0750520d
PA
26781
26782else
26783 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
26784fi
26785
26786
26787
26788
26789
26790
26791
26792 ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
26793#include <signal.h>
26794
26795"
d0ac1c44 26796if test "x$ac_cv_type_sighandler_t" = xyes; then :
0750520d
PA
26797
26798else
26799 HAVE_SIGHANDLER_T=0
26800fi
26801
26802
26803
0750520d 26804
0750520d
PA
26805
26806
698be2d8
CB
26807
26808
725e2999
JB
26809 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
26810/* <sys/types.h> is not needed according to POSIX, but the
26811 <sys/socket.h> in i386-unknown-freebsd4.10 and
26812 powerpc-apple-darwin5.5 required it. */
26813#include <sys/types.h>
26814#if HAVE_SYS_SOCKET_H
26815# include <sys/socket.h>
26816#elif HAVE_WS2TCPIP_H
26817# include <ws2tcpip.h>
26818#endif
26819
26820"
26821if test "x$ac_cv_type_socklen_t" = xyes; then :
26822
26823else
26824 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
26825$as_echo_n "checking for socklen_t equivalent... " >&6; }
c0c3707f 26826if ${gl_cv_socklen_t_equiv+:} false; then :
725e2999
JB
26827 $as_echo_n "(cached) " >&6
26828else
26829 # Systems have either "struct sockaddr *" or
26830 # "void *" as the second argument to getpeername
26831 gl_cv_socklen_t_equiv=
26832 for arg2 in "struct sockaddr" void; do
26833 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
26834 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26835/* end confdefs.h. */
26836#include <sys/types.h>
26837 #include <sys/socket.h>
26838
26839 int getpeername (int, $arg2 *, $t *);
26840int
26841main ()
26842{
26843$t len;
26844 getpeername (0, 0, &len);
26845 ;
26846 return 0;
26847}
26848_ACEOF
26849if ac_fn_c_try_compile "$LINENO"; then :
26850 gl_cv_socklen_t_equiv="$t"
26851fi
26852rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26853 test "$gl_cv_socklen_t_equiv" != "" && break
26854 done
26855 test "$gl_cv_socklen_t_equiv" != "" && break
26856 done
c0c3707f
CB
26857 if test "$gl_cv_socklen_t_equiv" = ""; then
26858 as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
26859 fi
725e2999
JB
26860
26861fi
c0c3707f 26862{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
725e2999
JB
26863$as_echo "$gl_cv_socklen_t_equiv" >&6; }
26864
26865cat >>confdefs.h <<_ACEOF
26866#define socklen_t $gl_cv_socklen_t_equiv
26867_ACEOF
26868
26869fi
26870
0750520d 26871
63ce7108
TT
26872 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
26873$as_echo_n "checking for ssize_t... " >&6; }
d0ac1c44 26874if ${gt_cv_ssize_t+:} false; then :
63ce7108
TT
26875 $as_echo_n "(cached) " >&6
26876else
26877 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26878/* end confdefs.h. */
26879#include <sys/types.h>
26880int
26881main ()
26882{
26883int x = sizeof (ssize_t *) + sizeof (ssize_t);
26884 return !x;
26885 ;
26886 return 0;
26887}
26888_ACEOF
26889if ac_fn_c_try_compile "$LINENO"; then :
26890 gt_cv_ssize_t=yes
26891else
26892 gt_cv_ssize_t=no
26893fi
26894rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26895fi
26896{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
26897$as_echo "$gt_cv_ssize_t" >&6; }
26898 if test $gt_cv_ssize_t = no; then
26899
26900$as_echo "#define ssize_t int" >>confdefs.h
26901
26902 fi
26903
26904
26905
26906
472fa5ee 26907
c0c3707f
CB
26908 case "$host_os" in
26909 mingw*)
26910 REPLACE_STAT=1
26911 ;;
26912 *)
26913 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
26914$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
26915if ${gl_cv_func_stat_file_slash+:} false; then :
2196f55f
YQ
26916 $as_echo_n "(cached) " >&6
26917else
c0c3707f
CB
26918 touch conftest.tmp
26919 # Assume that if we have lstat, we can also check symlinks.
26920 if test $ac_cv_func_lstat = yes; then
26921 ln -s conftest.tmp conftest.lnk
26922 fi
26923 if test "$cross_compiling" = yes; then :
26924 case "$host_os" in
26925 # Guess yes on Linux systems.
26926 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
26927 # Guess yes on glibc systems.
26928 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
26929 # If we don't know, obey --enable-cross-guesses.
26930 *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
26931 esac
26932
2196f55f
YQ
26933else
26934 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26935/* end confdefs.h. */
26936#include <sys/stat.h>
26937
26938int
26939main ()
26940{
c0c3707f
CB
26941int result = 0;
26942 struct stat st;
26943 if (!stat ("conftest.tmp/", &st))
26944 result |= 1;
26945#if HAVE_LSTAT
26946 if (!stat ("conftest.lnk/", &st))
26947 result |= 2;
26948#endif
26949 return result;
26950
2196f55f
YQ
26951 ;
26952 return 0;
26953}
26954_ACEOF
26955if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 26956 gl_cv_func_stat_file_slash=yes
2196f55f 26957else
c0c3707f 26958 gl_cv_func_stat_file_slash=no
2196f55f
YQ
26959fi
26960rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26961 conftest.$ac_objext conftest.beam conftest.$ac_ext
26962fi
26963
c0c3707f 26964 rm -f conftest.tmp conftest.lnk
2196f55f 26965fi
c0c3707f
CB
26966{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
26967$as_echo "$gl_cv_func_stat_file_slash" >&6; }
26968 case $gl_cv_func_stat_file_slash in
26969 *no)
26970 REPLACE_STAT=1
26971
26972$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
26973;;
26974 esac
26975 case $host_os in
26976 solaris*)
26977 REPLACE_FSTAT=1 ;;
26978 esac
26979 ;;
26980 esac
26981
26982 if test $REPLACE_STAT = 1; then
26983
26984
26985
26986
26987
26988
26989
26990
26991 gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
26992
26993 case "$host_os" in
26994 mingw*)
26995
26996
26997
26998
26999
27000
27001
27002
27003 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
27004
27005 ;;
27006 esac
27007
27008
27009 :
27010
27011 fi
27012
27013
27014
27015
27016
27017 GNULIB_STAT=1
27018
27019
27020
27021
27022
27023$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
27024
27025
27026
27027
7a6dbc2f 27028
c0c3707f
CB
27029
27030
27031 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>
27032 #include <sys/stat.h>
27033"
27034if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
27035
27036cat >>confdefs.h <<_ACEOF
27037#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
27038_ACEOF
27039
27040{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
27041$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
27042if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
27043 $as_echo_n "(cached) " >&6
2196f55f 27044else
5e8754f9
SDJ
27045 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27046/* end confdefs.h. */
c0c3707f
CB
27047
27048 #include <sys/types.h>
27049 #include <sys/stat.h>
27050 #if HAVE_SYS_TIME_H
27051 # include <sys/time.h>
27052 #endif
27053 #include <time.h>
27054 struct timespec ts;
27055 struct stat st;
7a6dbc2f 27056
5e8754f9
SDJ
27057int
27058main ()
27059{
c0c3707f
CB
27060
27061 st.st_atim = ts;
7a6dbc2f 27062
5e8754f9
SDJ
27063 ;
27064 return 0;
27065}
27066_ACEOF
c0c3707f
CB
27067if ac_fn_c_try_compile "$LINENO"; then :
27068 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
5e8754f9 27069else
c0c3707f 27070 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
2196f55f 27071fi
c0c3707f 27072rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2196f55f 27073fi
c0c3707f
CB
27074{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
27075$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
27076 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
2196f55f 27077
c0c3707f 27078$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
2196f55f 27079
c0c3707f
CB
27080 fi
27081else
27082 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>
27083 #include <sys/stat.h>
27084"
27085if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
2196f55f 27086
c0c3707f
CB
27087cat >>confdefs.h <<_ACEOF
27088#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
27089_ACEOF
2196f55f 27090
c0c3707f
CB
27091
27092else
27093 ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
27094 #include <sys/stat.h>
27095"
27096if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
27097
27098cat >>confdefs.h <<_ACEOF
27099#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
27100_ACEOF
2196f55f
YQ
27101
27102
c0c3707f
CB
27103else
27104 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>
27105 #include <sys/stat.h>
27106"
27107if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
2196f55f 27108
c0c3707f
CB
27109cat >>confdefs.h <<_ACEOF
27110#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
27111_ACEOF
2196f55f
YQ
27112
27113
c0c3707f 27114fi
2196f55f 27115
c0c3707f 27116fi
2196f55f 27117
c0c3707f 27118fi
2196f55f 27119
c0c3707f 27120fi
2196f55f
YQ
27121
27122
27123
27124
27125
c0c3707f
CB
27126 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>
27127 #include <sys/stat.h>
27128"
27129if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
2196f55f 27130
c0c3707f
CB
27131cat >>confdefs.h <<_ACEOF
27132#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
27133_ACEOF
2196f55f
YQ
27134
27135
c0c3707f
CB
27136else
27137 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
27138 #include <sys/stat.h>
27139"
27140if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
2196f55f 27141
c0c3707f
CB
27142cat >>confdefs.h <<_ACEOF
27143#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
27144_ACEOF
2196f55f 27145
2196f55f 27146
c0c3707f
CB
27147else
27148 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>
27149 #include <sys/stat.h>
27150"
27151if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
27152
27153cat >>confdefs.h <<_ACEOF
27154#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
27155_ACEOF
27156
27157
27158fi
27159
27160fi
5e8754f9 27161
c0c3707f 27162fi
2196f55f
YQ
27163
27164
27165
725e2999
JB
27166 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
27167$as_echo_n "checking for working stdalign.h... " >&6; }
27168if ${gl_cv_header_working_stdalign_h+:} false; then :
27169 $as_echo_n "(cached) " >&6
27170else
27171 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27172/* end confdefs.h. */
27173#include <stdalign.h>
27174 #include <stddef.h>
27175
27176 /* Test that alignof yields a result consistent with offsetof.
27177 This catches GCC bug 52023
c0c3707f 27178 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
725e2999
JB
27179 #ifdef __cplusplus
27180 template <class t> struct alignof_helper { char a; t b; };
27181 # define ao(type) offsetof (alignof_helper<type>, b)
27182 #else
27183 # define ao(type) offsetof (struct { char a; type b; }, b)
27184 #endif
27185 char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
27186 char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
27187 char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
27188
27189 /* Test _Alignas only on platforms where gnulib can help. */
27190 #if \
27191 ((defined __cplusplus && 201103 <= __cplusplus) \
27192 || (defined __APPLE__ && defined __MACH__ \
27193 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
27194 : __GNUC__) \
c0c3707f
CB
27195 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
27196 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
725e2999
JB
27197 || 1300 <= _MSC_VER)
27198 struct alignas_test { char c; char alignas (8) alignas_8; };
27199 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
27200 ? 1 : -1];
27201 #endif
27202
27203int
27204main ()
27205{
27206
27207 ;
27208 return 0;
27209}
27210_ACEOF
27211if ac_fn_c_try_compile "$LINENO"; then :
27212 gl_cv_header_working_stdalign_h=yes
27213else
27214 gl_cv_header_working_stdalign_h=no
27215fi
27216rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27217fi
27218{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
27219$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
27220
27221 if test $gl_cv_header_working_stdalign_h = yes; then
27222 STDALIGN_H=''
27223 else
27224 STDALIGN_H='stdalign.h'
27225 fi
27226
27227
27228 if test -n "$STDALIGN_H"; then
27229 GL_GENERATE_STDALIGN_H_TRUE=
27230 GL_GENERATE_STDALIGN_H_FALSE='#'
27231else
27232 GL_GENERATE_STDALIGN_H_TRUE='#'
27233 GL_GENERATE_STDALIGN_H_FALSE=
27234fi
27235
27236
27237
2196f55f
YQ
27238
27239
63ce7108 27240
c0c3707f
CB
27241 if test "$ac_cv_header_stdbool_h" = yes; then
27242 case "$host_os" in
27243 solaris*)
27244 if test -z "$GCC"; then
27245 STDBOOL_H='stdbool.h'
27246 else
27247 STDBOOL_H=''
27248 fi
27249 ;;
27250 *)
27251 STDBOOL_H=''
27252 ;;
27253 esac
63ce7108
TT
27254 else
27255 STDBOOL_H='stdbool.h'
27256 fi
27257
27258 if test -n "$STDBOOL_H"; then
27259 GL_GENERATE_STDBOOL_H_TRUE=
27260 GL_GENERATE_STDBOOL_H_FALSE='#'
27261else
27262 GL_GENERATE_STDBOOL_H_TRUE='#'
27263 GL_GENERATE_STDBOOL_H_FALSE=
27264fi
27265
27266
27267 if test "$ac_cv_type__Bool" = yes; then
27268 HAVE__BOOL=1
27269 else
27270 HAVE__BOOL=0
27271 fi
27272
27273
27274
27275
27276
27277 STDDEF_H=
4a626d0a 27278
c0c3707f
CB
27279 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
27280$as_echo_n "checking for good max_align_t... " >&6; }
27281if ${gl_cv_type_max_align_t+:} false; then :
27282 $as_echo_n "(cached) " >&6
27283else
27284 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27285/* end confdefs.h. */
27286#include <stddef.h>
27287 unsigned int s = sizeof (max_align_t);
27288 #if defined __GNUC__ || defined __IBM__ALIGNOF__
27289 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
27290 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
27291 #endif
27292
27293int
27294main ()
27295{
4a626d0a 27296
c0c3707f
CB
27297 ;
27298 return 0;
27299}
27300_ACEOF
27301if ac_fn_c_try_compile "$LINENO"; then :
27302 gl_cv_type_max_align_t=yes
4a626d0a 27303else
c0c3707f 27304 gl_cv_type_max_align_t=no
4a626d0a 27305fi
c0c3707f
CB
27306rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27307
27308fi
27309{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
27310$as_echo "$gl_cv_type_max_align_t" >&6; }
27311 if test $gl_cv_type_max_align_t = no; then
27312 HAVE_MAX_ALIGN_T=0
27313 STDDEF_H=stddef.h
27314 fi
4a626d0a 27315
63ce7108
TT
27316 if test $gt_cv_c_wchar_t = no; then
27317 HAVE_WCHAR_T=0
27318 STDDEF_H=stddef.h
27319 fi
c0c3707f 27320
63ce7108
TT
27321 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
27322$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
d0ac1c44 27323if ${gl_cv_decl_null_works+:} false; then :
63ce7108
TT
27324 $as_echo_n "(cached) " >&6
27325else
27326 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27327/* end confdefs.h. */
27328#include <stddef.h>
27329 int test[2 * (sizeof NULL == sizeof (void *)) -1];
27330
27331int
27332main ()
27333{
27334
27335 ;
27336 return 0;
27337}
27338_ACEOF
27339if ac_fn_c_try_compile "$LINENO"; then :
27340 gl_cv_decl_null_works=yes
27341else
27342 gl_cv_decl_null_works=no
27343fi
27344rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27345fi
27346{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
27347$as_echo "$gl_cv_decl_null_works" >&6; }
27348 if test $gl_cv_decl_null_works = no; then
27349 REPLACE_NULL=1
27350 STDDEF_H=stddef.h
27351 fi
27352
c0c3707f 27353
63ce7108
TT
27354 if test -n "$STDDEF_H"; then
27355 GL_GENERATE_STDDEF_H_TRUE=
27356 GL_GENERATE_STDDEF_H_FALSE='#'
27357else
27358 GL_GENERATE_STDDEF_H_TRUE='#'
27359 GL_GENERATE_STDDEF_H_FALSE=
27360fi
27361
27362 if test -n "$STDDEF_H"; then
27363
27364
27365
27366
27367
27368
27369
27370
27371 if test $gl_cv_have_include_next = yes; then
27372 gl_cv_next_stddef_h='<'stddef.h'>'
27373 else
27374 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
27375$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
d0ac1c44 27376if ${gl_cv_next_stddef_h+:} false; then :
63ce7108
TT
27377 $as_echo_n "(cached) " >&6
27378else
27379
4a626d0a
PA
27380
27381
27382 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63ce7108
TT
27383/* end confdefs.h. */
27384#include <stddef.h>
63ce7108 27385_ACEOF
4a626d0a
PA
27386 case "$host_os" in
27387 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27388 *) gl_absname_cpp="$ac_cpp" ;;
27389 esac
63ce7108 27390
4a626d0a
PA
27391 case "$host_os" in
27392 mingw*)
27393 gl_dirsep_regex='[/\\]'
27394 ;;
27395 *)
27396 gl_dirsep_regex='\/'
27397 ;;
27398 esac
27399 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27400 gl_header_literal_regex=`echo 'stddef.h' \
27401 | sed -e "$gl_make_literal_regex_sed"`
27402 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27403 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27404 s|^/[^/]|//&|
27405 p
27406 q
27407 }'
63ce7108 27408
4a626d0a
PA
27409 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27410 sed -n "$gl_absolute_header_sed"`
27411
27412 gl_header=$gl_cv_absolute_stddef_h
27413 gl_cv_next_stddef_h='"'$gl_header'"'
63ce7108
TT
27414
27415
27416fi
27417{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
27418$as_echo "$gl_cv_next_stddef_h" >&6; }
27419 fi
27420 NEXT_STDDEF_H=$gl_cv_next_stddef_h
27421
27422 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27423 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27424 gl_next_as_first_directive='<'stddef.h'>'
27425 else
27426 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27427 gl_next_as_first_directive=$gl_cv_next_stddef_h
27428 fi
27429 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
27430
27431
27432
27433
27434 fi
27435
27436
27437
27438
49e4877c 27439 $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
63ce7108
TT
27440
27441
27442
98399780
YQ
27443
27444
27445
27446
27447
4a626d0a
PA
27448
27449
6a29c58e
YQ
27450 if test $gl_cv_have_include_next = yes; then
27451 gl_cv_next_stdio_h='<'stdio.h'>'
27452 else
27453 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
27454$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
d0ac1c44 27455if ${gl_cv_next_stdio_h+:} false; then :
6a29c58e
YQ
27456 $as_echo_n "(cached) " >&6
27457else
27458
4a626d0a
PA
27459
27460
27461 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6a29c58e
YQ
27462/* end confdefs.h. */
27463#include <stdio.h>
6a29c58e 27464_ACEOF
4a626d0a
PA
27465 case "$host_os" in
27466 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27467 *) gl_absname_cpp="$ac_cpp" ;;
27468 esac
27469
27470 case "$host_os" in
27471 mingw*)
27472 gl_dirsep_regex='[/\\]'
27473 ;;
27474 *)
27475 gl_dirsep_regex='\/'
27476 ;;
27477 esac
27478 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27479 gl_header_literal_regex=`echo 'stdio.h' \
27480 | sed -e "$gl_make_literal_regex_sed"`
27481 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27482 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27483 s|^/[^/]|//&|
27484 p
27485 q
27486 }'
6a29c58e 27487
4a626d0a
PA
27488 gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27489 sed -n "$gl_absolute_header_sed"`
6a29c58e 27490
4a626d0a
PA
27491 gl_header=$gl_cv_absolute_stdio_h
27492 gl_cv_next_stdio_h='"'$gl_header'"'
6a29c58e
YQ
27493
27494
27495fi
27496{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
27497$as_echo "$gl_cv_next_stdio_h" >&6; }
27498 fi
27499 NEXT_STDIO_H=$gl_cv_next_stdio_h
27500
27501 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27502 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27503 gl_next_as_first_directive='<'stdio.h'>'
27504 else
27505 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27506 gl_next_as_first_directive=$gl_cv_next_stdio_h
27507 fi
27508 NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
27509
27510
27511
27512
27513
4a626d0a
PA
27514 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
27515$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
d0ac1c44 27516if ${gl_cv_func_printf_attribute_flavor+:} false; then :
4a626d0a
PA
27517 $as_echo_n "(cached) " >&6
27518else
27519 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27520/* end confdefs.h. */
27521
27522 #define __STDC_FORMAT_MACROS 1
27523 #include <stdio.h>
27524 #include <inttypes.h>
27525 /* For non-mingw systems, compilation will trivially succeed.
27526 For mingw, compilation will succeed for older mingw (system
27527 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
c0c3707f 27528 #if (defined _WIN32 && ! defined __CYGWIN__) && \
4a626d0a
PA
27529 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
27530 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
27531 #endif
27532
27533int
27534main ()
27535{
27536
27537 ;
27538 return 0;
27539}
27540_ACEOF
27541if ac_fn_c_try_compile "$LINENO"; then :
27542 gl_cv_func_printf_attribute_flavor=system
27543else
27544 gl_cv_func_printf_attribute_flavor=gnu
27545fi
27546rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27547fi
27548{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
27549$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
27550 if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
27551
27552$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
27553
27554 fi
27555
6a29c58e
YQ
27556 GNULIB_FSCANF=1
27557
27558
27559cat >>confdefs.h <<_ACEOF
27560#define GNULIB_FSCANF 1
27561_ACEOF
27562
27563
27564 GNULIB_SCANF=1
27565
27566
27567cat >>confdefs.h <<_ACEOF
27568#define GNULIB_SCANF 1
27569_ACEOF
27570
27571
27572 GNULIB_FGETC=1
27573 GNULIB_GETC=1
27574 GNULIB_GETCHAR=1
27575 GNULIB_FGETS=1
27576 GNULIB_FREAD=1
27577
27578
27579 GNULIB_FPRINTF=1
27580 GNULIB_PRINTF=1
27581 GNULIB_VFPRINTF=1
27582 GNULIB_VPRINTF=1
27583 GNULIB_FPUTC=1
27584 GNULIB_PUTC=1
27585 GNULIB_PUTCHAR=1
27586 GNULIB_FPUTS=1
27587 GNULIB_PUTS=1
27588 GNULIB_FWRITE=1
27589
27590
27591
27592
6a29c58e 27593
6a29c58e
YQ
27594
27595
27596
27597
27598
27599
27600
27601
27602
27603
27604
27605
698be2d8
CB
27606
27607
98399780
YQ
27608 if test $gl_cv_have_include_next = yes; then
27609 gl_cv_next_stdlib_h='<'stdlib.h'>'
27610 else
27611 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
27612$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
d0ac1c44 27613if ${gl_cv_next_stdlib_h+:} false; then :
98399780
YQ
27614 $as_echo_n "(cached) " >&6
27615else
27616
4a626d0a
PA
27617
27618
27619 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98399780
YQ
27620/* end confdefs.h. */
27621#include <stdlib.h>
98399780 27622_ACEOF
4a626d0a
PA
27623 case "$host_os" in
27624 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27625 *) gl_absname_cpp="$ac_cpp" ;;
27626 esac
27627
27628 case "$host_os" in
27629 mingw*)
27630 gl_dirsep_regex='[/\\]'
27631 ;;
27632 *)
27633 gl_dirsep_regex='\/'
27634 ;;
27635 esac
27636 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27637 gl_header_literal_regex=`echo 'stdlib.h' \
27638 | sed -e "$gl_make_literal_regex_sed"`
27639 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27640 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27641 s|^/[^/]|//&|
27642 p
27643 q
27644 }'
98399780 27645
4a626d0a
PA
27646 gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27647 sed -n "$gl_absolute_header_sed"`
98399780 27648
4a626d0a
PA
27649 gl_header=$gl_cv_absolute_stdlib_h
27650 gl_cv_next_stdlib_h='"'$gl_header'"'
98399780
YQ
27651
27652
27653fi
27654{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
27655$as_echo "$gl_cv_next_stdlib_h" >&6; }
27656 fi
27657 NEXT_STDLIB_H=$gl_cv_next_stdlib_h
27658
27659 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27660 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27661 gl_next_as_first_directive='<'stdlib.h'>'
27662 else
27663 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27664 gl_next_as_first_directive=$gl_cv_next_stdlib_h
27665 fi
27666 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
27667
27668
27669
27670
27671
27672
98399780 27673
98399780
YQ
27674
27675
27676
27677
27678
27679
698be2d8
CB
27680
27681
8424cc97
SM
27682 for ac_func in strchrnul
27683do :
27684 ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
d0ac1c44 27685if test "x$ac_cv_func_strchrnul" = xyes; then :
8424cc97
SM
27686 cat >>confdefs.h <<_ACEOF
27687#define HAVE_STRCHRNUL 1
27688_ACEOF
27689
27690fi
27691done
27692
27693 if test $ac_cv_func_strchrnul = no; then
27694 HAVE_STRCHRNUL=0
27695 else
27696 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
27697$as_echo_n "checking whether strchrnul works... " >&6; }
d0ac1c44 27698if ${gl_cv_func_strchrnul_works+:} false; then :
8424cc97
SM
27699 $as_echo_n "(cached) " >&6
27700else
27701 if test "$cross_compiling" = yes; then :
27702 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27703/* end confdefs.h. */
27704
27705#if defined __CYGWIN__
27706 #include <cygwin/version.h>
27707 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
27708 Lucky user
27709 #endif
27710#else
27711 Lucky user
27712#endif
27713
27714_ACEOF
27715if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
27716 $EGREP "Lucky user" >/dev/null 2>&1; then :
27717 gl_cv_func_strchrnul_works="guessing yes"
27718else
27719 gl_cv_func_strchrnul_works="guessing no"
27720fi
27721rm -f conftest*
27722
27723
27724else
27725 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27726/* end confdefs.h. */
27727
27728#include <string.h> /* for strchrnul */
27729
27730int
27731main ()
27732{
27733const char *buf = "a";
27734 return strchrnul (buf, 'b') != buf + 1;
27735
27736 ;
27737 return 0;
27738}
27739_ACEOF
27740if ac_fn_c_try_run "$LINENO"; then :
27741 gl_cv_func_strchrnul_works=yes
27742else
27743 gl_cv_func_strchrnul_works=no
27744fi
27745rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27746 conftest.$ac_objext conftest.beam conftest.$ac_ext
27747fi
27748
27749
27750fi
27751{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
27752$as_echo "$gl_cv_func_strchrnul_works" >&6; }
27753 case "$gl_cv_func_strchrnul_works" in
27754 *yes) ;;
27755 *) REPLACE_STRCHRNUL=1 ;;
27756 esac
27757 fi
27758
27759 if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
27760
27761
27762
27763
27764
27765
27766
27767
27768 gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext"
27769
27770 :
27771 fi
27772
27773
27774
27775
27776
27777 GNULIB_STRCHRNUL=1
27778
27779
27780
27781
27782
27783$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
27784
27785
27786
27787
27788
27789
27790
6ec2e0f5
SDJ
27791 if test $ac_cv_func_strdup = yes; then
27792 if test $gl_cv_func_malloc_posix != yes; then
27793 REPLACE_STRDUP=1
27794 fi
27795 fi
27796
27797 if test $ac_cv_have_decl_strdup = no; then
27798 HAVE_DECL_STRDUP=0
27799 fi
27800
27801 if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
27802
27803
27804
27805
27806
27807
27808
27809
27810 gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
27811
27812 :
27813 fi
27814
27815
27816
27817
27818
27819 GNULIB_STRDUP=1
27820
27821
27822
27823
27824
27825$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
27826
27827
27828
27829
27830
27831
27832
27833
5abebf3c
CB
27834
27835
6ec2e0f5
SDJ
27836 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
27837 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
27838$as_echo_n "checking for working strerror function... " >&6; }
d0ac1c44 27839if ${gl_cv_func_working_strerror+:} false; then :
6ec2e0f5
SDJ
27840 $as_echo_n "(cached) " >&6
27841else
27842 if test "$cross_compiling" = yes; then :
27843 case "$host_os" in
c0c3707f
CB
27844 # Guess yes on glibc systems.
27845 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
27846 # Guess yes on musl systems.
27847 *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
27848 # If we don't know, obey --enable-cross-guesses.
27849 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
6ec2e0f5
SDJ
27850 esac
27851
27852else
27853 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27854/* end confdefs.h. */
27855#include <string.h>
27856
27857int
27858main ()
27859{
27860if (!*strerror (-2)) return 1;
27861 ;
27862 return 0;
27863}
27864_ACEOF
27865if ac_fn_c_try_run "$LINENO"; then :
27866 gl_cv_func_working_strerror=yes
27867else
27868 gl_cv_func_working_strerror=no
27869fi
27870rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27871 conftest.$ac_objext conftest.beam conftest.$ac_ext
27872fi
27873
27874
27875fi
27876{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
27877$as_echo "$gl_cv_func_working_strerror" >&6; }
27878 case "$gl_cv_func_working_strerror" in
27879 *yes) ;;
27880 *)
27881 REPLACE_STRERROR=1
27882 ;;
27883 esac
27884
5abebf3c
CB
27885 case "$gl_cv_func_strerror_r_works" in
27886 *no) REPLACE_STRERROR=1 ;;
27887 esac
27888
6ec2e0f5
SDJ
27889 else
27890 REPLACE_STRERROR=1
27891 fi
27892
27893 if test $REPLACE_STRERROR = 1; then
27894
27895
27896
27897
27898
27899
27900
27901
27902 gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
27903
27904 fi
27905
27906
27907cat >>confdefs.h <<_ACEOF
27908#define GNULIB_STRERROR 1
27909_ACEOF
27910
27911
27912
27913
27914
27915
27916
27917 GNULIB_STRERROR=1
27918
27919
27920
27921
27922
27923$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
27924
27925
27926
27927
27928
27929 if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
27930
27931
27932
27933
27934
27935
27936
27937
27938 gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
27939
27940
27941
27942
27943
27944 if test $ac_cv_header_sys_socket_h != yes; then
27945 for ac_header in winsock2.h
27946do :
27947 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
d0ac1c44 27948if test "x$ac_cv_header_winsock2_h" = xyes; then :
6ec2e0f5
SDJ
27949 cat >>confdefs.h <<_ACEOF
27950#define HAVE_WINSOCK2_H 1
27951_ACEOF
27952
27953fi
27954
27955done
27956
27957 fi
27958 if test "$ac_cv_header_winsock2_h" = yes; then
27959 HAVE_WINSOCK2_H=1
27960 UNISTD_H_HAVE_WINSOCK2_H=1
27961 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
27962 else
27963 HAVE_WINSOCK2_H=0
27964 fi
27965
27966
27967 fi
27968
27969
27970
27971
98399780 27972
5abebf3c 27973
5abebf3c 27974
c0c3707f
CB
27975 if test $ac_cv_have_decl_strerror_r = no; then
27976 HAVE_DECL_STRERROR_R=0
27977 fi
5abebf3c
CB
27978
27979 if test $ac_cv_func_strerror_r = yes; then
27980 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
27981 if test $gl_cv_func_strerror_r_posix_signature = yes; then
27982 case "$gl_cv_func_strerror_r_works" in
27983 *no) REPLACE_STRERROR_R=1 ;;
27984 esac
27985 else
27986 REPLACE_STRERROR_R=1
27987 fi
27988 else
27989 REPLACE_STRERROR_R=1
27990 fi
27991 fi
27992
5abebf3c
CB
27993 if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
27994
27995
27996
27997
27998
27999
28000
28001
28002 gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext"
28003
28004
28005
5abebf3c
CB
28006
28007
28008
c0c3707f 28009 fi
5abebf3c
CB
28010
28011
28012
28013
5abebf3c 28014
c0c3707f 28015 GNULIB_STRERROR_R=1
5abebf3c
CB
28016
28017
28018
28019
5abebf3c 28020
c0c3707f 28021$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
5abebf3c
CB
28022
28023
28024
28025
5abebf3c 28026
c0c3707f
CB
28027cat >>confdefs.h <<_ACEOF
28028#define GNULIB_STRERROR_R_POSIX 1
28029_ACEOF
5abebf3c
CB
28030
28031
28032
28033
28034
28035
28036
698be2d8
CB
28037
28038
28039
28040
28041 if test $ac_cv_have_decl_strnlen = no; then
28042 HAVE_DECL_STRNLEN=0
28043 else
28044
28045 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
28046$as_echo_n "checking for working strnlen... " >&6; }
28047if ${ac_cv_func_strnlen_working+:} false; then :
28048 $as_echo_n "(cached) " >&6
28049else
28050 if test "$cross_compiling" = yes; then :
28051 # Guess no on AIX systems, yes otherwise.
28052 case "$host_os" in
28053 aix*) ac_cv_func_strnlen_working=no;;
28054 *) ac_cv_func_strnlen_working=yes;;
28055 esac
28056else
28057 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28058/* end confdefs.h. */
28059$ac_includes_default
28060int
28061main ()
28062{
28063
28064#define S "foobar"
28065#define S_LEN (sizeof S - 1)
28066
28067 /* At least one implementation is buggy: that of AIX 4.3 would
28068 give strnlen (S, 1) == 3. */
28069
28070 int i;
28071 for (i = 0; i < S_LEN + 1; ++i)
28072 {
28073 int expected = i <= S_LEN ? i : S_LEN;
28074 if (strnlen (S, i) != expected)
28075 return 1;
28076 }
28077 return 0;
28078
28079 ;
28080 return 0;
28081}
28082_ACEOF
28083if ac_fn_c_try_run "$LINENO"; then :
28084 ac_cv_func_strnlen_working=yes
28085else
28086 ac_cv_func_strnlen_working=no
28087fi
28088rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28089 conftest.$ac_objext conftest.beam conftest.$ac_ext
28090fi
28091
28092fi
28093{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5
28094$as_echo "$ac_cv_func_strnlen_working" >&6; }
28095test $ac_cv_func_strnlen_working = no && :
28096
28097
28098 if test $ac_cv_func_strnlen_working = no; then
28099 REPLACE_STRNLEN=1
28100 fi
28101 fi
28102
28103 if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
28104
28105
28106
28107
28108
28109
28110
28111
28112 gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
28113
28114 :
28115 fi
28116
28117
28118
28119
28120
28121 GNULIB_STRNLEN=1
28122
28123
28124
28125
28126
28127$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
28128
28129
28130
28131
28132
63ce7108
TT
28133 if test $REPLACE_STRSTR = 0; then
28134 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
28135$as_echo_n "checking whether strstr works in linear time... " >&6; }
d0ac1c44 28136if ${gl_cv_func_strstr_linear+:} false; then :
63ce7108
TT
28137 $as_echo_n "(cached) " >&6
28138else
28139 if test "$cross_compiling" = yes; then :
28140 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28141/* end confdefs.h. */
28142
28143#include <features.h>
28144#ifdef __GNU_LIBRARY__
28145 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
28146 && !(defined __i386__ || defined __x86_64__) \
28147 && !defined __UCLIBC__
28148 Lucky user
28149 #endif
28150#endif
28151#ifdef __CYGWIN__
28152 #include <cygwin/version.h>
28153 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
28154 Lucky user
28155 #endif
28156#endif
28157
28158_ACEOF
28159if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28160 $EGREP "Lucky user" >/dev/null 2>&1; then :
28161 gl_cv_func_strstr_linear="guessing yes"
c971b7fa 28162else
c0c3707f 28163 gl_cv_func_strstr_linear="$gl_cross_guess_normal"
c971b7fa
PA
28164fi
28165rm -f conftest*
28166
28167
28168else
28169 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28170/* end confdefs.h. */
28171
49e4877c
PA
28172#ifdef __MVS__
28173/* z/OS does not deliver signals while strstr() is running (thanks to
28174 restrictions on its LE runtime), which prevents us from limiting the
28175 running time of this test. */
28176# error "This test does not work properly on z/OS"
28177#endif
c971b7fa 28178#include <signal.h> /* for signal */
63ce7108 28179#include <string.h> /* for strstr */
c971b7fa
PA
28180#include <stdlib.h> /* for malloc */
28181#include <unistd.h> /* for alarm */
49e4877c 28182static void quit (int sig) { _exit (sig + 128); }
c971b7fa
PA
28183
28184int
28185main ()
28186{
28187
28188 int result = 0;
28189 size_t m = 1000000;
63ce7108
TT
28190 char *haystack = (char *) malloc (2 * m + 2);
28191 char *needle = (char *) malloc (m + 2);
c971b7fa 28192 /* Failure to compile this test due to missing alarm is okay,
63ce7108 28193 since all such platforms (mingw) also have quadratic strstr. */
c971b7fa
PA
28194 signal (SIGALRM, quit);
28195 alarm (5);
28196 /* Check for quadratic performance. */
28197 if (haystack && needle)
28198 {
28199 memset (haystack, 'A', 2 * m);
28200 haystack[2 * m] = 'B';
63ce7108 28201 haystack[2 * m + 1] = 0;
c971b7fa
PA
28202 memset (needle, 'A', m);
28203 needle[m] = 'B';
63ce7108
TT
28204 needle[m + 1] = 0;
28205 if (!strstr (haystack, needle))
c971b7fa
PA
28206 result |= 1;
28207 }
c0c3707f
CB
28208 /* Free allocated memory, in case some sanitizer is watching. */
28209 free (haystack);
28210 free (needle);
c971b7fa
PA
28211 return result;
28212
28213 ;
28214 return 0;
28215}
28216_ACEOF
28217if ac_fn_c_try_run "$LINENO"; then :
63ce7108 28218 gl_cv_func_strstr_linear=yes
c971b7fa 28219else
63ce7108 28220 gl_cv_func_strstr_linear=no
c971b7fa
PA
28221fi
28222rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28223 conftest.$ac_objext conftest.beam conftest.$ac_ext
28224fi
28225
28226
28227fi
63ce7108
TT
28228{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
28229$as_echo "$gl_cv_func_strstr_linear" >&6; }
28230 case "$gl_cv_func_strstr_linear" in
40a73391
JK
28231 *yes) ;;
28232 *)
63ce7108 28233 REPLACE_STRSTR=1
40a73391
JK
28234 ;;
28235 esac
c971b7fa
PA
28236 fi
28237
63ce7108 28238 if test $REPLACE_STRSTR = 1; then
c971b7fa
PA
28239
28240
28241
28242
28243
28244
28245
28246
63ce7108 28247 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
c971b7fa 28248
a512b375 28249 fi
c971b7fa
PA
28250
28251
28252
c0c3707f 28253 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
63ce7108 28254 REPLACE_STRSTR=1
c971b7fa 28255 else
c0c3707f 28256 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
63ce7108 28257$as_echo_n "checking whether strstr works... " >&6; }
d0ac1c44 28258if ${gl_cv_func_strstr_works_always+:} false; then :
c971b7fa
PA
28259 $as_echo_n "(cached) " >&6
28260else
28261 if test "$cross_compiling" = yes; then :
c0c3707f 28262 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
28263/* end confdefs.h. */
28264
28265#ifdef __GNU_LIBRARY__
28266 #include <features.h>
63ce7108 28267 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
c971b7fa
PA
28268 || defined __UCLIBC__
28269 Lucky user
28270 #endif
28271#elif defined __CYGWIN__
28272 #include <cygwin/version.h>
28273 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
28274 Lucky user
28275 #endif
28276#else
28277 Lucky user
28278#endif
28279
28280_ACEOF
28281if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28282 $EGREP "Lucky user" >/dev/null 2>&1; then :
63ce7108 28283 gl_cv_func_strstr_works_always="guessing yes"
c971b7fa 28284else
c0c3707f 28285 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
c971b7fa
PA
28286fi
28287rm -f conftest*
28288
28289
28290else
28291 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28292/* end confdefs.h. */
28293
63ce7108 28294#include <string.h> /* for strstr */
c0c3707f
CB
28295#ifdef __GNU_LIBRARY__
28296 #include <features.h>
28297 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
28298 Unlucky user
28299 #endif
28300#endif
c971b7fa
PA
28301#define P "_EF_BF_BD"
28302#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
28303#define NEEDLE P P P P P
28304
28305int
28306main ()
28307{
63ce7108 28308return !!strstr (HAYSTACK, NEEDLE);
c971b7fa
PA
28309
28310 ;
28311 return 0;
28312}
28313_ACEOF
28314if ac_fn_c_try_run "$LINENO"; then :
63ce7108 28315 gl_cv_func_strstr_works_always=yes
c971b7fa 28316else
63ce7108 28317 gl_cv_func_strstr_works_always=no
c971b7fa
PA
28318fi
28319rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28320 conftest.$ac_objext conftest.beam conftest.$ac_ext
28321fi
28322
28323
28324fi
63ce7108
TT
28325{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
28326$as_echo "$gl_cv_func_strstr_works_always" >&6; }
28327 case "$gl_cv_func_strstr_works_always" in
40a73391
JK
28328 *yes) ;;
28329 *)
63ce7108 28330 REPLACE_STRSTR=1
40a73391
JK
28331 ;;
28332 esac
c971b7fa 28333 fi
8839a007 28334
63ce7108 28335 if test $REPLACE_STRSTR = 1; then
8839a007 28336
8690e634
JK
28337
28338
8690e634
JK
28339
28340
28341
28342
28343
63ce7108 28344 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
8690e634 28345
8690e634
JK
28346 fi
28347
8690e634
JK
28348
28349
8690e634 28350
8690e634 28351
63ce7108 28352 GNULIB_STRSTR=1
8690e634
JK
28353
28354
28355
8690e634
JK
28356
28357
63ce7108 28358$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
8690e634
JK
28359
28360
28361
28362
28363
28364
28365
421693b0
PA
28366 for ac_func in strtok_r
28367do :
28368 ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r"
d0ac1c44 28369if test "x$ac_cv_func_strtok_r" = xyes; then :
421693b0
PA
28370 cat >>confdefs.h <<_ACEOF
28371#define HAVE_STRTOK_R 1
28372_ACEOF
28373
28374fi
28375done
28376
28377 if test $ac_cv_func_strtok_r = yes; then
28378 HAVE_STRTOK_R=1
28379 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5
28380$as_echo_n "checking whether strtok_r works... " >&6; }
d0ac1c44 28381if ${gl_cv_func_strtok_r_works+:} false; then :
421693b0
PA
28382 $as_echo_n "(cached) " >&6
28383else
28384 if test "$cross_compiling" = yes; then :
c0c3707f
CB
28385 case "$host_os" in
28386 # Guess no on glibc systems.
28387 *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;;
28388 # Guess yes on native Windows.
28389 mingw*) gl_cv_func_strtok_r_works="guessing yes" ;;
28390 *) gl_cv_func_strtok_r_works="guessing yes" ;;
421693b0
PA
28391 esac
28392
28393else
28394 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28395/* end confdefs.h. */
28396
28397 #ifndef __OPTIMIZE__
28398 # define __OPTIMIZE__ 1
28399 #endif
28400 #undef __OPTIMIZE_SIZE__
28401 #undef __NO_INLINE__
28402 #include <stdlib.h>
28403 #include <string.h>
28404
28405int
28406main ()
28407{
28408static const char dummy[] = "\177\01a";
28409 char delimiters[] = "xxxxxxxx";
28410 char *save_ptr = (char *) dummy;
28411 strtok_r (delimiters, "x", &save_ptr);
28412 strtok_r (NULL, "x", &save_ptr);
28413 return 0;
28414
28415 ;
28416 return 0;
28417}
28418
28419_ACEOF
28420if ac_fn_c_try_run "$LINENO"; then :
28421 gl_cv_func_strtok_r_works=yes
28422else
28423 gl_cv_func_strtok_r_works=no
28424fi
28425rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28426 conftest.$ac_objext conftest.beam conftest.$ac_ext
28427fi
28428
28429
28430fi
28431{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5
28432$as_echo "$gl_cv_func_strtok_r_works" >&6; }
28433 case "$gl_cv_func_strtok_r_works" in
28434 *no)
28435 UNDEFINE_STRTOK_R=1
28436 ;;
28437 esac
28438 else
28439 HAVE_STRTOK_R=0
28440 fi
28441
28442 if test $ac_cv_have_decl_strtok_r = no; then
28443 HAVE_DECL_STRTOK_R=0
28444 fi
28445
28446 if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then
28447
28448
28449
28450
28451
28452
28453
28454
28455 gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext"
28456
28457
28458 :
28459
28460 fi
28461
28462
28463
28464
28465
28466 GNULIB_STRTOK_R=1
28467
28468
28469
28470
28471
28472$as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h
28473
28474
28475
28476
28477
28478
28479
8690e634
JK
28480
28481
28482
28483
28484
8690e634 28485
09607c9e 28486
698be2d8
CB
28487 if test $gl_cv_have_include_next = yes; then
28488 gl_cv_next_sys_random_h='<'sys/random.h'>'
28489 else
28490 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/random.h>" >&5
28491$as_echo_n "checking absolute name of <sys/random.h>... " >&6; }
28492if ${gl_cv_next_sys_random_h+:} false; then :
28493 $as_echo_n "(cached) " >&6
28494else
28495
28496 if test $ac_cv_header_sys_random_h = yes; then
28497
28498
28499
28500
28501 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28502/* end confdefs.h. */
28503#include <sys/random.h>
28504_ACEOF
28505 case "$host_os" in
28506 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28507 *) gl_absname_cpp="$ac_cpp" ;;
28508 esac
28509
28510 case "$host_os" in
28511 mingw*)
28512 gl_dirsep_regex='[/\\]'
28513 ;;
28514 *)
28515 gl_dirsep_regex='\/'
28516 ;;
28517 esac
28518 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28519 gl_header_literal_regex=`echo 'sys/random.h' \
28520 | sed -e "$gl_make_literal_regex_sed"`
28521 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28522 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28523 s|^/[^/]|//&|
28524 p
28525 q
28526 }'
28527
28528 gl_cv_absolute_sys_random_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28529 sed -n "$gl_absolute_header_sed"`
28530
28531 gl_header=$gl_cv_absolute_sys_random_h
28532 gl_cv_next_sys_random_h='"'$gl_header'"'
28533 else
28534 gl_cv_next_sys_random_h='<'sys/random.h'>'
28535 fi
28536
28537
28538fi
28539{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_random_h" >&5
28540$as_echo "$gl_cv_next_sys_random_h" >&6; }
28541 fi
28542 NEXT_SYS_RANDOM_H=$gl_cv_next_sys_random_h
28543
28544 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28545 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28546 gl_next_as_first_directive='<'sys/random.h'>'
28547 else
28548 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28549 gl_next_as_first_directive=$gl_cv_next_sys_random_h
28550 fi
28551 NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H=$gl_next_as_first_directive
28552
28553
28554
28555
28556 if test $ac_cv_header_sys_random_h = yes; then
28557 HAVE_SYS_RANDOM_H=1
28558 else
28559 HAVE_SYS_RANDOM_H=0
28560 fi
28561
28562
28563
28564 if test $ac_cv_header_sys_random_h = yes; then
28565 UNISTD_H_HAVE_SYS_RANDOM_H=1
28566 fi
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577
28578
28579
28580
28581
28582
28583
725e2999
JB
28584
28585
09607c9e
TT
28586
28587
28588
28589 if test $gl_cv_have_include_next = yes; then
28590 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
28591 else
28592 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
28593$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
d0ac1c44 28594if ${gl_cv_next_sys_stat_h+:} false; then :
09607c9e
TT
28595 $as_echo_n "(cached) " >&6
28596else
28597
28598 if test $ac_cv_header_sys_stat_h = yes; then
28599
28600
4a626d0a
PA
28601
28602
28603 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
09607c9e
TT
28604/* end confdefs.h. */
28605#include <sys/stat.h>
09607c9e 28606_ACEOF
4a626d0a
PA
28607 case "$host_os" in
28608 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28609 *) gl_absname_cpp="$ac_cpp" ;;
28610 esac
28611
28612 case "$host_os" in
28613 mingw*)
28614 gl_dirsep_regex='[/\\]'
28615 ;;
28616 *)
28617 gl_dirsep_regex='\/'
28618 ;;
28619 esac
28620 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28621 gl_header_literal_regex=`echo 'sys/stat.h' \
28622 | sed -e "$gl_make_literal_regex_sed"`
28623 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28624 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28625 s|^/[^/]|//&|
28626 p
28627 q
28628 }'
28629
28630 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28631 sed -n "$gl_absolute_header_sed"`
28632
28633 gl_header=$gl_cv_absolute_sys_stat_h
28634 gl_cv_next_sys_stat_h='"'$gl_header'"'
09607c9e
TT
28635 else
28636 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
28637 fi
28638
28639
28640fi
28641{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
28642$as_echo "$gl_cv_next_sys_stat_h" >&6; }
28643 fi
28644 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
28645
28646 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28647 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28648 gl_next_as_first_directive='<'sys/stat.h'>'
28649 else
28650 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28651 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
28652 fi
28653 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
28654
28655
28656
28657
28658
28659
28660
28661
c0c3707f
CB
28662 WINDOWS_STAT_TIMESPEC=0
28663
28664
2196f55f 28665
09607c9e
TT
28666
28667
09607c9e 28668
09607c9e 28669
09607c9e
TT
28670
28671 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
28672 #include <sys/stat.h>
28673"
d0ac1c44 28674if test "x$ac_cv_type_nlink_t" = xyes; then :
09607c9e
TT
28675
28676else
28677
c0c3707f 28678$as_echo "#define nlink_t int" >>confdefs.h
09607c9e 28679
c0c3707f 28680fi
09607c9e
TT
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
725e2999
JB
28691
28692
28693
28694
28695
28696
725e2999
JB
28697
28698
28699
28700
28701
698be2d8
CB
28702
28703
725e2999
JB
28704
28705
28706
28707 if test $gl_cv_have_include_next = yes; then
28708 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
28709 else
28710 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
28711$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
28712if ${gl_cv_next_sys_uio_h+:} false; then :
28713 $as_echo_n "(cached) " >&6
28714else
28715
28716 if test $ac_cv_header_sys_uio_h = yes; then
28717
28718
28719
28720
28721 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28722/* end confdefs.h. */
28723#include <sys/uio.h>
28724_ACEOF
28725 case "$host_os" in
28726 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28727 *) gl_absname_cpp="$ac_cpp" ;;
28728 esac
28729
28730 case "$host_os" in
28731 mingw*)
28732 gl_dirsep_regex='[/\\]'
28733 ;;
28734 *)
28735 gl_dirsep_regex='\/'
28736 ;;
28737 esac
28738 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28739 gl_header_literal_regex=`echo 'sys/uio.h' \
28740 | sed -e "$gl_make_literal_regex_sed"`
28741 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28742 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28743 s|^/[^/]|//&|
28744 p
28745 q
28746 }'
28747
28748 gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28749 sed -n "$gl_absolute_header_sed"`
28750
28751 gl_header=$gl_cv_absolute_sys_uio_h
28752 gl_cv_next_sys_uio_h='"'$gl_header'"'
28753 else
28754 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
28755 fi
28756
28757
28758fi
28759{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
28760$as_echo "$gl_cv_next_sys_uio_h" >&6; }
28761 fi
28762 NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
28763
28764 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28765 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28766 gl_next_as_first_directive='<'sys/uio.h'>'
28767 else
28768 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28769 gl_next_as_first_directive=$gl_cv_next_sys_uio_h
28770 fi
28771 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
28772
28773
28774
28775
28776 if test $ac_cv_header_sys_uio_h = yes; then
28777 HAVE_SYS_UIO_H=1
28778 else
28779 HAVE_SYS_UIO_H=0
28780 fi
28781
28782
28783
28784
28785
2d8adcbd
MM
28786 :
28787
28788
28789
28790
09607c9e
TT
28791
28792
28793
8839a007
PA
28794
28795
28796
28797
09607c9e 28798
c0c3707f
CB
28799 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,
28800 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
28801 been included before. */
28802 #if defined __MINGW32__
28803 # include <unistd.h>
28804 #endif
28805 #include <time.h>
09607c9e 28806
f8e27d88
CB
28807"
28808if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
28809 ac_have_decl=1
28810else
28811 ac_have_decl=0
28812fi
28813
28814cat >>confdefs.h <<_ACEOF
28815#define HAVE_DECL_LOCALTIME_R $ac_have_decl
28816_ACEOF
28817
28818 if test $ac_cv_have_decl_localtime_r = no; then
28819 HAVE_DECL_LOCALTIME_R=0
28820 fi
28821
28822
f8e27d88
CB
28823 if test $ac_cv_func_localtime_r = yes; then
28824 HAVE_LOCALTIME_R=1
28825 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
28826$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
28827if ${gl_cv_time_r_posix+:} false; then :
28828 $as_echo_n "(cached) " >&6
28829else
28830 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28831/* end confdefs.h. */
c0c3707f
CB
28832/* mingw's <time.h> provides the functions asctime_r, ctime_r,
28833 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
28834 been included before. */
28835 #if defined __MINGW32__
28836 # include <unistd.h>
28837 #endif
28838 #include <time.h>
28839
f8e27d88
CB
28840int
28841main ()
28842{
28843/* We don't need to append 'restrict's to the argument types,
28844 even though the POSIX signature has the 'restrict's,
28845 since C99 says they can't affect type compatibility. */
28846 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
28847 if (ptr) return 0;
28848 /* Check the return type is a pointer.
28849 On HP-UX 10 it is 'int'. */
28850 *localtime_r (0, 0);
28851 ;
28852 return 0;
28853}
28854
28855_ACEOF
28856if ac_fn_c_try_compile "$LINENO"; then :
28857 gl_cv_time_r_posix=yes
28858else
28859 gl_cv_time_r_posix=no
28860fi
28861rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28862
28863fi
28864{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
28865$as_echo "$gl_cv_time_r_posix" >&6; }
28866 if test $gl_cv_time_r_posix = yes; then
28867 REPLACE_LOCALTIME_R=0
28868 else
28869 REPLACE_LOCALTIME_R=1
28870 fi
28871 else
28872 HAVE_LOCALTIME_R=0
c0c3707f
CB
28873 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5
28874$as_echo_n "checking whether localtime_r exists as an inline function... " >&6; }
28875if ${gl_cv_func_localtime_r_inline+:} false; then :
28876 $as_echo_n "(cached) " >&6
28877else
28878 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28879/* end confdefs.h. */
28880/* mingw's <time.h> provides the functions asctime_r, ctime_r,
28881 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
28882 been included before. */
28883 #if defined __MINGW32__
28884 # include <unistd.h>
28885 #endif
28886 #include <time.h>
28887
28888int
28889main ()
28890{
28891time_t a;
28892 struct tm r;
28893 localtime_r (&a, &r);
28894
28895 ;
28896 return 0;
28897}
28898
28899_ACEOF
28900if ac_fn_c_try_link "$LINENO"; then :
28901 gl_cv_func_localtime_r_inline=yes
28902else
28903 gl_cv_func_localtime_r_inline=no
28904fi
28905rm -f core conftest.err conftest.$ac_objext \
28906 conftest$ac_exeext conftest.$ac_ext
28907
28908fi
28909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5
28910$as_echo "$gl_cv_func_localtime_r_inline" >&6; }
28911 if test $gl_cv_func_localtime_r_inline = yes; then
28912 REPLACE_LOCALTIME_R=1
28913 fi
f8e27d88
CB
28914 fi
28915
28916 if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
28917
28918
28919
28920
28921
28922
28923
28924
28925 gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
28926
28927
28928 :
28929
28930 fi
28931
28932
28933
28934
28935
28936 GNULIB_TIME_R=1
28937
28938
28939
28940
28941
28942$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
28943
28944
28945
28946
28947
28948
28949
28950
28951
5abebf3c
CB
28952
28953
28954
8839a007
PA
28955
28956
28957
28958 if test $gl_cv_have_include_next = yes; then
28959 gl_cv_next_unistd_h='<'unistd.h'>'
28960 else
28961 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
28962$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
d0ac1c44 28963if ${gl_cv_next_unistd_h+:} false; then :
8839a007
PA
28964 $as_echo_n "(cached) " >&6
28965else
28966
28967 if test $ac_cv_header_unistd_h = yes; then
28968
28969
4a626d0a
PA
28970
28971
28972 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8839a007
PA
28973/* end confdefs.h. */
28974#include <unistd.h>
8839a007 28975_ACEOF
4a626d0a
PA
28976 case "$host_os" in
28977 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28978 *) gl_absname_cpp="$ac_cpp" ;;
28979 esac
28980
28981 case "$host_os" in
28982 mingw*)
28983 gl_dirsep_regex='[/\\]'
28984 ;;
28985 *)
28986 gl_dirsep_regex='\/'
28987 ;;
28988 esac
28989 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28990 gl_header_literal_regex=`echo 'unistd.h' \
28991 | sed -e "$gl_make_literal_regex_sed"`
28992 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28993 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28994 s|^/[^/]|//&|
28995 p
28996 q
28997 }'
28998
28999 gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29000 sed -n "$gl_absolute_header_sed"`
29001
29002 gl_header=$gl_cv_absolute_unistd_h
29003 gl_cv_next_unistd_h='"'$gl_header'"'
8839a007
PA
29004 else
29005 gl_cv_next_unistd_h='<'unistd.h'>'
29006 fi
29007
29008
29009fi
29010{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
29011$as_echo "$gl_cv_next_unistd_h" >&6; }
29012 fi
29013 NEXT_UNISTD_H=$gl_cv_next_unistd_h
29014
29015 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29016 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29017 gl_next_as_first_directive='<'unistd.h'>'
29018 else
29019 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29020 gl_next_as_first_directive=$gl_cv_next_unistd_h
29021 fi
29022 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
29023
29024
29025
29026
29027 if test $ac_cv_header_unistd_h = yes; then
29028 HAVE_UNISTD_H=1
29029 else
29030 HAVE_UNISTD_H=0
29031 fi
29032
29033
29034
29035
29036
29037
29038
472fa5ee
SM
29039
29040
29041
29042
29043
8839a007 29044
6ec2e0f5
SDJ
29045
29046
29047
698be2d8
CB
29048
29049
3d99e817
AK
29050 if test $ac_cv_have_decl_unsetenv = no; then
29051 HAVE_DECL_UNSETENV=0
29052 fi
29053 for ac_func in unsetenv
29054do :
29055 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
d0ac1c44 29056if test "x$ac_cv_func_unsetenv" = xyes; then :
3d99e817
AK
29057 cat >>confdefs.h <<_ACEOF
29058#define HAVE_UNSETENV 1
29059_ACEOF
29060
29061fi
29062done
29063
29064 if test $ac_cv_func_unsetenv = no; then
29065 HAVE_UNSETENV=0
29066 else
29067 HAVE_UNSETENV=1
29068 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
29069$as_echo_n "checking for unsetenv() return type... " >&6; }
d0ac1c44 29070if ${gt_cv_func_unsetenv_ret+:} false; then :
3d99e817
AK
29071 $as_echo_n "(cached) " >&6
29072else
29073 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29074/* end confdefs.h. */
29075
29076#undef _BSD
29077#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
29078#include <stdlib.h>
29079extern
29080#ifdef __cplusplus
29081"C"
29082#endif
29083int unsetenv (const char *name);
29084
29085int
29086main ()
29087{
29088
29089 ;
29090 return 0;
29091}
29092_ACEOF
29093if ac_fn_c_try_compile "$LINENO"; then :
29094 gt_cv_func_unsetenv_ret='int'
29095else
29096 gt_cv_func_unsetenv_ret='void'
29097fi
29098rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29099fi
29100{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
29101$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
29102 if test $gt_cv_func_unsetenv_ret = 'void'; then
29103
29104$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
29105
29106 REPLACE_UNSETENV=1
29107 fi
29108
29109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
29110$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
d0ac1c44 29111if ${gl_cv_func_unsetenv_works+:} false; then :
3d99e817
AK
29112 $as_echo_n "(cached) " >&6
29113else
29114 if test "$cross_compiling" = yes; then :
29115 case "$host_os" in
29116 # Guess yes on glibc systems.
29117 *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
c0c3707f
CB
29118 # If we don't know, obey --enable-cross-guesses.
29119 *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
29120 esac
29121
29122else
29123 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29124/* end confdefs.h. */
29125
29126 #include <stdlib.h>
29127 #include <errno.h>
29128 extern char **environ;
29129
29130int
29131main ()
29132{
29133
29134 char entry1[] = "a=1";
29135 char entry2[] = "b=2";
29136 char *env[] = { entry1, entry2, NULL };
29137 if (putenv ((char *) "a=1")) return 1;
29138 if (putenv (entry2)) return 2;
29139 entry2[0] = 'a';
29140 unsetenv ("a");
29141 if (getenv ("a")) return 3;
29142 if (!unsetenv ("") || errno != EINVAL) return 4;
29143 entry2[0] = 'b';
29144 environ = env;
29145 if (!getenv ("a")) return 5;
29146 entry2[0] = 'a';
29147 unsetenv ("a");
29148 if (getenv ("a")) return 6;
29149
29150 ;
29151 return 0;
29152}
29153_ACEOF
29154if ac_fn_c_try_run "$LINENO"; then :
29155 gl_cv_func_unsetenv_works=yes
29156else
29157 gl_cv_func_unsetenv_works=no
29158fi
29159rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29160 conftest.$ac_objext conftest.beam conftest.$ac_ext
29161fi
29162
29163fi
29164{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
29165$as_echo "$gl_cv_func_unsetenv_works" >&6; }
29166 case "$gl_cv_func_unsetenv_works" in
29167 *yes) ;;
29168 *)
29169 REPLACE_UNSETENV=1
29170 ;;
29171 esac
29172 fi
29173
29174 if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
29175
29176
29177
29178
29179
29180
29181
29182
29183 gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
29184
29185
29186
29187
29188
29189 fi
29190
29191
29192
29193
29194
29195 GNULIB_UNSETENV=1
29196
29197
29198
29199
29200
29201$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
29202
29203
29204
29205
29206
29207
8839a007
PA
29208
29209
29210
29211
29212
29213
29214
8690e634
JK
29215
29216
29217 if test $gl_cv_have_include_next = yes; then
29218 gl_cv_next_wchar_h='<'wchar.h'>'
29219 else
29220 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
29221$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
d0ac1c44 29222if ${gl_cv_next_wchar_h+:} false; then :
8690e634
JK
29223 $as_echo_n "(cached) " >&6
29224else
29225
29226 if test $ac_cv_header_wchar_h = yes; then
29227
29228
4a626d0a
PA
29229
29230
29231 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
29232/* end confdefs.h. */
29233#include <wchar.h>
8690e634 29234_ACEOF
4a626d0a
PA
29235 case "$host_os" in
29236 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29237 *) gl_absname_cpp="$ac_cpp" ;;
29238 esac
29239
29240 case "$host_os" in
29241 mingw*)
29242 gl_dirsep_regex='[/\\]'
29243 ;;
29244 *)
29245 gl_dirsep_regex='\/'
29246 ;;
29247 esac
29248 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29249 gl_header_literal_regex=`echo 'wchar.h' \
29250 | sed -e "$gl_make_literal_regex_sed"`
29251 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29252 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29253 s|^/[^/]|//&|
29254 p
29255 q
29256 }'
29257
29258 gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29259 sed -n "$gl_absolute_header_sed"`
29260
29261 gl_header=$gl_cv_absolute_wchar_h
29262 gl_cv_next_wchar_h='"'$gl_header'"'
8690e634
JK
29263 else
29264 gl_cv_next_wchar_h='<'wchar.h'>'
29265 fi
29266
29267
29268fi
29269{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
29270$as_echo "$gl_cv_next_wchar_h" >&6; }
29271 fi
29272 NEXT_WCHAR_H=$gl_cv_next_wchar_h
29273
29274 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29275 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29276 gl_next_as_first_directive='<'wchar.h'>'
29277 else
29278 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29279 gl_next_as_first_directive=$gl_cv_next_wchar_h
29280 fi
29281 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
29282
29283
29284
29285
29286 if test $ac_cv_header_wchar_h = yes; then
29287 HAVE_WCHAR_H=1
29288 else
29289 HAVE_WCHAR_H=0
29290 fi
29291
c971b7fa
PA
29292
29293
29294
29295
8690e634
JK
29296 if test $gt_cv_c_wint_t = yes; then
29297 HAVE_WINT_T=1
29298 else
29299 HAVE_WINT_T=0
29300 fi
c971b7fa
PA
29301
29302
29303
8690e634
JK
29304
29305
29306
29307
29308
472fa5ee
SM
29309
29310
29311
29312
29313
698be2d8
CB
29314
29315
8690e634
JK
29316 if test $ac_cv_func_iswcntrl = yes; then
29317 HAVE_ISWCNTRL=1
29318 else
29319 HAVE_ISWCNTRL=0
29320 fi
29321
29322
29323
8690e634
JK
29324 if test $gt_cv_c_wint_t = yes; then
29325 HAVE_WINT_T=1
29326 else
29327 HAVE_WINT_T=0
29328 fi
29329
29330
29331
29332
29333
29334
c971b7fa 29335
8690e634 29336
472fa5ee
SM
29337
29338
c971b7fa
PA
29339
29340
29341
29342 if test $gl_cv_have_include_next = yes; then
8690e634 29343 gl_cv_next_wctype_h='<'wctype.h'>'
c971b7fa 29344 else
8690e634
JK
29345 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
29346$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
d0ac1c44 29347if ${gl_cv_next_wctype_h+:} false; then :
c971b7fa
PA
29348 $as_echo_n "(cached) " >&6
29349else
29350
8690e634
JK
29351 if test $ac_cv_header_wctype_h = yes; then
29352
29353
4a626d0a
PA
29354
29355
29356 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 29357/* end confdefs.h. */
8690e634 29358#include <wctype.h>
c971b7fa 29359_ACEOF
4a626d0a
PA
29360 case "$host_os" in
29361 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29362 *) gl_absname_cpp="$ac_cpp" ;;
29363 esac
29364
29365 case "$host_os" in
29366 mingw*)
29367 gl_dirsep_regex='[/\\]'
29368 ;;
29369 *)
29370 gl_dirsep_regex='\/'
29371 ;;
29372 esac
29373 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29374 gl_header_literal_regex=`echo 'wctype.h' \
29375 | sed -e "$gl_make_literal_regex_sed"`
29376 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29377 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29378 s|^/[^/]|//&|
29379 p
29380 q
29381 }'
29382
29383 gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29384 sed -n "$gl_absolute_header_sed"`
29385
29386 gl_header=$gl_cv_absolute_wctype_h
29387 gl_cv_next_wctype_h='"'$gl_header'"'
8690e634
JK
29388 else
29389 gl_cv_next_wctype_h='<'wctype.h'>'
29390 fi
c971b7fa
PA
29391
29392
29393fi
8690e634
JK
29394{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
29395$as_echo "$gl_cv_next_wctype_h" >&6; }
c971b7fa 29396 fi
8690e634 29397 NEXT_WCTYPE_H=$gl_cv_next_wctype_h
c971b7fa
PA
29398
29399 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29400 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8690e634 29401 gl_next_as_first_directive='<'wctype.h'>'
c971b7fa
PA
29402 else
29403 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8690e634 29404 gl_next_as_first_directive=$gl_cv_next_wctype_h
c971b7fa 29405 fi
8690e634
JK
29406 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
29407
29408
29409
29410
29411 if test $ac_cv_header_wctype_h = yes; then
29412 if test $ac_cv_func_iswcntrl = yes; then
29413 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
29414$as_echo_n "checking whether iswcntrl works... " >&6; }
d0ac1c44 29415if ${gl_cv_func_iswcntrl_works+:} false; then :
8690e634
JK
29416 $as_echo_n "(cached) " >&6
29417else
29418
29419 if test "$cross_compiling" = yes; then :
c0c3707f 29420 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
29421/* end confdefs.h. */
29422#include <stdlib.h>
29423 #if __GNU_LIBRARY__ == 1
29424 Linux libc5 i18n is broken.
29425 #endif
29426int
29427main ()
29428{
29429
29430 ;
29431 return 0;
29432}
29433_ACEOF
29434if ac_fn_c_try_compile "$LINENO"; then :
29435 gl_cv_func_iswcntrl_works="guessing yes"
29436else
29437 gl_cv_func_iswcntrl_works="guessing no"
29438fi
29439rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29440
29441else
29442 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29443/* end confdefs.h. */
29444
29445 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
29446 included before <wchar.h>.
29447 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
29448 must be included before <wchar.h>. */
29449 #include <stddef.h>
29450 #include <stdio.h>
29451 #include <time.h>
29452 #include <wchar.h>
29453 #include <wctype.h>
29454 int main () { return iswprint ('x') == 0; }
29455
29456_ACEOF
29457if ac_fn_c_try_run "$LINENO"; then :
29458 gl_cv_func_iswcntrl_works=yes
29459else
29460 gl_cv_func_iswcntrl_works=no
29461fi
29462rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29463 conftest.$ac_objext conftest.beam conftest.$ac_ext
29464fi
29465
29466
29467fi
29468{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
29469$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
29470 fi
29471 HAVE_WCTYPE_H=1
29472 else
29473 HAVE_WCTYPE_H=0
29474 fi
29475
29476
c0c3707f
CB
29477 if test $GNULIB_OVERRIDES_WINT_T = 1; then
29478 REPLACE_ISWCNTRL=1
29479 else
29480 case "$gl_cv_func_iswcntrl_works" in
29481 *yes) REPLACE_ISWCNTRL=0 ;;
29482 *) REPLACE_ISWCNTRL=1 ;;
29483 esac
29484 fi
8690e634
JK
29485
29486
29487 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
29488 :
29489 fi
29490
29491 if test $REPLACE_ISWCNTRL = 1; then
29492 REPLACE_TOWLOWER=1
29493 else
29494 for ac_func in towlower
29495do :
29496 ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
d0ac1c44 29497if test "x$ac_cv_func_towlower" = xyes; then :
8690e634
JK
29498 cat >>confdefs.h <<_ACEOF
29499#define HAVE_TOWLOWER 1
29500_ACEOF
29501
29502fi
29503done
29504
29505 if test $ac_cv_func_towlower = yes; then
29506 REPLACE_TOWLOWER=0
29507 else
29508 ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
29509 included before <wchar.h>.
29510 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
29511 must be included before <wchar.h>. */
29512 #include <stddef.h>
29513 #include <stdio.h>
29514 #include <time.h>
29515 #include <wchar.h>
29516 #if HAVE_WCTYPE_H
29517 # include <wctype.h>
29518 #endif
29519
29520"
d0ac1c44 29521if test "x$ac_cv_have_decl_towlower" = xyes; then :
8690e634
JK
29522 ac_have_decl=1
29523else
29524 ac_have_decl=0
29525fi
29526
29527cat >>confdefs.h <<_ACEOF
29528#define HAVE_DECL_TOWLOWER $ac_have_decl
29529_ACEOF
29530
29531 if test $ac_cv_have_decl_towlower = yes; then
29532 REPLACE_TOWLOWER=1
29533 else
29534 REPLACE_TOWLOWER=0
29535 fi
29536 fi
29537 fi
29538
29539
29540 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
29541 :
29542 fi
29543
29544 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
29545$as_echo_n "checking for wctype_t... " >&6; }
d0ac1c44 29546if ${gl_cv_type_wctype_t+:} false; then :
8690e634
JK
29547 $as_echo_n "(cached) " >&6
29548else
29549 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29550/* end confdefs.h. */
29551/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
29552 included before <wchar.h>.
29553 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
29554 must be included before <wchar.h>. */
29555 #include <stddef.h>
29556 #include <stdio.h>
29557 #include <time.h>
29558 #include <wchar.h>
29559 #if HAVE_WCTYPE_H
29560 # include <wctype.h>
29561 #endif
29562 wctype_t a;
29563
29564int
29565main ()
29566{
29567
29568 ;
29569 return 0;
29570}
29571_ACEOF
29572if ac_fn_c_try_compile "$LINENO"; then :
29573 gl_cv_type_wctype_t=yes
29574else
29575 gl_cv_type_wctype_t=no
29576fi
29577rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 29578
8690e634
JK
29579fi
29580{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
29581$as_echo "$gl_cv_type_wctype_t" >&6; }
29582 if test $gl_cv_type_wctype_t = no; then
29583 HAVE_WCTYPE_T=0
29584 fi
29585
29586 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
29587$as_echo_n "checking for wctrans_t... " >&6; }
d0ac1c44 29588if ${gl_cv_type_wctrans_t+:} false; then :
8690e634
JK
29589 $as_echo_n "(cached) " >&6
29590else
29591 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29592/* end confdefs.h. */
29593/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
29594 included before <wchar.h>.
29595 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
29596 must be included before <wchar.h>. */
29597 #include <stddef.h>
29598 #include <stdio.h>
29599 #include <time.h>
29600 #include <wchar.h>
29601 #include <wctype.h>
29602 wctrans_t a;
c971b7fa 29603
8690e634
JK
29604int
29605main ()
29606{
c971b7fa 29607
8690e634
JK
29608 ;
29609 return 0;
29610}
29611_ACEOF
29612if ac_fn_c_try_compile "$LINENO"; then :
29613 gl_cv_type_wctrans_t=yes
29614else
29615 gl_cv_type_wctrans_t=no
29616fi
29617rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 29618
8690e634
JK
29619fi
29620{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
29621$as_echo "$gl_cv_type_wctrans_t" >&6; }
29622 if test $gl_cv_type_wctrans_t = no; then
29623 HAVE_WCTRANS_T=0
c971b7fa
PA
29624 fi
29625
29626
5e8754f9 29627
5e8754f9 29628
c971b7fa 29629
c0c3707f
CB
29630
29631 case "$host_os" in
29632 mingw*)
29633
29634
29635
29636
29637
29638
29639
29640
29641 gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext"
29642
29643 ;;
29644 esac
29645
29646 case "$host_os" in
29647 mingw*)
29648
29649
29650
29651
29652
29653
29654
29655
29656 gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext"
29657
29658 ;;
29659 esac
29660
29661 case "$host_os" in
29662 mingw*)
29663
29664
c971b7fa
PA
29665
29666
c0c3707f
CB
29667
29668
29669
29670
29671 gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext"
29672
29673 ;;
29674 esac
29675
29676 case "$host_os" in
29677 mingw*)
29678
29679
29680
29681
29682
29683
29684
29685
29686 gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext"
29687
29688 ;;
29689 esac
698be2d8
CB
29690
29691
29692 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wmemchr" >&5
29693$as_echo_n "checking for wmemchr... " >&6; }
29694if ${gl_cv_func_wmemchr+:} false; then :
29695 $as_echo_n "(cached) " >&6
29696else
29697 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29698/* end confdefs.h. */
29699
29700/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
29701 <wchar.h>.
29702 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
29703 before <wchar.h>. */
29704#include <stddef.h>
29705#include <stdio.h>
29706#include <time.h>
29707#include <wchar.h>
29708
29709int
29710main ()
29711{
29712return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0);
29713 ;
29714 return 0;
29715}
29716
29717_ACEOF
29718if ac_fn_c_try_link "$LINENO"; then :
29719 gl_cv_func_wmemchr=yes
29720else
29721 gl_cv_func_wmemchr=no
29722fi
29723rm -f core conftest.err conftest.$ac_objext \
29724 conftest$ac_exeext conftest.$ac_ext
29725
29726fi
29727{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wmemchr" >&5
29728$as_echo "$gl_cv_func_wmemchr" >&6; }
29729 if test $gl_cv_func_wmemchr = no; then
29730 HAVE_WMEMCHR=0
29731 fi
29732
29733 if test $HAVE_WMEMCHR = 0; then
29734
29735
29736
29737
29738
29739
29740
29741
29742 gl_LIBOBJS="$gl_LIBOBJS wmemchr.$ac_objext"
29743
29744 fi
29745
29746
29747
29748
29749
29750 GNULIB_WMEMCHR=1
29751
29752
29753
29754
29755
29756$as_echo "#define GNULIB_TEST_WMEMCHR 1" >>confdefs.h
29757
29758
29759
29760
29761
29762
29763
29764
29765
29766
29767
29768 if test $ac_cv_func_wmempcpy = no; then
29769 HAVE_WMEMPCPY=0
29770 fi
29771
29772 if test $HAVE_WMEMPCPY = 0; then
29773
29774
29775
29776
29777
29778
29779
29780
29781 gl_LIBOBJS="$gl_LIBOBJS wmempcpy.$ac_objext"
29782
29783 fi
29784
29785
29786
29787
29788
29789 GNULIB_WMEMPCPY=1
29790
29791
29792
29793
29794
29795$as_echo "#define GNULIB_TEST_WMEMPCPY 1" >>confdefs.h
29796
29797
29798
c971b7fa
PA
29799 # End of code from modules
29800
29801
29802
29803
29804
29805
29806
29807
29808
29809 gltests_libdeps=
29810 gltests_ltlibdeps=
29811
29812
29813
29814
29815
29816
29817
29818
29819
5df4cba6 29820
c971b7fa
PA
29821 gl_source_base='tests'
29822 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
29823
29824 gl_module_indicator_condition=$gltests_WITNESS
29825
29826
29827
29828
29829
29830
29831
29832
29833
29834 LIBGNU_LIBDEPS="$gl_libdeps"
29835
29836 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
29837
29838
29839
d0ac1c44 29840am__api_version='1.15'
c971b7fa
PA
29841
29842# Find a good install program. We prefer a C program (faster),
29843# so one script is as good as another. But avoid the broken or
29844# incompatible versions:
29845# SysV /etc/install, /usr/sbin/install
29846# SunOS /usr/etc/install
29847# IRIX /sbin/install
29848# AIX /bin/install
29849# AmigaOS /C/install, which installs bootblocks on floppy discs
29850# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
29851# AFS /usr/afsws/bin/install, which mishandles nonexistent args
29852# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
29853# OS/2's system install, which has a completely different semantic
29854# ./install, which can be erroneously created by make from ./install.sh.
29855# Reject install programs that cannot install multiple files.
29856{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
29857$as_echo_n "checking for a BSD-compatible install... " >&6; }
29858if test -z "$INSTALL"; then
d0ac1c44 29859if ${ac_cv_path_install+:} false; then :
c971b7fa
PA
29860 $as_echo_n "(cached) " >&6
29861else
29862 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29863for as_dir in $PATH
29864do
29865 IFS=$as_save_IFS
29866 test -z "$as_dir" && as_dir=.
29867 # Account for people who put trailing slashes in PATH elements.
29868case $as_dir/ in #((
29869 ./ | .// | /[cC]/* | \
29870 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
29871 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
29872 /usr/ucb/* ) ;;
29873 *)
29874 # OSF1 and SCO ODT 3.0 have their own names for install.
29875 # Don't use installbsd from OSF since it installs stuff as root
29876 # by default.
29877 for ac_prog in ginstall scoinst install; do
29878 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 29879 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
c971b7fa
PA
29880 if test $ac_prog = install &&
29881 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
29882 # AIX install. It has an incompatible calling convention.
29883 :
29884 elif test $ac_prog = install &&
29885 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
29886 # program-specific install script used by HP pwplus--don't use.
29887 :
29888 else
29889 rm -rf conftest.one conftest.two conftest.dir
29890 echo one > conftest.one
29891 echo two > conftest.two
29892 mkdir conftest.dir
29893 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
29894 test -s conftest.one && test -s conftest.two &&
29895 test -s conftest.dir/conftest.one &&
29896 test -s conftest.dir/conftest.two
29897 then
29898 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
29899 break 3
29900 fi
29901 fi
29902 fi
29903 done
29904 done
29905 ;;
29906esac
29907
29908 done
29909IFS=$as_save_IFS
29910
29911rm -rf conftest.one conftest.two conftest.dir
29912
29913fi
29914 if test "${ac_cv_path_install+set}" = set; then
29915 INSTALL=$ac_cv_path_install
29916 else
29917 # As a last resort, use the slow shell script. Don't cache a
29918 # value for INSTALL within a source directory, because that will
29919 # break other packages using the cache if that directory is
29920 # removed, or if the value is a relative name.
29921 INSTALL=$ac_install_sh
29922 fi
29923fi
29924{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
29925$as_echo "$INSTALL" >&6; }
29926
29927# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
29928# It thinks the first close brace ends the variable substitution.
29929test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
29930
29931test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
29932
29933test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
29934
29935{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
29936$as_echo_n "checking whether build environment is sane... " >&6; }
c971b7fa
PA
29937# Reject unsafe characters in $srcdir or the absolute working directory
29938# name. Accept space and tab only in the latter.
29939am_lf='
29940'
29941case `pwd` in
29942 *[\\\"\#\$\&\'\`$am_lf]*)
d0ac1c44 29943 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
c971b7fa
PA
29944esac
29945case $srcdir in
29946 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
d0ac1c44 29947 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
c971b7fa
PA
29948esac
29949
d0ac1c44 29950# Do 'set' in a subshell so we don't clobber the current shell's
c971b7fa
PA
29951# arguments. Must try -L first in case configure is actually a
29952# symlink; some systems play weird games with the mod time of symlinks
29953# (eg FreeBSD returns the mod time of the symlink's containing
29954# directory).
29955if (
d0ac1c44
SM
29956 am_has_slept=no
29957 for am_try in 1 2; do
29958 echo "timestamp, slept: $am_has_slept" > conftest.file
29959 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
29960 if test "$*" = "X"; then
29961 # -L didn't work.
29962 set X `ls -t "$srcdir/configure" conftest.file`
29963 fi
29964 if test "$*" != "X $srcdir/configure conftest.file" \
29965 && test "$*" != "X conftest.file $srcdir/configure"; then
29966
29967 # If neither matched, then we have a broken ls. This can happen
29968 # if, for instance, CONFIG_SHELL is bash and it inherits a
29969 # broken ls alias from the environment. This has actually
29970 # happened. Such a system could not be considered "sane".
29971 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
29972 alias in your environment" "$LINENO" 5
29973 fi
29974 if test "$2" = conftest.file || test $am_try -eq 2; then
29975 break
29976 fi
29977 # Just in case.
29978 sleep 1
29979 am_has_slept=yes
29980 done
c971b7fa
PA
29981 test "$2" = conftest.file
29982 )
29983then
29984 # Ok.
29985 :
29986else
d0ac1c44 29987 as_fn_error $? "newly created file is older than distributed files!
c971b7fa
PA
29988Check your system clock" "$LINENO" 5
29989fi
29990{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29991$as_echo "yes" >&6; }
d0ac1c44
SM
29992# If we didn't sleep, we still need to ensure time stamps of config.status and
29993# generated files are strictly newer.
29994am_sleep_pid=
29995if grep 'slept: no' conftest.file >/dev/null 2>&1; then
29996 ( sleep 1 ) &
29997 am_sleep_pid=$!
29998fi
29999
30000rm -f conftest.file
30001
c971b7fa
PA
30002test "$program_prefix" != NONE &&
30003 program_transform_name="s&^&$program_prefix&;$program_transform_name"
30004# Use a double $ so make ignores it.
30005test "$program_suffix" != NONE &&
30006 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
30007# Double any \ or $.
30008# By default was `s,x,x', remove it if useless.
30009ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
30010program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
30011
c0c3707f
CB
30012# Expand $ac_aux_dir to an absolute path.
30013am_aux_dir=`cd "$ac_aux_dir" && pwd`
30014
c971b7fa
PA
30015if test x"${MISSING+set}" != xset; then
30016 case $am_aux_dir in
30017 *\ * | *\ *)
30018 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
30019 *)
30020 MISSING="\${SHELL} $am_aux_dir/missing" ;;
30021 esac
30022fi
30023# Use eval to expand $SHELL
d0ac1c44
SM
30024if eval "$MISSING --is-lightweight"; then
30025 am_missing_run="$MISSING "
c971b7fa
PA
30026else
30027 am_missing_run=
d0ac1c44
SM
30028 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
30029$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
c971b7fa
PA
30030fi
30031
d0ac1c44 30032if test x"${install_sh+set}" != xset; then
c971b7fa
PA
30033 case $am_aux_dir in
30034 *\ * | *\ *)
30035 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
30036 *)
30037 install_sh="\${SHELL} $am_aux_dir/install-sh"
30038 esac
30039fi
30040
d0ac1c44
SM
30041# Installed binaries are usually stripped using 'strip' when the user
30042# run "make install-strip". However 'strip' might not be the right
c971b7fa 30043# tool to use in cross-compilation environments, therefore Automake
d0ac1c44 30044# will honor the 'STRIP' environment variable to overrule this program.
c971b7fa
PA
30045if test "$cross_compiling" != no; then
30046 if test -n "$ac_tool_prefix"; then
30047 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
30048set dummy ${ac_tool_prefix}strip; ac_word=$2
30049{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30050$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30051if ${ac_cv_prog_STRIP+:} false; then :
c971b7fa
PA
30052 $as_echo_n "(cached) " >&6
30053else
30054 if test -n "$STRIP"; then
30055 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
30056else
30057as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30058for as_dir in $PATH
30059do
30060 IFS=$as_save_IFS
30061 test -z "$as_dir" && as_dir=.
30062 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30063 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30064 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
30065 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30066 break 2
30067 fi
30068done
30069 done
30070IFS=$as_save_IFS
30071
30072fi
30073fi
30074STRIP=$ac_cv_prog_STRIP
30075if test -n "$STRIP"; then
30076 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
30077$as_echo "$STRIP" >&6; }
30078else
30079 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30080$as_echo "no" >&6; }
30081fi
30082
30083
30084fi
30085if test -z "$ac_cv_prog_STRIP"; then
30086 ac_ct_STRIP=$STRIP
30087 # Extract the first word of "strip", so it can be a program name with args.
30088set dummy strip; ac_word=$2
30089{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30090$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30091if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
c971b7fa
PA
30092 $as_echo_n "(cached) " >&6
30093else
30094 if test -n "$ac_ct_STRIP"; then
30095 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
30096else
30097as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30098for as_dir in $PATH
30099do
30100 IFS=$as_save_IFS
30101 test -z "$as_dir" && as_dir=.
30102 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30103 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30104 ac_cv_prog_ac_ct_STRIP="strip"
30105 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30106 break 2
30107 fi
30108done
30109 done
30110IFS=$as_save_IFS
30111
30112fi
30113fi
30114ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
30115if test -n "$ac_ct_STRIP"; then
30116 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
30117$as_echo "$ac_ct_STRIP" >&6; }
30118else
30119 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30120$as_echo "no" >&6; }
30121fi
30122
30123 if test "x$ac_ct_STRIP" = x; then
30124 STRIP=":"
30125 else
30126 case $cross_compiling:$ac_tool_warned in
30127yes:)
30128{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
30129$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
30130ac_tool_warned=yes ;;
30131esac
30132 STRIP=$ac_ct_STRIP
30133 fi
30134else
30135 STRIP="$ac_cv_prog_STRIP"
30136fi
30137
30138fi
30139INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
30140
c971b7fa
PA
30141for ac_prog in gawk mawk nawk awk
30142do
30143 # Extract the first word of "$ac_prog", so it can be a program name with args.
30144set dummy $ac_prog; ac_word=$2
30145{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30146$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30147if ${ac_cv_prog_AWK+:} false; then :
c971b7fa
PA
30148 $as_echo_n "(cached) " >&6
30149else
30150 if test -n "$AWK"; then
30151 ac_cv_prog_AWK="$AWK" # Let the user override the test.
30152else
30153as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30154for as_dir in $PATH
30155do
30156 IFS=$as_save_IFS
30157 test -z "$as_dir" && as_dir=.
30158 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30159 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30160 ac_cv_prog_AWK="$ac_prog"
30161 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30162 break 2
30163 fi
30164done
30165 done
30166IFS=$as_save_IFS
30167
30168fi
30169fi
30170AWK=$ac_cv_prog_AWK
30171if test -n "$AWK"; then
30172 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
30173$as_echo "$AWK" >&6; }
30174else
30175 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30176$as_echo "no" >&6; }
30177fi
30178
30179
30180 test -n "$AWK" && break
30181done
30182
30183{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
30184$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
30185set x ${MAKE-make}
30186ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
d0ac1c44 30187if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
c971b7fa
PA
30188 $as_echo_n "(cached) " >&6
30189else
30190 cat >conftest.make <<\_ACEOF
30191SHELL = /bin/sh
30192all:
30193 @echo '@@@%%%=$(MAKE)=@@@%%%'
30194_ACEOF
d0ac1c44 30195# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
c971b7fa
PA
30196case `${MAKE-make} -f conftest.make 2>/dev/null` in
30197 *@@@%%%=?*=@@@%%%*)
30198 eval ac_cv_prog_make_${ac_make}_set=yes;;
30199 *)
30200 eval ac_cv_prog_make_${ac_make}_set=no;;
30201esac
30202rm -f conftest.make
30203fi
30204if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
30205 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30206$as_echo "yes" >&6; }
30207 SET_MAKE=
30208else
30209 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30210$as_echo "no" >&6; }
30211 SET_MAKE="MAKE=${MAKE-make}"
30212fi
30213
30214rm -rf .tst 2>/dev/null
30215mkdir .tst 2>/dev/null
30216if test -d .tst; then
30217 am__leading_dot=.
30218else
30219 am__leading_dot=_
30220fi
30221rmdir .tst 2>/dev/null
30222
30223DEPDIR="${am__leading_dot}deps"
30224
30225ac_config_commands="$ac_config_commands depfiles"
30226
30227
30228am_make=${MAKE-make}
30229cat > confinc << 'END'
30230am__doit:
30231 @echo this is the am__doit target
30232.PHONY: am__doit
30233END
30234# If we don't find an include directive, just comment out the code.
30235{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
30236$as_echo_n "checking for style of include used by $am_make... " >&6; }
30237am__include="#"
30238am__quote=
30239_am_result=none
30240# First try GNU make style include.
30241echo "include confinc" > confmf
d0ac1c44 30242# Ignore all kinds of additional output from 'make'.
c971b7fa
PA
30243case `$am_make -s -f confmf 2> /dev/null` in #(
30244*the\ am__doit\ target*)
30245 am__include=include
30246 am__quote=
30247 _am_result=GNU
30248 ;;
30249esac
30250# Now try BSD make style include.
30251if test "$am__include" = "#"; then
30252 echo '.include "confinc"' > confmf
30253 case `$am_make -s -f confmf 2> /dev/null` in #(
30254 *the\ am__doit\ target*)
30255 am__include=.include
30256 am__quote="\""
30257 _am_result=BSD
30258 ;;
30259 esac
30260fi
30261
30262
30263{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
30264$as_echo "$_am_result" >&6; }
30265rm -f confinc confmf
30266
30267# Check whether --enable-dependency-tracking was given.
30268if test "${enable_dependency_tracking+set}" = set; then :
30269 enableval=$enable_dependency_tracking;
30270fi
30271
30272if test "x$enable_dependency_tracking" != xno; then
30273 am_depcomp="$ac_aux_dir/depcomp"
30274 AMDEPBACKSLASH='\'
d0ac1c44 30275 am__nodep='_no'
c971b7fa
PA
30276fi
30277 if test "x$enable_dependency_tracking" != xno; then
30278 AMDEP_TRUE=
30279 AMDEP_FALSE='#'
30280else
30281 AMDEP_TRUE='#'
30282 AMDEP_FALSE=
30283fi
30284
30285
d0ac1c44
SM
30286# Check whether --enable-silent-rules was given.
30287if test "${enable_silent_rules+set}" = set; then :
30288 enableval=$enable_silent_rules;
30289fi
30290
30291case $enable_silent_rules in # (((
30292 yes) AM_DEFAULT_VERBOSITY=0;;
30293 no) AM_DEFAULT_VERBOSITY=1;;
30294 *) AM_DEFAULT_VERBOSITY=1;;
30295esac
30296am_make=${MAKE-make}
30297{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
30298$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
30299if ${am_cv_make_support_nested_variables+:} false; then :
30300 $as_echo_n "(cached) " >&6
30301else
30302 if $as_echo 'TRUE=$(BAR$(V))
30303BAR0=false
30304BAR1=true
30305V=1
30306am__doit:
30307 @$(TRUE)
30308.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
30309 am_cv_make_support_nested_variables=yes
30310else
30311 am_cv_make_support_nested_variables=no
30312fi
30313fi
30314{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
30315$as_echo "$am_cv_make_support_nested_variables" >&6; }
30316if test $am_cv_make_support_nested_variables = yes; then
30317 AM_V='$(V)'
30318 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
30319else
30320 AM_V=$AM_DEFAULT_VERBOSITY
30321 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
30322fi
30323AM_BACKSLASH='\'
30324
c971b7fa
PA
30325if test "`cd $srcdir && pwd`" != "`pwd`"; then
30326 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
30327 # is not polluted with repeated "-I."
30328 am__isrc=' -I$(srcdir)'
30329 # test to see if srcdir already configured
30330 if test -f $srcdir/config.status; then
d0ac1c44 30331 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
c971b7fa
PA
30332 fi
30333fi
30334
30335# test whether we have cygpath
30336if test -z "$CYGPATH_W"; then
30337 if (cygpath --version) >/dev/null 2>/dev/null; then
30338 CYGPATH_W='cygpath -w'
30339 else
30340 CYGPATH_W=echo
30341 fi
30342fi
30343
30344
30345# Define the identity of the package.
d0ac1c44
SM
30346 PACKAGE='libgnu'
30347 VERSION='UNUSED-VERSION'
c971b7fa
PA
30348
30349
30350# Some tools Automake needs.
30351
30352ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
30353
30354
30355AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
30356
30357
30358AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
30359
30360
30361AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
30362
30363
30364MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
30365
d0ac1c44
SM
30366# For better backward compatibility. To be removed once Automake 1.9.x
30367# dies out for good. For more background, see:
30368# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
30369# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
30370mkdir_p='$(MKDIR_P)'
30371
30372# We need awk for the "check" target (and possibly the TAP driver). The
30373# system "awk" is bad on some platforms.
30374# Always define AMTAR for backward compatibility. Yes, it's still used
30375# in the wild :-( We should find a proper way to deprecate it ...
30376AMTAR='$${TAR-tar}'
30377
30378
30379# We'll loop over all known methods to create a tar archive until one works.
30380_am_tools='gnutar pax cpio none'
c971b7fa 30381
d0ac1c44 30382am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
c971b7fa 30383
c971b7fa
PA
30384
30385
30386
30387
30388depcc="$CC" am_compiler_list=
30389
30390{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
30391$as_echo_n "checking dependency style of $depcc... " >&6; }
d0ac1c44 30392if ${am_cv_CC_dependencies_compiler_type+:} false; then :
c971b7fa
PA
30393 $as_echo_n "(cached) " >&6
30394else
30395 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
30396 # We make a subdir and do the tests there. Otherwise we can end up
30397 # making bogus files that we don't know about and never remove. For
30398 # instance it was reported that on HP-UX the gcc test will end up
d0ac1c44
SM
30399 # making a dummy file named 'D' -- because '-MD' means "put the output
30400 # in D".
30401 rm -rf conftest.dir
c971b7fa
PA
30402 mkdir conftest.dir
30403 # Copy depcomp to subdir because otherwise we won't find it if we're
30404 # using a relative directory.
30405 cp "$am_depcomp" conftest.dir
30406 cd conftest.dir
30407 # We will build objects and dependencies in a subdirectory because
30408 # it helps to detect inapplicable dependency modes. For instance
30409 # both Tru64's cc and ICC support -MD to output dependencies as a
30410 # side effect of compilation, but ICC will put the dependencies in
30411 # the current directory while Tru64 will put them in the object
30412 # directory.
30413 mkdir sub
30414
30415 am_cv_CC_dependencies_compiler_type=none
30416 if test "$am_compiler_list" = ""; then
30417 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
30418 fi
30419 am__universal=false
30420 case " $depcc " in #(
30421 *\ -arch\ *\ -arch\ *) am__universal=true ;;
30422 esac
30423
30424 for depmode in $am_compiler_list; do
30425 # Setup a source with many dependencies, because some compilers
30426 # like to wrap large dependency lists on column 80 (with \), and
30427 # we should not choose a depcomp mode which is confused by this.
30428 #
30429 # We need to recreate these files for each test, as the compiler may
30430 # overwrite some of them when testing with obscure command lines.
30431 # This happens at least with the AIX C compiler.
30432 : > sub/conftest.c
30433 for i in 1 2 3 4 5 6; do
30434 echo '#include "conftst'$i'.h"' >> sub/conftest.c
d0ac1c44
SM
30435 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
30436 # Solaris 10 /bin/sh.
30437 echo '/* dummy */' > sub/conftst$i.h
c971b7fa
PA
30438 done
30439 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
30440
d0ac1c44 30441 # We check with '-c' and '-o' for the sake of the "dashmstdout"
c971b7fa 30442 # mode. It turns out that the SunPro C++ compiler does not properly
d0ac1c44
SM
30443 # handle '-M -o', and we need to detect this. Also, some Intel
30444 # versions had trouble with output in subdirs.
c971b7fa
PA
30445 am__obj=sub/conftest.${OBJEXT-o}
30446 am__minus_obj="-o $am__obj"
30447 case $depmode in
30448 gcc)
30449 # This depmode causes a compiler race in universal mode.
30450 test "$am__universal" = false || continue
30451 ;;
30452 nosideeffect)
d0ac1c44
SM
30453 # After this tag, mechanisms are not by side-effect, so they'll
30454 # only be used when explicitly requested.
c971b7fa
PA
30455 if test "x$enable_dependency_tracking" = xyes; then
30456 continue
30457 else
30458 break
30459 fi
30460 ;;
d0ac1c44
SM
30461 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
30462 # This compiler won't grok '-c -o', but also, the minuso test has
c971b7fa
PA
30463 # not run yet. These depmodes are late enough in the game, and
30464 # so weak that their functioning should not be impacted.
30465 am__obj=conftest.${OBJEXT-o}
30466 am__minus_obj=
30467 ;;
30468 none) break ;;
30469 esac
30470 if depmode=$depmode \
30471 source=sub/conftest.c object=$am__obj \
30472 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
30473 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
30474 >/dev/null 2>conftest.err &&
30475 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
30476 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
30477 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
30478 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
30479 # icc doesn't choke on unknown options, it will just issue warnings
30480 # or remarks (even with -Werror). So we grep stderr for any message
30481 # that says an option was ignored or not supported.
30482 # When given -MP, icc 7.0 and 7.1 complain thusly:
30483 # icc: Command line warning: ignoring option '-M'; no argument required
30484 # The diagnosis changed in icc 8.0:
30485 # icc: Command line remark: option '-MP' not supported
30486 if (grep 'ignoring option' conftest.err ||
30487 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
30488 am_cv_CC_dependencies_compiler_type=$depmode
30489 break
30490 fi
30491 fi
30492 done
30493
30494 cd ..
30495 rm -rf conftest.dir
30496else
30497 am_cv_CC_dependencies_compiler_type=none
30498fi
30499
30500fi
30501{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
30502$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
30503CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
30504
30505 if
30506 test "x$enable_dependency_tracking" != xno \
30507 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
30508 am__fastdepCC_TRUE=
30509 am__fastdepCC_FALSE='#'
30510else
30511 am__fastdepCC_TRUE='#'
30512 am__fastdepCC_FALSE=
30513fi
30514
30515
30516
d0ac1c44
SM
30517# POSIX will say in a future version that running "rm -f" with no argument
30518# is OK; and we want to be able to make that assumption in our Makefile
30519# recipes. So use an aggressive probe to check that the usage we want is
30520# actually supported "in the wild" to an acceptable degree.
30521# See automake bug#10828.
30522# To make any issue more visible, cause the running configure to be aborted
30523# by default if the 'rm' program in use doesn't match our expectations; the
30524# user can still override this though.
30525if rm -f && rm -fr && rm -rf; then : OK; else
30526 cat >&2 <<'END'
30527Oops!
30528
30529Your 'rm' program seems unable to run without file operands specified
30530on the command line, even when the '-f' option is present. This is contrary
30531to the behaviour of most rm programs out there, and not conforming with
30532the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
30533
30534Please tell bug-automake@gnu.org about your system, including the value
30535of your $PATH and any error possibly output before this message. This
30536can help us improve future automake versions.
30537
30538END
30539 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
30540 echo 'Configuration will proceed anyway, since you have set the' >&2
30541 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
30542 echo >&2
30543 else
30544 cat >&2 <<'END'
30545Aborting the configuration process, to ensure you take notice of the issue.
30546
30547You can download and install GNU coreutils to get an 'rm' implementation
30548that behaves properly: <http://www.gnu.org/software/coreutils/>.
30549
30550If you want to complete the configuration process using your problematic
30551'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
30552to "yes", and re-run configure.
30553
30554END
30555 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
30556 fi
30557fi
30558
c971b7fa 30559
39be3c7e
SM
30560# Check whether --enable-silent-rules was given.
30561if test "${enable_silent_rules+set}" = set; then :
30562 enableval=$enable_silent_rules;
30563fi
30564
d0ac1c44
SM
30565case $enable_silent_rules in # (((
30566 yes) AM_DEFAULT_VERBOSITY=0;;
30567 no) AM_DEFAULT_VERBOSITY=1;;
30568 *) AM_DEFAULT_VERBOSITY=0;;
39be3c7e 30569esac
d0ac1c44
SM
30570am_make=${MAKE-make}
30571{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
30572$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
30573if ${am_cv_make_support_nested_variables+:} false; then :
30574 $as_echo_n "(cached) " >&6
30575else
30576 if $as_echo 'TRUE=$(BAR$(V))
30577BAR0=false
30578BAR1=true
30579V=1
30580am__doit:
30581 @$(TRUE)
30582.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
30583 am_cv_make_support_nested_variables=yes
30584else
30585 am_cv_make_support_nested_variables=no
30586fi
30587fi
30588{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
30589$as_echo "$am_cv_make_support_nested_variables" >&6; }
30590if test $am_cv_make_support_nested_variables = yes; then
30591 AM_V='$(V)'
30592 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
30593else
30594 AM_V=$AM_DEFAULT_VERBOSITY
30595 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
30596fi
39be3c7e
SM
30597AM_BACKSLASH='\'
30598
30599
c971b7fa
PA
30600# --------------------- #
30601# Checks for programs. #
30602# --------------------- #
30603
30604
30605{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
30606$as_echo_n "checking whether ln -s works... " >&6; }
30607LN_S=$as_ln_s
30608if test "$LN_S" = "ln -s"; then
30609 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30610$as_echo "yes" >&6; }
30611else
30612 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
30613$as_echo "no, using $LN_S" >&6; }
30614fi
30615
30616if test -n "$ac_tool_prefix"; then
30617 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
30618set dummy ${ac_tool_prefix}ranlib; ac_word=$2
30619{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30620$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30621if ${ac_cv_prog_RANLIB+:} false; then :
c971b7fa
PA
30622 $as_echo_n "(cached) " >&6
30623else
30624 if test -n "$RANLIB"; then
30625 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
30626else
30627as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30628for as_dir in $PATH
30629do
30630 IFS=$as_save_IFS
30631 test -z "$as_dir" && as_dir=.
30632 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30633 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30634 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
30635 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30636 break 2
30637 fi
30638done
30639 done
30640IFS=$as_save_IFS
30641
30642fi
30643fi
30644RANLIB=$ac_cv_prog_RANLIB
30645if test -n "$RANLIB"; then
30646 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
30647$as_echo "$RANLIB" >&6; }
30648else
30649 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30650$as_echo "no" >&6; }
30651fi
30652
30653
30654fi
30655if test -z "$ac_cv_prog_RANLIB"; then
30656 ac_ct_RANLIB=$RANLIB
30657 # Extract the first word of "ranlib", so it can be a program name with args.
30658set dummy ranlib; ac_word=$2
30659{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30660$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30661if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
30662 $as_echo_n "(cached) " >&6
30663else
30664 if test -n "$ac_ct_RANLIB"; then
30665 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
30666else
30667as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30668for as_dir in $PATH
30669do
30670 IFS=$as_save_IFS
30671 test -z "$as_dir" && as_dir=.
30672 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30673 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30674 ac_cv_prog_ac_ct_RANLIB="ranlib"
30675 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30676 break 2
30677 fi
30678done
30679 done
30680IFS=$as_save_IFS
30681
30682fi
30683fi
30684ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
30685if test -n "$ac_ct_RANLIB"; then
30686 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
30687$as_echo "$ac_ct_RANLIB" >&6; }
30688else
30689 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30690$as_echo "no" >&6; }
30691fi
30692
30693 if test "x$ac_ct_RANLIB" = x; then
30694 RANLIB=":"
30695 else
30696 case $cross_compiling:$ac_tool_warned in
30697yes:)
30698{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
30699$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
30700ac_tool_warned=yes ;;
30701esac
30702 RANLIB=$ac_ct_RANLIB
30703 fi
30704else
30705 RANLIB="$ac_cv_prog_RANLIB"
30706fi
30707
30708
30709if test -n "$ac_tool_prefix"; then
30710 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
30711set dummy ${ac_tool_prefix}ar; ac_word=$2
30712{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30713$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30714if ${ac_cv_prog_AR+:} false; then :
c971b7fa
PA
30715 $as_echo_n "(cached) " >&6
30716else
30717 if test -n "$AR"; then
30718 ac_cv_prog_AR="$AR" # Let the user override the test.
30719else
30720as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30721for as_dir in $PATH
30722do
30723 IFS=$as_save_IFS
30724 test -z "$as_dir" && as_dir=.
30725 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30726 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30727 ac_cv_prog_AR="${ac_tool_prefix}ar"
30728 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30729 break 2
30730 fi
30731done
30732 done
30733IFS=$as_save_IFS
30734
30735fi
30736fi
30737AR=$ac_cv_prog_AR
30738if test -n "$AR"; then
30739 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
30740$as_echo "$AR" >&6; }
30741else
30742 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30743$as_echo "no" >&6; }
30744fi
30745
30746
30747fi
30748if test -z "$ac_cv_prog_AR"; then
30749 ac_ct_AR=$AR
30750 # Extract the first word of "ar", so it can be a program name with args.
30751set dummy ar; ac_word=$2
30752{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30753$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30754if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
30755 $as_echo_n "(cached) " >&6
30756else
30757 if test -n "$ac_ct_AR"; then
30758 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
30759else
30760as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30761for as_dir in $PATH
30762do
30763 IFS=$as_save_IFS
30764 test -z "$as_dir" && as_dir=.
30765 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30766 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30767 ac_cv_prog_ac_ct_AR="ar"
30768 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30769 break 2
30770 fi
30771done
30772 done
30773IFS=$as_save_IFS
30774
30775fi
30776fi
30777ac_ct_AR=$ac_cv_prog_ac_ct_AR
30778if test -n "$ac_ct_AR"; then
30779 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
30780$as_echo "$ac_ct_AR" >&6; }
30781else
30782 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30783$as_echo "no" >&6; }
30784fi
30785
30786 if test "x$ac_ct_AR" = x; then
30787 AR=""
30788 else
30789 case $cross_compiling:$ac_tool_warned in
30790yes:)
30791{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
30792$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
30793ac_tool_warned=yes ;;
30794esac
30795 AR=$ac_ct_AR
30796 fi
30797else
30798 AR="$ac_cv_prog_AR"
30799fi
30800
30801
30802# ---------------------- #
30803# Checks for libraries. #
30804# ---------------------- #
30805
30806ac_config_files="$ac_config_files Makefile import/Makefile"
30807
30808ac_config_commands="$ac_config_commands default"
30809
30810cat >confcache <<\_ACEOF
30811# This file is a shell script that caches the results of configure
30812# tests run on this system so they can be shared between configure
30813# scripts and configure runs, see configure's option --config-cache.
30814# It is not useful on other systems. If it contains results you don't
30815# want to keep, you may remove or edit it.
30816#
30817# config.status only pays attention to the cache file if you give it
30818# the --recheck option to rerun configure.
30819#
30820# `ac_cv_env_foo' variables (set or unset) will be overridden when
30821# loading this file, other *unset* `ac_cv_foo' will be assigned the
30822# following values.
30823
30824_ACEOF
30825
30826# The following way of writing the cache mishandles newlines in values,
30827# but we know of no workaround that is simple, portable, and efficient.
30828# So, we kill variables containing newlines.
30829# Ultrix sh set writes to stderr and can't be redirected directly,
30830# and sets the high bit in the cache file unless we assign to the vars.
30831(
30832 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
30833 eval ac_val=\$$ac_var
30834 case $ac_val in #(
30835 *${as_nl}*)
30836 case $ac_var in #(
30837 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
30838$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
30839 esac
30840 case $ac_var in #(
30841 _ | IFS | as_nl) ;; #(
30842 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
30843 *) { eval $ac_var=; unset $ac_var;} ;;
30844 esac ;;
30845 esac
30846 done
30847
30848 (set) 2>&1 |
30849 case $as_nl`(ac_space=' '; set) 2>&1` in #(
30850 *${as_nl}ac_space=\ *)
30851 # `set' does not quote correctly, so add quotes: double-quote
30852 # substitution turns \\\\ into \\, and sed turns \\ into \.
30853 sed -n \
30854 "s/'/'\\\\''/g;
30855 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
30856 ;; #(
30857 *)
30858 # `set' quotes correctly as required by POSIX, so do not add quotes.
30859 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
30860 ;;
30861 esac |
30862 sort
30863) |
30864 sed '
30865 /^ac_cv_env_/b end
30866 t clear
30867 :clear
30868 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
30869 t end
30870 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
30871 :end' >>confcache
30872if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
30873 if test -w "$cache_file"; then
d0ac1c44 30874 if test "x$cache_file" != "x/dev/null"; then
c971b7fa
PA
30875 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
30876$as_echo "$as_me: updating cache $cache_file" >&6;}
d0ac1c44
SM
30877 if test ! -f "$cache_file" || test -h "$cache_file"; then
30878 cat confcache >"$cache_file"
30879 else
30880 case $cache_file in #(
30881 */* | ?:*)
30882 mv -f confcache "$cache_file"$$ &&
30883 mv -f "$cache_file"$$ "$cache_file" ;; #(
30884 *)
30885 mv -f confcache "$cache_file" ;;
30886 esac
30887 fi
30888 fi
c971b7fa
PA
30889 else
30890 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
30891$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
30892 fi
30893fi
30894rm -f confcache
30895
30896test "x$prefix" = xNONE && prefix=$ac_default_prefix
30897# Let make expand exec_prefix.
30898test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
30899
30900DEFS=-DHAVE_CONFIG_H
30901
30902ac_libobjs=
30903ac_ltlibobjs=
30904for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
30905 # 1. Remove the extension, and $U if already installed.
30906 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
30907 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
30908 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
30909 # will be set to the directory where LIBOBJS objects are built.
30910 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
30911 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
30912done
30913LIBOBJS=$ac_libobjs
30914
30915LTLIBOBJS=$ac_ltlibobjs
30916
30917
30918if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
d0ac1c44 30919 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
c971b7fa
PA
30920Usually this means the macro was only invoked conditionally." "$LINENO" 5
30921fi
30922if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
d0ac1c44 30923 as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
c971b7fa
PA
30924Usually this means the macro was only invoked conditionally." "$LINENO" 5
30925fi
8690e634 30926if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
d0ac1c44 30927 as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
8690e634
JK
30928Usually this means the macro was only invoked conditionally." "$LINENO" 5
30929fi
18848e28 30930if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
d0ac1c44 30931 as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
18848e28
GF
30932Usually this means the macro was only invoked conditionally." "$LINENO" 5
30933fi
88b48903 30934if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
d0ac1c44 30935 as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
88b48903
WN
30936Usually this means the macro was only invoked conditionally." "$LINENO" 5
30937fi
8690e634 30938if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
d0ac1c44 30939 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
8690e634
JK
30940Usually this means the macro was only invoked conditionally." "$LINENO" 5
30941fi
c0c3707f
CB
30942if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
30943 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
30944Usually this means the macro was only invoked conditionally." "$LINENO" 5
30945fi
30946if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
30947 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
30948Usually this means the macro was only invoked conditionally." "$LINENO" 5
30949fi
6ec2e0f5 30950if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
d0ac1c44 30951 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
6ec2e0f5
SDJ
30952Usually this means the macro was only invoked conditionally." "$LINENO" 5
30953fi
49e4877c 30954if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 30955 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
30956Usually this means the macro was only invoked conditionally." "$LINENO" 5
30957fi
30958if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 30959 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
30960Usually this means the macro was only invoked conditionally." "$LINENO" 5
30961fi
c971b7fa 30962if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
d0ac1c44 30963 as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
c971b7fa
PA
30964Usually this means the macro was only invoked conditionally." "$LINENO" 5
30965fi
88b48903
WN
30966
30967
5df4cba6
SM
30968if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
30969 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
30970Usually this means the macro was only invoked conditionally." "$LINENO" 5
30971fi
725e2999
JB
30972if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
30973 as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
30974Usually this means the macro was only invoked conditionally." "$LINENO" 5
30975fi
30976if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
30977 as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
30978Usually this means the macro was only invoked conditionally." "$LINENO" 5
30979fi
8690e634 30980if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
d0ac1c44 30981 as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
8690e634
JK
30982Usually this means the macro was only invoked conditionally." "$LINENO" 5
30983fi
c971b7fa 30984if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
d0ac1c44 30985 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
c971b7fa
PA
30986Usually this means the macro was only invoked conditionally." "$LINENO" 5
30987fi
30988
30989 gl_libobjs=
30990 gl_ltlibobjs=
30991 if test -n "$gl_LIBOBJS"; then
30992 # Remove the extension.
30993 sed_drop_objext='s/\.o$//;s/\.obj$//'
30994 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
30995 gl_libobjs="$gl_libobjs $i.$ac_objext"
30996 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
30997 done
30998 fi
30999 gl_LIBOBJS=$gl_libobjs
31000
31001 gl_LTLIBOBJS=$gl_ltlibobjs
31002
31003
31004
31005 gltests_libobjs=
31006 gltests_ltlibobjs=
31007 if test -n "$gltests_LIBOBJS"; then
31008 # Remove the extension.
31009 sed_drop_objext='s/\.o$//;s/\.obj$//'
31010 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
31011 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
31012 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
31013 done
31014 fi
31015 gltests_LIBOBJS=$gltests_libobjs
31016
31017 gltests_LTLIBOBJS=$gltests_ltlibobjs
31018
31019
d0ac1c44
SM
31020{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
31021$as_echo_n "checking that generated files are newer than configure... " >&6; }
31022 if test -n "$am_sleep_pid"; then
31023 # Hide warnings about reused PIDs.
31024 wait $am_sleep_pid 2>/dev/null
31025 fi
31026 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
31027$as_echo "done" >&6; }
c971b7fa 31028if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
d0ac1c44 31029 as_fn_error $? "conditional \"AMDEP\" was never defined.
c971b7fa
PA
31030Usually this means the macro was only invoked conditionally." "$LINENO" 5
31031fi
31032if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
d0ac1c44 31033 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
c971b7fa
PA
31034Usually this means the macro was only invoked conditionally." "$LINENO" 5
31035fi
31036 if test -n "$EXEEXT"; then
31037 am__EXEEXT_TRUE=
31038 am__EXEEXT_FALSE='#'
31039else
31040 am__EXEEXT_TRUE='#'
31041 am__EXEEXT_FALSE=
31042fi
31043
31044
d0ac1c44 31045: "${CONFIG_STATUS=./config.status}"
c971b7fa
PA
31046ac_write_fail=0
31047ac_clean_files_save=$ac_clean_files
31048ac_clean_files="$ac_clean_files $CONFIG_STATUS"
31049{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
31050$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
31051as_write_fail=0
31052cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
31053#! $SHELL
31054# Generated by $as_me.
31055# Run this file to recreate the current configuration.
31056# Compiler output produced by configure, useful for debugging
31057# configure, is in config.log if it exists.
31058
31059debug=false
31060ac_cs_recheck=false
31061ac_cs_silent=false
31062
31063SHELL=\${CONFIG_SHELL-$SHELL}
31064export SHELL
31065_ASEOF
31066cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
31067## -------------------- ##
31068## M4sh Initialization. ##
31069## -------------------- ##
31070
31071# Be more Bourne compatible
31072DUALCASE=1; export DUALCASE # for MKS sh
31073if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
31074 emulate sh
31075 NULLCMD=:
31076 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
31077 # is contrary to our usage. Disable this feature.
31078 alias -g '${1+"$@"}'='"$@"'
31079 setopt NO_GLOB_SUBST
31080else
31081 case `(set -o) 2>/dev/null` in #(
31082 *posix*) :
31083 set -o posix ;; #(
31084 *) :
31085 ;;
31086esac
31087fi
31088
31089
31090as_nl='
31091'
31092export as_nl
31093# Printing a long string crashes Solaris 7 /usr/bin/printf.
31094as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
31095as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
31096as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
31097# Prefer a ksh shell builtin over an external printf program on Solaris,
31098# but without wasting forks for bash or zsh.
31099if test -z "$BASH_VERSION$ZSH_VERSION" \
31100 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
31101 as_echo='print -r --'
31102 as_echo_n='print -rn --'
31103elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
31104 as_echo='printf %s\n'
31105 as_echo_n='printf %s'
31106else
31107 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
31108 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
31109 as_echo_n='/usr/ucb/echo -n'
31110 else
31111 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
31112 as_echo_n_body='eval
31113 arg=$1;
31114 case $arg in #(
31115 *"$as_nl"*)
31116 expr "X$arg" : "X\\(.*\\)$as_nl";
31117 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
31118 esac;
31119 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
31120 '
31121 export as_echo_n_body
31122 as_echo_n='sh -c $as_echo_n_body as_echo'
31123 fi
31124 export as_echo_body
31125 as_echo='sh -c $as_echo_body as_echo'
31126fi
31127
31128# The user is always right.
31129if test "${PATH_SEPARATOR+set}" != set; then
31130 PATH_SEPARATOR=:
31131 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
31132 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
31133 PATH_SEPARATOR=';'
31134 }
31135fi
31136
31137
31138# IFS
31139# We need space, tab and new line, in precisely that order. Quoting is
31140# there to prevent editors from complaining about space-tab.
31141# (If _AS_PATH_WALK were called with IFS unset, it would disable word
31142# splitting by setting IFS to empty value.)
31143IFS=" "" $as_nl"
31144
31145# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 31146as_myself=
c971b7fa
PA
31147case $0 in #((
31148 *[\\/]* ) as_myself=$0 ;;
31149 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31150for as_dir in $PATH
31151do
31152 IFS=$as_save_IFS
31153 test -z "$as_dir" && as_dir=.
31154 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
31155 done
31156IFS=$as_save_IFS
31157
31158 ;;
31159esac
31160# We did not find ourselves, most probably we were run as `sh COMMAND'
31161# in which case we are not to be found in the path.
31162if test "x$as_myself" = x; then
31163 as_myself=$0
31164fi
31165if test ! -f "$as_myself"; then
31166 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
31167 exit 1
31168fi
31169
31170# Unset variables that we do not need and which cause bugs (e.g. in
31171# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
31172# suppresses any "Segmentation fault" message there. '((' could
31173# trigger a bug in pdksh 5.2.14.
31174for as_var in BASH_ENV ENV MAIL MAILPATH
31175do eval test x\${$as_var+set} = xset \
31176 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
31177done
31178PS1='$ '
31179PS2='> '
31180PS4='+ '
31181
31182# NLS nuisances.
31183LC_ALL=C
31184export LC_ALL
31185LANGUAGE=C
31186export LANGUAGE
31187
31188# CDPATH.
31189(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
31190
31191
d0ac1c44
SM
31192# as_fn_error STATUS ERROR [LINENO LOG_FD]
31193# ----------------------------------------
c971b7fa
PA
31194# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
31195# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 31196# script with STATUS, using 1 if that was 0.
c971b7fa
PA
31197as_fn_error ()
31198{
d0ac1c44
SM
31199 as_status=$1; test $as_status -eq 0 && as_status=1
31200 if test "$4"; then
31201 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
31202 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 31203 fi
d0ac1c44 31204 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
31205 as_fn_exit $as_status
31206} # as_fn_error
31207
31208
31209# as_fn_set_status STATUS
31210# -----------------------
31211# Set $? to STATUS, without forking.
31212as_fn_set_status ()
31213{
31214 return $1
31215} # as_fn_set_status
31216
31217# as_fn_exit STATUS
31218# -----------------
31219# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
31220as_fn_exit ()
31221{
31222 set +e
31223 as_fn_set_status $1
31224 exit $1
31225} # as_fn_exit
31226
31227# as_fn_unset VAR
31228# ---------------
31229# Portably unset VAR.
31230as_fn_unset ()
31231{
31232 { eval $1=; unset $1;}
31233}
31234as_unset=as_fn_unset
31235# as_fn_append VAR VALUE
31236# ----------------------
31237# Append the text in VALUE to the end of the definition contained in VAR. Take
31238# advantage of any shell optimizations that allow amortized linear growth over
31239# repeated appends, instead of the typical quadratic growth present in naive
31240# implementations.
31241if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
31242 eval 'as_fn_append ()
31243 {
31244 eval $1+=\$2
31245 }'
31246else
31247 as_fn_append ()
31248 {
31249 eval $1=\$$1\$2
31250 }
31251fi # as_fn_append
31252
31253# as_fn_arith ARG...
31254# ------------------
31255# Perform arithmetic evaluation on the ARGs, and store the result in the
31256# global $as_val. Take advantage of shells that can avoid forks. The arguments
31257# must be portable across $(()) and expr.
31258if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
31259 eval 'as_fn_arith ()
31260 {
31261 as_val=$(( $* ))
31262 }'
31263else
31264 as_fn_arith ()
31265 {
31266 as_val=`expr "$@" || test $? -eq 1`
31267 }
31268fi # as_fn_arith
31269
31270
31271if expr a : '\(a\)' >/dev/null 2>&1 &&
31272 test "X`expr 00001 : '.*\(...\)'`" = X001; then
31273 as_expr=expr
31274else
31275 as_expr=false
31276fi
31277
31278if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
31279 as_basename=basename
31280else
31281 as_basename=false
31282fi
31283
31284if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
31285 as_dirname=dirname
31286else
31287 as_dirname=false
31288fi
31289
31290as_me=`$as_basename -- "$0" ||
31291$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
31292 X"$0" : 'X\(//\)$' \| \
31293 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
31294$as_echo X/"$0" |
31295 sed '/^.*\/\([^/][^/]*\)\/*$/{
31296 s//\1/
31297 q
31298 }
31299 /^X\/\(\/\/\)$/{
31300 s//\1/
31301 q
31302 }
31303 /^X\/\(\/\).*/{
31304 s//\1/
31305 q
31306 }
31307 s/.*/./; q'`
31308
31309# Avoid depending upon Character Ranges.
31310as_cr_letters='abcdefghijklmnopqrstuvwxyz'
31311as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
31312as_cr_Letters=$as_cr_letters$as_cr_LETTERS
31313as_cr_digits='0123456789'
31314as_cr_alnum=$as_cr_Letters$as_cr_digits
31315
31316ECHO_C= ECHO_N= ECHO_T=
31317case `echo -n x` in #(((((
31318-n*)
31319 case `echo 'xy\c'` in
31320 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
31321 xy) ECHO_C='\c';;
31322 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
31323 ECHO_T=' ';;
31324 esac;;
31325*)
31326 ECHO_N='-n';;
31327esac
31328
31329rm -f conf$$ conf$$.exe conf$$.file
31330if test -d conf$$.dir; then
31331 rm -f conf$$.dir/conf$$.file
31332else
31333 rm -f conf$$.dir
31334 mkdir conf$$.dir 2>/dev/null
31335fi
31336if (echo >conf$$.file) 2>/dev/null; then
31337 if ln -s conf$$.file conf$$ 2>/dev/null; then
31338 as_ln_s='ln -s'
31339 # ... but there are two gotchas:
31340 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
31341 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 31342 # In both cases, we have to default to `cp -pR'.
c971b7fa 31343 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 31344 as_ln_s='cp -pR'
c971b7fa
PA
31345 elif ln conf$$.file conf$$ 2>/dev/null; then
31346 as_ln_s=ln
31347 else
d0ac1c44 31348 as_ln_s='cp -pR'
c971b7fa
PA
31349 fi
31350else
d0ac1c44 31351 as_ln_s='cp -pR'
c971b7fa
PA
31352fi
31353rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
31354rmdir conf$$.dir 2>/dev/null
31355
31356
31357# as_fn_mkdir_p
31358# -------------
31359# Create "$as_dir" as a directory, including parents if necessary.
31360as_fn_mkdir_p ()
31361{
31362
31363 case $as_dir in #(
31364 -*) as_dir=./$as_dir;;
31365 esac
31366 test -d "$as_dir" || eval $as_mkdir_p || {
31367 as_dirs=
31368 while :; do
31369 case $as_dir in #(
31370 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
31371 *) as_qdir=$as_dir;;
31372 esac
31373 as_dirs="'$as_qdir' $as_dirs"
31374 as_dir=`$as_dirname -- "$as_dir" ||
31375$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
31376 X"$as_dir" : 'X\(//\)[^/]' \| \
31377 X"$as_dir" : 'X\(//\)$' \| \
31378 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
31379$as_echo X"$as_dir" |
31380 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
31381 s//\1/
31382 q
31383 }
31384 /^X\(\/\/\)[^/].*/{
31385 s//\1/
31386 q
31387 }
31388 /^X\(\/\/\)$/{
31389 s//\1/
31390 q
31391 }
31392 /^X\(\/\).*/{
31393 s//\1/
31394 q
31395 }
31396 s/.*/./; q'`
31397 test -d "$as_dir" && break
31398 done
31399 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 31400 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
31401
31402
31403} # as_fn_mkdir_p
31404if mkdir -p . 2>/dev/null; then
31405 as_mkdir_p='mkdir -p "$as_dir"'
31406else
31407 test -d ./-p && rmdir ./-p
31408 as_mkdir_p=false
31409fi
31410
d0ac1c44
SM
31411
31412# as_fn_executable_p FILE
31413# -----------------------
31414# Test if FILE is an executable regular file.
31415as_fn_executable_p ()
31416{
31417 test -f "$1" && test -x "$1"
31418} # as_fn_executable_p
31419as_test_x='test -x'
31420as_executable_p=as_fn_executable_p
c971b7fa
PA
31421
31422# Sed expression to map a string onto a valid CPP name.
31423as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
31424
31425# Sed expression to map a string onto a valid variable name.
31426as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
31427
31428
31429exec 6>&1
31430## ----------------------------------- ##
31431## Main body of $CONFIG_STATUS script. ##
31432## ----------------------------------- ##
31433_ASEOF
31434test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
31435
31436cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31437# Save the log message, to keep $0 and so on meaningful, and to
31438# report actual input values of CONFIG_FILES etc. instead of their
31439# values after options handling.
31440ac_log="
d0ac1c44
SM
31441This file was extended by libgnu $as_me UNUSED-VERSION, which was
31442generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
31443
31444 CONFIG_FILES = $CONFIG_FILES
31445 CONFIG_HEADERS = $CONFIG_HEADERS
31446 CONFIG_LINKS = $CONFIG_LINKS
31447 CONFIG_COMMANDS = $CONFIG_COMMANDS
31448 $ $0 $@
31449
31450on `(hostname || uname -n) 2>/dev/null | sed 1q`
31451"
31452
31453_ACEOF
31454
31455case $ac_config_files in *"
31456"*) set x $ac_config_files; shift; ac_config_files=$*;;
31457esac
31458
31459case $ac_config_headers in *"
31460"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
31461esac
31462
31463
31464cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31465# Files that config.status was made for.
31466config_files="$ac_config_files"
31467config_headers="$ac_config_headers"
31468config_commands="$ac_config_commands"
31469
31470_ACEOF
31471
31472cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31473ac_cs_usage="\
31474\`$as_me' instantiates files and other configuration actions
31475from templates according to the current configuration. Unless the files
31476and actions are specified as TAGs, all are instantiated by default.
31477
31478Usage: $0 [OPTION]... [TAG]...
31479
31480 -h, --help print this help, then exit
31481 -V, --version print version number and configuration settings, then exit
d0ac1c44 31482 --config print configuration, then exit
c971b7fa
PA
31483 -q, --quiet, --silent
31484 do not print progress messages
31485 -d, --debug don't remove temporary files
31486 --recheck update $as_me by reconfiguring in the same conditions
31487 --file=FILE[:TEMPLATE]
31488 instantiate the configuration file FILE
31489 --header=FILE[:TEMPLATE]
31490 instantiate the configuration header FILE
31491
31492Configuration files:
31493$config_files
31494
31495Configuration headers:
31496$config_headers
31497
31498Configuration commands:
31499$config_commands
31500
31501Report bugs to the package provider."
31502
31503_ACEOF
31504cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 31505ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
c971b7fa 31506ac_cs_version="\\
d0ac1c44
SM
31507libgnu config.status UNUSED-VERSION
31508configured by $0, generated by GNU Autoconf 2.69,
31509 with options \\"\$ac_cs_config\\"
c971b7fa 31510
d0ac1c44 31511Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
31512This config.status script is free software; the Free Software Foundation
31513gives unlimited permission to copy, distribute and modify it."
31514
31515ac_pwd='$ac_pwd'
31516srcdir='$srcdir'
31517INSTALL='$INSTALL'
31518MKDIR_P='$MKDIR_P'
31519AWK='$AWK'
31520test -n "\$AWK" || AWK=awk
31521_ACEOF
31522
31523cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31524# The default lists apply if the user does not specify any file.
31525ac_need_defaults=:
31526while test $# != 0
31527do
31528 case $1 in
d0ac1c44 31529 --*=?*)
c971b7fa
PA
31530 ac_option=`expr "X$1" : 'X\([^=]*\)='`
31531 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
31532 ac_shift=:
31533 ;;
d0ac1c44
SM
31534 --*=)
31535 ac_option=`expr "X$1" : 'X\([^=]*\)='`
31536 ac_optarg=
31537 ac_shift=:
31538 ;;
c971b7fa
PA
31539 *)
31540 ac_option=$1
31541 ac_optarg=$2
31542 ac_shift=shift
31543 ;;
31544 esac
31545
31546 case $ac_option in
31547 # Handling of the options.
31548 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
31549 ac_cs_recheck=: ;;
31550 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
31551 $as_echo "$ac_cs_version"; exit ;;
d0ac1c44
SM
31552 --config | --confi | --conf | --con | --co | --c )
31553 $as_echo "$ac_cs_config"; exit ;;
c971b7fa
PA
31554 --debug | --debu | --deb | --de | --d | -d )
31555 debug=: ;;
31556 --file | --fil | --fi | --f )
31557 $ac_shift
31558 case $ac_optarg in
31559 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
d0ac1c44 31560 '') as_fn_error $? "missing file argument" ;;
c971b7fa
PA
31561 esac
31562 as_fn_append CONFIG_FILES " '$ac_optarg'"
31563 ac_need_defaults=false;;
31564 --header | --heade | --head | --hea )
31565 $ac_shift
31566 case $ac_optarg in
31567 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
31568 esac
31569 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
31570 ac_need_defaults=false;;
31571 --he | --h)
31572 # Conflict between --help and --header
d0ac1c44 31573 as_fn_error $? "ambiguous option: \`$1'
c971b7fa
PA
31574Try \`$0 --help' for more information.";;
31575 --help | --hel | -h )
31576 $as_echo "$ac_cs_usage"; exit ;;
31577 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
31578 | -silent | --silent | --silen | --sile | --sil | --si | --s)
31579 ac_cs_silent=: ;;
31580
31581 # This is an error.
d0ac1c44 31582 -*) as_fn_error $? "unrecognized option: \`$1'
c971b7fa
PA
31583Try \`$0 --help' for more information." ;;
31584
31585 *) as_fn_append ac_config_targets " $1"
31586 ac_need_defaults=false ;;
31587
31588 esac
31589 shift
31590done
31591
31592ac_configure_extra_args=
31593
31594if $ac_cs_silent; then
31595 exec 6>/dev/null
31596 ac_configure_extra_args="$ac_configure_extra_args --silent"
31597fi
31598
31599_ACEOF
31600cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31601if \$ac_cs_recheck; then
d0ac1c44 31602 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
c971b7fa
PA
31603 shift
31604 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
31605 CONFIG_SHELL='$SHELL'
31606 export CONFIG_SHELL
31607 exec "\$@"
31608fi
31609
31610_ACEOF
31611cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31612exec 5>>config.log
31613{
31614 echo
31615 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
31616## Running $as_me. ##
31617_ASBOX
31618 $as_echo "$ac_log"
31619} >&5
31620
31621_ACEOF
31622cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31623#
31624# INIT-COMMANDS
31625#
31626AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
31627
31628_ACEOF
31629
31630cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31631
31632# Handling of arguments.
31633for ac_config_target in $ac_config_targets
31634do
31635 case $ac_config_target in
31636 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
31637 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
31638 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
31639 "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;;
31640 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
31641
d0ac1c44 31642 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
c971b7fa
PA
31643 esac
31644done
31645
31646
31647# If the user did not use the arguments to specify the items to instantiate,
31648# then the envvar interface is used. Set only those that are not.
31649# We use the long form for the default assignment because of an extremely
31650# bizarre bug on SunOS 4.1.3.
31651if $ac_need_defaults; then
31652 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
31653 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
31654 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
31655fi
31656
31657# Have a temporary directory for convenience. Make it in the build tree
31658# simply because there is no reason against having it here, and in addition,
31659# creating and moving files from /tmp can sometimes cause problems.
31660# Hook for its removal unless debugging.
31661# Note that there is a small window in which the directory will not be cleaned:
31662# after its creation but before its name has been assigned to `$tmp'.
31663$debug ||
31664{
d0ac1c44 31665 tmp= ac_tmp=
c971b7fa 31666 trap 'exit_status=$?
d0ac1c44
SM
31667 : "${ac_tmp:=$tmp}"
31668 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
c971b7fa
PA
31669' 0
31670 trap 'as_fn_exit 1' 1 2 13 15
31671}
31672# Create a (secure) tmp directory for tmp files.
31673
31674{
31675 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
d0ac1c44 31676 test -d "$tmp"
c971b7fa
PA
31677} ||
31678{
31679 tmp=./conf$$-$RANDOM
31680 (umask 077 && mkdir "$tmp")
d0ac1c44
SM
31681} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
31682ac_tmp=$tmp
c971b7fa
PA
31683
31684# Set up the scripts for CONFIG_FILES section.
31685# No need to generate them if there are no CONFIG_FILES.
31686# This happens for instance with `./config.status config.h'.
31687if test -n "$CONFIG_FILES"; then
31688
31689
31690ac_cr=`echo X | tr X '\015'`
31691# On cygwin, bash can eat \r inside `` if the user requested igncr.
31692# But we know of no other shell where ac_cr would be empty at this
31693# point, so we can use a bashism as a fallback.
31694if test "x$ac_cr" = x; then
31695 eval ac_cr=\$\'\\r\'
31696fi
31697ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
31698if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
d0ac1c44 31699 ac_cs_awk_cr='\\r'
c971b7fa
PA
31700else
31701 ac_cs_awk_cr=$ac_cr
31702fi
31703
d0ac1c44 31704echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
c971b7fa
PA
31705_ACEOF
31706
31707
31708{
31709 echo "cat >conf$$subs.awk <<_ACEOF" &&
31710 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
31711 echo "_ACEOF"
31712} >conf$$subs.sh ||
d0ac1c44
SM
31713 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
31714ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
c971b7fa
PA
31715ac_delim='%!_!# '
31716for ac_last_try in false false false false false :; do
31717 . ./conf$$subs.sh ||
d0ac1c44 31718 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
31719
31720 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
31721 if test $ac_delim_n = $ac_delim_num; then
31722 break
31723 elif $ac_last_try; then
d0ac1c44 31724 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
31725 else
31726 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
31727 fi
31728done
31729rm -f conf$$subs.sh
31730
31731cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 31732cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
c971b7fa
PA
31733_ACEOF
31734sed -n '
31735h
31736s/^/S["/; s/!.*/"]=/
31737p
31738g
31739s/^[^!]*!//
31740:repl
31741t repl
31742s/'"$ac_delim"'$//
31743t delim
31744:nl
31745h
d0ac1c44 31746s/\(.\{148\}\)..*/\1/
c971b7fa
PA
31747t more1
31748s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
31749p
31750n
31751b repl
31752:more1
31753s/["\\]/\\&/g; s/^/"/; s/$/"\\/
31754p
31755g
31756s/.\{148\}//
31757t nl
31758:delim
31759h
d0ac1c44 31760s/\(.\{148\}\)..*/\1/
c971b7fa
PA
31761t more2
31762s/["\\]/\\&/g; s/^/"/; s/$/"/
31763p
31764b
31765:more2
31766s/["\\]/\\&/g; s/^/"/; s/$/"\\/
31767p
31768g
31769s/.\{148\}//
31770t delim
31771' <conf$$subs.awk | sed '
31772/^[^""]/{
31773 N
31774 s/\n//
31775}
31776' >>$CONFIG_STATUS || ac_write_fail=1
31777rm -f conf$$subs.awk
31778cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31779_ACAWK
d0ac1c44 31780cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
c971b7fa
PA
31781 for (key in S) S_is_set[key] = 1
31782 FS = "\a"
31783
31784}
31785{
31786 line = $ 0
31787 nfields = split(line, field, "@")
31788 substed = 0
31789 len = length(field[1])
31790 for (i = 2; i < nfields; i++) {
31791 key = field[i]
31792 keylen = length(key)
31793 if (S_is_set[key]) {
31794 value = S[key]
31795 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
31796 len += length(value) + length(field[++i])
31797 substed = 1
31798 } else
31799 len += 1 + keylen
31800 }
31801
31802 print line
31803}
31804
31805_ACAWK
31806_ACEOF
31807cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31808if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
31809 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
31810else
31811 cat
d0ac1c44
SM
31812fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
31813 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
c971b7fa
PA
31814_ACEOF
31815
d0ac1c44
SM
31816# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
31817# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
c971b7fa
PA
31818# trailing colons and then remove the whole line if VPATH becomes empty
31819# (actually we leave an empty line to preserve line numbers).
31820if test "x$srcdir" = x.; then
d0ac1c44
SM
31821 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
31822h
31823s///
31824s/^/:/
31825s/[ ]*$/:/
31826s/:\$(srcdir):/:/g
31827s/:\${srcdir}:/:/g
31828s/:@srcdir@:/:/g
31829s/^:*//
c971b7fa 31830s/:*$//
d0ac1c44
SM
31831x
31832s/\(=[ ]*\).*/\1/
31833G
31834s/\n//
c971b7fa
PA
31835s/^[^=]*=[ ]*$//
31836}'
31837fi
31838
31839cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31840fi # test -n "$CONFIG_FILES"
31841
31842# Set up the scripts for CONFIG_HEADERS section.
31843# No need to generate them if there are no CONFIG_HEADERS.
31844# This happens for instance with `./config.status Makefile'.
31845if test -n "$CONFIG_HEADERS"; then
d0ac1c44 31846cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
c971b7fa
PA
31847BEGIN {
31848_ACEOF
31849
31850# Transform confdefs.h into an awk script `defines.awk', embedded as
31851# here-document in config.status, that substitutes the proper values into
31852# config.h.in to produce config.h.
31853
31854# Create a delimiter string that does not exist in confdefs.h, to ease
31855# handling of long lines.
31856ac_delim='%!_!# '
31857for ac_last_try in false false :; do
d0ac1c44
SM
31858 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
31859 if test -z "$ac_tt"; then
c971b7fa
PA
31860 break
31861 elif $ac_last_try; then
d0ac1c44 31862 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
c971b7fa
PA
31863 else
31864 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
31865 fi
31866done
31867
31868# For the awk script, D is an array of macro values keyed by name,
31869# likewise P contains macro parameters if any. Preserve backslash
31870# newline sequences.
31871
31872ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
31873sed -n '
31874s/.\{148\}/&'"$ac_delim"'/g
31875t rset
31876:rset
31877s/^[ ]*#[ ]*define[ ][ ]*/ /
31878t def
31879d
31880:def
31881s/\\$//
31882t bsnl
31883s/["\\]/\\&/g
31884s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
31885D["\1"]=" \3"/p
31886s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
31887d
31888:bsnl
31889s/["\\]/\\&/g
31890s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
31891D["\1"]=" \3\\\\\\n"\\/p
31892t cont
31893s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
31894t cont
31895d
31896:cont
31897n
31898s/.\{148\}/&'"$ac_delim"'/g
31899t clear
31900:clear
31901s/\\$//
31902t bsnlc
31903s/["\\]/\\&/g; s/^/"/; s/$/"/p
31904d
31905:bsnlc
31906s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
31907b cont
31908' <confdefs.h | sed '
31909s/'"$ac_delim"'/"\\\
31910"/g' >>$CONFIG_STATUS || ac_write_fail=1
31911
31912cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31913 for (key in D) D_is_set[key] = 1
31914 FS = "\a"
31915}
31916/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
31917 line = \$ 0
31918 split(line, arg, " ")
31919 if (arg[1] == "#") {
31920 defundef = arg[2]
31921 mac1 = arg[3]
31922 } else {
31923 defundef = substr(arg[1], 2)
31924 mac1 = arg[2]
31925 }
31926 split(mac1, mac2, "(") #)
31927 macro = mac2[1]
31928 prefix = substr(line, 1, index(line, defundef) - 1)
31929 if (D_is_set[macro]) {
31930 # Preserve the white space surrounding the "#".
31931 print prefix "define", macro P[macro] D[macro]
31932 next
31933 } else {
31934 # Replace #undef with comments. This is necessary, for example,
31935 # in the case of _POSIX_SOURCE, which is predefined and required
31936 # on some systems where configure will not decide to define it.
31937 if (defundef == "undef") {
31938 print "/*", prefix defundef, macro, "*/"
31939 next
31940 }
31941 }
31942}
31943{ print }
31944_ACAWK
31945_ACEOF
31946cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
d0ac1c44 31947 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
c971b7fa
PA
31948fi # test -n "$CONFIG_HEADERS"
31949
31950
31951eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
31952shift
31953for ac_tag
31954do
31955 case $ac_tag in
31956 :[FHLC]) ac_mode=$ac_tag; continue;;
31957 esac
31958 case $ac_mode$ac_tag in
31959 :[FHL]*:*);;
d0ac1c44 31960 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
c971b7fa
PA
31961 :[FH]-) ac_tag=-:-;;
31962 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
31963 esac
31964 ac_save_IFS=$IFS
31965 IFS=:
31966 set x $ac_tag
31967 IFS=$ac_save_IFS
31968 shift
31969 ac_file=$1
31970 shift
31971
31972 case $ac_mode in
31973 :L) ac_source=$1;;
31974 :[FH])
31975 ac_file_inputs=
31976 for ac_f
31977 do
31978 case $ac_f in
d0ac1c44 31979 -) ac_f="$ac_tmp/stdin";;
c971b7fa
PA
31980 *) # Look for the file first in the build tree, then in the source tree
31981 # (if the path is not absolute). The absolute path cannot be DOS-style,
31982 # because $ac_f cannot contain `:'.
31983 test -f "$ac_f" ||
31984 case $ac_f in
31985 [\\/$]*) false;;
31986 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
31987 esac ||
d0ac1c44 31988 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
c971b7fa
PA
31989 esac
31990 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
31991 as_fn_append ac_file_inputs " '$ac_f'"
31992 done
31993
31994 # Let's still pretend it is `configure' which instantiates (i.e., don't
31995 # use $as_me), people would be surprised to read:
31996 # /* config.h. Generated by config.status. */
31997 configure_input='Generated from '`
31998 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
31999 `' by configure.'
32000 if test x"$ac_file" != x-; then
32001 configure_input="$ac_file. $configure_input"
32002 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
32003$as_echo "$as_me: creating $ac_file" >&6;}
32004 fi
32005 # Neutralize special characters interpreted by sed in replacement strings.
32006 case $configure_input in #(
32007 *\&* | *\|* | *\\* )
32008 ac_sed_conf_input=`$as_echo "$configure_input" |
32009 sed 's/[\\\\&|]/\\\\&/g'`;; #(
32010 *) ac_sed_conf_input=$configure_input;;
32011 esac
32012
32013 case $ac_tag in
d0ac1c44
SM
32014 *:-:* | *:-) cat >"$ac_tmp/stdin" \
32015 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
c971b7fa
PA
32016 esac
32017 ;;
32018 esac
32019
32020 ac_dir=`$as_dirname -- "$ac_file" ||
32021$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32022 X"$ac_file" : 'X\(//\)[^/]' \| \
32023 X"$ac_file" : 'X\(//\)$' \| \
32024 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
32025$as_echo X"$ac_file" |
32026 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32027 s//\1/
32028 q
32029 }
32030 /^X\(\/\/\)[^/].*/{
32031 s//\1/
32032 q
32033 }
32034 /^X\(\/\/\)$/{
32035 s//\1/
32036 q
32037 }
32038 /^X\(\/\).*/{
32039 s//\1/
32040 q
32041 }
32042 s/.*/./; q'`
32043 as_dir="$ac_dir"; as_fn_mkdir_p
32044 ac_builddir=.
32045
32046case "$ac_dir" in
32047.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
32048*)
32049 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
32050 # A ".." for each directory in $ac_dir_suffix.
32051 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
32052 case $ac_top_builddir_sub in
32053 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
32054 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
32055 esac ;;
32056esac
32057ac_abs_top_builddir=$ac_pwd
32058ac_abs_builddir=$ac_pwd$ac_dir_suffix
32059# for backward compatibility:
32060ac_top_builddir=$ac_top_build_prefix
32061
32062case $srcdir in
32063 .) # We are building in place.
32064 ac_srcdir=.
32065 ac_top_srcdir=$ac_top_builddir_sub
32066 ac_abs_top_srcdir=$ac_pwd ;;
32067 [\\/]* | ?:[\\/]* ) # Absolute name.
32068 ac_srcdir=$srcdir$ac_dir_suffix;
32069 ac_top_srcdir=$srcdir
32070 ac_abs_top_srcdir=$srcdir ;;
32071 *) # Relative name.
32072 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
32073 ac_top_srcdir=$ac_top_build_prefix$srcdir
32074 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
32075esac
32076ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
32077
32078
32079 case $ac_mode in
32080 :F)
32081 #
32082 # CONFIG_FILE
32083 #
32084
32085 case $INSTALL in
32086 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
32087 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
32088 esac
32089 ac_MKDIR_P=$MKDIR_P
32090 case $MKDIR_P in
32091 [\\/$]* | ?:[\\/]* ) ;;
32092 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
32093 esac
32094_ACEOF
32095
32096cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32097# If the template does not know about datarootdir, expand it.
32098# FIXME: This hack should be removed a few years after 2.60.
32099ac_datarootdir_hack=; ac_datarootdir_seen=
32100ac_sed_dataroot='
32101/datarootdir/ {
32102 p
32103 q
32104}
32105/@datadir@/p
32106/@docdir@/p
32107/@infodir@/p
32108/@localedir@/p
32109/@mandir@/p'
32110case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
32111*datarootdir*) ac_datarootdir_seen=yes;;
32112*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
32113 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
32114$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
32115_ACEOF
32116cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32117 ac_datarootdir_hack='
32118 s&@datadir@&$datadir&g
32119 s&@docdir@&$docdir&g
32120 s&@infodir@&$infodir&g
32121 s&@localedir@&$localedir&g
32122 s&@mandir@&$mandir&g
32123 s&\\\${datarootdir}&$datarootdir&g' ;;
32124esac
32125_ACEOF
32126
32127# Neutralize VPATH when `$srcdir' = `.'.
32128# Shell code in configure.ac might set extrasub.
32129# FIXME: do we really want to maintain this feature?
32130cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32131ac_sed_extra="$ac_vpsub
32132$extrasub
32133_ACEOF
32134cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32135:t
32136/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
32137s|@configure_input@|$ac_sed_conf_input|;t t
32138s&@top_builddir@&$ac_top_builddir_sub&;t t
32139s&@top_build_prefix@&$ac_top_build_prefix&;t t
32140s&@srcdir@&$ac_srcdir&;t t
32141s&@abs_srcdir@&$ac_abs_srcdir&;t t
32142s&@top_srcdir@&$ac_top_srcdir&;t t
32143s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
32144s&@builddir@&$ac_builddir&;t t
32145s&@abs_builddir@&$ac_abs_builddir&;t t
32146s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
32147s&@INSTALL@&$ac_INSTALL&;t t
32148s&@MKDIR_P@&$ac_MKDIR_P&;t t
32149$ac_datarootdir_hack
32150"
d0ac1c44
SM
32151eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
32152 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32153
32154test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
d0ac1c44
SM
32155 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
32156 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
32157 "$ac_tmp/out"`; test -z "$ac_out"; } &&
c971b7fa 32158 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 32159which seems to be undefined. Please make sure it is defined" >&5
c971b7fa 32160$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 32161which seems to be undefined. Please make sure it is defined" >&2;}
c971b7fa 32162
d0ac1c44 32163 rm -f "$ac_tmp/stdin"
c971b7fa 32164 case $ac_file in
d0ac1c44
SM
32165 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
32166 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
c971b7fa 32167 esac \
d0ac1c44 32168 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32169 ;;
32170 :H)
32171 #
32172 # CONFIG_HEADER
32173 #
32174 if test x"$ac_file" != x-; then
32175 {
32176 $as_echo "/* $configure_input */" \
d0ac1c44
SM
32177 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
32178 } >"$ac_tmp/config.h" \
32179 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
32180 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
c971b7fa
PA
32181 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
32182$as_echo "$as_me: $ac_file is unchanged" >&6;}
32183 else
32184 rm -f "$ac_file"
d0ac1c44
SM
32185 mv "$ac_tmp/config.h" "$ac_file" \
32186 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32187 fi
32188 else
32189 $as_echo "/* $configure_input */" \
d0ac1c44
SM
32190 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
32191 || as_fn_error $? "could not create -" "$LINENO" 5
c971b7fa
PA
32192 fi
32193# Compute "$ac_file"'s index in $config_headers.
32194_am_arg="$ac_file"
32195_am_stamp_count=1
32196for _am_header in $config_headers :; do
32197 case $_am_header in
32198 $_am_arg | $_am_arg:* )
32199 break ;;
32200 * )
32201 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
32202 esac
32203done
32204echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
32205$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32206 X"$_am_arg" : 'X\(//\)[^/]' \| \
32207 X"$_am_arg" : 'X\(//\)$' \| \
32208 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
32209$as_echo X"$_am_arg" |
32210 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32211 s//\1/
32212 q
32213 }
32214 /^X\(\/\/\)[^/].*/{
32215 s//\1/
32216 q
32217 }
32218 /^X\(\/\/\)$/{
32219 s//\1/
32220 q
32221 }
32222 /^X\(\/\).*/{
32223 s//\1/
32224 q
32225 }
32226 s/.*/./; q'`/stamp-h$_am_stamp_count
32227 ;;
32228
32229 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
32230$as_echo "$as_me: executing $ac_file commands" >&6;}
32231 ;;
32232 esac
32233
32234
32235 case $ac_file$ac_mode in
32236 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
d0ac1c44 32237 # Older Autoconf quotes --file arguments for eval, but not when files
c971b7fa
PA
32238 # are listed without --file. Let's play safe and only enable the eval
32239 # if we detect the quoting.
32240 case $CONFIG_FILES in
32241 *\'*) eval set x "$CONFIG_FILES" ;;
32242 *) set x $CONFIG_FILES ;;
32243 esac
32244 shift
32245 for mf
32246 do
32247 # Strip MF so we end up with the name of the file.
32248 mf=`echo "$mf" | sed -e 's/:.*$//'`
32249 # Check whether this is an Automake generated Makefile or not.
d0ac1c44 32250 # We used to match only the files named 'Makefile.in', but
c971b7fa
PA
32251 # some people rename them; so instead we look at the file content.
32252 # Grep'ing the first line is not enough: some people post-process
32253 # each Makefile.in and add a new line on top of each file to say so.
32254 # Grep'ing the whole file is not good either: AIX grep has a line
32255 # limit of 2048, but all sed's we know have understand at least 4000.
32256 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
32257 dirpart=`$as_dirname -- "$mf" ||
32258$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32259 X"$mf" : 'X\(//\)[^/]' \| \
32260 X"$mf" : 'X\(//\)$' \| \
32261 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
32262$as_echo X"$mf" |
32263 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32264 s//\1/
32265 q
32266 }
32267 /^X\(\/\/\)[^/].*/{
32268 s//\1/
32269 q
32270 }
32271 /^X\(\/\/\)$/{
32272 s//\1/
32273 q
32274 }
32275 /^X\(\/\).*/{
32276 s//\1/
32277 q
32278 }
32279 s/.*/./; q'`
32280 else
32281 continue
32282 fi
32283 # Extract the definition of DEPDIR, am__include, and am__quote
d0ac1c44 32284 # from the Makefile without running 'make'.
c971b7fa
PA
32285 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
32286 test -z "$DEPDIR" && continue
32287 am__include=`sed -n 's/^am__include = //p' < "$mf"`
d0ac1c44 32288 test -z "$am__include" && continue
c971b7fa 32289 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
c971b7fa
PA
32290 # Find all dependency output files, they are included files with
32291 # $(DEPDIR) in their names. We invoke sed twice because it is the
32292 # simplest approach to changing $(DEPDIR) to its actual value in the
32293 # expansion.
32294 for file in `sed -n "
32295 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
d0ac1c44 32296 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
c971b7fa
PA
32297 # Make sure the directory exists.
32298 test -f "$dirpart/$file" && continue
32299 fdir=`$as_dirname -- "$file" ||
32300$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32301 X"$file" : 'X\(//\)[^/]' \| \
32302 X"$file" : 'X\(//\)$' \| \
32303 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
32304$as_echo X"$file" |
32305 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32306 s//\1/
32307 q
32308 }
32309 /^X\(\/\/\)[^/].*/{
32310 s//\1/
32311 q
32312 }
32313 /^X\(\/\/\)$/{
32314 s//\1/
32315 q
32316 }
32317 /^X\(\/\).*/{
32318 s//\1/
32319 q
32320 }
32321 s/.*/./; q'`
32322 as_dir=$dirpart/$fdir; as_fn_mkdir_p
32323 # echo "creating $dirpart/$file"
32324 echo '# dummy' > "$dirpart/$file"
32325 done
32326 done
32327}
32328 ;;
32329 "default":C)
32330case x$CONFIG_HEADERS in
32331xconfig.h:config.in)
32332echo > stamp-h ;;
32333esac
32334 ;;
32335
32336 esac
32337done # for ac_tag
32338
32339
32340as_fn_exit 0
32341_ACEOF
32342ac_clean_files=$ac_clean_files_save
32343
32344test $ac_write_fail = 0 ||
d0ac1c44 32345 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
32346
32347
32348# configure is writing to config.log, and then calls config.status.
32349# config.status does its own redirection, appending to config.log.
32350# Unfortunately, on DOS this fails, as config.log is still kept open
32351# by configure, so config.status won't be able to write to it; its
32352# output is simply discarded. So we exec the FD to /dev/null,
32353# effectively closing config.log, so it can be properly (re)opened and
32354# appended to by config.status. When coming back to configure, we
32355# need to make the FD available again.
32356if test "$no_create" != yes; then
32357 ac_cs_success=:
32358 ac_config_status_args=
32359 test "$silent" = yes &&
32360 ac_config_status_args="$ac_config_status_args --quiet"
32361 exec 5>/dev/null
32362 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
32363 exec 5>>config.log
32364 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
32365 # would make configure fail if this is the last instruction.
d0ac1c44 32366 $ac_cs_success || as_fn_exit 1
c971b7fa
PA
32367fi
32368if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
32369 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
32370$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
32371fi
32372
32373
32374exit 0
This page took 2.700548 seconds and 4 git commands to generate.