gnulib: import getline
[deliverable/binutils-gdb.git] / gnulib / configure
CommitLineData
c971b7fa
PA
1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.
d0ac1c44
SM
3# Generated by GNU Autoconf 2.69 for libgnu UNUSED-VERSION.
4#
5#
6# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
c971b7fa 7#
c971b7fa
PA
8#
9# This configure script is free software; the Free Software Foundation
10# gives unlimited permission to copy, distribute and modify it.
11## -------------------- ##
12## M4sh Initialization. ##
13## -------------------- ##
14
15# Be more Bourne compatible
16DUALCASE=1; export DUALCASE # for MKS sh
17if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
18 emulate sh
19 NULLCMD=:
20 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
21 # is contrary to our usage. Disable this feature.
22 alias -g '${1+"$@"}'='"$@"'
23 setopt NO_GLOB_SUBST
24else
25 case `(set -o) 2>/dev/null` in #(
26 *posix*) :
27 set -o posix ;; #(
28 *) :
29 ;;
30esac
31fi
32
33
34as_nl='
35'
36export as_nl
37# Printing a long string crashes Solaris 7 /usr/bin/printf.
38as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
39as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
40as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
41# Prefer a ksh shell builtin over an external printf program on Solaris,
42# but without wasting forks for bash or zsh.
43if test -z "$BASH_VERSION$ZSH_VERSION" \
44 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
45 as_echo='print -r --'
46 as_echo_n='print -rn --'
47elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
48 as_echo='printf %s\n'
49 as_echo_n='printf %s'
50else
51 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
52 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
53 as_echo_n='/usr/ucb/echo -n'
54 else
55 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
56 as_echo_n_body='eval
57 arg=$1;
58 case $arg in #(
59 *"$as_nl"*)
60 expr "X$arg" : "X\\(.*\\)$as_nl";
61 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
62 esac;
63 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
64 '
65 export as_echo_n_body
66 as_echo_n='sh -c $as_echo_n_body as_echo'
67 fi
68 export as_echo_body
69 as_echo='sh -c $as_echo_body as_echo'
70fi
71
72# The user is always right.
73if test "${PATH_SEPARATOR+set}" != set; then
74 PATH_SEPARATOR=:
75 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
76 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
77 PATH_SEPARATOR=';'
78 }
79fi
80
81
82# IFS
83# We need space, tab and new line, in precisely that order. Quoting is
84# there to prevent editors from complaining about space-tab.
85# (If _AS_PATH_WALK were called with IFS unset, it would disable word
86# splitting by setting IFS to empty value.)
87IFS=" "" $as_nl"
88
89# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 90as_myself=
c971b7fa
PA
91case $0 in #((
92 *[\\/]* ) as_myself=$0 ;;
93 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
94for as_dir in $PATH
95do
96 IFS=$as_save_IFS
97 test -z "$as_dir" && as_dir=.
98 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
99 done
100IFS=$as_save_IFS
101
102 ;;
103esac
104# We did not find ourselves, most probably we were run as `sh COMMAND'
105# in which case we are not to be found in the path.
106if test "x$as_myself" = x; then
107 as_myself=$0
108fi
109if test ! -f "$as_myself"; then
110 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
111 exit 1
112fi
113
114# Unset variables that we do not need and which cause bugs (e.g. in
115# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
116# suppresses any "Segmentation fault" message there. '((' could
117# trigger a bug in pdksh 5.2.14.
118for as_var in BASH_ENV ENV MAIL MAILPATH
119do eval test x\${$as_var+set} = xset \
120 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
121done
122PS1='$ '
123PS2='> '
124PS4='+ '
125
126# NLS nuisances.
127LC_ALL=C
128export LC_ALL
129LANGUAGE=C
130export LANGUAGE
131
132# CDPATH.
133(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
134
d0ac1c44
SM
135# Use a proper internal environment variable to ensure we don't fall
136 # into an infinite loop, continuously re-executing ourselves.
137 if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
138 _as_can_reexec=no; export _as_can_reexec;
139 # We cannot yet assume a decent shell, so we have to provide a
140# neutralization value for shells without unset; and this also
141# works around shells that cannot unset nonexistent variables.
142# Preserve -v and -x to the replacement shell.
143BASH_ENV=/dev/null
144ENV=/dev/null
145(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
146case $- in # ((((
147 *v*x* | *x*v* ) as_opts=-vx ;;
148 *v* ) as_opts=-v ;;
149 *x* ) as_opts=-x ;;
150 * ) as_opts= ;;
151esac
152exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
153# Admittedly, this is quite paranoid, since all the known shells bail
154# out after a failed `exec'.
155$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
156as_fn_exit 255
157 fi
158 # We don't want this to propagate to other subprocesses.
159 { _as_can_reexec=; unset _as_can_reexec;}
c971b7fa
PA
160if test "x$CONFIG_SHELL" = x; then
161 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
162 emulate sh
163 NULLCMD=:
164 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
165 # is contrary to our usage. Disable this feature.
166 alias -g '\${1+\"\$@\"}'='\"\$@\"'
167 setopt NO_GLOB_SUBST
168else
169 case \`(set -o) 2>/dev/null\` in #(
170 *posix*) :
171 set -o posix ;; #(
172 *) :
173 ;;
174esac
175fi
176"
177 as_required="as_fn_return () { (exit \$1); }
178as_fn_success () { as_fn_return 0; }
179as_fn_failure () { as_fn_return 1; }
180as_fn_ret_success () { return 0; }
181as_fn_ret_failure () { return 1; }
182
183exitcode=0
184as_fn_success || { exitcode=1; echo as_fn_success failed.; }
185as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
186as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
187as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
188if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
189
190else
191 exitcode=1; echo positional parameters were not saved.
192fi
d0ac1c44
SM
193test x\$exitcode = x0 || exit 1
194test -x / || exit 1"
c971b7fa
PA
195 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
196 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
197 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
198 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
199test \$(( 1 + 1 )) = 2 || exit 1"
200 if (eval "$as_required") 2>/dev/null; then :
201 as_have_required=yes
202else
203 as_have_required=no
204fi
205 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
206
207else
208 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
209as_found=false
210for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
211do
212 IFS=$as_save_IFS
213 test -z "$as_dir" && as_dir=.
214 as_found=:
215 case $as_dir in #(
216 /*)
217 for as_base in sh bash ksh sh5; do
218 # Try only shells that exist, to save several forks.
219 as_shell=$as_dir/$as_base
220 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
221 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
222 CONFIG_SHELL=$as_shell as_have_required=yes
223 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
224 break 2
225fi
226fi
227 done;;
228 esac
229 as_found=false
230done
231$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
232 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
233 CONFIG_SHELL=$SHELL as_have_required=yes
234fi; }
235IFS=$as_save_IFS
236
237
238 if test "x$CONFIG_SHELL" != x; then :
d0ac1c44
SM
239 export CONFIG_SHELL
240 # We cannot yet assume a decent shell, so we have to provide a
241# neutralization value for shells without unset; and this also
242# works around shells that cannot unset nonexistent variables.
243# Preserve -v and -x to the replacement shell.
244BASH_ENV=/dev/null
245ENV=/dev/null
246(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
247case $- in # ((((
248 *v*x* | *x*v* ) as_opts=-vx ;;
249 *v* ) as_opts=-v ;;
250 *x* ) as_opts=-x ;;
251 * ) as_opts= ;;
252esac
253exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
254# Admittedly, this is quite paranoid, since all the known shells bail
255# out after a failed `exec'.
256$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
257exit 255
c971b7fa
PA
258fi
259
260 if test x$as_have_required = xno; then :
261 $as_echo "$0: This script requires a shell more modern than all"
262 $as_echo "$0: the shells that I found on your system."
263 if test x${ZSH_VERSION+set} = xset ; then
264 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
265 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
266 else
267 $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
268$0: including any error possibly output before this
269$0: message. Then install a modern shell, or manually run
270$0: the script under such a shell if you do have one."
271 fi
272 exit 1
273fi
274fi
275fi
276SHELL=${CONFIG_SHELL-/bin/sh}
277export SHELL
278# Unset more variables known to interfere with behavior of common tools.
279CLICOLOR_FORCE= GREP_OPTIONS=
280unset CLICOLOR_FORCE GREP_OPTIONS
281
282## --------------------- ##
283## M4sh Shell Functions. ##
284## --------------------- ##
285# as_fn_unset VAR
286# ---------------
287# Portably unset VAR.
288as_fn_unset ()
289{
290 { eval $1=; unset $1;}
291}
292as_unset=as_fn_unset
293
294# as_fn_set_status STATUS
295# -----------------------
296# Set $? to STATUS, without forking.
297as_fn_set_status ()
298{
299 return $1
300} # as_fn_set_status
301
302# as_fn_exit STATUS
303# -----------------
304# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
305as_fn_exit ()
306{
307 set +e
308 as_fn_set_status $1
309 exit $1
310} # as_fn_exit
311
312# as_fn_mkdir_p
313# -------------
314# Create "$as_dir" as a directory, including parents if necessary.
315as_fn_mkdir_p ()
316{
317
318 case $as_dir in #(
319 -*) as_dir=./$as_dir;;
320 esac
321 test -d "$as_dir" || eval $as_mkdir_p || {
322 as_dirs=
323 while :; do
324 case $as_dir in #(
325 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
326 *) as_qdir=$as_dir;;
327 esac
328 as_dirs="'$as_qdir' $as_dirs"
329 as_dir=`$as_dirname -- "$as_dir" ||
330$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
331 X"$as_dir" : 'X\(//\)[^/]' \| \
332 X"$as_dir" : 'X\(//\)$' \| \
333 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
334$as_echo X"$as_dir" |
335 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
336 s//\1/
337 q
338 }
339 /^X\(\/\/\)[^/].*/{
340 s//\1/
341 q
342 }
343 /^X\(\/\/\)$/{
344 s//\1/
345 q
346 }
347 /^X\(\/\).*/{
348 s//\1/
349 q
350 }
351 s/.*/./; q'`
352 test -d "$as_dir" && break
353 done
354 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 355 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
356
357
358} # as_fn_mkdir_p
d0ac1c44
SM
359
360# as_fn_executable_p FILE
361# -----------------------
362# Test if FILE is an executable regular file.
363as_fn_executable_p ()
364{
365 test -f "$1" && test -x "$1"
366} # as_fn_executable_p
c971b7fa
PA
367# as_fn_append VAR VALUE
368# ----------------------
369# Append the text in VALUE to the end of the definition contained in VAR. Take
370# advantage of any shell optimizations that allow amortized linear growth over
371# repeated appends, instead of the typical quadratic growth present in naive
372# implementations.
373if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
374 eval 'as_fn_append ()
375 {
376 eval $1+=\$2
377 }'
378else
379 as_fn_append ()
380 {
381 eval $1=\$$1\$2
382 }
383fi # as_fn_append
384
385# as_fn_arith ARG...
386# ------------------
387# Perform arithmetic evaluation on the ARGs, and store the result in the
388# global $as_val. Take advantage of shells that can avoid forks. The arguments
389# must be portable across $(()) and expr.
390if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
391 eval 'as_fn_arith ()
392 {
393 as_val=$(( $* ))
394 }'
395else
396 as_fn_arith ()
397 {
398 as_val=`expr "$@" || test $? -eq 1`
399 }
400fi # as_fn_arith
401
402
d0ac1c44
SM
403# as_fn_error STATUS ERROR [LINENO LOG_FD]
404# ----------------------------------------
c971b7fa
PA
405# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
406# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 407# script with STATUS, using 1 if that was 0.
c971b7fa
PA
408as_fn_error ()
409{
d0ac1c44
SM
410 as_status=$1; test $as_status -eq 0 && as_status=1
411 if test "$4"; then
412 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
413 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 414 fi
d0ac1c44 415 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
416 as_fn_exit $as_status
417} # as_fn_error
418
419if expr a : '\(a\)' >/dev/null 2>&1 &&
420 test "X`expr 00001 : '.*\(...\)'`" = X001; then
421 as_expr=expr
422else
423 as_expr=false
424fi
425
426if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
427 as_basename=basename
428else
429 as_basename=false
430fi
431
432if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
433 as_dirname=dirname
434else
435 as_dirname=false
436fi
437
438as_me=`$as_basename -- "$0" ||
439$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
440 X"$0" : 'X\(//\)$' \| \
441 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
442$as_echo X/"$0" |
443 sed '/^.*\/\([^/][^/]*\)\/*$/{
444 s//\1/
445 q
446 }
447 /^X\/\(\/\/\)$/{
448 s//\1/
449 q
450 }
451 /^X\/\(\/\).*/{
452 s//\1/
453 q
454 }
455 s/.*/./; q'`
456
457# Avoid depending upon Character Ranges.
458as_cr_letters='abcdefghijklmnopqrstuvwxyz'
459as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
460as_cr_Letters=$as_cr_letters$as_cr_LETTERS
461as_cr_digits='0123456789'
462as_cr_alnum=$as_cr_Letters$as_cr_digits
463
464
465 as_lineno_1=$LINENO as_lineno_1a=$LINENO
466 as_lineno_2=$LINENO as_lineno_2a=$LINENO
467 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
468 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
469 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
470 sed -n '
471 p
472 /[$]LINENO/=
473 ' <$as_myself |
474 sed '
475 s/[$]LINENO.*/&-/
476 t lineno
477 b
478 :lineno
479 N
480 :loop
481 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
482 t loop
483 s/-\n.*//
484 ' >$as_me.lineno &&
485 chmod +x "$as_me.lineno" ||
486 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
487
d0ac1c44
SM
488 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
489 # already done that, so ensure we don't try to do so again and fall
490 # in an infinite loop. This has already happened in practice.
491 _as_can_reexec=no; export _as_can_reexec
c971b7fa
PA
492 # Don't try to exec as it changes $[0], causing all sort of problems
493 # (the dirname of $[0] is not the place where we might find the
494 # original and so on. Autoconf is especially sensitive to this).
495 . "./$as_me.lineno"
496 # Exit status is that of the last command.
497 exit
498}
499
500ECHO_C= ECHO_N= ECHO_T=
501case `echo -n x` in #(((((
502-n*)
503 case `echo 'xy\c'` in
504 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
505 xy) ECHO_C='\c';;
506 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
507 ECHO_T=' ';;
508 esac;;
509*)
510 ECHO_N='-n';;
511esac
512
513rm -f conf$$ conf$$.exe conf$$.file
514if test -d conf$$.dir; then
515 rm -f conf$$.dir/conf$$.file
516else
517 rm -f conf$$.dir
518 mkdir conf$$.dir 2>/dev/null
519fi
520if (echo >conf$$.file) 2>/dev/null; then
521 if ln -s conf$$.file conf$$ 2>/dev/null; then
522 as_ln_s='ln -s'
523 # ... but there are two gotchas:
524 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
525 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 526 # In both cases, we have to default to `cp -pR'.
c971b7fa 527 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 528 as_ln_s='cp -pR'
c971b7fa
PA
529 elif ln conf$$.file conf$$ 2>/dev/null; then
530 as_ln_s=ln
531 else
d0ac1c44 532 as_ln_s='cp -pR'
c971b7fa
PA
533 fi
534else
d0ac1c44 535 as_ln_s='cp -pR'
c971b7fa
PA
536fi
537rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
538rmdir conf$$.dir 2>/dev/null
539
540if mkdir -p . 2>/dev/null; then
541 as_mkdir_p='mkdir -p "$as_dir"'
542else
543 test -d ./-p && rmdir ./-p
544 as_mkdir_p=false
545fi
546
d0ac1c44
SM
547as_test_x='test -x'
548as_executable_p=as_fn_executable_p
c971b7fa
PA
549
550# Sed expression to map a string onto a valid CPP name.
551as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
552
553# Sed expression to map a string onto a valid variable name.
554as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
555
556
d0ac1c44
SM
557test -n "$DJDIR" || exec 7<&0 </dev/null
558exec 6>&1
c971b7fa
PA
559
560# Name of the host.
d0ac1c44 561# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
c971b7fa
PA
562# so uname gets run too.
563ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
564
565#
566# Initializations.
567#
568ac_default_prefix=/usr/local
569ac_clean_files=
570ac_config_libobj_dir=.
571LIBOBJS=
572cross_compiling=no
573subdirs=
574MFLAGS=
575MAKEFLAGS=
576
577# Identity of this package.
d0ac1c44
SM
578PACKAGE_NAME='libgnu'
579PACKAGE_TARNAME='libgnu'
580PACKAGE_VERSION='UNUSED-VERSION'
581PACKAGE_STRING='libgnu UNUSED-VERSION'
582PACKAGE_BUGREPORT=''
583PACKAGE_URL=''
c971b7fa 584
8690e634 585ac_unique_file="import/memmem.c"
9c9d63b1 586ac_header_list=
c971b7fa
PA
587# Factoring default headers for most tests.
588ac_includes_default="\
589#include <stdio.h>
590#ifdef HAVE_SYS_TYPES_H
591# include <sys/types.h>
592#endif
593#ifdef HAVE_SYS_STAT_H
594# include <sys/stat.h>
595#endif
596#ifdef STDC_HEADERS
597# include <stdlib.h>
598# include <stddef.h>
599#else
600# ifdef HAVE_STDLIB_H
601# include <stdlib.h>
602# endif
603#endif
604#ifdef HAVE_STRING_H
605# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
606# include <memory.h>
607# endif
608# include <string.h>
609#endif
610#ifdef HAVE_STRINGS_H
611# include <strings.h>
612#endif
613#ifdef HAVE_INTTYPES_H
614# include <inttypes.h>
615#endif
616#ifdef HAVE_STDINT_H
617# include <stdint.h>
618#endif
619#ifdef HAVE_UNISTD_H
620# include <unistd.h>
621#endif"
622
5abebf3c 623gl_use_threads_default=
c0c3707f 624gl_use_winpthreads_default=
c0c3707f 625ac_func_list=
8690e634 626gl_fnmatch_required=POSIX
c971b7fa
PA
627ac_subst_vars='am__EXEEXT_FALSE
628am__EXEEXT_TRUE
629gltests_LTLIBOBJS
630gltests_LIBOBJS
631gl_LTLIBOBJS
632gl_LIBOBJS
633LTLIBOBJS
634LIBOBJS
635LN_S
39be3c7e
SM
636AM_BACKSLASH
637AM_DEFAULT_VERBOSITY
d0ac1c44
SM
638AM_DEFAULT_V
639AM_V
c971b7fa
PA
640am__fastdepCC_FALSE
641am__fastdepCC_TRUE
642CCDEPMODE
d0ac1c44 643am__nodep
c971b7fa
PA
644AMDEPBACKSLASH
645AMDEP_FALSE
646AMDEP_TRUE
647am__quote
648am__include
649DEPDIR
650am__untar
651am__tar
652AMTAR
653am__leading_dot
654SET_MAKE
655AWK
656mkdir_p
c971b7fa
PA
657INSTALL_STRIP_PROGRAM
658STRIP
659install_sh
660MAKEINFO
661AUTOHEADER
662AUTOMAKE
663AUTOCONF
664ACLOCAL
665VERSION
666PACKAGE
667CYGPATH_W
668am__isrc
669INSTALL_DATA
670INSTALL_SCRIPT
671INSTALL_PROGRAM
672LIBGNU_LTLIBDEPS
673LIBGNU_LIBDEPS
674gltests_WITNESS
8690e634
JK
675REPLACE_TOWLOWER
676REPLACE_ISWCNTRL
677HAVE_WCTYPE_H
678NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
679NEXT_WCTYPE_H
680HAVE_ISWCNTRL
5df4cba6
SM
681REPLACE_ISWXDIGIT
682REPLACE_ISWDIGIT
8690e634
JK
683REPLACE_ISWBLANK
684HAVE_WCTRANS_T
685HAVE_WCTYPE_T
686HAVE_ISWBLANK
687GNULIB_TOWCTRANS
688GNULIB_WCTRANS
689GNULIB_ISWCTYPE
690GNULIB_WCTYPE
5df4cba6
SM
691GNULIB_ISWXDIGIT
692GNULIB_ISWDIGIT
8690e634 693GNULIB_ISWBLANK
c0c3707f 694HAVE_CRTDEFS_H
8690e634 695HAVE_WINT_T
8690e634
JK
696NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
697NEXT_WCHAR_H
8839a007
PA
698HAVE_UNISTD_H
699NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
700NEXT_UNISTD_H
9c9d63b1 701TIME_H_DEFINES_TIME_UTC
4a626d0a 702UNISTD_H_DEFINES_STRUCT_TIMESPEC
09607c9e
TT
703PTHREAD_H_DEFINES_STRUCT_TIMESPEC
704SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
705TIME_H_DEFINES_STRUCT_TIMESPEC
706NEXT_AS_FIRST_DIRECTIVE_TIME_H
707NEXT_TIME_H
9c9d63b1
PM
708REPLACE_LOCALTIME
709REPLACE_GMTIME
710REPLACE_TZSET
711REPLACE_TIMEGM
712REPLACE_STRFTIME
713REPLACE_NANOSLEEP
714REPLACE_MKTIME
715REPLACE_LOCALTIME_R
716REPLACE_CTIME
717HAVE_TIMEZONE_T
718HAVE_TIMESPEC_GET
719HAVE_TIMEGM
720HAVE_STRPTIME
721HAVE_NANOSLEEP
722HAVE_DECL_LOCALTIME_R
723GNULIB_MDA_TZSET
724GNULIB_TZSET
725GNULIB_TIME_RZ
726GNULIB_TIME_R
727GNULIB_TIMESPEC_GET
728GNULIB_TIMEGM
729GNULIB_STRPTIME
730GNULIB_STRFTIME
731GNULIB_NANOSLEEP
732GNULIB_LOCALTIME
733GNULIB_MKTIME
734GNULIB_CTIME
725e2999
JB
735HAVE_SYS_UIO_H
736NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
737NEXT_SYS_UIO_H
c0c3707f 738WINDOWS_STAT_INODES
63ce7108
TT
739WINDOWS_64_BIT_OFF_T
740NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
741NEXT_SYS_TYPES_H
698be2d8
CB
742HAVE_SYS_RANDOM_H
743NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H
744NEXT_SYS_RANDOM_H
2196f55f
YQ
745NEXT_AS_FIRST_DIRECTIVE_STRING_H
746NEXT_STRING_H
98399780
YQ
747NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
748NEXT_STDLIB_H
6a29c58e
YQ
749NEXT_AS_FIRST_DIRECTIVE_STDIO_H
750NEXT_STDIO_H
2196f55f
YQ
751HAVE__BOOL
752GL_GENERATE_STDBOOL_H_FALSE
753GL_GENERATE_STDBOOL_H_TRUE
754STDBOOL_H
725e2999
JB
755GL_GENERATE_STDALIGN_H_FALSE
756GL_GENERATE_STDALIGN_H_TRUE
757STDALIGN_H
0750520d
PA
758NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
759NEXT_SIGNAL_H
760REPLACE_RAISE
761REPLACE_PTHREAD_SIGMASK
762HAVE_SIGHANDLER_T
763HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
764HAVE_STRUCT_SIGACTION_SA_SIGACTION
765HAVE_SIGACTION
766HAVE_SIGINFO_T
767HAVE_SIGSET_T
768HAVE_RAISE
769HAVE_PTHREAD_SIGMASK
770HAVE_POSIX_SIGNALBLOCKING
771GNULIB_SIGACTION
772GNULIB_SIGPROCMASK
773GNULIB_SIGNAL_H_SIGPIPE
774GNULIB_RAISE
775GNULIB_PTHREAD_SIGMASK
725e2999
JB
776GL_GENERATE_NETINET_IN_H_FALSE
777GL_GENERATE_NETINET_IN_H_TRUE
778NETINET_IN_H
779HAVE_NETINET_IN_H
780NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
781NEXT_NETINET_IN_H
c971b7fa 782UNDEFINE_STRTOK_R
c971b7fa 783REPLACE_STRSIGNAL
9c9d63b1 784REPLACE_STRERRORNAME_NP
c971b7fa
PA
785REPLACE_STRERROR_R
786REPLACE_STRERROR
c0c3707f 787REPLACE_STRTOK_R
c971b7fa
PA
788REPLACE_STRCASESTR
789REPLACE_STRSTR
c0c3707f
CB
790REPLACE_STRNLEN
791REPLACE_STRNDUP
792REPLACE_STRNCAT
c971b7fa 793REPLACE_STRDUP
c0c3707f 794REPLACE_STRCHRNUL
c971b7fa
PA
795REPLACE_STPNCPY
796REPLACE_MEMMEM
797REPLACE_MEMCHR
9c9d63b1 798REPLACE_FFSLL
c971b7fa
PA
799HAVE_STRVERSCMP
800HAVE_DECL_STRSIGNAL
9c9d63b1
PM
801HAVE_SIGDESCR_NP
802HAVE_SIGABBREV_NP
803HAVE_STRERRORNAME_NP
c971b7fa
PA
804HAVE_DECL_STRERROR_R
805HAVE_DECL_STRTOK_R
806HAVE_STRCASESTR
807HAVE_STRSEP
808HAVE_STRPBRK
809HAVE_DECL_STRNLEN
810HAVE_DECL_STRNDUP
811HAVE_DECL_STRDUP
812HAVE_STRCHRNUL
813HAVE_STPNCPY
814HAVE_STPCPY
815HAVE_RAWMEMCHR
816HAVE_DECL_MEMRCHR
817HAVE_MEMPCPY
818HAVE_DECL_MEMMEM
c971b7fa
PA
819HAVE_FFSLL
820HAVE_FFSL
c0c3707f 821HAVE_EXPLICIT_BZERO
9c9d63b1
PM
822GNULIB_MDA_STRDUP
823GNULIB_MDA_MEMCCPY
c971b7fa
PA
824HAVE_MBSLEN
825GNULIB_STRVERSCMP
826GNULIB_STRSIGNAL
9c9d63b1
PM
827GNULIB_SIGDESCR_NP
828GNULIB_SIGABBREV_NP
829GNULIB_STRERRORNAME_NP
c971b7fa
PA
830GNULIB_STRERROR_R
831GNULIB_STRERROR
832GNULIB_MBSTOK_R
833GNULIB_MBSSEP
834GNULIB_MBSSPN
835GNULIB_MBSPBRK
836GNULIB_MBSCSPN
837GNULIB_MBSCASESTR
838GNULIB_MBSPCASECMP
839GNULIB_MBSNCASECMP
840GNULIB_MBSCASECMP
841GNULIB_MBSSTR
842GNULIB_MBSRCHR
843GNULIB_MBSCHR
844GNULIB_MBSNLEN
845GNULIB_MBSLEN
846GNULIB_STRTOK_R
847GNULIB_STRCASESTR
848GNULIB_STRSTR
849GNULIB_STRSEP
850GNULIB_STRPBRK
851GNULIB_STRNLEN
852GNULIB_STRNDUP
853GNULIB_STRNCAT
854GNULIB_STRDUP
855GNULIB_STRCHRNUL
856GNULIB_STPNCPY
857GNULIB_STPCPY
858GNULIB_RAWMEMCHR
859GNULIB_MEMRCHR
860GNULIB_MEMPCPY
861GNULIB_MEMMEM
862GNULIB_MEMCHR
863GNULIB_FFSLL
864GNULIB_FFSL
c0c3707f 865GNULIB_EXPLICIT_BZERO
5df4cba6
SM
866HAVE_VISIBILITY
867CFLAG_VISIBILITY
868LIB_MBRTOWC
8690e634 869LOCALE_ZH_CN
c0c3707f 870LOCALE_FR_UTF8
8690e634 871LOCALE_JA
88b48903
WN
872NEXT_AS_FIRST_DIRECTIVE_MATH_H
873NEXT_MATH_H
5abebf3c
CB
874LTLIBMULTITHREAD
875LIBMULTITHREAD
876LTLIBTHREAD
877LIBTHREAD
5df4cba6
SM
878LIBSTDTHREAD
879NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
880NEXT_LOCALE_H
881HAVE_XLOCALE_H
882NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
883NEXT_STDDEF_H
884GL_GENERATE_STDDEF_H_FALSE
885GL_GENERATE_STDDEF_H_TRUE
886STDDEF_H
887HAVE_WCHAR_T
888HAVE_MAX_ALIGN_T
889REPLACE_NULL
890REPLACE_STRUCT_LCONV
891REPLACE_FREELOCALE
892REPLACE_DUPLOCALE
893REPLACE_NEWLOCALE
894REPLACE_SETLOCALE
895REPLACE_LOCALECONV
896HAVE_FREELOCALE
897HAVE_DUPLOCALE
898HAVE_NEWLOCALE
899GNULIB_LOCALENAME
900GNULIB_DUPLOCALE
901GNULIB_SETLOCALE_NULL
902GNULIB_SETLOCALE
903GNULIB_LOCALECONV
8690e634 904LOCALCHARSET_TESTS_ENVIRONMENT
c971b7fa
PA
905NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
906NEXT_INTTYPES_H
907UINT64_MAX_EQ_ULONG_MAX
908UINT32_MAX_LT_UINTMAX_MAX
909PRIPTR_PREFIX
c971b7fa
PA
910INT64_MAX_EQ_LONG_MAX
911INT32_MAX_LT_INTMAX_MAX
4a626d0a 912REPLACE_STRTOUMAX
c971b7fa 913REPLACE_STRTOIMAX
c0c3707f 914HAVE_IMAXDIV_T
c971b7fa
PA
915HAVE_DECL_STRTOUMAX
916HAVE_DECL_STRTOIMAX
917HAVE_DECL_IMAXDIV
918HAVE_DECL_IMAXABS
919GNULIB_STRTOUMAX
920GNULIB_STRTOIMAX
921GNULIB_IMAXDIV
922GNULIB_IMAXABS
923GL_GENERATE_STDINT_H_FALSE
924GL_GENERATE_STDINT_H_TRUE
925STDINT_H
49e4877c
PA
926HAVE_SYS_INTTYPES_H
927HAVE_SYS_BITYPES_H
928HAVE_C99_STDINT_H
c971b7fa
PA
929WINT_T_SUFFIX
930WCHAR_T_SUFFIX
931SIG_ATOMIC_T_SUFFIX
932SIZE_T_SUFFIX
933PTRDIFF_T_SUFFIX
934HAVE_SIGNED_WINT_T
935HAVE_SIGNED_WCHAR_T
936HAVE_SIGNED_SIG_ATOMIC_T
937BITSIZEOF_WINT_T
938BITSIZEOF_WCHAR_T
939BITSIZEOF_SIG_ATOMIC_T
940BITSIZEOF_SIZE_T
941BITSIZEOF_PTRDIFF_T
942APPLE_UNIVERSAL_BUILD
c971b7fa
PA
943HAVE_STDINT_H
944NEXT_AS_FIRST_DIRECTIVE_STDINT_H
945NEXT_STDINT_H
c971b7fa
PA
946HAVE_SYS_TYPES_H
947HAVE_INTTYPES_H
948HAVE_WCHAR_H
c0c3707f 949GNULIB_OVERRIDES_WINT_T
49e4877c
PA
950GL_GENERATE_LIMITS_H_FALSE
951GL_GENERATE_LIMITS_H_TRUE
952LIMITS_H
953NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
954NEXT_LIMITS_H
725e2999
JB
955HAVE_SYS_SOCKET_H
956NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
957NEXT_SYS_SOCKET_H
958HAVE_ACCEPT4
959HAVE_SA_FAMILY_T
960HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
961HAVE_STRUCT_SOCKADDR_STORAGE
962GNULIB_ACCEPT4
963GNULIB_SHUTDOWN
964GNULIB_SETSOCKOPT
965GNULIB_SENDTO
966GNULIB_RECVFROM
967GNULIB_SEND
968GNULIB_RECV
969GNULIB_LISTEN
970GNULIB_GETSOCKOPT
971GNULIB_GETSOCKNAME
972GNULIB_GETPEERNAME
973GNULIB_BIND
974GNULIB_ACCEPT
975GNULIB_CONNECT
976GNULIB_SOCKET
977INET_NTOP_LIB
5df4cba6
SM
978LIB_HARD_LOCALE
979LIB_SETLOCALE_NULL
980LIB_SCHED_YIELD
981LIBPMULTITHREAD
982LIBPTHREAD
6ec2e0f5
SDJ
983GL_GENERATE_GLOB_H_FALSE
984GL_GENERATE_GLOB_H_TRUE
985GLOB_H
c0c3707f
CB
986HAVE_GLOB_H
987NEXT_AS_FIRST_DIRECTIVE_GLOB_H
988NEXT_GLOB_H
989REPLACE_GLOB_PATTERN_P
990REPLACE_GLOB
991HAVE_GLOB_PATTERN_P
992HAVE_GLOB
993GNULIB_GLOB
4a626d0a
PA
994NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
995NEXT_SYS_TIME_H
996REPLACE_STRUCT_TIMEVAL
997REPLACE_GETTIMEOFDAY
4a626d0a
PA
998HAVE_SYS_TIME_H
999HAVE_STRUCT_TIMEVAL
1000HAVE_GETTIMEOFDAY
1001GNULIB_GETTIMEOFDAY
6ec2e0f5
SDJ
1002LTLIBINTL
1003LIBINTL
698be2d8
CB
1004LIB_GETRANDOM
1005REPLACE_GETRANDOM
1006HAVE_GETRANDOM
1007GNULIB_GETRANDOM
c0c3707f 1008LIB_GETLOGIN
c17253b9
MF
1009REPLACE_VSPRINTF
1010REPLACE_VSNPRINTF
1011REPLACE_VPRINTF
1012REPLACE_VFPRINTF
1013REPLACE_VDPRINTF
1014REPLACE_VASPRINTF
1015REPLACE_TMPFILE
1016REPLACE_STDIO_WRITE_FUNCS
1017REPLACE_STDIO_READ_FUNCS
1018REPLACE_SPRINTF
1019REPLACE_SNPRINTF
1020REPLACE_RENAMEAT
1021REPLACE_RENAME
1022REPLACE_REMOVE
1023REPLACE_PRINTF
1024REPLACE_POPEN
1025REPLACE_PERROR
1026REPLACE_OBSTACK_PRINTF
1027REPLACE_GETLINE
1028REPLACE_GETDELIM
1029REPLACE_FTELLO
1030REPLACE_FTELL
1031REPLACE_FSEEKO
1032REPLACE_FSEEK
1033REPLACE_FREOPEN
1034REPLACE_FPURGE
1035REPLACE_FPRINTF
1036REPLACE_FOPEN
1037REPLACE_FFLUSH
1038REPLACE_FDOPEN
1039REPLACE_FCLOSE
1040REPLACE_DPRINTF
1041HAVE_VDPRINTF
1042HAVE_VASPRINTF
1043HAVE_RENAMEAT
1044HAVE_POPEN
1045HAVE_PCLOSE
1046HAVE_FTELLO
1047HAVE_FSEEKO
1048HAVE_DPRINTF
1049HAVE_DECL_VSNPRINTF
1050HAVE_DECL_SNPRINTF
1051HAVE_DECL_OBSTACK_PRINTF
1052HAVE_DECL_GETLINE
1053HAVE_DECL_GETDELIM
1054HAVE_DECL_FTELLO
1055HAVE_DECL_FSEEKO
1056HAVE_DECL_FPURGE
1057HAVE_DECL_FCLOSEALL
1058GNULIB_MDA_TEMPNAM
1059GNULIB_MDA_PUTW
1060GNULIB_MDA_GETW
1061GNULIB_MDA_FILENO
1062GNULIB_MDA_FDOPEN
1063GNULIB_MDA_FCLOSEALL
1064GNULIB_VSPRINTF_POSIX
1065GNULIB_VSNPRINTF
1066GNULIB_VPRINTF_POSIX
1067GNULIB_VPRINTF
1068GNULIB_VFPRINTF_POSIX
1069GNULIB_VFPRINTF
1070GNULIB_VDPRINTF
1071GNULIB_VSCANF
1072GNULIB_VFSCANF
1073GNULIB_VASPRINTF
1074GNULIB_TMPFILE
1075GNULIB_STDIO_H_SIGPIPE
1076GNULIB_STDIO_H_NONBLOCKING
1077GNULIB_SPRINTF_POSIX
1078GNULIB_SNPRINTF
1079GNULIB_SCANF
1080GNULIB_RENAMEAT
1081GNULIB_RENAME
1082GNULIB_REMOVE
1083GNULIB_PUTS
1084GNULIB_PUTCHAR
1085GNULIB_PUTC
1086GNULIB_PRINTF_POSIX
1087GNULIB_PRINTF
1088GNULIB_POPEN
1089GNULIB_PERROR
1090GNULIB_PCLOSE
1091GNULIB_OBSTACK_PRINTF_POSIX
1092GNULIB_OBSTACK_PRINTF
1093GNULIB_GETLINE
1094GNULIB_GETDELIM
1095GNULIB_GETCHAR
1096GNULIB_GETC
1097GNULIB_FWRITE
1098GNULIB_FTELLO
1099GNULIB_FTELL
1100GNULIB_FSEEKO
1101GNULIB_FSEEK
1102GNULIB_FSCANF
1103GNULIB_FREOPEN
1104GNULIB_FREAD
1105GNULIB_FPUTS
1106GNULIB_FPUTC
1107GNULIB_FPURGE
1108GNULIB_FPRINTF_POSIX
1109GNULIB_FPRINTF
1110GNULIB_FOPEN
1111GNULIB_FGETS
1112GNULIB_FGETC
1113GNULIB_FFLUSH
1114GNULIB_FDOPEN
1115GNULIB_FCLOSE
1116GNULIB_DPRINTF
6ec2e0f5 1117WINDOWS_64_BIT_ST_SIZE
c0c3707f 1118WINDOWS_STAT_TIMESPEC
6ec2e0f5
SDJ
1119NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
1120NEXT_SYS_STAT_H
1121REPLACE_UTIMENSAT
1122REPLACE_STAT
9c9d63b1 1123REPLACE_MKNODAT
6ec2e0f5 1124REPLACE_MKNOD
9c9d63b1 1125REPLACE_MKFIFOAT
6ec2e0f5
SDJ
1126REPLACE_MKFIFO
1127REPLACE_MKDIR
1128REPLACE_LSTAT
1129REPLACE_FUTIMENS
1130REPLACE_FSTATAT
1131REPLACE_FSTAT
5df4cba6 1132REPLACE_FCHMODAT
6ec2e0f5
SDJ
1133HAVE_UTIMENSAT
1134HAVE_MKNODAT
1135HAVE_MKNOD
1136HAVE_MKFIFOAT
1137HAVE_MKFIFO
1138HAVE_MKDIRAT
1139HAVE_LSTAT
1140HAVE_LCHMOD
9c9d63b1 1141HAVE_GETUMASK
6ec2e0f5
SDJ
1142HAVE_FUTIMENS
1143HAVE_FSTATAT
1144HAVE_FCHMODAT
9c9d63b1
PM
1145GNULIB_MDA_UMASK
1146GNULIB_MDA_MKDIR
1147GNULIB_MDA_CHMOD
c0c3707f 1148GNULIB_OVERRIDES_STRUCT_STAT
6ec2e0f5
SDJ
1149GNULIB_UTIMENSAT
1150GNULIB_STAT
1151GNULIB_MKNODAT
1152GNULIB_MKNOD
1153GNULIB_MKFIFOAT
1154GNULIB_MKFIFO
1155GNULIB_MKDIRAT
9c9d63b1 1156GNULIB_MKDIR
6ec2e0f5
SDJ
1157GNULIB_LSTAT
1158GNULIB_LCHMOD
9c9d63b1 1159GNULIB_GETUMASK
6ec2e0f5
SDJ
1160GNULIB_FUTIMENS
1161GNULIB_FSTATAT
1162GNULIB_FSTAT
1163GNULIB_FCHMODAT
88b48903
WN
1164FREXPL_LIBM
1165HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
1166FREXP_LIBM
1167REPLACE_TRUNCL
1168REPLACE_TRUNCF
1169REPLACE_TRUNC
c0c3707f
CB
1170REPLACE_TANHF
1171REPLACE_TANF
88b48903 1172REPLACE_SQRTL
c0c3707f
CB
1173REPLACE_SQRTF
1174REPLACE_SINHF
1175REPLACE_SINF
9c9d63b1 1176REPLACE_SIGNBIT_USING_BUILTINS
88b48903
WN
1177REPLACE_SIGNBIT
1178REPLACE_ROUNDL
1179REPLACE_ROUNDF
1180REPLACE_ROUND
c0c3707f 1181REPLACE_RINTL
88b48903
WN
1182REPLACE_REMAINDERL
1183REPLACE_REMAINDERF
1184REPLACE_REMAINDER
1185REPLACE_NAN
1186REPLACE_MODFL
1187REPLACE_MODFF
1188REPLACE_MODF
1189REPLACE_LOGBL
1190REPLACE_LOGBF
1191REPLACE_LOGB
1192REPLACE_LOG2L
1193REPLACE_LOG2F
1194REPLACE_LOG2
1195REPLACE_LOG1PL
1196REPLACE_LOG1PF
1197REPLACE_LOG1P
1198REPLACE_LOG10L
1199REPLACE_LOG10F
1200REPLACE_LOG10
1201REPLACE_LOGL
1202REPLACE_LOGF
1203REPLACE_LOG
1204REPLACE_LDEXPL
1205REPLACE_ISNAN
1206REPLACE_ISINF
1207REPLACE_ISFINITE
c0c3707f 1208REPLACE_ILOGBL
88b48903
WN
1209REPLACE_ILOGBF
1210REPLACE_ILOGB
1211REPLACE_HYPOTL
1212REPLACE_HYPOTF
1213REPLACE_HYPOT
1214REPLACE_HUGE_VAL
1215REPLACE_FREXPL
1216REPLACE_FREXP
1217REPLACE_FREXPF
1218REPLACE_FMODL
1219REPLACE_FMODF
1220REPLACE_FMOD
1221REPLACE_FMAL
1222REPLACE_FMAF
1223REPLACE_FMA
1224REPLACE_FLOORL
1225REPLACE_FLOORF
1226REPLACE_FLOOR
1227REPLACE_FABSL
1228REPLACE_EXP2L
1229REPLACE_EXP2
c0c3707f 1230REPLACE_EXPM1L
88b48903
WN
1231REPLACE_EXPM1F
1232REPLACE_EXPM1
c0c3707f
CB
1233REPLACE_EXPL
1234REPLACE_EXPF
1235REPLACE_COSHF
1236REPLACE_COSF
88b48903
WN
1237REPLACE_CEILL
1238REPLACE_CEILF
1239REPLACE_CEIL
1240REPLACE_CBRTL
1241REPLACE_CBRTF
c0c3707f
CB
1242REPLACE_ATAN2F
1243REPLACE_ATANF
1244REPLACE_ASINF
1245REPLACE_ACOSF
88b48903
WN
1246HAVE_DECL_TRUNCL
1247HAVE_DECL_TRUNCF
1248HAVE_DECL_TRUNC
1249HAVE_DECL_TANL
1250HAVE_DECL_SQRTL
1251HAVE_DECL_SINL
1252HAVE_DECL_ROUNDL
1253HAVE_DECL_ROUNDF
1254HAVE_DECL_ROUND
1255HAVE_DECL_RINTF
1256HAVE_DECL_REMAINDERL
1257HAVE_DECL_REMAINDER
1258HAVE_DECL_LOGB
1259HAVE_DECL_LOG2L
1260HAVE_DECL_LOG2F
1261HAVE_DECL_LOG2
1262HAVE_DECL_LOG10L
1263HAVE_DECL_LOGL
1264HAVE_DECL_LDEXPL
1265HAVE_DECL_FREXPL
1266HAVE_DECL_FLOORL
1267HAVE_DECL_FLOORF
1268HAVE_DECL_EXPM1L
1269HAVE_DECL_EXP2L
1270HAVE_DECL_EXP2F
1271HAVE_DECL_EXP2
1272HAVE_DECL_EXPL
1273HAVE_DECL_COSL
1274HAVE_DECL_COPYSIGNF
1275HAVE_DECL_CEILL
1276HAVE_DECL_CEILF
1277HAVE_DECL_CBRTL
1278HAVE_DECL_CBRTF
1279HAVE_DECL_ATANL
1280HAVE_DECL_ASINL
1281HAVE_DECL_ACOSL
1282HAVE_TANHF
1283HAVE_TANL
1284HAVE_TANF
1285HAVE_SQRTL
1286HAVE_SQRTF
1287HAVE_SINHF
1288HAVE_SINL
1289HAVE_SINF
1290HAVE_RINTL
1291HAVE_RINT
1292HAVE_REMAINDERF
1293HAVE_REMAINDER
1294HAVE_POWF
1295HAVE_MODFL
1296HAVE_MODFF
1297HAVE_LOGBL
1298HAVE_LOGBF
1299HAVE_LOG1PL
1300HAVE_LOG1PF
1301HAVE_LOG1P
1302HAVE_LOG10L
1303HAVE_LOG10F
1304HAVE_LOGL
1305HAVE_LOGF
1306HAVE_LDEXPF
1307HAVE_ISNANL
1308HAVE_ISNAND
1309HAVE_ISNANF
1310HAVE_ILOGBL
1311HAVE_ILOGBF
1312HAVE_ILOGB
1313HAVE_HYPOTL
1314HAVE_HYPOTF
1315HAVE_FREXPF
1316HAVE_FMODL
1317HAVE_FMODF
1318HAVE_FMAL
1319HAVE_FMAF
1320HAVE_FMA
1321HAVE_FABSL
1322HAVE_FABSF
1323HAVE_EXPM1F
1324HAVE_EXPM1
1325HAVE_EXPL
1326HAVE_EXPF
1327HAVE_COSHF
1328HAVE_COSL
1329HAVE_COSF
1330HAVE_COPYSIGNL
1331HAVE_COPYSIGN
1332HAVE_CBRTL
1333HAVE_CBRTF
1334HAVE_CBRT
1335HAVE_ATAN2F
1336HAVE_ATANL
1337HAVE_ATANF
1338HAVE_ASINL
1339HAVE_ASINF
1340HAVE_ACOSL
1341HAVE_ACOSF
9c9d63b1
PM
1342GNULIB_MDA_YN
1343GNULIB_MDA_Y1
1344GNULIB_MDA_Y0
1345GNULIB_MDA_JN
1346GNULIB_MDA_J1
1347GNULIB_MDA_J0
88b48903
WN
1348GNULIB_TRUNCL
1349GNULIB_TRUNCF
1350GNULIB_TRUNC
1351GNULIB_TANHF
1352GNULIB_TANL
1353GNULIB_TANF
1354GNULIB_SQRTL
1355GNULIB_SQRTF
1356GNULIB_SINHF
1357GNULIB_SINL
1358GNULIB_SINF
1359GNULIB_SIGNBIT
1360GNULIB_ROUNDL
1361GNULIB_ROUNDF
1362GNULIB_ROUND
1363GNULIB_RINTL
1364GNULIB_RINTF
1365GNULIB_RINT
1366GNULIB_REMAINDERL
1367GNULIB_REMAINDERF
1368GNULIB_REMAINDER
1369GNULIB_POWF
1370GNULIB_MODFL
1371GNULIB_MODFF
1372GNULIB_MODF
1373GNULIB_LOGBL
1374GNULIB_LOGBF
1375GNULIB_LOGB
1376GNULIB_LOG2L
1377GNULIB_LOG2F
1378GNULIB_LOG2
1379GNULIB_LOG1PL
1380GNULIB_LOG1PF
1381GNULIB_LOG1P
1382GNULIB_LOG10L
1383GNULIB_LOG10F
1384GNULIB_LOG10
1385GNULIB_LOGL
1386GNULIB_LOGF
1387GNULIB_LOG
1388GNULIB_LDEXPL
1389GNULIB_LDEXPF
1390GNULIB_ISNANL
1391GNULIB_ISNAND
1392GNULIB_ISNANF
1393GNULIB_ISNAN
1394GNULIB_ISINF
1395GNULIB_ISFINITE
1396GNULIB_ILOGBL
1397GNULIB_ILOGBF
1398GNULIB_ILOGB
1399GNULIB_HYPOTL
1400GNULIB_HYPOTF
1401GNULIB_HYPOT
1402GNULIB_FREXPL
1403GNULIB_FREXP
1404GNULIB_FREXPF
1405GNULIB_FMODL
1406GNULIB_FMODF
1407GNULIB_FMOD
1408GNULIB_FMAL
1409GNULIB_FMAF
1410GNULIB_FMA
1411GNULIB_FLOORL
1412GNULIB_FLOORF
1413GNULIB_FLOOR
1414GNULIB_FABSL
1415GNULIB_FABSF
1416GNULIB_EXPM1L
1417GNULIB_EXPM1F
1418GNULIB_EXPM1
1419GNULIB_EXP2L
1420GNULIB_EXP2F
1421GNULIB_EXP2
1422GNULIB_EXPL
1423GNULIB_EXPF
1424GNULIB_COSHF
1425GNULIB_COSL
1426GNULIB_COSF
1427GNULIB_COPYSIGNL
1428GNULIB_COPYSIGNF
1429GNULIB_COPYSIGN
1430GNULIB_CEILL
1431GNULIB_CEILF
1432GNULIB_CEIL
1433GNULIB_CBRTL
1434GNULIB_CBRTF
1435GNULIB_CBRT
1436GNULIB_ATAN2F
1437GNULIB_ATANL
1438GNULIB_ATANF
1439GNULIB_ASINL
1440GNULIB_ASINF
1441GNULIB_ACOSL
1442GNULIB_ACOSF
8690e634
JK
1443GL_GENERATE_FNMATCH_H_FALSE
1444GL_GENERATE_FNMATCH_H_TRUE
1445FNMATCH_H
c0c3707f
CB
1446HAVE_FNMATCH_H
1447NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H
1448NEXT_FNMATCH_H
1449REPLACE_FNMATCH
1450HAVE_FNMATCH
1451GNULIB_FNMATCH
88b48903
WN
1452REPLACE_ITOLD
1453GL_GENERATE_FLOAT_H_FALSE
1454GL_GENERATE_FLOAT_H_TRUE
1455FLOAT_H
1456NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
1457NEXT_FLOAT_H
6ec2e0f5
SDJ
1458NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
1459NEXT_FCNTL_H
1460REPLACE_OPENAT
1461REPLACE_OPEN
1462REPLACE_FCNTL
c0c3707f 1463REPLACE_CREAT
6ec2e0f5
SDJ
1464HAVE_OPENAT
1465HAVE_FCNTL
9c9d63b1
PM
1466GNULIB_MDA_OPEN
1467GNULIB_MDA_CREAT
6ec2e0f5
SDJ
1468GNULIB_OPENAT
1469GNULIB_OPEN
1470GNULIB_NONBLOCKING
1471GNULIB_FCNTL
c0c3707f 1472GNULIB_CREAT
18848e28
GF
1473EOVERFLOW_VALUE
1474EOVERFLOW_HIDDEN
1475ENOLINK_VALUE
1476ENOLINK_HIDDEN
1477EMULTIHOP_VALUE
1478EMULTIHOP_HIDDEN
1479GL_GENERATE_ERRNO_H_FALSE
1480GL_GENERATE_ERRNO_H_TRUE
1481ERRNO_H
1482NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
1483NEXT_ERRNO_H
e26b6bb0
TT
1484HAVE_DIRENT_H
1485NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
1486NEXT_DIRENT_H
698be2d8
CB
1487NEXT_AS_FIRST_DIRECTIVE_CTYPE_H
1488NEXT_CTYPE_H
1489HAVE_ISBLANK
1490GNULIB_ISBLANK
e26b6bb0
TT
1491REPLACE_FDOPENDIR
1492REPLACE_DIRFD
1493REPLACE_CLOSEDIR
1494REPLACE_OPENDIR
1495HAVE_ALPHASORT
1496HAVE_SCANDIR
1497HAVE_FDOPENDIR
1498HAVE_DECL_FDOPENDIR
1499HAVE_DECL_DIRFD
1500HAVE_CLOSEDIR
1501HAVE_REWINDDIR
1502HAVE_READDIR
1503HAVE_OPENDIR
1504GNULIB_ALPHASORT
1505GNULIB_SCANDIR
1506GNULIB_FDOPENDIR
1507GNULIB_DIRFD
1508GNULIB_CLOSEDIR
1509GNULIB_REWINDDIR
1510GNULIB_READDIR
1511GNULIB_OPENDIR
6ec2e0f5
SDJ
1512HAVE_WINSOCK2_H
1513HAVE_MSVC_INVALID_PARAMETER_HANDLER
9c9d63b1 1514LIB_CLOCK_GETTIME
e26b6bb0
TT
1515UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
1516UNISTD_H_HAVE_WINSOCK2_H
698be2d8 1517UNISTD_H_HAVE_SYS_RANDOM_H
e26b6bb0
TT
1518REPLACE_WRITE
1519REPLACE_USLEEP
1520REPLACE_UNLINKAT
1521REPLACE_UNLINK
1522REPLACE_TTYNAME_R
c0c3707f 1523REPLACE_TRUNCATE
4a626d0a 1524REPLACE_SYMLINKAT
e26b6bb0
TT
1525REPLACE_SYMLINK
1526REPLACE_SLEEP
1527REPLACE_RMDIR
4a626d0a 1528REPLACE_READLINKAT
e26b6bb0
TT
1529REPLACE_READLINK
1530REPLACE_READ
1531REPLACE_PWRITE
1532REPLACE_PREAD
1533REPLACE_LSEEK
1534REPLACE_LINKAT
1535REPLACE_LINK
1536REPLACE_LCHOWN
1537REPLACE_ISATTY
c0c3707f 1538REPLACE_GETPASS
e26b6bb0
TT
1539REPLACE_GETPAGESIZE
1540REPLACE_GETGROUPS
1541REPLACE_GETLOGIN_R
4a626d0a 1542REPLACE_GETDTABLESIZE
e26b6bb0
TT
1543REPLACE_GETDOMAINNAME
1544REPLACE_GETCWD
1545REPLACE_FTRUNCATE
1546REPLACE_FCHOWNAT
c0c3707f 1547REPLACE_FACCESSAT
9c9d63b1
PM
1548REPLACE_EXECVPE
1549REPLACE_EXECVP
1550REPLACE_EXECVE
1551REPLACE_EXECV
1552REPLACE_EXECLP
1553REPLACE_EXECLE
1554REPLACE_EXECL
e26b6bb0
TT
1555REPLACE_DUP2
1556REPLACE_DUP
1557REPLACE_CLOSE
1558REPLACE_CHOWN
c0c3707f 1559REPLACE_ACCESS
e26b6bb0
TT
1560HAVE_SYS_PARAM_H
1561HAVE_OS_H
1562HAVE_DECL_TTYNAME_R
c0c3707f 1563HAVE_DECL_TRUNCATE
e26b6bb0
TT
1564HAVE_DECL_SETHOSTNAME
1565HAVE_DECL_GETUSERSHELL
1566HAVE_DECL_GETPAGESIZE
1567HAVE_DECL_GETLOGIN_R
c0c3707f 1568HAVE_DECL_GETLOGIN
e26b6bb0
TT
1569HAVE_DECL_GETDOMAINNAME
1570HAVE_DECL_FDATASYNC
1571HAVE_DECL_FCHDIR
9c9d63b1 1572HAVE_DECL_EXECVPE
e26b6bb0
TT
1573HAVE_DECL_ENVIRON
1574HAVE_USLEEP
1575HAVE_UNLINKAT
1576HAVE_SYMLINKAT
1577HAVE_SYMLINK
1578HAVE_SLEEP
1579HAVE_SETHOSTNAME
1580HAVE_READLINKAT
1581HAVE_READLINK
1582HAVE_PWRITE
1583HAVE_PREAD
1584HAVE_PIPE2
1585HAVE_PIPE
1586HAVE_LINKAT
1587HAVE_LINK
1588HAVE_LCHOWN
1589HAVE_GROUP_MEMBER
c0c3707f 1590HAVE_GETPASS
e26b6bb0
TT
1591HAVE_GETPAGESIZE
1592HAVE_GETLOGIN
1593HAVE_GETHOSTNAME
1594HAVE_GETGROUPS
698be2d8 1595HAVE_GETENTROPY
e26b6bb0
TT
1596HAVE_GETDTABLESIZE
1597HAVE_FTRUNCATE
1598HAVE_FSYNC
1599HAVE_FDATASYNC
1600HAVE_FCHOWNAT
1601HAVE_FCHDIR
1602HAVE_FACCESSAT
9c9d63b1 1603HAVE_EXECVPE
e26b6bb0
TT
1604HAVE_EUIDACCESS
1605HAVE_DUP3
c0c3707f 1606HAVE_COPY_FILE_RANGE
e26b6bb0 1607HAVE_CHOWN
9c9d63b1
PM
1608GNULIB_MDA_WRITE
1609GNULIB_MDA_UNLINK
1610GNULIB_MDA_SWAB
1611GNULIB_MDA_RMDIR
1612GNULIB_MDA_READ
1613GNULIB_MDA_LSEEK
1614GNULIB_MDA_ISATTY
1615GNULIB_MDA_GETPID
1616GNULIB_MDA_GETCWD
1617GNULIB_MDA_EXECVPE
1618GNULIB_MDA_EXECVP
1619GNULIB_MDA_EXECVE
1620GNULIB_MDA_EXECV
1621GNULIB_MDA_EXECLP
1622GNULIB_MDA_EXECLE
1623GNULIB_MDA_EXECL
1624GNULIB_MDA_DUP2
1625GNULIB_MDA_DUP
1626GNULIB_MDA_CLOSE
1627GNULIB_MDA_CHDIR
1628GNULIB_MDA_ACCESS
e26b6bb0
TT
1629GNULIB_WRITE
1630GNULIB_USLEEP
1631GNULIB_UNLINKAT
1632GNULIB_UNLINK
1633GNULIB_UNISTD_H_SIGPIPE
1634GNULIB_UNISTD_H_NONBLOCKING
1635GNULIB_TTYNAME_R
c0c3707f 1636GNULIB_TRUNCATE
e26b6bb0
TT
1637GNULIB_SYMLINKAT
1638GNULIB_SYMLINK
1639GNULIB_SLEEP
1640GNULIB_SETHOSTNAME
1641GNULIB_RMDIR
1642GNULIB_READLINKAT
1643GNULIB_READLINK
1644GNULIB_READ
1645GNULIB_PWRITE
1646GNULIB_PREAD
1647GNULIB_PIPE2
1648GNULIB_PIPE
1649GNULIB_LSEEK
1650GNULIB_LINKAT
1651GNULIB_LINK
1652GNULIB_LCHOWN
1653GNULIB_ISATTY
1654GNULIB_GROUP_MEMBER
1655GNULIB_GETUSERSHELL
c0c3707f 1656GNULIB_GETPASS
e26b6bb0 1657GNULIB_GETPAGESIZE
5df4cba6 1658GNULIB_GETOPT_POSIX
e26b6bb0
TT
1659GNULIB_GETLOGIN_R
1660GNULIB_GETLOGIN
1661GNULIB_GETHOSTNAME
1662GNULIB_GETGROUPS
698be2d8 1663GNULIB_GETENTROPY
e26b6bb0
TT
1664GNULIB_GETDTABLESIZE
1665GNULIB_GETDOMAINNAME
1666GNULIB_GETCWD
1667GNULIB_FTRUNCATE
1668GNULIB_FSYNC
1669GNULIB_FDATASYNC
1670GNULIB_FCHOWNAT
1671GNULIB_FCHDIR
1672GNULIB_FACCESSAT
9c9d63b1
PM
1673GNULIB_EXECVPE
1674GNULIB_EXECVP
1675GNULIB_EXECVE
1676GNULIB_EXECV
1677GNULIB_EXECLP
1678GNULIB_EXECLE
1679GNULIB_EXECL
e26b6bb0
TT
1680GNULIB_EUIDACCESS
1681GNULIB_ENVIRON
1682GNULIB_DUP3
1683GNULIB_DUP2
1684GNULIB_DUP
c0c3707f 1685GNULIB_COPY_FILE_RANGE
e26b6bb0
TT
1686GNULIB_CLOSE
1687GNULIB_CHOWN
1688GNULIB_CHDIR
c0c3707f 1689GNULIB_ACCESS
98399780
YQ
1690REPLACE_WCTOMB
1691REPLACE_UNSETENV
c0c3707f 1692REPLACE_STRTOLD
98399780 1693REPLACE_STRTOD
c0c3707f 1694REPLACE_SETSTATE
98399780
YQ
1695REPLACE_SETENV
1696REPLACE_REALPATH
1697REPLACE_REALLOC
1698REPLACE_RANDOM_R
c0c3707f 1699REPLACE_RANDOM
4a626d0a 1700REPLACE_QSORT_R
98399780
YQ
1701REPLACE_PUTENV
1702REPLACE_PTSNAME_R
1703REPLACE_PTSNAME
9c9d63b1 1704REPLACE_POSIX_MEMALIGN
98399780
YQ
1705REPLACE_MKSTEMP
1706REPLACE_MBTOWC
1707REPLACE_MALLOC
c0c3707f 1708REPLACE_INITSTATE
9c9d63b1 1709REPLACE_FREE
98399780
YQ
1710REPLACE_CANONICALIZE_FILE_NAME
1711REPLACE_CALLOC
9c9d63b1 1712REPLACE_ALIGNED_ALLOC
98399780
YQ
1713HAVE_DECL_UNSETENV
1714HAVE_UNLOCKPT
1715HAVE_SYS_LOADAVG_H
1716HAVE_STRUCT_RANDOM_DATA
1717HAVE_STRTOULL
1718HAVE_STRTOLL
c0c3707f 1719HAVE_STRTOLD
98399780 1720HAVE_STRTOD
c0c3707f
CB
1721HAVE_DECL_SETSTATE
1722HAVE_SETSTATE
98399780
YQ
1723HAVE_DECL_SETENV
1724HAVE_SETENV
4a626d0a 1725HAVE_SECURE_GETENV
98399780
YQ
1726HAVE_RPMATCH
1727HAVE_REALPATH
c0c3707f 1728HAVE_REALLOCARRAY
98399780
YQ
1729HAVE_RANDOM_R
1730HAVE_RANDOM_H
1731HAVE_RANDOM
4c62b19f 1732HAVE_QSORT_R
98399780
YQ
1733HAVE_PTSNAME_R
1734HAVE_PTSNAME
1735HAVE_POSIX_OPENPT
9c9d63b1 1736HAVE_POSIX_MEMALIGN
98399780
YQ
1737HAVE_MKSTEMPS
1738HAVE_MKSTEMP
1739HAVE_MKOSTEMPS
1740HAVE_MKOSTEMP
1741HAVE_MKDTEMP
c0c3707f
CB
1742HAVE_MBTOWC
1743HAVE_DECL_INITSTATE
1744HAVE_INITSTATE
98399780
YQ
1745HAVE_GRANTPT
1746HAVE_GETSUBOPT
1747HAVE_DECL_GETLOADAVG
9c9d63b1
PM
1748HAVE_DECL_GCVT
1749HAVE_DECL_FCVT
1750HAVE_DECL_ECVT
98399780
YQ
1751HAVE_CANONICALIZE_FILE_NAME
1752HAVE_ATOLL
9c9d63b1 1753HAVE_ALIGNED_ALLOC
98399780 1754HAVE__EXIT
9c9d63b1
PM
1755GNULIB_MDA_PUTENV
1756GNULIB_MDA_MKTEMP
1757GNULIB_MDA_GCVT
1758GNULIB_MDA_FCVT
1759GNULIB_MDA_ECVT
98399780
YQ
1760GNULIB_WCTOMB
1761GNULIB_UNSETENV
1762GNULIB_UNLOCKPT
1763GNULIB_SYSTEM_POSIX
1764GNULIB_STRTOULL
1765GNULIB_STRTOLL
c0c3707f 1766GNULIB_STRTOLD
98399780
YQ
1767GNULIB_STRTOD
1768GNULIB_SETENV
4a626d0a 1769GNULIB_SECURE_GETENV
98399780
YQ
1770GNULIB_RPMATCH
1771GNULIB_REALPATH
1772GNULIB_REALLOC_POSIX
c0c3707f 1773GNULIB_REALLOCARRAY
98399780
YQ
1774GNULIB_RANDOM_R
1775GNULIB_RANDOM
4a626d0a 1776GNULIB_QSORT_R
98399780
YQ
1777GNULIB_PUTENV
1778GNULIB_PTSNAME_R
1779GNULIB_PTSNAME
1780GNULIB_POSIX_OPENPT
9c9d63b1 1781GNULIB_POSIX_MEMALIGN
98399780
YQ
1782GNULIB_MKSTEMPS
1783GNULIB_MKSTEMP
1784GNULIB_MKOSTEMPS
1785GNULIB_MKOSTEMP
1786GNULIB_MKDTEMP
1787GNULIB_MBTOWC
1788GNULIB_MALLOC_POSIX
1789GNULIB_GRANTPT
1790GNULIB_GETSUBOPT
1791GNULIB_GETLOADAVG
9c9d63b1 1792GNULIB_FREE_POSIX
98399780
YQ
1793GNULIB_CANONICALIZE_FILE_NAME
1794GNULIB_CALLOC_POSIX
1795GNULIB_ATOLL
9c9d63b1 1796GNULIB_ALIGNED_ALLOC
98399780 1797GNULIB__EXIT
698be2d8
CB
1798LOCALE_FR
1799REPLACE_WCSTOK
1800REPLACE_WCSFTIME
1801REPLACE_WCSWIDTH
1802REPLACE_WCWIDTH
1803REPLACE_WCSNRTOMBS
1804REPLACE_WCSRTOMBS
1805REPLACE_WCRTOMB
1806REPLACE_MBSNRTOWCS
1807REPLACE_MBSRTOWCS
1808REPLACE_MBRLEN
1809REPLACE_MBRTOWC
1810REPLACE_MBSINIT
1811REPLACE_WCTOB
1812REPLACE_BTOWC
1813REPLACE_MBSTATE_T
1814HAVE_DECL_WCWIDTH
9c9d63b1 1815HAVE_DECL_WCSDUP
698be2d8
CB
1816HAVE_DECL_WCTOB
1817HAVE_WCSFTIME
1818HAVE_WCSWIDTH
1819HAVE_WCSTOK
1820HAVE_WCSSTR
1821HAVE_WCSPBRK
1822HAVE_WCSSPN
1823HAVE_WCSCSPN
1824HAVE_WCSRCHR
1825HAVE_WCSCHR
1826HAVE_WCSDUP
1827HAVE_WCSXFRM
1828HAVE_WCSCOLL
1829HAVE_WCSNCASECMP
1830HAVE_WCSCASECMP
1831HAVE_WCSNCMP
1832HAVE_WCSCMP
1833HAVE_WCSNCAT
1834HAVE_WCSCAT
1835HAVE_WCPNCPY
1836HAVE_WCSNCPY
1837HAVE_WCPCPY
1838HAVE_WCSCPY
1839HAVE_WCSNLEN
1840HAVE_WCSLEN
1841HAVE_WMEMSET
1842HAVE_WMEMPCPY
1843HAVE_WMEMMOVE
1844HAVE_WMEMCPY
1845HAVE_WMEMCMP
1846HAVE_WMEMCHR
1847HAVE_WCSNRTOMBS
1848HAVE_WCSRTOMBS
1849HAVE_WCRTOMB
1850HAVE_MBSNRTOWCS
1851HAVE_MBSRTOWCS
1852HAVE_MBRLEN
1853HAVE_MBRTOWC
1854HAVE_MBSINIT
1855HAVE_BTOWC
9c9d63b1 1856GNULIB_MDA_WCSDUP
698be2d8
CB
1857GNULIB_WCSFTIME
1858GNULIB_WCSWIDTH
1859GNULIB_WCSTOK
1860GNULIB_WCSSTR
1861GNULIB_WCSPBRK
1862GNULIB_WCSSPN
1863GNULIB_WCSCSPN
1864GNULIB_WCSRCHR
1865GNULIB_WCSCHR
1866GNULIB_WCSDUP
1867GNULIB_WCSXFRM
1868GNULIB_WCSCOLL
1869GNULIB_WCSNCASECMP
1870GNULIB_WCSCASECMP
1871GNULIB_WCSNCMP
1872GNULIB_WCSCMP
1873GNULIB_WCSNCAT
1874GNULIB_WCSCAT
1875GNULIB_WCPNCPY
1876GNULIB_WCSNCPY
1877GNULIB_WCPCPY
1878GNULIB_WCSCPY
1879GNULIB_WCSNLEN
1880GNULIB_WCSLEN
1881GNULIB_WMEMSET
1882GNULIB_WMEMPCPY
1883GNULIB_WMEMMOVE
1884GNULIB_WMEMCPY
1885GNULIB_WMEMCMP
1886GNULIB_WMEMCHR
1887GNULIB_WCWIDTH
1888GNULIB_WCSNRTOMBS
1889GNULIB_WCSRTOMBS
1890GNULIB_WCRTOMB
1891GNULIB_MBSNRTOWCS
1892GNULIB_MBSRTOWCS
1893GNULIB_MBRLEN
1894GNULIB_MBRTOWC
1895GNULIB_MBSINIT
1896GNULIB_WCTOB
1897GNULIB_BTOWC
725e2999 1898MKDIR_P
c0c3707f 1899HAVE_WS2TCPIP_H
725e2999
JB
1900HAVE_FEATURES_H
1901NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
1902NEXT_ARPA_INET_H
1903PRAGMA_COLUMNS
1904PRAGMA_SYSTEM_HEADER
1905INCLUDE_NEXT_AS_FIRST_DIRECTIVE
1906INCLUDE_NEXT
1907HAVE_ARPA_INET_H
1908REPLACE_INET_PTON
1909REPLACE_INET_NTOP
1910HAVE_DECL_INET_PTON
1911HAVE_DECL_INET_NTOP
1912GNULIB_INET_PTON
1913GNULIB_INET_NTOP
c0c3707f 1914HAVE_ALLOCA_H
8690e634
JK
1915GL_GENERATE_ALLOCA_H_FALSE
1916GL_GENERATE_ALLOCA_H_TRUE
1917ALLOCA_H
1918ALLOCA
c971b7fa
PA
1919GL_COND_LIBTOOL_FALSE
1920GL_COND_LIBTOOL_TRUE
c8693053
RO
1921RANLIB
1922ARFLAGS
1923AR
1924LARGEFILE_CPPFLAGS
c971b7fa
PA
1925target_os
1926target_vendor
1927target_cpu
1928target
c971b7fa
PA
1929host_os
1930host_vendor
1931host_cpu
1932host
1933build_os
1934build_vendor
1935build_cpu
1936build
4a626d0a
PA
1937EGREP
1938GREP
1939CPP
c971b7fa
PA
1940OBJEXT
1941EXEEXT
1942ac_ct_CC
1943CPPFLAGS
1944LDFLAGS
1945CFLAGS
1946CC
1947MAINT
1948MAINTAINER_MODE_FALSE
1949MAINTAINER_MODE_TRUE
1950target_alias
1951host_alias
1952build_alias
1953LIBS
1954ECHO_T
1955ECHO_N
1956ECHO_C
1957DEFS
1958mandir
1959localedir
1960libdir
1961psdir
1962pdfdir
1963dvidir
1964htmldir
1965infodir
1966docdir
1967oldincludedir
1968includedir
1969localstatedir
1970sharedstatedir
1971sysconfdir
1972datadir
1973datarootdir
1974libexecdir
1975sbindir
1976bindir
1977program_transform_name
1978prefix
1979exec_prefix
1980PACKAGE_URL
1981PACKAGE_BUGREPORT
1982PACKAGE_STRING
1983PACKAGE_VERSION
1984PACKAGE_TARNAME
1985PACKAGE_NAME
1986PATH_SEPARATOR
1987SHELL'
1988ac_subst_files=''
1989ac_user_opts='
1990enable_option_checking
1991enable_maintainer_mode
c8693053 1992enable_plugins
2196f55f 1993enable_largefile
5abebf3c 1994enable_threads
c0c3707f 1995enable_cross_guesses
c971b7fa 1996enable_dependency_tracking
39be3c7e 1997enable_silent_rules
c971b7fa
PA
1998'
1999 ac_precious_vars='build_alias
2000host_alias
2001target_alias
2002CC
2003CFLAGS
2004LDFLAGS
2005LIBS
2006CPPFLAGS
2007CPP'
2008
2009
2010# Initialize some variables set by options.
2011ac_init_help=
2012ac_init_version=false
2013ac_unrecognized_opts=
2014ac_unrecognized_sep=
2015# The variables have the same names as the options, with
2016# dashes changed to underlines.
2017cache_file=/dev/null
2018exec_prefix=NONE
2019no_create=
2020no_recursion=
2021prefix=NONE
2022program_prefix=NONE
2023program_suffix=NONE
2024program_transform_name=s,x,x,
2025silent=
2026site=
2027srcdir=
2028verbose=
2029x_includes=NONE
2030x_libraries=NONE
2031
2032# Installation directory options.
2033# These are left unexpanded so users can "make install exec_prefix=/foo"
2034# and all the variables that are supposed to be based on exec_prefix
2035# by default will actually change.
2036# Use braces instead of parens because sh, perl, etc. also accept them.
2037# (The list follows the same order as the GNU Coding Standards.)
2038bindir='${exec_prefix}/bin'
2039sbindir='${exec_prefix}/sbin'
2040libexecdir='${exec_prefix}/libexec'
2041datarootdir='${prefix}/share'
2042datadir='${datarootdir}'
2043sysconfdir='${prefix}/etc'
2044sharedstatedir='${prefix}/com'
2045localstatedir='${prefix}/var'
2046includedir='${prefix}/include'
2047oldincludedir='/usr/include'
d0ac1c44 2048docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
c971b7fa
PA
2049infodir='${datarootdir}/info'
2050htmldir='${docdir}'
2051dvidir='${docdir}'
2052pdfdir='${docdir}'
2053psdir='${docdir}'
2054libdir='${exec_prefix}/lib'
2055localedir='${datarootdir}/locale'
2056mandir='${datarootdir}/man'
2057
2058ac_prev=
2059ac_dashdash=
2060for ac_option
2061do
2062 # If the previous option needs an argument, assign it.
2063 if test -n "$ac_prev"; then
2064 eval $ac_prev=\$ac_option
2065 ac_prev=
2066 continue
2067 fi
2068
2069 case $ac_option in
d0ac1c44
SM
2070 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
2071 *=) ac_optarg= ;;
2072 *) ac_optarg=yes ;;
c971b7fa
PA
2073 esac
2074
2075 # Accept the important Cygnus configure options, so we can diagnose typos.
2076
2077 case $ac_dashdash$ac_option in
2078 --)
2079 ac_dashdash=yes ;;
2080
2081 -bindir | --bindir | --bindi | --bind | --bin | --bi)
2082 ac_prev=bindir ;;
2083 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
2084 bindir=$ac_optarg ;;
2085
2086 -build | --build | --buil | --bui | --bu)
2087 ac_prev=build_alias ;;
2088 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
2089 build_alias=$ac_optarg ;;
2090
2091 -cache-file | --cache-file | --cache-fil | --cache-fi \
2092 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
2093 ac_prev=cache_file ;;
2094 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
2095 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
2096 cache_file=$ac_optarg ;;
2097
2098 --config-cache | -C)
2099 cache_file=config.cache ;;
2100
2101 -datadir | --datadir | --datadi | --datad)
2102 ac_prev=datadir ;;
2103 -datadir=* | --datadir=* | --datadi=* | --datad=*)
2104 datadir=$ac_optarg ;;
2105
2106 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
2107 | --dataroo | --dataro | --datar)
2108 ac_prev=datarootdir ;;
2109 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
2110 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
2111 datarootdir=$ac_optarg ;;
2112
2113 -disable-* | --disable-*)
2114 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
2115 # Reject names that are not valid shell variable names.
2116 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2117 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2118 ac_useropt_orig=$ac_useropt
2119 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2120 case $ac_user_opts in
2121 *"
2122"enable_$ac_useropt"
2123"*) ;;
2124 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
2125 ac_unrecognized_sep=', ';;
2126 esac
2127 eval enable_$ac_useropt=no ;;
2128
2129 -docdir | --docdir | --docdi | --doc | --do)
2130 ac_prev=docdir ;;
2131 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
2132 docdir=$ac_optarg ;;
2133
2134 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
2135 ac_prev=dvidir ;;
2136 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
2137 dvidir=$ac_optarg ;;
2138
2139 -enable-* | --enable-*)
2140 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
2141 # Reject names that are not valid shell variable names.
2142 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2143 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2144 ac_useropt_orig=$ac_useropt
2145 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2146 case $ac_user_opts in
2147 *"
2148"enable_$ac_useropt"
2149"*) ;;
2150 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
2151 ac_unrecognized_sep=', ';;
2152 esac
2153 eval enable_$ac_useropt=\$ac_optarg ;;
2154
2155 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
2156 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
2157 | --exec | --exe | --ex)
2158 ac_prev=exec_prefix ;;
2159 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
2160 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
2161 | --exec=* | --exe=* | --ex=*)
2162 exec_prefix=$ac_optarg ;;
2163
2164 -gas | --gas | --ga | --g)
2165 # Obsolete; use --with-gas.
2166 with_gas=yes ;;
2167
2168 -help | --help | --hel | --he | -h)
2169 ac_init_help=long ;;
2170 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
2171 ac_init_help=recursive ;;
2172 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
2173 ac_init_help=short ;;
2174
2175 -host | --host | --hos | --ho)
2176 ac_prev=host_alias ;;
2177 -host=* | --host=* | --hos=* | --ho=*)
2178 host_alias=$ac_optarg ;;
2179
2180 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
2181 ac_prev=htmldir ;;
2182 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
2183 | --ht=*)
2184 htmldir=$ac_optarg ;;
2185
2186 -includedir | --includedir | --includedi | --included | --include \
2187 | --includ | --inclu | --incl | --inc)
2188 ac_prev=includedir ;;
2189 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
2190 | --includ=* | --inclu=* | --incl=* | --inc=*)
2191 includedir=$ac_optarg ;;
2192
2193 -infodir | --infodir | --infodi | --infod | --info | --inf)
2194 ac_prev=infodir ;;
2195 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
2196 infodir=$ac_optarg ;;
2197
2198 -libdir | --libdir | --libdi | --libd)
2199 ac_prev=libdir ;;
2200 -libdir=* | --libdir=* | --libdi=* | --libd=*)
2201 libdir=$ac_optarg ;;
2202
2203 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
2204 | --libexe | --libex | --libe)
2205 ac_prev=libexecdir ;;
2206 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
2207 | --libexe=* | --libex=* | --libe=*)
2208 libexecdir=$ac_optarg ;;
2209
2210 -localedir | --localedir | --localedi | --localed | --locale)
2211 ac_prev=localedir ;;
2212 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
2213 localedir=$ac_optarg ;;
2214
2215 -localstatedir | --localstatedir | --localstatedi | --localstated \
2216 | --localstate | --localstat | --localsta | --localst | --locals)
2217 ac_prev=localstatedir ;;
2218 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
2219 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
2220 localstatedir=$ac_optarg ;;
2221
2222 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
2223 ac_prev=mandir ;;
2224 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
2225 mandir=$ac_optarg ;;
2226
2227 -nfp | --nfp | --nf)
2228 # Obsolete; use --without-fp.
2229 with_fp=no ;;
2230
2231 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
2232 | --no-cr | --no-c | -n)
2233 no_create=yes ;;
2234
2235 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
2236 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
2237 no_recursion=yes ;;
2238
2239 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
2240 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
2241 | --oldin | --oldi | --old | --ol | --o)
2242 ac_prev=oldincludedir ;;
2243 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
2244 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
2245 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
2246 oldincludedir=$ac_optarg ;;
2247
2248 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
2249 ac_prev=prefix ;;
2250 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
2251 prefix=$ac_optarg ;;
2252
2253 -program-prefix | --program-prefix | --program-prefi | --program-pref \
2254 | --program-pre | --program-pr | --program-p)
2255 ac_prev=program_prefix ;;
2256 -program-prefix=* | --program-prefix=* | --program-prefi=* \
2257 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
2258 program_prefix=$ac_optarg ;;
2259
2260 -program-suffix | --program-suffix | --program-suffi | --program-suff \
2261 | --program-suf | --program-su | --program-s)
2262 ac_prev=program_suffix ;;
2263 -program-suffix=* | --program-suffix=* | --program-suffi=* \
2264 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
2265 program_suffix=$ac_optarg ;;
2266
2267 -program-transform-name | --program-transform-name \
2268 | --program-transform-nam | --program-transform-na \
2269 | --program-transform-n | --program-transform- \
2270 | --program-transform | --program-transfor \
2271 | --program-transfo | --program-transf \
2272 | --program-trans | --program-tran \
2273 | --progr-tra | --program-tr | --program-t)
2274 ac_prev=program_transform_name ;;
2275 -program-transform-name=* | --program-transform-name=* \
2276 | --program-transform-nam=* | --program-transform-na=* \
2277 | --program-transform-n=* | --program-transform-=* \
2278 | --program-transform=* | --program-transfor=* \
2279 | --program-transfo=* | --program-transf=* \
2280 | --program-trans=* | --program-tran=* \
2281 | --progr-tra=* | --program-tr=* | --program-t=*)
2282 program_transform_name=$ac_optarg ;;
2283
2284 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
2285 ac_prev=pdfdir ;;
2286 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
2287 pdfdir=$ac_optarg ;;
2288
2289 -psdir | --psdir | --psdi | --psd | --ps)
2290 ac_prev=psdir ;;
2291 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
2292 psdir=$ac_optarg ;;
2293
2294 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2295 | -silent | --silent | --silen | --sile | --sil)
2296 silent=yes ;;
2297
2298 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
2299 ac_prev=sbindir ;;
2300 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
2301 | --sbi=* | --sb=*)
2302 sbindir=$ac_optarg ;;
2303
2304 -sharedstatedir | --sharedstatedir | --sharedstatedi \
2305 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
2306 | --sharedst | --shareds | --shared | --share | --shar \
2307 | --sha | --sh)
2308 ac_prev=sharedstatedir ;;
2309 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
2310 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
2311 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
2312 | --sha=* | --sh=*)
2313 sharedstatedir=$ac_optarg ;;
2314
2315 -site | --site | --sit)
2316 ac_prev=site ;;
2317 -site=* | --site=* | --sit=*)
2318 site=$ac_optarg ;;
2319
2320 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
2321 ac_prev=srcdir ;;
2322 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
2323 srcdir=$ac_optarg ;;
2324
2325 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
2326 | --syscon | --sysco | --sysc | --sys | --sy)
2327 ac_prev=sysconfdir ;;
2328 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
2329 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
2330 sysconfdir=$ac_optarg ;;
2331
2332 -target | --target | --targe | --targ | --tar | --ta | --t)
2333 ac_prev=target_alias ;;
2334 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
2335 target_alias=$ac_optarg ;;
2336
2337 -v | -verbose | --verbose | --verbos | --verbo | --verb)
2338 verbose=yes ;;
2339
2340 -version | --version | --versio | --versi | --vers | -V)
2341 ac_init_version=: ;;
2342
2343 -with-* | --with-*)
2344 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
2345 # Reject names that are not valid shell variable names.
2346 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2347 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2348 ac_useropt_orig=$ac_useropt
2349 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2350 case $ac_user_opts in
2351 *"
2352"with_$ac_useropt"
2353"*) ;;
2354 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
2355 ac_unrecognized_sep=', ';;
2356 esac
2357 eval with_$ac_useropt=\$ac_optarg ;;
2358
2359 -without-* | --without-*)
2360 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
2361 # Reject names that are not valid shell variable names.
2362 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2363 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2364 ac_useropt_orig=$ac_useropt
2365 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2366 case $ac_user_opts in
2367 *"
2368"with_$ac_useropt"
2369"*) ;;
2370 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
2371 ac_unrecognized_sep=', ';;
2372 esac
2373 eval with_$ac_useropt=no ;;
2374
2375 --x)
2376 # Obsolete; use --with-x.
2377 with_x=yes ;;
2378
2379 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
2380 | --x-incl | --x-inc | --x-in | --x-i)
2381 ac_prev=x_includes ;;
2382 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
2383 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
2384 x_includes=$ac_optarg ;;
2385
2386 -x-libraries | --x-libraries | --x-librarie | --x-librari \
2387 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
2388 ac_prev=x_libraries ;;
2389 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
2390 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
2391 x_libraries=$ac_optarg ;;
2392
d0ac1c44
SM
2393 -*) as_fn_error $? "unrecognized option: \`$ac_option'
2394Try \`$0 --help' for more information"
c971b7fa
PA
2395 ;;
2396
2397 *=*)
2398 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
2399 # Reject names that are not valid shell variable names.
2400 case $ac_envvar in #(
2401 '' | [0-9]* | *[!_$as_cr_alnum]* )
d0ac1c44 2402 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
c971b7fa
PA
2403 esac
2404 eval $ac_envvar=\$ac_optarg
2405 export $ac_envvar ;;
2406
2407 *)
2408 # FIXME: should be removed in autoconf 3.0.
2409 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
2410 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
2411 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
d0ac1c44 2412 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
c971b7fa
PA
2413 ;;
2414
2415 esac
2416done
2417
2418if test -n "$ac_prev"; then
2419 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
d0ac1c44 2420 as_fn_error $? "missing argument to $ac_option"
c971b7fa
PA
2421fi
2422
2423if test -n "$ac_unrecognized_opts"; then
2424 case $enable_option_checking in
2425 no) ;;
d0ac1c44 2426 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
c971b7fa
PA
2427 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
2428 esac
2429fi
2430
2431# Check all directory arguments for consistency.
2432for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
2433 datadir sysconfdir sharedstatedir localstatedir includedir \
2434 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
2435 libdir localedir mandir
2436do
2437 eval ac_val=\$$ac_var
2438 # Remove trailing slashes.
2439 case $ac_val in
2440 */ )
2441 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
2442 eval $ac_var=\$ac_val;;
2443 esac
2444 # Be sure to have absolute directory names.
2445 case $ac_val in
2446 [\\/$]* | ?:[\\/]* ) continue;;
2447 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
2448 esac
d0ac1c44 2449 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
c971b7fa
PA
2450done
2451
2452# There might be people who depend on the old broken behavior: `$host'
2453# used to hold the argument of --host etc.
2454# FIXME: To remove some day.
2455build=$build_alias
2456host=$host_alias
2457target=$target_alias
2458
2459# FIXME: To remove some day.
2460if test "x$host_alias" != x; then
2461 if test "x$build_alias" = x; then
2462 cross_compiling=maybe
c971b7fa
PA
2463 elif test "x$build_alias" != "x$host_alias"; then
2464 cross_compiling=yes
2465 fi
2466fi
2467
2468ac_tool_prefix=
2469test -n "$host_alias" && ac_tool_prefix=$host_alias-
2470
2471test "$silent" = yes && exec 6>/dev/null
2472
2473
2474ac_pwd=`pwd` && test -n "$ac_pwd" &&
2475ac_ls_di=`ls -di .` &&
2476ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
d0ac1c44 2477 as_fn_error $? "working directory cannot be determined"
c971b7fa 2478test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
d0ac1c44 2479 as_fn_error $? "pwd does not report name of working directory"
c971b7fa
PA
2480
2481
2482# Find the source files, if location was not specified.
2483if test -z "$srcdir"; then
2484 ac_srcdir_defaulted=yes
2485 # Try the directory containing this script, then the parent directory.
2486 ac_confdir=`$as_dirname -- "$as_myself" ||
2487$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2488 X"$as_myself" : 'X\(//\)[^/]' \| \
2489 X"$as_myself" : 'X\(//\)$' \| \
2490 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
2491$as_echo X"$as_myself" |
2492 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
2493 s//\1/
2494 q
2495 }
2496 /^X\(\/\/\)[^/].*/{
2497 s//\1/
2498 q
2499 }
2500 /^X\(\/\/\)$/{
2501 s//\1/
2502 q
2503 }
2504 /^X\(\/\).*/{
2505 s//\1/
2506 q
2507 }
2508 s/.*/./; q'`
2509 srcdir=$ac_confdir
2510 if test ! -r "$srcdir/$ac_unique_file"; then
2511 srcdir=..
2512 fi
2513else
2514 ac_srcdir_defaulted=no
2515fi
2516if test ! -r "$srcdir/$ac_unique_file"; then
2517 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
d0ac1c44 2518 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
c971b7fa
PA
2519fi
2520ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
2521ac_abs_confdir=`(
d0ac1c44 2522 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
c971b7fa
PA
2523 pwd)`
2524# When building in place, set srcdir=.
2525if test "$ac_abs_confdir" = "$ac_pwd"; then
2526 srcdir=.
2527fi
2528# Remove unnecessary trailing slashes from srcdir.
2529# Double slashes in file names in object file debugging info
2530# mess up M-x gdb in Emacs.
2531case $srcdir in
2532*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
2533esac
2534for ac_var in $ac_precious_vars; do
2535 eval ac_env_${ac_var}_set=\${${ac_var}+set}
2536 eval ac_env_${ac_var}_value=\$${ac_var}
2537 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
2538 eval ac_cv_env_${ac_var}_value=\$${ac_var}
2539done
2540
2541#
2542# Report the --help message.
2543#
2544if test "$ac_init_help" = "long"; then
2545 # Omit some internal or obsolete options to make the list less imposing.
2546 # This message is too long to be a string in the A/UX 3.1 sh.
2547 cat <<_ACEOF
d0ac1c44 2548\`configure' configures libgnu UNUSED-VERSION to adapt to many kinds of systems.
c971b7fa
PA
2549
2550Usage: $0 [OPTION]... [VAR=VALUE]...
2551
2552To assign environment variables (e.g., CC, CFLAGS...), specify them as
2553VAR=VALUE. See below for descriptions of some of the useful variables.
2554
2555Defaults for the options are specified in brackets.
2556
2557Configuration:
2558 -h, --help display this help and exit
2559 --help=short display options specific to this package
2560 --help=recursive display the short help of all the included packages
2561 -V, --version display version information and exit
d0ac1c44 2562 -q, --quiet, --silent do not print \`checking ...' messages
c971b7fa
PA
2563 --cache-file=FILE cache test results in FILE [disabled]
2564 -C, --config-cache alias for \`--cache-file=config.cache'
2565 -n, --no-create do not create output files
2566 --srcdir=DIR find the sources in DIR [configure dir or \`..']
2567
2568Installation directories:
2569 --prefix=PREFIX install architecture-independent files in PREFIX
2570 [$ac_default_prefix]
2571 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
2572 [PREFIX]
2573
2574By default, \`make install' will install all the files in
2575\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
2576an installation prefix other than \`$ac_default_prefix' using \`--prefix',
2577for instance \`--prefix=\$HOME'.
2578
2579For better control, use the options below.
2580
2581Fine tuning of the installation directories:
2582 --bindir=DIR user executables [EPREFIX/bin]
2583 --sbindir=DIR system admin executables [EPREFIX/sbin]
2584 --libexecdir=DIR program executables [EPREFIX/libexec]
2585 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
2586 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
2587 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
2588 --libdir=DIR object code libraries [EPREFIX/lib]
2589 --includedir=DIR C header files [PREFIX/include]
2590 --oldincludedir=DIR C header files for non-gcc [/usr/include]
2591 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
2592 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
2593 --infodir=DIR info documentation [DATAROOTDIR/info]
2594 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
2595 --mandir=DIR man documentation [DATAROOTDIR/man]
d0ac1c44 2596 --docdir=DIR documentation root [DATAROOTDIR/doc/libgnu]
c971b7fa
PA
2597 --htmldir=DIR html documentation [DOCDIR]
2598 --dvidir=DIR dvi documentation [DOCDIR]
2599 --pdfdir=DIR pdf documentation [DOCDIR]
2600 --psdir=DIR ps documentation [DOCDIR]
2601_ACEOF
2602
2603 cat <<\_ACEOF
2604
2605Program names:
2606 --program-prefix=PREFIX prepend PREFIX to installed program names
2607 --program-suffix=SUFFIX append SUFFIX to installed program names
2608 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
2609
2610System types:
2611 --build=BUILD configure for building on BUILD [guessed]
2612 --host=HOST cross-compile to build programs to run on HOST [BUILD]
2613 --target=TARGET configure for building compilers for TARGET [HOST]
2614_ACEOF
2615fi
2616
2617if test -n "$ac_init_help"; then
d0ac1c44
SM
2618 case $ac_init_help in
2619 short | recursive ) echo "Configuration of libgnu UNUSED-VERSION:";;
2620 esac
c971b7fa
PA
2621 cat <<\_ACEOF
2622
2623Optional Features:
2624 --disable-option-checking ignore unrecognized --enable/--with options
2625 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
2626 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
d0ac1c44
SM
2627 --enable-maintainer-mode
2628 enable make rules and dependencies not useful (and
2629 sometimes confusing) to the casual installer
c8693053 2630 --enable-plugins Enable support for plugins
2196f55f 2631 --disable-largefile omit support for large files
c0c3707f 2632 --enable-threads={isoc|posix|isoc+posix|windows}
5abebf3c
CB
2633 specify multithreading API
2634 --disable-threads build without multithread safety
c0c3707f
CB
2635 --enable-cross-guesses={conservative|risky}
2636 specify policy for cross-compilation guesses
d0ac1c44
SM
2637 --enable-dependency-tracking
2638 do not reject slow dependency extractors
2639 --disable-dependency-tracking
2640 speeds up one-time build
2641 --enable-silent-rules less verbose build output (undo: "make V=1")
2642 --disable-silent-rules verbose build output (undo: "make V=0")
c971b7fa
PA
2643
2644Some influential environment variables:
2645 CC C compiler command
2646 CFLAGS C compiler flags
2647 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
2648 nonstandard directory <lib dir>
2649 LIBS libraries to pass to the linker, e.g. -l<library>
d0ac1c44 2650 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
c971b7fa
PA
2651 you have headers in a nonstandard directory <include dir>
2652 CPP C preprocessor
2653
2654Use these variables to override the choices made by `configure' or to help
2655it to find libraries and programs with nonstandard names/locations.
2656
2657Report bugs to the package provider.
2658_ACEOF
2659ac_status=$?
2660fi
2661
2662if test "$ac_init_help" = "recursive"; then
2663 # If there are subdirs, report their specific --help.
2664 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
2665 test -d "$ac_dir" ||
2666 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
2667 continue
2668 ac_builddir=.
2669
2670case "$ac_dir" in
2671.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
2672*)
2673 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
2674 # A ".." for each directory in $ac_dir_suffix.
2675 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
2676 case $ac_top_builddir_sub in
2677 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
2678 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
2679 esac ;;
2680esac
2681ac_abs_top_builddir=$ac_pwd
2682ac_abs_builddir=$ac_pwd$ac_dir_suffix
2683# for backward compatibility:
2684ac_top_builddir=$ac_top_build_prefix
2685
2686case $srcdir in
2687 .) # We are building in place.
2688 ac_srcdir=.
2689 ac_top_srcdir=$ac_top_builddir_sub
2690 ac_abs_top_srcdir=$ac_pwd ;;
2691 [\\/]* | ?:[\\/]* ) # Absolute name.
2692 ac_srcdir=$srcdir$ac_dir_suffix;
2693 ac_top_srcdir=$srcdir
2694 ac_abs_top_srcdir=$srcdir ;;
2695 *) # Relative name.
2696 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
2697 ac_top_srcdir=$ac_top_build_prefix$srcdir
2698 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
2699esac
2700ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
2701
2702 cd "$ac_dir" || { ac_status=$?; continue; }
2703 # Check for guested configure.
2704 if test -f "$ac_srcdir/configure.gnu"; then
2705 echo &&
2706 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
2707 elif test -f "$ac_srcdir/configure"; then
2708 echo &&
2709 $SHELL "$ac_srcdir/configure" --help=recursive
2710 else
2711 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
2712 fi || ac_status=$?
2713 cd "$ac_pwd" || { ac_status=$?; break; }
2714 done
2715fi
2716
2717test -n "$ac_init_help" && exit $ac_status
2718if $ac_init_version; then
2719 cat <<\_ACEOF
d0ac1c44
SM
2720libgnu configure UNUSED-VERSION
2721generated by GNU Autoconf 2.69
c971b7fa 2722
d0ac1c44 2723Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
2724This configure script is free software; the Free Software Foundation
2725gives unlimited permission to copy, distribute and modify it.
2726_ACEOF
2727 exit
2728fi
2729
2730## ------------------------ ##
2731## Autoconf initialization. ##
2732## ------------------------ ##
2733
2734# ac_fn_c_try_compile LINENO
2735# --------------------------
2736# Try to compile conftest.$ac_ext, and return whether this succeeded.
2737ac_fn_c_try_compile ()
2738{
2739 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2740 rm -f conftest.$ac_objext
2741 if { { ac_try="$ac_compile"
2742case "(($ac_try" in
2743 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2744 *) ac_try_echo=$ac_try;;
2745esac
2746eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2747$as_echo "$ac_try_echo"; } >&5
2748 (eval "$ac_compile") 2>conftest.err
2749 ac_status=$?
2750 if test -s conftest.err; then
2751 grep -v '^ *+' conftest.err >conftest.er1
2752 cat conftest.er1 >&5
2753 mv -f conftest.er1 conftest.err
2754 fi
2755 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2756 test $ac_status = 0; } && {
2757 test -z "$ac_c_werror_flag" ||
2758 test ! -s conftest.err
2759 } && test -s conftest.$ac_objext; then :
2760 ac_retval=0
2761else
2762 $as_echo "$as_me: failed program was:" >&5
2763sed 's/^/| /' conftest.$ac_ext >&5
2764
2765 ac_retval=1
2766fi
d0ac1c44
SM
2767 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2768 as_fn_set_status $ac_retval
c971b7fa
PA
2769
2770} # ac_fn_c_try_compile
2771
9c9d63b1
PM
2772# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
2773# -------------------------------------------------------
2774# Tests whether HEADER exists and can be compiled using the include files in
2775# INCLUDES, setting the cache variable VAR accordingly.
2776ac_fn_c_check_header_compile ()
2777{
2778 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2780$as_echo_n "checking for $2... " >&6; }
2781if eval \${$3+:} false; then :
2782 $as_echo_n "(cached) " >&6
2783else
2784 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2785/* end confdefs.h. */
2786$4
2787#include <$2>
2788_ACEOF
2789if ac_fn_c_try_compile "$LINENO"; then :
2790 eval "$3=yes"
2791else
2792 eval "$3=no"
2793fi
2794rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2795fi
2796eval ac_res=\$$3
2797 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2798$as_echo "$ac_res" >&6; }
2799 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2800
2801} # ac_fn_c_check_header_compile
2802
c971b7fa
PA
2803# ac_fn_c_try_cpp LINENO
2804# ----------------------
2805# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
2806ac_fn_c_try_cpp ()
2807{
2808 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2809 if { { ac_try="$ac_cpp conftest.$ac_ext"
2810case "(($ac_try" in
2811 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2812 *) ac_try_echo=$ac_try;;
2813esac
2814eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2815$as_echo "$ac_try_echo"; } >&5
2816 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
2817 ac_status=$?
2818 if test -s conftest.err; then
2819 grep -v '^ *+' conftest.err >conftest.er1
2820 cat conftest.er1 >&5
2821 mv -f conftest.er1 conftest.err
2822 fi
2823 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
d0ac1c44 2824 test $ac_status = 0; } > conftest.i && {
c971b7fa
PA
2825 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
2826 test ! -s conftest.err
2827 }; then :
2828 ac_retval=0
2829else
2830 $as_echo "$as_me: failed program was:" >&5
2831sed 's/^/| /' conftest.$ac_ext >&5
2832
2833 ac_retval=1
2834fi
d0ac1c44
SM
2835 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2836 as_fn_set_status $ac_retval
c971b7fa
PA
2837
2838} # ac_fn_c_try_cpp
2839
c971b7fa
PA
2840# ac_fn_c_try_run LINENO
2841# ----------------------
2842# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
2843# that executables *can* be run.
2844ac_fn_c_try_run ()
2845{
2846 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2847 if { { ac_try="$ac_link"
2848case "(($ac_try" in
2849 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2850 *) ac_try_echo=$ac_try;;
2851esac
2852eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2853$as_echo "$ac_try_echo"; } >&5
2854 (eval "$ac_link") 2>&5
2855 ac_status=$?
2856 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2857 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
2858 { { case "(($ac_try" in
2859 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2860 *) ac_try_echo=$ac_try;;
2861esac
2862eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2863$as_echo "$ac_try_echo"; } >&5
2864 (eval "$ac_try") 2>&5
2865 ac_status=$?
2866 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2867 test $ac_status = 0; }; }; then :
2868 ac_retval=0
2869else
2870 $as_echo "$as_me: program exited with status $ac_status" >&5
2871 $as_echo "$as_me: failed program was:" >&5
2872sed 's/^/| /' conftest.$ac_ext >&5
2873
2874 ac_retval=$ac_status
2875fi
2876 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
d0ac1c44
SM
2877 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2878 as_fn_set_status $ac_retval
c971b7fa
PA
2879
2880} # ac_fn_c_try_run
2881
73cc7272
TT
2882# ac_fn_c_try_link LINENO
2883# -----------------------
2884# Try to link conftest.$ac_ext, and return whether this succeeded.
2885ac_fn_c_try_link ()
2886{
2887 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2888 rm -f conftest.$ac_objext conftest$ac_exeext
2889 if { { ac_try="$ac_link"
2890case "(($ac_try" in
2891 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2892 *) ac_try_echo=$ac_try;;
2893esac
2894eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2895$as_echo "$ac_try_echo"; } >&5
2896 (eval "$ac_link") 2>conftest.err
2897 ac_status=$?
2898 if test -s conftest.err; then
2899 grep -v '^ *+' conftest.err >conftest.er1
2900 cat conftest.er1 >&5
2901 mv -f conftest.er1 conftest.err
2902 fi
2903 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2904 test $ac_status = 0; } && {
2905 test -z "$ac_c_werror_flag" ||
2906 test ! -s conftest.err
2907 } && test -s conftest$ac_exeext && {
2908 test "$cross_compiling" = yes ||
2909 test -x conftest$ac_exeext
2910 }; then :
2911 ac_retval=0
2912else
2913 $as_echo "$as_me: failed program was:" >&5
2914sed 's/^/| /' conftest.$ac_ext >&5
2915
2916 ac_retval=1
2917fi
2918 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2919 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2920 # interfere with the next link command; also delete a directory that is
2921 # left behind by Apple's compiler. We do this before executing the actions.
2922 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2923 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2924 as_fn_set_status $ac_retval
2925
2926} # ac_fn_c_try_link
2927
d0ac1c44
SM
2928# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2929# -------------------------------------------
2930# Tests whether TYPE exists after having included INCLUDES, setting cache
2931# variable VAR accordingly.
2932ac_fn_c_check_type ()
2933{
2934 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2935 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2936$as_echo_n "checking for $2... " >&6; }
2937if eval \${$3+:} false; then :
2938 $as_echo_n "(cached) " >&6
2939else
2940 eval "$3=no"
2941 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2942/* end confdefs.h. */
2943$4
2944int
2945main ()
2946{
2947if (sizeof ($2))
2948 return 0;
2949 ;
2950 return 0;
2951}
2952_ACEOF
2953if ac_fn_c_try_compile "$LINENO"; then :
2954 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2955/* end confdefs.h. */
2956$4
2957int
2958main ()
2959{
2960if (sizeof (($2)))
2961 return 0;
2962 ;
2963 return 0;
2964}
2965_ACEOF
2966if ac_fn_c_try_compile "$LINENO"; then :
2967
2968else
2969 eval "$3=yes"
2970fi
2971rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2972fi
2973rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2974fi
2975eval ac_res=\$$3
2976 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2977$as_echo "$ac_res" >&6; }
2978 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2979
2980} # ac_fn_c_check_type
2981
9c9d63b1
PM
2982# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
2983# -------------------------------------------------------
2984# Tests whether HEADER exists, giving a warning if it cannot be compiled using
2985# the include files in INCLUDES and setting the cache variable VAR
2986# accordingly.
2987ac_fn_c_check_header_mongrel ()
2988{
2989 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2990 if eval \${$3+:} false; then :
2991 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2992$as_echo_n "checking for $2... " >&6; }
2993if eval \${$3+:} false; then :
2994 $as_echo_n "(cached) " >&6
2995fi
2996eval ac_res=\$$3
2997 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2998$as_echo "$ac_res" >&6; }
2999else
3000 # Is the header compilable?
3001{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
3002$as_echo_n "checking $2 usability... " >&6; }
3003cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3004/* end confdefs.h. */
3005$4
3006#include <$2>
3007_ACEOF
3008if ac_fn_c_try_compile "$LINENO"; then :
3009 ac_header_compiler=yes
3010else
3011 ac_header_compiler=no
3012fi
3013rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
3015$as_echo "$ac_header_compiler" >&6; }
3016
3017# Is the header present?
3018{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
3019$as_echo_n "checking $2 presence... " >&6; }
3020cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3021/* end confdefs.h. */
3022#include <$2>
3023_ACEOF
3024if ac_fn_c_try_cpp "$LINENO"; then :
3025 ac_header_preproc=yes
3026else
3027 ac_header_preproc=no
3028fi
3029rm -f conftest.err conftest.i conftest.$ac_ext
3030{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
3031$as_echo "$ac_header_preproc" >&6; }
3032
3033# So? What about this header?
3034case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
3035 yes:no: )
3036 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
3037$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
3038 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
3039$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
3040 ;;
3041 no:yes:* )
3042 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
3043$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
3044 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
3045$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
3046 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
3047$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
3048 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
3049$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
3050 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
3051$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
3052 ;;
3053esac
3054 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
3055$as_echo_n "checking for $2... " >&6; }
3056if eval \${$3+:} false; then :
3057 $as_echo_n "(cached) " >&6
3058else
3059 eval "$3=\$ac_header_compiler"
3060fi
3061eval ac_res=\$$3
3062 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3063$as_echo "$ac_res" >&6; }
3064fi
3065 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3066
3067} # ac_fn_c_check_header_mongrel
3068
8690e634
JK
3069# ac_fn_c_check_func LINENO FUNC VAR
3070# ----------------------------------
3071# Tests whether FUNC exists, setting the cache variable VAR accordingly
3072ac_fn_c_check_func ()
3073{
3074 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3075 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
3076$as_echo_n "checking for $2... " >&6; }
d0ac1c44 3077if eval \${$3+:} false; then :
8690e634
JK
3078 $as_echo_n "(cached) " >&6
3079else
3080 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3081/* end confdefs.h. */
3082/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
3083 For example, HP-UX 11i <limits.h> declares gettimeofday. */
3084#define $2 innocuous_$2
3085
3086/* System header to define __stub macros and hopefully few prototypes,
3087 which can conflict with char $2 (); below.
3088 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3089 <limits.h> exists even on freestanding compilers. */
3090
3091#ifdef __STDC__
3092# include <limits.h>
3093#else
3094# include <assert.h>
3095#endif
3096
3097#undef $2
3098
3099/* Override any GCC internal prototype to avoid an error.
3100 Use char because int might match the return type of a GCC
3101 builtin and then its argument prototype would still apply. */
3102#ifdef __cplusplus
3103extern "C"
3104#endif
3105char $2 ();
3106/* The GNU C library defines this for functions which it implements
3107 to always fail with ENOSYS. Some functions are actually named
3108 something starting with __ and the normal name is an alias. */
3109#if defined __stub_$2 || defined __stub___$2
3110choke me
3111#endif
3112
3113int
3114main ()
3115{
3116return $2 ();
3117 ;
3118 return 0;
3119}
3120_ACEOF
3121if ac_fn_c_try_link "$LINENO"; then :
3122 eval "$3=yes"
3123else
3124 eval "$3=no"
3125fi
3126rm -f core conftest.err conftest.$ac_objext \
3127 conftest$ac_exeext conftest.$ac_ext
3128fi
3129eval ac_res=\$$3
3130 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3131$as_echo "$ac_res" >&6; }
d0ac1c44 3132 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
8690e634
JK
3133
3134} # ac_fn_c_check_func
3135
d0ac1c44
SM
3136# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
3137# ---------------------------------------------
3138# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
3139# accordingly.
8986e351
TT
3140ac_fn_c_check_decl ()
3141{
5df4cba6
SM
3142 ac_save_ac_compile="$ac_compile"
3143 if test -n "$ac_compile_for_check_decl"; then
3144 ac_compile="$ac_compile_for_check_decl"
3145 fi
8986e351 3146 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
d0ac1c44
SM
3147 as_decl_name=`echo $2|sed 's/ *(.*//'`
3148 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
3149 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
3150$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
3151if eval \${$3+:} false; then :
8986e351
TT
3152 $as_echo_n "(cached) " >&6
3153else
3154 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3155/* end confdefs.h. */
3156$4
3157int
3158main ()
3159{
d0ac1c44
SM
3160#ifndef $as_decl_name
3161#ifdef __cplusplus
3162 (void) $as_decl_use;
3163#else
3164 (void) $as_decl_name;
3165#endif
8986e351
TT
3166#endif
3167
3168 ;
3169 return 0;
3170}
3171_ACEOF
3172if ac_fn_c_try_compile "$LINENO"; then :
3173 eval "$3=yes"
3174else
3175 eval "$3=no"
3176fi
3177rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3178fi
3179eval ac_res=\$$3
3180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3181$as_echo "$ac_res" >&6; }
d0ac1c44 3182 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
5df4cba6 3183 ac_compile="$ac_save_ac_compile"
8986e351
TT
3184
3185} # ac_fn_c_check_decl
3186
c971b7fa
PA
3187# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
3188# --------------------------------------------
3189# Tries to find the compile-time value of EXPR in a program that includes
3190# INCLUDES, setting VAR accordingly. Returns whether the value could be
3191# computed
3192ac_fn_c_compute_int ()
3193{
3194 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3195 if test "$cross_compiling" = yes; then
3196 # Depending upon the size, compute the lo and hi bounds.
3197cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3198/* end confdefs.h. */
3199$4
3200int
3201main ()
3202{
3203static int test_array [1 - 2 * !(($2) >= 0)];
d0ac1c44
SM
3204test_array [0] = 0;
3205return test_array [0];
c971b7fa
PA
3206
3207 ;
3208 return 0;
3209}
3210_ACEOF
3211if ac_fn_c_try_compile "$LINENO"; then :
3212 ac_lo=0 ac_mid=0
3213 while :; do
3214 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3215/* end confdefs.h. */
3216$4
3217int
3218main ()
3219{
3220static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3221test_array [0] = 0;
3222return test_array [0];
c971b7fa
PA
3223
3224 ;
3225 return 0;
3226}
3227_ACEOF
3228if ac_fn_c_try_compile "$LINENO"; then :
3229 ac_hi=$ac_mid; break
3230else
3231 as_fn_arith $ac_mid + 1 && ac_lo=$as_val
3232 if test $ac_lo -le $ac_mid; then
3233 ac_lo= ac_hi=
3234 break
3235 fi
3236 as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
3237fi
3238rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3239 done
3240else
3241 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3242/* end confdefs.h. */
3243$4
3244int
3245main ()
3246{
3247static int test_array [1 - 2 * !(($2) < 0)];
d0ac1c44
SM
3248test_array [0] = 0;
3249return test_array [0];
c971b7fa
PA
3250
3251 ;
3252 return 0;
3253}
3254_ACEOF
3255if ac_fn_c_try_compile "$LINENO"; then :
3256 ac_hi=-1 ac_mid=-1
3257 while :; do
3258 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3259/* end confdefs.h. */
3260$4
3261int
3262main ()
3263{
3264static int test_array [1 - 2 * !(($2) >= $ac_mid)];
d0ac1c44
SM
3265test_array [0] = 0;
3266return test_array [0];
c971b7fa
PA
3267
3268 ;
3269 return 0;
3270}
3271_ACEOF
3272if ac_fn_c_try_compile "$LINENO"; then :
3273 ac_lo=$ac_mid; break
3274else
3275 as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
3276 if test $ac_mid -le $ac_hi; then
3277 ac_lo= ac_hi=
3278 break
3279 fi
3280 as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
3281fi
3282rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3283 done
3284else
3285 ac_lo= ac_hi=
3286fi
3287rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3288fi
3289rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3290# Binary search between lo and hi bounds.
3291while test "x$ac_lo" != "x$ac_hi"; do
3292 as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
3293 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3294/* end confdefs.h. */
3295$4
3296int
3297main ()
3298{
3299static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3300test_array [0] = 0;
3301return test_array [0];
c971b7fa
PA
3302
3303 ;
3304 return 0;
3305}
3306_ACEOF
3307if ac_fn_c_try_compile "$LINENO"; then :
3308 ac_hi=$ac_mid
3309else
3310 as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
3311fi
3312rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3313done
3314case $ac_lo in #((
3315?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
3316'') ac_retval=1 ;;
3317esac
3318 else
3319 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3320/* end confdefs.h. */
3321$4
3322static long int longval () { return $2; }
3323static unsigned long int ulongval () { return $2; }
3324#include <stdio.h>
3325#include <stdlib.h>
3326int
3327main ()
3328{
3329
3330 FILE *f = fopen ("conftest.val", "w");
3331 if (! f)
3332 return 1;
3333 if (($2) < 0)
3334 {
3335 long int i = longval ();
3336 if (i != ($2))
3337 return 1;
3338 fprintf (f, "%ld", i);
3339 }
3340 else
3341 {
3342 unsigned long int i = ulongval ();
3343 if (i != ($2))
3344 return 1;
3345 fprintf (f, "%lu", i);
3346 }
3347 /* Do not output a trailing newline, as this causes \r\n confusion
3348 on some platforms. */
3349 return ferror (f) || fclose (f) != 0;
3350
3351 ;
3352 return 0;
3353}
3354_ACEOF
3355if ac_fn_c_try_run "$LINENO"; then :
3356 echo >>conftest.val; read $3 <conftest.val; ac_retval=0
3357else
3358 ac_retval=1
3359fi
3360rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3361 conftest.$ac_objext conftest.beam conftest.$ac_ext
3362rm -f conftest.val
3363
3364 fi
d0ac1c44
SM
3365 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3366 as_fn_set_status $ac_retval
c971b7fa
PA
3367
3368} # ac_fn_c_compute_int
725e2999
JB
3369
3370# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
3371# ----------------------------------------------------
3372# Tries to find if the field MEMBER exists in type AGGR, after including
3373# INCLUDES, setting cache variable VAR accordingly.
3374ac_fn_c_check_member ()
3375{
3376 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3377 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
3378$as_echo_n "checking for $2.$3... " >&6; }
3379if eval \${$4+:} false; then :
3380 $as_echo_n "(cached) " >&6
3381else
3382 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3383/* end confdefs.h. */
3384$5
3385int
3386main ()
3387{
3388static $2 ac_aggr;
3389if (ac_aggr.$3)
3390return 0;
3391 ;
3392 return 0;
3393}
3394_ACEOF
3395if ac_fn_c_try_compile "$LINENO"; then :
3396 eval "$4=yes"
3397else
3398 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3399/* end confdefs.h. */
3400$5
3401int
3402main ()
3403{
3404static $2 ac_aggr;
3405if (sizeof ac_aggr.$3)
3406return 0;
3407 ;
3408 return 0;
3409}
3410_ACEOF
3411if ac_fn_c_try_compile "$LINENO"; then :
3412 eval "$4=yes"
3413else
3414 eval "$4=no"
3415fi
3416rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3417fi
3418rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3419fi
3420eval ac_res=\$$4
3421 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3422$as_echo "$ac_res" >&6; }
3423 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3424
3425} # ac_fn_c_check_member
c971b7fa
PA
3426cat >config.log <<_ACEOF
3427This file contains any messages produced by compilers while
3428running configure, to aid debugging if configure makes a mistake.
3429
d0ac1c44
SM
3430It was created by libgnu $as_me UNUSED-VERSION, which was
3431generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
3432
3433 $ $0 $@
3434
3435_ACEOF
3436exec 5>>config.log
3437{
3438cat <<_ASUNAME
3439## --------- ##
3440## Platform. ##
3441## --------- ##
3442
3443hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
3444uname -m = `(uname -m) 2>/dev/null || echo unknown`
3445uname -r = `(uname -r) 2>/dev/null || echo unknown`
3446uname -s = `(uname -s) 2>/dev/null || echo unknown`
3447uname -v = `(uname -v) 2>/dev/null || echo unknown`
3448
3449/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
3450/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
3451
3452/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
3453/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
3454/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
3455/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
3456/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
3457/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
3458/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
3459
3460_ASUNAME
3461
3462as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3463for as_dir in $PATH
3464do
3465 IFS=$as_save_IFS
3466 test -z "$as_dir" && as_dir=.
3467 $as_echo "PATH: $as_dir"
3468 done
3469IFS=$as_save_IFS
3470
3471} >&5
3472
3473cat >&5 <<_ACEOF
3474
3475
3476## ----------- ##
3477## Core tests. ##
3478## ----------- ##
3479
3480_ACEOF
3481
3482
3483# Keep a trace of the command line.
3484# Strip out --no-create and --no-recursion so they do not pile up.
3485# Strip out --silent because we don't want to record it for future runs.
3486# Also quote any args containing shell meta-characters.
3487# Make two passes to allow for proper duplicate-argument suppression.
3488ac_configure_args=
3489ac_configure_args0=
3490ac_configure_args1=
3491ac_must_keep_next=false
3492for ac_pass in 1 2
3493do
3494 for ac_arg
3495 do
3496 case $ac_arg in
3497 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
3498 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
3499 | -silent | --silent | --silen | --sile | --sil)
3500 continue ;;
3501 *\'*)
3502 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
3503 esac
3504 case $ac_pass in
3505 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
3506 2)
3507 as_fn_append ac_configure_args1 " '$ac_arg'"
3508 if test $ac_must_keep_next = true; then
3509 ac_must_keep_next=false # Got value, back to normal.
3510 else
3511 case $ac_arg in
3512 *=* | --config-cache | -C | -disable-* | --disable-* \
3513 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
3514 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
3515 | -with-* | --with-* | -without-* | --without-* | --x)
3516 case "$ac_configure_args0 " in
3517 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
3518 esac
3519 ;;
3520 -* ) ac_must_keep_next=true ;;
3521 esac
3522 fi
3523 as_fn_append ac_configure_args " '$ac_arg'"
3524 ;;
3525 esac
3526 done
3527done
3528{ ac_configure_args0=; unset ac_configure_args0;}
3529{ ac_configure_args1=; unset ac_configure_args1;}
3530
3531# When interrupted or exit'd, cleanup temporary files, and complete
3532# config.log. We remove comments because anyway the quotes in there
3533# would cause problems or look ugly.
3534# WARNING: Use '\'' to represent an apostrophe within the trap.
3535# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
3536trap 'exit_status=$?
3537 # Save into config.log some information that might help in debugging.
3538 {
3539 echo
3540
d0ac1c44 3541 $as_echo "## ---------------- ##
c971b7fa 3542## Cache variables. ##
d0ac1c44 3543## ---------------- ##"
c971b7fa
PA
3544 echo
3545 # The following way of writing the cache mishandles newlines in values,
3546(
3547 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
3548 eval ac_val=\$$ac_var
3549 case $ac_val in #(
3550 *${as_nl}*)
3551 case $ac_var in #(
3552 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
3553$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
3554 esac
3555 case $ac_var in #(
3556 _ | IFS | as_nl) ;; #(
3557 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
3558 *) { eval $ac_var=; unset $ac_var;} ;;
3559 esac ;;
3560 esac
3561 done
3562 (set) 2>&1 |
3563 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
3564 *${as_nl}ac_space=\ *)
3565 sed -n \
3566 "s/'\''/'\''\\\\'\'''\''/g;
3567 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
3568 ;; #(
3569 *)
3570 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
3571 ;;
3572 esac |
3573 sort
3574)
3575 echo
3576
d0ac1c44 3577 $as_echo "## ----------------- ##
c971b7fa 3578## Output variables. ##
d0ac1c44 3579## ----------------- ##"
c971b7fa
PA
3580 echo
3581 for ac_var in $ac_subst_vars
3582 do
3583 eval ac_val=\$$ac_var
3584 case $ac_val in
3585 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3586 esac
3587 $as_echo "$ac_var='\''$ac_val'\''"
3588 done | sort
3589 echo
3590
3591 if test -n "$ac_subst_files"; then
d0ac1c44 3592 $as_echo "## ------------------- ##
c971b7fa 3593## File substitutions. ##
d0ac1c44 3594## ------------------- ##"
c971b7fa
PA
3595 echo
3596 for ac_var in $ac_subst_files
3597 do
3598 eval ac_val=\$$ac_var
3599 case $ac_val in
3600 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3601 esac
3602 $as_echo "$ac_var='\''$ac_val'\''"
3603 done | sort
3604 echo
3605 fi
3606
3607 if test -s confdefs.h; then
d0ac1c44 3608 $as_echo "## ----------- ##
c971b7fa 3609## confdefs.h. ##
d0ac1c44 3610## ----------- ##"
c971b7fa
PA
3611 echo
3612 cat confdefs.h
3613 echo
3614 fi
3615 test "$ac_signal" != 0 &&
3616 $as_echo "$as_me: caught signal $ac_signal"
3617 $as_echo "$as_me: exit $exit_status"
3618 } >&5
3619 rm -f core *.core core.conftest.* &&
3620 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
3621 exit $exit_status
3622' 0
3623for ac_signal in 1 2 13 15; do
3624 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
3625done
3626ac_signal=0
3627
3628# confdefs.h avoids OS command line length limits that DEFS can exceed.
3629rm -f -r conftest* confdefs.h
3630
3631$as_echo "/* confdefs.h */" > confdefs.h
3632
3633# Predefined preprocessor variables.
3634
3635cat >>confdefs.h <<_ACEOF
3636#define PACKAGE_NAME "$PACKAGE_NAME"
3637_ACEOF
3638
3639cat >>confdefs.h <<_ACEOF
3640#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
3641_ACEOF
3642
3643cat >>confdefs.h <<_ACEOF
3644#define PACKAGE_VERSION "$PACKAGE_VERSION"
3645_ACEOF
3646
3647cat >>confdefs.h <<_ACEOF
3648#define PACKAGE_STRING "$PACKAGE_STRING"
3649_ACEOF
3650
3651cat >>confdefs.h <<_ACEOF
3652#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
3653_ACEOF
3654
3655cat >>confdefs.h <<_ACEOF
3656#define PACKAGE_URL "$PACKAGE_URL"
3657_ACEOF
3658
3659
3660# Let the site file select an alternate cache file if it wants to.
3661# Prefer an explicitly selected file to automatically selected ones.
3662ac_site_file1=NONE
3663ac_site_file2=NONE
3664if test -n "$CONFIG_SITE"; then
d0ac1c44
SM
3665 # We do not want a PATH search for config.site.
3666 case $CONFIG_SITE in #((
3667 -*) ac_site_file1=./$CONFIG_SITE;;
3668 */*) ac_site_file1=$CONFIG_SITE;;
3669 *) ac_site_file1=./$CONFIG_SITE;;
3670 esac
c971b7fa
PA
3671elif test "x$prefix" != xNONE; then
3672 ac_site_file1=$prefix/share/config.site
3673 ac_site_file2=$prefix/etc/config.site
3674else
3675 ac_site_file1=$ac_default_prefix/share/config.site
3676 ac_site_file2=$ac_default_prefix/etc/config.site
3677fi
3678for ac_site_file in "$ac_site_file1" "$ac_site_file2"
3679do
3680 test "x$ac_site_file" = xNONE && continue
d0ac1c44 3681 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
c971b7fa
PA
3682 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
3683$as_echo "$as_me: loading site script $ac_site_file" >&6;}
3684 sed 's/^/| /' "$ac_site_file" >&5
d0ac1c44
SM
3685 . "$ac_site_file" \
3686 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3687$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3688as_fn_error $? "failed to load site script $ac_site_file
3689See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
3690 fi
3691done
3692
3693if test -r "$cache_file"; then
d0ac1c44
SM
3694 # Some versions of bash will fail to source /dev/null (special files
3695 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
3696 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
c971b7fa
PA
3697 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
3698$as_echo "$as_me: loading cache $cache_file" >&6;}
3699 case $cache_file in
3700 [\\/]* | ?:[\\/]* ) . "$cache_file";;
3701 *) . "./$cache_file";;
3702 esac
3703 fi
3704else
3705 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
3706$as_echo "$as_me: creating cache $cache_file" >&6;}
3707 >$cache_file
3708fi
3709
9c9d63b1
PM
3710as_fn_append ac_header_list " wchar.h"
3711as_fn_append ac_header_list " minix/config.h"
c0c3707f
CB
3712as_fn_append ac_header_list " arpa/inet.h"
3713as_fn_append ac_header_list " features.h"
3714as_fn_append ac_header_list " sys/socket.h"
698be2d8 3715as_fn_append ac_func_list " btowc"
c0c3707f 3716as_fn_append ac_func_list " canonicalize_file_name"
9c9d63b1 3717as_fn_append ac_func_list " faccessat"
c0c3707f
CB
3718as_fn_append ac_func_list " realpath"
3719as_fn_append ac_header_list " sys/param.h"
3720as_fn_append ac_header_list " unistd.h"
3721as_fn_append ac_func_list " _set_invalid_parameter_handler"
3722as_fn_append ac_func_list " fchdir"
3723as_fn_append ac_header_list " dirent.h"
3724as_fn_append ac_func_list " fcntl"
3725as_fn_append ac_func_list " symlink"
3726as_fn_append ac_func_list " fdopendir"
3727as_fn_append ac_func_list " mempcpy"
3728as_fn_append ac_header_list " fnmatch.h"
3729as_fn_append ac_func_list " fnmatch"
c0c3707f 3730as_fn_append ac_func_list " mbsrtowcs"
8690e634 3731gl_fnmatch_required=GNU
c0c3707f
CB
3732as_fn_append ac_header_list " sys/stat.h"
3733as_fn_append ac_func_list " fstatat"
c17253b9 3734as_fn_append ac_func_list " getdelim"
c0c3707f
CB
3735as_fn_append ac_func_list " getdtablesize"
3736as_fn_append ac_func_list " getlogin_r"
3737as_fn_append ac_func_list " getprogname"
3738as_fn_append ac_func_list " getexecname"
698be2d8 3739as_fn_append ac_func_list " getrandom"
c0c3707f
CB
3740as_fn_append ac_header_list " sys/time.h"
3741as_fn_append ac_func_list " gettimeofday"
3742as_fn_append ac_header_list " glob.h"
3743as_fn_append ac_func_list " glob"
3744as_fn_append ac_func_list " glob_pattern_p"
3745as_fn_append ac_func_list " getpwnam_r"
5df4cba6 3746as_fn_append ac_header_list " threads.h"
c0c3707f
CB
3747as_fn_append ac_header_list " netdb.h"
3748as_fn_append ac_header_list " netinet/in.h"
3749as_fn_append ac_header_list " limits.h"
c0c3707f 3750as_fn_append ac_header_list " inttypes.h"
9c9d63b1
PM
3751as_fn_append ac_header_list " sys/types.h"
3752as_fn_append ac_header_list " stdint.h"
698be2d8 3753as_fn_append ac_func_list " isblank"
5df4cba6 3754as_fn_append ac_header_list " xlocale.h"
c0c3707f
CB
3755as_fn_append ac_func_list " lstat"
3756as_fn_append ac_header_list " math.h"
3757as_fn_append ac_func_list " mbsinit"
3758as_fn_append ac_func_list " mbrtowc"
3759as_fn_append ac_header_list " sys/mman.h"
3760as_fn_append ac_func_list " mprotect"
3761as_fn_append ac_func_list " mkostemp"
3762as_fn_append ac_func_list " openat"
9c9d63b1
PM
3763as_fn_append ac_func_list " pipe"
3764as_fn_append ac_func_list " readlink"
c0c3707f
CB
3765as_fn_append ac_func_list " link"
3766as_fn_append ac_func_list " setenv"
c0c3707f
CB
3767as_fn_append ac_func_list " strerror_r"
3768as_fn_append ac_func_list " __xpg_strerror_r"
3769as_fn_append ac_func_list " catgets"
3770as_fn_append ac_func_list " snprintf"
698be2d8 3771as_fn_append ac_header_list " sys/random.h"
c0c3707f
CB
3772as_fn_append ac_header_list " sys/uio.h"
3773as_fn_append ac_func_list " localtime_r"
c0c3707f
CB
3774as_fn_append ac_header_list " crtdefs.h"
3775as_fn_append ac_func_list " iswcntrl"
698be2d8
CB
3776as_fn_append ac_header_list " wctype.h"
3777as_fn_append ac_func_list " wmempcpy"
c971b7fa
PA
3778# Check that the precious variables saved in the cache have kept the same
3779# value.
3780ac_cache_corrupted=false
3781for ac_var in $ac_precious_vars; do
3782 eval ac_old_set=\$ac_cv_env_${ac_var}_set
3783 eval ac_new_set=\$ac_env_${ac_var}_set
3784 eval ac_old_val=\$ac_cv_env_${ac_var}_value
3785 eval ac_new_val=\$ac_env_${ac_var}_value
3786 case $ac_old_set,$ac_new_set in
3787 set,)
3788 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
3789$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
3790 ac_cache_corrupted=: ;;
3791 ,set)
3792 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
3793$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
3794 ac_cache_corrupted=: ;;
3795 ,);;
3796 *)
3797 if test "x$ac_old_val" != "x$ac_new_val"; then
3798 # differences in whitespace do not lead to failure.
3799 ac_old_val_w=`echo x $ac_old_val`
3800 ac_new_val_w=`echo x $ac_new_val`
3801 if test "$ac_old_val_w" != "$ac_new_val_w"; then
3802 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
3803$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
3804 ac_cache_corrupted=:
3805 else
3806 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
3807$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
3808 eval $ac_var=\$ac_old_val
3809 fi
3810 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
3811$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
3812 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
3813$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
3814 fi;;
3815 esac
3816 # Pass precious variables to config.status.
3817 if test "$ac_new_set" = set; then
3818 case $ac_new_val in
3819 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
3820 *) ac_arg=$ac_var=$ac_new_val ;;
3821 esac
3822 case " $ac_configure_args " in
3823 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
3824 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
3825 esac
3826 fi
3827done
3828if $ac_cache_corrupted; then
3829 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3830$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3831 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
3832$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
d0ac1c44 3833 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
c971b7fa
PA
3834fi
3835## -------------------- ##
3836## Main body of script. ##
3837## -------------------- ##
3838
3839ac_ext=c
3840ac_cpp='$CPP $CPPFLAGS'
3841ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3842ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3843ac_compiler_gnu=$ac_cv_c_compiler_gnu
3844
3845
d0ac1c44 3846
73cc7272
TT
3847
3848
3849
c971b7fa
PA
3850ac_config_headers="$ac_config_headers config.h:config.in"
3851
3852
5abebf3c
CB
3853
3854
c971b7fa
PA
3855{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
3856$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
3857 # Check whether --enable-maintainer-mode was given.
3858if test "${enable_maintainer_mode+set}" = set; then :
3859 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
3860else
3861 USE_MAINTAINER_MODE=no
3862fi
3863
3864 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
3865$as_echo "$USE_MAINTAINER_MODE" >&6; }
3866 if test $USE_MAINTAINER_MODE = yes; then
3867 MAINTAINER_MODE_TRUE=
3868 MAINTAINER_MODE_FALSE='#'
3869else
3870 MAINTAINER_MODE_TRUE='#'
3871 MAINTAINER_MODE_FALSE=
3872fi
3873
3874 MAINT=$MAINTAINER_MODE_TRUE
3875
3876
3877
3878ac_ext=c
3879ac_cpp='$CPP $CPPFLAGS'
3880ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3881ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3882ac_compiler_gnu=$ac_cv_c_compiler_gnu
3883if test -n "$ac_tool_prefix"; then
3884 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3885set dummy ${ac_tool_prefix}gcc; ac_word=$2
3886{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3887$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3888if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3889 $as_echo_n "(cached) " >&6
3890else
3891 if test -n "$CC"; then
3892 ac_cv_prog_CC="$CC" # Let the user override the test.
3893else
3894as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3895for as_dir in $PATH
3896do
3897 IFS=$as_save_IFS
3898 test -z "$as_dir" && as_dir=.
3899 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3900 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3901 ac_cv_prog_CC="${ac_tool_prefix}gcc"
3902 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3903 break 2
3904 fi
3905done
3906 done
3907IFS=$as_save_IFS
3908
3909fi
3910fi
3911CC=$ac_cv_prog_CC
3912if test -n "$CC"; then
3913 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3914$as_echo "$CC" >&6; }
3915else
3916 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3917$as_echo "no" >&6; }
3918fi
3919
3920
3921fi
3922if test -z "$ac_cv_prog_CC"; then
3923 ac_ct_CC=$CC
3924 # Extract the first word of "gcc", so it can be a program name with args.
3925set dummy gcc; ac_word=$2
3926{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3927$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3928if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
3929 $as_echo_n "(cached) " >&6
3930else
3931 if test -n "$ac_ct_CC"; then
3932 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3933else
3934as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3935for as_dir in $PATH
3936do
3937 IFS=$as_save_IFS
3938 test -z "$as_dir" && as_dir=.
3939 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3940 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3941 ac_cv_prog_ac_ct_CC="gcc"
3942 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3943 break 2
3944 fi
3945done
3946 done
3947IFS=$as_save_IFS
3948
3949fi
3950fi
3951ac_ct_CC=$ac_cv_prog_ac_ct_CC
3952if test -n "$ac_ct_CC"; then
3953 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3954$as_echo "$ac_ct_CC" >&6; }
3955else
3956 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3957$as_echo "no" >&6; }
3958fi
3959
3960 if test "x$ac_ct_CC" = x; then
3961 CC=""
3962 else
3963 case $cross_compiling:$ac_tool_warned in
3964yes:)
3965{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3966$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3967ac_tool_warned=yes ;;
3968esac
3969 CC=$ac_ct_CC
3970 fi
3971else
3972 CC="$ac_cv_prog_CC"
3973fi
3974
3975if test -z "$CC"; then
3976 if test -n "$ac_tool_prefix"; then
3977 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3978set dummy ${ac_tool_prefix}cc; ac_word=$2
3979{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3980$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3981if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3982 $as_echo_n "(cached) " >&6
3983else
3984 if test -n "$CC"; then
3985 ac_cv_prog_CC="$CC" # Let the user override the test.
3986else
3987as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3988for as_dir in $PATH
3989do
3990 IFS=$as_save_IFS
3991 test -z "$as_dir" && as_dir=.
3992 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3993 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3994 ac_cv_prog_CC="${ac_tool_prefix}cc"
3995 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3996 break 2
3997 fi
3998done
3999 done
4000IFS=$as_save_IFS
4001
4002fi
4003fi
4004CC=$ac_cv_prog_CC
4005if test -n "$CC"; then
4006 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4007$as_echo "$CC" >&6; }
4008else
4009 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4010$as_echo "no" >&6; }
4011fi
4012
4013
4014 fi
4015fi
4016if test -z "$CC"; then
4017 # Extract the first word of "cc", so it can be a program name with args.
4018set dummy cc; ac_word=$2
4019{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4020$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4021if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
4022 $as_echo_n "(cached) " >&6
4023else
4024 if test -n "$CC"; then
4025 ac_cv_prog_CC="$CC" # Let the user override the test.
4026else
4027 ac_prog_rejected=no
4028as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4029for as_dir in $PATH
4030do
4031 IFS=$as_save_IFS
4032 test -z "$as_dir" && as_dir=.
4033 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4034 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4035 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
4036 ac_prog_rejected=yes
4037 continue
4038 fi
4039 ac_cv_prog_CC="cc"
4040 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4041 break 2
4042 fi
4043done
4044 done
4045IFS=$as_save_IFS
4046
4047if test $ac_prog_rejected = yes; then
4048 # We found a bogon in the path, so make sure we never use it.
4049 set dummy $ac_cv_prog_CC
4050 shift
4051 if test $# != 0; then
4052 # We chose a different compiler from the bogus one.
4053 # However, it has the same basename, so the bogon will be chosen
4054 # first if we set CC to just the basename; use the full file name.
4055 shift
4056 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
4057 fi
4058fi
4059fi
4060fi
4061CC=$ac_cv_prog_CC
4062if test -n "$CC"; then
4063 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4064$as_echo "$CC" >&6; }
4065else
4066 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4067$as_echo "no" >&6; }
4068fi
4069
4070
4071fi
4072if test -z "$CC"; then
4073 if test -n "$ac_tool_prefix"; then
4074 for ac_prog in cl.exe
4075 do
4076 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4077set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4078{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4079$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4080if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
4081 $as_echo_n "(cached) " >&6
4082else
4083 if test -n "$CC"; then
4084 ac_cv_prog_CC="$CC" # Let the user override the test.
4085else
4086as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4087for as_dir in $PATH
4088do
4089 IFS=$as_save_IFS
4090 test -z "$as_dir" && as_dir=.
4091 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4092 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4093 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
4094 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4095 break 2
4096 fi
4097done
4098 done
4099IFS=$as_save_IFS
4100
4101fi
4102fi
4103CC=$ac_cv_prog_CC
4104if test -n "$CC"; then
4105 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4106$as_echo "$CC" >&6; }
4107else
4108 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4109$as_echo "no" >&6; }
4110fi
4111
4112
4113 test -n "$CC" && break
4114 done
4115fi
4116if test -z "$CC"; then
4117 ac_ct_CC=$CC
4118 for ac_prog in cl.exe
4119do
4120 # Extract the first word of "$ac_prog", so it can be a program name with args.
4121set dummy $ac_prog; ac_word=$2
4122{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4123$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4124if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
4125 $as_echo_n "(cached) " >&6
4126else
4127 if test -n "$ac_ct_CC"; then
4128 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4129else
4130as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4131for as_dir in $PATH
4132do
4133 IFS=$as_save_IFS
4134 test -z "$as_dir" && as_dir=.
4135 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4136 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4137 ac_cv_prog_ac_ct_CC="$ac_prog"
4138 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4139 break 2
4140 fi
4141done
4142 done
4143IFS=$as_save_IFS
4144
4145fi
4146fi
4147ac_ct_CC=$ac_cv_prog_ac_ct_CC
4148if test -n "$ac_ct_CC"; then
4149 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4150$as_echo "$ac_ct_CC" >&6; }
4151else
4152 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4153$as_echo "no" >&6; }
4154fi
4155
4156
4157 test -n "$ac_ct_CC" && break
4158done
4159
4160 if test "x$ac_ct_CC" = x; then
4161 CC=""
4162 else
4163 case $cross_compiling:$ac_tool_warned in
4164yes:)
4165{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4166$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4167ac_tool_warned=yes ;;
4168esac
4169 CC=$ac_ct_CC
4170 fi
4171fi
4172
c0c3707f
CB
4173fi
4174if test -z "$CC"; then
4175 if test -n "$ac_tool_prefix"; then
4176 # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
4177set dummy ${ac_tool_prefix}clang; ac_word=$2
4178{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4179$as_echo_n "checking for $ac_word... " >&6; }
4180if ${ac_cv_prog_CC+:} false; then :
4181 $as_echo_n "(cached) " >&6
4182else
4183 if test -n "$CC"; then
4184 ac_cv_prog_CC="$CC" # Let the user override the test.
4185else
4186as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4187for as_dir in $PATH
4188do
4189 IFS=$as_save_IFS
4190 test -z "$as_dir" && as_dir=.
4191 for ac_exec_ext in '' $ac_executable_extensions; do
4192 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4193 ac_cv_prog_CC="${ac_tool_prefix}clang"
4194 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4195 break 2
4196 fi
4197done
4198 done
4199IFS=$as_save_IFS
4200
4201fi
4202fi
4203CC=$ac_cv_prog_CC
4204if test -n "$CC"; then
4205 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4206$as_echo "$CC" >&6; }
4207else
4208 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4209$as_echo "no" >&6; }
4210fi
4211
4212
4213fi
4214if test -z "$ac_cv_prog_CC"; then
4215 ac_ct_CC=$CC
4216 # Extract the first word of "clang", so it can be a program name with args.
4217set dummy clang; ac_word=$2
4218{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4219$as_echo_n "checking for $ac_word... " >&6; }
4220if ${ac_cv_prog_ac_ct_CC+:} false; then :
4221 $as_echo_n "(cached) " >&6
4222else
4223 if test -n "$ac_ct_CC"; then
4224 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4225else
4226as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4227for as_dir in $PATH
4228do
4229 IFS=$as_save_IFS
4230 test -z "$as_dir" && as_dir=.
4231 for ac_exec_ext in '' $ac_executable_extensions; do
4232 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4233 ac_cv_prog_ac_ct_CC="clang"
4234 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4235 break 2
4236 fi
4237done
4238 done
4239IFS=$as_save_IFS
4240
4241fi
4242fi
4243ac_ct_CC=$ac_cv_prog_ac_ct_CC
4244if test -n "$ac_ct_CC"; then
4245 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4246$as_echo "$ac_ct_CC" >&6; }
4247else
4248 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4249$as_echo "no" >&6; }
4250fi
4251
4252 if test "x$ac_ct_CC" = x; then
4253 CC=""
4254 else
4255 case $cross_compiling:$ac_tool_warned in
4256yes:)
4257{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4258$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4259ac_tool_warned=yes ;;
4260esac
4261 CC=$ac_ct_CC
4262 fi
4263else
4264 CC="$ac_cv_prog_CC"
4265fi
4266
c971b7fa
PA
4267fi
4268
4269
4270test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4271$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4272as_fn_error $? "no acceptable C compiler found in \$PATH
4273See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4274
4275# Provide some information about the compiler.
4276$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4277set X $ac_compile
4278ac_compiler=$2
c0c3707f 4279for ac_option in --version -v -V -qversion -version; do
c971b7fa
PA
4280 { { ac_try="$ac_compiler $ac_option >&5"
4281case "(($ac_try" in
4282 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4283 *) ac_try_echo=$ac_try;;
4284esac
4285eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4286$as_echo "$ac_try_echo"; } >&5
4287 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4288 ac_status=$?
4289 if test -s conftest.err; then
4290 sed '10a\
4291... rest of stderr output deleted ...
4292 10q' conftest.err >conftest.er1
4293 cat conftest.er1 >&5
c971b7fa 4294 fi
d0ac1c44 4295 rm -f conftest.er1 conftest.err
c971b7fa
PA
4296 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4297 test $ac_status = 0; }
4298done
4299
4300cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4301/* end confdefs.h. */
d0ac1c44 4302
c971b7fa
PA
4303int
4304main ()
4305{
c971b7fa
PA
4306
4307 ;
4308 return 0;
4309}
4310_ACEOF
4311ac_clean_files_save=$ac_clean_files
d0ac1c44 4312ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
c971b7fa
PA
4313# Try to create an executable without -o first, disregard a.out.
4314# It will help us diagnose broken compilers, and finding out an intuition
4315# of exeext.
d0ac1c44
SM
4316{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
4317$as_echo_n "checking whether the C compiler works... " >&6; }
c971b7fa
PA
4318ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
4319
4320# The possible output files:
4321ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
4322
4323ac_rmfiles=
4324for ac_file in $ac_files
4325do
4326 case $ac_file in
4327 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4328 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
4329 esac
4330done
4331rm -f $ac_rmfiles
4332
4333if { { ac_try="$ac_link_default"
4334case "(($ac_try" in
4335 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4336 *) ac_try_echo=$ac_try;;
4337esac
4338eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4339$as_echo "$ac_try_echo"; } >&5
4340 (eval "$ac_link_default") 2>&5
4341 ac_status=$?
4342 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4343 test $ac_status = 0; }; then :
4344 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
4345# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
4346# in a Makefile. We should not override ac_cv_exeext if it was cached,
4347# so that the user can short-circuit this test for compilers unknown to
4348# Autoconf.
4349for ac_file in $ac_files ''
4350do
4351 test -f "$ac_file" || continue
4352 case $ac_file in
4353 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
4354 ;;
4355 [ab].out )
4356 # We found the default executable, but exeext='' is most
4357 # certainly right.
4358 break;;
4359 *.* )
4360 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
4361 then :; else
4362 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4363 fi
4364 # We set ac_cv_exeext here because the later test for it is not
4365 # safe: cross compilers may not add the suffix if given an `-o'
4366 # argument, so we may need to know it at that point already.
4367 # Even if this section looks crufty: it has the advantage of
4368 # actually working.
4369 break;;
4370 * )
4371 break;;
4372 esac
4373done
4374test "$ac_cv_exeext" = no && ac_cv_exeext=
4375
4376else
4377 ac_file=''
4378fi
c971b7fa 4379if test -z "$ac_file"; then :
d0ac1c44
SM
4380 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4381$as_echo "no" >&6; }
4382$as_echo "$as_me: failed program was:" >&5
c971b7fa
PA
4383sed 's/^/| /' conftest.$ac_ext >&5
4384
4385{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4386$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4387as_fn_error 77 "C compiler cannot create executables
4388See \`config.log' for more details" "$LINENO" 5; }
4389else
4390 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4391$as_echo "yes" >&6; }
c971b7fa 4392fi
d0ac1c44
SM
4393{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
4394$as_echo_n "checking for C compiler default output file name... " >&6; }
4395{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
4396$as_echo "$ac_file" >&6; }
c971b7fa
PA
4397ac_exeext=$ac_cv_exeext
4398
d0ac1c44 4399rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
c971b7fa 4400ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4401{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
4402$as_echo_n "checking for suffix of executables... " >&6; }
4403if { { ac_try="$ac_link"
4404case "(($ac_try" in
4405 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4406 *) ac_try_echo=$ac_try;;
4407esac
4408eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4409$as_echo "$ac_try_echo"; } >&5
4410 (eval "$ac_link") 2>&5
4411 ac_status=$?
4412 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4413 test $ac_status = 0; }; then :
4414 # If both `conftest.exe' and `conftest' are `present' (well, observable)
4415# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
4416# work properly (i.e., refer to `conftest.exe'), while it won't with
4417# `rm'.
4418for ac_file in conftest.exe conftest conftest.*; do
4419 test -f "$ac_file" || continue
4420 case $ac_file in
4421 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4422 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4423 break;;
4424 * ) break;;
4425 esac
4426done
4427else
4428 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4429$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4430as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4431See \`config.log' for more details" "$LINENO" 5; }
c971b7fa 4432fi
d0ac1c44 4433rm -f conftest conftest$ac_cv_exeext
c971b7fa
PA
4434{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4435$as_echo "$ac_cv_exeext" >&6; }
4436
4437rm -f conftest.$ac_ext
4438EXEEXT=$ac_cv_exeext
4439ac_exeext=$EXEEXT
d0ac1c44
SM
4440cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4441/* end confdefs.h. */
4442#include <stdio.h>
4443int
4444main ()
4445{
4446FILE *f = fopen ("conftest.out", "w");
4447 return ferror (f) || fclose (f) != 0;
4448
4449 ;
4450 return 0;
4451}
4452_ACEOF
4453ac_clean_files="$ac_clean_files conftest.out"
4454# Check that the compiler produces executables we can run. If not, either
4455# the compiler is broken, or we cross compile.
4456{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4457$as_echo_n "checking whether we are cross compiling... " >&6; }
4458if test "$cross_compiling" != yes; then
4459 { { ac_try="$ac_link"
4460case "(($ac_try" in
4461 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4462 *) ac_try_echo=$ac_try;;
4463esac
4464eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4465$as_echo "$ac_try_echo"; } >&5
4466 (eval "$ac_link") 2>&5
4467 ac_status=$?
4468 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4469 test $ac_status = 0; }
4470 if { ac_try='./conftest$ac_cv_exeext'
4471 { { case "(($ac_try" in
4472 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4473 *) ac_try_echo=$ac_try;;
4474esac
4475eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4476$as_echo "$ac_try_echo"; } >&5
4477 (eval "$ac_try") 2>&5
4478 ac_status=$?
4479 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4480 test $ac_status = 0; }; }; then
4481 cross_compiling=no
4482 else
4483 if test "$cross_compiling" = maybe; then
4484 cross_compiling=yes
4485 else
4486 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4487$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4488as_fn_error $? "cannot run C compiled programs.
4489If you meant to cross compile, use \`--host'.
4490See \`config.log' for more details" "$LINENO" 5; }
4491 fi
4492 fi
4493fi
4494{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4495$as_echo "$cross_compiling" >&6; }
4496
4497rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4498ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4499{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4500$as_echo_n "checking for suffix of object files... " >&6; }
d0ac1c44 4501if ${ac_cv_objext+:} false; then :
c971b7fa
PA
4502 $as_echo_n "(cached) " >&6
4503else
4504 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4505/* end confdefs.h. */
4506
4507int
4508main ()
4509{
4510
4511 ;
4512 return 0;
4513}
4514_ACEOF
4515rm -f conftest.o conftest.obj
4516if { { ac_try="$ac_compile"
4517case "(($ac_try" in
4518 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4519 *) ac_try_echo=$ac_try;;
4520esac
4521eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4522$as_echo "$ac_try_echo"; } >&5
4523 (eval "$ac_compile") 2>&5
4524 ac_status=$?
4525 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4526 test $ac_status = 0; }; then :
4527 for ac_file in conftest.o conftest.obj conftest.*; do
4528 test -f "$ac_file" || continue;
4529 case $ac_file in
4530 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4531 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4532 break;;
4533 esac
4534done
4535else
4536 $as_echo "$as_me: failed program was:" >&5
4537sed 's/^/| /' conftest.$ac_ext >&5
4538
4539{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4540$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4541as_fn_error $? "cannot compute suffix of object files: cannot compile
4542See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4543fi
4544rm -f conftest.$ac_cv_objext conftest.$ac_ext
4545fi
4546{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4547$as_echo "$ac_cv_objext" >&6; }
4548OBJEXT=$ac_cv_objext
4549ac_objext=$OBJEXT
4550{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4551$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
d0ac1c44 4552if ${ac_cv_c_compiler_gnu+:} false; then :
c971b7fa
PA
4553 $as_echo_n "(cached) " >&6
4554else
4555 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4556/* end confdefs.h. */
4557
4558int
4559main ()
4560{
4561#ifndef __GNUC__
4562 choke me
4563#endif
4564
4565 ;
4566 return 0;
4567}
4568_ACEOF
4569if ac_fn_c_try_compile "$LINENO"; then :
4570 ac_compiler_gnu=yes
4571else
4572 ac_compiler_gnu=no
4573fi
4574rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4575ac_cv_c_compiler_gnu=$ac_compiler_gnu
4576
4577fi
4578{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4579$as_echo "$ac_cv_c_compiler_gnu" >&6; }
4580if test $ac_compiler_gnu = yes; then
4581 GCC=yes
4582else
4583 GCC=
4584fi
4585ac_test_CFLAGS=${CFLAGS+set}
4586ac_save_CFLAGS=$CFLAGS
4587{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4588$as_echo_n "checking whether $CC accepts -g... " >&6; }
d0ac1c44 4589if ${ac_cv_prog_cc_g+:} false; then :
c971b7fa
PA
4590 $as_echo_n "(cached) " >&6
4591else
4592 ac_save_c_werror_flag=$ac_c_werror_flag
4593 ac_c_werror_flag=yes
4594 ac_cv_prog_cc_g=no
4595 CFLAGS="-g"
4596 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4597/* end confdefs.h. */
4598
4599int
4600main ()
4601{
4602
4603 ;
4604 return 0;
4605}
4606_ACEOF
4607if ac_fn_c_try_compile "$LINENO"; then :
4608 ac_cv_prog_cc_g=yes
4609else
4610 CFLAGS=""
4611 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4612/* end confdefs.h. */
4613
4614int
4615main ()
4616{
4617
4618 ;
4619 return 0;
4620}
4621_ACEOF
4622if ac_fn_c_try_compile "$LINENO"; then :
4623
4624else
4625 ac_c_werror_flag=$ac_save_c_werror_flag
4626 CFLAGS="-g"
4627 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4628/* end confdefs.h. */
4629
4630int
4631main ()
4632{
4633
4634 ;
4635 return 0;
4636}
4637_ACEOF
4638if ac_fn_c_try_compile "$LINENO"; then :
4639 ac_cv_prog_cc_g=yes
4640fi
4641rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4642fi
4643rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4644fi
4645rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4646 ac_c_werror_flag=$ac_save_c_werror_flag
4647fi
4648{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4649$as_echo "$ac_cv_prog_cc_g" >&6; }
4650if test "$ac_test_CFLAGS" = set; then
4651 CFLAGS=$ac_save_CFLAGS
4652elif test $ac_cv_prog_cc_g = yes; then
4653 if test "$GCC" = yes; then
4654 CFLAGS="-g -O2"
4655 else
4656 CFLAGS="-g"
4657 fi
4658else
4659 if test "$GCC" = yes; then
4660 CFLAGS="-O2"
4661 else
4662 CFLAGS=
4663 fi
4664fi
c0c3707f
CB
4665{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
4666$as_echo_n "checking for $CC option to enable C11 features... " >&6; }
4667if ${ac_cv_prog_cc_c11+:} false; then :
c971b7fa
PA
4668 $as_echo_n "(cached) " >&6
4669else
c0c3707f 4670 ac_cv_prog_cc_c11=no
c971b7fa
PA
4671ac_save_CC=$CC
4672cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4673/* end confdefs.h. */
4674#include <stdarg.h>
c0c3707f
CB
4675#include <stdbool.h>
4676#include <stddef.h>
4677#include <stdlib.h>
4678#include <wchar.h>
c971b7fa 4679#include <stdio.h>
c0c3707f
CB
4680
4681// Check varargs macros. These examples are taken from C99 6.10.3.5.
4682#define debug(...) fprintf (stderr, __VA_ARGS__)
4683#define showlist(...) puts (#__VA_ARGS__)
4684#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4685static void
4686test_varargs_macros (void)
7a6dbc2f 4687{
c0c3707f
CB
4688 int x = 1234;
4689 int y = 5678;
4690 debug ("Flag");
4691 debug ("X = %d\n", x);
4692 showlist (The first, second, and third items.);
4693 report (x>y, "x is %d but y is %d", x, y);
c971b7fa 4694}
c0c3707f
CB
4695
4696// Check long long types.
4697#define BIG64 18446744073709551615ull
4698#define BIG32 4294967295ul
4699#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4700#if !BIG_OK
4701 your preprocessor is broken;
4702#endif
4703#if BIG_OK
4704#else
4705 your preprocessor is broken;
4706#endif
4707static long long int bignum = -9223372036854775807LL;
4708static unsigned long long int ubignum = BIG64;
4709
4710struct incomplete_array
7a6dbc2f 4711{
c0c3707f
CB
4712 int datasize;
4713 double data[];
4714};
4715
4716struct named_init {
4717 int number;
4718 const wchar_t *name;
4719 double average;
4720};
4721
4722typedef const char *ccp;
4723
4724static inline int
4725test_restrict (ccp restrict text)
4726{
4727 // See if C++-style comments work.
4728 // Iterate through items via the restricted pointer.
4729 // Also check for declarations in for loops.
4730 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4731 continue;
4732 return 0;
7a6dbc2f 4733}
7a6dbc2f 4734
c0c3707f
CB
4735// Check varargs and va_copy.
4736static bool
4737test_varargs (const char *format, ...)
4738{
4739 va_list args;
4740 va_start (args, format);
4741 va_list args_copy;
4742 va_copy (args_copy, args);
7a6dbc2f 4743
c0c3707f
CB
4744 const char *str = "";
4745 int number = 0;
4746 float fnumber = 0;
4747
4748 while (*format)
4749 {
4750 switch (*format++)
4751 {
4752 case 's': // string
4753 str = va_arg (args_copy, const char *);
4754 break;
4755 case 'd': // int
4756 number = va_arg (args_copy, int);
4757 break;
4758 case 'f': // float
4759 fnumber = va_arg (args_copy, double);
4760 break;
4761 default:
4762 break;
4763 }
4764 }
4765 va_end (args_copy);
4766 va_end (args);
4767
4768 return *str && number && fnumber;
4769}
4770// Check _Alignas.
4771char _Alignas (double) aligned_as_double;
4772char _Alignas (0) no_special_alignment;
4773extern char aligned_as_int;
4774char _Alignas (0) _Alignas (int) aligned_as_int;
4775
4776// Check _Alignof.
4777enum
4778{
4779 int_alignment = _Alignof (int),
4780 int_array_alignment = _Alignof (int[100]),
4781 char_alignment = _Alignof (char)
4782};
4783_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
4784
4785// Check _Noreturn.
4786int _Noreturn does_not_return (void) { for (;;) continue; }
4787
4788// Check _Static_assert.
4789struct test_static_assert
4790{
4791 int x;
4792 _Static_assert (sizeof (int) <= sizeof (long int),
4793 "_Static_assert does not work in struct");
4794 long int y;
4795};
4796
4797// Check UTF-8 literals.
4798#define u8 syntax error!
4799char const utf8_literal[] = u8"happens to be ASCII" "another string";
4800
4801// Check duplicate typedefs.
4802typedef long *long_ptr;
4803typedef long int *long_ptr;
4804typedef long_ptr long_ptr;
4805
4806// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
4807struct anonymous
4808{
4809 union {
4810 struct { int i; int j; };
4811 struct { int k; long int l; } w;
4812 };
4813 int m;
4814} v1;
c971b7fa 4815
c971b7fa
PA
4816int
4817main ()
4818{
c0c3707f
CB
4819
4820 // Check bool.
4821 _Bool success = false;
4822
4823 // Check restrict.
4824 if (test_restrict ("String literal") == 0)
4825 success = true;
4826 char *restrict newvar = "Another string";
4827
4828 // Check varargs.
4829 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4830 test_varargs_macros ();
4831
4832 // Check flexible array members.
4833 struct incomplete_array *ia =
4834 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4835 ia->datasize = 10;
4836 for (int i = 0; i < ia->datasize; ++i)
4837 ia->data[i] = i * 1.234;
4838
4839 // Check named initializers.
4840 struct named_init ni = {
4841 .number = 34,
4842 .name = L"Test wide string",
4843 .average = 543.34343,
4844 };
4845
4846 ni.number = 58;
4847
4848 int dynamic_array[ni.number];
4849 dynamic_array[ni.number - 1] = 543;
4850
4851 // work around unused variable warnings
4852 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4853 || dynamic_array[ni.number - 1] != 543);
4854
4855 v1.i = 2;
4856 v1.w.k = 5;
4857 _Static_assert ((offsetof (struct anonymous, i)
4858 == offsetof (struct anonymous, w.k)),
4859 "Anonymous union alignment botch");
4860
c971b7fa
PA
4861 ;
4862 return 0;
4863}
4864_ACEOF
c0c3707f 4865for ac_arg in '' -std=gnu11
c971b7fa
PA
4866do
4867 CC="$ac_save_CC $ac_arg"
4868 if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 4869 ac_cv_prog_cc_c11=$ac_arg
c971b7fa
PA
4870fi
4871rm -f core conftest.err conftest.$ac_objext
c0c3707f 4872 test "x$ac_cv_prog_cc_c11" != "xno" && break
c971b7fa
PA
4873done
4874rm -f conftest.$ac_ext
4875CC=$ac_save_CC
4876
4877fi
4878# AC_CACHE_VAL
c0c3707f
CB
4879ac_prog_cc_stdc_options=
4880case "x$ac_cv_prog_cc_c11" in
c971b7fa
PA
4881 x)
4882 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4883$as_echo "none needed" >&6; } ;;
4884 xno)
4885 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4886$as_echo "unsupported" >&6; } ;;
4887 *)
c0c3707f
CB
4888 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
4889 CC=$CC$ac_prog_cc_stdc_options
4890 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
4891$as_echo "$ac_cv_prog_cc_c11" >&6; } ;;
c971b7fa 4892esac
c0c3707f
CB
4893if test "x$ac_cv_prog_cc_c11" != xno; then :
4894 ac_prog_cc_stdc=c11
4895 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
4896else
4897 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
4898$as_echo_n "checking for $CC option to enable C99 features... " >&6; }
4899if ${ac_cv_prog_cc_c99+:} false; then :
4900 $as_echo_n "(cached) " >&6
4901else
4902 ac_cv_prog_cc_c99=no
4903ac_save_CC=$CC
4904cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4905/* end confdefs.h. */
4906#include <stdarg.h>
4907#include <stdbool.h>
4908#include <stddef.h>
4909#include <stdlib.h>
4910#include <wchar.h>
4911#include <stdio.h>
7a6dbc2f 4912
c0c3707f
CB
4913// Check varargs macros. These examples are taken from C99 6.10.3.5.
4914#define debug(...) fprintf (stderr, __VA_ARGS__)
4915#define showlist(...) puts (#__VA_ARGS__)
4916#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4917static void
4918test_varargs_macros (void)
4919{
4920 int x = 1234;
4921 int y = 5678;
4922 debug ("Flag");
4923 debug ("X = %d\n", x);
4924 showlist (The first, second, and third items.);
4925 report (x>y, "x is %d but y is %d", x, y);
4926}
7a6dbc2f 4927
c0c3707f
CB
4928// Check long long types.
4929#define BIG64 18446744073709551615ull
4930#define BIG32 4294967295ul
4931#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4932#if !BIG_OK
4933 your preprocessor is broken;
4934#endif
4935#if BIG_OK
4936#else
4937 your preprocessor is broken;
4938#endif
4939static long long int bignum = -9223372036854775807LL;
4940static unsigned long long int ubignum = BIG64;
7a6dbc2f 4941
c0c3707f
CB
4942struct incomplete_array
4943{
4944 int datasize;
4945 double data[];
4946};
7a6dbc2f 4947
c0c3707f
CB
4948struct named_init {
4949 int number;
4950 const wchar_t *name;
4951 double average;
4952};
7a6dbc2f 4953
c0c3707f 4954typedef const char *ccp;
7a6dbc2f 4955
c0c3707f
CB
4956static inline int
4957test_restrict (ccp restrict text)
4958{
4959 // See if C++-style comments work.
4960 // Iterate through items via the restricted pointer.
4961 // Also check for declarations in for loops.
4962 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4963 continue;
4964 return 0;
4965}
7a6dbc2f 4966
c0c3707f
CB
4967// Check varargs and va_copy.
4968static bool
4969test_varargs (const char *format, ...)
4970{
4971 va_list args;
4972 va_start (args, format);
4973 va_list args_copy;
4974 va_copy (args_copy, args);
4975
4976 const char *str = "";
4977 int number = 0;
4978 float fnumber = 0;
4979
4980 while (*format)
4981 {
4982 switch (*format++)
4983 {
4984 case 's': // string
4985 str = va_arg (args_copy, const char *);
4986 break;
4987 case 'd': // int
4988 number = va_arg (args_copy, int);
4989 break;
4990 case 'f': // float
4991 fnumber = va_arg (args_copy, double);
4992 break;
4993 default:
4994 break;
4995 }
4996 }
4997 va_end (args_copy);
4998 va_end (args);
4999
5000 return *str && number && fnumber;
5001}
5002int
5003main ()
5004{
5005
5006 // Check bool.
5007 _Bool success = false;
5008
5009 // Check restrict.
5010 if (test_restrict ("String literal") == 0)
5011 success = true;
5012 char *restrict newvar = "Another string";
5013
5014 // Check varargs.
5015 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
5016 test_varargs_macros ();
5017
5018 // Check flexible array members.
5019 struct incomplete_array *ia =
5020 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
5021 ia->datasize = 10;
5022 for (int i = 0; i < ia->datasize; ++i)
5023 ia->data[i] = i * 1.234;
5024
5025 // Check named initializers.
5026 struct named_init ni = {
5027 .number = 34,
5028 .name = L"Test wide string",
5029 .average = 543.34343,
5030 };
5031
5032 ni.number = 58;
5033
5034 int dynamic_array[ni.number];
5035 dynamic_array[ni.number - 1] = 543;
5036
5037 // work around unused variable warnings
5038 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
5039 || dynamic_array[ni.number - 1] != 543);
5040
5041 ;
5042 return 0;
5043}
5044_ACEOF
5045for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
5046do
5047 CC="$ac_save_CC $ac_arg"
5048 if ac_fn_c_try_compile "$LINENO"; then :
5049 ac_cv_prog_cc_c99=$ac_arg
5050fi
5051rm -f core conftest.err conftest.$ac_objext
5052 test "x$ac_cv_prog_cc_c99" != "xno" && break
5053done
5054rm -f conftest.$ac_ext
5055CC=$ac_save_CC
5056
5057fi
5058# AC_CACHE_VAL
5059ac_prog_cc_stdc_options=
5060case "x$ac_cv_prog_cc_c99" in
5061 x)
5062 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5063$as_echo "none needed" >&6; } ;;
5064 xno)
5065 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5066$as_echo "unsupported" >&6; } ;;
5067 *)
5068 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
5069 CC=$CC$ac_prog_cc_stdc_options
5070 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
5071$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
5072esac
5073if test "x$ac_cv_prog_cc_c99" != xno; then :
5074 ac_prog_cc_stdc=c99
5075 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
5076else
5077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
5078$as_echo_n "checking for $CC option to enable C89 features... " >&6; }
5079if ${ac_cv_prog_cc_c89+:} false; then :
d0ac1c44
SM
5080 $as_echo_n "(cached) " >&6
5081else
c0c3707f
CB
5082 ac_cv_prog_cc_c89=no
5083ac_save_CC=$CC
5084cat confdefs.h - <<_ACEOF >conftest.$ac_ext
d0ac1c44 5085/* end confdefs.h. */
c0c3707f
CB
5086#include <stdarg.h>
5087#include <stdio.h>
5088struct stat;
5089/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
5090struct buf { int x; };
5091FILE * (*rcsopen) (struct buf *, struct stat *, int);
5092static char *e (p, i)
5093 char **p;
5094 int i;
5095{
5096 return p[i];
5097}
5098static char *f (char * (*g) (char **, int), char **p, ...)
5099{
5100 char *s;
5101 va_list v;
5102 va_start (v,p);
5103 s = g (p, va_arg (v,int));
5104 va_end (v);
5105 return s;
5106}
5107
5108/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
5109 function prototypes and stuff, but not '\xHH' hex character constants.
5110 These don't provoke an error unfortunately, instead are silently treated
5111 as 'x'. The following induces an error, until -std is added to get
5112 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
5113 array size at least. It's necessary to write '\x00'==0 to get something
5114 that's true only with -std. */
5115int osf4_cc_array ['\x00' == 0 ? 1 : -1];
5116
5117/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
5118 inside strings and character constants. */
5119#define FOO(x) 'x'
5120int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
d0ac1c44 5121
c0c3707f
CB
5122int test (int i, double x);
5123struct s1 {int (*f) (int a);};
5124struct s2 {int (*f) (double a);};
5125int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
5126int argc;
5127char **argv;
d0ac1c44
SM
5128int
5129main ()
5130{
c0c3707f 5131return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
d0ac1c44
SM
5132 ;
5133 return 0;
5134}
5135_ACEOF
c0c3707f
CB
5136for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
5137 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
5138do
5139 CC="$ac_save_CC $ac_arg"
5140 if ac_fn_c_try_compile "$LINENO"; then :
5141 ac_cv_prog_cc_c89=$ac_arg
5142fi
5143rm -f core conftest.err conftest.$ac_objext
5144 test "x$ac_cv_prog_cc_c89" != "xno" && break
5145done
5146rm -f conftest.$ac_ext
5147CC=$ac_save_CC
5148
5149fi
5150# AC_CACHE_VAL
5151ac_prog_cc_stdc_options=
5152case "x$ac_cv_prog_cc_c89" in
5153 x)
5154 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5155$as_echo "none needed" >&6; } ;;
5156 xno)
5157 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5158$as_echo "unsupported" >&6; } ;;
5159 *)
5160 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
5161 CC=$CC$ac_prog_cc_stdc_options
5162 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
5163$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
5164esac
5165if test "x$ac_cv_prog_cc_c89" != xno; then :
5166 ac_prog_cc_stdc=c89
5167 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
5168else
5169 ac_prog_cc_stdc=no
5170 ac_cv_prog_cc_stdc=no
5171fi
5172
5173fi
5174
7a6dbc2f 5175fi
c0c3707f 5176
d0ac1c44
SM
5177ac_ext=c
5178ac_cpp='$CPP $CPPFLAGS'
5179ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5180ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5181ac_compiler_gnu=$ac_cv_c_compiler_gnu
5182
5183
5df4cba6
SM
5184 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
5185$as_echo_n "checking whether the compiler is clang... " >&6; }
5186if ${gl_cv_compiler_clang+:} false; then :
5187 $as_echo_n "(cached) " >&6
5188else
5189 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5190/* end confdefs.h. */
5191
5192 #ifdef __clang__
5193 barfbarf
5194 #endif
5195
5196int
5197main ()
5198{
5199
5200 ;
5201 return 0;
5202}
5203
5204_ACEOF
5205if ac_fn_c_try_compile "$LINENO"; then :
5206 gl_cv_compiler_clang=no
5207else
5208 gl_cv_compiler_clang=yes
5209fi
5210rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5211
5212fi
5213{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5
5214$as_echo "$gl_cv_compiler_clang" >&6; }
5215
5216
5217 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5
5218$as_echo_n "checking for compiler option needed when checking for declarations... " >&6; }
5219if ${gl_cv_compiler_check_decl_option+:} false; then :
5220 $as_echo_n "(cached) " >&6
5221else
5222 if test $gl_cv_compiler_clang = yes; then
5223 save_ac_compile="$ac_compile"
5224 ac_compile="$ac_compile -Werror=implicit-function-declaration"
5225 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5226/* end confdefs.h. */
5227
5228int
5229main ()
5230{
5231
5232 ;
5233 return 0;
5234}
5235_ACEOF
5236if ac_fn_c_try_compile "$LINENO"; then :
5237 gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'
5238else
5239 gl_cv_compiler_check_decl_option=none
5240fi
5241rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5242 ac_compile="$save_ac_compile"
5243 else
5244 gl_cv_compiler_check_decl_option=none
5245 fi
5246
5247fi
5248{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5
5249$as_echo "$gl_cv_compiler_check_decl_option" >&6; }
5250 if test "x$gl_cv_compiler_check_decl_option" != xnone; then
5251 ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
5252 else
5253 ac_compile_for_check_decl="$ac_compile"
5254 fi
5255
5256
5257
9c9d63b1 5258
c971b7fa
PA
5259ac_ext=c
5260ac_cpp='$CPP $CPPFLAGS'
5261ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5262ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5263ac_compiler_gnu=$ac_cv_c_compiler_gnu
5264{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5265$as_echo_n "checking how to run the C preprocessor... " >&6; }
5266# On Suns, sometimes $CPP names a directory.
5267if test -n "$CPP" && test -d "$CPP"; then
5268 CPP=
5269fi
5270if test -z "$CPP"; then
d0ac1c44 5271 if ${ac_cv_prog_CPP+:} false; then :
c971b7fa
PA
5272 $as_echo_n "(cached) " >&6
5273else
5274 # Double quotes because CPP needs to be expanded
5275 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5276 do
5277 ac_preproc_ok=false
5278for ac_c_preproc_warn_flag in '' yes
5279do
5280 # Use a header file that comes with gcc, so configuring glibc
5281 # with a fresh cross-compiler works.
5282 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5283 # <limits.h> exists even on freestanding compilers.
5284 # On the NeXT, cc -E runs the code through the compiler's parser,
5285 # not just through cpp. "Syntax error" is here to catch this case.
5286 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5287/* end confdefs.h. */
5288#ifdef __STDC__
5289# include <limits.h>
5290#else
5291# include <assert.h>
5292#endif
5293 Syntax error
5294_ACEOF
5295if ac_fn_c_try_cpp "$LINENO"; then :
5296
5297else
5298 # Broken: fails on valid input.
5299continue
5300fi
d0ac1c44 5301rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5302
5303 # OK, works on sane cases. Now check whether nonexistent headers
5304 # can be detected and how.
5305 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5306/* end confdefs.h. */
5307#include <ac_nonexistent.h>
5308_ACEOF
5309if ac_fn_c_try_cpp "$LINENO"; then :
5310 # Broken: success on invalid input.
5311continue
5312else
5313 # Passes both tests.
5314ac_preproc_ok=:
5315break
5316fi
d0ac1c44 5317rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5318
5319done
5320# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5321rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5322if $ac_preproc_ok; then :
5323 break
5324fi
5325
5326 done
5327 ac_cv_prog_CPP=$CPP
5328
5329fi
5330 CPP=$ac_cv_prog_CPP
5331else
5332 ac_cv_prog_CPP=$CPP
5333fi
5334{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5335$as_echo "$CPP" >&6; }
5336ac_preproc_ok=false
5337for ac_c_preproc_warn_flag in '' yes
5338do
5339 # Use a header file that comes with gcc, so configuring glibc
5340 # with a fresh cross-compiler works.
5341 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5342 # <limits.h> exists even on freestanding compilers.
5343 # On the NeXT, cc -E runs the code through the compiler's parser,
5344 # not just through cpp. "Syntax error" is here to catch this case.
5345 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5346/* end confdefs.h. */
5347#ifdef __STDC__
5348# include <limits.h>
5349#else
5350# include <assert.h>
5351#endif
5352 Syntax error
5353_ACEOF
5354if ac_fn_c_try_cpp "$LINENO"; then :
5355
5356else
5357 # Broken: fails on valid input.
5358continue
5359fi
d0ac1c44 5360rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5361
5362 # OK, works on sane cases. Now check whether nonexistent headers
5363 # can be detected and how.
5364 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5365/* end confdefs.h. */
5366#include <ac_nonexistent.h>
5367_ACEOF
5368if ac_fn_c_try_cpp "$LINENO"; then :
5369 # Broken: success on invalid input.
5370continue
5371else
5372 # Passes both tests.
5373ac_preproc_ok=:
5374break
5375fi
d0ac1c44 5376rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5377
5378done
5379# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5380rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5381if $ac_preproc_ok; then :
5382
5383else
5384 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5385$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
5386as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5387See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
5388fi
5389
5390ac_ext=c
5391ac_cpp='$CPP $CPPFLAGS'
5392ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5393ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5394ac_compiler_gnu=$ac_cv_c_compiler_gnu
5395
5396
5397{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
5398$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
d0ac1c44 5399if ${ac_cv_path_GREP+:} false; then :
c971b7fa
PA
5400 $as_echo_n "(cached) " >&6
5401else
5402 if test -z "$GREP"; then
5403 ac_path_GREP_found=false
5404 # Loop through the user's path and test for each of PROGNAME-LIST
5405 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5406for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5407do
5408 IFS=$as_save_IFS
5409 test -z "$as_dir" && as_dir=.
5410 for ac_prog in grep ggrep; do
5411 for ac_exec_ext in '' $ac_executable_extensions; do
5412 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5413 as_fn_executable_p "$ac_path_GREP" || continue
c971b7fa
PA
5414# Check for GNU ac_path_GREP and select it if it is found.
5415 # Check for GNU $ac_path_GREP
5416case `"$ac_path_GREP" --version 2>&1` in
5417*GNU*)
5418 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
5419*)
5420 ac_count=0
5421 $as_echo_n 0123456789 >"conftest.in"
5422 while :
5423 do
5424 cat "conftest.in" "conftest.in" >"conftest.tmp"
5425 mv "conftest.tmp" "conftest.in"
5426 cp "conftest.in" "conftest.nl"
5427 $as_echo 'GREP' >> "conftest.nl"
5428 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5429 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5430 as_fn_arith $ac_count + 1 && ac_count=$as_val
5431 if test $ac_count -gt ${ac_path_GREP_max-0}; then
5432 # Best one so far, save it but keep looking for a better one
5433 ac_cv_path_GREP="$ac_path_GREP"
5434 ac_path_GREP_max=$ac_count
5435 fi
5436 # 10*(2^10) chars as input seems more than enough
5437 test $ac_count -gt 10 && break
5438 done
5439 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5440esac
5441
5442 $ac_path_GREP_found && break 3
5443 done
5444 done
5445 done
5446IFS=$as_save_IFS
5447 if test -z "$ac_cv_path_GREP"; then
d0ac1c44 5448 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5449 fi
5450else
5451 ac_cv_path_GREP=$GREP
5452fi
5453
5454fi
5455{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
5456$as_echo "$ac_cv_path_GREP" >&6; }
5457 GREP="$ac_cv_path_GREP"
5458
5459
5460{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
5461$as_echo_n "checking for egrep... " >&6; }
d0ac1c44 5462if ${ac_cv_path_EGREP+:} false; then :
c971b7fa
PA
5463 $as_echo_n "(cached) " >&6
5464else
5465 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
5466 then ac_cv_path_EGREP="$GREP -E"
5467 else
5468 if test -z "$EGREP"; then
5469 ac_path_EGREP_found=false
5470 # Loop through the user's path and test for each of PROGNAME-LIST
5471 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5472for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5473do
5474 IFS=$as_save_IFS
5475 test -z "$as_dir" && as_dir=.
5476 for ac_prog in egrep; do
5477 for ac_exec_ext in '' $ac_executable_extensions; do
5478 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5479 as_fn_executable_p "$ac_path_EGREP" || continue
c971b7fa
PA
5480# Check for GNU ac_path_EGREP and select it if it is found.
5481 # Check for GNU $ac_path_EGREP
5482case `"$ac_path_EGREP" --version 2>&1` in
5483*GNU*)
5484 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
5485*)
5486 ac_count=0
5487 $as_echo_n 0123456789 >"conftest.in"
5488 while :
5489 do
5490 cat "conftest.in" "conftest.in" >"conftest.tmp"
5491 mv "conftest.tmp" "conftest.in"
5492 cp "conftest.in" "conftest.nl"
5493 $as_echo 'EGREP' >> "conftest.nl"
5494 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5495 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5496 as_fn_arith $ac_count + 1 && ac_count=$as_val
5497 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
5498 # Best one so far, save it but keep looking for a better one
5499 ac_cv_path_EGREP="$ac_path_EGREP"
5500 ac_path_EGREP_max=$ac_count
5501 fi
5502 # 10*(2^10) chars as input seems more than enough
5503 test $ac_count -gt 10 && break
5504 done
5505 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5506esac
5507
5508 $ac_path_EGREP_found && break 3
5509 done
5510 done
5511 done
5512IFS=$as_save_IFS
5513 if test -z "$ac_cv_path_EGREP"; then
d0ac1c44 5514 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5515 fi
5516else
5517 ac_cv_path_EGREP=$EGREP
5518fi
5519
5520 fi
5521fi
5522{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
5523$as_echo "$ac_cv_path_EGREP" >&6; }
5524 EGREP="$ac_cv_path_EGREP"
5525
5526
5527{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
5528$as_echo_n "checking for ANSI C header files... " >&6; }
d0ac1c44 5529if ${ac_cv_header_stdc+:} false; then :
c971b7fa
PA
5530 $as_echo_n "(cached) " >&6
5531else
5532 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5533/* end confdefs.h. */
5534#include <stdlib.h>
5535#include <stdarg.h>
5536#include <string.h>
5537#include <float.h>
5538
5539int
5540main ()
5541{
5542
5543 ;
5544 return 0;
5545}
5546_ACEOF
5547if ac_fn_c_try_compile "$LINENO"; then :
5548 ac_cv_header_stdc=yes
5549else
5550 ac_cv_header_stdc=no
5551fi
5552rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5553
5554if test $ac_cv_header_stdc = yes; then
5555 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5556 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5557/* end confdefs.h. */
5558#include <string.h>
5559
5560_ACEOF
5561if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5562 $EGREP "memchr" >/dev/null 2>&1; then :
5563
5564else
5565 ac_cv_header_stdc=no
5566fi
5567rm -f conftest*
5568
5569fi
5570
5571if test $ac_cv_header_stdc = yes; then
5572 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5573 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5574/* end confdefs.h. */
5575#include <stdlib.h>
5576
5577_ACEOF
5578if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5579 $EGREP "free" >/dev/null 2>&1; then :
5580
5581else
5582 ac_cv_header_stdc=no
5583fi
5584rm -f conftest*
5585
5586fi
5587
5588if test $ac_cv_header_stdc = yes; then
5589 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5590 if test "$cross_compiling" = yes; then :
5591 :
5592else
5593 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5594/* end confdefs.h. */
5595#include <ctype.h>
5596#include <stdlib.h>
5597#if ((' ' & 0x0FF) == 0x020)
5598# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5599# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5600#else
5601# define ISLOWER(c) \
5602 (('a' <= (c) && (c) <= 'i') \
5603 || ('j' <= (c) && (c) <= 'r') \
5604 || ('s' <= (c) && (c) <= 'z'))
5605# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
5606#endif
5607
5608#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5609int
5610main ()
5611{
5612 int i;
5613 for (i = 0; i < 256; i++)
5614 if (XOR (islower (i), ISLOWER (i))
5615 || toupper (i) != TOUPPER (i))
5616 return 2;
5617 return 0;
5618}
5619_ACEOF
5620if ac_fn_c_try_run "$LINENO"; then :
5621
5622else
5623 ac_cv_header_stdc=no
5624fi
5625rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5626 conftest.$ac_objext conftest.beam conftest.$ac_ext
5627fi
5628
5629fi
5630fi
5631{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
5632$as_echo "$ac_cv_header_stdc" >&6; }
5633if test $ac_cv_header_stdc = yes; then
5634
5635$as_echo "#define STDC_HEADERS 1" >>confdefs.h
5636
5637fi
5638
5639# On IRIX 5.3, sys/types and inttypes.h are conflicting.
5640for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
5641 inttypes.h stdint.h unistd.h
5642do :
5643 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5644ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5645"
d0ac1c44 5646if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
c971b7fa
PA
5647 cat >>confdefs.h <<_ACEOF
5648#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5649_ACEOF
5650
5651fi
5652
5653done
5654
5655
5656
c971b7fa
PA
5657
5658
9c9d63b1
PM
5659 for ac_header in $ac_header_list
5660do :
5661 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5662ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5663"
5664if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
5665 cat >>confdefs.h <<_ACEOF
5666#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5667_ACEOF
c971b7fa 5668
9c9d63b1
PM
5669fi
5670
5671done
c971b7fa
PA
5672
5673
c971b7fa
PA
5674
5675
c971b7fa 5676
c971b7fa 5677
c971b7fa 5678
c971b7fa
PA
5679
5680
5681 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
5682$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
d0ac1c44 5683if ${ac_cv_safe_to_define___extensions__+:} false; then :
c971b7fa
PA
5684 $as_echo_n "(cached) " >&6
5685else
5686 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5687/* end confdefs.h. */
5688
5689# define __EXTENSIONS__ 1
5690 $ac_includes_default
5691int
5692main ()
5693{
5694
5695 ;
5696 return 0;
5697}
5698_ACEOF
5699if ac_fn_c_try_compile "$LINENO"; then :
5700 ac_cv_safe_to_define___extensions__=yes
5701else
5702 ac_cv_safe_to_define___extensions__=no
5703fi
5704rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5705fi
5706{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
5707$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
c971b7fa 5708
4a626d0a
PA
5709 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
5710$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
d0ac1c44 5711if ${ac_cv_should_define__xopen_source+:} false; then :
4a626d0a
PA
5712 $as_echo_n "(cached) " >&6
5713else
5714 ac_cv_should_define__xopen_source=no
9c9d63b1
PM
5715 if test $ac_cv_header_wchar_h = yes; then :
5716 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4a626d0a
PA
5717/* end confdefs.h. */
5718
5719 #include <wchar.h>
5720 mbstate_t x;
5721int
5722main ()
5723{
5724
5725 ;
5726 return 0;
5727}
5728_ACEOF
5729if ac_fn_c_try_compile "$LINENO"; then :
5730
5731else
5732 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5733/* end confdefs.h. */
5734
9c9d63b1
PM
5735 #define _XOPEN_SOURCE 500
5736 #include <wchar.h>
5737 mbstate_t x;
4a626d0a
PA
5738int
5739main ()
5740{
5741
5742 ;
5743 return 0;
5744}
5745_ACEOF
5746if ac_fn_c_try_compile "$LINENO"; then :
5747 ac_cv_should_define__xopen_source=yes
5748fi
d0ac1c44
SM
5749rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5750fi
5751rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5752fi
9c9d63b1 5753fi
d0ac1c44
SM
5754{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
5755$as_echo "$ac_cv_should_define__xopen_source" >&6; }
9c9d63b1
PM
5756
5757 $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
5758
5759 $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
5760
5761 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
d0ac1c44 5762
c0c3707f
CB
5763 $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
5764
9c9d63b1
PM
5765 $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
5766
5767 $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h
5768
5769 $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
5770
5771 $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
5772
5773 $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
5774
5775 $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
5776
5777 $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
5778
5779 $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
5780
5781 $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
5782
5783 $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
5784
5785 $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
5786
5787 if test $ac_cv_header_minix_config_h = yes; then :
5788 MINIX=yes
5789 $as_echo "#define _MINIX 1" >>confdefs.h
5790
5791 $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
5792
5793 $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
5794
5795else
5796 MINIX=
5797fi
5798 if test $ac_cv_safe_to_define___extensions__ = yes; then :
5799 $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
5800
5801fi
5802 if test $ac_cv_should_define__xopen_source = yes; then :
5803 $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
5804
5805fi
d0ac1c44 5806
c8693053
RO
5807# Needs to run before gl_EARLY so it can override AC_SYS_LARGEFILE included
5808# there.
c0c3707f
CB
5809ac_aux_dir=
5810for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
5811 if test -f "$ac_dir/install-sh"; then
5812 ac_aux_dir=$ac_dir
5813 ac_install_sh="$ac_aux_dir/install-sh -c"
5814 break
5815 elif test -f "$ac_dir/install.sh"; then
5816 ac_aux_dir=$ac_dir
5817 ac_install_sh="$ac_aux_dir/install.sh -c"
5818 break
5819 elif test -f "$ac_dir/shtool"; then
5820 ac_aux_dir=$ac_dir
5821 ac_install_sh="$ac_aux_dir/shtool install -c"
5822 break
5823 fi
5824done
5825if test -z "$ac_aux_dir"; then
5826 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
5827fi
5828
5829# These three variables are undocumented and unsupported,
5830# and are intended to be withdrawn in a future Autoconf release.
5831# They can cause serious problems if a builder's source tree is in a directory
5832# whose full name contains unusual characters.
5833ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
5834ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
5835ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
5836
5837
4a626d0a
PA
5838# Make sure we can run config.sub.
5839$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
d0ac1c44 5840 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4a626d0a
PA
5841
5842{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
5843$as_echo_n "checking build system type... " >&6; }
d0ac1c44 5844if ${ac_cv_build+:} false; then :
4a626d0a
PA
5845 $as_echo_n "(cached) " >&6
5846else
5847 ac_build_alias=$build_alias
5848test "x$ac_build_alias" = x &&
5849 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
5850test "x$ac_build_alias" = x &&
d0ac1c44 5851 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4a626d0a 5852ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
d0ac1c44 5853 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4a626d0a
PA
5854
5855fi
5856{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
5857$as_echo "$ac_cv_build" >&6; }
5858case $ac_cv_build in
5859*-*-*) ;;
d0ac1c44 5860*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4a626d0a
PA
5861esac
5862build=$ac_cv_build
5863ac_save_IFS=$IFS; IFS='-'
5864set x $ac_cv_build
5865shift
5866build_cpu=$1
5867build_vendor=$2
5868shift; shift
5869# Remember, the first character of IFS is used to create $*,
5870# except with old shells:
5871build_os=$*
5872IFS=$ac_save_IFS
5873case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
5874
5875
5876{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
5877$as_echo_n "checking host system type... " >&6; }
d0ac1c44 5878if ${ac_cv_host+:} false; then :
4a626d0a
PA
5879 $as_echo_n "(cached) " >&6
5880else
5881 if test "x$host_alias" = x; then
5882 ac_cv_host=$ac_cv_build
5883else
5884 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
d0ac1c44 5885 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4a626d0a
PA
5886fi
5887
5888fi
5889{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
5890$as_echo "$ac_cv_host" >&6; }
5891case $ac_cv_host in
5892*-*-*) ;;
d0ac1c44 5893*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4a626d0a
PA
5894esac
5895host=$ac_cv_host
5896ac_save_IFS=$IFS; IFS='-'
5897set x $ac_cv_host
5898shift
5899host_cpu=$1
5900host_vendor=$2
5901shift; shift
5902# Remember, the first character of IFS is used to create $*,
5903# except with old shells:
5904host_os=$*
5905IFS=$ac_save_IFS
5906case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
5907
5908
c8693053
RO
5909{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
5910$as_echo_n "checking target system type... " >&6; }
5911if ${ac_cv_target+:} false; then :
5912 $as_echo_n "(cached) " >&6
5913else
5914 if test "x$target_alias" = x; then
5915 ac_cv_target=$ac_cv_host
5916else
5917 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
5918 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
5919fi
c971b7fa 5920
c8693053
RO
5921fi
5922{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
5923$as_echo "$ac_cv_target" >&6; }
5924case $ac_cv_target in
5925*-*-*) ;;
5926*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
5927esac
5928target=$ac_cv_target
5929ac_save_IFS=$IFS; IFS='-'
5930set x $ac_cv_target
5931shift
5932target_cpu=$1
5933target_vendor=$2
5934shift; shift
5935# Remember, the first character of IFS is used to create $*,
5936# except with old shells:
5937target_os=$*
5938IFS=$ac_save_IFS
5939case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
c971b7fa 5940
88b48903 5941
c8693053
RO
5942# The aliases save the names the user supplied, while $host etc.
5943# will get canonicalized.
5944test -n "$target_alias" &&
5945 test "$program_prefix$program_suffix$program_transform_name" = \
5946 NONENONEs,x,x, &&
5947 program_prefix=${target_alias}-
5948
5949# The tests for host and target for $enable_largefile require
5950# canonical names.
5951
5952
5953
5954# As the $enable_largefile decision depends on --enable-plugins we must set it
5955# even in directories otherwise not depending on the $plugins option.
5956
5957
5958 maybe_plugins=no
5959 for ac_header in dlfcn.h
5960do :
5961 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
5962"
5963if test "x$ac_cv_header_dlfcn_h" = xyes; then :
5964 cat >>confdefs.h <<_ACEOF
5965#define HAVE_DLFCN_H 1
5966_ACEOF
5967 maybe_plugins=yes
5968fi
5969
5970done
5971
5972 for ac_header in windows.h
5973do :
5974 ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
5975"
5976if test "x$ac_cv_header_windows_h" = xyes; then :
5977 cat >>confdefs.h <<_ACEOF
5978#define HAVE_WINDOWS_H 1
5979_ACEOF
5980 maybe_plugins=yes
5981fi
5982
5983done
5984
5985
5986 # Check whether --enable-plugins was given.
5987if test "${enable_plugins+set}" = set; then :
5988 enableval=$enable_plugins; case "${enableval}" in
5989 no) plugins=no ;;
5990 *) plugins=yes
5991 if test "$maybe_plugins" != "yes" ; then
5992 as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
5993 fi ;;
5994 esac
5995else
5996 plugins=$maybe_plugins
5997
5998fi
5999
6000 if test "$plugins" = "yes"; then
6001 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5
6002$as_echo_n "checking for library containing dlsym... " >&6; }
6003if ${ac_cv_search_dlsym+:} false; then :
6004 $as_echo_n "(cached) " >&6
6005else
6006 ac_func_search_save_LIBS=$LIBS
6007cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6008/* end confdefs.h. */
6009
6010/* Override any GCC internal prototype to avoid an error.
6011 Use char because int might match the return type of a GCC
6012 builtin and then its argument prototype would still apply. */
6013#ifdef __cplusplus
6014extern "C"
6015#endif
6016char dlsym ();
6017int
6018main ()
6019{
6020return dlsym ();
6021 ;
6022 return 0;
6023}
6024_ACEOF
6025for ac_lib in '' dl; do
6026 if test -z "$ac_lib"; then
6027 ac_res="none required"
6028 else
6029 ac_res=-l$ac_lib
6030 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6031 fi
6032 if ac_fn_c_try_link "$LINENO"; then :
6033 ac_cv_search_dlsym=$ac_res
6034fi
6035rm -f core conftest.err conftest.$ac_objext \
6036 conftest$ac_exeext
6037 if ${ac_cv_search_dlsym+:} false; then :
6038 break
6039fi
6040done
6041if ${ac_cv_search_dlsym+:} false; then :
6042
6043else
6044 ac_cv_search_dlsym=no
6045fi
6046rm conftest.$ac_ext
6047LIBS=$ac_func_search_save_LIBS
6048fi
6049{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5
6050$as_echo "$ac_cv_search_dlsym" >&6; }
6051ac_res=$ac_cv_search_dlsym
6052if test "$ac_res" != no; then :
6053 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6054
6055fi
6056
6057 fi
6058
6059
6060case "${host}" in
6061 sparc-*-solaris*|i?86-*-solaris*)
6062 # On native 32-bit Solaris/SPARC and x86, large-file and procfs support
6063 # were mutually exclusive until Solaris 11.3. Without procfs support,
6064 # the bfd/ elf module cannot provide certain routines such as
6065 # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user
6066 # explicitly requested large-file support through the
6067 # --enable-largefile switch, disable large-file support in favor of
6068 # procfs support.
6069 #
6070 # Check if <sys/procfs.h> is incompatible with large-file support.
6071 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6072/* end confdefs.h. */
6073#define _FILE_OFFSET_BITS 64
6074#define _STRUCTURED_PROC 1
6075#include <sys/procfs.h>
6076int
6077main ()
6078{
6079
6080 ;
6081 return 0;
6082}
6083_ACEOF
6084if ac_fn_c_try_compile "$LINENO"; then :
6085 acx_cv_procfs_lfs=yes
6086else
6087 acx_cv_procfs_lfs=no
6088fi
6089rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6090 #
6091 # Forcefully disable large-file support only if necessary, gdb is in
6092 # tree and enabled.
6093 if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \
6094 -a -d $srcdir/../gdb -a "$enable_gdb" != no; then
6095 : ${enable_largefile="no"}
6096 if test "$plugins" = yes; then
6097 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
6098plugin support disabled; require large-file support which is incompatible with GDB." >&5
6099$as_echo "$as_me: WARNING:
6100plugin support disabled; require large-file support which is incompatible with GDB." >&2;}
6101 plugins=no
88b48903 6102 fi
c8693053
RO
6103 fi
6104 #
6105 # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the
6106 # benefit of g++ 9+ which predefines it on Solaris.
6107 if test "$enable_largefile" = no; then
6108 LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS"
6109
6110 fi
6111 ;;
6112esac
88b48903 6113
2196f55f
YQ
6114# Check whether --enable-largefile was given.
6115if test "${enable_largefile+set}" = set; then :
6116 enableval=$enable_largefile;
6117fi
6118
6119if test "$enable_largefile" != no; then
6120
6121 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
6122$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
d0ac1c44 6123if ${ac_cv_sys_largefile_CC+:} false; then :
2196f55f
YQ
6124 $as_echo_n "(cached) " >&6
6125else
6126 ac_cv_sys_largefile_CC=no
6127 if test "$GCC" != yes; then
6128 ac_save_CC=$CC
6129 while :; do
6130 # IRIX 6.2 and later do not support large files by default,
6131 # so use the C compiler's -n32 option if that helps.
6132 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6133/* end confdefs.h. */
6134#include <sys/types.h>
6135 /* Check that off_t can represent 2**63 - 1 correctly.
6136 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6137 since some C++ compilers masquerading as C compilers
6138 incorrectly reject 9223372036854775807. */
9c9d63b1 6139#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6140 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6141 && LARGE_OFF_T % 2147483647 == 1)
6142 ? 1 : -1];
6143int
6144main ()
6145{
6146
6147 ;
6148 return 0;
6149}
6150_ACEOF
6151 if ac_fn_c_try_compile "$LINENO"; then :
6152 break
6153fi
6154rm -f core conftest.err conftest.$ac_objext
6155 CC="$CC -n32"
6156 if ac_fn_c_try_compile "$LINENO"; then :
6157 ac_cv_sys_largefile_CC=' -n32'; break
6158fi
6159rm -f core conftest.err conftest.$ac_objext
6160 break
6161 done
6162 CC=$ac_save_CC
6163 rm -f conftest.$ac_ext
6164 fi
6165fi
6166{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6167$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6168 if test "$ac_cv_sys_largefile_CC" != no; then
6169 CC=$CC$ac_cv_sys_largefile_CC
6170 fi
6171
6172 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6173$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
d0ac1c44 6174if ${ac_cv_sys_file_offset_bits+:} false; then :
2196f55f
YQ
6175 $as_echo_n "(cached) " >&6
6176else
6177 while :; do
6178 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6179/* end confdefs.h. */
6180#include <sys/types.h>
6181 /* Check that off_t can represent 2**63 - 1 correctly.
6182 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6183 since some C++ compilers masquerading as C compilers
6184 incorrectly reject 9223372036854775807. */
9c9d63b1 6185#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6186 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6187 && LARGE_OFF_T % 2147483647 == 1)
6188 ? 1 : -1];
6189int
6190main ()
6191{
6192
6193 ;
6194 return 0;
6195}
6196_ACEOF
6197if ac_fn_c_try_compile "$LINENO"; then :
6198 ac_cv_sys_file_offset_bits=no; break
6199fi
6200rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6201 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6202/* end confdefs.h. */
6203#define _FILE_OFFSET_BITS 64
6204#include <sys/types.h>
6205 /* Check that off_t can represent 2**63 - 1 correctly.
6206 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6207 since some C++ compilers masquerading as C compilers
6208 incorrectly reject 9223372036854775807. */
9c9d63b1 6209#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6210 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6211 && LARGE_OFF_T % 2147483647 == 1)
6212 ? 1 : -1];
6213int
6214main ()
6215{
6216
6217 ;
6218 return 0;
6219}
6220_ACEOF
6221if ac_fn_c_try_compile "$LINENO"; then :
6222 ac_cv_sys_file_offset_bits=64; break
6223fi
6224rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6225 ac_cv_sys_file_offset_bits=unknown
6226 break
6227done
6228fi
6229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6230$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6231case $ac_cv_sys_file_offset_bits in #(
6232 no | unknown) ;;
6233 *)
6234cat >>confdefs.h <<_ACEOF
6235#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6236_ACEOF
6237;;
6238esac
6239rm -rf conftest*
6240 if test $ac_cv_sys_file_offset_bits = unknown; then
6241 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6242$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
d0ac1c44 6243if ${ac_cv_sys_large_files+:} false; then :
2196f55f
YQ
6244 $as_echo_n "(cached) " >&6
6245else
6246 while :; do
6247 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6248/* end confdefs.h. */
6249#include <sys/types.h>
6250 /* Check that off_t can represent 2**63 - 1 correctly.
6251 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6252 since some C++ compilers masquerading as C compilers
6253 incorrectly reject 9223372036854775807. */
9c9d63b1 6254#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6255 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6256 && LARGE_OFF_T % 2147483647 == 1)
6257 ? 1 : -1];
6258int
6259main ()
6260{
6261
6262 ;
6263 return 0;
6264}
6265_ACEOF
6266if ac_fn_c_try_compile "$LINENO"; then :
6267 ac_cv_sys_large_files=no; break
6268fi
6269rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6270 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6271/* end confdefs.h. */
6272#define _LARGE_FILES 1
6273#include <sys/types.h>
6274 /* Check that off_t can represent 2**63 - 1 correctly.
6275 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6276 since some C++ compilers masquerading as C compilers
6277 incorrectly reject 9223372036854775807. */
9c9d63b1 6278#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6279 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6280 && LARGE_OFF_T % 2147483647 == 1)
6281 ? 1 : -1];
6282int
6283main ()
6284{
6285
6286 ;
6287 return 0;
6288}
6289_ACEOF
6290if ac_fn_c_try_compile "$LINENO"; then :
6291 ac_cv_sys_large_files=1; break
6292fi
6293rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6294 ac_cv_sys_large_files=unknown
6295 break
6296done
6297fi
6298{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6299$as_echo "$ac_cv_sys_large_files" >&6; }
6300case $ac_cv_sys_large_files in #(
6301 no | unknown) ;;
6302 *)
6303cat >>confdefs.h <<_ACEOF
6304#define _LARGE_FILES $ac_cv_sys_large_files
6305_ACEOF
6306;;
6307esac
6308rm -rf conftest*
6309 fi
2196f55f
YQ
6310fi
6311
88b48903
WN
6312
6313
5abebf3c
CB
6314
6315
6316
9c9d63b1
PM
6317 case "$host_os" in
6318 openbsd*)
6319
6320$as_echo "#define _ISOC11_SOURCE 1" >>confdefs.h
c0c3707f 6321
9c9d63b1
PM
6322 ;;
6323 esac
5abebf3c 6324
5abebf3c 6325
c0c3707f
CB
6326
6327
c8693053
RO
6328 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
6329$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
6330if ${gl_cv_c_amsterdam_compiler+:} false; then :
6331 $as_echo_n "(cached) " >&6
6332else
c0c3707f 6333
c8693053
RO
6334 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6335/* end confdefs.h. */
5abebf3c 6336
c8693053
RO
6337#ifdef __ACK__
6338Amsterdam
6339#endif
5abebf3c 6340
c8693053
RO
6341_ACEOF
6342if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6343 $EGREP "Amsterdam" >/dev/null 2>&1; then :
6344 gl_cv_c_amsterdam_compiler=yes
6345else
6346 gl_cv_c_amsterdam_compiler=no
6347fi
6348rm -f conftest*
5abebf3c
CB
6349
6350
c8693053
RO
6351fi
6352{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
6353$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
5abebf3c 6354
c8693053
RO
6355 if test $gl_cv_c_amsterdam_compiler = yes; then
6356 if test -z "$AR"; then
6357 AR='cc -c.a'
6358 fi
6359 if test -z "$ARFLAGS"; then
6360 ARFLAGS='-o'
6361 fi
6362 else
6363 :
6364 fi
c971b7fa 6365
c8693053
RO
6366 if test -n "$ac_tool_prefix"; then
6367 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6368set dummy ${ac_tool_prefix}ar; ac_word=$2
6369{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6370$as_echo_n "checking for $ac_word... " >&6; }
6371if ${ac_cv_prog_AR+:} false; then :
6372 $as_echo_n "(cached) " >&6
6373else
6374 if test -n "$AR"; then
6375 ac_cv_prog_AR="$AR" # Let the user override the test.
6376else
6377as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6378for as_dir in $PATH
6379do
6380 IFS=$as_save_IFS
6381 test -z "$as_dir" && as_dir=.
6382 for ac_exec_ext in '' $ac_executable_extensions; do
6383 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6384 ac_cv_prog_AR="${ac_tool_prefix}ar"
6385 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6386 break 2
6387 fi
6388done
6389 done
6390IFS=$as_save_IFS
c971b7fa 6391
c8693053
RO
6392fi
6393fi
6394AR=$ac_cv_prog_AR
6395if test -n "$AR"; then
6396 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
6397$as_echo "$AR" >&6; }
6398else
6399 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6400$as_echo "no" >&6; }
6401fi
c971b7fa 6402
c971b7fa 6403
c8693053
RO
6404fi
6405if test -z "$ac_cv_prog_AR"; then
6406 ac_ct_AR=$AR
6407 # Extract the first word of "ar", so it can be a program name with args.
6408set dummy ar; ac_word=$2
6409{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6410$as_echo_n "checking for $ac_word... " >&6; }
6411if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
6412 $as_echo_n "(cached) " >&6
6413else
c8693053
RO
6414 if test -n "$ac_ct_AR"; then
6415 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5e8754f9 6416else
c8693053
RO
6417as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6418for as_dir in $PATH
6419do
6420 IFS=$as_save_IFS
6421 test -z "$as_dir" && as_dir=.
6422 for ac_exec_ext in '' $ac_executable_extensions; do
6423 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6424 ac_cv_prog_ac_ct_AR="ar"
6425 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6426 break 2
6427 fi
6428done
6429 done
6430IFS=$as_save_IFS
7a6dbc2f 6431
c971b7fa 6432fi
c8693053
RO
6433fi
6434ac_ct_AR=$ac_cv_prog_ac_ct_AR
6435if test -n "$ac_ct_AR"; then
6436 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
6437$as_echo "$ac_ct_AR" >&6; }
6438else
6439 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6440$as_echo "no" >&6; }
6441fi
5e8754f9 6442
c8693053
RO
6443 if test "x$ac_ct_AR" = x; then
6444 AR="ar"
6445 else
6446 case $cross_compiling:$ac_tool_warned in
6447yes:)
6448{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6449$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6450ac_tool_warned=yes ;;
6451esac
6452 AR=$ac_ct_AR
6453 fi
6454else
6455 AR="$ac_cv_prog_AR"
6456fi
c0c3707f 6457
c8693053
RO
6458 if test -z "$ARFLAGS"; then
6459 ARFLAGS='cr'
6460 fi
7a6dbc2f 6461
7a6dbc2f 6462
c0c3707f 6463
c8693053
RO
6464 if test -z "$RANLIB"; then
6465 if test $gl_cv_c_amsterdam_compiler = yes; then
6466 RANLIB=':'
6467 else
6468 if test -n "$ac_tool_prefix"; then
6469 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6470set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6471{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6472$as_echo_n "checking for $ac_word... " >&6; }
6473if ${ac_cv_prog_RANLIB+:} false; then :
6474 $as_echo_n "(cached) " >&6
6475else
6476 if test -n "$RANLIB"; then
6477 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6478else
6479as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6480for as_dir in $PATH
6481do
6482 IFS=$as_save_IFS
6483 test -z "$as_dir" && as_dir=.
6484 for ac_exec_ext in '' $ac_executable_extensions; do
6485 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6486 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6487 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6488 break 2
6489 fi
5e8754f9 6490done
c8693053
RO
6491 done
6492IFS=$as_save_IFS
5e8754f9 6493
c971b7fa 6494fi
c8693053
RO
6495fi
6496RANLIB=$ac_cv_prog_RANLIB
6497if test -n "$RANLIB"; then
6498 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6499$as_echo "$RANLIB" >&6; }
c0c3707f 6500else
c8693053
RO
6501 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6502$as_echo "no" >&6; }
5e8754f9 6503fi
c0c3707f 6504
c8693053
RO
6505
6506fi
6507if test -z "$ac_cv_prog_RANLIB"; then
6508 ac_ct_RANLIB=$RANLIB
6509 # Extract the first word of "ranlib", so it can be a program name with args.
6510set dummy ranlib; ac_word=$2
6511{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6512$as_echo_n "checking for $ac_word... " >&6; }
6513if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
6514 $as_echo_n "(cached) " >&6
6515else
c8693053
RO
6516 if test -n "$ac_ct_RANLIB"; then
6517 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6518else
6519as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6520for as_dir in $PATH
6521do
6522 IFS=$as_save_IFS
6523 test -z "$as_dir" && as_dir=.
6524 for ac_exec_ext in '' $ac_executable_extensions; do
6525 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6526 ac_cv_prog_ac_ct_RANLIB="ranlib"
6527 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6528 break 2
5e8754f9
SDJ
6529 fi
6530done
c8693053
RO
6531 done
6532IFS=$as_save_IFS
5e8754f9
SDJ
6533
6534fi
6535fi
c8693053
RO
6536ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6537if test -n "$ac_ct_RANLIB"; then
6538 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6539$as_echo "$ac_ct_RANLIB" >&6; }
6540else
6541 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6542$as_echo "no" >&6; }
6543fi
c0c3707f 6544
c8693053
RO
6545 if test "x$ac_ct_RANLIB" = x; then
6546 RANLIB=":"
6547 else
6548 case $cross_compiling:$ac_tool_warned in
6549yes:)
6550{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6551$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6552ac_tool_warned=yes ;;
6553esac
6554 RANLIB=$ac_ct_RANLIB
6555 fi
6556else
6557 RANLIB="$ac_cv_prog_RANLIB"
5e8754f9
SDJ
6558fi
6559
c8693053 6560 fi
c0c3707f 6561 fi
5e8754f9 6562
5e8754f9 6563
5e8754f9 6564
5e8754f9
SDJ
6565
6566
5e8754f9 6567
c8693053
RO
6568 # IEEE behaviour is the default on all CPUs except Alpha and SH
6569 # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
6570 # and the GCC 4.1.2 manual).
6571 case "$host_cpu" in
6572 alpha*)
6573 # On Alpha systems, a compiler option provides the behaviour.
6574 # See the ieee(3) manual page, also available at
6575 # <https://backdrift.org/man/tru64/man3/ieee.3.html>
6576 if test -n "$GCC"; then
6577 # GCC has the option -mieee.
6578 # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
6579 CPPFLAGS="$CPPFLAGS -mieee"
6580 else
6581 # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
6582 # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
6583 CPPFLAGS="$CPPFLAGS -ieee"
6584 fi
6585 ;;
6586 sh*)
6587 if test -n "$GCC"; then
6588 # GCC has the option -mieee.
6589 CPPFLAGS="$CPPFLAGS -mieee"
6590 fi
6591 ;;
6592 esac
c0c3707f 6593
c971b7fa 6594
c971b7fa 6595
c8693053
RO
6596
6597
6598
6599
6600 # Check whether --enable-threads was given.
6601if test "${enable_threads+set}" = set; then :
6602 enableval=$enable_threads; gl_use_threads=$enableval
5e8754f9 6603else
c8693053
RO
6604 if test -n "$gl_use_threads_default"; then
6605 gl_use_threads="$gl_use_threads_default"
6606 else
6607 case "$host_os" in
6608 osf*) gl_use_threads=no ;;
6609 cygwin*)
6610 case `uname -r` in
6611 1.[0-5].*) gl_use_threads=no ;;
6612 *) gl_use_threads=yes ;;
6613 esac
6614 ;;
6615 mingw*)
6616 case "$gl_use_winpthreads_default" in
6617 yes) gl_use_threads=posix ;;
6618 no) gl_use_threads=windows ;;
6619 *) gl_use_threads=yes ;;
6620 esac
6621 ;;
6622 *) gl_use_threads=yes ;;
6623 esac
6624 fi
c971b7fa 6625
5e8754f9 6626fi
c0c3707f 6627
c8693053
RO
6628 if test "$gl_use_threads" = yes \
6629 || test "$gl_use_threads" = isoc \
6630 || test "$gl_use_threads" = posix \
6631 || test "$gl_use_threads" = isoc+posix; then
6632 # For using <threads.h> or <pthread.h>:
6633
6634
6635 if test -z "$gl_anythreadlib_early_done"; then
6636 case "$host_os" in
6637 osf*)
6638 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
6639 # groks <pthread.h>. cc also understands the flag -pthread, but
6640 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
6641 # 2. putting a flag into CPPFLAGS that has an effect on the linker
6642 # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
6643 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
6644 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
6645 ;;
6646 esac
6647 # Some systems optimize for single-threaded programs by default, and
6648 # need special flags to disable these optimizations. For example, the
6649 # definition of 'errno' in <errno.h>.
6650 case "$host_os" in
6651 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
6652 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
6653 esac
6654 gl_anythreadlib_early_done=done
5e8754f9 6655 fi
c0c3707f 6656
c8693053 6657 fi
c0c3707f 6658
c0c3707f 6659
c971b7fa 6660
c8693053
RO
6661 # Pre-early section.
6662
6663
6664
6665
6666 # Code from module absolute-header:
6667 # Code from module alloca:
6668 # Code from module alloca-opt:
6669 # Code from module arpa_inet:
6670 # Code from module assure:
6671 # Code from module at-internal:
698be2d8 6672 # Code from module attribute:
9c9d63b1 6673 # Code from module basename-lgpl:
698be2d8 6674 # Code from module btowc:
c8693053
RO
6675 # Code from module builtin-expect:
6676 # Code from module c99:
6677 # Code from module canonicalize-lgpl:
6678 # Code from module chdir:
6679 # Code from module chdir-long:
9c9d63b1 6680 # Code from module clock-time:
c8693053
RO
6681 # Code from module cloexec:
6682 # Code from module close:
6683 # Code from module closedir:
6684 # Code from module count-one-bits:
698be2d8 6685 # Code from module ctype:
c8693053
RO
6686 # Code from module d-ino:
6687 # Code from module d-type:
6688 # Code from module dirent:
6689 # Code from module dirfd:
6690 # Code from module dirname-lgpl:
c8693053
RO
6691 # Code from module double-slash-root:
6692 # Code from module dup:
6693 # Code from module dup2:
9c9d63b1 6694 # Code from module eloop-threshold:
c8693053
RO
6695 # Code from module environ:
6696 # Code from module errno:
6697 # Code from module error:
6698 # Code from module exitfail:
6699 # Code from module extensions:
6700 # Code from module extern-inline:
6701 # Code from module fchdir:
6702 # Code from module fcntl:
6703 # Code from module fcntl-h:
6704 # Code from module fd-hook:
6705 # Code from module fd-safer-flag:
6706 # Code from module fdopendir:
6707 # Code from module filename:
6708 # Code from module filenamecat-lgpl:
6709 # Code from module flexmember:
6710 # Code from module float:
6711 # Code from module fnmatch:
6712 # Code from module fnmatch-gnu:
6713 # Code from module fnmatch-h:
6714 # Code from module fpieee:
6715
6716 # Code from module fpucw:
9c9d63b1 6717 # Code from module free-posix:
c8693053
RO
6718 # Code from module frexp:
6719 # Code from module frexpl:
6720 # Code from module fstat:
6721 # Code from module fstatat:
6722 # Code from module getcwd:
6723 # Code from module getcwd-lgpl:
c17253b9 6724 # Code from module getdelim:
c8693053 6725 # Code from module getdtablesize:
c17253b9 6726 # Code from module getline:
c8693053
RO
6727 # Code from module getlogin_r:
6728 # Code from module getprogname:
698be2d8 6729 # Code from module getrandom:
c8693053
RO
6730 # Code from module gettext-h:
6731 # Code from module gettimeofday:
0fa6376c 6732 # Code from module gitlog-to-changelog:
c8693053
RO
6733 # Code from module glob:
6734 # Code from module glob-h:
6735 # Code from module hard-locale:
9c9d63b1 6736 # Code from module idx:
c8693053
RO
6737 # Code from module include_next:
6738 # Code from module inet_ntop:
6739 # Code from module intprops:
6740 # Code from module inttypes:
6741 # Code from module inttypes-incomplete:
698be2d8 6742 # Code from module isblank:
c8693053
RO
6743 # Code from module isnand-nolibm:
6744 # Code from module isnanl-nolibm:
6745 # Code from module largefile:
6746
6747 # Code from module libc-config:
6748 # Code from module limits-h:
6749 # Code from module localcharset:
6750 # Code from module locale:
c8693053
RO
6751 # Code from module lock:
6752 # Code from module lstat:
6753 # Code from module malloc-posix:
6754 # Code from module malloca:
6755 # Code from module math:
6756 # Code from module mbrtowc:
6757 # Code from module mbsinit:
6758 # Code from module mbsrtowcs:
698be2d8 6759 # Code from module mbtowc:
c8693053
RO
6760 # Code from module memchr:
6761 # Code from module memmem:
6762 # Code from module memmem-simple:
6763 # Code from module mempcpy:
6764 # Code from module memrchr:
698be2d8 6765 # Code from module minmax:
c8693053
RO
6766 # Code from module mkdir:
6767 # Code from module mkdtemp:
6768 # Code from module mkostemp:
6769 # Code from module msvc-inval:
6770 # Code from module msvc-nothrow:
6771 # Code from module multiarch:
6772 # Code from module netinet_in:
6773 # Code from module nocrash:
6774 # Code from module open:
6775 # Code from module openat:
6776 # Code from module openat-die:
6777 # Code from module openat-h:
6778 # Code from module opendir:
6779 # Code from module pathmax:
9c9d63b1 6780 # Code from module pipe-posix:
c8693053
RO
6781 # Code from module rawmemchr:
6782 # Code from module readdir:
6783 # Code from module readlink:
6784 # Code from module realloc-posix:
6785 # Code from module rename:
6786 # Code from module rewinddir:
6787 # Code from module rmdir:
6788 # Code from module same-inode:
6789 # Code from module save-cwd:
6790 # Code from module scratch_buffer:
6791 # Code from module setenv:
6792 # Code from module setlocale-null:
6793 # Code from module signal-h:
6794 # Code from module snippet/_Noreturn:
6795 # Code from module snippet/arg-nonnull:
6796 # Code from module snippet/c++defs:
6797 # Code from module snippet/warn-on-use:
6798 # Code from module socklen:
6799 # Code from module ssize_t:
6800 # Code from module stat:
6801 # Code from module stat-time:
6802 # Code from module std-gnu11:
6803 # Code from module stdalign:
6804 # Code from module stdbool:
6805 # Code from module stddef:
6806 # Code from module stdint:
6807 # Code from module stdio:
6808 # Code from module stdlib:
6809 # Code from module strchrnul:
6810 # Code from module strdup-posix:
6811 # Code from module streq:
6812 # Code from module strerror:
6813 # Code from module strerror-override:
6814 # Code from module strerror_r-posix:
6815 # Code from module string:
698be2d8 6816 # Code from module strnlen:
c8693053
RO
6817 # Code from module strnlen1:
6818 # Code from module strstr:
6819 # Code from module strstr-simple:
6820 # Code from module strtok_r:
698be2d8 6821 # Code from module sys_random:
c8693053
RO
6822 # Code from module sys_socket:
6823 # Code from module sys_stat:
6824 # Code from module sys_time:
6825 # Code from module sys_types:
6826 # Code from module sys_uio:
6827 # Code from module tempname:
6828 # Code from module threadlib:
6829
6830
6831
6832 # Code from module time:
6833 # Code from module time_r:
6834 # Code from module unistd:
6835 # Code from module unistd-safer:
6836 # Code from module unsetenv:
6837 # Code from module update-copyright:
6838 # Code from module verify:
6839 # Code from module wchar:
6840 # Code from module wctype-h:
6841 # Code from module windows-mutex:
6842 # Code from module windows-once:
6843 # Code from module windows-recmutex:
6844 # Code from module windows-rwlock:
698be2d8
CB
6845 # Code from module wmemchr:
6846 # Code from module wmempcpy:
c8693053
RO
6847 # Code from module xalloc-oversized:
6848
6849
6850am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
c971b7fa
PA
6851
6852
c0c3707f
CB
6853ac_aux_dir=
6854for ac_dir in .. "$srcdir"/..; do
6855 if test -f "$ac_dir/install-sh"; then
6856 ac_aux_dir=$ac_dir
6857 ac_install_sh="$ac_aux_dir/install-sh -c"
6858 break
6859 elif test -f "$ac_dir/install.sh"; then
6860 ac_aux_dir=$ac_dir
6861 ac_install_sh="$ac_aux_dir/install.sh -c"
6862 break
6863 elif test -f "$ac_dir/shtool"; then
6864 ac_aux_dir=$ac_dir
6865 ac_install_sh="$ac_aux_dir/shtool install -c"
6866 break
6867 fi
6868done
6869if test -z "$ac_aux_dir"; then
6870 as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5
6871fi
6872
6873# These three variables are undocumented and unsupported,
6874# and are intended to be withdrawn in a future Autoconf release.
6875# They can cause serious problems if a builder's source tree is in a directory
6876# whose full name contains unusual characters.
6877ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
6878ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
6879ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
698be2d8 6890
9c9d63b1 6891
c0c3707f
CB
6892 # Check whether --enable-cross-guesses was given.
6893if test "${enable_cross_guesses+set}" = set; then :
6894 enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
6895 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
6896$as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
6897 enableval=conservative
6898 fi
6899 gl_cross_guesses="$enableval"
6900else
6901 gl_cross_guesses=conservative
6902fi
6903
6904 if test $gl_cross_guesses = risky; then
6905 gl_cross_guess_normal="guessing yes"
6906 gl_cross_guess_inverted="guessing no"
6907 else
6908 gl_cross_guess_normal="guessing no"
6909 gl_cross_guess_inverted="guessing yes"
6910 fi
6911 LIBC_FATAL_STDERR_=1
6912 export LIBC_FATAL_STDERR_
6913
5df4cba6 6914
c0c3707f
CB
6915ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
6916if test "x$ac_cv_type_size_t" = xyes; then :
6917
6918else
6919
6920cat >>confdefs.h <<_ACEOF
6921#define size_t unsigned int
6922_ACEOF
6923
6924fi
6925
6926# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
6927# for constant arguments. Useless!
6928{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
6929$as_echo_n "checking for working alloca.h... " >&6; }
6930if ${ac_cv_working_alloca_h+:} false; then :
6931 $as_echo_n "(cached) " >&6
6932else
6933 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6934/* end confdefs.h. */
6935#include <alloca.h>
5e8754f9
SDJ
6936int
6937main ()
6938{
c0c3707f
CB
6939char *p = (char *) alloca (2 * sizeof (int));
6940 if (p) return 0;
5e8754f9
SDJ
6941 ;
6942 return 0;
6943}
6944_ACEOF
c0c3707f
CB
6945if ac_fn_c_try_link "$LINENO"; then :
6946 ac_cv_working_alloca_h=yes
6947else
6948 ac_cv_working_alloca_h=no
5e8754f9 6949fi
c0c3707f
CB
6950rm -f core conftest.err conftest.$ac_objext \
6951 conftest$ac_exeext conftest.$ac_ext
5e8754f9 6952fi
c0c3707f
CB
6953{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
6954$as_echo "$ac_cv_working_alloca_h" >&6; }
6955if test $ac_cv_working_alloca_h = yes; then
c971b7fa 6956
c0c3707f 6957$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
c971b7fa 6958
c0c3707f 6959fi
d0ac1c44 6960
c0c3707f
CB
6961{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
6962$as_echo_n "checking for alloca... " >&6; }
6963if ${ac_cv_func_alloca_works+:} false; then :
5e8754f9
SDJ
6964 $as_echo_n "(cached) " >&6
6965else
6966 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6967/* end confdefs.h. */
c0c3707f
CB
6968#ifdef __GNUC__
6969# define alloca __builtin_alloca
6970#else
6971# ifdef _MSC_VER
6972# include <malloc.h>
6973# define alloca _alloca
6974# else
6975# ifdef HAVE_ALLOCA_H
6976# include <alloca.h>
6977# else
6978# ifdef _AIX
6979 #pragma alloca
6980# else
6981# ifndef alloca /* predefined by HP cc +Olibcalls */
6982void *alloca (size_t);
6983# endif
6984# endif
6985# endif
6986# endif
6987#endif
d0ac1c44 6988
5e8754f9
SDJ
6989int
6990main ()
6991{
c0c3707f
CB
6992char *p = (char *) alloca (1);
6993 if (p) return 0;
5e8754f9
SDJ
6994 ;
6995 return 0;
6996}
6997_ACEOF
c0c3707f
CB
6998if ac_fn_c_try_link "$LINENO"; then :
6999 ac_cv_func_alloca_works=yes
7000else
7001 ac_cv_func_alloca_works=no
5e8754f9 7002fi
c0c3707f
CB
7003rm -f core conftest.err conftest.$ac_objext \
7004 conftest$ac_exeext conftest.$ac_ext
7005fi
7006{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
7007$as_echo "$ac_cv_func_alloca_works" >&6; }
7a6dbc2f 7008
c0c3707f 7009if test $ac_cv_func_alloca_works = yes; then
7a6dbc2f 7010
c0c3707f 7011$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
7a6dbc2f 7012
5e8754f9 7013else
c0c3707f
CB
7014 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
7015# that cause trouble. Some versions do not even contain alloca or
7016# contain a buggy version. If you still want to use their alloca,
7017# use ar to extract alloca.o from them instead of compiling alloca.c.
c971b7fa
PA
7018
7019
7a6dbc2f 7020
73cc7272
TT
7021
7022
c0c3707f 7023ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
73cc7272 7024
c0c3707f 7025$as_echo "#define C_ALLOCA 1" >>confdefs.h
73cc7272
TT
7026
7027
c0c3707f
CB
7028{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
7029$as_echo_n "checking stack direction for C alloca... " >&6; }
7030if ${ac_cv_c_stack_direction+:} false; then :
73cc7272
TT
7031 $as_echo_n "(cached) " >&6
7032else
c0c3707f
CB
7033 if test "$cross_compiling" = yes; then :
7034 ac_cv_c_stack_direction=0
7035else
7036 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7037/* end confdefs.h. */
c0c3707f
CB
7038$ac_includes_default
7039int
7040find_stack_direction (int *addr, int depth)
7041{
7042 int dir, dummy = 0;
7043 if (! addr)
7044 addr = &dummy;
7045 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
7046 dir = depth ? find_stack_direction (addr, depth - 1) : 0;
7047 return dir + dummy;
7048}
73cc7272 7049
73cc7272 7050int
c0c3707f 7051main (int argc, char **argv)
73cc7272 7052{
c0c3707f 7053 return find_stack_direction (0, argc + !argv + 20) < 0;
73cc7272
TT
7054}
7055_ACEOF
c0c3707f
CB
7056if ac_fn_c_try_run "$LINENO"; then :
7057 ac_cv_c_stack_direction=1
7058else
7059 ac_cv_c_stack_direction=-1
73cc7272 7060fi
c0c3707f
CB
7061rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7062 conftest.$ac_objext conftest.beam conftest.$ac_ext
73cc7272 7063fi
73cc7272 7064
73cc7272 7065fi
9c9d63b1
PM
7066{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
7067$as_echo "$ac_cv_c_stack_direction" >&6; }
7068cat >>confdefs.h <<_ACEOF
7069#define STACK_DIRECTION $ac_cv_c_stack_direction
c0c3707f
CB
7070_ACEOF
7071
9c9d63b1 7072
73cc7272
TT
7073fi
7074
9c9d63b1
PM
7075
7076 GNULIB_INET_NTOP=0;
7077 GNULIB_INET_PTON=0;
7078 HAVE_DECL_INET_NTOP=1;
7079 HAVE_DECL_INET_PTON=1;
7080 REPLACE_INET_NTOP=0;
7081 REPLACE_INET_PTON=0;
73cc7272 7082
c0c3707f
CB
7083
7084
7085
7086
7087 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
7088$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
7089if ${gl_cv_have_include_next+:} false; then :
73cc7272
TT
7090 $as_echo_n "(cached) " >&6
7091else
c0c3707f
CB
7092 rm -rf conftestd1a conftestd1b conftestd2
7093 mkdir conftestd1a conftestd1b conftestd2
7094 cat <<EOF > conftestd1a/conftest.h
7095#define DEFINED_IN_CONFTESTD1
7096#include_next <conftest.h>
7097#ifdef DEFINED_IN_CONFTESTD2
7098int foo;
7099#else
7100#error "include_next doesn't work"
7101#endif
7102EOF
7103 cat <<EOF > conftestd1b/conftest.h
7104#define DEFINED_IN_CONFTESTD1
7105#include <stdio.h>
7106#include_next <conftest.h>
7107#ifdef DEFINED_IN_CONFTESTD2
7108int foo;
7109#else
7110#error "include_next doesn't work"
7111#endif
7112EOF
7113 cat <<EOF > conftestd2/conftest.h
7114#ifndef DEFINED_IN_CONFTESTD1
7115#error "include_next test doesn't work"
7116#endif
7117#define DEFINED_IN_CONFTESTD2
7118EOF
7119 gl_save_CPPFLAGS="$CPPFLAGS"
7120 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
7121 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7122/* end confdefs.h. */
c0c3707f 7123#include <conftest.h>
73cc7272 7124_ACEOF
c0c3707f
CB
7125if ac_fn_c_try_compile "$LINENO"; then :
7126 gl_cv_have_include_next=yes
7127else
7128 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
7129 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7130/* end confdefs.h. */
7131#include <conftest.h>
7132_ACEOF
7133if ac_fn_c_try_compile "$LINENO"; then :
7134 gl_cv_have_include_next=buggy
7135else
7136 gl_cv_have_include_next=no
73cc7272 7137fi
c0c3707f
CB
7138rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7139
73cc7272 7140fi
c0c3707f
CB
7141rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7142 CPPFLAGS="$gl_save_CPPFLAGS"
7143 rm -rf conftestd1a conftestd1b conftestd2
7144
73cc7272 7145fi
c0c3707f
CB
7146{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
7147$as_echo "$gl_cv_have_include_next" >&6; }
7148 PRAGMA_SYSTEM_HEADER=
7149 if test $gl_cv_have_include_next = yes; then
7150 INCLUDE_NEXT=include_next
7151 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7152 if test -n "$GCC"; then
7153 PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
7154 fi
7155 else
7156 if test $gl_cv_have_include_next = buggy; then
7157 INCLUDE_NEXT=include
7158 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7159 else
7160 INCLUDE_NEXT=include
7161 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
7162 fi
73cc7272
TT
7163 fi
7164
73cc7272 7165
73cc7272 7166
9c9d63b1
PM
7167
7168 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether source code line length is unlimited" >&5
7169$as_echo_n "checking whether source code line length is unlimited... " >&6; }
7170if ${gl_cv_source_line_length_unlimited+:} false; then :
73cc7272
TT
7171 $as_echo_n "(cached) " >&6
7172else
9c9d63b1 7173 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7174/* end confdefs.h. */
73cc7272 7175
c0c3707f
CB
7176#ifdef __TANDEM
7177choke me
7178#endif
73cc7272 7179
73cc7272 7180_ACEOF
c0c3707f
CB
7181if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7182 $EGREP "choke me" >/dev/null 2>&1; then :
9c9d63b1 7183 gl_cv_source_line_length_unlimited=no
c0c3707f 7184else
9c9d63b1 7185 gl_cv_source_line_length_unlimited=yes
73cc7272 7186fi
c0c3707f 7187rm -f conftest*
73cc7272 7188
73cc7272
TT
7189
7190fi
9c9d63b1
PM
7191{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_source_line_length_unlimited" >&5
7192$as_echo "$gl_cv_source_line_length_unlimited" >&6; }
7193 if test $gl_cv_source_line_length_unlimited = no; then
c0c3707f
CB
7194 PRAGMA_COLUMNS="#pragma COLUMNS 10000"
7195 else
7196 PRAGMA_COLUMNS=
7197 fi
73cc7272
TT
7198
7199
7200
73cc7272 7201
73cc7272
TT
7202
7203
c0c3707f
CB
7204 if test $ac_cv_header_features_h = yes; then
7205 HAVE_FEATURES_H=1
7206 else
7207 HAVE_FEATURES_H=0
7208 fi
73cc7272 7209
7a6dbc2f
SDJ
7210
7211
7212
7213
c0c3707f
CB
7214 if test $ac_cv_header_sys_socket_h = no; then
7215 for ac_header in ws2tcpip.h
7216do :
7217 ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
7218if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
7219 cat >>confdefs.h <<_ACEOF
7220#define HAVE_WS2TCPIP_H 1
7221_ACEOF
7a6dbc2f 7222
c0c3707f 7223fi
7a6dbc2f 7224
c0c3707f 7225done
7a6dbc2f 7226
c0c3707f 7227 fi
7a6dbc2f 7228
c0c3707f
CB
7229{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7230$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7231if test -z "$MKDIR_P"; then
7232 if ${ac_cv_path_mkdir+:} false; then :
7233 $as_echo_n "(cached) " >&6
5e8754f9 7234else
c0c3707f
CB
7235 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7236for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7237do
7238 IFS=$as_save_IFS
7239 test -z "$as_dir" && as_dir=.
7240 for ac_prog in mkdir gmkdir; do
7241 for ac_exec_ext in '' $ac_executable_extensions; do
7242 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7243 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7244 'mkdir (GNU coreutils) '* | \
7245 'mkdir (coreutils) '* | \
7246 'mkdir (fileutils) '4.1*)
7247 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7248 break 3;;
7249 esac
7250 done
7251 done
7252 done
7253IFS=$as_save_IFS
7a6dbc2f 7254
5e8754f9 7255fi
7a6dbc2f 7256
c0c3707f
CB
7257 test -d ./--version && rmdir ./--version
7258 if test "${ac_cv_path_mkdir+set}" = set; then
7259 MKDIR_P="$ac_cv_path_mkdir -p"
7260 else
7261 # As a last resort, use the slow shell script. Don't cache a
7262 # value for MKDIR_P within a source directory, because that will
7263 # break other packages using the cache if that directory is
7264 # removed, or if the value is a relative name.
7265 MKDIR_P="$ac_install_sh -d"
7266 fi
5e8754f9 7267fi
c0c3707f
CB
7268{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7269$as_echo "$MKDIR_P" >&6; }
7a6dbc2f 7270
5e8754f9 7271
698be2d8
CB
7272 GNULIB_BTOWC=0;
7273 GNULIB_WCTOB=0;
7274 GNULIB_MBSINIT=0;
7275 GNULIB_MBRTOWC=0;
7276 GNULIB_MBRLEN=0;
7277 GNULIB_MBSRTOWCS=0;
7278 GNULIB_MBSNRTOWCS=0;
7279 GNULIB_WCRTOMB=0;
7280 GNULIB_WCSRTOMBS=0;
7281 GNULIB_WCSNRTOMBS=0;
7282 GNULIB_WCWIDTH=0;
7283 GNULIB_WMEMCHR=0;
7284 GNULIB_WMEMCMP=0;
7285 GNULIB_WMEMCPY=0;
7286 GNULIB_WMEMMOVE=0;
7287 GNULIB_WMEMPCPY=0;
7288 GNULIB_WMEMSET=0;
7289 GNULIB_WCSLEN=0;
7290 GNULIB_WCSNLEN=0;
7291 GNULIB_WCSCPY=0;
7292 GNULIB_WCPCPY=0;
7293 GNULIB_WCSNCPY=0;
7294 GNULIB_WCPNCPY=0;
7295 GNULIB_WCSCAT=0;
7296 GNULIB_WCSNCAT=0;
7297 GNULIB_WCSCMP=0;
7298 GNULIB_WCSNCMP=0;
7299 GNULIB_WCSCASECMP=0;
7300 GNULIB_WCSNCASECMP=0;
7301 GNULIB_WCSCOLL=0;
7302 GNULIB_WCSXFRM=0;
7303 GNULIB_WCSDUP=0;
7304 GNULIB_WCSCHR=0;
7305 GNULIB_WCSRCHR=0;
7306 GNULIB_WCSCSPN=0;
7307 GNULIB_WCSSPN=0;
7308 GNULIB_WCSPBRK=0;
7309 GNULIB_WCSSTR=0;
7310 GNULIB_WCSTOK=0;
7311 GNULIB_WCSWIDTH=0;
7312 GNULIB_WCSFTIME=0;
9c9d63b1 7313 GNULIB_MDA_WCSDUP=1;
698be2d8
CB
7314 HAVE_BTOWC=1;
7315 HAVE_MBSINIT=1;
7316 HAVE_MBRTOWC=1;
7317 HAVE_MBRLEN=1;
7318 HAVE_MBSRTOWCS=1;
7319 HAVE_MBSNRTOWCS=1;
7320 HAVE_WCRTOMB=1;
7321 HAVE_WCSRTOMBS=1;
7322 HAVE_WCSNRTOMBS=1;
7323 HAVE_WMEMCHR=1;
7324 HAVE_WMEMCMP=1;
7325 HAVE_WMEMCPY=1;
7326 HAVE_WMEMMOVE=1;
7327 HAVE_WMEMPCPY=1;
7328 HAVE_WMEMSET=1;
7329 HAVE_WCSLEN=1;
7330 HAVE_WCSNLEN=1;
7331 HAVE_WCSCPY=1;
7332 HAVE_WCPCPY=1;
7333 HAVE_WCSNCPY=1;
7334 HAVE_WCPNCPY=1;
7335 HAVE_WCSCAT=1;
7336 HAVE_WCSNCAT=1;
7337 HAVE_WCSCMP=1;
7338 HAVE_WCSNCMP=1;
7339 HAVE_WCSCASECMP=1;
7340 HAVE_WCSNCASECMP=1;
7341 HAVE_WCSCOLL=1;
7342 HAVE_WCSXFRM=1;
7343 HAVE_WCSDUP=1;
7344 HAVE_WCSCHR=1;
7345 HAVE_WCSRCHR=1;
7346 HAVE_WCSCSPN=1;
7347 HAVE_WCSSPN=1;
7348 HAVE_WCSPBRK=1;
7349 HAVE_WCSSTR=1;
7350 HAVE_WCSTOK=1;
7351 HAVE_WCSWIDTH=1;
7352 HAVE_WCSFTIME=1;
7353 HAVE_DECL_WCTOB=1;
9c9d63b1 7354 HAVE_DECL_WCSDUP=1;
698be2d8
CB
7355 HAVE_DECL_WCWIDTH=1;
7356 REPLACE_MBSTATE_T=0;
7357 REPLACE_BTOWC=0;
7358 REPLACE_WCTOB=0;
7359 REPLACE_MBSINIT=0;
7360 REPLACE_MBRTOWC=0;
7361 REPLACE_MBRLEN=0;
7362 REPLACE_MBSRTOWCS=0;
7363 REPLACE_MBSNRTOWCS=0;
7364 REPLACE_WCRTOMB=0;
7365 REPLACE_WCSRTOMBS=0;
7366 REPLACE_WCSNRTOMBS=0;
7367 REPLACE_WCWIDTH=0;
7368 REPLACE_WCSWIDTH=0;
7369 REPLACE_WCSFTIME=0;
7370 REPLACE_WCSTOK=0;
7371
7372
9c9d63b1
PM
7373
7374 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
698be2d8
CB
7375$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
7376if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
7377 $as_echo_n "(cached) " >&6
7378else
7379 gl_cv_header_wchar_h_correct_inline=yes
9c9d63b1
PM
7380 case "$host_os" in
7381 *-gnu* | gnu*)
7382 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
698be2d8
CB
7383/* end confdefs.h. */
7384
9c9d63b1
PM
7385
7386 #define wcstod renamed_wcstod
7387 #include <wchar.h>
7388 extern int zero (void);
7389 int main () { return zero(); }
698be2d8
CB
7390
7391_ACEOF
9c9d63b1
PM
7392 save_ac_compile="$ac_compile"
7393 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
7394 if echo '#include "conftest.c"' >conftest1.c \
7395 && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
698be2d8
CB
7396 (eval $ac_compile) 2>&5
7397 ac_status=$?
7398 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7399 test $ac_status = 0; }; then
9c9d63b1 7400 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
698be2d8
CB
7401/* end confdefs.h. */
7402
9c9d63b1
PM
7403
7404 #define wcstod renamed_wcstod
7405 #include <wchar.h>
7406 int zero (void) { return 0; }
698be2d8
CB
7407
7408_ACEOF
9c9d63b1
PM
7409 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
7410 if echo '#include "conftest.c"' >conftest2.c \
7411 && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
698be2d8
CB
7412 (eval $ac_compile) 2>&5
7413 ac_status=$?
7414 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7415 test $ac_status = 0; }; then
9c9d63b1
PM
7416 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
7417 :
7418 else
7419 gl_cv_header_wchar_h_correct_inline=no
7420 fi
7421 fi
698be2d8 7422 fi
9c9d63b1
PM
7423 ac_compile="$save_ac_compile"
7424 rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
7425 ;;
7426 esac
698be2d8
CB
7427
7428fi
7429{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
7430$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
7431 if test $gl_cv_header_wchar_h_correct_inline = no; then
7432 as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
7433This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
7434C99 mode. You have four options:
7435 - Add the flag -fgnu89-inline to CC and reconfigure, or
7436 - Fix your include files, using parts of
7437 <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
7438 - Use a gcc version older than 4.3, or
7439 - Don't use the flags -std=c99 or -std=gnu99.
7440Configuration aborted." "$LINENO" 5
7441 fi
7442
7443
7444
7445
7446 for ac_func in $ac_func_list
7447do :
7448 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
7449ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
7450if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
7451 cat >>confdefs.h <<_ACEOF
7452#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
7453_ACEOF
7454
7455fi
7456done
7457
7458
7459
7460
7461 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
7462$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
7463if ${am_cv_langinfo_codeset+:} false; then :
7464 $as_echo_n "(cached) " >&6
7465else
7466 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7467/* end confdefs.h. */
7468#include <langinfo.h>
7469int
7470main ()
7471{
7472char* cs = nl_langinfo(CODESET); return !cs;
7473 ;
7474 return 0;
7475}
7476_ACEOF
7477if ac_fn_c_try_link "$LINENO"; then :
7478 am_cv_langinfo_codeset=yes
7479else
7480 am_cv_langinfo_codeset=no
7481fi
7482rm -f core conftest.err conftest.$ac_objext \
7483 conftest$ac_exeext conftest.$ac_ext
7484
7485fi
7486{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
7487$as_echo "$am_cv_langinfo_codeset" >&6; }
7488 if test $am_cv_langinfo_codeset = yes; then
7489
7490$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
7491
7492 fi
7493
7494
7495
7496
7497 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
7498$as_echo_n "checking for a traditional french locale... " >&6; }
7499if ${gt_cv_locale_fr+:} false; then :
7500 $as_echo_n "(cached) " >&6
7501else
7502
7503 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7504/* end confdefs.h. */
7505
7506#include <locale.h>
7507#include <time.h>
7508#if HAVE_LANGINFO_CODESET
7509# include <langinfo.h>
7510#endif
7511#include <stdlib.h>
7512#include <string.h>
7513struct tm t;
7514char buf[16];
7515int main () {
7516 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
7517 imitates locale dependent behaviour by looking at the environment
7518 variables, and all locales use the UTF-8 encoding. */
7519#if defined __BEOS__ || defined __HAIKU__
7520 return 1;
7521#else
7522 /* Check whether the given locale name is recognized by the system. */
7523# if defined _WIN32 && !defined __CYGWIN__
7524 /* On native Windows, setlocale(category, "") looks at the system settings,
7525 not at the environment variables. Also, when an encoding suffix such
7526 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
7527 category of the locale to "C". */
7528 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
7529 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
7530 return 1;
7531# else
7532 if (setlocale (LC_ALL, "") == NULL) return 1;
7533# endif
7534 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
7535 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
7536 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
7537 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
7538 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
7539 some unit tests fail.
7540 On MirBSD 10, when an unsupported locale is specified, setlocale()
7541 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
7542# if HAVE_LANGINFO_CODESET
7543 {
7544 const char *cs = nl_langinfo (CODESET);
7545 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
7546 || strcmp (cs, "UTF-8") == 0)
7547 return 1;
7548 }
7549# endif
7550# ifdef __CYGWIN__
7551 /* On Cygwin, avoid locale names without encoding suffix, because the
7552 locale_charset() function relies on the encoding suffix. Note that
7553 LC_ALL is set on the command line. */
7554 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
7555# endif
7556 /* Check whether in the abbreviation of the second month, the second
7557 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
7558 one byte long. This excludes the UTF-8 encoding. */
7559 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
7560 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
7561# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
7562 /* Check whether the decimal separator is a comma.
7563 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
7564 are nl_langinfo(RADIXCHAR) are both ".". */
7565 if (localeconv () ->decimal_point[0] != ',') return 1;
7566# endif
7567 return 0;
7568#endif
7569}
7570
7571_ACEOF
7572 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
7573 (eval $ac_link) 2>&5
7574 ac_status=$?
7575 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7576 test $ac_status = 0; } && test -s conftest$ac_exeext; then
7577 case "$host_os" in
7578 # Handle native Windows specially, because there setlocale() interprets
7579 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
7580 # "fr" or "fra" as "French" or "French_France.1252",
7581 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
7582 # "ja" as "Japanese" or "Japanese_Japan.932",
7583 # and similar.
7584 mingw*)
7585 # Test for the native Windows locale name.
7586 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7587 gt_cv_locale_fr=French_France.1252
7588 else
7589 # None found.
7590 gt_cv_locale_fr=none
7591 fi
7592 ;;
7593 *)
7594 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
7595 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
7596 # configure script would override the LC_ALL setting. Likewise for
7597 # LC_CTYPE, which is also set at the beginning of the configure script.
7598 # Test for the usual locale name.
7599 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7600 gt_cv_locale_fr=fr_FR
7601 else
7602 # Test for the locale name with explicit encoding suffix.
7603 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7604 gt_cv_locale_fr=fr_FR.ISO-8859-1
7605 else
7606 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
7607 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7608 gt_cv_locale_fr=fr_FR.ISO8859-1
7609 else
7610 # Test for the HP-UX locale name.
7611 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7612 gt_cv_locale_fr=fr_FR.iso88591
7613 else
7614 # Test for the Solaris 7 locale name.
7615 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7616 gt_cv_locale_fr=fr
7617 else
7618 # None found.
7619 gt_cv_locale_fr=none
7620 fi
7621 fi
7622 fi
7623 fi
7624 fi
7625 ;;
7626 esac
7627 fi
7628 rm -fr conftest*
7629
7630fi
7631{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
7632$as_echo "$gt_cv_locale_fr" >&6; }
7633 LOCALE_FR=$gt_cv_locale_fr
7634
7635
7636
7637 GNULIB__EXIT=0;
9c9d63b1 7638 GNULIB_ALIGNED_ALLOC=0;
698be2d8
CB
7639 GNULIB_ATOLL=0;
7640 GNULIB_CALLOC_POSIX=0;
7641 GNULIB_CANONICALIZE_FILE_NAME=0;
9c9d63b1 7642 GNULIB_FREE_POSIX=0;
698be2d8
CB
7643 GNULIB_GETLOADAVG=0;
7644 GNULIB_GETSUBOPT=0;
7645 GNULIB_GRANTPT=0;
7646 GNULIB_MALLOC_POSIX=0;
7647 GNULIB_MBTOWC=0;
7648 GNULIB_MKDTEMP=0;
7649 GNULIB_MKOSTEMP=0;
7650 GNULIB_MKOSTEMPS=0;
7651 GNULIB_MKSTEMP=0;
7652 GNULIB_MKSTEMPS=0;
9c9d63b1 7653 GNULIB_POSIX_MEMALIGN=0;
698be2d8
CB
7654 GNULIB_POSIX_OPENPT=0;
7655 GNULIB_PTSNAME=0;
7656 GNULIB_PTSNAME_R=0;
7657 GNULIB_PUTENV=0;
7658 GNULIB_QSORT_R=0;
7659 GNULIB_RANDOM=0;
7660 GNULIB_RANDOM_R=0;
7661 GNULIB_REALLOCARRAY=0;
7662 GNULIB_REALLOC_POSIX=0;
7663 GNULIB_REALPATH=0;
7664 GNULIB_RPMATCH=0;
7665 GNULIB_SECURE_GETENV=0;
7666 GNULIB_SETENV=0;
7667 GNULIB_STRTOD=0;
7668 GNULIB_STRTOLD=0;
7669 GNULIB_STRTOLL=0;
7670 GNULIB_STRTOULL=0;
7671 GNULIB_SYSTEM_POSIX=0;
7672 GNULIB_UNLOCKPT=0;
7673 GNULIB_UNSETENV=0;
7674 GNULIB_WCTOMB=0;
9c9d63b1
PM
7675 GNULIB_MDA_ECVT=1;
7676 GNULIB_MDA_FCVT=1;
7677 GNULIB_MDA_GCVT=1;
7678 GNULIB_MDA_MKTEMP=1;
7679 GNULIB_MDA_PUTENV=1;
698be2d8 7680 HAVE__EXIT=1;
9c9d63b1 7681 HAVE_ALIGNED_ALLOC=1;
698be2d8
CB
7682 HAVE_ATOLL=1;
7683 HAVE_CANONICALIZE_FILE_NAME=1;
9c9d63b1
PM
7684 HAVE_DECL_ECVT=1;
7685 HAVE_DECL_FCVT=1;
7686 HAVE_DECL_GCVT=1;
698be2d8
CB
7687 HAVE_DECL_GETLOADAVG=1;
7688 HAVE_GETSUBOPT=1;
7689 HAVE_GRANTPT=1;
7690 HAVE_INITSTATE=1;
7691 HAVE_DECL_INITSTATE=1;
7692 HAVE_MBTOWC=1;
7693 HAVE_MKDTEMP=1;
7694 HAVE_MKOSTEMP=1;
7695 HAVE_MKOSTEMPS=1;
7696 HAVE_MKSTEMP=1;
7697 HAVE_MKSTEMPS=1;
9c9d63b1 7698 HAVE_POSIX_MEMALIGN=1;
698be2d8
CB
7699 HAVE_POSIX_OPENPT=1;
7700 HAVE_PTSNAME=1;
7701 HAVE_PTSNAME_R=1;
c0c3707f
CB
7702 HAVE_QSORT_R=1;
7703 HAVE_RANDOM=1;
7704 HAVE_RANDOM_H=1;
7705 HAVE_RANDOM_R=1;
7706 HAVE_REALLOCARRAY=1;
7707 HAVE_REALPATH=1;
7708 HAVE_RPMATCH=1;
7709 HAVE_SECURE_GETENV=1;
7710 HAVE_SETENV=1;
7711 HAVE_DECL_SETENV=1;
7712 HAVE_SETSTATE=1;
7713 HAVE_DECL_SETSTATE=1;
7714 HAVE_STRTOD=1;
7715 HAVE_STRTOLD=1;
7716 HAVE_STRTOLL=1;
7717 HAVE_STRTOULL=1;
7718 HAVE_STRUCT_RANDOM_DATA=1;
7719 HAVE_SYS_LOADAVG_H=0;
7720 HAVE_UNLOCKPT=1;
7721 HAVE_DECL_UNSETENV=1;
9c9d63b1 7722 REPLACE_ALIGNED_ALLOC=0;
c0c3707f
CB
7723 REPLACE_CALLOC=0;
7724 REPLACE_CANONICALIZE_FILE_NAME=0;
9c9d63b1 7725 REPLACE_FREE=0;
c0c3707f
CB
7726 REPLACE_INITSTATE=0;
7727 REPLACE_MALLOC=0;
7728 REPLACE_MBTOWC=0;
7729 REPLACE_MKSTEMP=0;
9c9d63b1 7730 REPLACE_POSIX_MEMALIGN=0;
c0c3707f
CB
7731 REPLACE_PTSNAME=0;
7732 REPLACE_PTSNAME_R=0;
7733 REPLACE_PUTENV=0;
7734 REPLACE_QSORT_R=0;
7735 REPLACE_RANDOM=0;
7736 REPLACE_RANDOM_R=0;
7737 REPLACE_REALLOC=0;
7738 REPLACE_REALPATH=0;
7739 REPLACE_SETENV=0;
7740 REPLACE_SETSTATE=0;
7741 REPLACE_STRTOD=0;
7742 REPLACE_STRTOLD=0;
7743 REPLACE_UNSETENV=0;
7744 REPLACE_WCTOMB=0;
7a6dbc2f 7745
7a6dbc2f 7746
9c9d63b1
PM
7747 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
7748$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
7749if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
7750 $as_echo_n "(cached) " >&6
7751else
7752 rm -f conftest.sym conftest.file
7753 echo >conftest.file
7754 if test "$cross_compiling" = yes; then :
7755 case "$host_os" in
7756 linux-* | linux)
7757 # Guess yes on Linux systems.
7758 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
7759 *-gnu* | gnu*)
7760 # Guess yes on glibc systems.
7761 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
7762 mingw*)
7763 # Guess no on native Windows.
7764 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
7765 *)
7766 # If we don't know, obey --enable-cross-guesses.
7767 gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
7768 esac
7769
7770else
7771 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7772/* end confdefs.h. */
7773$ac_includes_default
7774int
7775main ()
7776{
7777struct stat sbuf;
7778 if (symlink ("conftest.file", "conftest.sym") != 0)
7779 return 1;
7780 /* Linux will dereference the symlink and fail, as required by
7781 POSIX. That is better in the sense that it means we will not
7782 have to compile and use the lstat wrapper. */
7783 return lstat ("conftest.sym/", &sbuf) == 0;
7784
7785 ;
7786 return 0;
7787}
7788_ACEOF
7789if ac_fn_c_try_run "$LINENO"; then :
7790 gl_cv_func_lstat_dereferences_slashed_symlink=yes
7791else
7792 gl_cv_func_lstat_dereferences_slashed_symlink=no
7793fi
7794rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7795 conftest.$ac_objext conftest.beam conftest.$ac_ext
7796fi
7797
7798 rm -f conftest.sym conftest.file
7799
7800fi
7801{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
7802$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
7803 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
7804 *yes)
7805
7806cat >>confdefs.h <<_ACEOF
7807#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
7808_ACEOF
7809
7810 ;;
7811 esac
98399780 7812
98399780 7813
472fa5ee
SM
7814
7815
7816
7817
7818
c0c3707f
CB
7819 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
7820$as_echo_n "checking whether // is distinct from /... " >&6; }
7821if ${gl_cv_double_slash_root+:} false; then :
7822 $as_echo_n "(cached) " >&6
5e8754f9 7823else
c0c3707f
CB
7824 if test x"$cross_compiling" = xyes ; then
7825 # When cross-compiling, there is no way to tell whether // is special
7826 # short of a list of hosts. However, the only known hosts to date
7827 # that have a distinct // are Apollo DomainOS (too old to port to),
7828 # Cygwin, and z/OS. If anyone knows of another system for which // has
7829 # special semantics and is distinct from /, please report it to
7830 # <bug-gnulib@gnu.org>.
7831 case $host in
7832 *-cygwin | i370-ibm-openedition)
7833 gl_cv_double_slash_root=yes ;;
7834 *)
7835 # Be optimistic and assume that / and // are the same when we
7836 # don't know.
7837 gl_cv_double_slash_root='unknown, assuming no' ;;
7838 esac
7839 else
7840 set x `ls -di / // 2>/dev/null`
7841 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
7842 gl_cv_double_slash_root=no
7843 else
7844 gl_cv_double_slash_root=yes
7845 fi
7846 fi
5e8754f9 7847fi
c0c3707f
CB
7848{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
7849$as_echo "$gl_cv_double_slash_root" >&6; }
7850 if test "$gl_cv_double_slash_root" = yes; then
472fa5ee 7851
c0c3707f 7852$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
472fa5ee 7853
c0c3707f 7854 fi
472fa5ee
SM
7855
7856
472fa5ee 7857
c0c3707f
CB
7858
7859
7860 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
7861$as_echo_n "checking whether realpath works... " >&6; }
7862if ${gl_cv_func_realpath_works+:} false; then :
5e8754f9
SDJ
7863 $as_echo_n "(cached) " >&6
7864else
c0c3707f 7865
9c9d63b1 7866 rm -rf conftest.a conftest.d
c0c3707f
CB
7867 touch conftest.a
7868 mkdir conftest.d
7869 if test "$cross_compiling" = yes; then :
7870 case "$host_os" in
7871 # Guess yes on glibc systems.
7872 *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
7873 # Guess yes on musl systems.
7874 *-musl*) gl_cv_func_realpath_works="guessing yes" ;;
7875 # Guess no on native Windows.
7876 mingw*) gl_cv_func_realpath_works="guessing no" ;;
7877 # If we don't know, obey --enable-cross-guesses.
7878 *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
7879 esac
7880
5e8754f9
SDJ
7881else
7882 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7883/* end confdefs.h. */
c0c3707f
CB
7884
7885
7886
7887#include <stdlib.h>
7888#if defined __MACH__ && defined __APPLE__
7889/* Avoid a crash on Mac OS X. */
7890#include <mach/mach.h>
7891#include <mach/mach_error.h>
7892#include <mach/thread_status.h>
7893#include <mach/exception.h>
7894#include <mach/task.h>
7895#include <pthread.h>
7896/* The exception port on which our thread listens. */
7897static mach_port_t our_exception_port;
7898/* The main function of the thread listening for exceptions of type
7899 EXC_BAD_ACCESS. */
7900static void *
7901mach_exception_thread (void *arg)
5e8754f9 7902{
c0c3707f
CB
7903 /* Buffer for a message to be received. */
7904 struct {
7905 mach_msg_header_t head;
7906 mach_msg_body_t msgh_body;
7907 char data[1024];
7908 } msg;
7909 mach_msg_return_t retval;
7910 /* Wait for a message on the exception port. */
7911 retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
7912 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
7913 if (retval != MACH_MSG_SUCCESS)
7914 abort ();
7915 exit (1);
7916}
7917static void
7918nocrash_init (void)
7919{
7920 mach_port_t self = mach_task_self ();
7921 /* Allocate a port on which the thread shall listen for exceptions. */
7922 if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
7923 == KERN_SUCCESS) {
7924 /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
7925 if (mach_port_insert_right (self, our_exception_port, our_exception_port,
7926 MACH_MSG_TYPE_MAKE_SEND)
7927 == KERN_SUCCESS) {
7928 /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
7929 for us. */
7930 exception_mask_t mask = EXC_MASK_BAD_ACCESS;
7931 /* Create the thread listening on the exception port. */
7932 pthread_attr_t attr;
7933 pthread_t thread;
7934 if (pthread_attr_init (&attr) == 0
7935 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
7936 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
7937 pthread_attr_destroy (&attr);
7938 /* Replace the exception port info for these exceptions with our own.
7939 Note that we replace the exception port for the entire task, not only
7940 for a particular thread. This has the effect that when our exception
7941 port gets the message, the thread specific exception port has already
7942 been asked, and we don't need to bother about it.
7943 See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
7944 task_set_exception_ports (self, mask, our_exception_port,
7945 EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
7946 }
7947 }
7948 }
7949}
7950#elif defined _WIN32 && ! defined __CYGWIN__
7951/* Avoid a crash on native Windows. */
7952#define WIN32_LEAN_AND_MEAN
7953#include <windows.h>
7954#include <winerror.h>
7955static LONG WINAPI
7956exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
7957{
7958 switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
7959 {
7960 case EXCEPTION_ACCESS_VIOLATION:
7961 case EXCEPTION_IN_PAGE_ERROR:
7962 case EXCEPTION_STACK_OVERFLOW:
7963 case EXCEPTION_GUARD_PAGE:
7964 case EXCEPTION_PRIV_INSTRUCTION:
7965 case EXCEPTION_ILLEGAL_INSTRUCTION:
7966 case EXCEPTION_DATATYPE_MISALIGNMENT:
7967 case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
7968 case EXCEPTION_NONCONTINUABLE_EXCEPTION:
7969 exit (1);
7970 }
7971 return EXCEPTION_CONTINUE_SEARCH;
7972}
7973static void
7974nocrash_init (void)
7975{
7976 SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
7977}
7978#else
7979/* Avoid a crash on POSIX systems. */
7980#include <signal.h>
7981#include <unistd.h>
7982/* A POSIX signal handler. */
7983static void
7984exception_handler (int sig)
7985{
7986 _exit (1);
7987}
7988static void
7989nocrash_init (void)
7990{
7991#ifdef SIGSEGV
7992 signal (SIGSEGV, exception_handler);
7993#endif
7994#ifdef SIGBUS
7995 signal (SIGBUS, exception_handler);
7996#endif
5e8754f9 7997}
c0c3707f
CB
7998#endif
7999
8000 #include <stdlib.h>
8001 #include <string.h>
472fa5ee 8002
5e8754f9 8003int
c0c3707f 8004main ()
5e8754f9 8005{
c0c3707f
CB
8006
8007 int result = 0;
8008 {
8009 char *name = realpath ("conftest.a", NULL);
8010 if (!(name && *name == '/'))
8011 result |= 1;
8012 free (name);
8013 }
8014 {
8015 char *name = realpath ("conftest.b/../conftest.a", NULL);
8016 if (name != NULL)
8017 result |= 2;
8018 free (name);
8019 }
8020 {
8021 char *name = realpath ("conftest.a/", NULL);
8022 if (name != NULL)
8023 result |= 4;
8024 free (name);
8025 }
8026 {
8027 char *name1 = realpath (".", NULL);
8028 char *name2 = realpath ("conftest.d//./..", NULL);
8029 if (! name1 || ! name2 || strcmp (name1, name2))
8030 result |= 8;
8031 free (name1);
8032 free (name2);
8033 }
8034 return result;
8035
8036 ;
8037 return 0;
5e8754f9 8038}
c0c3707f 8039
5e8754f9
SDJ
8040_ACEOF
8041if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 8042 gl_cv_func_realpath_works=yes
5e8754f9 8043else
c0c3707f 8044 gl_cv_func_realpath_works=no
5e8754f9
SDJ
8045fi
8046rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8047 conftest.$ac_objext conftest.beam conftest.$ac_ext
8048fi
472fa5ee 8049
c0c3707f 8050 rm -rf conftest.a conftest.d
98399780 8051
5e8754f9 8052fi
c0c3707f
CB
8053{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
8054$as_echo "$gl_cv_func_realpath_works" >&6; }
8055 case "$gl_cv_func_realpath_works" in
8056 *yes)
98399780 8057
c0c3707f 8058$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
98399780 8059
c0c3707f
CB
8060 ;;
8061 esac
725e2999
JB
8062
8063
725e2999 8064
725e2999 8065
725e2999
JB
8066
8067
8068
8069
8070
9c9d63b1
PM
8071 case "$host_os" in
8072 mingw*) ;;
8073 *) for ac_func in getcwd
8074do :
8075 ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
8076if test "x$ac_cv_func_getcwd" = xyes; then :
8077 cat >>confdefs.h <<_ACEOF
8078#define HAVE_GETCWD 1
8079_ACEOF
8080
8081fi
8082done
8083 ;;
8084 esac
8085
8086
8087
8088
725e2999
JB
8089
8090
c0c3707f
CB
8091 GNULIB_ACCESS=0;
8092 GNULIB_CHDIR=0;
8093 GNULIB_CHOWN=0;
8094 GNULIB_CLOSE=0;
8095 GNULIB_COPY_FILE_RANGE=0;
8096 GNULIB_DUP=0;
8097 GNULIB_DUP2=0;
8098 GNULIB_DUP3=0;
8099 GNULIB_ENVIRON=0;
8100 GNULIB_EUIDACCESS=0;
9c9d63b1
PM
8101 GNULIB_EXECL=0;
8102 GNULIB_EXECLE=0;
8103 GNULIB_EXECLP=0;
8104 GNULIB_EXECV=0;
8105 GNULIB_EXECVE=0;
8106 GNULIB_EXECVP=0;
8107 GNULIB_EXECVPE=0;
c0c3707f
CB
8108 GNULIB_FACCESSAT=0;
8109 GNULIB_FCHDIR=0;
8110 GNULIB_FCHOWNAT=0;
8111 GNULIB_FDATASYNC=0;
8112 GNULIB_FSYNC=0;
8113 GNULIB_FTRUNCATE=0;
8114 GNULIB_GETCWD=0;
8115 GNULIB_GETDOMAINNAME=0;
8116 GNULIB_GETDTABLESIZE=0;
698be2d8 8117 GNULIB_GETENTROPY=0;
c0c3707f
CB
8118 GNULIB_GETGROUPS=0;
8119 GNULIB_GETHOSTNAME=0;
8120 GNULIB_GETLOGIN=0;
8121 GNULIB_GETLOGIN_R=0;
5df4cba6 8122 GNULIB_GETOPT_POSIX=0;
c0c3707f
CB
8123 GNULIB_GETPAGESIZE=0;
8124 GNULIB_GETPASS=0;
8125 GNULIB_GETUSERSHELL=0;
8126 GNULIB_GROUP_MEMBER=0;
8127 GNULIB_ISATTY=0;
8128 GNULIB_LCHOWN=0;
8129 GNULIB_LINK=0;
8130 GNULIB_LINKAT=0;
8131 GNULIB_LSEEK=0;
8132 GNULIB_PIPE=0;
8133 GNULIB_PIPE2=0;
8134 GNULIB_PREAD=0;
8135 GNULIB_PWRITE=0;
8136 GNULIB_READ=0;
8137 GNULIB_READLINK=0;
8138 GNULIB_READLINKAT=0;
8139 GNULIB_RMDIR=0;
8140 GNULIB_SETHOSTNAME=0;
8141 GNULIB_SLEEP=0;
8142 GNULIB_SYMLINK=0;
8143 GNULIB_SYMLINKAT=0;
8144 GNULIB_TRUNCATE=0;
8145 GNULIB_TTYNAME_R=0;
8146 GNULIB_UNISTD_H_NONBLOCKING=0;
8147 GNULIB_UNISTD_H_SIGPIPE=0;
8148 GNULIB_UNLINK=0;
8149 GNULIB_UNLINKAT=0;
8150 GNULIB_USLEEP=0;
8151 GNULIB_WRITE=0;
9c9d63b1
PM
8152 GNULIB_MDA_ACCESS=1;
8153 GNULIB_MDA_CHDIR=1;
8154 GNULIB_MDA_CLOSE=1;
8155 GNULIB_MDA_DUP=1;
8156 GNULIB_MDA_DUP2=1;
8157 GNULIB_MDA_EXECL=1;
8158 GNULIB_MDA_EXECLE=1;
8159 GNULIB_MDA_EXECLP=1;
8160 GNULIB_MDA_EXECV=1;
8161 GNULIB_MDA_EXECVE=1;
8162 GNULIB_MDA_EXECVP=1;
8163 GNULIB_MDA_EXECVPE=1;
8164 GNULIB_MDA_GETCWD=1;
8165 GNULIB_MDA_GETPID=1;
8166 GNULIB_MDA_ISATTY=1;
8167 GNULIB_MDA_LSEEK=1;
8168 GNULIB_MDA_READ=1;
8169 GNULIB_MDA_RMDIR=1;
8170 GNULIB_MDA_SWAB=1;
8171 GNULIB_MDA_UNLINK=1;
8172 GNULIB_MDA_WRITE=1;
c0c3707f
CB
8173 HAVE_CHOWN=1;
8174 HAVE_COPY_FILE_RANGE=1;
c0c3707f
CB
8175 HAVE_DUP3=1;
8176 HAVE_EUIDACCESS=1;
9c9d63b1 8177 HAVE_EXECVPE=1;
c0c3707f
CB
8178 HAVE_FACCESSAT=1;
8179 HAVE_FCHDIR=1;
8180 HAVE_FCHOWNAT=1;
8181 HAVE_FDATASYNC=1;
8182 HAVE_FSYNC=1;
8183 HAVE_FTRUNCATE=1;
8184 HAVE_GETDTABLESIZE=1;
698be2d8 8185 HAVE_GETENTROPY=1;
c0c3707f
CB
8186 HAVE_GETGROUPS=1;
8187 HAVE_GETHOSTNAME=1;
8188 HAVE_GETLOGIN=1;
8189 HAVE_GETPAGESIZE=1;
8190 HAVE_GETPASS=1;
8191 HAVE_GROUP_MEMBER=1;
8192 HAVE_LCHOWN=1;
8193 HAVE_LINK=1;
8194 HAVE_LINKAT=1;
8195 HAVE_PIPE=1;
8196 HAVE_PIPE2=1;
8197 HAVE_PREAD=1;
8198 HAVE_PWRITE=1;
8199 HAVE_READLINK=1;
8200 HAVE_READLINKAT=1;
8201 HAVE_SETHOSTNAME=1;
8202 HAVE_SLEEP=1;
8203 HAVE_SYMLINK=1;
8204 HAVE_SYMLINKAT=1;
8205 HAVE_UNLINKAT=1;
8206 HAVE_USLEEP=1;
8207 HAVE_DECL_ENVIRON=1;
9c9d63b1 8208 HAVE_DECL_EXECVPE=1;
c0c3707f
CB
8209 HAVE_DECL_FCHDIR=1;
8210 HAVE_DECL_FDATASYNC=1;
8211 HAVE_DECL_GETDOMAINNAME=1;
8212 HAVE_DECL_GETLOGIN=1;
8213 HAVE_DECL_GETLOGIN_R=1;
8214 HAVE_DECL_GETPAGESIZE=1;
8215 HAVE_DECL_GETUSERSHELL=1;
8216 HAVE_DECL_SETHOSTNAME=1;
8217 HAVE_DECL_TRUNCATE=1;
8218 HAVE_DECL_TTYNAME_R=1;
8219 HAVE_OS_H=0;
8220 HAVE_SYS_PARAM_H=0;
8221 REPLACE_ACCESS=0;
8222 REPLACE_CHOWN=0;
8223 REPLACE_CLOSE=0;
8224 REPLACE_DUP=0;
8225 REPLACE_DUP2=0;
9c9d63b1
PM
8226 REPLACE_EXECL=0;
8227 REPLACE_EXECLE=0;
8228 REPLACE_EXECLP=0;
8229 REPLACE_EXECV=0;
8230 REPLACE_EXECVE=0;
8231 REPLACE_EXECVP=0;
8232 REPLACE_EXECVPE=0;
c0c3707f
CB
8233 REPLACE_FACCESSAT=0;
8234 REPLACE_FCHOWNAT=0;
8235 REPLACE_FTRUNCATE=0;
8236 REPLACE_GETCWD=0;
8237 REPLACE_GETDOMAINNAME=0;
8238 REPLACE_GETDTABLESIZE=0;
8239 REPLACE_GETLOGIN_R=0;
8240 REPLACE_GETGROUPS=0;
8241 REPLACE_GETPAGESIZE=0;
8242 REPLACE_GETPASS=0;
8243 REPLACE_ISATTY=0;
8244 REPLACE_LCHOWN=0;
8245 REPLACE_LINK=0;
8246 REPLACE_LINKAT=0;
8247 REPLACE_LSEEK=0;
8248 REPLACE_PREAD=0;
8249 REPLACE_PWRITE=0;
8250 REPLACE_READ=0;
8251 REPLACE_READLINK=0;
8252 REPLACE_READLINKAT=0;
8253 REPLACE_RMDIR=0;
8254 REPLACE_SLEEP=0;
8255 REPLACE_SYMLINK=0;
8256 REPLACE_SYMLINKAT=0;
8257 REPLACE_TRUNCATE=0;
8258 REPLACE_TTYNAME_R=0;
8259 REPLACE_UNLINK=0;
8260 REPLACE_UNLINKAT=0;
8261 REPLACE_USLEEP=0;
8262 REPLACE_WRITE=0;
698be2d8 8263 UNISTD_H_HAVE_SYS_RANDOM_H=0;
c0c3707f
CB
8264 UNISTD_H_HAVE_WINSOCK2_H=0;
8265 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
725e2999 8266
725e2999 8267
725e2999
JB
8268
8269
8270
725e2999 8271
725e2999 8272
725e2999
JB
8273
8274
c0c3707f
CB
8275
8276
8277 if test $ac_cv_func__set_invalid_parameter_handler = yes; then
8278 HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
8279
8280$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
8281
725e2999 8282 else
c0c3707f 8283 HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
725e2999
JB
8284 fi
8285
8286
8287
8288
8289
c0c3707f
CB
8290 GNULIB_OPENDIR=0;
8291 GNULIB_READDIR=0;
8292 GNULIB_REWINDDIR=0;
8293 GNULIB_CLOSEDIR=0;
8294 GNULIB_DIRFD=0;
8295 GNULIB_FDOPENDIR=0;
8296 GNULIB_SCANDIR=0;
8297 GNULIB_ALPHASORT=0;
8298 HAVE_OPENDIR=1;
8299 HAVE_READDIR=1;
8300 HAVE_REWINDDIR=1;
8301 HAVE_CLOSEDIR=1;
8302 HAVE_DECL_DIRFD=1;
8303 HAVE_DECL_FDOPENDIR=1;
8304 HAVE_FDOPENDIR=1;
8305 HAVE_SCANDIR=1;
8306 HAVE_ALPHASORT=1;
8307 REPLACE_OPENDIR=0;
8308 REPLACE_CLOSEDIR=0;
8309 REPLACE_DIRFD=0;
8310 REPLACE_FDOPENDIR=0;
725e2999
JB
8311
8312
698be2d8
CB
8313 GNULIB_ISBLANK=0;
8314 HAVE_ISBLANK=1;
8315
8316
725e2999 8317
9c9d63b1
PM
8318gl_mda_defines='
8319#if defined _WIN32 && !defined __CYGWIN__
8320#define access _access
8321#define chdir _chdir
8322#define chmod _chmod
8323#define close _close
8324#define creat _creat
8325#define dup _dup
8326#define dup2 _dup2
8327#define ecvt _ecvt
8328#define execl _execl
8329#define execle _execle
8330#define execlp _execlp
8331#define execv _execv
8332#define execve _execve
8333#define execvp _execvp
8334#define execvpe _execvpe
8335#define fcloseall _fcloseall
8336#define fcvt _fcvt
8337#define fdopen _fdopen
8338#define fileno _fileno
8339#define gcvt _gcvt
8340#define getcwd _getcwd
8341#define getpid _getpid
8342#define getw _getw
8343#define isatty _isatty
8344#define j0 _j0
8345#define j1 _j1
8346#define jn _jn
8347#define lfind _lfind
8348#define lsearch _lsearch
8349#define lseek _lseek
8350#define memccpy _memccpy
8351#define mkdir _mkdir
8352#define mktemp _mktemp
8353#define open _open
8354#define putenv _putenv
8355#define putw _putw
8356#define read _read
8357#define rmdir _rmdir
8358#define strdup _strdup
8359#define swab _swab
8360#define tempnam _tempnam
8361#define tzset _tzset
8362#define umask _umask
8363#define unlink _unlink
8364#define utime _utime
8365#define wcsdup _wcsdup
8366#define write _write
8367#define y0 _y0
8368#define y1 _y1
8369#define yn _yn
8370#endif
8371'
8372
725e2999 8373
725e2999
JB
8374
8375
8376
8377
725e2999
JB
8378
8379
c0c3707f
CB
8380 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
8381$as_echo_n "checking if environ is properly declared... " >&6; }
8382if ${gt_cv_var_environ_declaration+:} false; then :
725e2999
JB
8383 $as_echo_n "(cached) " >&6
8384else
c0c3707f
CB
8385 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8386/* end confdefs.h. */
8387#if HAVE_UNISTD_H
8388 #include <unistd.h>
8389 #endif
8390 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
8391 #include <stdlib.h>
725e2999 8392
c0c3707f
CB
8393 extern struct { int foo; } environ;
8394int
8395main ()
8396{
8397environ.foo = 1;
8398 ;
8399 return 0;
8400}
8401_ACEOF
8402if ac_fn_c_try_compile "$LINENO"; then :
8403 gt_cv_var_environ_declaration=no
8404else
8405 gt_cv_var_environ_declaration=yes
725e2999 8406fi
c0c3707f
CB
8407rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8408fi
8409{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
8410$as_echo "$gt_cv_var_environ_declaration" >&6; }
8411 if test $gt_cv_var_environ_declaration = yes; then
8412
8413$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
725e2999 8414
725e2999 8415 fi
725e2999
JB
8416
8417
c0c3707f
CB
8418 if test $gt_cv_var_environ_declaration != yes; then
8419 HAVE_DECL_ENVIRON=0
8420 fi
6ec2e0f5
SDJ
8421
8422
8423
c0c3707f
CB
8424 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
8425$as_echo_n "checking for complete errno.h... " >&6; }
8426if ${gl_cv_header_errno_h_complete+:} false; then :
8427 $as_echo_n "(cached) " >&6
8428else
6ec2e0f5 8429
c0c3707f
CB
8430 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8431/* end confdefs.h. */
472fa5ee 8432
c0c3707f
CB
8433#include <errno.h>
8434#if !defined ETXTBSY
8435booboo
8436#endif
8437#if !defined ENOMSG
8438booboo
8439#endif
8440#if !defined EIDRM
8441booboo
8442#endif
8443#if !defined ENOLINK
8444booboo
8445#endif
8446#if !defined EPROTO
8447booboo
8448#endif
8449#if !defined EMULTIHOP
8450booboo
8451#endif
8452#if !defined EBADMSG
8453booboo
8454#endif
8455#if !defined EOVERFLOW
8456booboo
8457#endif
8458#if !defined ENOTSUP
8459booboo
8460#endif
8461#if !defined ENETRESET
8462booboo
8463#endif
8464#if !defined ECONNABORTED
8465booboo
8466#endif
8467#if !defined ESTALE
8468booboo
8469#endif
8470#if !defined EDQUOT
8471booboo
8472#endif
8473#if !defined ECANCELED
8474booboo
8475#endif
8476#if !defined EOWNERDEAD
8477booboo
8478#endif
8479#if !defined ENOTRECOVERABLE
8480booboo
8481#endif
8482#if !defined EILSEQ
8483booboo
8484#endif
472fa5ee 8485
c0c3707f
CB
8486_ACEOF
8487if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8488 $EGREP "booboo" >/dev/null 2>&1; then :
8489 gl_cv_header_errno_h_complete=no
8490else
8491 gl_cv_header_errno_h_complete=yes
5e8754f9 8492fi
c0c3707f 8493rm -f conftest*
472fa5ee
SM
8494
8495
c0c3707f
CB
8496fi
8497{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
8498$as_echo "$gl_cv_header_errno_h_complete" >&6; }
8499 if test $gl_cv_header_errno_h_complete = yes; then
8500 ERRNO_H=''
8501 else
472fa5ee
SM
8502
8503
8504
8505
8506
472fa5ee
SM
8507
8508
8509
c0c3707f
CB
8510 if test $gl_cv_have_include_next = yes; then
8511 gl_cv_next_errno_h='<'errno.h'>'
8512 else
8513 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
8514$as_echo_n "checking absolute name of <errno.h>... " >&6; }
8515if ${gl_cv_next_errno_h+:} false; then :
5e8754f9
SDJ
8516 $as_echo_n "(cached) " >&6
8517else
6ec2e0f5 8518
6ec2e0f5 8519
6ec2e0f5 8520
c0c3707f
CB
8521 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8522/* end confdefs.h. */
8523#include <errno.h>
8524_ACEOF
8525 case "$host_os" in
8526 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8527 *) gl_absname_cpp="$ac_cpp" ;;
8528 esac
6ec2e0f5 8529
c0c3707f
CB
8530 case "$host_os" in
8531 mingw*)
8532 gl_dirsep_regex='[/\\]'
8533 ;;
8534 *)
8535 gl_dirsep_regex='\/'
8536 ;;
8537 esac
8538 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
8539 gl_header_literal_regex=`echo 'errno.h' \
8540 | sed -e "$gl_make_literal_regex_sed"`
8541 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8542 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8543 s|^/[^/]|//&|
8544 p
8545 q
8546 }'
6ec2e0f5 8547
c0c3707f
CB
8548 gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
8549 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 8550
c0c3707f
CB
8551 gl_header=$gl_cv_absolute_errno_h
8552 gl_cv_next_errno_h='"'$gl_header'"'
6ec2e0f5
SDJ
8553
8554
c0c3707f
CB
8555fi
8556{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
8557$as_echo "$gl_cv_next_errno_h" >&6; }
8558 fi
8559 NEXT_ERRNO_H=$gl_cv_next_errno_h
6ec2e0f5 8560
c0c3707f
CB
8561 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8562 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8563 gl_next_as_first_directive='<'errno.h'>'
8564 else
8565 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8566 gl_next_as_first_directive=$gl_cv_next_errno_h
8567 fi
8568 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
6ec2e0f5 8569
472fa5ee
SM
8570
8571
8572
c0c3707f
CB
8573 ERRNO_H='errno.h'
8574 fi
472fa5ee 8575
c0c3707f
CB
8576 if test -n "$ERRNO_H"; then
8577 GL_GENERATE_ERRNO_H_TRUE=
8578 GL_GENERATE_ERRNO_H_FALSE='#'
5e8754f9 8579else
c0c3707f
CB
8580 GL_GENERATE_ERRNO_H_TRUE='#'
8581 GL_GENERATE_ERRNO_H_FALSE=
8582fi
472fa5ee
SM
8583
8584
c0c3707f
CB
8585 if test -n "$ERRNO_H"; then
8586 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
8587$as_echo_n "checking for EMULTIHOP value... " >&6; }
8588if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
8589 $as_echo_n "(cached) " >&6
5e8754f9 8590else
e26b6bb0 8591
c0c3707f
CB
8592 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8593/* end confdefs.h. */
e26b6bb0 8594
c0c3707f
CB
8595#include <errno.h>
8596#ifdef EMULTIHOP
8597yes
88b48903 8598#endif
88b48903 8599
c0c3707f
CB
8600_ACEOF
8601if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8602 $EGREP "yes" >/dev/null 2>&1; then :
8603 gl_cv_header_errno_h_EMULTIHOP=yes
8604else
8605 gl_cv_header_errno_h_EMULTIHOP=no
8606fi
8607rm -f conftest*
88b48903 8608
c0c3707f
CB
8609 if test $gl_cv_header_errno_h_EMULTIHOP = no; then
8610 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8611/* end confdefs.h. */
88b48903 8612
c0c3707f
CB
8613#define _XOPEN_SOURCE_EXTENDED 1
8614#include <errno.h>
8615#ifdef EMULTIHOP
8616yes
8617#endif
88b48903
WN
8618
8619_ACEOF
c0c3707f
CB
8620if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8621 $EGREP "yes" >/dev/null 2>&1; then :
8622 gl_cv_header_errno_h_EMULTIHOP=hidden
88b48903 8623fi
c0c3707f 8624rm -f conftest*
88b48903 8625
c0c3707f
CB
8626 if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
8627 if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
8628#define _XOPEN_SOURCE_EXTENDED 1
8629#include <errno.h>
8630/* The following two lines are a workaround against an autoconf-2.52 bug. */
8631#include <stdio.h>
8632#include <stdlib.h>
8633"; then :
88b48903
WN
8634
8635fi
88b48903 8636
c0c3707f
CB
8637 fi
8638 fi
88b48903 8639
c0c3707f
CB
8640fi
8641{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
8642$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
8643 case $gl_cv_header_errno_h_EMULTIHOP in
8644 yes | no)
8645 EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
8646 ;;
8647 *)
8648 EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
8649 ;;
8650 esac
88b48903 8651
e26b6bb0 8652
c0c3707f 8653 fi
e26b6bb0 8654
3d99e817 8655
c0c3707f
CB
8656 if test -n "$ERRNO_H"; then
8657 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
8658$as_echo_n "checking for ENOLINK value... " >&6; }
8659if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
8660 $as_echo_n "(cached) " >&6
8661else
472fa5ee 8662
c0c3707f
CB
8663 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8664/* end confdefs.h. */
472fa5ee 8665
c0c3707f
CB
8666#include <errno.h>
8667#ifdef ENOLINK
8668yes
8669#endif
472fa5ee 8670
c0c3707f
CB
8671_ACEOF
8672if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8673 $EGREP "yes" >/dev/null 2>&1; then :
8674 gl_cv_header_errno_h_ENOLINK=yes
8675else
8676 gl_cv_header_errno_h_ENOLINK=no
8677fi
8678rm -f conftest*
472fa5ee 8679
c0c3707f
CB
8680 if test $gl_cv_header_errno_h_ENOLINK = no; then
8681 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8682/* end confdefs.h. */
3d99e817 8683
c0c3707f
CB
8684#define _XOPEN_SOURCE_EXTENDED 1
8685#include <errno.h>
8686#ifdef ENOLINK
8687yes
8688#endif
3d99e817 8689
c0c3707f
CB
8690_ACEOF
8691if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8692 $EGREP "yes" >/dev/null 2>&1; then :
8693 gl_cv_header_errno_h_ENOLINK=hidden
8694fi
8695rm -f conftest*
3d99e817 8696
c0c3707f
CB
8697 if test $gl_cv_header_errno_h_ENOLINK = hidden; then
8698 if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
8699#define _XOPEN_SOURCE_EXTENDED 1
8700#include <errno.h>
8701/* The following two lines are a workaround against an autoconf-2.52 bug. */
8702#include <stdio.h>
8703#include <stdlib.h>
8704"; then :
3d99e817 8705
c0c3707f 8706fi
3d99e817 8707
c0c3707f
CB
8708 fi
8709 fi
3d99e817 8710
c0c3707f
CB
8711fi
8712{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
8713$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
8714 case $gl_cv_header_errno_h_ENOLINK in
8715 yes | no)
8716 ENOLINK_HIDDEN=0; ENOLINK_VALUE=
8717 ;;
8718 *)
8719 ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
8720 ;;
8721 esac
18848e28 8722
18848e28 8723
c0c3707f 8724 fi
18848e28 8725
18848e28 8726
c0c3707f
CB
8727 if test -n "$ERRNO_H"; then
8728 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
8729$as_echo_n "checking for EOVERFLOW value... " >&6; }
8730if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
8731 $as_echo_n "(cached) " >&6
8732else
18848e28 8733
c0c3707f
CB
8734 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8735/* end confdefs.h. */
18848e28 8736
c0c3707f
CB
8737#include <errno.h>
8738#ifdef EOVERFLOW
8739yes
8740#endif
18848e28 8741
c0c3707f
CB
8742_ACEOF
8743if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8744 $EGREP "yes" >/dev/null 2>&1; then :
8745 gl_cv_header_errno_h_EOVERFLOW=yes
8746else
8747 gl_cv_header_errno_h_EOVERFLOW=no
8748fi
8749rm -f conftest*
18848e28 8750
c0c3707f
CB
8751 if test $gl_cv_header_errno_h_EOVERFLOW = no; then
8752 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8753/* end confdefs.h. */
18848e28 8754
c0c3707f
CB
8755#define _XOPEN_SOURCE_EXTENDED 1
8756#include <errno.h>
8757#ifdef EOVERFLOW
8758yes
8759#endif
18848e28 8760
c0c3707f
CB
8761_ACEOF
8762if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8763 $EGREP "yes" >/dev/null 2>&1; then :
8764 gl_cv_header_errno_h_EOVERFLOW=hidden
8765fi
8766rm -f conftest*
18848e28 8767
c0c3707f
CB
8768 if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
8769 if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
8770#define _XOPEN_SOURCE_EXTENDED 1
8771#include <errno.h>
8772/* The following two lines are a workaround against an autoconf-2.52 bug. */
8773#include <stdio.h>
8774#include <stdlib.h>
8775"; then :
18848e28 8776
c0c3707f 8777fi
18848e28 8778
c0c3707f
CB
8779 fi
8780 fi
18848e28 8781
c0c3707f
CB
8782fi
8783{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
8784$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
8785 case $gl_cv_header_errno_h_EOVERFLOW in
8786 yes | no)
8787 EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
8788 ;;
8789 *)
8790 EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
8791 ;;
8792 esac
4a626d0a
PA
8793
8794
c0c3707f 8795 fi
18848e28 8796
4a626d0a 8797
c0c3707f
CB
8798ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
8799if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
8800 ac_have_decl=1
8801else
8802 ac_have_decl=0
8803fi
4a626d0a 8804
c0c3707f
CB
8805cat >>confdefs.h <<_ACEOF
8806#define HAVE_DECL_STRERROR_R $ac_have_decl
8807_ACEOF
4a626d0a 8808
c0c3707f
CB
8809for ac_func in strerror_r
8810do :
8811 ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
8812if test "x$ac_cv_func_strerror_r" = xyes; then :
8813 cat >>confdefs.h <<_ACEOF
8814#define HAVE_STRERROR_R 1
8815_ACEOF
4a626d0a 8816
c0c3707f
CB
8817fi
8818done
18848e28 8819
c0c3707f
CB
8820{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
8821$as_echo_n "checking whether strerror_r returns char *... " >&6; }
8822if ${ac_cv_func_strerror_r_char_p+:} false; then :
8823 $as_echo_n "(cached) " >&6
8824else
18848e28 8825
c0c3707f
CB
8826 ac_cv_func_strerror_r_char_p=no
8827 if test $ac_cv_have_decl_strerror_r = yes; then
8828 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8829/* end confdefs.h. */
8830$ac_includes_default
8831int
8832main ()
8833{
18848e28 8834
c0c3707f
CB
8835 char buf[100];
8836 char x = *strerror_r (0, buf, sizeof buf);
8837 char *p = strerror_r (0, buf, sizeof buf);
8838 return !p || x;
18848e28 8839
c0c3707f
CB
8840 ;
8841 return 0;
8842}
8843_ACEOF
8844if ac_fn_c_try_compile "$LINENO"; then :
8845 ac_cv_func_strerror_r_char_p=yes
8846fi
8847rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8848 else
8849 # strerror_r is not declared. Choose between
8850 # systems that have relatively inaccessible declarations for the
8851 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
8852 # former has a strerror_r that returns char*, while the latter
8853 # has a strerror_r that returns `int'.
8854 # This test should segfault on the DEC system.
8855 if test "$cross_compiling" = yes; then :
8856 :
8857else
8858 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8859/* end confdefs.h. */
8860$ac_includes_default
8861 extern char *strerror_r ();
8862int
8863main ()
8864{
8865char buf[100];
8866 char x = *strerror_r (0, buf, sizeof buf);
8867 return ! isalpha (x);
8868 ;
8869 return 0;
8870}
8871_ACEOF
8872if ac_fn_c_try_run "$LINENO"; then :
8873 ac_cv_func_strerror_r_char_p=yes
8874fi
8875rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8876 conftest.$ac_objext conftest.beam conftest.$ac_ext
8877fi
18848e28 8878
c0c3707f 8879 fi
18848e28 8880
c0c3707f
CB
8881fi
8882{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
8883$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
8884if test $ac_cv_func_strerror_r_char_p = yes; then
18848e28 8885
c0c3707f 8886$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
18848e28 8887
c0c3707f 8888fi
18848e28 8889
18848e28 8890
18848e28 8891
18848e28 8892
c0c3707f
CB
8893ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
8894if test "x$ac_cv_have_decl_fchdir" = xyes; then :
8895 ac_have_decl=1
8896else
8897 ac_have_decl=0
8898fi
18848e28 8899
c0c3707f
CB
8900cat >>confdefs.h <<_ACEOF
8901#define HAVE_DECL_FCHDIR $ac_have_decl
8902_ACEOF
18848e28 8903
18848e28 8904
c0c3707f
CB
8905 GNULIB_CREAT=0;
8906 GNULIB_FCNTL=0;
8907 GNULIB_NONBLOCKING=0;
8908 GNULIB_OPEN=0;
8909 GNULIB_OPENAT=0;
9c9d63b1
PM
8910 GNULIB_MDA_CREAT=1;
8911 GNULIB_MDA_OPEN=1;
c0c3707f
CB
8912 HAVE_FCNTL=1;
8913 HAVE_OPENAT=1;
8914 REPLACE_CREAT=0;
8915 REPLACE_FCNTL=0;
8916 REPLACE_OPEN=0;
8917 REPLACE_OPENAT=0;
18848e28 8918
18848e28 8919
18848e28 8920
18848e28
GF
8921
8922
18848e28
GF
8923
8924
18848e28 8925
18848e28 8926
18848e28 8927
c0c3707f
CB
8928 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
8929$as_echo_n "checking for working fcntl.h... " >&6; }
8930if ${gl_cv_header_working_fcntl_h+:} false; then :
8931 $as_echo_n "(cached) " >&6
8932else
8933 if test "$cross_compiling" = yes; then :
8934 case "$host_os" in
8935 # Guess 'no' on native Windows.
8936 mingw*) gl_cv_header_working_fcntl_h='no' ;;
8937 *) gl_cv_header_working_fcntl_h=cross-compiling ;;
8938 esac
18848e28 8939
c0c3707f
CB
8940else
8941 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8942/* end confdefs.h. */
8943#include <sys/types.h>
8944 #include <sys/stat.h>
8945 #if HAVE_UNISTD_H
8946 # include <unistd.h>
8947 #else /* on Windows with MSVC */
8948 # include <io.h>
8949 # include <stdlib.h>
8950 # defined sleep(n) _sleep ((n) * 1000)
8951 #endif
8952 #include <fcntl.h>
9c9d63b1
PM
8953
8954
8955$gl_mda_defines
8956
c0c3707f
CB
8957 #ifndef O_NOATIME
8958 #define O_NOATIME 0
8959 #endif
8960 #ifndef O_NOFOLLOW
8961 #define O_NOFOLLOW 0
8962 #endif
8963 static int const constants[] =
8964 {
8965 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
8966 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
8967 };
18848e28 8968
c0c3707f
CB
8969int
8970main ()
8971{
18848e28 8972
c0c3707f
CB
8973 int result = !constants;
8974 #if HAVE_SYMLINK
8975 {
8976 static char const sym[] = "conftest.sym";
8977 if (symlink ("/dev/null", sym) != 0)
8978 result |= 2;
8979 else
8980 {
8981 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
8982 if (fd >= 0)
8983 {
8984 close (fd);
8985 result |= 4;
8986 }
8987 }
8988 if (unlink (sym) != 0 || symlink (".", sym) != 0)
8989 result |= 2;
8990 else
8991 {
8992 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
8993 if (fd >= 0)
8994 {
8995 close (fd);
8996 result |= 4;
8997 }
8998 }
8999 unlink (sym);
9000 }
9001 #endif
9002 {
9003 static char const file[] = "confdefs.h";
9004 int fd = open (file, O_RDONLY | O_NOATIME);
9005 if (fd < 0)
9006 result |= 8;
9007 else
9008 {
9009 struct stat st0;
9010 if (fstat (fd, &st0) != 0)
9011 result |= 16;
9012 else
9013 {
9014 char c;
9015 sleep (1);
9016 if (read (fd, &c, 1) != 1)
9017 result |= 24;
9018 else
9019 {
9020 if (close (fd) != 0)
9021 result |= 32;
9022 else
9023 {
9024 struct stat st1;
9025 if (stat (file, &st1) != 0)
9026 result |= 40;
9027 else
9028 if (st0.st_atime != st1.st_atime)
9029 result |= 64;
9030 }
9031 }
9032 }
9033 }
9034 }
9035 return result;
9036 ;
9037 return 0;
9038}
9039_ACEOF
9040if ac_fn_c_try_run "$LINENO"; then :
9041 gl_cv_header_working_fcntl_h=yes
9042else
9043 case $? in #(
9044 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
9045 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
9046 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
9047 *) gl_cv_header_working_fcntl_h='no';;
9048 esac
9049fi
9050rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9051 conftest.$ac_objext conftest.beam conftest.$ac_ext
9052fi
18848e28 9053
18848e28 9054
c0c3707f
CB
9055fi
9056{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
9057$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
18848e28 9058
c0c3707f
CB
9059 case $gl_cv_header_working_fcntl_h in #(
9060 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
9061 *) ac_val=1;;
9062 esac
18848e28 9063
c0c3707f
CB
9064cat >>confdefs.h <<_ACEOF
9065#define HAVE_WORKING_O_NOATIME $ac_val
9066_ACEOF
18848e28
GF
9067
9068
c0c3707f
CB
9069 case $gl_cv_header_working_fcntl_h in #(
9070 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
9071 *) ac_val=1;;
9072 esac
18848e28 9073
c0c3707f
CB
9074cat >>confdefs.h <<_ACEOF
9075#define HAVE_WORKING_O_NOFOLLOW $ac_val
9076_ACEOF
18848e28 9077
63ce7108 9078
9c9d63b1
PM
9079
9080 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default
9081"
c0c3707f 9082if test "x$ac_cv_type_pid_t" = xyes; then :
63ce7108 9083
c0c3707f 9084else
9c9d63b1
PM
9085 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9086/* end confdefs.h. */
9087
9088 #if defined _WIN64 && !defined __CYGWIN__
9089 LLP64
9090 #endif
9091
9092int
9093main ()
9094{
9095
9096 ;
9097 return 0;
9098}
9099
9100_ACEOF
9101if ac_fn_c_try_compile "$LINENO"; then :
9102 gl_pid_type='int'
9103else
9104 gl_pid_type='__int64'
9105fi
9106rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63ce7108 9107
c0c3707f 9108cat >>confdefs.h <<_ACEOF
9c9d63b1 9109#define pid_t $gl_pid_type
c0c3707f 9110_ACEOF
63ce7108 9111
9c9d63b1 9112
c0c3707f 9113fi
63ce7108 9114
9c9d63b1 9115
c0c3707f
CB
9116ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
9117if test "x$ac_cv_type_mode_t" = xyes; then :
63ce7108 9118
c0c3707f 9119else
63ce7108 9120
c0c3707f
CB
9121cat >>confdefs.h <<_ACEOF
9122#define mode_t int
9123_ACEOF
63ce7108 9124
c0c3707f 9125fi
63ce7108 9126
472fa5ee
SM
9127
9128
9129
9130
9131
c0c3707f
CB
9132 GNULIB_FNMATCH=0;
9133 HAVE_FNMATCH=1;
9134 REPLACE_FNMATCH=0;
472fa5ee
SM
9135
9136
9137
9138
9139
9140
472fa5ee
SM
9141
9142
472fa5ee
SM
9143
9144
9145
9146
9147
9148
9149
9150
7a6dbc2f 9151 if test $gl_cv_have_include_next = yes; then
c0c3707f 9152 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
7a6dbc2f 9153 else
c0c3707f
CB
9154 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5
9155$as_echo_n "checking absolute name of <fnmatch.h>... " >&6; }
9156if ${gl_cv_next_fnmatch_h+:} false; then :
7a6dbc2f
SDJ
9157 $as_echo_n "(cached) " >&6
9158else
472fa5ee 9159
c0c3707f
CB
9160 if test $ac_cv_header_fnmatch_h = yes; then
9161
9162
472fa5ee
SM
9163
9164
7a6dbc2f
SDJ
9165 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9166/* end confdefs.h. */
c0c3707f 9167#include <fnmatch.h>
7a6dbc2f
SDJ
9168_ACEOF
9169 case "$host_os" in
9170 aix*) gl_absname_cpp="$ac_cpp -C" ;;
9171 *) gl_absname_cpp="$ac_cpp" ;;
9172 esac
472fa5ee 9173
7a6dbc2f
SDJ
9174 case "$host_os" in
9175 mingw*)
9176 gl_dirsep_regex='[/\\]'
9177 ;;
9178 *)
9179 gl_dirsep_regex='\/'
9180 ;;
9181 esac
9182 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 9183 gl_header_literal_regex=`echo 'fnmatch.h' \
7a6dbc2f
SDJ
9184 | sed -e "$gl_make_literal_regex_sed"`
9185 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
9186 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
9187 s|^/[^/]|//&|
9188 p
9189 q
9190 }'
9191
c0c3707f 9192 gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
7a6dbc2f
SDJ
9193 sed -n "$gl_absolute_header_sed"`
9194
c0c3707f
CB
9195 gl_header=$gl_cv_absolute_fnmatch_h
9196 gl_cv_next_fnmatch_h='"'$gl_header'"'
9197 else
9198 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
9199 fi
7a6dbc2f
SDJ
9200
9201
9202fi
c0c3707f
CB
9203{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5
9204$as_echo "$gl_cv_next_fnmatch_h" >&6; }
7a6dbc2f 9205 fi
c0c3707f 9206 NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h
7a6dbc2f
SDJ
9207
9208 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
9209 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 9210 gl_next_as_first_directive='<'fnmatch.h'>'
7a6dbc2f
SDJ
9211 else
9212 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 9213 gl_next_as_first_directive=$gl_cv_next_fnmatch_h
7a6dbc2f 9214 fi
c0c3707f 9215 NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive
7a6dbc2f
SDJ
9216
9217
9218
9219
7a6dbc2f 9220
7a6dbc2f
SDJ
9221
9222
c0c3707f
CB
9223 if test $ac_cv_header_fnmatch_h = yes; then
9224 HAVE_FNMATCH_H=1
9225 else
9226 HAVE_FNMATCH_H=0
9227 fi
7a6dbc2f
SDJ
9228
9229
c0c3707f
CB
9230 FNMATCH_H=''
9231 if false; then
9232 FNMATCH_H=fnmatch.h
9233 else
9234 if test $ac_cv_header_fnmatch_h != yes; then
9235 FNMATCH_H=fnmatch.h
9236 fi
9237 fi
7a6dbc2f 9238
c0c3707f
CB
9239
9240 if test -n "$FNMATCH_H"; then
9241 GL_GENERATE_FNMATCH_H_TRUE=
9242 GL_GENERATE_FNMATCH_H_FALSE='#'
7a6dbc2f 9243else
c0c3707f
CB
9244 GL_GENERATE_FNMATCH_H_TRUE='#'
9245 GL_GENERATE_FNMATCH_H_FALSE=
7a6dbc2f 9246fi
7a6dbc2f 9247
7a6dbc2f 9248
7a6dbc2f 9249
7a6dbc2f
SDJ
9250
9251
9252
9253
9254
9255
9256
c0c3707f
CB
9257 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
9258$as_echo_n "checking for mbstate_t... " >&6; }
9259if ${ac_cv_type_mbstate_t+:} false; then :
5e8754f9
SDJ
9260 $as_echo_n "(cached) " >&6
9261else
c0c3707f 9262 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 9263/* end confdefs.h. */
c0c3707f 9264$ac_includes_default
9c9d63b1 9265 #include <wchar.h>
c0c3707f
CB
9266int
9267main ()
9268{
9269mbstate_t x; return sizeof x;
9270 ;
9271 return 0;
9272}
5e8754f9 9273_ACEOF
c0c3707f
CB
9274if ac_fn_c_try_compile "$LINENO"; then :
9275 ac_cv_type_mbstate_t=yes
5e8754f9 9276else
c0c3707f 9277 ac_cv_type_mbstate_t=no
5e8754f9 9278fi
c0c3707f
CB
9279rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9280fi
9281{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
9282$as_echo "$ac_cv_type_mbstate_t" >&6; }
9283 if test $ac_cv_type_mbstate_t = yes; then
5e8754f9 9284
c0c3707f 9285$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
5e8754f9 9286
c0c3707f 9287 else
5e8754f9 9288
c0c3707f 9289$as_echo "#define mbstate_t int" >>confdefs.h
5e8754f9 9290
c0c3707f 9291 fi
5e8754f9
SDJ
9292
9293
9294
9295
5e8754f9
SDJ
9296 GNULIB_ACOSF=0;
9297 GNULIB_ACOSL=0;
9298 GNULIB_ASINF=0;
9299 GNULIB_ASINL=0;
9300 GNULIB_ATANF=0;
9301 GNULIB_ATANL=0;
9302 GNULIB_ATAN2F=0;
9303 GNULIB_CBRT=0;
9304 GNULIB_CBRTF=0;
9305 GNULIB_CBRTL=0;
9306 GNULIB_CEIL=0;
9307 GNULIB_CEILF=0;
9308 GNULIB_CEILL=0;
9309 GNULIB_COPYSIGN=0;
9310 GNULIB_COPYSIGNF=0;
9311 GNULIB_COPYSIGNL=0;
9312 GNULIB_COSF=0;
9313 GNULIB_COSL=0;
9314 GNULIB_COSHF=0;
9315 GNULIB_EXPF=0;
9316 GNULIB_EXPL=0;
9317 GNULIB_EXP2=0;
9318 GNULIB_EXP2F=0;
9319 GNULIB_EXP2L=0;
9320 GNULIB_EXPM1=0;
9321 GNULIB_EXPM1F=0;
9322 GNULIB_EXPM1L=0;
9323 GNULIB_FABSF=0;
9324 GNULIB_FABSL=0;
9325 GNULIB_FLOOR=0;
9326 GNULIB_FLOORF=0;
9327 GNULIB_FLOORL=0;
9328 GNULIB_FMA=0;
9329 GNULIB_FMAF=0;
9330 GNULIB_FMAL=0;
9331 GNULIB_FMOD=0;
9332 GNULIB_FMODF=0;
9333 GNULIB_FMODL=0;
9334 GNULIB_FREXPF=0;
9335 GNULIB_FREXP=0;
9336 GNULIB_FREXPL=0;
9337 GNULIB_HYPOT=0;
9338 GNULIB_HYPOTF=0;
9339 GNULIB_HYPOTL=0;
9340 GNULIB_ILOGB=0;
9341 GNULIB_ILOGBF=0;
9342 GNULIB_ILOGBL=0;
9343 GNULIB_ISFINITE=0;
9344 GNULIB_ISINF=0;
9345 GNULIB_ISNAN=0;
9346 GNULIB_ISNANF=0;
9347 GNULIB_ISNAND=0;
9348 GNULIB_ISNANL=0;
9349 GNULIB_LDEXPF=0;
9350 GNULIB_LDEXPL=0;
9351 GNULIB_LOG=0;
9352 GNULIB_LOGF=0;
9353 GNULIB_LOGL=0;
9354 GNULIB_LOG10=0;
9355 GNULIB_LOG10F=0;
9356 GNULIB_LOG10L=0;
9357 GNULIB_LOG1P=0;
9358 GNULIB_LOG1PF=0;
9359 GNULIB_LOG1PL=0;
9360 GNULIB_LOG2=0;
9361 GNULIB_LOG2F=0;
9362 GNULIB_LOG2L=0;
9363 GNULIB_LOGB=0;
9364 GNULIB_LOGBF=0;
9365 GNULIB_LOGBL=0;
9366 GNULIB_MODF=0;
9367 GNULIB_MODFF=0;
9368 GNULIB_MODFL=0;
9369 GNULIB_POWF=0;
9370 GNULIB_REMAINDER=0;
9371 GNULIB_REMAINDERF=0;
9372 GNULIB_REMAINDERL=0;
9373 GNULIB_RINT=0;
9374 GNULIB_RINTF=0;
9375 GNULIB_RINTL=0;
9376 GNULIB_ROUND=0;
9377 GNULIB_ROUNDF=0;
9378 GNULIB_ROUNDL=0;
9379 GNULIB_SIGNBIT=0;
9380 GNULIB_SINF=0;
9381 GNULIB_SINL=0;
9382 GNULIB_SINHF=0;
9383 GNULIB_SQRTF=0;
9384 GNULIB_SQRTL=0;
9385 GNULIB_TANF=0;
9386 GNULIB_TANL=0;
9387 GNULIB_TANHF=0;
9388 GNULIB_TRUNC=0;
9389 GNULIB_TRUNCF=0;
9390 GNULIB_TRUNCL=0;
9c9d63b1
PM
9391 GNULIB_MDA_J0=1;
9392 GNULIB_MDA_J1=1;
9393 GNULIB_MDA_JN=1;
9394 GNULIB_MDA_Y0=1;
9395 GNULIB_MDA_Y1=1;
9396 GNULIB_MDA_YN=1;
5e8754f9
SDJ
9397 HAVE_ACOSF=1;
9398 HAVE_ACOSL=1;
9399 HAVE_ASINF=1;
9400 HAVE_ASINL=1;
9401 HAVE_ATANF=1;
9402 HAVE_ATANL=1;
9403 HAVE_ATAN2F=1;
9404 HAVE_CBRT=1;
9405 HAVE_CBRTF=1;
9406 HAVE_CBRTL=1;
9407 HAVE_COPYSIGN=1;
9408 HAVE_COPYSIGNL=1;
9409 HAVE_COSF=1;
9410 HAVE_COSL=1;
9411 HAVE_COSHF=1;
9412 HAVE_EXPF=1;
9413 HAVE_EXPL=1;
9414 HAVE_EXPM1=1;
9415 HAVE_EXPM1F=1;
9416 HAVE_FABSF=1;
9417 HAVE_FABSL=1;
9418 HAVE_FMA=1;
9419 HAVE_FMAF=1;
9420 HAVE_FMAL=1;
9421 HAVE_FMODF=1;
9422 HAVE_FMODL=1;
9423 HAVE_FREXPF=1;
9424 HAVE_HYPOTF=1;
9425 HAVE_HYPOTL=1;
9426 HAVE_ILOGB=1;
9427 HAVE_ILOGBF=1;
9428 HAVE_ILOGBL=1;
9429 HAVE_ISNANF=1;
9430 HAVE_ISNAND=1;
9431 HAVE_ISNANL=1;
9432 HAVE_LDEXPF=1;
9433 HAVE_LOGF=1;
9434 HAVE_LOGL=1;
9435 HAVE_LOG10F=1;
9436 HAVE_LOG10L=1;
9437 HAVE_LOG1P=1;
9438 HAVE_LOG1PF=1;
9439 HAVE_LOG1PL=1;
9440 HAVE_LOGBF=1;
9441 HAVE_LOGBL=1;
9442 HAVE_MODFF=1;
9443 HAVE_MODFL=1;
9444 HAVE_POWF=1;
9445 HAVE_REMAINDER=1;
9446 HAVE_REMAINDERF=1;
9447 HAVE_RINT=1;
9448 HAVE_RINTL=1;
9449 HAVE_SINF=1;
9450 HAVE_SINL=1;
9451 HAVE_SINHF=1;
9452 HAVE_SQRTF=1;
9453 HAVE_SQRTL=1;
9454 HAVE_TANF=1;
9455 HAVE_TANL=1;
9456 HAVE_TANHF=1;
9457 HAVE_DECL_ACOSL=1;
9458 HAVE_DECL_ASINL=1;
9459 HAVE_DECL_ATANL=1;
9460 HAVE_DECL_CBRTF=1;
9461 HAVE_DECL_CBRTL=1;
9462 HAVE_DECL_CEILF=1;
9463 HAVE_DECL_CEILL=1;
9464 HAVE_DECL_COPYSIGNF=1;
9465 HAVE_DECL_COSL=1;
9466 HAVE_DECL_EXPL=1;
9467 HAVE_DECL_EXP2=1;
9468 HAVE_DECL_EXP2F=1;
9469 HAVE_DECL_EXP2L=1;
9470 HAVE_DECL_EXPM1L=1;
9471 HAVE_DECL_FLOORF=1;
9472 HAVE_DECL_FLOORL=1;
9473 HAVE_DECL_FREXPL=1;
9474 HAVE_DECL_LDEXPL=1;
9475 HAVE_DECL_LOGL=1;
9476 HAVE_DECL_LOG10L=1;
9477 HAVE_DECL_LOG2=1;
9478 HAVE_DECL_LOG2F=1;
9479 HAVE_DECL_LOG2L=1;
9480 HAVE_DECL_LOGB=1;
9481 HAVE_DECL_REMAINDER=1;
9482 HAVE_DECL_REMAINDERL=1;
9483 HAVE_DECL_RINTF=1;
9484 HAVE_DECL_ROUND=1;
9485 HAVE_DECL_ROUNDF=1;
9486 HAVE_DECL_ROUNDL=1;
9487 HAVE_DECL_SINL=1;
9488 HAVE_DECL_SQRTL=1;
9489 HAVE_DECL_TANL=1;
9490 HAVE_DECL_TRUNC=1;
9491 HAVE_DECL_TRUNCF=1;
9492 HAVE_DECL_TRUNCL=1;
c0c3707f
CB
9493 REPLACE_ACOSF=0;
9494 REPLACE_ASINF=0;
9495 REPLACE_ATANF=0;
9496 REPLACE_ATAN2F=0;
5e8754f9
SDJ
9497 REPLACE_CBRTF=0;
9498 REPLACE_CBRTL=0;
9499 REPLACE_CEIL=0;
9500 REPLACE_CEILF=0;
9501 REPLACE_CEILL=0;
c0c3707f
CB
9502 REPLACE_COSF=0;
9503 REPLACE_COSHF=0;
9504 REPLACE_EXPF=0;
9505 REPLACE_EXPL=0;
5e8754f9
SDJ
9506 REPLACE_EXPM1=0;
9507 REPLACE_EXPM1F=0;
c0c3707f 9508 REPLACE_EXPM1L=0;
5e8754f9
SDJ
9509 REPLACE_EXP2=0;
9510 REPLACE_EXP2L=0;
9511 REPLACE_FABSL=0;
9512 REPLACE_FLOOR=0;
9513 REPLACE_FLOORF=0;
9514 REPLACE_FLOORL=0;
9515 REPLACE_FMA=0;
9516 REPLACE_FMAF=0;
9517 REPLACE_FMAL=0;
9518 REPLACE_FMOD=0;
9519 REPLACE_FMODF=0;
9520 REPLACE_FMODL=0;
9521 REPLACE_FREXPF=0;
9522 REPLACE_FREXP=0;
9523 REPLACE_FREXPL=0;
9524 REPLACE_HUGE_VAL=0;
9525 REPLACE_HYPOT=0;
9526 REPLACE_HYPOTF=0;
9527 REPLACE_HYPOTL=0;
9528 REPLACE_ILOGB=0;
9529 REPLACE_ILOGBF=0;
c0c3707f 9530 REPLACE_ILOGBL=0;
5e8754f9
SDJ
9531 REPLACE_ISFINITE=0;
9532 REPLACE_ISINF=0;
9533 REPLACE_ISNAN=0;
9534 REPLACE_LDEXPL=0;
9535 REPLACE_LOG=0;
9536 REPLACE_LOGF=0;
9537 REPLACE_LOGL=0;
9538 REPLACE_LOG10=0;
9539 REPLACE_LOG10F=0;
9540 REPLACE_LOG10L=0;
9541 REPLACE_LOG1P=0;
9542 REPLACE_LOG1PF=0;
9543 REPLACE_LOG1PL=0;
9544 REPLACE_LOG2=0;
9545 REPLACE_LOG2F=0;
9546 REPLACE_LOG2L=0;
9547 REPLACE_LOGB=0;
9548 REPLACE_LOGBF=0;
9549 REPLACE_LOGBL=0;
9550 REPLACE_MODF=0;
9551 REPLACE_MODFF=0;
9552 REPLACE_MODFL=0;
9553 REPLACE_NAN=0;
9554 REPLACE_REMAINDER=0;
9555 REPLACE_REMAINDERF=0;
9556 REPLACE_REMAINDERL=0;
c0c3707f 9557 REPLACE_RINTL=0;
5e8754f9 9558 REPLACE_ROUND=0;
c0c3707f
CB
9559 REPLACE_ROUNDF=0;
9560 REPLACE_ROUNDL=0;
9561 REPLACE_SIGNBIT=0;
9c9d63b1 9562 REPLACE_SIGNBIT_USING_BUILTINS=0;
c0c3707f
CB
9563 REPLACE_SINF=0;
9564 REPLACE_SINHF=0;
9565 REPLACE_SQRTF=0;
9566 REPLACE_SQRTL=0;
9567 REPLACE_TANF=0;
9568 REPLACE_TANHF=0;
9569 REPLACE_TRUNC=0;
9570 REPLACE_TRUNCF=0;
9571 REPLACE_TRUNCL=0;
49e4877c 9572
49e4877c 9573
c0c3707f
CB
9574 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
9575$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
9576if ${gl_cv_func_frexp_no_libm+:} false; then :
9577 $as_echo_n "(cached) " >&6
9578else
8690e634 9579
c0c3707f
CB
9580 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9581/* end confdefs.h. */
9582#include <math.h>
9583 double x;
9584int
9585main ()
9586{
9587int e; return frexp (x, &e) > 0;
9588 ;
9589 return 0;
9590}
9591_ACEOF
9592if ac_fn_c_try_link "$LINENO"; then :
9593 gl_cv_func_frexp_no_libm=yes
9594else
9595 gl_cv_func_frexp_no_libm=no
9596fi
9597rm -f core conftest.err conftest.$ac_objext \
9598 conftest$ac_exeext conftest.$ac_ext
8690e634 9599
c0c3707f
CB
9600fi
9601{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
9602$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
8690e634 9603
c0c3707f
CB
9604ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
9605if test "x$ac_cv_have_decl_alarm" = xyes; then :
9606 ac_have_decl=1
9607else
9608 ac_have_decl=0
9609fi
472fa5ee 9610
c0c3707f
CB
9611cat >>confdefs.h <<_ACEOF
9612#define HAVE_DECL_ALARM $ac_have_decl
9613_ACEOF
472fa5ee
SM
9614
9615
9616
9617
c0c3707f
CB
9618 FREXP_LIBM=
9619 if test $gl_cv_func_frexp_no_libm = no; then
9620 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5
9621$as_echo_n "checking whether frexp() can be used with libm... " >&6; }
9622if ${gl_cv_func_frexp_in_libm+:} false; then :
9623 $as_echo_n "(cached) " >&6
9624else
8690e634 9625
c0c3707f
CB
9626 save_LIBS="$LIBS"
9627 LIBS="$LIBS -lm"
9628 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9629/* end confdefs.h. */
9630#include <math.h>
9631 double x;
9632int
9633main ()
9634{
9635int e; return frexp (x, &e) > 0;
9636 ;
9637 return 0;
9638}
9639_ACEOF
9640if ac_fn_c_try_link "$LINENO"; then :
9641 gl_cv_func_frexp_in_libm=yes
9642else
9643 gl_cv_func_frexp_in_libm=no
9644fi
9645rm -f core conftest.err conftest.$ac_objext \
9646 conftest$ac_exeext conftest.$ac_ext
9647 LIBS="$save_LIBS"
8690e634 9648
c0c3707f
CB
9649fi
9650{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5
9651$as_echo "$gl_cv_func_frexp_in_libm" >&6; }
9652 if test $gl_cv_func_frexp_in_libm = yes; then
9653 FREXP_LIBM=-lm
9654 fi
6ec2e0f5 9655 fi
c0c3707f
CB
9656 if test $gl_cv_func_frexp_no_libm = yes \
9657 || test $gl_cv_func_frexp_in_libm = yes; then
9658 save_LIBS="$LIBS"
9659 LIBS="$LIBS $FREXP_LIBM"
8690e634
JK
9660
9661
8690e634 9662
c0c3707f
CB
9663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
9664$as_echo_n "checking whether frexp works... " >&6; }
9665if ${gl_cv_func_frexp_works+:} false; then :
9666 $as_echo_n "(cached) " >&6
9667else
8690e634 9668
c0c3707f
CB
9669 if test "$cross_compiling" = yes; then :
9670 case "$host_os" in
9671 netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
9672 mingw*) # Guess yes with MSVC, no with mingw.
9673 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9674/* end confdefs.h. */
8690e634 9675
c0c3707f
CB
9676#ifdef _MSC_VER
9677 Good
9678#endif
8690e634 9679
c0c3707f
CB
9680_ACEOF
9681if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9682 $EGREP "Good" >/dev/null 2>&1; then :
9683 gl_cv_func_frexp_works="guessing yes"
9684else
9685 gl_cv_func_frexp_works="guessing no"
9686fi
9687rm -f conftest*
8690e634 9688
c0c3707f
CB
9689 ;;
9690 *) gl_cv_func_frexp_works="guessing yes" ;;
9691 esac
8690e634 9692
c0c3707f
CB
9693else
9694 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9695/* end confdefs.h. */
8690e634 9696
c0c3707f
CB
9697#include <float.h>
9698#include <math.h>
9699#include <string.h>
9700#if HAVE_DECL_ALARM
9701# include <signal.h>
9702# include <unistd.h>
9703#endif
9704/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
9705 ICC 10.0 has a bug when optimizing the expression -zero.
9706 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
9707 to PowerPC on Mac OS X 10.5. */
9708#if defined __hpux || defined __sgi || defined __ICC
9709static double
9710compute_minus_zero (void)
9711{
9712 return -DBL_MIN * DBL_MIN;
9713}
9714# define minus_zero compute_minus_zero ()
9715#else
9716double minus_zero = -0.0;
9717#endif
9718int main()
9719{
9720 int result = 0;
9721 int i;
9722 volatile double x;
9723 double zero = 0.0;
9724#if HAVE_DECL_ALARM
9725 /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
9726 number. Let the test fail in this case. */
9727 signal (SIGALRM, SIG_DFL);
9728 alarm (5);
9729#endif
9730 /* Test on denormalized numbers. */
9731 for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
9732 ;
9733 if (x > 0.0)
9734 {
9735 int exp;
9736 double y = frexp (x, &exp);
9737 /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
9738 On NetBSD: y = 0.75. Correct: y = 0.5. */
9739 if (y != 0.5)
9740 result |= 1;
9741 }
9742 /* Test on infinite numbers. */
9743 x = 1.0 / zero;
9744 {
9745 int exp;
9746 double y = frexp (x, &exp);
9747 if (y != x)
9748 result |= 2;
9749 }
9750 /* Test on negative zero. */
9751 x = minus_zero;
9752 {
9753 int exp;
9754 double y = frexp (x, &exp);
9755 if (memcmp (&y, &x, sizeof x))
9756 result |= 4;
9757 }
9758 return result;
9759}
9760_ACEOF
9761if ac_fn_c_try_run "$LINENO"; then :
9762 gl_cv_func_frexp_works=yes
9763else
9764 gl_cv_func_frexp_works=no
9765fi
9766rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9767 conftest.$ac_objext conftest.beam conftest.$ac_ext
9768fi
472fa5ee
SM
9769
9770
c0c3707f
CB
9771fi
9772{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
9773$as_echo "$gl_cv_func_frexp_works" >&6; }
472fa5ee 9774
c0c3707f
CB
9775 LIBS="$save_LIBS"
9776 case "$gl_cv_func_frexp_works" in
9777 *yes) gl_func_frexp=yes ;;
9778 *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
9779 esac
9780 else
9781 gl_func_frexp=no
9782 fi
9783 if test $gl_func_frexp = yes; then
472fa5ee 9784
c0c3707f 9785$as_echo "#define HAVE_FREXP 1" >>confdefs.h
472fa5ee 9786
c0c3707f 9787 fi
8690e634 9788
6ec2e0f5
SDJ
9789
9790
c0c3707f
CB
9791 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
9792$as_echo_n "checking whether long double and double are the same... " >&6; }
9793if ${gl_cv_long_double_equals_double+:} false; then :
8690e634
JK
9794 $as_echo_n "(cached) " >&6
9795else
c0c3707f
CB
9796 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9797/* end confdefs.h. */
9798#include <float.h>
9799int
9800main ()
9801{
9802typedef int check[sizeof (long double) == sizeof (double)
9803 && LDBL_MANT_DIG == DBL_MANT_DIG
9804 && LDBL_MAX_EXP == DBL_MAX_EXP
9805 && LDBL_MIN_EXP == DBL_MIN_EXP
9806 ? 1 : -1];
8690e634 9807
c0c3707f
CB
9808 ;
9809 return 0;
9810}
9811_ACEOF
9812if ac_fn_c_try_compile "$LINENO"; then :
9813 gl_cv_long_double_equals_double=yes
9814else
9815 gl_cv_long_double_equals_double=no
9816fi
9817rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9818
c0c3707f
CB
9819fi
9820{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
9821$as_echo "$gl_cv_long_double_equals_double" >&6; }
9822 if test $gl_cv_long_double_equals_double = yes; then
8690e634 9823
c0c3707f 9824$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
6ec2e0f5 9825
c0c3707f
CB
9826 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
9827 else
9828 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
9829 fi
8690e634 9830
6ec2e0f5 9831
6ec2e0f5 9832
6ec2e0f5
SDJ
9833
9834
6ec2e0f5 9835
8690e634
JK
9836
9837
c0c3707f
CB
9838 ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
9839"
9840if test "x$ac_cv_have_decl_frexpl" = xyes; then :
8690e634 9841
c0c3707f
CB
9842else
9843 HAVE_DECL_FREXPL=0
9844fi
8690e634 9845
6ec2e0f5 9846
c0c3707f
CB
9847 FREXPL_LIBM=
9848 if test $HAVE_DECL_FREXPL = 1; then
6ec2e0f5 9849
c0c3707f
CB
9850 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
9851$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
9852if ${gl_cv_func_frexpl_no_libm+:} false; then :
8690e634
JK
9853 $as_echo_n "(cached) " >&6
9854else
c0c3707f
CB
9855
9856 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9857/* end confdefs.h. */
c0c3707f
CB
9858#include <math.h>
9859 long double x;
9860int
9861main ()
9862{
9863int e; return frexpl (x, &e) > 0;
9864 ;
9865 return 0;
9866}
9867_ACEOF
9868if ac_fn_c_try_link "$LINENO"; then :
9869 gl_cv_func_frexpl_no_libm=yes
9870else
9871 gl_cv_func_frexpl_no_libm=no
9872fi
9873rm -f core conftest.err conftest.$ac_objext \
9874 conftest$ac_exeext conftest.$ac_ext
8690e634 9875
c0c3707f
CB
9876fi
9877{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
9878$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
6ec2e0f5 9879
c0c3707f
CB
9880 if test $gl_cv_func_frexpl_no_libm = no; then
9881 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5
9882$as_echo_n "checking whether frexpl() can be used with libm... " >&6; }
9883if ${gl_cv_func_frexpl_in_libm+:} false; then :
9884 $as_echo_n "(cached) " >&6
9885else
6ec2e0f5 9886
c0c3707f
CB
9887 save_LIBS="$LIBS"
9888 LIBS="$LIBS -lm"
9889 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9890/* end confdefs.h. */
9891#include <math.h>
9892 long double x;
9893int
9894main ()
9895{
9896int e; return frexpl (x, &e) > 0;
9897 ;
9898 return 0;
9899}
9900_ACEOF
9901if ac_fn_c_try_link "$LINENO"; then :
9902 gl_cv_func_frexpl_in_libm=yes
9903else
9904 gl_cv_func_frexpl_in_libm=no
9905fi
9906rm -f core conftest.err conftest.$ac_objext \
9907 conftest$ac_exeext conftest.$ac_ext
9908 LIBS="$save_LIBS"
6ec2e0f5 9909
c0c3707f
CB
9910fi
9911{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5
9912$as_echo "$gl_cv_func_frexpl_in_libm" >&6; }
9913 if test $gl_cv_func_frexpl_in_libm = yes; then
9914 FREXPL_LIBM=-lm
9915 fi
9916 fi
9917 if test $gl_cv_func_frexpl_no_libm = yes \
9918 || test $gl_cv_func_frexpl_in_libm = yes; then
9919 save_LIBS="$LIBS"
9920 LIBS="$LIBS $FREXPL_LIBM"
8690e634 9921
8690e634 9922
c0c3707f
CB
9923 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
9924$as_echo_n "checking whether frexpl works... " >&6; }
9925if ${gl_cv_func_frexpl_works+:} false; then :
9926 $as_echo_n "(cached) " >&6
9927else
8690e634 9928
c0c3707f 9929 if test "$cross_compiling" = yes; then :
8690e634 9930
c0c3707f
CB
9931 case "$host_os" in
9932 aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
9933 gl_cv_func_frexpl_works="guessing no";;
9934 *) gl_cv_func_frexpl_works="guessing yes";;
9935 esac
8690e634 9936
c0c3707f
CB
9937else
9938 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9939/* end confdefs.h. */
8690e634 9940
c0c3707f
CB
9941#include <float.h>
9942#include <math.h>
9943/* Override the values of <float.h>, like done in float.in.h. */
9944#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
9945# undef LDBL_MIN_EXP
9946# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9947#endif
c0c3707f
CB
9948#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
9949# undef LDBL_MIN_EXP
9950# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9951#endif
c0c3707f
CB
9952#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
9953# undef LDBL_MIN_EXP
9954# define LDBL_MIN_EXP DBL_MIN_EXP
6ec2e0f5 9955#endif
c0c3707f
CB
9956#if defined __sgi && (LDBL_MANT_DIG >= 106)
9957# if defined __GNUC__
9958# undef LDBL_MIN_EXP
9959# define LDBL_MIN_EXP DBL_MIN_EXP
9960# endif
6ec2e0f5 9961#endif
c0c3707f
CB
9962extern
9963#ifdef __cplusplus
9964"C"
9965#endif
9966long double frexpl (long double, int *);
9c9d63b1 9967long double zero = 0.0L;
c0c3707f 9968int main()
8690e634 9969{
c0c3707f
CB
9970 int result = 0;
9971 volatile long double x;
9972 /* Test on finite numbers that fails on AIX 5.1. */
9973 x = 16.0L;
9974 {
9975 int exp = -9999;
9976 frexpl (x, &exp);
9977 if (exp != 5)
9978 result |= 1;
9979 }
9980 /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
9981 function returns an invalid (incorrectly normalized) value: it returns
9982 y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
9983 but the correct result is
9984 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
9985 x = 1.01L;
9986 {
9987 int exp = -9999;
9988 long double y = frexpl (x, &exp);
9989 if (!(exp == 1 && y == 0.505L))
9990 result |= 2;
9991 }
9992 /* Test on large finite numbers. This fails on BeOS at i = 16322, while
9993 LDBL_MAX_EXP = 16384.
9994 In the loop end test, we test x against Infinity, rather than comparing
9995 i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
9996 {
9997 int i;
9998 for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
9999 {
10000 int exp = -9999;
10001 frexpl (x, &exp);
10002 if (exp != i)
10003 {
10004 result |= 4;
10005 break;
10006 }
10007 }
10008 }
10009 /* Test on denormalized numbers. */
10010 {
10011 int i;
10012 for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
10013 ;
10014 if (x > 0.0L)
10015 {
10016 int exp;
10017 long double y = frexpl (x, &exp);
10018 /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
10019 exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
10020 if (exp != LDBL_MIN_EXP - 1)
10021 result |= 8;
10022 }
10023 }
10024 /* Test on infinite numbers. */
9c9d63b1
PM
10025 /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */
10026 x = 1.0L / zero;
c0c3707f
CB
10027 {
10028 int exp;
10029 long double y = frexpl (x, &exp);
10030 if (y != x)
10031 result |= 16;
10032 }
10033 return result;
8690e634
JK
10034}
10035_ACEOF
c0c3707f
CB
10036if ac_fn_c_try_run "$LINENO"; then :
10037 gl_cv_func_frexpl_works=yes
6ec2e0f5 10038else
c0c3707f
CB
10039 gl_cv_func_frexpl_works=no
10040fi
10041rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10042 conftest.$ac_objext conftest.beam conftest.$ac_ext
10043fi
8690e634 10044
8690e634 10045
c0c3707f
CB
10046fi
10047{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
10048$as_echo "$gl_cv_func_frexpl_works" >&6; }
8690e634 10049
c0c3707f
CB
10050 LIBS="$save_LIBS"
10051 case "$gl_cv_func_frexpl_works" in
10052 *yes) gl_func_frexpl=yes ;;
10053 *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
10054 esac
10055 else
10056 gl_func_frexpl=no
10057 fi
10058 if test $gl_func_frexpl = yes; then
8690e634 10059
c0c3707f 10060$as_echo "#define HAVE_FREXPL 1" >>confdefs.h
8690e634 10061
c0c3707f
CB
10062 fi
10063 fi
10064 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
10065 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
8690e634 10066
c0c3707f
CB
10067 FREXPL_LIBM="$FREXP_LIBM"
10068 else
10069 FREXPL_LIBM=
10070 fi
10071 fi
6ec2e0f5 10072
6ec2e0f5 10073
6ec2e0f5 10074
c0c3707f
CB
10075 GNULIB_FCHMODAT=0;
10076 GNULIB_FSTAT=0;
10077 GNULIB_FSTATAT=0;
10078 GNULIB_FUTIMENS=0;
9c9d63b1 10079 GNULIB_GETUMASK=0;
c0c3707f
CB
10080 GNULIB_LCHMOD=0;
10081 GNULIB_LSTAT=0;
9c9d63b1 10082 GNULIB_MKDIR=0;
c0c3707f
CB
10083 GNULIB_MKDIRAT=0;
10084 GNULIB_MKFIFO=0;
10085 GNULIB_MKFIFOAT=0;
10086 GNULIB_MKNOD=0;
10087 GNULIB_MKNODAT=0;
10088 GNULIB_STAT=0;
10089 GNULIB_UTIMENSAT=0;
10090 GNULIB_OVERRIDES_STRUCT_STAT=0;
9c9d63b1
PM
10091 GNULIB_MDA_CHMOD=1;
10092 GNULIB_MDA_MKDIR=1;
10093 GNULIB_MDA_UMASK=1;
c0c3707f
CB
10094 HAVE_FCHMODAT=1;
10095 HAVE_FSTATAT=1;
10096 HAVE_FUTIMENS=1;
9c9d63b1 10097 HAVE_GETUMASK=1;
c0c3707f
CB
10098 HAVE_LCHMOD=1;
10099 HAVE_LSTAT=1;
10100 HAVE_MKDIRAT=1;
10101 HAVE_MKFIFO=1;
10102 HAVE_MKFIFOAT=1;
10103 HAVE_MKNOD=1;
10104 HAVE_MKNODAT=1;
10105 HAVE_UTIMENSAT=1;
5df4cba6 10106 REPLACE_FCHMODAT=0;
c0c3707f
CB
10107 REPLACE_FSTAT=0;
10108 REPLACE_FSTATAT=0;
10109 REPLACE_FUTIMENS=0;
10110 REPLACE_LSTAT=0;
10111 REPLACE_MKDIR=0;
10112 REPLACE_MKFIFO=0;
9c9d63b1 10113 REPLACE_MKFIFOAT=0;
c0c3707f 10114 REPLACE_MKNOD=0;
9c9d63b1 10115 REPLACE_MKNODAT=0;
c0c3707f
CB
10116 REPLACE_STAT=0;
10117 REPLACE_UTIMENSAT=0;
10118
10119{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
10120$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
10121if ${ac_cv_header_stat_broken+:} false; then :
10122 $as_echo_n "(cached) " >&6
10123else
10124 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10125/* end confdefs.h. */
10126#include <sys/types.h>
10127#include <sys/stat.h>
10128
10129#if defined S_ISBLK && defined S_IFDIR
10130extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
10131#endif
10132
10133#if defined S_ISBLK && defined S_IFCHR
10134extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
10135#endif
10136
10137#if defined S_ISLNK && defined S_IFREG
10138extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
10139#endif
8690e634 10140
c0c3707f
CB
10141#if defined S_ISSOCK && defined S_IFREG
10142extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
10143#endif
8690e634 10144
c0c3707f
CB
10145_ACEOF
10146if ac_fn_c_try_compile "$LINENO"; then :
10147 ac_cv_header_stat_broken=no
10148else
10149 ac_cv_header_stat_broken=yes
6ec2e0f5
SDJ
10150fi
10151rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 10152fi
c0c3707f
CB
10153{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
10154$as_echo "$ac_cv_header_stat_broken" >&6; }
10155if test $ac_cv_header_stat_broken = yes; then
8690e634 10156
c0c3707f 10157$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
49e4877c 10158
c0c3707f 10159fi
49e4877c
PA
10160
10161
10162
10163
8690e634 10164
c0c3707f
CB
10165 case "$host_os" in
10166 mingw*)
10167 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
10168$as_echo_n "checking for 64-bit off_t... " >&6; }
10169if ${gl_cv_type_off_t_64+:} false; then :
10170 $as_echo_n "(cached) " >&6
10171else
10172 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10173/* end confdefs.h. */
10174#include <sys/types.h>
10175 int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
8690e634 10176
6ec2e0f5
SDJ
10177int
10178main ()
10179{
8690e634 10180
6ec2e0f5
SDJ
10181 ;
10182 return 0;
10183}
10184_ACEOF
10185if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
10186 gl_cv_type_off_t_64=yes
10187else
10188 gl_cv_type_off_t_64=no
6ec2e0f5
SDJ
10189fi
10190rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 10191
c0c3707f
CB
10192fi
10193{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
10194$as_echo "$gl_cv_type_off_t_64" >&6; }
10195 if test $gl_cv_type_off_t_64 = no; then
10196 WINDOWS_64_BIT_OFF_T=1
10197 else
10198 WINDOWS_64_BIT_OFF_T=0
10199 fi
10200 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
10201$as_echo_n "checking for 64-bit st_size... " >&6; }
10202if ${gl_cv_member_st_size_64+:} false; then :
6ec2e0f5
SDJ
10203 $as_echo_n "(cached) " >&6
10204else
c0c3707f 10205 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10206/* end confdefs.h. */
c0c3707f
CB
10207#include <sys/types.h>
10208 struct stat buf;
10209 int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
8690e634 10210
6ec2e0f5
SDJ
10211int
10212main ()
10213{
8690e634 10214
6ec2e0f5
SDJ
10215 ;
10216 return 0;
10217}
10218_ACEOF
10219if ac_fn_c_try_compile "$LINENO"; then :
698be2d8
CB
10220 gl_cv_member_st_size_64=yes
10221else
10222 gl_cv_member_st_size_64=no
10223fi
10224rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10225
10226fi
10227{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
10228$as_echo "$gl_cv_member_st_size_64" >&6; }
10229 if test $gl_cv_member_st_size_64 = no; then
10230 WINDOWS_64_BIT_ST_SIZE=1
10231 else
10232 WINDOWS_64_BIT_ST_SIZE=0
10233 fi
10234 ;;
10235 *)
10236 WINDOWS_64_BIT_OFF_T=0
10237 WINDOWS_64_BIT_ST_SIZE=0
10238 ;;
10239 esac
10240
10241{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
10242$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
10243if ${ac_cv_c_restrict+:} false; then :
10244 $as_echo_n "(cached) " >&6
10245else
10246 ac_cv_c_restrict=no
9c9d63b1
PM
10247 # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
10248 # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
10249 # Put 'restrict' last, because C++ lacks it.
10250 for ac_kw in __restrict__ __restrict _Restrict restrict; do
698be2d8
CB
10251 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10252/* end confdefs.h. */
10253typedef int *int_ptr;
10254 int foo (int_ptr $ac_kw ip) { return ip[0]; }
10255 int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
10256 int bar (int ip[$ac_kw]) { return ip[0]; }
10257
10258int
10259main ()
10260{
10261int s[1];
10262 int *$ac_kw t = s;
10263 t[0] = 0;
10264 return foo (t) + bar (t);
10265
10266 ;
10267 return 0;
10268}
10269_ACEOF
10270if ac_fn_c_try_compile "$LINENO"; then :
10271 ac_cv_c_restrict=$ac_kw
6ec2e0f5
SDJ
10272fi
10273rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
698be2d8
CB
10274 test "$ac_cv_c_restrict" != no && break
10275 done
8690e634 10276
6ec2e0f5 10277fi
698be2d8
CB
10278{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
10279$as_echo "$ac_cv_c_restrict" >&6; }
10280
10281 case $ac_cv_c_restrict in
10282 restrict) ;;
10283 no) $as_echo "#define restrict /**/" >>confdefs.h
10284 ;;
10285 *) cat >>confdefs.h <<_ACEOF
10286#define restrict $ac_cv_c_restrict
10287_ACEOF
10288 ;;
10289 esac
8690e634
JK
10290
10291
10292
10293
10294
10295
c0c3707f
CB
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305 if test $gl_cv_have_include_next = yes; then
10306 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
10307 else
10308 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
10309$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
10310if ${gl_cv_next_sys_stat_h+:} false; then :
8690e634
JK
10311 $as_echo_n "(cached) " >&6
10312else
10313
c0c3707f 10314 if test $ac_cv_header_sys_stat_h = yes; then
4a626d0a
PA
10315
10316
4a626d0a 10317
c0c3707f
CB
10318
10319 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10320/* end confdefs.h. */
10321#include <sys/stat.h>
6ec2e0f5 10322_ACEOF
c0c3707f
CB
10323 case "$host_os" in
10324 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10325 *) gl_absname_cpp="$ac_cpp" ;;
10326 esac
10327
10328 case "$host_os" in
10329 mingw*)
10330 gl_dirsep_regex='[/\\]'
10331 ;;
10332 *)
10333 gl_dirsep_regex='\/'
10334 ;;
10335 esac
10336 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10337 gl_header_literal_regex=`echo 'sys/stat.h' \
10338 | sed -e "$gl_make_literal_regex_sed"`
10339 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10340 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10341 s|^/[^/]|//&|
10342 p
10343 q
10344 }'
10345
10346 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10347 sed -n "$gl_absolute_header_sed"`
10348
10349 gl_header=$gl_cv_absolute_sys_stat_h
10350 gl_cv_next_sys_stat_h='"'$gl_header'"'
10351 else
10352 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
10353 fi
10354
10355
10356fi
10357{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
10358$as_echo "$gl_cv_next_sys_stat_h" >&6; }
10359 fi
10360 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
10361
10362 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10363 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10364 gl_next_as_first_directive='<'sys/stat.h'>'
10365 else
10366 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10367 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
10368 fi
10369 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
10370
10371
10372
10373
10374
10375
10376
10377
10378 WINDOWS_STAT_TIMESPEC=0
10379
10380
10381
10382
4a626d0a 10383
4a626d0a 10384
8690e634
JK
10385
10386
c0c3707f
CB
10387 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
10388 #include <sys/stat.h>
10389"
10390if test "x$ac_cv_type_nlink_t" = xyes; then :
8690e634 10391
6ec2e0f5 10392else
8690e634 10393
c0c3707f 10394$as_echo "#define nlink_t int" >>confdefs.h
6ec2e0f5 10395
6ec2e0f5 10396fi
8690e634
JK
10397
10398
10399
10400
10401
10402
10403
698be2d8
CB
10404
10405
6ec2e0f5 10406
9c9d63b1
PM
10407 case "$host_os" in
10408 mingw*)
10409 for ac_header in sdkddkver.h
10410do :
10411 ac_fn_c_check_header_mongrel "$LINENO" "sdkddkver.h" "ac_cv_header_sdkddkver_h" "$ac_includes_default"
10412if test "x$ac_cv_header_sdkddkver_h" = xyes; then :
10413 cat >>confdefs.h <<_ACEOF
10414#define HAVE_SDKDDKVER_H 1
8690e634 10415_ACEOF
6ec2e0f5 10416
8690e634 10417fi
c0c3707f 10418
9c9d63b1 10419done
8690e634 10420
c0c3707f
CB
10421 ;;
10422 esac
8690e634 10423
8690e634 10424
8690e634 10425
8690e634 10426
c0c3707f
CB
10427
10428 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
10429$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
10430if ${gl_cv_func_getcwd_null+:} false; then :
8690e634
JK
10431 $as_echo_n "(cached) " >&6
10432else
c0c3707f
CB
10433 if test "$cross_compiling" = yes; then :
10434 case "$host_os" in
10435 # Guess yes on glibc systems.
10436 *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
10437 # Guess yes on musl systems.
10438 *-musl*) gl_cv_func_getcwd_null="guessing yes";;
10439 # Guess yes on Cygwin.
10440 cygwin*) gl_cv_func_getcwd_null="guessing yes";;
10441 # If we don't know, obey --enable-cross-guesses.
10442 *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
10443 esac
10444
10445else
10446 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
10447/* end confdefs.h. */
10448
c0c3707f
CB
10449# include <stdlib.h>
10450# if HAVE_UNISTD_H
10451# include <unistd.h>
10452# else /* on Windows with MSVC */
10453# include <direct.h>
10454# endif
9c9d63b1
PM
10455
10456
10457$gl_mda_defines
10458
c0c3707f
CB
10459# ifndef getcwd
10460 char *getcwd ();
10461# endif
8690e634
JK
10462
10463int
10464main ()
10465{
10466
c0c3707f 10467#if defined _WIN32 && ! defined __CYGWIN__
9c9d63b1 10468/* mingw cwd does not start with '/', but _getcwd does allocate.
c0c3707f
CB
10469 However, mingw fails to honor non-zero size. */
10470#else
10471 if (chdir ("/") != 0)
10472 return 1;
10473 else
10474 {
10475 char *f = getcwd (NULL, 0);
10476 if (! f)
10477 return 2;
10478 if (f[0] != '/')
10479 { free (f); return 3; }
10480 if (f[1] != '\0')
10481 { free (f); return 4; }
10482 free (f);
10483 return 0;
10484 }
10485#endif
10486
8690e634
JK
10487 ;
10488 return 0;
10489}
10490_ACEOF
c0c3707f
CB
10491if ac_fn_c_try_run "$LINENO"; then :
10492 gl_cv_func_getcwd_null=yes
10493else
10494 gl_cv_func_getcwd_null=no
8690e634 10495fi
c0c3707f
CB
10496rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10497 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 10498fi
8690e634 10499
c0c3707f
CB
10500fi
10501{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
10502$as_echo "$gl_cv_func_getcwd_null" >&6; }
8690e634 10503
6ec2e0f5 10504
c0c3707f
CB
10505 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
10506$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
10507if ${gl_cv_func_getcwd_posix_signature+:} false; then :
8690e634
JK
10508 $as_echo_n "(cached) " >&6
10509else
c0c3707f 10510 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 10511/* end confdefs.h. */
c0c3707f 10512#include <unistd.h>
9c9d63b1
PM
10513
10514
10515$gl_mda_defines
10516
88b48903
WN
10517int
10518main ()
10519{
c0c3707f
CB
10520extern
10521 #ifdef __cplusplus
10522 "C"
10523 #endif
10524 char *getcwd (char *, size_t);
88b48903
WN
10525
10526 ;
10527 return 0;
10528}
c0c3707f 10529
88b48903
WN
10530_ACEOF
10531if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
10532 gl_cv_func_getcwd_posix_signature=yes
10533else
10534 gl_cv_func_getcwd_posix_signature=no
8690e634 10535fi
88b48903 10536rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 10537
c0c3707f
CB
10538fi
10539{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
10540$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
8690e634 10541
c0c3707f
CB
10542ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
10543if test "x$ac_cv_have_decl_getcwd" = xyes; then :
10544 ac_have_decl=1
10545else
10546 ac_have_decl=0
10547fi
8690e634 10548
c0c3707f
CB
10549cat >>confdefs.h <<_ACEOF
10550#define HAVE_DECL_GETCWD $ac_have_decl
10551_ACEOF
8690e634
JK
10552
10553
c17253b9
MF
10554 GNULIB_DPRINTF=0;
10555 GNULIB_FCLOSE=0;
10556 GNULIB_FDOPEN=0;
10557 GNULIB_FFLUSH=0;
10558 GNULIB_FGETC=0;
10559 GNULIB_FGETS=0;
10560 GNULIB_FOPEN=0;
10561 GNULIB_FPRINTF=0;
10562 GNULIB_FPRINTF_POSIX=0;
10563 GNULIB_FPURGE=0;
10564 GNULIB_FPUTC=0;
10565 GNULIB_FPUTS=0;
10566 GNULIB_FREAD=0;
10567 GNULIB_FREOPEN=0;
10568 GNULIB_FSCANF=0;
10569 GNULIB_FSEEK=0;
10570 GNULIB_FSEEKO=0;
10571 GNULIB_FTELL=0;
10572 GNULIB_FTELLO=0;
10573 GNULIB_FWRITE=0;
10574 GNULIB_GETC=0;
10575 GNULIB_GETCHAR=0;
10576 GNULIB_GETDELIM=0;
10577 GNULIB_GETLINE=0;
10578 GNULIB_OBSTACK_PRINTF=0;
10579 GNULIB_OBSTACK_PRINTF_POSIX=0;
10580 GNULIB_PCLOSE=0;
10581 GNULIB_PERROR=0;
10582 GNULIB_POPEN=0;
10583 GNULIB_PRINTF=0;
10584 GNULIB_PRINTF_POSIX=0;
10585 GNULIB_PUTC=0;
10586 GNULIB_PUTCHAR=0;
10587 GNULIB_PUTS=0;
10588 GNULIB_REMOVE=0;
10589 GNULIB_RENAME=0;
10590 GNULIB_RENAMEAT=0;
10591 GNULIB_SCANF=0;
10592 GNULIB_SNPRINTF=0;
10593 GNULIB_SPRINTF_POSIX=0;
10594 GNULIB_STDIO_H_NONBLOCKING=0;
10595 GNULIB_STDIO_H_SIGPIPE=0;
10596 GNULIB_TMPFILE=0;
10597 GNULIB_VASPRINTF=0;
10598 GNULIB_VFSCANF=0;
10599 GNULIB_VSCANF=0;
10600 GNULIB_VDPRINTF=0;
10601 GNULIB_VFPRINTF=0;
10602 GNULIB_VFPRINTF_POSIX=0;
10603 GNULIB_VPRINTF=0;
10604 GNULIB_VPRINTF_POSIX=0;
10605 GNULIB_VSNPRINTF=0;
10606 GNULIB_VSPRINTF_POSIX=0;
10607 GNULIB_MDA_FCLOSEALL=1;
10608 GNULIB_MDA_FDOPEN=1;
10609 GNULIB_MDA_FILENO=1;
10610 GNULIB_MDA_GETW=1;
10611 GNULIB_MDA_PUTW=1;
10612 GNULIB_MDA_TEMPNAM=1;
10613 HAVE_DECL_FCLOSEALL=1;
10614 HAVE_DECL_FPURGE=1;
10615 HAVE_DECL_FSEEKO=1;
10616 HAVE_DECL_FTELLO=1;
10617 HAVE_DECL_GETDELIM=1;
10618 HAVE_DECL_GETLINE=1;
10619 HAVE_DECL_OBSTACK_PRINTF=1;
10620 HAVE_DECL_SNPRINTF=1;
10621 HAVE_DECL_VSNPRINTF=1;
10622 HAVE_DPRINTF=1;
10623 HAVE_FSEEKO=1;
10624 HAVE_FTELLO=1;
10625 HAVE_PCLOSE=1;
10626 HAVE_POPEN=1;
10627 HAVE_RENAMEAT=1;
10628 HAVE_VASPRINTF=1;
10629 HAVE_VDPRINTF=1;
10630 REPLACE_DPRINTF=0;
10631 REPLACE_FCLOSE=0;
10632 REPLACE_FDOPEN=0;
10633 REPLACE_FFLUSH=0;
10634 REPLACE_FOPEN=0;
10635 REPLACE_FPRINTF=0;
10636 REPLACE_FPURGE=0;
10637 REPLACE_FREOPEN=0;
10638 REPLACE_FSEEK=0;
10639 REPLACE_FSEEKO=0;
10640 REPLACE_FTELL=0;
10641 REPLACE_FTELLO=0;
10642 REPLACE_GETDELIM=0;
10643 REPLACE_GETLINE=0;
10644 REPLACE_OBSTACK_PRINTF=0;
10645 REPLACE_PERROR=0;
10646 REPLACE_POPEN=0;
10647 REPLACE_PRINTF=0;
10648 REPLACE_REMOVE=0;
10649 REPLACE_RENAME=0;
10650 REPLACE_RENAMEAT=0;
10651 REPLACE_SNPRINTF=0;
10652 REPLACE_SPRINTF=0;
10653 REPLACE_STDIO_READ_FUNCS=0;
10654 REPLACE_STDIO_WRITE_FUNCS=0;
10655 REPLACE_TMPFILE=0;
10656 REPLACE_VASPRINTF=0;
10657 REPLACE_VDPRINTF=0;
10658 REPLACE_VFPRINTF=0;
10659 REPLACE_VPRINTF=0;
10660 REPLACE_VSNPRINTF=0;
10661 REPLACE_VSPRINTF=0;
10662
10663ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" "$ac_includes_default"
10664if test "x$ac_cv_have_decl_getdelim" = xyes; then :
10665 ac_have_decl=1
10666else
10667 ac_have_decl=0
10668fi
10669
10670cat >>confdefs.h <<_ACEOF
10671#define HAVE_DECL_GETDELIM $ac_have_decl
10672_ACEOF
10673
10674
10675
10676
10677
10678ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
10679if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
10680 ac_have_decl=1
10681else
10682 ac_have_decl=0
10683fi
10684
10685cat >>confdefs.h <<_ACEOF
10686#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
10687_ACEOF
10688
10689ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" "$ac_includes_default"
10690if test "x$ac_cv_have_decl_getline" = xyes; then :
10691 ac_have_decl=1
10692else
10693 ac_have_decl=0
10694fi
10695
10696cat >>confdefs.h <<_ACEOF
10697#define HAVE_DECL_GETLINE $ac_have_decl
10698_ACEOF
10699
10700ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default"
10701if test "x$ac_cv_have_decl_getlogin_r" = xyes; then :
10702 ac_have_decl=1
10703else
10704 ac_have_decl=0
10705fi
10706
10707cat >>confdefs.h <<_ACEOF
10708#define HAVE_DECL_GETLOGIN_R $ac_have_decl
10709_ACEOF
10710
10711
10712
10713ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default"
10714if test "x$ac_cv_have_decl_getlogin" = xyes; then :
10715 ac_have_decl=1
10716else
10717 ac_have_decl=0
10718fi
10719
10720cat >>confdefs.h <<_ACEOF
10721#define HAVE_DECL_GETLOGIN $ac_have_decl
10722_ACEOF
10723
10724
10725
10726 case $host_os in
10727 mingw*)
c0c3707f
CB
10728 LIB_GETLOGIN='-ladvapi32' ;;
10729 *)
10730 LIB_GETLOGIN= ;;
10731 esac
6ec2e0f5 10732
472fa5ee
SM
10733
10734
10735
6ec2e0f5
SDJ
10736
10737
10738
698be2d8
CB
10739 GNULIB_GETRANDOM=0;
10740 HAVE_GETRANDOM=1;
10741 REPLACE_GETRANDOM=0;
10742
10743
10744
10745
c0c3707f
CB
10746 GNULIB_GETTIMEOFDAY=0;
10747 HAVE_GETTIMEOFDAY=1;
10748 HAVE_STRUCT_TIMEVAL=1;
10749 HAVE_SYS_TIME_H=1;
10750 REPLACE_GETTIMEOFDAY=0;
10751 REPLACE_STRUCT_TIMEVAL=0;
472fa5ee 10752
472fa5ee 10753
6ec2e0f5
SDJ
10754
10755
10756
10757
10758
10759
472fa5ee
SM
10760
10761
10762
6ec2e0f5
SDJ
10763
10764
10765
10766
10767
10768 if test $gl_cv_have_include_next = yes; then
c0c3707f 10769 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10770 else
c0c3707f
CB
10771 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
10772$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
10773if ${gl_cv_next_sys_time_h+:} false; then :
6ec2e0f5 10774 $as_echo_n "(cached) " >&6
88b48903 10775else
8690e634 10776
c0c3707f 10777 if test $ac_cv_header_sys_time_h = yes; then
8690e634
JK
10778
10779
8690e634
JK
10780
10781
6ec2e0f5
SDJ
10782 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10783/* end confdefs.h. */
c0c3707f 10784#include <sys/time.h>
88b48903 10785_ACEOF
6ec2e0f5
SDJ
10786 case "$host_os" in
10787 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10788 *) gl_absname_cpp="$ac_cpp" ;;
10789 esac
8690e634 10790
6ec2e0f5
SDJ
10791 case "$host_os" in
10792 mingw*)
10793 gl_dirsep_regex='[/\\]'
10794 ;;
10795 *)
10796 gl_dirsep_regex='\/'
88b48903
WN
10797 ;;
10798 esac
6ec2e0f5 10799 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 10800 gl_header_literal_regex=`echo 'sys/time.h' \
6ec2e0f5
SDJ
10801 | sed -e "$gl_make_literal_regex_sed"`
10802 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10803 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10804 s|^/[^/]|//&|
10805 p
10806 q
10807 }'
8690e634 10808
c0c3707f 10809 gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5 10810 sed -n "$gl_absolute_header_sed"`
8690e634 10811
c0c3707f
CB
10812 gl_header=$gl_cv_absolute_sys_time_h
10813 gl_cv_next_sys_time_h='"'$gl_header'"'
6ec2e0f5 10814 else
c0c3707f 10815 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10816 fi
88b48903 10817
88b48903 10818
88b48903 10819fi
c0c3707f
CB
10820{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
10821$as_echo "$gl_cv_next_sys_time_h" >&6; }
6ec2e0f5 10822 fi
c0c3707f 10823 NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
88b48903 10824
6ec2e0f5
SDJ
10825 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10826 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 10827 gl_next_as_first_directive='<'sys/time.h'>'
6ec2e0f5
SDJ
10828 else
10829 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f
CB
10830 gl_next_as_first_directive=$gl_cv_next_sys_time_h
10831 fi
10832 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
6ec2e0f5 10833
6ec2e0f5
SDJ
10834
10835
10836
6ec2e0f5 10837
c0c3707f
CB
10838 if test $ac_cv_header_sys_time_h != yes; then
10839 HAVE_SYS_TIME_H=0
10840 fi
6ec2e0f5 10841
6ec2e0f5 10842
6ec2e0f5 10843
6ec2e0f5 10844
6ec2e0f5 10845
c0c3707f
CB
10846 if test $ac_cv_header_sys_socket_h != yes; then
10847 for ac_header in winsock2.h
10848do :
10849 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10850if test "x$ac_cv_header_winsock2_h" = xyes; then :
10851 cat >>confdefs.h <<_ACEOF
10852#define HAVE_WINSOCK2_H 1
6ec2e0f5 10853_ACEOF
6ec2e0f5 10854
6ec2e0f5 10855fi
6ec2e0f5 10856
c0c3707f 10857done
6ec2e0f5 10858
c0c3707f
CB
10859 fi
10860 if test "$ac_cv_header_winsock2_h" = yes; then
10861 HAVE_WINSOCK2_H=1
10862 UNISTD_H_HAVE_WINSOCK2_H=1
10863 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
10864 else
10865 HAVE_WINSOCK2_H=0
10866 fi
10867
10868
10869 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
10870$as_echo_n "checking for struct timeval... " >&6; }
10871if ${gl_cv_sys_struct_timeval+:} false; then :
10872 $as_echo_n "(cached) " >&6
10873else
10874 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10875/* end confdefs.h. */
c0c3707f
CB
10876#if HAVE_SYS_TIME_H
10877 #include <sys/time.h>
10878 #endif
10879 #include <time.h>
10880 #if HAVE_WINSOCK2_H
10881 # include <winsock2.h>
10882 #endif
6ec2e0f5
SDJ
10883
10884int
10885main ()
10886{
c0c3707f 10887static struct timeval x; x.tv_sec = x.tv_usec;
6ec2e0f5
SDJ
10888 ;
10889 return 0;
10890}
10891_ACEOF
10892if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10893 gl_cv_sys_struct_timeval=yes
6ec2e0f5 10894else
c0c3707f 10895 gl_cv_sys_struct_timeval=no
6ec2e0f5
SDJ
10896fi
10897rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903 10898
c0c3707f
CB
10899fi
10900{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
10901$as_echo "$gl_cv_sys_struct_timeval" >&6; }
10902 if test $gl_cv_sys_struct_timeval != yes; then
10903 HAVE_STRUCT_TIMEVAL=0
10904 else
10905 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
10906$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
10907if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
10908 $as_echo_n "(cached) " >&6
10909else
10910 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88b48903 10911/* end confdefs.h. */
c0c3707f
CB
10912#if HAVE_SYS_TIME_H
10913 #include <sys/time.h>
10914 #endif
10915 #include <time.h>
10916 #if HAVE_WINSOCK2_H
10917 # include <winsock2.h>
10918 #endif
88b48903
WN
10919
10920int
10921main ()
10922{
c0c3707f
CB
10923static struct timeval x;
10924 typedef int verify_tv_sec_type[
10925 sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
10926 ];
88b48903
WN
10927
10928 ;
10929 return 0;
10930}
10931_ACEOF
10932if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10933 gl_cv_sys_struct_timeval_tv_sec=yes
88b48903 10934else
c0c3707f 10935 gl_cv_sys_struct_timeval_tv_sec=no
88b48903
WN
10936fi
10937rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10938
88b48903 10939fi
c0c3707f
CB
10940{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
10941$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
10942 if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
10943 REPLACE_STRUCT_TIMEVAL=1
88b48903 10944 fi
c0c3707f 10945 fi
88b48903 10946
c0c3707f
CB
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
c0c3707f
CB
10957 GNULIB_GLOB=0;
10958 HAVE_GLOB=1;
10959 HAVE_GLOB_PATTERN_P=1;
10960 REPLACE_GLOB=0;
10961 REPLACE_GLOB_PATTERN_P=0;
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979 if test $gl_cv_have_include_next = yes; then
10980 gl_cv_next_glob_h='<'glob.h'>'
10981 else
10982 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5
10983$as_echo_n "checking absolute name of <glob.h>... " >&6; }
10984if ${gl_cv_next_glob_h+:} false; then :
10985 $as_echo_n "(cached) " >&6
88b48903 10986else
c0c3707f
CB
10987
10988 if test $ac_cv_header_glob_h = yes; then
10989
10990
10991
10992
88b48903
WN
10993 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10994/* end confdefs.h. */
c0c3707f
CB
10995#include <glob.h>
10996_ACEOF
10997 case "$host_os" in
10998 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10999 *) gl_absname_cpp="$ac_cpp" ;;
11000 esac
88b48903 11001
c0c3707f
CB
11002 case "$host_os" in
11003 mingw*)
11004 gl_dirsep_regex='[/\\]'
11005 ;;
11006 *)
11007 gl_dirsep_regex='\/'
11008 ;;
11009 esac
11010 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11011 gl_header_literal_regex=`echo 'glob.h' \
11012 | sed -e "$gl_make_literal_regex_sed"`
11013 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11014 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11015 s|^/[^/]|//&|
11016 p
11017 q
11018 }'
11019
11020 gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11021 sed -n "$gl_absolute_header_sed"`
11022
11023 gl_header=$gl_cv_absolute_glob_h
11024 gl_cv_next_glob_h='"'$gl_header'"'
11025 else
11026 gl_cv_next_glob_h='<'glob.h'>'
11027 fi
88b48903 11028
88b48903 11029
88b48903 11030fi
c0c3707f
CB
11031{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5
11032$as_echo "$gl_cv_next_glob_h" >&6; }
11033 fi
11034 NEXT_GLOB_H=$gl_cv_next_glob_h
88b48903 11035
c0c3707f
CB
11036 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11037 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11038 gl_next_as_first_directive='<'glob.h'>'
11039 else
11040 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11041 gl_next_as_first_directive=$gl_cv_next_glob_h
11042 fi
11043 NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive
88b48903 11044
88b48903
WN
11045
11046
11047
2196f55f 11048
c0c3707f
CB
11049 if test $ac_cv_header_glob_h = yes; then
11050 HAVE_GLOB_H=1
11051 else
11052 HAVE_GLOB_H=0
11053 fi
2196f55f 11054
6ec2e0f5 11055
c0c3707f
CB
11056 GLOB_H=''
11057 if false; then
11058 GLOB_H=glob.h
11059 else
11060 if test $ac_cv_header_glob_h != yes; then
11061 GLOB_H=glob.h
11062 fi
11063 fi
11064
11065
11066 if test -n "$GLOB_H"; then
11067 GL_GENERATE_GLOB_H_TRUE=
11068 GL_GENERATE_GLOB_H_FALSE='#'
88b48903 11069else
c0c3707f
CB
11070 GL_GENERATE_GLOB_H_TRUE='#'
11071 GL_GENERATE_GLOB_H_FALSE=
6ec2e0f5
SDJ
11072fi
11073
88b48903 11074
88b48903 11075
88b48903 11076
88b48903
WN
11077
11078
11079
11080
11081
11082
11083
11084
8690e634 11085
c0c3707f
CB
11086
11087
c0c3707f 11088
5df4cba6
SM
11089 if test -z "$gl_pthreadlib_body_done"; then
11090 gl_pthread_api=no
11091 LIBPTHREAD=
11092 LIBPMULTITHREAD=
11093 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
11094 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
11095 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
11096if test "x$ac_cv_header_pthread_h" = xyes; then :
11097 gl_have_pthread_h=yes
c0c3707f 11098else
5df4cba6
SM
11099 gl_have_pthread_h=no
11100fi
c0c3707f 11101
5df4cba6
SM
11102
11103 if test "$gl_have_pthread_h" = yes; then
11104 # Other possible tests:
11105 # -lpthreads (FSU threads, PCthreads)
11106 # -lgthreads
11107 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
11108 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
11109 # the second one only in libpthread, and lock.c needs it.
11110 #
11111 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
11112 # needs -pthread for some reason. See:
11113 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
11114 save_LIBS=$LIBS
11115 for gl_pthread in '' '-pthread'; do
11116 LIBS="$LIBS $gl_pthread"
11117 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11118/* end confdefs.h. */
5df4cba6
SM
11119#include <pthread.h>
11120 pthread_mutex_t m;
11121 pthread_mutexattr_t ma;
11122
8690e634
JK
11123int
11124main ()
11125{
5df4cba6
SM
11126pthread_mutex_lock (&m);
11127 pthread_mutexattr_init (&ma);
8690e634
JK
11128 ;
11129 return 0;
11130}
11131_ACEOF
5df4cba6
SM
11132if ac_fn_c_try_link "$LINENO"; then :
11133 gl_pthread_api=yes
11134 LIBPTHREAD=$gl_pthread
11135 LIBPMULTITHREAD=$gl_pthread
c0c3707f 11136fi
5df4cba6
SM
11137rm -f core conftest.err conftest.$ac_objext \
11138 conftest$ac_exeext conftest.$ac_ext
11139 LIBS=$save_LIBS
11140 test $gl_pthread_api = yes && break
11141 done
6ec2e0f5 11142
5df4cba6
SM
11143 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
11144 # since it is defined as a macro on OSF/1.)
11145 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
11146 # The program links fine without libpthread. But it may actually
11147 # need to link with libpthread in order to create multiple threads.
11148 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
11149$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
11150if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
11151 $as_echo_n "(cached) " >&6
11152else
5df4cba6
SM
11153 ac_check_lib_save_LIBS=$LIBS
11154LIBS="-lpthread $LIBS"
11155cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11156/* end confdefs.h. */
5df4cba6
SM
11157
11158/* Override any GCC internal prototype to avoid an error.
11159 Use char because int might match the return type of a GCC
11160 builtin and then its argument prototype would still apply. */
11161#ifdef __cplusplus
11162extern "C"
11163#endif
11164char pthread_kill ();
6ec2e0f5
SDJ
11165int
11166main ()
11167{
5df4cba6 11168return pthread_kill ();
6ec2e0f5
SDJ
11169 ;
11170 return 0;
11171}
11172_ACEOF
5df4cba6
SM
11173if ac_fn_c_try_link "$LINENO"; then :
11174 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 11175else
5df4cba6 11176 ac_cv_lib_pthread_pthread_kill=no
8690e634 11177fi
5df4cba6
SM
11178rm -f core conftest.err conftest.$ac_objext \
11179 conftest$ac_exeext conftest.$ac_ext
11180LIBS=$ac_check_lib_save_LIBS
11181fi
11182{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
11183$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
11184if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
11185 LIBPMULTITHREAD=-lpthread
11186 # On Solaris and HP-UX, most pthread functions exist also in libc.
11187 # Therefore pthread_in_use() needs to actually try to create a
11188 # thread: pthread_create from libc will fail, whereas
11189 # pthread_create will actually create a thread.
11190 # On Solaris 10 or newer, this test is no longer needed, because
11191 # libc contains the fully functional pthread functions.
11192 case "$host_os" in
11193 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
11194
11195$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
11196
11197 esac
c0c3707f 11198
6ec2e0f5 11199fi
8690e634 11200
5df4cba6
SM
11201 elif test $gl_pthread_api != yes; then
11202 # Some library is needed. Try libpthread and libc_r.
11203 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
11204$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
11205if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
11206 $as_echo_n "(cached) " >&6
11207else
11208 ac_check_lib_save_LIBS=$LIBS
11209LIBS="-lpthread $LIBS"
11210cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11211/* end confdefs.h. */
c0c3707f 11212
5df4cba6
SM
11213/* Override any GCC internal prototype to avoid an error.
11214 Use char because int might match the return type of a GCC
11215 builtin and then its argument prototype would still apply. */
11216#ifdef __cplusplus
11217extern "C"
11218#endif
11219char pthread_kill ();
11220int
11221main ()
11222{
11223return pthread_kill ();
11224 ;
11225 return 0;
11226}
11227_ACEOF
11228if ac_fn_c_try_link "$LINENO"; then :
11229 ac_cv_lib_pthread_pthread_kill=yes
11230else
11231 ac_cv_lib_pthread_pthread_kill=no
11232fi
11233rm -f core conftest.err conftest.$ac_objext \
11234 conftest$ac_exeext conftest.$ac_ext
11235LIBS=$ac_check_lib_save_LIBS
11236fi
11237{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
11238$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
11239if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
11240 gl_pthread_api=yes
11241 LIBPTHREAD=-lpthread
11242 LIBPMULTITHREAD=-lpthread
11243fi
c0c3707f 11244
5df4cba6
SM
11245 if test $gl_pthread_api != yes; then
11246 # For FreeBSD 4.
11247 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
11248$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
11249if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
11250 $as_echo_n "(cached) " >&6
11251else
11252 ac_check_lib_save_LIBS=$LIBS
11253LIBS="-lc_r $LIBS"
11254cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11255/* end confdefs.h. */
c0c3707f 11256
5df4cba6
SM
11257/* Override any GCC internal prototype to avoid an error.
11258 Use char because int might match the return type of a GCC
11259 builtin and then its argument prototype would still apply. */
11260#ifdef __cplusplus
11261extern "C"
11262#endif
11263char pthread_kill ();
11264int
11265main ()
11266{
11267return pthread_kill ();
11268 ;
11269 return 0;
11270}
11271_ACEOF
11272if ac_fn_c_try_link "$LINENO"; then :
11273 ac_cv_lib_c_r_pthread_kill=yes
11274else
11275 ac_cv_lib_c_r_pthread_kill=no
11276fi
11277rm -f core conftest.err conftest.$ac_objext \
11278 conftest$ac_exeext conftest.$ac_ext
11279LIBS=$ac_check_lib_save_LIBS
11280fi
11281{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
11282$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
11283if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
11284 gl_pthread_api=yes
11285 LIBPTHREAD=-lc_r
11286 LIBPMULTITHREAD=-lc_r
11287fi
c0c3707f 11288
5df4cba6
SM
11289 fi
11290 fi
11291 fi
11292 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
11293$as_echo_n "checking whether POSIX threads API is available... " >&6; }
11294 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
11295$as_echo "$gl_pthread_api" >&6; }
c0c3707f
CB
11296
11297
5df4cba6 11298 if test $gl_pthread_api = yes; then
c0c3707f 11299
5df4cba6 11300$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
c0c3707f 11301
5df4cba6 11302 fi
c0c3707f 11303
5df4cba6
SM
11304 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11305/* end confdefs.h. */
11306#include <sched.h>
11307int
11308main ()
11309{
11310sched_yield ();
11311 ;
11312 return 0;
11313}
11314_ACEOF
11315if ac_fn_c_try_link "$LINENO"; then :
11316 LIB_SCHED_YIELD=
c0c3707f 11317
5df4cba6
SM
11318else
11319 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
11320$as_echo_n "checking for sched_yield in -lrt... " >&6; }
11321if ${ac_cv_lib_rt_sched_yield+:} false; then :
c0c3707f 11322 $as_echo_n "(cached) " >&6
6ec2e0f5 11323else
5df4cba6
SM
11324 ac_check_lib_save_LIBS=$LIBS
11325LIBS="-lrt $LIBS"
11326cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 11327/* end confdefs.h. */
6ec2e0f5 11328
5df4cba6
SM
11329/* Override any GCC internal prototype to avoid an error.
11330 Use char because int might match the return type of a GCC
11331 builtin and then its argument prototype would still apply. */
11332#ifdef __cplusplus
11333extern "C"
11334#endif
11335char sched_yield ();
11336int
11337main ()
11338{
11339return sched_yield ();
11340 ;
11341 return 0;
11342}
11343_ACEOF
11344if ac_fn_c_try_link "$LINENO"; then :
11345 ac_cv_lib_rt_sched_yield=yes
11346else
11347 ac_cv_lib_rt_sched_yield=no
11348fi
11349rm -f core conftest.err conftest.$ac_objext \
11350 conftest$ac_exeext conftest.$ac_ext
11351LIBS=$ac_check_lib_save_LIBS
11352fi
11353{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
11354$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
11355if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
11356 LIB_SCHED_YIELD=-lrt
11357else
11358 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
11359$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
11360if ${ac_cv_lib_posix4_sched_yield+:} false; then :
11361 $as_echo_n "(cached) " >&6
11362else
11363 ac_check_lib_save_LIBS=$LIBS
11364LIBS="-lposix4 $LIBS"
11365cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11366/* end confdefs.h. */
6ec2e0f5 11367
5df4cba6
SM
11368/* Override any GCC internal prototype to avoid an error.
11369 Use char because int might match the return type of a GCC
11370 builtin and then its argument prototype would still apply. */
11371#ifdef __cplusplus
11372extern "C"
11373#endif
11374char sched_yield ();
11375int
11376main ()
11377{
11378return sched_yield ();
11379 ;
11380 return 0;
11381}
11382_ACEOF
11383if ac_fn_c_try_link "$LINENO"; then :
11384 ac_cv_lib_posix4_sched_yield=yes
11385else
11386 ac_cv_lib_posix4_sched_yield=no
11387fi
11388rm -f core conftest.err conftest.$ac_objext \
11389 conftest$ac_exeext conftest.$ac_ext
11390LIBS=$ac_check_lib_save_LIBS
11391fi
11392{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
11393$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
11394if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
11395 LIB_SCHED_YIELD=-lposix4
6ec2e0f5 11396fi
8690e634 11397
5df4cba6 11398fi
8690e634 11399
8690e634 11400
5df4cba6
SM
11401fi
11402rm -f core conftest.err conftest.$ac_objext \
11403 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5
SDJ
11404
11405
5df4cba6 11406 gl_pthreadlib_body_done=done
c0c3707f 11407 fi
6ec2e0f5 11408
6ec2e0f5 11409
8690e634
JK
11410
11411
472fa5ee 11412
c0c3707f 11413
c0c3707f 11414
c0c3707f 11415
c0c3707f 11416
5df4cba6
SM
11417 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
11418$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
11419if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
11420 $as_echo_n "(cached) " >&6
11421else
11422 case "$host_os" in
11423 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
11424 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
11425 gl_cv_func_setlocale_null_all_mtsafe=no ;;
11426 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
11427 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
11428 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
11429 # If we don't know, obey --enable-cross-guesses.
11430 *)
11431 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
11432 esac
c0c3707f 11433
5e8754f9 11434fi
5df4cba6
SM
11435{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
11436$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
11437 case "$host_os" in
11438 mingw*) ;;
11439 *)
11440 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
11441 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
11442 fi
11443 ;;
11444 esac
11445 case "$gl_cv_func_setlocale_null_all_mtsafe" in
11446 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
11447 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
11448 esac
5e8754f9
SDJ
11449
11450cat >>confdefs.h <<_ACEOF
5df4cba6 11451#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
5e8754f9
SDJ
11452_ACEOF
11453
11454
5df4cba6
SM
11455 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
11456$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
11457if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
11458 $as_echo_n "(cached) " >&6
11459else
11460 case "$host_os" in
11461 # Guess no on OpenBSD, AIX.
11462 openbsd* | aix*)
11463 gl_cv_func_setlocale_null_one_mtsafe=no ;;
11464 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
11465 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
11466 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
11467 # If we don't know, obey --enable-cross-guesses.
11468 *)
11469 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
11470 esac
5abebf3c 11471
5df4cba6
SM
11472fi
11473{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
11474$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
11475 case "$host_os" in
11476 mingw*) ;;
11477 *)
11478 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
11479 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
11480 fi
11481 ;;
11482 esac
11483 case "$gl_cv_func_setlocale_null_one_mtsafe" in
11484 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
11485 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
11486 esac
5abebf3c 11487
c0c3707f 11488cat >>confdefs.h <<_ACEOF
5df4cba6 11489#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
5abebf3c 11490_ACEOF
c0c3707f
CB
11491
11492
5df4cba6
SM
11493 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
11494 case "$host_os" in
11495 mingw*) LIB_SETLOCALE_NULL= ;;
11496 *)
11497
11498
11499 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
11500$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
11501if ${gl_cv_have_weak+:} false; then :
11502 $as_echo_n "(cached) " >&6
5abebf3c 11503else
5df4cba6
SM
11504 gl_cv_have_weak=no
11505 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11506/* end confdefs.h. */
11507extern void xyzzy ();
11508#pragma weak xyzzy
11509int
11510main ()
11511{
11512xyzzy();
11513 ;
11514 return 0;
11515}
11516_ACEOF
11517if ac_fn_c_try_link "$LINENO"; then :
11518 gl_cv_have_weak=maybe
5abebf3c 11519fi
5df4cba6
SM
11520rm -f core conftest.err conftest.$ac_objext \
11521 conftest$ac_exeext conftest.$ac_ext
11522 if test $gl_cv_have_weak = maybe; then
11523 if test "$cross_compiling" = yes; then :
11524 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11525/* end confdefs.h. */
11526#ifdef __ELF__
11527 Extensible Linking Format
11528 #endif
c0c3707f 11529
5df4cba6
SM
11530_ACEOF
11531if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11532 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
11533 gl_cv_have_weak="guessing yes"
11534else
11535 gl_cv_have_weak="guessing no"
11536fi
11537rm -f conftest*
5abebf3c
CB
11538
11539
5df4cba6
SM
11540else
11541 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11542/* end confdefs.h. */
5abebf3c 11543
5df4cba6
SM
11544#include <stdio.h>
11545#pragma weak fputs
11546int main ()
11547{
11548 return (fputs == NULL);
11549}
c0c3707f 11550_ACEOF
5df4cba6
SM
11551if ac_fn_c_try_run "$LINENO"; then :
11552 gl_cv_have_weak=yes
11553else
11554 gl_cv_have_weak=no
11555fi
11556rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11557 conftest.$ac_objext conftest.beam conftest.$ac_ext
11558fi
11559
11560 fi
11561 case " $LDFLAGS " in
11562 *" -static "*) gl_cv_have_weak=no ;;
11563 esac
11564 case "$gl_cv_have_weak" in
11565 *yes)
11566 case "$host_os" in
11567 freebsd* | dragonfly*)
11568 : > conftest1.c
11569 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
11570 cat <<EOF > conftest2.c
11571#include <pthread.h>
11572#pragma weak pthread_mutexattr_gettype
11573int main ()
11574{
11575 return (pthread_mutexattr_gettype != NULL);
11576}
11577EOF
11578 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
11579 || gl_cv_have_weak=no
11580 rm -f conftest1.c libempty.so conftest2.c conftest
11581 ;;
11582 esac
11583 ;;
11584 esac
5abebf3c 11585
c0c3707f 11586fi
5df4cba6
SM
11587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
11588$as_echo "$gl_cv_have_weak" >&6; }
11589 case "$gl_cv_have_weak" in
11590 *yes)
5abebf3c 11591
5df4cba6 11592$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
5abebf3c 11593
5df4cba6
SM
11594 ;;
11595 esac
11596
11597 case "$gl_cv_have_weak" in
11598 *yes) LIB_SETLOCALE_NULL= ;;
11599 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
11600 esac
11601 ;;
11602 esac
5abebf3c 11603 else
5df4cba6 11604 LIB_SETLOCALE_NULL=
5abebf3c 11605 fi
5abebf3c
CB
11606
11607
11608
5abebf3c 11609
5abebf3c 11610
5df4cba6
SM
11611 GNULIB_SOCKET=0;
11612 GNULIB_CONNECT=0;
11613 GNULIB_ACCEPT=0;
11614 GNULIB_BIND=0;
11615 GNULIB_GETPEERNAME=0;
11616 GNULIB_GETSOCKNAME=0;
11617 GNULIB_GETSOCKOPT=0;
11618 GNULIB_LISTEN=0;
11619 GNULIB_RECV=0;
11620 GNULIB_SEND=0;
11621 GNULIB_RECVFROM=0;
11622 GNULIB_SENDTO=0;
11623 GNULIB_SETSOCKOPT=0;
11624 GNULIB_SHUTDOWN=0;
11625 GNULIB_ACCEPT4=0;
11626 HAVE_STRUCT_SOCKADDR_STORAGE=1;
11627 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
11628
11629 HAVE_SA_FAMILY_T=1;
11630 HAVE_ACCEPT4=1;
c0c3707f
CB
11631
11632
11633
11634
11635
5df4cba6
SM
11636 case "$host_os" in
11637 osf*)
c0c3707f 11638
5df4cba6 11639$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
c0c3707f 11640
5df4cba6
SM
11641 ;;
11642 esac
c0c3707f 11643
5df4cba6
SM
11644 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
11645$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
11646if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
5abebf3c
CB
11647 $as_echo_n "(cached) " >&6
11648else
5df4cba6
SM
11649
11650 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11651/* end confdefs.h. */
c0c3707f 11652#include <sys/socket.h>
c0c3707f
CB
11653int
11654main ()
11655{
5df4cba6 11656
c0c3707f
CB
11657 ;
11658 return 0;
11659}
11660_ACEOF
11661if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11662 gl_cv_header_sys_socket_h_selfcontained=yes
5abebf3c 11663else
5df4cba6 11664 gl_cv_header_sys_socket_h_selfcontained=no
5abebf3c 11665fi
c0c3707f 11666rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11667
5df4cba6
SM
11668fi
11669{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
11670$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
11671 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
11672 for ac_func in shutdown
11673do :
11674 ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
11675if test "x$ac_cv_func_shutdown" = xyes; then :
11676 cat >>confdefs.h <<_ACEOF
11677#define HAVE_SHUTDOWN 1
11678_ACEOF
c0c3707f 11679
5df4cba6
SM
11680fi
11681done
c0c3707f 11682
5df4cba6
SM
11683 if test $ac_cv_func_shutdown = yes; then
11684 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
11685$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
11686if ${gl_cv_header_sys_socket_h_shut+:} false; then :
5abebf3c
CB
11687 $as_echo_n "(cached) " >&6
11688else
5df4cba6
SM
11689
11690 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11691/* end confdefs.h. */
c0c3707f 11692#include <sys/socket.h>
c0c3707f
CB
11693int
11694main ()
11695{
5df4cba6 11696int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
c0c3707f
CB
11697 ;
11698 return 0;
11699}
11700_ACEOF
11701if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11702 gl_cv_header_sys_socket_h_shut=yes
c0c3707f 11703else
5df4cba6 11704 gl_cv_header_sys_socket_h_shut=no
c0c3707f
CB
11705fi
11706rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11707
5df4cba6
SM
11708fi
11709{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
11710$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
11711 if test $gl_cv_header_sys_socket_h_shut = no; then
11712 SYS_SOCKET_H='sys/socket.h'
11713 fi
11714 fi
c0c3707f 11715 fi
5df4cba6 11716 # We need to check for ws2tcpip.h now.
5abebf3c 11717
5abebf3c 11718
5abebf3c 11719
5abebf3c
CB
11720
11721
11722
11723
c0c3707f
CB
11724
11725
11726
11727
11728 if test $gl_cv_have_include_next = yes; then
5df4cba6 11729 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11730 else
5df4cba6
SM
11731 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
11732$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
11733if ${gl_cv_next_sys_socket_h+:} false; then :
5abebf3c
CB
11734 $as_echo_n "(cached) " >&6
11735else
5abebf3c 11736
5df4cba6 11737 if test $ac_cv_header_sys_socket_h = yes; then
5abebf3c 11738
5abebf3c
CB
11739
11740
c0c3707f
CB
11741
11742 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11743/* end confdefs.h. */
5df4cba6 11744#include <sys/socket.h>
c0c3707f
CB
11745_ACEOF
11746 case "$host_os" in
11747 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11748 *) gl_absname_cpp="$ac_cpp" ;;
11749 esac
11750
11751 case "$host_os" in
11752 mingw*)
11753 gl_dirsep_regex='[/\\]'
5abebf3c
CB
11754 ;;
11755 *)
c0c3707f 11756 gl_dirsep_regex='\/'
5abebf3c
CB
11757 ;;
11758 esac
c0c3707f 11759 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
5df4cba6 11760 gl_header_literal_regex=`echo 'sys/socket.h' \
c0c3707f
CB
11761 | sed -e "$gl_make_literal_regex_sed"`
11762 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11763 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11764 s|^/[^/]|//&|
11765 p
11766 q
11767 }'
5abebf3c 11768
5df4cba6 11769 gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
c0c3707f 11770 sed -n "$gl_absolute_header_sed"`
5abebf3c 11771
5df4cba6
SM
11772 gl_header=$gl_cv_absolute_sys_socket_h
11773 gl_cv_next_sys_socket_h='"'$gl_header'"'
c0c3707f 11774 else
5df4cba6 11775 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11776 fi
5abebf3c 11777
5abebf3c 11778
5abebf3c 11779fi
5df4cba6
SM
11780{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
11781$as_echo "$gl_cv_next_sys_socket_h" >&6; }
c0c3707f 11782 fi
5df4cba6 11783 NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
c0c3707f
CB
11784
11785 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11786 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
5df4cba6 11787 gl_next_as_first_directive='<'sys/socket.h'>'
c0c3707f
CB
11788 else
11789 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
5df4cba6 11790 gl_next_as_first_directive=$gl_cv_next_sys_socket_h
c0c3707f 11791 fi
5df4cba6 11792 NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
5abebf3c
CB
11793
11794
c0c3707f
CB
11795
11796
5df4cba6
SM
11797 if test $ac_cv_header_sys_socket_h = yes; then
11798 HAVE_SYS_SOCKET_H=1
11799 else
11800 HAVE_SYS_SOCKET_H=0
11801 fi
c0c3707f 11802
5abebf3c 11803
c0c3707f 11804
5df4cba6
SM
11805 if test $ac_cv_header_sys_socket_h = yes; then
11806 HAVE_WS2TCPIP_H=0
11807 else
11808 if test $ac_cv_header_ws2tcpip_h = yes; then
11809 HAVE_WS2TCPIP_H=1
11810 else
11811 HAVE_WS2TCPIP_H=0
11812 fi
11813 fi
11814
11815
11816
11817 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
11818 /* sys/types.h is not needed according to POSIX, but the
11819 sys/socket.h in i386-unknown-freebsd4.10 and
11820 powerpc-apple-darwin5.5 required it. */
11821#include <sys/types.h>
11822#ifdef HAVE_SYS_SOCKET_H
11823#include <sys/socket.h>
11824#endif
11825#ifdef HAVE_WS2TCPIP_H
11826#include <ws2tcpip.h>
11827#endif
11828
11829"
11830if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
11831
11832cat >>confdefs.h <<_ACEOF
11833#define HAVE_STRUCT_SOCKADDR_STORAGE 1
5abebf3c 11834_ACEOF
5df4cba6
SM
11835
11836
5abebf3c 11837fi
5df4cba6
SM
11838ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
11839 /* sys/types.h is not needed according to POSIX, but the
11840 sys/socket.h in i386-unknown-freebsd4.10 and
11841 powerpc-apple-darwin5.5 required it. */
11842#include <sys/types.h>
11843#ifdef HAVE_SYS_SOCKET_H
11844#include <sys/socket.h>
11845#endif
11846#ifdef HAVE_WS2TCPIP_H
11847#include <ws2tcpip.h>
11848#endif
11849
11850"
11851if test "x$ac_cv_type_sa_family_t" = xyes; then :
11852
11853cat >>confdefs.h <<_ACEOF
11854#define HAVE_SA_FAMILY_T 1
11855_ACEOF
11856
11857
5abebf3c 11858fi
5df4cba6
SM
11859
11860 if test $ac_cv_type_struct_sockaddr_storage = no; then
11861 HAVE_STRUCT_SOCKADDR_STORAGE=0
11862 fi
11863 if test $ac_cv_type_sa_family_t = no; then
11864 HAVE_SA_FAMILY_T=0
c0c3707f 11865 fi
5df4cba6
SM
11866 if test $ac_cv_type_struct_sockaddr_storage != no; then
11867 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
11868 #ifdef HAVE_SYS_SOCKET_H
11869 #include <sys/socket.h>
11870 #endif
11871 #ifdef HAVE_WS2TCPIP_H
11872 #include <ws2tcpip.h>
11873 #endif
11874
11875"
11876if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
11877
11878cat >>confdefs.h <<_ACEOF
11879#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
11880_ACEOF
11881
5abebf3c 11882
5abebf3c 11883else
5df4cba6 11884 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
5abebf3c
CB
11885fi
11886
5df4cba6
SM
11887 fi
11888 if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
11889 || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
11890 SYS_SOCKET_H='sys/socket.h'
11891 fi
5abebf3c 11892
5abebf3c 11893
5df4cba6
SM
11894
11895
11896 if test $ac_cv_header_sys_socket_h != yes; then
11897 for ac_header in winsock2.h
11898do :
11899 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
11900if test "x$ac_cv_header_winsock2_h" = xyes; then :
11901 cat >>confdefs.h <<_ACEOF
11902#define HAVE_WINSOCK2_H 1
11903_ACEOF
11904
11905fi
11906
11907done
11908
11909 fi
11910 if test "$ac_cv_header_winsock2_h" = yes; then
11911 HAVE_WINSOCK2_H=1
11912 UNISTD_H_HAVE_WINSOCK2_H=1
11913 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
11914 else
11915 HAVE_WINSOCK2_H=0
11916 fi
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
698be2d8
CB
11930
11931
5df4cba6
SM
11932 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
11933$as_echo_n "checking for IPv4 sockets... " >&6; }
11934if ${gl_cv_socket_ipv4+:} false; then :
5abebf3c
CB
11935 $as_echo_n "(cached) " >&6
11936else
c0c3707f 11937 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11938/* end confdefs.h. */
5df4cba6
SM
11939#include <sys/types.h>
11940#ifdef HAVE_SYS_SOCKET_H
11941#include <sys/socket.h>
11942#endif
11943#ifdef HAVE_NETINET_IN_H
11944#include <netinet/in.h>
11945#endif
11946#ifdef HAVE_WINSOCK2_H
11947#include <winsock2.h>
11948#endif
5abebf3c
CB
11949int
11950main ()
11951{
5df4cba6
SM
11952int x = AF_INET; struct in_addr y; struct sockaddr_in z;
11953 if (&x && &y && &z) return 0;
5abebf3c
CB
11954 ;
11955 return 0;
11956}
11957_ACEOF
c0c3707f 11958if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11959 gl_cv_socket_ipv4=yes
5abebf3c 11960else
5df4cba6 11961 gl_cv_socket_ipv4=no
5abebf3c 11962fi
c0c3707f 11963rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11964fi
5df4cba6
SM
11965{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
11966$as_echo "$gl_cv_socket_ipv4" >&6; }
11967 if test $gl_cv_socket_ipv4 = yes; then
5abebf3c 11968
5df4cba6 11969$as_echo "#define HAVE_IPV4 1" >>confdefs.h
5abebf3c 11970
5df4cba6 11971 fi
5abebf3c 11972
5df4cba6
SM
11973 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
11974$as_echo_n "checking for IPv6 sockets... " >&6; }
11975if ${gl_cv_socket_ipv6+:} false; then :
5abebf3c
CB
11976 $as_echo_n "(cached) " >&6
11977else
c0c3707f 11978 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11979/* end confdefs.h. */
5df4cba6
SM
11980#include <sys/types.h>
11981#ifdef HAVE_SYS_SOCKET_H
11982#include <sys/socket.h>
5abebf3c 11983#endif
5df4cba6
SM
11984#ifdef HAVE_NETINET_IN_H
11985#include <netinet/in.h>
11986#endif
11987#ifdef HAVE_WINSOCK2_H
11988#include <winsock2.h>
11989#endif
11990#ifdef HAVE_WS2TCPIP_H
11991#include <ws2tcpip.h>
11992#endif
11993int
11994main ()
11995{
11996int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
11997 if (&x && &y && &z) return 0;
11998 ;
11999 return 0;
12000}
12001_ACEOF
12002if ac_fn_c_try_compile "$LINENO"; then :
12003 gl_cv_socket_ipv6=yes
12004else
12005 gl_cv_socket_ipv6=no
12006fi
12007rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12008fi
12009{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
12010$as_echo "$gl_cv_socket_ipv6" >&6; }
12011 if test $gl_cv_socket_ipv6 = yes; then
12012
12013$as_echo "#define HAVE_IPV6 1" >>confdefs.h
12014
12015 fi
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029 if test $gl_cv_have_include_next = yes; then
12030 gl_cv_next_limits_h='<'limits.h'>'
12031 else
12032 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
12033$as_echo_n "checking absolute name of <limits.h>... " >&6; }
12034if ${gl_cv_next_limits_h+:} false; then :
12035 $as_echo_n "(cached) " >&6
12036else
12037
12038 if test $ac_cv_header_limits_h = yes; then
12039
12040
12041
12042
12043 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12044/* end confdefs.h. */
12045#include <limits.h>
12046_ACEOF
12047 case "$host_os" in
12048 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12049 *) gl_absname_cpp="$ac_cpp" ;;
12050 esac
12051
12052 case "$host_os" in
12053 mingw*)
12054 gl_dirsep_regex='[/\\]'
12055 ;;
12056 *)
12057 gl_dirsep_regex='\/'
12058 ;;
12059 esac
12060 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12061 gl_header_literal_regex=`echo 'limits.h' \
12062 | sed -e "$gl_make_literal_regex_sed"`
12063 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12064 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12065 s|^/[^/]|//&|
12066 p
12067 q
12068 }'
12069
12070 gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12071 sed -n "$gl_absolute_header_sed"`
12072
12073 gl_header=$gl_cv_absolute_limits_h
12074 gl_cv_next_limits_h='"'$gl_header'"'
12075 else
12076 gl_cv_next_limits_h='<'limits.h'>'
12077 fi
12078
12079
12080fi
12081{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
12082$as_echo "$gl_cv_next_limits_h" >&6; }
12083 fi
12084 NEXT_LIMITS_H=$gl_cv_next_limits_h
12085
12086 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12087 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12088 gl_next_as_first_directive='<'limits.h'>'
12089 else
12090 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12091 gl_next_as_first_directive=$gl_cv_next_limits_h
12092 fi
12093 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
12094
12095
12096
12097
12098
12099 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
12100$as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
12101if ${gl_cv_header_limits_width+:} false; then :
12102 $as_echo_n "(cached) " >&6
12103else
12104 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12105/* end confdefs.h. */
12106#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
12107 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
12108 #endif
12109 #include <limits.h>
12110 long long llm = LLONG_MAX;
12111 int wb = WORD_BIT;
12112 int ullw = ULLONG_WIDTH;
c0c3707f 12113
5abebf3c
CB
12114int
12115main ()
12116{
c0c3707f 12117
5abebf3c
CB
12118 ;
12119 return 0;
12120}
12121_ACEOF
c0c3707f 12122if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 12123 gl_cv_header_limits_width=yes
5abebf3c 12124else
5df4cba6 12125 gl_cv_header_limits_width=no
5abebf3c 12126fi
c0c3707f 12127rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 12128fi
5df4cba6
SM
12129{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
12130$as_echo "$gl_cv_header_limits_width" >&6; }
12131 if test "$gl_cv_header_limits_width" = yes; then
12132 LIMITS_H=
c0c3707f 12133 else
5df4cba6 12134 LIMITS_H=limits.h
c0c3707f 12135 fi
5abebf3c 12136
5df4cba6
SM
12137 if test -n "$LIMITS_H"; then
12138 GL_GENERATE_LIMITS_H_TRUE=
12139 GL_GENERATE_LIMITS_H_FALSE='#'
12140else
12141 GL_GENERATE_LIMITS_H_TRUE='#'
12142 GL_GENERATE_LIMITS_H_FALSE=
12143fi
c0c3707f
CB
12144
12145
5abebf3c 12146
5df4cba6
SM
12147 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
12148$as_echo_n "checking for wint_t... " >&6; }
12149if ${gt_cv_c_wint_t+:} false; then :
c0c3707f 12150 $as_echo_n "(cached) " >&6
c0c3707f
CB
12151else
12152 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 12153/* end confdefs.h. */
5df4cba6
SM
12154#include <wchar.h>
12155 wint_t foo = (wchar_t)'\0';
5abebf3c
CB
12156int
12157main ()
12158{
5df4cba6 12159
5abebf3c
CB
12160 ;
12161 return 0;
12162}
12163_ACEOF
5df4cba6
SM
12164if ac_fn_c_try_compile "$LINENO"; then :
12165 gt_cv_c_wint_t=yes
c0c3707f 12166else
5df4cba6 12167 gt_cv_c_wint_t=no
c0c3707f 12168fi
5df4cba6 12169rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 12170fi
5df4cba6
SM
12171{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
12172$as_echo "$gt_cv_c_wint_t" >&6; }
12173 if test $gt_cv_c_wint_t = yes; then
5abebf3c 12174
5df4cba6 12175$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
5abebf3c
CB
12176
12177
9c9d63b1
PM
12178 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is large enough" >&5
12179$as_echo_n "checking whether wint_t is large enough... " >&6; }
12180if ${gl_cv_type_wint_t_large_enough+:} false; then :
5df4cba6
SM
12181 $as_echo_n "(cached) " >&6
12182else
12183 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12184/* end confdefs.h. */
5df4cba6 12185#include <wchar.h>
9c9d63b1 12186 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
5df4cba6
SM
12187
12188int
12189main ()
12190{
12191
12192 ;
12193 return 0;
12194}
12195_ACEOF
12196if ac_fn_c_try_compile "$LINENO"; then :
9c9d63b1 12197 gl_cv_type_wint_t_large_enough=yes
5df4cba6 12198else
9c9d63b1 12199 gl_cv_type_wint_t_large_enough=no
5df4cba6
SM
12200fi
12201rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12202fi
9c9d63b1
PM
12203{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_large_enough" >&5
12204$as_echo "$gl_cv_type_wint_t_large_enough" >&6; }
12205 if test $gl_cv_type_wint_t_large_enough = no; then
5df4cba6
SM
12206 GNULIB_OVERRIDES_WINT_T=1
12207 else
12208 GNULIB_OVERRIDES_WINT_T=0
12209 fi
12210 else
12211 GNULIB_OVERRIDES_WINT_T=0
c0c3707f 12212 fi
5abebf3c 12213
5abebf3c
CB
12214
12215
12216
12217
12218
5df4cba6 12219
9c9d63b1
PM
12220
12221
12222 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler produces multi-arch binaries" >&5
12223$as_echo_n "checking whether the compiler produces multi-arch binaries... " >&6; }
12224if ${gl_cv_c_multiarch+:} false; then :
12225 $as_echo_n "(cached) " >&6
12226else
12227 gl_cv_c_multiarch=no
12228 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f
CB
12229/* end confdefs.h. */
12230#ifndef __APPLE_CC__
9c9d63b1
PM
12231 not a universal capable compiler
12232 #endif
12233 typedef int dummy;
5abebf3c 12234
c0c3707f
CB
12235_ACEOF
12236if ac_fn_c_try_compile "$LINENO"; then :
5abebf3c 12237
9c9d63b1
PM
12238 arch=
12239 prev=
12240 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
12241 if test -n "$prev"; then
12242 case $word in
12243 i?86 | x86_64 | ppc | ppc64 | arm | arm64)
12244 if test -z "$arch" || test "$arch" = "$word"; then
12245 arch="$word"
12246 else
12247 gl_cv_c_multiarch=yes
12248 fi
12249 ;;
12250 esac
12251 prev=
12252 else
12253 if test "x$word" = "x-arch"; then
12254 prev=arch
12255 fi
12256 fi
12257 done
5abebf3c 12258
c0c3707f
CB
12259fi
12260rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1
PM
12261
12262fi
12263{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_multiarch" >&5
12264$as_echo "$gl_cv_c_multiarch" >&6; }
c0c3707f
CB
12265 if test $gl_cv_c_multiarch = yes; then
12266 APPLE_UNIVERSAL_BUILD=1
12267 else
12268 APPLE_UNIVERSAL_BUILD=0
12269 fi
5abebf3c 12270
5abebf3c 12271
5abebf3c 12272
5abebf3c
CB
12273
12274
5abebf3c 12275
5abebf3c 12276
5abebf3c 12277
5df4cba6 12278$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 12279
5abebf3c 12280
5df4cba6 12281$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 12282
c0c3707f
CB
12283
12284
12285 if test $ac_cv_header_wchar_h = yes; then
12286 HAVE_WCHAR_H=1
12287 else
12288 HAVE_WCHAR_H=0
5abebf3c 12289 fi
c0c3707f
CB
12290
12291
9c9d63b1
PM
12292
12293 if test $ac_cv_header_inttypes_h = yes; then
c0c3707f
CB
12294 HAVE_INTTYPES_H=1
12295 else
12296 HAVE_INTTYPES_H=0
5abebf3c
CB
12297 fi
12298
12299
9c9d63b1
PM
12300
12301 if test $ac_cv_header_sys_types_h = yes; then
c0c3707f
CB
12302 HAVE_SYS_TYPES_H=1
12303 else
12304 HAVE_SYS_TYPES_H=0
12305 fi
12306
5abebf3c
CB
12307
12308
12309
12310
5abebf3c 12311
5abebf3c 12312
5abebf3c 12313
5abebf3c 12314
5abebf3c
CB
12315
12316
c0c3707f
CB
12317 if test $gl_cv_have_include_next = yes; then
12318 gl_cv_next_stdint_h='<'stdint.h'>'
12319 else
12320 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
12321$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
12322if ${gl_cv_next_stdint_h+:} false; then :
12323 $as_echo_n "(cached) " >&6
12324else
5abebf3c 12325
c0c3707f 12326 if test $ac_cv_header_stdint_h = yes; then
5abebf3c 12327
5abebf3c
CB
12328
12329
12330
c0c3707f 12331 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 12332/* end confdefs.h. */
c0c3707f 12333#include <stdint.h>
5abebf3c 12334_ACEOF
c0c3707f
CB
12335 case "$host_os" in
12336 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12337 *) gl_absname_cpp="$ac_cpp" ;;
12338 esac
5abebf3c 12339
c0c3707f
CB
12340 case "$host_os" in
12341 mingw*)
12342 gl_dirsep_regex='[/\\]'
12343 ;;
12344 *)
12345 gl_dirsep_regex='\/'
12346 ;;
12347 esac
12348 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12349 gl_header_literal_regex=`echo 'stdint.h' \
12350 | sed -e "$gl_make_literal_regex_sed"`
12351 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12352 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12353 s|^/[^/]|//&|
12354 p
12355 q
12356 }'
5abebf3c 12357
c0c3707f
CB
12358 gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12359 sed -n "$gl_absolute_header_sed"`
5abebf3c 12360
c0c3707f
CB
12361 gl_header=$gl_cv_absolute_stdint_h
12362 gl_cv_next_stdint_h='"'$gl_header'"'
12363 else
12364 gl_cv_next_stdint_h='<'stdint.h'>'
12365 fi
5abebf3c 12366
5abebf3c 12367
c0c3707f
CB
12368fi
12369{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
12370$as_echo "$gl_cv_next_stdint_h" >&6; }
12371 fi
12372 NEXT_STDINT_H=$gl_cv_next_stdint_h
5abebf3c 12373
c0c3707f
CB
12374 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12375 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12376 gl_next_as_first_directive='<'stdint.h'>'
12377 else
12378 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12379 gl_next_as_first_directive=$gl_cv_next_stdint_h
12380 fi
12381 NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
5abebf3c 12382
5e8754f9 12383
5e8754f9 12384
5e8754f9 12385
c0c3707f
CB
12386 if test $ac_cv_header_stdint_h = yes; then
12387 HAVE_STDINT_H=1
12388 else
12389 HAVE_STDINT_H=0
12390 fi
5e8754f9
SDJ
12391
12392
c0c3707f
CB
12393 if test $ac_cv_header_stdint_h = yes; then
12394 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
12395$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
12396if ${gl_cv_header_working_stdint_h+:} false; then :
12397 $as_echo_n "(cached) " >&6
12398else
12399 gl_cv_header_working_stdint_h=no
12400 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12401/* end confdefs.h. */
5e8754f9 12402
5e8754f9 12403
c0c3707f
CB
12404#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12405#define __STDC_CONSTANT_MACROS 1
12406#define __STDC_LIMIT_MACROS 1
12407#include <stdint.h>
12408/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
12409#if !(defined WCHAR_MIN && defined WCHAR_MAX)
12410#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
12411#endif
5e8754f9
SDJ
12412
12413
c0c3707f
CB
12414 #include <stddef.h>
12415 #include <signal.h>
12416 #if HAVE_WCHAR_H
c0c3707f
CB
12417 # include <wchar.h>
12418 #endif
f45c62c4
YQ
12419
12420
c0c3707f
CB
12421#ifdef INT8_MAX
12422int8_t a1 = INT8_MAX;
12423int8_t a1min = INT8_MIN;
12424#endif
12425#ifdef INT16_MAX
12426int16_t a2 = INT16_MAX;
12427int16_t a2min = INT16_MIN;
12428#endif
12429#ifdef INT32_MAX
12430int32_t a3 = INT32_MAX;
12431int32_t a3min = INT32_MIN;
12432#endif
12433#ifdef INT64_MAX
12434int64_t a4 = INT64_MAX;
12435int64_t a4min = INT64_MIN;
12436#endif
12437#ifdef UINT8_MAX
12438uint8_t b1 = UINT8_MAX;
12439#else
12440typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
12441#endif
12442#ifdef UINT16_MAX
12443uint16_t b2 = UINT16_MAX;
12444#endif
12445#ifdef UINT32_MAX
12446uint32_t b3 = UINT32_MAX;
12447#endif
12448#ifdef UINT64_MAX
12449uint64_t b4 = UINT64_MAX;
12450#endif
12451int_least8_t c1 = INT8_C (0x7f);
12452int_least8_t c1max = INT_LEAST8_MAX;
12453int_least8_t c1min = INT_LEAST8_MIN;
12454int_least16_t c2 = INT16_C (0x7fff);
12455int_least16_t c2max = INT_LEAST16_MAX;
12456int_least16_t c2min = INT_LEAST16_MIN;
12457int_least32_t c3 = INT32_C (0x7fffffff);
12458int_least32_t c3max = INT_LEAST32_MAX;
12459int_least32_t c3min = INT_LEAST32_MIN;
12460int_least64_t c4 = INT64_C (0x7fffffffffffffff);
12461int_least64_t c4max = INT_LEAST64_MAX;
12462int_least64_t c4min = INT_LEAST64_MIN;
12463uint_least8_t d1 = UINT8_C (0xff);
12464uint_least8_t d1max = UINT_LEAST8_MAX;
12465uint_least16_t d2 = UINT16_C (0xffff);
12466uint_least16_t d2max = UINT_LEAST16_MAX;
12467uint_least32_t d3 = UINT32_C (0xffffffff);
12468uint_least32_t d3max = UINT_LEAST32_MAX;
12469uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
12470uint_least64_t d4max = UINT_LEAST64_MAX;
12471int_fast8_t e1 = INT_FAST8_MAX;
12472int_fast8_t e1min = INT_FAST8_MIN;
12473int_fast16_t e2 = INT_FAST16_MAX;
12474int_fast16_t e2min = INT_FAST16_MIN;
12475int_fast32_t e3 = INT_FAST32_MAX;
12476int_fast32_t e3min = INT_FAST32_MIN;
12477int_fast64_t e4 = INT_FAST64_MAX;
12478int_fast64_t e4min = INT_FAST64_MIN;
12479uint_fast8_t f1 = UINT_FAST8_MAX;
12480uint_fast16_t f2 = UINT_FAST16_MAX;
12481uint_fast32_t f3 = UINT_FAST32_MAX;
12482uint_fast64_t f4 = UINT_FAST64_MAX;
12483#ifdef INTPTR_MAX
12484intptr_t g = INTPTR_MAX;
12485intptr_t gmin = INTPTR_MIN;
12486#endif
12487#ifdef UINTPTR_MAX
12488uintptr_t h = UINTPTR_MAX;
12489#endif
12490intmax_t i = INTMAX_MAX;
12491uintmax_t j = UINTMAX_MAX;
472fa5ee 12492
c0c3707f
CB
12493/* Check that SIZE_MAX has the correct type, if possible. */
12494#if 201112 <= __STDC_VERSION__
12495int k = _Generic (SIZE_MAX, size_t: 0);
9c9d63b1 12496#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
c0c3707f
CB
12497 || (0x5110 <= __SUNPRO_C && !__STDC__))
12498extern size_t k;
12499extern __typeof__ (SIZE_MAX) k;
12500#endif
472fa5ee 12501
c0c3707f
CB
12502#include <limits.h> /* for CHAR_BIT */
12503#define TYPE_MINIMUM(t) \
12504 ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
12505#define TYPE_MAXIMUM(t) \
12506 ((t) ((t) 0 < (t) -1 \
12507 ? (t) -1 \
12508 : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
12509struct s {
12510 int check_PTRDIFF:
12511 PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
12512 && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
12513 ? 1 : -1;
12514 /* Detect bug in FreeBSD 6.0 / ia64. */
12515 int check_SIG_ATOMIC:
12516 SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
12517 && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
12518 ? 1 : -1;
12519 int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
12520 int check_WCHAR:
12521 WCHAR_MIN == TYPE_MINIMUM (wchar_t)
12522 && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
12523 ? 1 : -1;
12524 /* Detect bug in mingw. */
12525 int check_WINT:
12526 WINT_MIN == TYPE_MINIMUM (wint_t)
12527 && WINT_MAX == TYPE_MAXIMUM (wint_t)
12528 ? 1 : -1;
472fa5ee 12529
c0c3707f
CB
12530 /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
12531 int check_UINT8_C:
12532 (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
12533 int check_UINT16_C:
12534 (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
f45c62c4 12535
c0c3707f
CB
12536 /* Detect bugs in OpenBSD 3.9 stdint.h. */
12537#ifdef UINT8_MAX
12538 int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
12539#endif
12540#ifdef UINT16_MAX
12541 int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
12542#endif
12543#ifdef UINT32_MAX
12544 int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
12545#endif
12546#ifdef UINT64_MAX
12547 int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
12548#endif
12549 int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
12550 int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
12551 int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
12552 int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
12553 int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
12554 int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
12555 int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
12556 int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
12557 int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
12558 int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
12559 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
12560};
6ec2e0f5 12561
f45c62c4
YQ
12562int
12563main ()
12564{
f45c62c4
YQ
12565
12566 ;
12567 return 0;
12568}
12569_ACEOF
6ec2e0f5 12570if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 12571 if test "$cross_compiling" = yes; then :
6a29c58e 12572 case "$host_os" in
c0c3707f
CB
12573 # Guess yes on native Windows.
12574 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
12575 # In general, assume it works.
12576 *) gl_cv_header_working_stdint_h="guessing yes" ;;
12577 esac
6a29c58e 12578
98399780
YQ
12579else
12580 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12581/* end confdefs.h. */
98399780
YQ
12582
12583
c0c3707f
CB
12584#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12585#define __STDC_CONSTANT_MACROS 1
12586#define __STDC_LIMIT_MACROS 1
12587#include <stdint.h>
98399780 12588
88b48903 12589
c0c3707f
CB
12590 #include <stddef.h>
12591 #include <signal.h>
12592 #if HAVE_WCHAR_H
c0c3707f
CB
12593 # include <wchar.h>
12594 #endif
88b48903 12595
472fa5ee 12596
c0c3707f
CB
12597#include <stdio.h>
12598#include <string.h>
12599#define MVAL(macro) MVAL1(macro)
12600#define MVAL1(expression) #expression
12601static const char *macro_values[] =
12602 {
12603#ifdef INT8_MAX
12604 MVAL (INT8_MAX),
12605#endif
12606#ifdef INT16_MAX
12607 MVAL (INT16_MAX),
12608#endif
12609#ifdef INT32_MAX
12610 MVAL (INT32_MAX),
12611#endif
12612#ifdef INT64_MAX
12613 MVAL (INT64_MAX),
12614#endif
12615#ifdef UINT8_MAX
12616 MVAL (UINT8_MAX),
12617#endif
12618#ifdef UINT16_MAX
12619 MVAL (UINT16_MAX),
12620#endif
12621#ifdef UINT32_MAX
12622 MVAL (UINT32_MAX),
12623#endif
12624#ifdef UINT64_MAX
12625 MVAL (UINT64_MAX),
12626#endif
12627 NULL
12628 };
472fa5ee 12629
c0c3707f
CB
12630int
12631main ()
12632{
472fa5ee 12633
c0c3707f
CB
12634 const char **mv;
12635 for (mv = macro_values; *mv != NULL; mv++)
12636 {
12637 const char *value = *mv;
12638 /* Test whether it looks like a cast expression. */
12639 if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
12640 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
12641 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
12642 || strncmp (value, "((int)"/*)*/, 6) == 0
12643 || strncmp (value, "((signed short)"/*)*/, 15) == 0
12644 || strncmp (value, "((signed char)"/*)*/, 14) == 0)
12645 return mv - macro_values + 1;
12646 }
12647 return 0;
12648
12649 ;
12650 return 0;
12651}
12652_ACEOF
12653if ac_fn_c_try_run "$LINENO"; then :
12654 gl_cv_header_working_stdint_h=yes
12655fi
12656rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12657 conftest.$ac_objext conftest.beam conftest.$ac_ext
12658fi
12659
12660
12661fi
12662rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 12663
c0c3707f
CB
12664fi
12665{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
12666$as_echo "$gl_cv_header_working_stdint_h" >&6; }
12667 fi
8690e634 12668
c0c3707f
CB
12669 HAVE_C99_STDINT_H=0
12670 HAVE_SYS_BITYPES_H=0
12671 HAVE_SYS_INTTYPES_H=0
12672 STDINT_H=stdint.h
12673 case "$gl_cv_header_working_stdint_h" in
12674 *yes)
12675 HAVE_C99_STDINT_H=1
9c9d63b1
PM
12676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h works without ISO C predefines" >&5
12677$as_echo_n "checking whether stdint.h works without ISO C predefines... " >&6; }
12678if ${gl_cv_header_stdint_without_STDC_macros+:} false; then :
c0c3707f
CB
12679 $as_echo_n "(cached) " >&6
12680else
9c9d63b1 12681 gl_cv_header_stdint_without_STDC_macros=no
c0c3707f
CB
12682 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12683/* end confdefs.h. */
8690e634
JK
12684
12685
c0c3707f
CB
12686#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12687#include <stdint.h>
8690e634
JK
12688
12689
c0c3707f
CB
12690 #include <stddef.h>
12691 #include <signal.h>
12692 #if HAVE_WCHAR_H
c0c3707f
CB
12693 # include <wchar.h>
12694 #endif
8690e634
JK
12695
12696
c0c3707f
CB
12697intmax_t im = INTMAX_MAX;
12698int32_t i32 = INT32_C (0x7fffffff);
472fa5ee 12699
c0c3707f
CB
12700int
12701main ()
12702{
472fa5ee 12703
c0c3707f
CB
12704 ;
12705 return 0;
12706}
12707_ACEOF
12708if ac_fn_c_try_compile "$LINENO"; then :
9c9d63b1 12709 gl_cv_header_stdint_without_STDC_macros=yes
c0c3707f
CB
12710fi
12711rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1 12712
c0c3707f 12713fi
9c9d63b1
PM
12714{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_without_STDC_macros" >&5
12715$as_echo "$gl_cv_header_stdint_without_STDC_macros" >&6; }
472fa5ee 12716
9c9d63b1 12717 if test $gl_cv_header_stdint_without_STDC_macros = no; then
472fa5ee 12718
c0c3707f 12719$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
472fa5ee
SM
12720
12721
c0c3707f
CB
12722$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
12723
12724 fi
12725 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
12726$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
12727if ${gl_cv_header_stdint_width+:} false; then :
8690e634
JK
12728 $as_echo_n "(cached) " >&6
12729else
c0c3707f
CB
12730 gl_cv_header_stdint_width=no
12731 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12732/* end confdefs.h. */
12733
c0c3707f
CB
12734 /* Work if build is not clean. */
12735 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
12736 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
12737 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
12738 #endif
12739 #include <stdint.h>
12740
c0c3707f
CB
12741 #include <stddef.h>
12742 #include <signal.h>
12743 #if HAVE_WCHAR_H
c0c3707f
CB
12744 # include <wchar.h>
12745 #endif
12746
12747 int iw = UINTMAX_WIDTH;
12748
12749int
12750main ()
8690e634 12751{
c0c3707f
CB
12752
12753 ;
8690e634
JK
12754 return 0;
12755}
8690e634 12756_ACEOF
c0c3707f
CB
12757if ac_fn_c_try_compile "$LINENO"; then :
12758 gl_cv_header_stdint_width=yes
12759fi
12760rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12761fi
12762{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
12763$as_echo "$gl_cv_header_stdint_width" >&6; }
12764 if test "$gl_cv_header_stdint_width" = yes; then
12765 STDINT_H=
12766 fi
12767 ;;
12768 *)
12769 for ac_header in sys/inttypes.h sys/bitypes.h
12770do :
12771 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12772ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
12773if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12774 cat >>confdefs.h <<_ACEOF
12775#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12776_ACEOF
12777
12778fi
12779
12780done
12781
12782 if test $ac_cv_header_sys_inttypes_h = yes; then
12783 HAVE_SYS_INTTYPES_H=1
12784 fi
12785 if test $ac_cv_header_sys_bitypes_h = yes; then
12786 HAVE_SYS_BITYPES_H=1
12787 fi
12788
12789
12790 if test $APPLE_UNIVERSAL_BUILD = 0; then
12791
12792
12793 for gltype in ptrdiff_t size_t ; do
12794 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12795$as_echo_n "checking for bit size of $gltype... " >&6; }
12796if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
12797 $as_echo_n "(cached) " >&6
12798else
12799 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
c0c3707f
CB
12800 #include <stddef.h>
12801 #include <signal.h>
12802 #if HAVE_WCHAR_H
c0c3707f
CB
12803 # include <wchar.h>
12804 #endif
12805
12806#include <limits.h>"; then :
12807
12808else
12809 result=unknown
12810fi
12811
12812 eval gl_cv_bitsizeof_${gltype}=\$result
12813
12814fi
12815eval ac_res=\$gl_cv_bitsizeof_${gltype}
12816 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12817$as_echo "$ac_res" >&6; }
12818 eval result=\$gl_cv_bitsizeof_${gltype}
12819 if test $result = unknown; then
12820 result=0
8690e634 12821 fi
c0c3707f
CB
12822 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12823 cat >>confdefs.h <<_ACEOF
12824#define BITSIZEOF_${GLTYPE} $result
12825_ACEOF
8690e634 12826
c0c3707f
CB
12827 eval BITSIZEOF_${GLTYPE}=\$result
12828 done
8690e634
JK
12829
12830
c0c3707f 12831 fi
8690e634
JK
12832
12833
c0c3707f
CB
12834 for gltype in sig_atomic_t wchar_t wint_t ; do
12835 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12836$as_echo_n "checking for bit size of $gltype... " >&6; }
12837if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
8690e634
JK
12838 $as_echo_n "(cached) " >&6
12839else
c0c3707f 12840 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
c0c3707f
CB
12841 #include <stddef.h>
12842 #include <signal.h>
12843 #if HAVE_WCHAR_H
c0c3707f
CB
12844 # include <wchar.h>
12845 #endif
8690e634 12846
c0c3707f 12847#include <limits.h>"; then :
8690e634 12848
c0c3707f
CB
12849else
12850 result=unknown
12851fi
8690e634 12852
c0c3707f 12853 eval gl_cv_bitsizeof_${gltype}=\$result
8690e634
JK
12854
12855fi
c0c3707f
CB
12856eval ac_res=\$gl_cv_bitsizeof_${gltype}
12857 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12858$as_echo "$ac_res" >&6; }
12859 eval result=\$gl_cv_bitsizeof_${gltype}
12860 if test $result = unknown; then
12861 result=0
12862 fi
12863 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12864 cat >>confdefs.h <<_ACEOF
12865#define BITSIZEOF_${GLTYPE} $result
12866_ACEOF
12867
12868 eval BITSIZEOF_${GLTYPE}=\$result
12869 done
8690e634
JK
12870
12871
12872
12873
c0c3707f
CB
12874 for gltype in sig_atomic_t wchar_t wint_t ; do
12875 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
12876$as_echo_n "checking whether $gltype is signed... " >&6; }
12877if eval \${gl_cv_type_${gltype}_signed+:} false; then :
8690e634
JK
12878 $as_echo_n "(cached) " >&6
12879else
c0c3707f 12880 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12881/* end confdefs.h. */
12882
c0c3707f
CB
12883 #include <stddef.h>
12884 #include <signal.h>
12885 #if HAVE_WCHAR_H
c0c3707f
CB
12886 # include <wchar.h>
12887 #endif
12888
12889 int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
12890int
12891main ()
12892{
12893
12894 ;
8690e634
JK
12895 return 0;
12896}
c0c3707f
CB
12897_ACEOF
12898if ac_fn_c_try_compile "$LINENO"; then :
12899 result=yes
12900else
12901 result=no
12902fi
12903rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12904 eval gl_cv_type_${gltype}_signed=\$result
8690e634 12905
c0c3707f
CB
12906fi
12907eval ac_res=\$gl_cv_type_${gltype}_signed
12908 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12909$as_echo "$ac_res" >&6; }
12910 eval result=\$gl_cv_type_${gltype}_signed
12911 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12912 if test "$result" = yes; then
12913 cat >>confdefs.h <<_ACEOF
12914#define HAVE_SIGNED_${GLTYPE} 1
8690e634 12915_ACEOF
c0c3707f
CB
12916
12917 eval HAVE_SIGNED_${GLTYPE}=1
12918 else
12919 eval HAVE_SIGNED_${GLTYPE}=0
8690e634 12920 fi
c0c3707f
CB
12921 done
12922
12923
12924 gl_cv_type_ptrdiff_t_signed=yes
12925 gl_cv_type_size_t_signed=no
12926 if test $APPLE_UNIVERSAL_BUILD = 0; then
12927
12928
12929 for gltype in ptrdiff_t size_t ; do
12930 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12931$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
12932if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
12933 $as_echo_n "(cached) " >&6
12934else
12935 eval gl_cv_type_${gltype}_suffix=no
12936 eval result=\$gl_cv_type_${gltype}_signed
12937 if test "$result" = yes; then
12938 glsufu=
12939 else
12940 glsufu=u
12941 fi
12942 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
12943 case $glsuf in
12944 '') gltype1='int';;
12945 l) gltype1='long int';;
12946 ll) gltype1='long long int';;
12947 i64) gltype1='__int64';;
12948 u) gltype1='unsigned int';;
12949 ul) gltype1='unsigned long int';;
12950 ull) gltype1='unsigned long long int';;
12951 ui64)gltype1='unsigned __int64';;
12952 esac
12953 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12954/* end confdefs.h. */
12955
c0c3707f
CB
12956 #include <stddef.h>
12957 #include <signal.h>
12958 #if HAVE_WCHAR_H
c0c3707f
CB
12959 # include <wchar.h>
12960 #endif
8690e634 12961
c0c3707f
CB
12962 extern $gltype foo;
12963 extern $gltype1 foo;
12964int
12965main ()
12966{
12967
12968 ;
12969 return 0;
12970}
12971_ACEOF
12972if ac_fn_c_try_compile "$LINENO"; then :
12973 eval gl_cv_type_${gltype}_suffix=\$glsuf
8690e634 12974fi
c0c3707f
CB
12975rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12976 eval result=\$gl_cv_type_${gltype}_suffix
12977 test "$result" != no && break
12978 done
12979fi
12980eval ac_res=\$gl_cv_type_${gltype}_suffix
12981 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12982$as_echo "$ac_res" >&6; }
12983 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12984 eval result=\$gl_cv_type_${gltype}_suffix
12985 test "$result" = no && result=
12986 eval ${GLTYPE}_SUFFIX=\$result
12987 cat >>confdefs.h <<_ACEOF
12988#define ${GLTYPE}_SUFFIX $result
12989_ACEOF
8690e634 12990
c0c3707f 12991 done
8690e634
JK
12992
12993
c0c3707f 12994 fi
8690e634
JK
12995
12996
c0c3707f
CB
12997 for gltype in sig_atomic_t wchar_t wint_t ; do
12998 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12999$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
13000if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
8690e634
JK
13001 $as_echo_n "(cached) " >&6
13002else
c0c3707f
CB
13003 eval gl_cv_type_${gltype}_suffix=no
13004 eval result=\$gl_cv_type_${gltype}_signed
13005 if test "$result" = yes; then
13006 glsufu=
13007 else
13008 glsufu=u
13009 fi
13010 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
13011 case $glsuf in
13012 '') gltype1='int';;
13013 l) gltype1='long int';;
13014 ll) gltype1='long long int';;
13015 i64) gltype1='__int64';;
13016 u) gltype1='unsigned int';;
13017 ul) gltype1='unsigned long int';;
13018 ull) gltype1='unsigned long long int';;
13019 ui64)gltype1='unsigned __int64';;
13020 esac
13021 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
13022/* end confdefs.h. */
13023
c0c3707f
CB
13024 #include <stddef.h>
13025 #include <signal.h>
13026 #if HAVE_WCHAR_H
c0c3707f
CB
13027 # include <wchar.h>
13028 #endif
13029
13030 extern $gltype foo;
13031 extern $gltype1 foo;
13032int
13033main ()
13034{
13035
13036 ;
5e8754f9 13037 return 0;
8690e634 13038}
c0c3707f
CB
13039_ACEOF
13040if ac_fn_c_try_compile "$LINENO"; then :
13041 eval gl_cv_type_${gltype}_suffix=\$glsuf
13042fi
13043rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13044 eval result=\$gl_cv_type_${gltype}_suffix
13045 test "$result" != no && break
13046 done
13047fi
13048eval ac_res=\$gl_cv_type_${gltype}_suffix
13049 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
13050$as_echo "$ac_res" >&6; }
13051 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
13052 eval result=\$gl_cv_type_${gltype}_suffix
13053 test "$result" = no && result=
13054 eval ${GLTYPE}_SUFFIX=\$result
13055 cat >>confdefs.h <<_ACEOF
13056#define ${GLTYPE}_SUFFIX $result
13057_ACEOF
13058
13059 done
13060
13061
13062
13063 if test $GNULIB_OVERRIDES_WINT_T = 1; then
13064 BITSIZEOF_WINT_T=32
13065 fi
13066
13067 ;;
13068 esac
8690e634 13069
8690e634 13070
c0c3707f
CB
13071
13072 LIMITS_H='limits.h'
13073 if test -n "$LIMITS_H"; then
13074 GL_GENERATE_LIMITS_H_TRUE=
13075 GL_GENERATE_LIMITS_H_FALSE='#'
13076else
13077 GL_GENERATE_LIMITS_H_TRUE='#'
13078 GL_GENERATE_LIMITS_H_FALSE=
8690e634 13079fi
6ec2e0f5
SDJ
13080
13081
13082
13083
13084
13085
13086
c0c3707f
CB
13087 if test -n "$STDINT_H"; then
13088 GL_GENERATE_STDINT_H_TRUE=
13089 GL_GENERATE_STDINT_H_FALSE='#'
13090else
13091 GL_GENERATE_STDINT_H_TRUE='#'
13092 GL_GENERATE_STDINT_H_FALSE=
13093fi
472fa5ee
SM
13094
13095
13096
c0c3707f
CB
13097 GNULIB_IMAXABS=0;
13098 GNULIB_IMAXDIV=0;
13099 GNULIB_STRTOIMAX=0;
13100 GNULIB_STRTOUMAX=0;
13101 HAVE_DECL_IMAXABS=1;
13102 HAVE_DECL_IMAXDIV=1;
13103 HAVE_DECL_STRTOIMAX=1;
13104 HAVE_DECL_STRTOUMAX=1;
13105 HAVE_IMAXDIV_T=1;
13106 REPLACE_STRTOIMAX=0;
13107 REPLACE_STRTOUMAX=0;
13108 INT32_MAX_LT_INTMAX_MAX=1;
13109 INT64_MAX_EQ_LONG_MAX='defined _LP64';
c0c3707f
CB
13110 PRIPTR_PREFIX=__PRIPTR_PREFIX;
13111 UINT32_MAX_LT_UINTMAX_MAX=1;
13112 UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
472fa5ee 13113
6ec2e0f5
SDJ
13114
13115
13116
13117
13118
6ec2e0f5
SDJ
13119
13120
6ec2e0f5 13121
6ec2e0f5 13122
6ec2e0f5 13123
6ec2e0f5 13124
6ec2e0f5 13125
c0c3707f
CB
13126
13127
13128 if test $gl_cv_have_include_next = yes; then
13129 gl_cv_next_inttypes_h='<'inttypes.h'>'
13130 else
13131 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
13132$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
13133if ${gl_cv_next_inttypes_h+:} false; then :
13134 $as_echo_n "(cached) " >&6
13135else
13136
13137 if test $ac_cv_header_inttypes_h = yes; then
13138
13139
13140
13141
13142 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13143/* end confdefs.h. */
13144#include <inttypes.h>
6ec2e0f5 13145_ACEOF
c0c3707f
CB
13146 case "$host_os" in
13147 aix*) gl_absname_cpp="$ac_cpp -C" ;;
13148 *) gl_absname_cpp="$ac_cpp" ;;
13149 esac
6ec2e0f5 13150
c0c3707f
CB
13151 case "$host_os" in
13152 mingw*)
13153 gl_dirsep_regex='[/\\]'
13154 ;;
13155 *)
13156 gl_dirsep_regex='\/'
13157 ;;
13158 esac
13159 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13160 gl_header_literal_regex=`echo 'inttypes.h' \
13161 | sed -e "$gl_make_literal_regex_sed"`
13162 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13163 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13164 s|^/[^/]|//&|
13165 p
13166 q
13167 }'
6ec2e0f5 13168
c0c3707f
CB
13169 gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13170 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 13171
c0c3707f
CB
13172 gl_header=$gl_cv_absolute_inttypes_h
13173 gl_cv_next_inttypes_h='"'$gl_header'"'
13174 else
13175 gl_cv_next_inttypes_h='<'inttypes.h'>'
13176 fi
6ec2e0f5 13177
6ec2e0f5 13178
c0c3707f
CB
13179fi
13180{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
13181$as_echo "$gl_cv_next_inttypes_h" >&6; }
13182 fi
13183 NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
6ec2e0f5 13184
c0c3707f
CB
13185 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13186 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13187 gl_next_as_first_directive='<'inttypes.h'>'
13188 else
13189 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13190 gl_next_as_first_directive=$gl_cv_next_inttypes_h
13191 fi
13192 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
6ec2e0f5 13193
472fa5ee
SM
13194
13195
13196
13197
13198
13199
472fa5ee
SM
13200
13201
13202
13203
6ec2e0f5 13204
698be2d8
CB
13205
13206
698be2d8
CB
13207
13208
5df4cba6
SM
13209 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
13210$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
13211if ${gl_cv_cc_double_expbit0+:} false; then :
13212 $as_echo_n "(cached) " >&6
13213else
13214
13215 if test "$cross_compiling" = yes; then :
13216
13217 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13218/* end confdefs.h. */
13219
13220#if defined arm || defined __arm || defined __arm__
13221 mixed_endianness
13222#endif
13223
13224_ACEOF
13225if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13226 $EGREP "mixed_endianness" >/dev/null 2>&1; then :
13227 gl_cv_cc_double_expbit0="unknown"
13228else
13229
13230 :
13231if ${ac_cv_c_bigendian+:} false; then :
13232 $as_echo_n "(cached) " >&6
13233else
13234 ac_cv_c_bigendian=unknown
13235 # See if we're dealing with a universal compiler.
13236 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13237/* end confdefs.h. */
13238#ifndef __APPLE_CC__
13239 not a universal capable compiler
13240 #endif
13241 typedef int dummy;
13242
13243_ACEOF
13244if ac_fn_c_try_compile "$LINENO"; then :
13245
13246 # Check for potential -arch flags. It is not universal unless
13247 # there are at least two -arch flags with different values.
13248 ac_arch=
13249 ac_prev=
13250 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13251 if test -n "$ac_prev"; then
13252 case $ac_word in
13253 i?86 | x86_64 | ppc | ppc64)
13254 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13255 ac_arch=$ac_word
13256 else
13257 ac_cv_c_bigendian=universal
13258 break
13259 fi
13260 ;;
13261 esac
13262 ac_prev=
13263 elif test "x$ac_word" = "x-arch"; then
13264 ac_prev=arch
13265 fi
13266 done
13267fi
13268rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13269 if test $ac_cv_c_bigendian = unknown; then
13270 # See if sys/param.h defines the BYTE_ORDER macro.
13271 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13272/* end confdefs.h. */
13273#include <sys/types.h>
13274 #include <sys/param.h>
13275
13276int
13277main ()
13278{
13279#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13280 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13281 && LITTLE_ENDIAN)
13282 bogus endian macros
13283 #endif
13284
13285 ;
13286 return 0;
13287}
13288_ACEOF
13289if ac_fn_c_try_compile "$LINENO"; then :
13290 # It does; now see whether it defined to BIG_ENDIAN or not.
13291 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13292/* end confdefs.h. */
13293#include <sys/types.h>
13294 #include <sys/param.h>
13295
13296int
13297main ()
13298{
13299#if BYTE_ORDER != BIG_ENDIAN
13300 not big endian
13301 #endif
13302
13303 ;
13304 return 0;
13305}
13306_ACEOF
13307if ac_fn_c_try_compile "$LINENO"; then :
13308 ac_cv_c_bigendian=yes
13309else
13310 ac_cv_c_bigendian=no
13311fi
13312rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13313fi
13314rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13315 fi
13316 if test $ac_cv_c_bigendian = unknown; then
13317 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13318 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13319/* end confdefs.h. */
13320#include <limits.h>
13321
13322int
13323main ()
13324{
13325#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13326 bogus endian macros
13327 #endif
13328
13329 ;
13330 return 0;
13331}
13332_ACEOF
13333if ac_fn_c_try_compile "$LINENO"; then :
13334 # It does; now see whether it defined to _BIG_ENDIAN or not.
13335 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13336/* end confdefs.h. */
13337#include <limits.h>
13338
13339int
13340main ()
13341{
13342#ifndef _BIG_ENDIAN
13343 not big endian
13344 #endif
13345
13346 ;
13347 return 0;
13348}
13349_ACEOF
13350if ac_fn_c_try_compile "$LINENO"; then :
13351 ac_cv_c_bigendian=yes
13352else
13353 ac_cv_c_bigendian=no
13354fi
13355rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13356fi
13357rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13358 fi
13359 if test $ac_cv_c_bigendian = unknown; then
13360 # Compile a test program.
13361 if test "$cross_compiling" = yes; then :
13362 # Try to guess by grepping values from an object file.
13363 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13364/* end confdefs.h. */
13365short int ascii_mm[] =
13366 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13367 short int ascii_ii[] =
13368 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13369 int use_ascii (int i) {
13370 return ascii_mm[i] + ascii_ii[i];
13371 }
13372 short int ebcdic_ii[] =
13373 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13374 short int ebcdic_mm[] =
13375 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13376 int use_ebcdic (int i) {
13377 return ebcdic_mm[i] + ebcdic_ii[i];
13378 }
13379 extern int foo;
13380
13381int
13382main ()
13383{
13384return use_ascii (foo) == use_ebcdic (foo);
13385 ;
13386 return 0;
13387}
13388_ACEOF
13389if ac_fn_c_try_compile "$LINENO"; then :
13390 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13391 ac_cv_c_bigendian=yes
13392 fi
13393 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13394 if test "$ac_cv_c_bigendian" = unknown; then
13395 ac_cv_c_bigendian=no
13396 else
13397 # finding both strings is unlikely to happen, but who knows?
13398 ac_cv_c_bigendian=unknown
13399 fi
13400 fi
13401fi
13402rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13403else
13404 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13405/* end confdefs.h. */
13406$ac_includes_default
13407int
13408main ()
13409{
13410
13411 /* Are we little or big endian? From Harbison&Steele. */
13412 union
13413 {
13414 long int l;
13415 char c[sizeof (long int)];
13416 } u;
13417 u.l = 1;
13418 return u.c[sizeof (long int) - 1] == 1;
13419
13420 ;
13421 return 0;
13422}
13423_ACEOF
13424if ac_fn_c_try_run "$LINENO"; then :
13425 ac_cv_c_bigendian=no
13426else
13427 ac_cv_c_bigendian=yes
13428fi
13429rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13430 conftest.$ac_objext conftest.beam conftest.$ac_ext
13431fi
13432
13433 fi
13434fi
13435:
13436 case $ac_cv_c_bigendian in #(
13437 yes)
13438 gl_cv_cc_double_expbit0="word 0 bit 20";; #(
13439 no)
13440 gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
13441 universal)
13442
13443$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13444
13445 ;; #(
13446 *)
13447 gl_cv_cc_double_expbit0="unknown" ;;
13448 esac
13449
13450
13451fi
13452rm -f conftest*
13453
13454
13455else
13456 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13457/* end confdefs.h. */
13458
13459#include <float.h>
13460#include <stddef.h>
13461#include <stdio.h>
13462#include <string.h>
13463#define NWORDS \
13464 ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
13465typedef union { double value; unsigned int word[NWORDS]; } memory_double;
13466static unsigned int ored_words[NWORDS];
13467static unsigned int anded_words[NWORDS];
13468static void add_to_ored_words (double x)
13469{
13470 memory_double m;
13471 size_t i;
13472 /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
13473 memset (&m, 0, sizeof (memory_double));
13474 m.value = x;
13475 for (i = 0; i < NWORDS; i++)
13476 {
13477 ored_words[i] |= m.word[i];
13478 anded_words[i] &= m.word[i];
13479 }
13480}
13481int main ()
13482{
13483 size_t j;
13484 FILE *fp = fopen ("conftest.out", "w");
13485 if (fp == NULL)
13486 return 1;
13487 for (j = 0; j < NWORDS; j++)
13488 anded_words[j] = ~ (unsigned int) 0;
13489 add_to_ored_words (0.25);
13490 add_to_ored_words (0.5);
13491 add_to_ored_words (1.0);
13492 add_to_ored_words (2.0);
13493 add_to_ored_words (4.0);
13494 /* Remove bits that are common (e.g. if representation of the first mantissa
13495 bit is explicit). */
13496 for (j = 0; j < NWORDS; j++)
13497 ored_words[j] &= ~anded_words[j];
13498 /* Now find the nonzero word. */
13499 for (j = 0; j < NWORDS; j++)
13500 if (ored_words[j] != 0)
13501 break;
13502 if (j < NWORDS)
13503 {
13504 size_t i;
13505 for (i = j + 1; i < NWORDS; i++)
13506 if (ored_words[i] != 0)
13507 {
13508 fprintf (fp, "unknown");
13509 return (fclose (fp) != 0);
13510 }
13511 for (i = 0; ; i++)
13512 if ((ored_words[j] >> i) & 1)
13513 {
13514 fprintf (fp, "word %d bit %d", (int) j, (int) i);
13515 return (fclose (fp) != 0);
13516 }
13517 }
13518 fprintf (fp, "unknown");
13519 return (fclose (fp) != 0);
13520}
13521
13522_ACEOF
13523if ac_fn_c_try_run "$LINENO"; then :
13524 gl_cv_cc_double_expbit0=`cat conftest.out`
13525else
13526 gl_cv_cc_double_expbit0="unknown"
6ec2e0f5 13527fi
5df4cba6
SM
13528rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13529 conftest.$ac_objext conftest.beam conftest.$ac_ext
13530fi
13531
13532 rm -f conftest.out
6ec2e0f5
SDJ
13533
13534fi
5df4cba6
SM
13535{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
13536$as_echo "$gl_cv_cc_double_expbit0" >&6; }
13537 case "$gl_cv_cc_double_expbit0" in
13538 word*bit*)
13539 word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
13540 bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
6ec2e0f5
SDJ
13541
13542cat >>confdefs.h <<_ACEOF
5df4cba6 13543#define DBL_EXPBIT0_WORD $word
6ec2e0f5
SDJ
13544_ACEOF
13545
c0c3707f 13546
5df4cba6
SM
13547cat >>confdefs.h <<_ACEOF
13548#define DBL_EXPBIT0_BIT $bit
13549_ACEOF
6ec2e0f5 13550
5df4cba6
SM
13551 ;;
13552 esac
6ec2e0f5 13553
6ec2e0f5 13554
5df4cba6
SM
13555 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
13556$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
c0c3707f
CB
13557if ${ac_cv_c_bigendian+:} false; then :
13558 $as_echo_n "(cached) " >&6
6ec2e0f5 13559else
c0c3707f
CB
13560 ac_cv_c_bigendian=unknown
13561 # See if we're dealing with a universal compiler.
13562 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13563/* end confdefs.h. */
c0c3707f
CB
13564#ifndef __APPLE_CC__
13565 not a universal capable compiler
13566 #endif
13567 typedef int dummy;
6ec2e0f5 13568
c0c3707f
CB
13569_ACEOF
13570if ac_fn_c_try_compile "$LINENO"; then :
13571
13572 # Check for potential -arch flags. It is not universal unless
13573 # there are at least two -arch flags with different values.
13574 ac_arch=
13575 ac_prev=
13576 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13577 if test -n "$ac_prev"; then
13578 case $ac_word in
13579 i?86 | x86_64 | ppc | ppc64)
13580 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13581 ac_arch=$ac_word
13582 else
13583 ac_cv_c_bigendian=universal
13584 break
13585 fi
13586 ;;
13587 esac
13588 ac_prev=
13589 elif test "x$ac_word" = "x-arch"; then
13590 ac_prev=arch
13591 fi
13592 done
13593fi
13594rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13595 if test $ac_cv_c_bigendian = unknown; then
13596 # See if sys/param.h defines the BYTE_ORDER macro.
13597 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13598/* end confdefs.h. */
13599#include <sys/types.h>
13600 #include <sys/param.h>
6ec2e0f5
SDJ
13601
13602int
13603main ()
13604{
c0c3707f
CB
13605#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13606 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13607 && LITTLE_ENDIAN)
13608 bogus endian macros
13609 #endif
6ec2e0f5 13610
c0c3707f
CB
13611 ;
13612 return 0;
13613}
13614_ACEOF
13615if ac_fn_c_try_compile "$LINENO"; then :
13616 # It does; now see whether it defined to BIG_ENDIAN or not.
13617 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13618/* end confdefs.h. */
13619#include <sys/types.h>
13620 #include <sys/param.h>
13621
13622int
13623main ()
13624{
13625#if BYTE_ORDER != BIG_ENDIAN
13626 not big endian
13627 #endif
6ec2e0f5
SDJ
13628
13629 ;
13630 return 0;
13631}
13632_ACEOF
c0c3707f
CB
13633if ac_fn_c_try_compile "$LINENO"; then :
13634 ac_cv_c_bigendian=yes
6ec2e0f5 13635else
c0c3707f 13636 ac_cv_c_bigendian=no
6ec2e0f5 13637fi
c0c3707f 13638rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13639fi
c0c3707f
CB
13640rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13641 fi
13642 if test $ac_cv_c_bigendian = unknown; then
13643 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13644 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13645/* end confdefs.h. */
13646#include <limits.h>
472fa5ee 13647
c0c3707f
CB
13648int
13649main ()
13650{
13651#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13652 bogus endian macros
13653 #endif
6ec2e0f5 13654
c0c3707f
CB
13655 ;
13656 return 0;
13657}
6ec2e0f5 13658_ACEOF
c0c3707f
CB
13659if ac_fn_c_try_compile "$LINENO"; then :
13660 # It does; now see whether it defined to _BIG_ENDIAN or not.
13661 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13662/* end confdefs.h. */
c0c3707f
CB
13663#include <limits.h>
13664
6ec2e0f5
SDJ
13665int
13666main ()
13667{
5df4cba6
SM
13668#ifndef _BIG_ENDIAN
13669 not big endian
13670 #endif
13671
13672 ;
13673 return 0;
13674}
13675_ACEOF
13676if ac_fn_c_try_compile "$LINENO"; then :
13677 ac_cv_c_bigendian=yes
13678else
13679 ac_cv_c_bigendian=no
13680fi
13681rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13682fi
13683rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13684 fi
13685 if test $ac_cv_c_bigendian = unknown; then
13686 # Compile a test program.
13687 if test "$cross_compiling" = yes; then :
13688 # Try to guess by grepping values from an object file.
13689 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13690/* end confdefs.h. */
13691short int ascii_mm[] =
13692 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13693 short int ascii_ii[] =
13694 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13695 int use_ascii (int i) {
13696 return ascii_mm[i] + ascii_ii[i];
13697 }
13698 short int ebcdic_ii[] =
13699 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13700 short int ebcdic_mm[] =
13701 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13702 int use_ebcdic (int i) {
13703 return ebcdic_mm[i] + ebcdic_ii[i];
13704 }
13705 extern int foo;
13706
13707int
13708main ()
13709{
13710return use_ascii (foo) == use_ebcdic (foo);
13711 ;
13712 return 0;
13713}
13714_ACEOF
13715if ac_fn_c_try_compile "$LINENO"; then :
13716 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13717 ac_cv_c_bigendian=yes
13718 fi
13719 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13720 if test "$ac_cv_c_bigendian" = unknown; then
13721 ac_cv_c_bigendian=no
13722 else
13723 # finding both strings is unlikely to happen, but who knows?
13724 ac_cv_c_bigendian=unknown
13725 fi
13726 fi
13727fi
13728rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13729else
13730 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13731/* end confdefs.h. */
13732$ac_includes_default
13733int
13734main ()
13735{
13736
13737 /* Are we little or big endian? From Harbison&Steele. */
13738 union
13739 {
13740 long int l;
13741 char c[sizeof (long int)];
13742 } u;
13743 u.l = 1;
13744 return u.c[sizeof (long int) - 1] == 1;
13745
13746 ;
13747 return 0;
13748}
13749_ACEOF
13750if ac_fn_c_try_run "$LINENO"; then :
13751 ac_cv_c_bigendian=no
13752else
13753 ac_cv_c_bigendian=yes
13754fi
13755rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13756 conftest.$ac_objext conftest.beam conftest.$ac_ext
13757fi
13758
13759 fi
13760fi
13761{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
13762$as_echo "$ac_cv_c_bigendian" >&6; }
13763 case $ac_cv_c_bigendian in #(
13764 yes)
13765 $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
13766;; #(
13767 no)
13768 ;; #(
13769 universal)
13770
13771$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13772
13773 ;; #(
13774 *)
13775 as_fn_error $? "unknown endianness
13776 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
13777 esac
13778
13779
13780
5df4cba6
SM
13781 GNULIB_LOCALECONV=0;
13782 GNULIB_SETLOCALE=0;
13783 GNULIB_SETLOCALE_NULL=0;
13784 GNULIB_DUPLOCALE=0;
13785 GNULIB_LOCALENAME=0;
13786 HAVE_NEWLOCALE=1;
13787 HAVE_DUPLOCALE=1;
13788 HAVE_FREELOCALE=1;
13789 REPLACE_LOCALECONV=0;
13790 REPLACE_SETLOCALE=0;
13791 REPLACE_NEWLOCALE=0;
13792 REPLACE_DUPLOCALE=0;
13793 REPLACE_FREELOCALE=0;
13794 REPLACE_STRUCT_LCONV=0;
13795
13796
13797 REPLACE_NULL=0;
13798 HAVE_MAX_ALIGN_T=1;
13799 HAVE_WCHAR_T=1;
13800
13801
13802 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
13803$as_echo_n "checking for wchar_t... " >&6; }
13804if ${gt_cv_c_wchar_t+:} false; then :
13805 $as_echo_n "(cached) " >&6
13806else
13807 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13808/* end confdefs.h. */
13809#include <stddef.h>
13810 wchar_t foo = (wchar_t)'\0';
13811int
13812main ()
13813{
13814
13815 ;
13816 return 0;
13817}
13818_ACEOF
13819if ac_fn_c_try_compile "$LINENO"; then :
13820 gt_cv_c_wchar_t=yes
13821else
13822 gt_cv_c_wchar_t=no
13823fi
13824rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13825fi
13826{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
13827$as_echo "$gt_cv_c_wchar_t" >&6; }
13828 if test $gt_cv_c_wchar_t = yes; then
13829
13830$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
13831
13832 fi
13833
13834
13835
13836
9c9d63b1
PM
13837
13838
13839
5df4cba6
SM
13840 STDDEF_H=
13841
13842 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
13843$as_echo_n "checking for good max_align_t... " >&6; }
13844if ${gl_cv_type_max_align_t+:} false; then :
13845 $as_echo_n "(cached) " >&6
13846else
13847 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13848/* end confdefs.h. */
13849#include <stddef.h>
13850 unsigned int s = sizeof (max_align_t);
9c9d63b1 13851 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
5df4cba6
SM
13852 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
13853 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
13854 #endif
9c9d63b1
PM
13855 typedef struct { char a; max_align_t b; } max_helper;
13856 typedef struct { char a; long b; } long_helper;
13857 typedef struct { char a; double b; } double_helper;
13858 typedef struct { char a; long double b; } long_double_helper;
13859 int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
13860 int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
13861 int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
5df4cba6
SM
13862
13863int
13864main ()
13865{
c0c3707f 13866
6ec2e0f5
SDJ
13867 ;
13868 return 0;
13869}
13870_ACEOF
13871if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 13872 gl_cv_type_max_align_t=yes
6ec2e0f5 13873else
5df4cba6 13874 gl_cv_type_max_align_t=no
6ec2e0f5 13875fi
c0c3707f 13876rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13877
c0c3707f 13878fi
5df4cba6
SM
13879{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
13880$as_echo "$gl_cv_type_max_align_t" >&6; }
13881 if test $gl_cv_type_max_align_t = no; then
13882 HAVE_MAX_ALIGN_T=0
13883 STDDEF_H=stddef.h
13884 fi
13885
13886 if test $gt_cv_c_wchar_t = no; then
13887 HAVE_WCHAR_T=0
13888 STDDEF_H=stddef.h
13889 fi
13890
13891 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
13892$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
13893if ${gl_cv_decl_null_works+:} false; then :
13894 $as_echo_n "(cached) " >&6
c0c3707f
CB
13895else
13896 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13897/* end confdefs.h. */
5df4cba6
SM
13898#include <stddef.h>
13899 int test[2 * (sizeof NULL == sizeof (void *)) -1];
13900
c0c3707f
CB
13901int
13902main ()
13903{
6ec2e0f5 13904
c0c3707f
CB
13905 ;
13906 return 0;
13907}
13908_ACEOF
5df4cba6
SM
13909if ac_fn_c_try_compile "$LINENO"; then :
13910 gl_cv_decl_null_works=yes
c0c3707f 13911else
5df4cba6 13912 gl_cv_decl_null_works=no
c0c3707f 13913fi
5df4cba6 13914rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 13915fi
5df4cba6
SM
13916{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
13917$as_echo "$gl_cv_decl_null_works" >&6; }
13918 if test $gl_cv_decl_null_works = no; then
13919 REPLACE_NULL=1
13920 STDDEF_H=stddef.h
13921 fi
6ec2e0f5 13922
5df4cba6
SM
13923
13924 if test -n "$STDDEF_H"; then
13925 GL_GENERATE_STDDEF_H_TRUE=
13926 GL_GENERATE_STDDEF_H_FALSE='#'
13927else
13928 GL_GENERATE_STDDEF_H_TRUE='#'
13929 GL_GENERATE_STDDEF_H_FALSE=
c0c3707f 13930fi
6ec2e0f5 13931
5df4cba6 13932 if test -n "$STDDEF_H"; then
6ec2e0f5 13933
472fa5ee
SM
13934
13935
5e8754f9
SDJ
13936
13937
5df4cba6
SM
13938
13939
13940
13941 if test $gl_cv_have_include_next = yes; then
13942 gl_cv_next_stddef_h='<'stddef.h'>'
13943 else
13944 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
13945$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
13946if ${gl_cv_next_stddef_h+:} false; then :
13947 $as_echo_n "(cached) " >&6
c0c3707f 13948else
5df4cba6
SM
13949
13950
13951
c0c3707f
CB
13952 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13953/* end confdefs.h. */
c0c3707f 13954#include <stddef.h>
c0c3707f 13955_ACEOF
5df4cba6
SM
13956 case "$host_os" in
13957 aix*) gl_absname_cpp="$ac_cpp -C" ;;
13958 *) gl_absname_cpp="$ac_cpp" ;;
13959 esac
13960
13961 case "$host_os" in
13962 mingw*)
13963 gl_dirsep_regex='[/\\]'
13964 ;;
13965 *)
13966 gl_dirsep_regex='\/'
13967 ;;
13968 esac
13969 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13970 gl_header_literal_regex=`echo 'stddef.h' \
13971 | sed -e "$gl_make_literal_regex_sed"`
13972 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13973 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13974 s|^/[^/]|//&|
13975 p
13976 q
13977 }'
13978
13979 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13980 sed -n "$gl_absolute_header_sed"`
13981
13982 gl_header=$gl_cv_absolute_stddef_h
13983 gl_cv_next_stddef_h='"'$gl_header'"'
5e8754f9
SDJ
13984
13985
c0c3707f 13986fi
5df4cba6
SM
13987{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
13988$as_echo "$gl_cv_next_stddef_h" >&6; }
13989 fi
13990 NEXT_STDDEF_H=$gl_cv_next_stddef_h
13991
13992 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13993 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13994 gl_next_as_first_directive='<'stddef.h'>'
13995 else
13996 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13997 gl_next_as_first_directive=$gl_cv_next_stddef_h
13998 fi
13999 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
5e8754f9
SDJ
14000
14001
14002
14003
5df4cba6 14004 fi
5e8754f9
SDJ
14005
14006
14007
14008
14009
14010
5df4cba6
SM
14011 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
14012$as_echo_n "checking whether locale.h defines locale_t... " >&6; }
14013if ${gl_cv_header_locale_has_locale_t+:} false; then :
14014 $as_echo_n "(cached) " >&6
14015else
14016 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14017/* end confdefs.h. */
5df4cba6
SM
14018#include <locale.h>
14019 locale_t x;
c0c3707f
CB
14020int
14021main ()
14022{
5e8754f9 14023
c0c3707f
CB
14024 ;
14025 return 0;
14026}
14027_ACEOF
14028if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 14029 gl_cv_header_locale_has_locale_t=yes
c0c3707f 14030else
5df4cba6 14031 gl_cv_header_locale_has_locale_t=no
c0c3707f
CB
14032fi
14033rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 14034
c0c3707f 14035fi
5df4cba6
SM
14036{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
14037$as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
14038
14039
14040 if test $ac_cv_header_xlocale_h = yes; then
14041 HAVE_XLOCALE_H=1
14042 if test $gl_cv_header_locale_has_locale_t = yes; then
14043 gl_cv_header_locale_h_needs_xlocale_h=no
14044 else
14045 gl_cv_header_locale_h_needs_xlocale_h=yes
c0c3707f 14046 fi
5df4cba6
SM
14047 HAVE_LOCALE_T=1
14048 else
14049 HAVE_XLOCALE_H=0
14050 gl_cv_header_locale_h_needs_xlocale_h=no
14051 if test $gl_cv_header_locale_has_locale_t = yes; then
14052 HAVE_LOCALE_T=1
14053 else
14054 HAVE_LOCALE_T=0
14055 fi
14056 fi
14057
14058
5e8754f9 14059
5df4cba6
SM
14060
14061 gl_threads_api=none
14062 LIBTHREAD=
14063 LTLIBTHREAD=
14064 LIBMULTITHREAD=
14065 LTLIBMULTITHREAD=
14066 if test "$gl_use_threads" != no; then
14067
14068
14069 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
14070$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
14071if ${gl_cv_have_weak+:} false; then :
14072 $as_echo_n "(cached) " >&6
14073else
14074 gl_cv_have_weak=no
14075 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14076/* end confdefs.h. */
14077extern void xyzzy ();
14078#pragma weak xyzzy
c0c3707f
CB
14079int
14080main ()
14081{
5df4cba6 14082xyzzy();
c0c3707f
CB
14083 ;
14084 return 0;
14085}
14086_ACEOF
5df4cba6
SM
14087if ac_fn_c_try_link "$LINENO"; then :
14088 gl_cv_have_weak=maybe
14089fi
14090rm -f core conftest.err conftest.$ac_objext \
14091 conftest$ac_exeext conftest.$ac_ext
14092 if test $gl_cv_have_weak = maybe; then
14093 if test "$cross_compiling" = yes; then :
14094 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14095/* end confdefs.h. */
5df4cba6
SM
14096#ifdef __ELF__
14097 Extensible Linking Format
14098 #endif
5e8754f9 14099
5df4cba6
SM
14100_ACEOF
14101if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14102 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
14103 gl_cv_have_weak="guessing yes"
14104else
14105 gl_cv_have_weak="guessing no"
14106fi
14107rm -f conftest*
5e8754f9 14108
5df4cba6
SM
14109
14110else
14111 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14112/* end confdefs.h. */
14113
14114#include <stdio.h>
14115#pragma weak fputs
14116int main ()
14117{
14118 return (fputs == NULL);
c0c3707f
CB
14119}
14120_ACEOF
5df4cba6
SM
14121if ac_fn_c_try_run "$LINENO"; then :
14122 gl_cv_have_weak=yes
c0c3707f 14123else
5df4cba6 14124 gl_cv_have_weak=no
c0c3707f 14125fi
5df4cba6
SM
14126rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14127 conftest.$ac_objext conftest.beam conftest.$ac_ext
c0c3707f 14128fi
5df4cba6
SM
14129
14130 fi
14131 case " $LDFLAGS " in
14132 *" -static "*) gl_cv_have_weak=no ;;
14133 esac
14134 case "$gl_cv_have_weak" in
14135 *yes)
14136 case "$host_os" in
14137 freebsd* | dragonfly*)
14138 : > conftest1.c
14139 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
14140 cat <<EOF > conftest2.c
14141#include <pthread.h>
14142#pragma weak pthread_mutexattr_gettype
14143int main ()
14144{
14145 return (pthread_mutexattr_gettype != NULL);
14146}
14147EOF
14148 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
14149 || gl_cv_have_weak=no
14150 rm -f conftest1.c libempty.so conftest2.c conftest
14151 ;;
14152 esac
14153 ;;
14154 esac
14155
14156fi
14157{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
14158$as_echo "$gl_cv_have_weak" >&6; }
14159 case "$gl_cv_have_weak" in
14160 *yes)
14161
14162$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
14163
14164 ;;
14165 esac
14166
14167 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
14168
14169 :
c0c3707f 14170 fi
5df4cba6
SM
14171 if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
14172
14173 gl_have_isoc_threads="$ac_cv_header_threads_h"
14174 fi
14175 if test "$gl_use_threads" = yes \
14176 || test "$gl_use_threads" = posix \
14177 || test "$gl_use_threads" = isoc+posix; then
14178
14179
14180 if test -z "$gl_pthreadlib_body_done"; then
14181 gl_pthread_api=no
14182 LIBPTHREAD=
14183 LIBPMULTITHREAD=
14184 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
14185 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
14186 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
14187if test "x$ac_cv_header_pthread_h" = xyes; then :
14188 gl_have_pthread_h=yes
14189else
14190 gl_have_pthread_h=no
14191fi
14192
14193
14194 if test "$gl_have_pthread_h" = yes; then
14195 # Other possible tests:
14196 # -lpthreads (FSU threads, PCthreads)
14197 # -lgthreads
14198 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
14199 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
14200 # the second one only in libpthread, and lock.c needs it.
14201 #
14202 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
14203 # needs -pthread for some reason. See:
14204 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
14205 save_LIBS=$LIBS
14206 for gl_pthread in '' '-pthread'; do
14207 LIBS="$LIBS $gl_pthread"
14208 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14209/* end confdefs.h. */
14210#include <pthread.h>
14211 pthread_mutex_t m;
14212 pthread_mutexattr_t ma;
5e8754f9 14213
c0c3707f
CB
14214int
14215main ()
14216{
5df4cba6
SM
14217pthread_mutex_lock (&m);
14218 pthread_mutexattr_init (&ma);
c0c3707f
CB
14219 ;
14220 return 0;
14221}
14222_ACEOF
5df4cba6
SM
14223if ac_fn_c_try_link "$LINENO"; then :
14224 gl_pthread_api=yes
14225 LIBPTHREAD=$gl_pthread
14226 LIBPMULTITHREAD=$gl_pthread
c0c3707f 14227fi
5df4cba6
SM
14228rm -f core conftest.err conftest.$ac_objext \
14229 conftest$ac_exeext conftest.$ac_ext
14230 LIBS=$save_LIBS
14231 test $gl_pthread_api = yes && break
14232 done
14233
14234 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
14235 # since it is defined as a macro on OSF/1.)
14236 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
14237 # The program links fine without libpthread. But it may actually
14238 # need to link with libpthread in order to create multiple threads.
14239 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14240$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14241if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
14242 $as_echo_n "(cached) " >&6
c0c3707f 14243else
5df4cba6
SM
14244 ac_check_lib_save_LIBS=$LIBS
14245LIBS="-lpthread $LIBS"
14246cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14247/* end confdefs.h. */
5df4cba6
SM
14248
14249/* Override any GCC internal prototype to avoid an error.
14250 Use char because int might match the return type of a GCC
14251 builtin and then its argument prototype would still apply. */
14252#ifdef __cplusplus
14253extern "C"
14254#endif
14255char pthread_kill ();
c0c3707f
CB
14256int
14257main ()
14258{
5df4cba6 14259return pthread_kill ();
c0c3707f
CB
14260 ;
14261 return 0;
14262}
14263_ACEOF
5df4cba6
SM
14264if ac_fn_c_try_link "$LINENO"; then :
14265 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 14266else
5df4cba6 14267 ac_cv_lib_pthread_pthread_kill=no
6ec2e0f5 14268fi
5df4cba6
SM
14269rm -f core conftest.err conftest.$ac_objext \
14270 conftest$ac_exeext conftest.$ac_ext
14271LIBS=$ac_check_lib_save_LIBS
c0c3707f 14272fi
5df4cba6
SM
14273{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14274$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14275if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14276 LIBPMULTITHREAD=-lpthread
14277 # On Solaris and HP-UX, most pthread functions exist also in libc.
14278 # Therefore pthread_in_use() needs to actually try to create a
14279 # thread: pthread_create from libc will fail, whereas
14280 # pthread_create will actually create a thread.
14281 # On Solaris 10 or newer, this test is no longer needed, because
14282 # libc contains the fully functional pthread functions.
14283 case "$host_os" in
14284 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
472fa5ee 14285
5df4cba6 14286$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
472fa5ee 14287
5df4cba6 14288 esac
472fa5ee 14289
5df4cba6 14290fi
472fa5ee 14291
5df4cba6
SM
14292 elif test $gl_pthread_api != yes; then
14293 # Some library is needed. Try libpthread and libc_r.
14294 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14295$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14296if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
14297 $as_echo_n "(cached) " >&6
14298else
5df4cba6
SM
14299 ac_check_lib_save_LIBS=$LIBS
14300LIBS="-lpthread $LIBS"
14301cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14302/* end confdefs.h. */
5df4cba6
SM
14303
14304/* Override any GCC internal prototype to avoid an error.
14305 Use char because int might match the return type of a GCC
14306 builtin and then its argument prototype would still apply. */
14307#ifdef __cplusplus
14308extern "C"
14309#endif
14310char pthread_kill ();
c0c3707f
CB
14311int
14312main ()
14313{
5df4cba6 14314return pthread_kill ();
c0c3707f
CB
14315 ;
14316 return 0;
14317}
14318_ACEOF
14319if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14320 ac_cv_lib_pthread_pthread_kill=yes
c0c3707f 14321else
5df4cba6 14322 ac_cv_lib_pthread_pthread_kill=no
c0c3707f
CB
14323fi
14324rm -f core conftest.err conftest.$ac_objext \
14325 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14326LIBS=$ac_check_lib_save_LIBS
14327fi
14328{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14329$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14330if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14331 gl_pthread_api=yes
14332 LIBPTHREAD=-lpthread
14333 LIBPMULTITHREAD=-lpthread
c0c3707f 14334fi
472fa5ee 14335
5df4cba6
SM
14336 if test $gl_pthread_api != yes; then
14337 # For FreeBSD 4.
14338 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14339$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14340if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14341 $as_echo_n "(cached) " >&6
14342else
14343 ac_check_lib_save_LIBS=$LIBS
14344LIBS="-lc_r $LIBS"
14345cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14346/* end confdefs.h. */
472fa5ee 14347
5df4cba6
SM
14348/* Override any GCC internal prototype to avoid an error.
14349 Use char because int might match the return type of a GCC
14350 builtin and then its argument prototype would still apply. */
14351#ifdef __cplusplus
14352extern "C"
14353#endif
14354char pthread_kill ();
14355int
14356main ()
14357{
14358return pthread_kill ();
14359 ;
14360 return 0;
14361}
14362_ACEOF
14363if ac_fn_c_try_link "$LINENO"; then :
14364 ac_cv_lib_c_r_pthread_kill=yes
14365else
14366 ac_cv_lib_c_r_pthread_kill=no
14367fi
14368rm -f core conftest.err conftest.$ac_objext \
14369 conftest$ac_exeext conftest.$ac_ext
14370LIBS=$ac_check_lib_save_LIBS
14371fi
14372{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14373$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14374if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14375 gl_pthread_api=yes
14376 LIBPTHREAD=-lc_r
14377 LIBPMULTITHREAD=-lc_r
14378fi
6ec2e0f5 14379
5df4cba6
SM
14380 fi
14381 fi
14382 fi
14383 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14384$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14385 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14386$as_echo "$gl_pthread_api" >&6; }
472fa5ee
SM
14387
14388
5df4cba6 14389 if test $gl_pthread_api = yes; then
472fa5ee 14390
5df4cba6 14391$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
472fa5ee 14392
5df4cba6 14393 fi
472fa5ee 14394
5df4cba6 14395 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14396/* end confdefs.h. */
5df4cba6 14397#include <sched.h>
c0c3707f
CB
14398int
14399main ()
14400{
5df4cba6 14401sched_yield ();
c0c3707f
CB
14402 ;
14403 return 0;
14404}
14405_ACEOF
14406if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14407 LIB_SCHED_YIELD=
6ec2e0f5 14408
c0c3707f 14409else
5df4cba6
SM
14410 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14411$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14412if ${ac_cv_lib_rt_sched_yield+:} false; then :
14413 $as_echo_n "(cached) " >&6
c0c3707f 14414else
5df4cba6
SM
14415 ac_check_lib_save_LIBS=$LIBS
14416LIBS="-lrt $LIBS"
14417cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14418/* end confdefs.h. */
6ec2e0f5 14419
5df4cba6
SM
14420/* Override any GCC internal prototype to avoid an error.
14421 Use char because int might match the return type of a GCC
14422 builtin and then its argument prototype would still apply. */
14423#ifdef __cplusplus
14424extern "C"
14425#endif
14426char sched_yield ();
14427int
14428main ()
c0c3707f 14429{
5df4cba6
SM
14430return sched_yield ();
14431 ;
14432 return 0;
c0c3707f 14433}
6ec2e0f5 14434_ACEOF
5df4cba6
SM
14435if ac_fn_c_try_link "$LINENO"; then :
14436 ac_cv_lib_rt_sched_yield=yes
c0c3707f 14437else
5df4cba6 14438 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14439fi
5df4cba6
SM
14440rm -f core conftest.err conftest.$ac_objext \
14441 conftest$ac_exeext conftest.$ac_ext
14442LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14443fi
5df4cba6
SM
14444{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14445$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14446if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14447 LIB_SCHED_YIELD=-lrt
14448else
14449 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14450$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14451if ${ac_cv_lib_posix4_sched_yield+:} false; then :
14452 $as_echo_n "(cached) " >&6
14453else
14454 ac_check_lib_save_LIBS=$LIBS
14455LIBS="-lposix4 $LIBS"
14456cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14457/* end confdefs.h. */
6ec2e0f5 14458
5df4cba6
SM
14459/* Override any GCC internal prototype to avoid an error.
14460 Use char because int might match the return type of a GCC
14461 builtin and then its argument prototype would still apply. */
14462#ifdef __cplusplus
14463extern "C"
14464#endif
14465char sched_yield ();
c0c3707f
CB
14466int
14467main ()
14468{
5df4cba6 14469return sched_yield ();
c0c3707f
CB
14470 ;
14471 return 0;
14472}
14473_ACEOF
14474if ac_fn_c_try_link "$LINENO"; then :
5df4cba6
SM
14475 ac_cv_lib_posix4_sched_yield=yes
14476else
14477 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14478fi
14479rm -f core conftest.err conftest.$ac_objext \
14480 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14481LIBS=$ac_check_lib_save_LIBS
14482fi
14483{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14484$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14485if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14486 LIB_SCHED_YIELD=-lposix4
14487fi
14488
14489fi
14490
14491
14492fi
14493rm -f core conftest.err conftest.$ac_objext \
14494 conftest$ac_exeext conftest.$ac_ext
14495
14496
14497 gl_pthreadlib_body_done=done
14498 fi
14499
14500 LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
14501 LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
14502 if test $gl_pthread_api = yes; then
14503 if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
14504 gl_threads_api='isoc+posix'
14505
14506$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
14507
14508 LIBTHREAD= LTLIBTHREAD=
14509 else
14510 gl_threads_api=posix
14511
14512$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
14513
14514 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
14515 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
14516
14517$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
14518
14519 LIBTHREAD= LTLIBTHREAD=
9c9d63b1
PM
14520 else
14521 case "$host_os" in
14522 freebsd* | dragonfly*)
14523 if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
14524
14525$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
14526
14527 fi
14528 ;;
14529 esac
5df4cba6
SM
14530 fi
14531 fi
14532 fi
c0c3707f
CB
14533 fi
14534 fi
5df4cba6
SM
14535 if test $gl_threads_api = none; then
14536 if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
14537
14538
14539
14540 if test -z "$gl_stdthreadlib_body_done"; then
14541
14542
14543 case "$host_os" in
14544 mingw*)
14545 LIBSTDTHREAD=
14546 ;;
14547 *)
c0c3707f
CB
14548
14549
5df4cba6 14550 if test -z "$gl_pthreadlib_body_done"; then
c0c3707f
CB
14551 gl_pthread_api=no
14552 LIBPTHREAD=
14553 LIBPMULTITHREAD=
14554 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
14555 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
14556 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
14557if test "x$ac_cv_header_pthread_h" = xyes; then :
14558 gl_have_pthread_h=yes
14559else
14560 gl_have_pthread_h=no
14561fi
6ec2e0f5 14562
6ec2e0f5 14563
c0c3707f
CB
14564 if test "$gl_have_pthread_h" = yes; then
14565 # Other possible tests:
14566 # -lpthreads (FSU threads, PCthreads)
14567 # -lgthreads
14568 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
14569 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
14570 # the second one only in libpthread, and lock.c needs it.
14571 #
14572 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
14573 # needs -pthread for some reason. See:
14574 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
14575 save_LIBS=$LIBS
14576 for gl_pthread in '' '-pthread'; do
14577 LIBS="$LIBS $gl_pthread"
14578 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14579/* end confdefs.h. */
14580#include <pthread.h>
14581 pthread_mutex_t m;
14582 pthread_mutexattr_t ma;
6ec2e0f5 14583
c0c3707f
CB
14584int
14585main ()
14586{
14587pthread_mutex_lock (&m);
14588 pthread_mutexattr_init (&ma);
14589 ;
14590 return 0;
14591}
6ec2e0f5 14592_ACEOF
c0c3707f
CB
14593if ac_fn_c_try_link "$LINENO"; then :
14594 gl_pthread_api=yes
14595 LIBPTHREAD=$gl_pthread
14596 LIBPMULTITHREAD=$gl_pthread
6ec2e0f5 14597fi
c0c3707f
CB
14598rm -f core conftest.err conftest.$ac_objext \
14599 conftest$ac_exeext conftest.$ac_ext
14600 LIBS=$save_LIBS
14601 test $gl_pthread_api = yes && break
14602 done
6ec2e0f5 14603
c0c3707f
CB
14604 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
14605 # since it is defined as a macro on OSF/1.)
14606 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
14607 # The program links fine without libpthread. But it may actually
14608 # need to link with libpthread in order to create multiple threads.
14609 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14610$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14611if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
14612 $as_echo_n "(cached) " >&6
14613else
c0c3707f 14614 ac_check_lib_save_LIBS=$LIBS
5df4cba6
SM
14615LIBS="-lpthread $LIBS"
14616cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14617/* end confdefs.h. */
14618
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
14625char pthread_kill ();
14626int
14627main ()
14628{
14629return pthread_kill ();
14630 ;
14631 return 0;
14632}
14633_ACEOF
14634if ac_fn_c_try_link "$LINENO"; then :
14635 ac_cv_lib_pthread_pthread_kill=yes
14636else
14637 ac_cv_lib_pthread_pthread_kill=no
14638fi
14639rm -f core conftest.err conftest.$ac_objext \
14640 conftest$ac_exeext conftest.$ac_ext
14641LIBS=$ac_check_lib_save_LIBS
14642fi
14643{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14644$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14645if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14646 LIBPMULTITHREAD=-lpthread
14647 # On Solaris and HP-UX, most pthread functions exist also in libc.
14648 # Therefore pthread_in_use() needs to actually try to create a
14649 # thread: pthread_create from libc will fail, whereas
14650 # pthread_create will actually create a thread.
14651 # On Solaris 10 or newer, this test is no longer needed, because
14652 # libc contains the fully functional pthread functions.
14653 case "$host_os" in
14654 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
14655
14656$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
14657
14658 esac
14659
14660fi
14661
14662 elif test $gl_pthread_api != yes; then
14663 # Some library is needed. Try libpthread and libc_r.
14664 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14665$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14666if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
14667 $as_echo_n "(cached) " >&6
14668else
14669 ac_check_lib_save_LIBS=$LIBS
14670LIBS="-lpthread $LIBS"
14671cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14672/* end confdefs.h. */
14673
14674/* Override any GCC internal prototype to avoid an error.
14675 Use char because int might match the return type of a GCC
14676 builtin and then its argument prototype would still apply. */
14677#ifdef __cplusplus
14678extern "C"
14679#endif
14680char pthread_kill ();
14681int
14682main ()
14683{
14684return pthread_kill ();
14685 ;
14686 return 0;
14687}
14688_ACEOF
14689if ac_fn_c_try_link "$LINENO"; then :
14690 ac_cv_lib_pthread_pthread_kill=yes
14691else
14692 ac_cv_lib_pthread_pthread_kill=no
14693fi
14694rm -f core conftest.err conftest.$ac_objext \
14695 conftest$ac_exeext conftest.$ac_ext
14696LIBS=$ac_check_lib_save_LIBS
14697fi
14698{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14699$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14700if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14701 gl_pthread_api=yes
14702 LIBPTHREAD=-lpthread
14703 LIBPMULTITHREAD=-lpthread
14704fi
14705
14706 if test $gl_pthread_api != yes; then
14707 # For FreeBSD 4.
14708 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14709$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14710if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14711 $as_echo_n "(cached) " >&6
14712else
14713 ac_check_lib_save_LIBS=$LIBS
14714LIBS="-lc_r $LIBS"
14715cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14716/* end confdefs.h. */
14717
14718/* Override any GCC internal prototype to avoid an error.
14719 Use char because int might match the return type of a GCC
14720 builtin and then its argument prototype would still apply. */
14721#ifdef __cplusplus
14722extern "C"
14723#endif
14724char pthread_kill ();
14725int
14726main ()
14727{
14728return pthread_kill ();
14729 ;
14730 return 0;
14731}
14732_ACEOF
14733if ac_fn_c_try_link "$LINENO"; then :
14734 ac_cv_lib_c_r_pthread_kill=yes
14735else
14736 ac_cv_lib_c_r_pthread_kill=no
14737fi
14738rm -f core conftest.err conftest.$ac_objext \
14739 conftest$ac_exeext conftest.$ac_ext
14740LIBS=$ac_check_lib_save_LIBS
14741fi
14742{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14743$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14744if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14745 gl_pthread_api=yes
14746 LIBPTHREAD=-lc_r
14747 LIBPMULTITHREAD=-lc_r
14748fi
14749
14750 fi
14751 fi
14752 fi
14753 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14754$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14755 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14756$as_echo "$gl_pthread_api" >&6; }
14757
14758
14759 if test $gl_pthread_api = yes; then
14760
14761$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
14762
14763 fi
14764
14765 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14766/* end confdefs.h. */
14767#include <sched.h>
14768int
14769main ()
14770{
14771sched_yield ();
14772 ;
14773 return 0;
14774}
14775_ACEOF
14776if ac_fn_c_try_link "$LINENO"; then :
14777 LIB_SCHED_YIELD=
14778
14779else
14780 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14781$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14782if ${ac_cv_lib_rt_sched_yield+:} false; then :
14783 $as_echo_n "(cached) " >&6
14784else
14785 ac_check_lib_save_LIBS=$LIBS
14786LIBS="-lrt $LIBS"
c0c3707f 14787cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14788/* end confdefs.h. */
6ec2e0f5 14789
c0c3707f
CB
14790/* Override any GCC internal prototype to avoid an error.
14791 Use char because int might match the return type of a GCC
14792 builtin and then its argument prototype would still apply. */
14793#ifdef __cplusplus
14794extern "C"
14795#endif
5df4cba6 14796char sched_yield ();
c0c3707f
CB
14797int
14798main ()
14799{
5df4cba6 14800return sched_yield ();
c0c3707f
CB
14801 ;
14802 return 0;
14803}
6ec2e0f5 14804_ACEOF
c0c3707f 14805if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14806 ac_cv_lib_rt_sched_yield=yes
6ec2e0f5 14807else
5df4cba6 14808 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14809fi
c0c3707f
CB
14810rm -f core conftest.err conftest.$ac_objext \
14811 conftest$ac_exeext conftest.$ac_ext
14812LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14813fi
5df4cba6
SM
14814{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14815$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14816if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14817 LIB_SCHED_YIELD=-lrt
14818else
14819 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14820$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14821if ${ac_cv_lib_posix4_sched_yield+:} false; then :
6ec2e0f5
SDJ
14822 $as_echo_n "(cached) " >&6
14823else
c0c3707f 14824 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14825LIBS="-lposix4 $LIBS"
c0c3707f 14826cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
14827/* end confdefs.h. */
14828
c0c3707f
CB
14829/* Override any GCC internal prototype to avoid an error.
14830 Use char because int might match the return type of a GCC
14831 builtin and then its argument prototype would still apply. */
14832#ifdef __cplusplus
14833extern "C"
14834#endif
5df4cba6 14835char sched_yield ();
6ec2e0f5
SDJ
14836int
14837main ()
14838{
5df4cba6 14839return sched_yield ();
c0c3707f
CB
14840 ;
14841 return 0;
14842}
14843_ACEOF
14844if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14845 ac_cv_lib_posix4_sched_yield=yes
c0c3707f 14846else
5df4cba6 14847 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14848fi
14849rm -f core conftest.err conftest.$ac_objext \
14850 conftest$ac_exeext conftest.$ac_ext
14851LIBS=$ac_check_lib_save_LIBS
14852fi
5df4cba6
SM
14853{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14854$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14855if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14856 LIB_SCHED_YIELD=-lposix4
c0c3707f 14857fi
6ec2e0f5 14858
5df4cba6
SM
14859fi
14860
14861
14862fi
14863rm -f core conftest.err conftest.$ac_objext \
14864 conftest$ac_exeext conftest.$ac_ext
14865
14866
14867 gl_pthreadlib_body_done=done
14868 fi
14869
14870 if test $ac_cv_header_threads_h = yes; then
14871 for ac_func in thrd_create
14872do :
14873 ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create"
14874if test "x$ac_cv_func_thrd_create" = xyes; then :
14875 cat >>confdefs.h <<_ACEOF
14876#define HAVE_THRD_CREATE 1
14877_ACEOF
14878
14879fi
14880done
14881
14882 if test $ac_cv_func_thrd_create = yes; then
14883 LIBSTDTHREAD=
14884 else
14885 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5
14886$as_echo_n "checking for thrd_create in -lstdthreads... " >&6; }
14887if ${ac_cv_lib_stdthreads_thrd_create+:} false; then :
c0c3707f
CB
14888 $as_echo_n "(cached) " >&6
14889else
14890 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14891LIBS="-lstdthreads $LIBS"
c0c3707f
CB
14892cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14893/* end confdefs.h. */
6ec2e0f5 14894
c0c3707f
CB
14895/* Override any GCC internal prototype to avoid an error.
14896 Use char because int might match the return type of a GCC
14897 builtin and then its argument prototype would still apply. */
14898#ifdef __cplusplus
14899extern "C"
14900#endif
5df4cba6 14901char thrd_create ();
c0c3707f
CB
14902int
14903main ()
14904{
5df4cba6 14905return thrd_create ();
6ec2e0f5
SDJ
14906 ;
14907 return 0;
14908}
14909_ACEOF
c0c3707f 14910if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14911 ac_cv_lib_stdthreads_thrd_create=yes
6ec2e0f5 14912else
5df4cba6 14913 ac_cv_lib_stdthreads_thrd_create=no
6ec2e0f5 14914fi
c0c3707f
CB
14915rm -f core conftest.err conftest.$ac_objext \
14916 conftest$ac_exeext conftest.$ac_ext
14917LIBS=$ac_check_lib_save_LIBS
14918fi
5df4cba6
SM
14919{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5
14920$as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; }
14921if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then :
6ec2e0f5 14922
5df4cba6 14923 LIBSTDTHREAD='-lstdthreads -lpthread'
6ec2e0f5 14924
5df4cba6 14925else
6ec2e0f5 14926
5df4cba6 14927 LIBSTDTHREAD="$LIBPMULTITHREAD"
6ec2e0f5 14928
5df4cba6 14929fi
6ec2e0f5 14930
5df4cba6 14931 fi
c0c3707f 14932 else
5df4cba6
SM
14933 LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
14934 fi
14935 ;;
14936 esac
c0c3707f 14937
c0c3707f 14938
5df4cba6
SM
14939 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5
14940$as_echo_n "checking whether ISO C threads API is available... " >&6; }
14941 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5
14942$as_echo "$ac_cv_header_threads_h" >&6; }
14943 gl_stdthreadlib_body_done=done
14944 fi
c0c3707f 14945
5df4cba6
SM
14946 LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
14947 LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
c0c3707f
CB
14948 gl_threads_api=isoc
14949
14950$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
14951
14952 fi
14953 fi
14954 if test $gl_threads_api = none; then
14955 case "$gl_use_threads" in
14956 yes | windows | win32) # The 'win32' is for backward compatibility.
14957 if { case "$host_os" in
14958 mingw*) true;;
14959 *) false;;
14960 esac
14961 }; then
14962 gl_threads_api=windows
14963
14964$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
14965
14966 fi
14967 ;;
14968 esac
14969 fi
14970 fi
14971 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
14972$as_echo_n "checking for multithread API to use... " >&6; }
14973 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
14974$as_echo "$gl_threads_api" >&6; }
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
14988$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
14989if ${gl_cv_func_malloc_posix+:} false; then :
6ec2e0f5
SDJ
14990 $as_echo_n "(cached) " >&6
14991else
c0c3707f
CB
14992
14993 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14994/* end confdefs.h. */
c0c3707f 14995
6ec2e0f5
SDJ
14996int
14997main ()
14998{
c0c3707f
CB
14999#if defined _WIN32 && ! defined __CYGWIN__
15000 choke me
15001 #endif
6ec2e0f5
SDJ
15002
15003 ;
15004 return 0;
15005}
15006_ACEOF
15007if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 15008 gl_cv_func_malloc_posix=yes
6ec2e0f5 15009else
c0c3707f 15010 gl_cv_func_malloc_posix=no
6ec2e0f5
SDJ
15011fi
15012rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
472fa5ee 15013
c0c3707f
CB
15014fi
15015{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
15016$as_echo "$gl_cv_func_malloc_posix" >&6; }
472fa5ee
SM
15017
15018
6ec2e0f5 15019
9c9d63b1 15020 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
c0c3707f
CB
15021$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
15022if ${ac_cv_func_malloc_0_nonnull+:} false; then :
6ec2e0f5
SDJ
15023 $as_echo_n "(cached) " >&6
15024else
15025 if test "$cross_compiling" = yes; then :
15026 case "$host_os" in
c0c3707f
CB
15027 # Guess yes on platforms where we know the result.
15028 *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
15029 | hpux* | solaris* | cygwin* | mingw*)
15030 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
15031 # If we don't know, obey --enable-cross-guesses.
15032 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
15033 esac
6ec2e0f5
SDJ
15034
15035else
15036 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15037/* end confdefs.h. */
9c9d63b1 15038#include <stdlib.h>
6ec2e0f5
SDJ
15039
15040int
15041main ()
15042{
c0c3707f
CB
15043char *p = malloc (0);
15044 int result = !p;
15045 free (p);
15046 return result;
6ec2e0f5
SDJ
15047 ;
15048 return 0;
698be2d8
CB
15049}
15050
15051_ACEOF
15052if ac_fn_c_try_run "$LINENO"; then :
15053 ac_cv_func_malloc_0_nonnull=yes
15054else
15055 ac_cv_func_malloc_0_nonnull=no
15056fi
15057rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15058 conftest.$ac_objext conftest.beam conftest.$ac_ext
15059fi
15060
15061
15062fi
15063{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
15064$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
15065 case "$ac_cv_func_malloc_0_nonnull" in
15066 *yes)
15067 gl_cv_func_malloc_0_nonnull=1
15068 ;;
15069 *)
15070 gl_cv_func_malloc_0_nonnull=0
15071 ;;
15072 esac
15073
15074
15075cat >>confdefs.h <<_ACEOF
15076#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
15077_ACEOF
15078
15079
15080
c0c3707f
CB
15081
15082
6ec2e0f5
SDJ
15083
15084
15085
15086
15087
15088
c0c3707f
CB
15089 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
15090$as_echo_n "checking for a traditional japanese locale... " >&6; }
15091if ${gt_cv_locale_ja+:} false; then :
15092 $as_echo_n "(cached) " >&6
15093else
15094
15095 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15096/* end confdefs.h. */
6ec2e0f5 15097
c0c3707f
CB
15098#include <locale.h>
15099#include <time.h>
15100#if HAVE_LANGINFO_CODESET
15101# include <langinfo.h>
15102#endif
15103#include <stdlib.h>
15104#include <string.h>
15105struct tm t;
15106char buf[16];
15107int main ()
15108{
15109 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15110 imitates locale dependent behaviour by looking at the environment
15111 variables, and all locales use the UTF-8 encoding. */
15112#if defined __BEOS__ || defined __HAIKU__
15113 return 1;
15114#else
15115 /* Check whether the given locale name is recognized by the system. */
15116# if defined _WIN32 && !defined __CYGWIN__
15117 /* On native Windows, setlocale(category, "") looks at the system settings,
15118 not at the environment variables. Also, when an encoding suffix such
15119 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15120 category of the locale to "C". */
15121 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15122 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15123 return 1;
15124# else
15125 if (setlocale (LC_ALL, "") == NULL) return 1;
15126# endif
15127 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15128 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15129 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15130 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15131 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15132 some unit tests fail.
15133 On MirBSD 10, when an unsupported locale is specified, setlocale()
15134 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
15135# if HAVE_LANGINFO_CODESET
15136 {
15137 const char *cs = nl_langinfo (CODESET);
15138 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15139 || strcmp (cs, "UTF-8") == 0)
15140 return 1;
15141 }
15142# endif
15143# ifdef __CYGWIN__
15144 /* On Cygwin, avoid locale names without encoding suffix, because the
15145 locale_charset() function relies on the encoding suffix. Note that
15146 LC_ALL is set on the command line. */
15147 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15148# endif
15149 /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
15150 on Cygwin 1.5.x. */
15151 if (MB_CUR_MAX == 1)
15152 return 1;
15153 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
15154 This excludes the UTF-8 encoding (except on MirBSD). */
15155 {
15156 const char *p;
15157 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15158 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
15159 for (p = buf; *p != '\0'; p++)
15160 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
15161 return 1;
15162 }
15163 return 0;
15164#endif
15165}
6ec2e0f5 15166
c0c3707f
CB
15167_ACEOF
15168 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15169 (eval $ac_link) 2>&5
15170 ac_status=$?
15171 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15172 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15173 case "$host_os" in
15174 # Handle native Windows specially, because there setlocale() interprets
15175 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15176 # "fr" or "fra" as "French" or "French_France.1252",
15177 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15178 # "ja" as "Japanese" or "Japanese_Japan.932",
15179 # and similar.
15180 mingw*)
15181 # Note that on native Windows, the Japanese locale is
15182 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
15183 # cannot use it here.
15184 gt_cv_locale_ja=none
15185 ;;
15186 *)
15187 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15188 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15189 # configure script would override the LC_ALL setting. Likewise for
15190 # LC_CTYPE, which is also set at the beginning of the configure script.
15191 # Test for the AIX locale name.
15192 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15193 gt_cv_locale_ja=ja_JP
15194 else
15195 # Test for the locale name with explicit encoding suffix.
15196 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15197 gt_cv_locale_ja=ja_JP.EUC-JP
15198 else
15199 # Test for the HP-UX, OSF/1, NetBSD locale name.
15200 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15201 gt_cv_locale_ja=ja_JP.eucJP
15202 else
15203 # Test for the IRIX, FreeBSD locale name.
15204 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15205 gt_cv_locale_ja=ja_JP.EUC
15206 else
15207 # Test for the Solaris 7 locale name.
15208 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15209 gt_cv_locale_ja=ja
15210 else
15211 # Special test for NetBSD 1.6.
15212 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
15213 gt_cv_locale_ja=ja_JP.eucJP
15214 else
15215 # None found.
15216 gt_cv_locale_ja=none
15217 fi
15218 fi
15219 fi
15220 fi
15221 fi
15222 fi
15223 ;;
15224 esac
15225 fi
15226 rm -fr conftest*
5abebf3c
CB
15227
15228fi
c0c3707f
CB
15229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
15230$as_echo "$gt_cv_locale_ja" >&6; }
15231 LOCALE_JA=$gt_cv_locale_ja
5abebf3c 15232
5abebf3c 15233
5abebf3c 15234
5abebf3c 15235
c0c3707f
CB
15236 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
15237$as_echo_n "checking for a french Unicode locale... " >&6; }
15238if ${gt_cv_locale_fr_utf8+:} false; then :
5abebf3c
CB
15239 $as_echo_n "(cached) " >&6
15240else
5abebf3c 15241
c0c3707f 15242 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 15243/* end confdefs.h. */
5abebf3c 15244
c0c3707f
CB
15245#include <locale.h>
15246#include <time.h>
15247#if HAVE_LANGINFO_CODESET
15248# include <langinfo.h>
15249#endif
15250#include <stdlib.h>
15251#include <string.h>
15252struct tm t;
15253char buf[16];
15254int main () {
15255 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15256 imitates locale dependent behaviour by looking at the environment
15257 variables, and all locales use the UTF-8 encoding. */
15258#if !(defined __BEOS__ || defined __HAIKU__)
15259 /* Check whether the given locale name is recognized by the system. */
15260# if defined _WIN32 && !defined __CYGWIN__
15261 /* On native Windows, setlocale(category, "") looks at the system settings,
15262 not at the environment variables. Also, when an encoding suffix such
15263 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15264 category of the locale to "C". */
15265 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15266 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15267 return 1;
15268# else
15269 if (setlocale (LC_ALL, "") == NULL) return 1;
15270# endif
15271 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15272 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15273 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15274 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15275 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15276 some unit tests fail. */
15277# if HAVE_LANGINFO_CODESET
15278 {
15279 const char *cs = nl_langinfo (CODESET);
15280 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
15281 return 1;
15282 }
15283# endif
15284# ifdef __CYGWIN__
15285 /* On Cygwin, avoid locale names without encoding suffix, because the
15286 locale_charset() function relies on the encoding suffix. Note that
15287 LC_ALL is set on the command line. */
15288 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15289# endif
15290 /* Check whether in the abbreviation of the second month, the second
15291 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
15292 two bytes long, with UTF-8 encoding. */
15293 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15294 if (strftime (buf, sizeof (buf), "%b", &t) < 4
15295 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
15296 return 1;
15297#endif
15298#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
15299 /* Check whether the decimal separator is a comma.
15300 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
15301 are nl_langinfo(RADIXCHAR) are both ".". */
15302 if (localeconv () ->decimal_point[0] != ',') return 1;
15303#endif
5abebf3c
CB
15304 return 0;
15305}
5abebf3c 15306
c0c3707f
CB
15307_ACEOF
15308 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15309 (eval $ac_link) 2>&5
15310 ac_status=$?
15311 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15312 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15313 case "$host_os" in
15314 # Handle native Windows specially, because there setlocale() interprets
15315 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15316 # "fr" or "fra" as "French" or "French_France.1252",
15317 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15318 # "ja" as "Japanese" or "Japanese_Japan.932",
15319 # and similar.
15320 mingw*)
15321 # Test for the hypothetical native Windows locale name.
15322 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15323 gt_cv_locale_fr_utf8=French_France.65001
15324 else
15325 # None found.
15326 gt_cv_locale_fr_utf8=none
15327 fi
15328 ;;
15329 *)
15330 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15331 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15332 # configure script would override the LC_ALL setting. Likewise for
15333 # LC_CTYPE, which is also set at the beginning of the configure script.
15334 # Test for the usual locale name.
15335 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15336 gt_cv_locale_fr_utf8=fr_FR
15337 else
15338 # Test for the locale name with explicit encoding suffix.
15339 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15340 gt_cv_locale_fr_utf8=fr_FR.UTF-8
15341 else
15342 # Test for the Solaris 7 locale name.
15343 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15344 gt_cv_locale_fr_utf8=fr.UTF-8
15345 else
15346 # None found.
15347 gt_cv_locale_fr_utf8=none
15348 fi
15349 fi
15350 fi
15351 ;;
15352 esac
15353 fi
15354 rm -fr conftest*
5abebf3c
CB
15355
15356fi
c0c3707f
CB
15357{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
15358$as_echo "$gt_cv_locale_fr_utf8" >&6; }
15359 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
5abebf3c
CB
15360
15361
15362
15363
15364
c0c3707f
CB
15365 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
15366$as_echo_n "checking for a transitional chinese locale... " >&6; }
15367if ${gt_cv_locale_zh_CN+:} false; then :
5abebf3c
CB
15368 $as_echo_n "(cached) " >&6
15369else
5abebf3c 15370
c0c3707f 15371 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 15372/* end confdefs.h. */
5abebf3c 15373
c0c3707f
CB
15374#include <locale.h>
15375#include <stdlib.h>
15376#include <time.h>
15377#if HAVE_LANGINFO_CODESET
15378# include <langinfo.h>
15379#endif
15380#include <stdlib.h>
15381#include <string.h>
15382struct tm t;
15383char buf[16];
15384int main ()
5abebf3c 15385{
c0c3707f
CB
15386 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15387 imitates locale dependent behaviour by looking at the environment
15388 variables, and all locales use the UTF-8 encoding. */
15389#if defined __BEOS__ || defined __HAIKU__
15390 return 1;
15391#else
15392 /* Check whether the given locale name is recognized by the system. */
15393# if defined _WIN32 && !defined __CYGWIN__
15394 /* On native Windows, setlocale(category, "") looks at the system settings,
15395 not at the environment variables. Also, when an encoding suffix such
15396 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15397 category of the locale to "C". */
15398 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15399 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15400 return 1;
15401# else
15402 if (setlocale (LC_ALL, "") == NULL) return 1;
15403# endif
15404 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15405 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15406 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15407 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15408 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15409 some unit tests fail.
15410 On MirBSD 10, when an unsupported locale is specified, setlocale()
15411 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
15412# if HAVE_LANGINFO_CODESET
15413 {
15414 const char *cs = nl_langinfo (CODESET);
15415 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15416 || strcmp (cs, "UTF-8") == 0)
15417 return 1;
15418 }
15419# endif
15420# ifdef __CYGWIN__
15421 /* On Cygwin, avoid locale names without encoding suffix, because the
15422 locale_charset() function relies on the encoding suffix. Note that
15423 LC_ALL is set on the command line. */
15424 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15425# endif
15426 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
15427 This excludes the UTF-8 encoding (except on MirBSD). */
15428 {
15429 const char *p;
15430 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15431 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
15432 for (p = buf; *p != '\0'; p++)
15433 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
15434 return 1;
15435 }
15436 /* Check whether a typical GB18030 multibyte sequence is recognized as a
15437 single wide character. This excludes the GB2312 and GBK encodings. */
15438 if (mblen ("\203\062\332\066", 5) != 4)
15439 return 1;
5abebf3c 15440 return 0;
c0c3707f 15441#endif
5abebf3c 15442}
c0c3707f 15443
5abebf3c 15444_ACEOF
c0c3707f
CB
15445 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15446 (eval $ac_link) 2>&5
15447 ac_status=$?
15448 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15449 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15450 case "$host_os" in
15451 # Handle native Windows specially, because there setlocale() interprets
15452 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15453 # "fr" or "fra" as "French" or "French_France.1252",
15454 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15455 # "ja" as "Japanese" or "Japanese_Japan.932",
15456 # and similar.
15457 mingw*)
15458 # Test for the hypothetical native Windows locale name.
15459 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15460 gt_cv_locale_zh_CN=Chinese_China.54936
15461 else
15462 # None found.
15463 gt_cv_locale_zh_CN=none
15464 fi
15465 ;;
15466 solaris2.8)
15467 # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
15468 # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
15469 # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
15470 gt_cv_locale_zh_CN=none
15471 ;;
15472 *)
15473 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15474 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15475 # configure script would override the LC_ALL setting. Likewise for
15476 # LC_CTYPE, which is also set at the beginning of the configure script.
15477 # Test for the locale name without encoding suffix.
15478 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15479 gt_cv_locale_zh_CN=zh_CN
15480 else
15481 # Test for the locale name with explicit encoding suffix.
15482 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15483 gt_cv_locale_zh_CN=zh_CN.GB18030
15484 else
15485 # None found.
15486 gt_cv_locale_zh_CN=none
15487 fi
15488 fi
15489 ;;
15490 esac
15491 else
15492 # If there was a link error, due to mblen(), the system is so old that
15493 # it certainly doesn't have a chinese locale.
15494 gt_cv_locale_zh_CN=none
15495 fi
15496 rm -fr conftest*
15497
5abebf3c 15498fi
c0c3707f
CB
15499{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
15500$as_echo "$gt_cv_locale_zh_CN" >&6; }
15501 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
15502
15503
15504{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
15505$as_echo_n "checking for inline... " >&6; }
15506if ${ac_cv_c_inline+:} false; then :
15507 $as_echo_n "(cached) " >&6
15508else
15509 ac_cv_c_inline=no
15510for ac_kw in inline __inline__ __inline; do
15511 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15512/* end confdefs.h. */
15513#ifndef __cplusplus
15514typedef int foo_t;
15515static $ac_kw foo_t static_foo () {return 0; }
15516$ac_kw foo_t foo () {return 0; }
15517#endif
5abebf3c 15518
c0c3707f
CB
15519_ACEOF
15520if ac_fn_c_try_compile "$LINENO"; then :
15521 ac_cv_c_inline=$ac_kw
15522fi
15523rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15524 test "$ac_cv_c_inline" != no && break
15525done
5abebf3c
CB
15526
15527fi
c0c3707f
CB
15528{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
15529$as_echo "$ac_cv_c_inline" >&6; }
5abebf3c 15530
c0c3707f
CB
15531case $ac_cv_c_inline in
15532 inline | yes) ;;
15533 *)
15534 case $ac_cv_c_inline in
15535 no) ac_val=;;
15536 *) ac_val=$ac_cv_c_inline;;
15537 esac
15538 cat >>confdefs.h <<_ACEOF
15539#ifndef __cplusplus
15540#define inline $ac_val
15541#endif
15542_ACEOF
15543 ;;
15544esac
5abebf3c
CB
15545
15546
15547
15548
5abebf3c
CB
15549
15550
c0c3707f
CB
15551 GNULIB_EXPLICIT_BZERO=0;
15552 GNULIB_FFSL=0;
15553 GNULIB_FFSLL=0;
15554 GNULIB_MEMCHR=0;
15555 GNULIB_MEMMEM=0;
15556 GNULIB_MEMPCPY=0;
15557 GNULIB_MEMRCHR=0;
15558 GNULIB_RAWMEMCHR=0;
15559 GNULIB_STPCPY=0;
15560 GNULIB_STPNCPY=0;
15561 GNULIB_STRCHRNUL=0;
15562 GNULIB_STRDUP=0;
15563 GNULIB_STRNCAT=0;
15564 GNULIB_STRNDUP=0;
15565 GNULIB_STRNLEN=0;
15566 GNULIB_STRPBRK=0;
15567 GNULIB_STRSEP=0;
15568 GNULIB_STRSTR=0;
15569 GNULIB_STRCASESTR=0;
15570 GNULIB_STRTOK_R=0;
15571 GNULIB_MBSLEN=0;
15572 GNULIB_MBSNLEN=0;
15573 GNULIB_MBSCHR=0;
15574 GNULIB_MBSRCHR=0;
15575 GNULIB_MBSSTR=0;
15576 GNULIB_MBSCASECMP=0;
15577 GNULIB_MBSNCASECMP=0;
15578 GNULIB_MBSPCASECMP=0;
15579 GNULIB_MBSCASESTR=0;
15580 GNULIB_MBSCSPN=0;
15581 GNULIB_MBSPBRK=0;
15582 GNULIB_MBSSPN=0;
15583 GNULIB_MBSSEP=0;
15584 GNULIB_MBSTOK_R=0;
15585 GNULIB_STRERROR=0;
15586 GNULIB_STRERROR_R=0;
9c9d63b1
PM
15587 GNULIB_STRERRORNAME_NP=0;
15588 GNULIB_SIGABBREV_NP=0;
15589 GNULIB_SIGDESCR_NP=0;
c0c3707f
CB
15590 GNULIB_STRSIGNAL=0;
15591 GNULIB_STRVERSCMP=0;
15592 HAVE_MBSLEN=0;
9c9d63b1
PM
15593 GNULIB_MDA_MEMCCPY=1;
15594 GNULIB_MDA_STRDUP=1;
c0c3707f
CB
15595 HAVE_EXPLICIT_BZERO=1;
15596 HAVE_FFSL=1;
15597 HAVE_FFSLL=1;
c0c3707f
CB
15598 HAVE_DECL_MEMMEM=1;
15599 HAVE_MEMPCPY=1;
15600 HAVE_DECL_MEMRCHR=1;
15601 HAVE_RAWMEMCHR=1;
15602 HAVE_STPCPY=1;
15603 HAVE_STPNCPY=1;
15604 HAVE_STRCHRNUL=1;
15605 HAVE_DECL_STRDUP=1;
15606 HAVE_DECL_STRNDUP=1;
15607 HAVE_DECL_STRNLEN=1;
15608 HAVE_STRPBRK=1;
15609 HAVE_STRSEP=1;
15610 HAVE_STRCASESTR=1;
15611 HAVE_DECL_STRTOK_R=1;
15612 HAVE_DECL_STRERROR_R=1;
9c9d63b1
PM
15613 HAVE_STRERRORNAME_NP=1;
15614 HAVE_SIGABBREV_NP=1;
15615 HAVE_SIGDESCR_NP=1;
c0c3707f
CB
15616 HAVE_DECL_STRSIGNAL=1;
15617 HAVE_STRVERSCMP=1;
9c9d63b1 15618 REPLACE_FFSLL=0;
c0c3707f
CB
15619 REPLACE_MEMCHR=0;
15620 REPLACE_MEMMEM=0;
15621 REPLACE_STPNCPY=0;
15622 REPLACE_STRCHRNUL=0;
15623 REPLACE_STRDUP=0;
15624 REPLACE_STRNCAT=0;
15625 REPLACE_STRNDUP=0;
15626 REPLACE_STRNLEN=0;
15627 REPLACE_STRSTR=0;
15628 REPLACE_STRCASESTR=0;
15629 REPLACE_STRTOK_R=0;
15630 REPLACE_STRERROR=0;
15631 REPLACE_STRERROR_R=0;
9c9d63b1 15632 REPLACE_STRERRORNAME_NP=0;
c0c3707f
CB
15633 REPLACE_STRSIGNAL=0;
15634 UNDEFINE_STRTOK_R=0;
5abebf3c
CB
15635
15636
15637
15638
6ec2e0f5
SDJ
15639
15640
c0c3707f
CB
15641 # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
15642 # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
15643 # irrelevant for anonymous mappings.
15644 ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
15645if test "x$ac_cv_func_mmap" = xyes; then :
15646 gl_have_mmap=yes
6ec2e0f5 15647else
c0c3707f
CB
15648 gl_have_mmap=no
15649fi
6ec2e0f5
SDJ
15650
15651
c0c3707f
CB
15652 # Try to allow MAP_ANONYMOUS.
15653 gl_have_mmap_anonymous=no
15654 if test $gl_have_mmap = yes; then
15655 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
15656$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
15657 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15658/* end confdefs.h. */
6ec2e0f5 15659
c0c3707f
CB
15660#include <sys/mman.h>
15661#ifdef MAP_ANONYMOUS
15662 I cannot identify this map
15663#endif
6ec2e0f5 15664
c0c3707f
CB
15665_ACEOF
15666if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15667 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
15668 gl_have_mmap_anonymous=yes
6ec2e0f5 15669fi
c0c3707f 15670rm -f conftest*
6ec2e0f5 15671
c0c3707f
CB
15672 if test $gl_have_mmap_anonymous != yes; then
15673 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15674/* end confdefs.h. */
6ec2e0f5 15675
c0c3707f
CB
15676#include <sys/mman.h>
15677#ifdef MAP_ANON
15678 I cannot identify this map
15679#endif
6ec2e0f5 15680
c0c3707f
CB
15681_ACEOF
15682if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15683 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
6ec2e0f5 15684
c0c3707f 15685$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
5e8754f9 15686
c0c3707f 15687 gl_have_mmap_anonymous=yes
5e8754f9 15688fi
c0c3707f
CB
15689rm -f conftest*
15690
15691 fi
15692 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
15693$as_echo "$gl_have_mmap_anonymous" >&6; }
15694 if test $gl_have_mmap_anonymous = yes; then
6ec2e0f5 15695
c0c3707f 15696$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
6ec2e0f5 15697
c0c3707f
CB
15698 fi
15699 fi
6ec2e0f5
SDJ
15700
15701
15702
15703
6ec2e0f5 15704
9c9d63b1
PM
15705 # Detect platform-specific bugs in some versions of glibc:
15706 # memchr should not dereference anything with length 0
15707 # https://bugzilla.redhat.com/show_bug.cgi?id=499689
15708 # memchr should not dereference overestimated length after a match
15709 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
15710 # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
15711 # memchr should cast the second argument to 'unsigned char'.
15712 # This bug exists in Android 4.3.
15713 # Assume that memchr works on platforms that lack mprotect.
15714 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
c0c3707f
CB
15715$as_echo_n "checking whether memchr works... " >&6; }
15716if ${gl_cv_func_memchr_works+:} false; then :
15717 $as_echo_n "(cached) " >&6
6ec2e0f5 15718else
c0c3707f
CB
15719 if test "$cross_compiling" = yes; then :
15720 case "$host_os" in
9c9d63b1
PM
15721 # Guess no on Android.
15722 linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
15723 # Guess yes on native Windows.
15724 mingw*) gl_cv_func_memchr_works="guessing yes" ;;
15725 # If we don't know, obey --enable-cross-guesses.
15726 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
15727 esac
6ec2e0f5
SDJ
15728
15729else
15730 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15731/* end confdefs.h. */
15732
c0c3707f
CB
15733#include <string.h>
15734#if HAVE_SYS_MMAN_H
15735# include <fcntl.h>
15736# include <unistd.h>
15737# include <sys/types.h>
15738# include <sys/mman.h>
15739# ifndef MAP_FILE
15740# define MAP_FILE 0
15741# endif
15742#endif
6ec2e0f5
SDJ
15743
15744int
15745main ()
15746{
c0c3707f
CB
15747
15748 int result = 0;
15749 char *fence = NULL;
15750#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
15751# if HAVE_MAP_ANONYMOUS
15752 const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
15753 const int fd = -1;
15754# else /* !HAVE_MAP_ANONYMOUS */
15755 const int flags = MAP_FILE | MAP_PRIVATE;
15756 int fd = open ("/dev/zero", O_RDONLY, 0666);
15757 if (fd >= 0)
15758# endif
15759 {
15760 int pagesize = getpagesize ();
15761 char *two_pages =
15762 (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
15763 flags, fd, 0);
15764 if (two_pages != (char *)(-1)
15765 && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
15766 fence = two_pages + pagesize;
15767 }
15768#endif
15769 if (fence)
15770 {
9c9d63b1 15771 /* Test against bugs on glibc systems. */
c0c3707f
CB
15772 if (memchr (fence, 0, 0))
15773 result |= 1;
15774 strcpy (fence - 9, "12345678");
15775 if (memchr (fence - 9, 0, 79) != fence - 1)
15776 result |= 2;
15777 if (memchr (fence - 1, 0, 3) != fence - 1)
15778 result |= 4;
9c9d63b1
PM
15779 /* Test against bug on AIX 7.2. */
15780 if (memchr (fence - 4, '6', 16) != fence - 4)
15781 result |= 8;
c0c3707f
CB
15782 }
15783 /* Test against bug on Android 4.3. */
15784 {
15785 char input[3];
15786 input[0] = 'a';
15787 input[1] = 'b';
15788 input[2] = 'c';
15789 if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
9c9d63b1 15790 result |= 16;
c0c3707f
CB
15791 }
15792 return result;
6ec2e0f5
SDJ
15793
15794 ;
15795 return 0;
15796}
15797_ACEOF
15798if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 15799 gl_cv_func_memchr_works=yes
6ec2e0f5 15800else
c0c3707f 15801 gl_cv_func_memchr_works=no
6ec2e0f5
SDJ
15802fi
15803rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15804 conftest.$ac_objext conftest.beam conftest.$ac_ext
15805fi
15806
15807
15808fi
c0c3707f
CB
15809{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
15810$as_echo "$gl_cv_func_memchr_works" >&6; }
9c9d63b1
PM
15811 case "$gl_cv_func_memchr_works" in
15812 *yes) ;;
15813 *) REPLACE_MEMCHR=1 ;;
15814 esac
6ec2e0f5 15815
c0c3707f
CB
15816ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default"
15817if test "x$ac_cv_have_decl_memmem" = xyes; then :
6ec2e0f5
SDJ
15818 ac_have_decl=1
15819else
15820 ac_have_decl=0
15821fi
15822
15823cat >>confdefs.h <<_ACEOF
c0c3707f 15824#define HAVE_DECL_MEMMEM $ac_have_decl
6ec2e0f5
SDJ
15825_ACEOF
15826
472fa5ee 15827
6ec2e0f5
SDJ
15828
15829
15830
c0c3707f
CB
15831 for ac_func in memmem
15832do :
15833 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
15834if test "x$ac_cv_func_memmem" = xyes; then :
15835 cat >>confdefs.h <<_ACEOF
15836#define HAVE_MEMMEM 1
15837_ACEOF
6ec2e0f5 15838
c0c3707f
CB
15839fi
15840done
6ec2e0f5 15841
c0c3707f
CB
15842 if test $ac_cv_func_memmem = yes; then
15843 HAVE_MEMMEM=1
15844 else
15845 HAVE_MEMMEM=0
15846 fi
6ec2e0f5 15847
c0c3707f
CB
15848 if test $ac_cv_have_decl_memmem = no; then
15849 HAVE_DECL_MEMMEM=0
15850 else
15851 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
15852$as_echo_n "checking whether memmem works... " >&6; }
15853if ${gl_cv_func_memmem_works_always+:} false; then :
6ec2e0f5
SDJ
15854 $as_echo_n "(cached) " >&6
15855else
c0c3707f
CB
15856 if test "$cross_compiling" = yes; then :
15857 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15858/* end confdefs.h. */
472fa5ee 15859
c0c3707f
CB
15860#ifdef __GNU_LIBRARY__
15861 #include <features.h>
15862 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
15863 || __GLIBC_MINOR__ > 12)) \
15864 || (__GLIBC__ > 2)) \
15865 || defined __UCLIBC__
15866 Lucky user
15867 #endif
15868#elif defined __CYGWIN__
15869 #include <cygwin/version.h>
15870 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
15871 Lucky user
15872 #endif
15873#else
15874 Lucky user
15875#endif
472fa5ee 15876
c0c3707f
CB
15877_ACEOF
15878if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15879 $EGREP "Lucky user" >/dev/null 2>&1; then :
15880 gl_cv_func_memmem_works_always="guessing yes"
15881else
15882 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
15883fi
15884rm -f conftest*
472fa5ee
SM
15885
15886
6ec2e0f5
SDJ
15887else
15888 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15889/* end confdefs.h. */
c0c3707f
CB
15890
15891#include <string.h> /* for memmem */
15892#define P "_EF_BF_BD"
15893#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
15894#define NEEDLE P P P P P
6ec2e0f5
SDJ
15895
15896int
15897main ()
15898{
c0c3707f 15899
698be2d8
CB
15900 int result = 0;
15901 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
15902 result |= 1;
15903 /* Check for empty needle behavior. */
15904 {
15905 const char *haystack = "AAA";
15906 if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
15907 result |= 2;
15908 }
15909 return result;
15910
15911 ;
15912 return 0;
15913}
15914_ACEOF
15915if ac_fn_c_try_run "$LINENO"; then :
15916 gl_cv_func_memmem_works_always=yes
15917else
15918 gl_cv_func_memmem_works_always=no
15919fi
15920rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15921 conftest.$ac_objext conftest.beam conftest.$ac_ext
15922fi
15923
15924
15925fi
15926{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
15927$as_echo "$gl_cv_func_memmem_works_always" >&6; }
15928 case "$gl_cv_func_memmem_works_always" in
15929 *yes) ;;
15930 *)
15931 REPLACE_MEMMEM=1
15932 ;;
15933 esac
15934 fi
15935 :
15936
15937ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
15938if test "x$ac_cv_have_decl_memrchr" = xyes; then :
15939 ac_have_decl=1
15940else
15941 ac_have_decl=0
15942fi
15943
15944cat >>confdefs.h <<_ACEOF
15945#define HAVE_DECL_MEMRCHR $ac_have_decl
15946_ACEOF
15947
15948
15949
15950
15951
15952 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5
15953$as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; }
15954if ${gl_cv_minmax_in_limits_h+:} false; then :
15955 $as_echo_n "(cached) " >&6
15956else
15957 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15958/* end confdefs.h. */
15959#include <limits.h>
15960 int x = MIN (42, 17);
15961int
15962main ()
15963{
15964
15965 ;
15966 return 0;
15967}
15968_ACEOF
15969if ac_fn_c_try_compile "$LINENO"; then :
15970 gl_cv_minmax_in_limits_h=yes
15971else
15972 gl_cv_minmax_in_limits_h=no
15973fi
15974rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15975fi
15976{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5
15977$as_echo "$gl_cv_minmax_in_limits_h" >&6; }
15978 if test $gl_cv_minmax_in_limits_h = yes; then
15979
15980$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h
15981
15982 fi
15983
15984
15985
15986
15987
15988
15989 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5
15990$as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; }
15991if ${gl_cv_minmax_in_sys_param_h+:} false; then :
15992 $as_echo_n "(cached) " >&6
15993else
15994 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15995/* end confdefs.h. */
15996#include <sys/param.h>
15997 int x = MIN (42, 17);
15998int
15999main ()
16000{
16001
6ec2e0f5
SDJ
16002 ;
16003 return 0;
16004}
16005_ACEOF
698be2d8
CB
16006if ac_fn_c_try_compile "$LINENO"; then :
16007 gl_cv_minmax_in_sys_param_h=yes
6ec2e0f5 16008else
698be2d8 16009 gl_cv_minmax_in_sys_param_h=no
6ec2e0f5 16010fi
698be2d8 16011rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 16012fi
698be2d8
CB
16013{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5
16014$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; }
16015 if test $gl_cv_minmax_in_sys_param_h = yes; then
6ec2e0f5 16016
698be2d8 16017$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
c0c3707f 16018
c0c3707f 16019 fi
c0c3707f 16020
c0c3707f 16021
698be2d8 16022
c0c3707f
CB
16023
16024
16025
16026
16027
16028
16029
16030 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
16031$as_echo_n "checking for O_CLOEXEC... " >&6; }
16032if ${gl_cv_macro_O_CLOEXEC+:} false; then :
6ec2e0f5
SDJ
16033 $as_echo_n "(cached) " >&6
16034else
16035 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16036/* end confdefs.h. */
c0c3707f
CB
16037#include <fcntl.h>
16038 #ifndef O_CLOEXEC
16039 choke me;
16040 #endif
6ec2e0f5
SDJ
16041
16042int
16043main ()
16044{
c0c3707f 16045return O_CLOEXEC;
6ec2e0f5
SDJ
16046 ;
16047 return 0;
16048}
16049_ACEOF
16050if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 16051 gl_cv_macro_O_CLOEXEC=yes
6ec2e0f5 16052else
c0c3707f 16053 gl_cv_macro_O_CLOEXEC=no
6ec2e0f5
SDJ
16054fi
16055rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16056fi
c0c3707f
CB
16057{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
16058$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
16059
16060
16061
16062 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
16063$as_echo_n "checking for promoted mode_t type... " >&6; }
16064if ${gl_cv_promoted_mode_t+:} false; then :
6ec2e0f5
SDJ
16065 $as_echo_n "(cached) " >&6
16066else
6ec2e0f5 16067
c0c3707f
CB
16068 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16069/* end confdefs.h. */
16070#include <sys/types.h>
6ec2e0f5
SDJ
16071int
16072main ()
16073{
c0c3707f 16074typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
6ec2e0f5
SDJ
16075 ;
16076 return 0;
16077}
16078_ACEOF
16079if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 16080 gl_cv_promoted_mode_t='int'
6ec2e0f5 16081else
c0c3707f 16082 gl_cv_promoted_mode_t='mode_t'
6ec2e0f5
SDJ
16083fi
16084rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 16085
6ec2e0f5 16086fi
c0c3707f
CB
16087{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
16088$as_echo "$gl_cv_promoted_mode_t" >&6; }
6ec2e0f5 16089
c0c3707f
CB
16090cat >>confdefs.h <<_ACEOF
16091#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
6ec2e0f5 16092_ACEOF
c0c3707f
CB
16093
16094
16095
16096
16097
9c9d63b1
PM
16098
16099
16100
16101
c0c3707f
CB
16102
16103ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
16104if test "x$ac_cv_have_decl_setenv" = xyes; then :
16105 ac_have_decl=1
6ec2e0f5 16106else
c0c3707f 16107 ac_have_decl=0
6ec2e0f5 16108fi
c0c3707f
CB
16109
16110cat >>confdefs.h <<_ACEOF
16111#define HAVE_DECL_SETENV $ac_have_decl
16112_ACEOF
16113
16114
16115
16116
16117
16118
16119 if test $ac_cv_have_decl_setenv = no; then
16120 HAVE_DECL_SETENV=0
6ec2e0f5
SDJ
16121 fi
16122
16123
16124
16125
16126
c0c3707f
CB
16127 for ac_header in search.h
16128do :
16129 ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
16130if test "x$ac_cv_header_search_h" = xyes; then :
16131 cat >>confdefs.h <<_ACEOF
16132#define HAVE_SEARCH_H 1
16133_ACEOF
6ec2e0f5 16134
c0c3707f 16135fi
6ec2e0f5 16136
c0c3707f 16137done
6ec2e0f5 16138
c0c3707f
CB
16139 for ac_func in tsearch
16140do :
16141 ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
16142if test "x$ac_cv_func_tsearch" = xyes; then :
16143 cat >>confdefs.h <<_ACEOF
16144#define HAVE_TSEARCH 1
16145_ACEOF
6ec2e0f5 16146
c0c3707f
CB
16147fi
16148done
6ec2e0f5
SDJ
16149
16150
16151
16152
c0c3707f
CB
16153 GNULIB_PTHREAD_SIGMASK=0;
16154 GNULIB_RAISE=0;
16155 GNULIB_SIGNAL_H_SIGPIPE=0;
16156 GNULIB_SIGPROCMASK=0;
16157 GNULIB_SIGACTION=0;
16158 HAVE_POSIX_SIGNALBLOCKING=1;
16159 HAVE_PTHREAD_SIGMASK=1;
16160 HAVE_RAISE=1;
16161 HAVE_SIGSET_T=1;
16162 HAVE_SIGINFO_T=1;
16163 HAVE_SIGACTION=1;
16164 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
6ec2e0f5 16165
c0c3707f 16166 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
6ec2e0f5 16167
c0c3707f
CB
16168 HAVE_SIGHANDLER_T=1;
16169 REPLACE_PTHREAD_SIGMASK=0;
16170 REPLACE_RAISE=0;
6ec2e0f5 16171
6ec2e0f5 16172
c0c3707f
CB
16173 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
16174 #include <signal.h>
16175 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
16176 #include <sys/types.h>
16177
16178"
16179if test "x$ac_cv_type_sigset_t" = xyes; then :
16180
16181cat >>confdefs.h <<_ACEOF
16182#define HAVE_SIGSET_T 1
16183_ACEOF
16184
16185gl_cv_type_sigset_t=yes
16186else
16187 gl_cv_type_sigset_t=no
16188fi
6ec2e0f5 16189
c0c3707f
CB
16190 if test $gl_cv_type_sigset_t != yes; then
16191 HAVE_SIGSET_T=0
16192 fi
6ec2e0f5 16193
c0c3707f
CB
16194{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
16195$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
16196if ${ac_cv_type_uid_t+:} false; then :
16197 $as_echo_n "(cached) " >&6
16198else
6ec2e0f5
SDJ
16199 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16200/* end confdefs.h. */
c0c3707f
CB
16201#include <sys/types.h>
16202
6ec2e0f5 16203_ACEOF
c0c3707f
CB
16204if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16205 $EGREP "uid_t" >/dev/null 2>&1; then :
16206 ac_cv_type_uid_t=yes
16207else
16208 ac_cv_type_uid_t=no
16209fi
16210rm -f conftest*
6ec2e0f5 16211
c0c3707f
CB
16212fi
16213{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
16214$as_echo "$ac_cv_type_uid_t" >&6; }
16215if test $ac_cv_type_uid_t = no; then
6ec2e0f5 16216
c0c3707f 16217$as_echo "#define uid_t int" >>confdefs.h
6ec2e0f5 16218
6ec2e0f5 16219
c0c3707f 16220$as_echo "#define gid_t int" >>confdefs.h
6ec2e0f5
SDJ
16221
16222fi
6ec2e0f5 16223
c0c3707f
CB
16224{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
16225$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
16226if ${ac_cv_header_stdbool_h+:} false; then :
16227 $as_echo_n "(cached) " >&6
16228else
16229 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16230/* end confdefs.h. */
16231
16232 #include <stdbool.h>
16233
16234 #ifdef __cplusplus
16235 typedef bool Bool;
16236 #else
16237 typedef _Bool Bool;
16238 #ifndef bool
16239 "error: bool is not defined"
16240 #endif
16241 #ifndef false
16242 "error: false is not defined"
16243 #endif
16244 #if false
16245 "error: false is not 0"
16246 #endif
16247 #ifndef true
16248 "error: true is not defined"
16249 #endif
16250 #if true != 1
16251 "error: true is not 1"
16252 #endif
16253 #endif
16254
16255 #ifndef __bool_true_false_are_defined
16256 "error: __bool_true_false_are_defined is not defined"
16257 #endif
16258
16259 struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
16260
16261 char a[true == 1 ? 1 : -1];
16262 char b[false == 0 ? 1 : -1];
16263 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
16264 char d[(bool) 0.5 == true ? 1 : -1];
16265 /* See body of main program for 'e'. */
16266 char f[(Bool) 0.0 == false ? 1 : -1];
16267 char g[true];
16268 char h[sizeof (Bool)];
16269 char i[sizeof s.t];
16270 enum { j = false, k = true, l = false * true, m = true * 256 };
16271 /* The following fails for
16272 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
16273 Bool n[m];
16274 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
16275 char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
16276 /* Catch a bug in an HP-UX C compiler. See
16277 https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
16278 https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
16279 */
16280 Bool q = true;
16281 Bool *pq = &q;
16282 bool *qq = &q;
6ec2e0f5 16283
c0c3707f
CB
16284int
16285main ()
16286{
6ec2e0f5 16287
c0c3707f
CB
16288 bool e = &s;
16289 *pq |= q; *pq |= ! q;
16290 *qq |= q; *qq |= ! q;
16291 /* Refer to every declared value, to avoid compiler optimizations. */
16292 return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
16293 + !m + !n + !o + !p + !q + !pq + !qq);
6ec2e0f5 16294
c0c3707f
CB
16295 ;
16296 return 0;
16297}
16298_ACEOF
16299if ac_fn_c_try_compile "$LINENO"; then :
16300 ac_cv_header_stdbool_h=yes
16301else
16302 ac_cv_header_stdbool_h=no
16303fi
16304rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16305fi
16306{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
16307$as_echo "$ac_cv_header_stdbool_h" >&6; }
16308 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
16309if test "x$ac_cv_type__Bool" = xyes; then :
6ec2e0f5 16310
c0c3707f
CB
16311cat >>confdefs.h <<_ACEOF
16312#define HAVE__BOOL 1
16313_ACEOF
6ec2e0f5
SDJ
16314
16315
c0c3707f 16316fi
6ec2e0f5
SDJ
16317
16318
9c9d63b1
PM
16319ac_fn_c_check_decl "$LINENO" "fcloseall" "ac_cv_have_decl_fcloseall" "$ac_includes_default"
16320if test "x$ac_cv_have_decl_fcloseall" = xyes; then :
16321 ac_have_decl=1
16322else
16323 ac_have_decl=0
16324fi
16325
16326cat >>confdefs.h <<_ACEOF
16327#define HAVE_DECL_FCLOSEALL $ac_have_decl
16328_ACEOF
16329
16330ac_fn_c_check_decl "$LINENO" "ecvt" "ac_cv_have_decl_ecvt" "$ac_includes_default"
16331if test "x$ac_cv_have_decl_ecvt" = xyes; then :
16332 ac_have_decl=1
16333else
16334 ac_have_decl=0
16335fi
16336
16337cat >>confdefs.h <<_ACEOF
16338#define HAVE_DECL_ECVT $ac_have_decl
16339_ACEOF
16340
16341ac_fn_c_check_decl "$LINENO" "fcvt" "ac_cv_have_decl_fcvt" "$ac_includes_default"
16342if test "x$ac_cv_have_decl_fcvt" = xyes; then :
16343 ac_have_decl=1
16344else
16345 ac_have_decl=0
16346fi
16347
16348cat >>confdefs.h <<_ACEOF
16349#define HAVE_DECL_FCVT $ac_have_decl
16350_ACEOF
16351
16352ac_fn_c_check_decl "$LINENO" "gcvt" "ac_cv_have_decl_gcvt" "$ac_includes_default"
16353if test "x$ac_cv_have_decl_gcvt" = xyes; then :
16354 ac_have_decl=1
16355else
16356 ac_have_decl=0
16357fi
472fa5ee 16358
9c9d63b1
PM
16359cat >>confdefs.h <<_ACEOF
16360#define HAVE_DECL_GCVT $ac_have_decl
16361_ACEOF
f8e27d88 16362
c0c3707f
CB
16363ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
16364if test "x$ac_cv_have_decl_strdup" = xyes; then :
6ec2e0f5
SDJ
16365 ac_have_decl=1
16366else
16367 ac_have_decl=0
16368fi
16369
16370cat >>confdefs.h <<_ACEOF
c0c3707f 16371#define HAVE_DECL_STRDUP $ac_have_decl
6ec2e0f5
SDJ
16372_ACEOF
16373
16374
c0c3707f
CB
16375 REPLACE_STRERROR_0=0
16376 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
16377$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
16378if ${gl_cv_func_strerror_0_works+:} false; then :
6ec2e0f5
SDJ
16379 $as_echo_n "(cached) " >&6
16380else
c0c3707f
CB
16381 if test "$cross_compiling" = yes; then :
16382 case "$host_os" in
16383 # Guess yes on glibc systems.
16384 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
16385 # Guess yes on musl systems.
16386 *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
16387 # Guess yes on native Windows.
16388 mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
16389 # If we don't know, obey --enable-cross-guesses.
16390 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
16391 esac
6ec2e0f5 16392
5e8754f9
SDJ
16393else
16394 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16395/* end confdefs.h. */
c0c3707f
CB
16396#include <string.h>
16397 #include <errno.h>
6ec2e0f5 16398
5e8754f9
SDJ
16399int
16400main ()
16401{
c0c3707f
CB
16402int result = 0;
16403 char *str;
16404 errno = 0;
16405 str = strerror (0);
16406 if (!*str) result |= 1;
16407 if (errno) result |= 2;
16408 if (strstr (str, "nknown") || strstr (str, "ndefined"))
16409 result |= 4;
16410 return result;
5e8754f9
SDJ
16411 ;
16412 return 0;
16413}
16414_ACEOF
c0c3707f
CB
16415if ac_fn_c_try_run "$LINENO"; then :
16416 gl_cv_func_strerror_0_works=yes
5e8754f9 16417else
c0c3707f 16418 gl_cv_func_strerror_0_works=no
5e8754f9 16419fi
c0c3707f
CB
16420rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16421 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 16422fi
6ec2e0f5 16423
6ec2e0f5 16424
c0c3707f
CB
16425fi
16426{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
16427$as_echo "$gl_cv_func_strerror_0_works" >&6; }
16428 case "$gl_cv_func_strerror_0_works" in
16429 *yes) ;;
16430 *)
16431 REPLACE_STRERROR_0=1
6ec2e0f5 16432
c0c3707f 16433$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
6ec2e0f5 16434
c0c3707f
CB
16435 ;;
16436 esac
6ec2e0f5
SDJ
16437
16438
16439
16440
472fa5ee
SM
16441
16442
16443
725e2999 16444
725e2999
JB
16445
16446
c0c3707f
CB
16447 if test $ac_cv_func_strerror_r = yes; then
16448 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
16449 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
16450$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
16451if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
16452 $as_echo_n "(cached) " >&6
16453else
16454 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16455/* end confdefs.h. */
16456#include <string.h>
16457 int strerror_r (int, char *, size_t);
725e2999 16458
c0c3707f
CB
16459int
16460main ()
16461{
725e2999 16462
c0c3707f
CB
16463 ;
16464 return 0;
16465}
16466_ACEOF
16467if ac_fn_c_try_compile "$LINENO"; then :
16468 gl_cv_func_strerror_r_posix_signature=yes
16469else
16470 gl_cv_func_strerror_r_posix_signature=no
16471fi
16472rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
725e2999 16473
c0c3707f
CB
16474fi
16475{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
16476$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
16477 if test $gl_cv_func_strerror_r_posix_signature = yes; then
16478 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
16479$as_echo_n "checking whether strerror_r works... " >&6; }
16480if ${gl_cv_func_strerror_r_works+:} false; then :
16481 $as_echo_n "(cached) " >&6
16482else
16483 if test "$cross_compiling" = yes; then :
725e2999 16484
c0c3707f
CB
16485 case "$host_os" in
16486 # Guess no on AIX.
16487 aix*) gl_cv_func_strerror_r_works="guessing no";;
16488 # Guess no on HP-UX.
16489 hpux*) gl_cv_func_strerror_r_works="guessing no";;
16490 # Guess no on BSD variants.
16491 *bsd*) gl_cv_func_strerror_r_works="guessing no";;
16492 # Guess yes otherwise.
16493 *) gl_cv_func_strerror_r_works="guessing yes";;
16494 esac
725e2999 16495
c0c3707f
CB
16496else
16497 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16498/* end confdefs.h. */
16499#include <errno.h>
16500 #include <string.h>
725e2999 16501
c0c3707f
CB
16502int
16503main ()
16504{
16505int result = 0;
16506 char buf[79];
16507 if (strerror_r (EACCES, buf, 0) < 0)
16508 result |= 1;
16509 errno = 0;
16510 if (strerror_r (EACCES, buf, sizeof buf) != 0)
16511 result |= 2;
16512 strcpy (buf, "Unknown");
16513 if (strerror_r (0, buf, sizeof buf) != 0)
16514 result |= 4;
16515 if (errno)
16516 result |= 8;
16517 if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
16518 result |= 0x10;
16519 errno = 0;
16520 *buf = 0;
16521 if (strerror_r (-3, buf, sizeof buf) < 0)
16522 result |= 0x20;
16523 if (errno)
16524 result |= 0x40;
16525 if (!*buf)
16526 result |= 0x80;
16527 return result;
725e2999 16528
c0c3707f
CB
16529 ;
16530 return 0;
16531}
16532_ACEOF
16533if ac_fn_c_try_run "$LINENO"; then :
16534 gl_cv_func_strerror_r_works=yes
16535else
16536 gl_cv_func_strerror_r_works=no
16537fi
16538rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16539 conftest.$ac_objext conftest.beam conftest.$ac_ext
16540fi
725e2999
JB
16541
16542
c0c3707f
CB
16543fi
16544{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16545$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16546 else
725e2999 16547
c0c3707f
CB
16548 if test $ac_cv_func___xpg_strerror_r = yes; then
16549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
16550$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
16551if ${gl_cv_func_strerror_r_works+:} false; then :
725e2999
JB
16552 $as_echo_n "(cached) " >&6
16553else
c0c3707f
CB
16554 if test "$cross_compiling" = yes; then :
16555 gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
725e2999 16556
c0c3707f
CB
16557else
16558 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
725e2999 16559/* end confdefs.h. */
c0c3707f
CB
16560#include <errno.h>
16561 #include <string.h>
16562 extern
16563 #ifdef __cplusplus
16564 "C"
16565 #endif
16566 int __xpg_strerror_r(int, char *, size_t);
725e2999 16567
c0c3707f
CB
16568int
16569main ()
16570{
16571int result = 0;
16572 char buf[256] = "^";
16573 char copy[256];
16574 char *str = strerror (-1);
16575 strcpy (copy, str);
16576 if (__xpg_strerror_r (-2, buf, 1) == 0)
16577 result |= 1;
16578 if (*buf)
16579 result |= 2;
16580 __xpg_strerror_r (-2, buf, 256);
16581 if (strcmp (str, copy))
16582 result |= 4;
16583 return result;
725e2999 16584
c0c3707f
CB
16585 ;
16586 return 0;
16587}
725e2999 16588_ACEOF
c0c3707f
CB
16589if ac_fn_c_try_run "$LINENO"; then :
16590 gl_cv_func_strerror_r_works=yes
725e2999 16591else
c0c3707f 16592 gl_cv_func_strerror_r_works=no
725e2999 16593fi
c0c3707f
CB
16594rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16595 conftest.$ac_objext conftest.beam conftest.$ac_ext
725e2999 16596fi
725e2999 16597
725e2999 16598
c0c3707f
CB
16599fi
16600{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16601$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16602 fi
16603 fi
725e2999 16604 fi
725e2999
JB
16605 fi
16606
c0c3707f
CB
16607ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
16608if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
16609 ac_have_decl=1
725e2999 16610else
c0c3707f 16611 ac_have_decl=0
725e2999
JB
16612fi
16613
c0c3707f
CB
16614cat >>confdefs.h <<_ACEOF
16615#define HAVE_DECL_STRERROR_R $ac_have_decl
16616_ACEOF
725e2999
JB
16617
16618
16619
16620
16621
725e2999
JB
16622
16623
16624
725e2999
JB
16625
16626
16627
16628
16629
16630
16631
725e2999 16632 if test $gl_cv_have_include_next = yes; then
c0c3707f 16633 gl_cv_next_string_h='<'string.h'>'
725e2999 16634 else
c0c3707f
CB
16635 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
16636$as_echo_n "checking absolute name of <string.h>... " >&6; }
16637if ${gl_cv_next_string_h+:} false; then :
725e2999
JB
16638 $as_echo_n "(cached) " >&6
16639else
16640
725e2999
JB
16641
16642
16643 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16644/* end confdefs.h. */
c0c3707f 16645#include <string.h>
725e2999
JB
16646_ACEOF
16647 case "$host_os" in
16648 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16649 *) gl_absname_cpp="$ac_cpp" ;;
16650 esac
16651
16652 case "$host_os" in
16653 mingw*)
16654 gl_dirsep_regex='[/\\]'
16655 ;;
16656 *)
16657 gl_dirsep_regex='\/'
16658 ;;
16659 esac
16660 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 16661 gl_header_literal_regex=`echo 'string.h' \
725e2999
JB
16662 | sed -e "$gl_make_literal_regex_sed"`
16663 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16664 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16665 s|^/[^/]|//&|
16666 p
16667 q
16668 }'
6ec2e0f5 16669
c0c3707f 16670 gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
725e2999 16671 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16672
c0c3707f
CB
16673 gl_header=$gl_cv_absolute_string_h
16674 gl_cv_next_string_h='"'$gl_header'"'
6ec2e0f5
SDJ
16675
16676
725e2999 16677fi
c0c3707f
CB
16678{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
16679$as_echo "$gl_cv_next_string_h" >&6; }
725e2999 16680 fi
c0c3707f 16681 NEXT_STRING_H=$gl_cv_next_string_h
6ec2e0f5 16682
725e2999
JB
16683 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16684 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 16685 gl_next_as_first_directive='<'string.h'>'
725e2999
JB
16686 else
16687 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 16688 gl_next_as_first_directive=$gl_cv_next_string_h
725e2999 16689 fi
c0c3707f
CB
16690 NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
16691
16692
16693
6ec2e0f5
SDJ
16694
16695
16696
16697
16698
6ec2e0f5
SDJ
16699
16700
6ec2e0f5 16701
698be2d8
CB
16702ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
16703if test "x$ac_cv_have_decl_strnlen" = xyes; then :
16704 ac_have_decl=1
16705else
16706 ac_have_decl=0
16707fi
16708
16709cat >>confdefs.h <<_ACEOF
16710#define HAVE_DECL_STRNLEN $ac_have_decl
16711_ACEOF
16712
16713
16714
c0c3707f 16715
9c9d63b1 16716 if test $REPLACE_MEMCHR = 1; then
c0c3707f
CB
16717 REPLACE_STRSTR=1
16718 else
16719 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
16720$as_echo_n "checking whether strstr works... " >&6; }
16721if ${gl_cv_func_strstr_works_always+:} false; then :
6ec2e0f5
SDJ
16722 $as_echo_n "(cached) " >&6
16723else
c0c3707f
CB
16724 if test "$cross_compiling" = yes; then :
16725 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
16726/* end confdefs.h. */
16727
c0c3707f
CB
16728#ifdef __GNU_LIBRARY__
16729 #include <features.h>
16730 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
16731 || defined __UCLIBC__
16732 Lucky user
16733 #endif
16734#elif defined __CYGWIN__
16735 #include <cygwin/version.h>
16736 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
16737 Lucky user
16738 #endif
16739#else
16740 Lucky user
6ec2e0f5 16741#endif
c0c3707f
CB
16742
16743_ACEOF
16744if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16745 $EGREP "Lucky user" >/dev/null 2>&1; then :
16746 gl_cv_func_strstr_works_always="guessing yes"
16747else
16748 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
16749fi
16750rm -f conftest*
16751
16752
16753else
16754 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16755/* end confdefs.h. */
16756
16757#include <string.h> /* for strstr */
16758#ifdef __GNU_LIBRARY__
16759 #include <features.h>
16760 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
16761 Unlucky user
16762 #endif
725e2999 16763#endif
c0c3707f
CB
16764#define P "_EF_BF_BD"
16765#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
16766#define NEEDLE P P P P P
6ec2e0f5 16767
725e2999
JB
16768int
16769main ()
16770{
c0c3707f
CB
16771return !!strstr (HAYSTACK, NEEDLE);
16772
725e2999
JB
16773 ;
16774 return 0;
16775}
6ec2e0f5 16776_ACEOF
c0c3707f
CB
16777if ac_fn_c_try_run "$LINENO"; then :
16778 gl_cv_func_strstr_works_always=yes
6ec2e0f5 16779else
c0c3707f 16780 gl_cv_func_strstr_works_always=no
6ec2e0f5 16781fi
c0c3707f
CB
16782rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16783 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 16784fi
6ec2e0f5
SDJ
16785
16786
c0c3707f
CB
16787fi
16788{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
16789$as_echo "$gl_cv_func_strstr_works_always" >&6; }
16790 case "$gl_cv_func_strstr_works_always" in
16791 *yes) ;;
16792 *)
16793 REPLACE_STRSTR=1
16794 ;;
16795 esac
16796 fi
6ec2e0f5 16797
c0c3707f
CB
16798ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default"
16799if test "x$ac_cv_have_decl_strtok_r" = xyes; then :
16800 ac_have_decl=1
16801else
16802 ac_have_decl=0
16803fi
6ec2e0f5 16804
c0c3707f
CB
16805cat >>confdefs.h <<_ACEOF
16806#define HAVE_DECL_STRTOK_R $ac_have_decl
16807_ACEOF
6ec2e0f5
SDJ
16808
16809
16810
16811
6ec2e0f5
SDJ
16812
16813
16814
16815
16816
16817
16818
698be2d8
CB
16819
16820
c0c3707f 16821$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
6ec2e0f5 16822
6ec2e0f5
SDJ
16823
16824
16825
16826
16827
6ec2e0f5
SDJ
16828
16829
16830
16831
16832
c0c3707f
CB
16833 if test $gl_cv_have_include_next = yes; then
16834 gl_cv_next_sys_types_h='<'sys/types.h'>'
16835 else
16836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
16837$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
16838if ${gl_cv_next_sys_types_h+:} false; then :
6ec2e0f5
SDJ
16839 $as_echo_n "(cached) " >&6
16840else
6ec2e0f5 16841
6ec2e0f5 16842
c0c3707f
CB
16843
16844 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16845/* end confdefs.h. */
16846#include <sys/types.h>
6ec2e0f5 16847_ACEOF
c0c3707f
CB
16848 case "$host_os" in
16849 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16850 *) gl_absname_cpp="$ac_cpp" ;;
16851 esac
6ec2e0f5 16852
c0c3707f
CB
16853 case "$host_os" in
16854 mingw*)
16855 gl_dirsep_regex='[/\\]'
16856 ;;
16857 *)
16858 gl_dirsep_regex='\/'
16859 ;;
16860 esac
16861 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16862 gl_header_literal_regex=`echo 'sys/types.h' \
16863 | sed -e "$gl_make_literal_regex_sed"`
16864 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16865 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16866 s|^/[^/]|//&|
16867 p
16868 q
16869 }'
6ec2e0f5 16870
c0c3707f
CB
16871 gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16872 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16873
c0c3707f
CB
16874 gl_header=$gl_cv_absolute_sys_types_h
16875 gl_cv_next_sys_types_h='"'$gl_header'"'
6ec2e0f5
SDJ
16876
16877
c0c3707f
CB
16878fi
16879{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
16880$as_echo "$gl_cv_next_sys_types_h" >&6; }
16881 fi
16882 NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
6ec2e0f5 16883
c0c3707f
CB
16884 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16885 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16886 gl_next_as_first_directive='<'sys/types.h'>'
16887 else
16888 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16889 gl_next_as_first_directive=$gl_cv_next_sys_types_h
16890 fi
16891 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
16892
16893
16894
16895
6ec2e0f5 16896
6ec2e0f5
SDJ
16897
16898
6ec2e0f5
SDJ
16899
16900
16901
16902
16903
c0c3707f 16904 WINDOWS_STAT_INODES=0
6ec2e0f5
SDJ
16905
16906
16907
16908
16909
472fa5ee
SM
16910
16911
16912
9c9d63b1
PM
16913 GNULIB_CTIME=0;
16914 GNULIB_MKTIME=0;
16915 GNULIB_LOCALTIME=0;
16916 GNULIB_NANOSLEEP=0;
16917 GNULIB_STRFTIME=0;
16918 GNULIB_STRPTIME=0;
16919 GNULIB_TIMEGM=0;
16920 GNULIB_TIMESPEC_GET=0;
16921 GNULIB_TIME_R=0;
16922 GNULIB_TIME_RZ=0;
16923 GNULIB_TZSET=0;
16924 GNULIB_MDA_TZSET=1;
16925 HAVE_DECL_LOCALTIME_R=1;
16926 HAVE_NANOSLEEP=1;
16927 HAVE_STRPTIME=1;
16928 HAVE_TIMEGM=1;
16929 HAVE_TIMESPEC_GET=1;
16930 HAVE_TIMEZONE_T=0;
16931 REPLACE_CTIME=GNULIB_PORTCHECK;
16932 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
16933 REPLACE_MKTIME=GNULIB_PORTCHECK;
16934 REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
16935 REPLACE_STRFTIME=GNULIB_PORTCHECK;
16936 REPLACE_TIMEGM=GNULIB_PORTCHECK;
16937 REPLACE_TZSET=GNULIB_PORTCHECK;
16938
16939 : ${GNULIB_GETTIMEOFDAY=0};
16940 REPLACE_GMTIME=0;
16941 REPLACE_LOCALTIME=0;
16942
16943
472fa5ee 16944
c0c3707f
CB
16945 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
16946$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
16947if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
16948 $as_echo_n "(cached) " >&6
16949else
16950 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16951/* end confdefs.h. */
16952#include <time.h>
472fa5ee 16953
c0c3707f
CB
16954int
16955main ()
16956{
16957static struct timespec x; x.tv_sec = x.tv_nsec;
16958 ;
16959 return 0;
16960}
6ec2e0f5 16961_ACEOF
c0c3707f
CB
16962if ac_fn_c_try_compile "$LINENO"; then :
16963 gl_cv_sys_struct_timespec_in_time_h=yes
16964else
16965 gl_cv_sys_struct_timespec_in_time_h=no
6ec2e0f5 16966fi
c0c3707f
CB
16967rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16968fi
16969{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
16970$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
6ec2e0f5 16971
c0c3707f
CB
16972 TIME_H_DEFINES_STRUCT_TIMESPEC=0
16973 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
16974 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
16975 UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
16976 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
16977 TIME_H_DEFINES_STRUCT_TIMESPEC=1
6ec2e0f5 16978 else
c0c3707f
CB
16979 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
16980$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
16981if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
16982 $as_echo_n "(cached) " >&6
16983else
16984 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16985/* end confdefs.h. */
16986#include <sys/time.h>
472fa5ee 16987
c0c3707f
CB
16988int
16989main ()
16990{
16991static struct timespec x; x.tv_sec = x.tv_nsec;
16992 ;
16993 return 0;
16994}
16995_ACEOF
16996if ac_fn_c_try_compile "$LINENO"; then :
16997 gl_cv_sys_struct_timespec_in_sys_time_h=yes
16998else
16999 gl_cv_sys_struct_timespec_in_sys_time_h=no
17000fi
17001rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17002fi
17003{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
17004$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
17005 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
17006 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
17007 else
17008 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
17009$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
17010if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
17011 $as_echo_n "(cached) " >&6
17012else
17013 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17014/* end confdefs.h. */
17015#include <pthread.h>
472fa5ee 17016
c0c3707f
CB
17017int
17018main ()
17019{
17020static struct timespec x; x.tv_sec = x.tv_nsec;
17021 ;
17022 return 0;
17023}
17024_ACEOF
17025if ac_fn_c_try_compile "$LINENO"; then :
17026 gl_cv_sys_struct_timespec_in_pthread_h=yes
17027else
17028 gl_cv_sys_struct_timespec_in_pthread_h=no
17029fi
17030rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17031fi
17032{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
17033$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
17034 if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
17035 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
17036 else
17037 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
17038$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
17039if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
17040 $as_echo_n "(cached) " >&6
17041else
17042 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17043/* end confdefs.h. */
17044#include <unistd.h>
6ec2e0f5 17045
c0c3707f
CB
17046int
17047main ()
17048{
17049static struct timespec x; x.tv_sec = x.tv_nsec;
17050 ;
17051 return 0;
17052}
17053_ACEOF
17054if ac_fn_c_try_compile "$LINENO"; then :
17055 gl_cv_sys_struct_timespec_in_unistd_h=yes
17056else
17057 gl_cv_sys_struct_timespec_in_unistd_h=no
17058fi
17059rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17060fi
17061{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
17062$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
17063 if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
17064 UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
17065 fi
6ec2e0f5
SDJ
17066 fi
17067 fi
c0c3707f 17068 fi
6ec2e0f5
SDJ
17069
17070
17071
17072
17073
17074
6ec2e0f5 17075
6ec2e0f5
SDJ
17076
17077
17078
17079
17080
6ec2e0f5
SDJ
17081
17082
17083
17084
c0c3707f
CB
17085 if test $gl_cv_have_include_next = yes; then
17086 gl_cv_next_time_h='<'time.h'>'
17087 else
17088 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
17089$as_echo_n "checking absolute name of <time.h>... " >&6; }
17090if ${gl_cv_next_time_h+:} false; then :
17091 $as_echo_n "(cached) " >&6
17092else
6ec2e0f5 17093
6ec2e0f5
SDJ
17094
17095
c0c3707f
CB
17096 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17097/* end confdefs.h. */
17098#include <time.h>
17099_ACEOF
17100 case "$host_os" in
17101 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17102 *) gl_absname_cpp="$ac_cpp" ;;
17103 esac
6ec2e0f5 17104
c0c3707f
CB
17105 case "$host_os" in
17106 mingw*)
17107 gl_dirsep_regex='[/\\]'
17108 ;;
17109 *)
17110 gl_dirsep_regex='\/'
17111 ;;
17112 esac
17113 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17114 gl_header_literal_regex=`echo 'time.h' \
17115 | sed -e "$gl_make_literal_regex_sed"`
17116 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17117 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17118 s|^/[^/]|//&|
17119 p
17120 q
17121 }'
6ec2e0f5 17122
c0c3707f
CB
17123 gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17124 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 17125
c0c3707f
CB
17126 gl_header=$gl_cv_absolute_time_h
17127 gl_cv_next_time_h='"'$gl_header'"'
6ec2e0f5 17128
6ec2e0f5
SDJ
17129
17130fi
c0c3707f
CB
17131{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
17132$as_echo "$gl_cv_next_time_h" >&6; }
17133 fi
17134 NEXT_TIME_H=$gl_cv_next_time_h
6ec2e0f5 17135
c0c3707f
CB
17136 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17137 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17138 gl_next_as_first_directive='<'time.h'>'
17139 else
17140 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17141 gl_next_as_first_directive=$gl_cv_next_time_h
17142 fi
17143 NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
6ec2e0f5 17144
472fa5ee
SM
17145
17146
17147
17148
17149
6ec2e0f5 17150
6ec2e0f5 17151
9c9d63b1
PM
17152 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME_UTC in <time.h>" >&5
17153$as_echo_n "checking for TIME_UTC in <time.h>... " >&6; }
17154if ${gl_cv_time_h_has_TIME_UTC+:} false; then :
17155 $as_echo_n "(cached) " >&6
17156else
17157 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17158/* end confdefs.h. */
17159#include <time.h>
17160
17161int
17162main ()
17163{
17164static int x = TIME_UTC; x++;
17165 ;
17166 return 0;
17167}
17168_ACEOF
17169if ac_fn_c_try_compile "$LINENO"; then :
17170 gl_cv_time_h_has_TIME_UTC=yes
17171else
17172 gl_cv_time_h_has_TIME_UTC=no
17173fi
17174rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17175fi
17176{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_h_has_TIME_UTC" >&5
17177$as_echo "$gl_cv_time_h_has_TIME_UTC" >&6; }
17178 if test $gl_cv_time_h_has_TIME_UTC = yes; then
17179 TIME_H_DEFINES_TIME_UTC=1
17180 else
17181 TIME_H_DEFINES_TIME_UTC=0
17182 fi
17183
17184
6ec2e0f5 17185
6ec2e0f5 17186
9c9d63b1
PM
17187ac_fn_c_check_decl "$LINENO" "execvpe" "ac_cv_have_decl_execvpe" "$ac_includes_default"
17188if test "x$ac_cv_have_decl_execvpe" = xyes; then :
17189 ac_have_decl=1
17190else
17191 ac_have_decl=0
17192fi
698be2d8 17193
9c9d63b1
PM
17194cat >>confdefs.h <<_ACEOF
17195#define HAVE_DECL_EXECVPE $ac_have_decl
17196_ACEOF
698be2d8 17197
c0c3707f
CB
17198ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
17199if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
17200 ac_have_decl=1
17201else
17202 ac_have_decl=0
17203fi
6ec2e0f5 17204
c0c3707f
CB
17205cat >>confdefs.h <<_ACEOF
17206#define HAVE_DECL_UNSETENV $ac_have_decl
17207_ACEOF
6ec2e0f5
SDJ
17208
17209
6ec2e0f5
SDJ
17210
17211
17212
c0c3707f
CB
17213 if test $ac_cv_header_crtdefs_h = yes; then
17214 HAVE_CRTDEFS_H=1
17215 else
17216 HAVE_CRTDEFS_H=0
5e8754f9 17217 fi
5e8754f9 17218
5e8754f9 17219
5e8754f9 17220
c0c3707f 17221 GNULIB_ISWBLANK=0;
5df4cba6
SM
17222 GNULIB_ISWDIGIT=0;
17223 GNULIB_ISWXDIGIT=0;
c0c3707f
CB
17224 GNULIB_WCTYPE=0;
17225 GNULIB_ISWCTYPE=0;
17226 GNULIB_WCTRANS=0;
17227 GNULIB_TOWCTRANS=0;
17228 HAVE_ISWBLANK=1;
17229 HAVE_WCTYPE_T=1;
17230 HAVE_WCTRANS_T=1;
17231 REPLACE_ISWBLANK=0;
5df4cba6
SM
17232 REPLACE_ISWDIGIT=0;
17233 REPLACE_ISWXDIGIT=0;
5e8754f9 17234
5e8754f9 17235
5e8754f9 17236
5e8754f9 17237
698be2d8
CB
17238
17239
17240
17241
c0c3707f
CB
17242 if false; then
17243 GL_COND_LIBTOOL_TRUE=
17244 GL_COND_LIBTOOL_FALSE='#'
17245else
17246 GL_COND_LIBTOOL_TRUE='#'
17247 GL_COND_LIBTOOL_FALSE=
17248fi
5e8754f9 17249
c0c3707f
CB
17250 gl_cond_libtool=false
17251 gl_libdeps=
17252 gl_ltlibdeps=
17253 gl_m4_base='import/m4'
5e8754f9 17254
5e8754f9
SDJ
17255
17256
6ec2e0f5 17257
6ec2e0f5 17258
6ec2e0f5 17259
6ec2e0f5 17260
6ec2e0f5 17261
6ec2e0f5 17262
5df4cba6 17263
c0c3707f
CB
17264 gl_source_base='import'
17265
6ec2e0f5 17266
c0c3707f
CB
17267 if test $ac_cv_func_alloca_works = no; then
17268 :
17269 fi
6ec2e0f5 17270
c0c3707f
CB
17271 # Define an additional variable used in the Makefile substitution.
17272 if test $ac_cv_working_alloca_h = yes; then
17273 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
17274$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
17275if ${gl_cv_rpl_alloca+:} false; then :
6ec2e0f5
SDJ
17276 $as_echo_n "(cached) " >&6
17277else
c0c3707f
CB
17278
17279 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
17280/* end confdefs.h. */
17281
c0c3707f
CB
17282#if defined __GNUC__ || defined _AIX || defined _MSC_VER
17283 Need own alloca
17284#endif
6ec2e0f5 17285
6ec2e0f5 17286_ACEOF
c0c3707f
CB
17287if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17288 $EGREP "Need own alloca" >/dev/null 2>&1; then :
17289 gl_cv_rpl_alloca=yes
6ec2e0f5 17290else
c0c3707f 17291 gl_cv_rpl_alloca=no
6ec2e0f5 17292fi
c0c3707f 17293rm -f conftest*
6ec2e0f5
SDJ
17294
17295
17296fi
c0c3707f
CB
17297{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
17298$as_echo "$gl_cv_rpl_alloca" >&6; }
17299 if test $gl_cv_rpl_alloca = yes; then
6ec2e0f5 17300
c0c3707f 17301$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
6ec2e0f5 17302
c0c3707f
CB
17303 ALLOCA_H=alloca.h
17304 else
17305 ALLOCA_H=
17306 fi
17307 else
17308 ALLOCA_H=alloca.h
17309 fi
6ec2e0f5 17310
c0c3707f
CB
17311 if test -n "$ALLOCA_H"; then
17312 GL_GENERATE_ALLOCA_H_TRUE=
17313 GL_GENERATE_ALLOCA_H_FALSE='#'
17314else
17315 GL_GENERATE_ALLOCA_H_TRUE='#'
17316 GL_GENERATE_ALLOCA_H_FALSE=
17317fi
6ec2e0f5
SDJ
17318
17319
c0c3707f
CB
17320 if test $ac_cv_working_alloca_h = yes; then
17321 HAVE_ALLOCA_H=1
17322 else
17323 HAVE_ALLOCA_H=0
17324 fi
6ec2e0f5
SDJ
17325
17326
17327
17328
17329
17330
c0c3707f
CB
17331 if test $ac_cv_header_arpa_inet_h = yes; then
17332 HAVE_ARPA_INET_H=1
17333 else
17334 HAVE_ARPA_INET_H=0
17335 fi
6ec2e0f5
SDJ
17336
17337
472fa5ee
SM
17338
17339
17340
17341
17342
6ec2e0f5
SDJ
17343
17344
17345
17346 if test $gl_cv_have_include_next = yes; then
c0c3707f 17347 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5 17348 else
c0c3707f
CB
17349 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
17350$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
17351if ${gl_cv_next_arpa_inet_h+:} false; then :
6ec2e0f5
SDJ
17352 $as_echo_n "(cached) " >&6
17353else
17354
c0c3707f 17355 if test $ac_cv_header_arpa_inet_h = yes; then
6ec2e0f5
SDJ
17356
17357
17358
17359
17360 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17361/* end confdefs.h. */
c0c3707f 17362#include <arpa/inet.h>
6ec2e0f5
SDJ
17363_ACEOF
17364 case "$host_os" in
17365 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17366 *) gl_absname_cpp="$ac_cpp" ;;
17367 esac
17368
17369 case "$host_os" in
17370 mingw*)
17371 gl_dirsep_regex='[/\\]'
17372 ;;
17373 *)
17374 gl_dirsep_regex='\/'
17375 ;;
17376 esac
17377 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 17378 gl_header_literal_regex=`echo 'arpa/inet.h' \
6ec2e0f5
SDJ
17379 | sed -e "$gl_make_literal_regex_sed"`
17380 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17381 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17382 s|^/[^/]|//&|
17383 p
17384 q
17385 }'
17386
c0c3707f 17387 gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5
SDJ
17388 sed -n "$gl_absolute_header_sed"`
17389
c0c3707f
CB
17390 gl_header=$gl_cv_absolute_arpa_inet_h
17391 gl_cv_next_arpa_inet_h='"'$gl_header'"'
6ec2e0f5 17392 else
c0c3707f 17393 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5
SDJ
17394 fi
17395
c0c3707f 17396
6ec2e0f5 17397fi
c0c3707f
CB
17398{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
17399$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
17400 fi
17401 NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
6ec2e0f5 17402
c0c3707f
CB
17403 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17404 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17405 gl_next_as_first_directive='<'arpa/inet.h'>'
17406 else
17407 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17408 gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
17409 fi
17410 NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
17411
17412
6ec2e0f5 17413
6ec2e0f5 17414
6ec2e0f5
SDJ
17415
17416
6ec2e0f5
SDJ
17417
17418
17419
c0c3707f
CB
17420 if test $ac_cv_header_sys_socket_h = yes; then
17421 HAVE_WS2TCPIP_H=0
17422 else
17423 if test $ac_cv_header_ws2tcpip_h = yes; then
17424 HAVE_WS2TCPIP_H=1
17425 else
17426 HAVE_WS2TCPIP_H=0
17427 fi
17428 fi
17429
17430
6ec2e0f5
SDJ
17431
17432
6ec2e0f5
SDJ
17433
17434
17435
17436
17437
698be2d8
CB
17438
17439
17440
17441
17442
17443
17444 if test $ac_cv_func_btowc = no; then
17445 HAVE_BTOWC=0
17446 else
17447
17448
17449
17450
17451 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
17452$as_echo_n "checking whether btowc(0) is correct... " >&6; }
17453if ${gl_cv_func_btowc_nul+:} false; then :
17454 $as_echo_n "(cached) " >&6
17455else
17456
17457 if test "$cross_compiling" = yes; then :
17458
17459 case "$host_os" in
17460 # Guess no on Cygwin.
17461 cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
17462 # Guess yes on native Windows.
17463 mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
17464 # Guess yes otherwise.
17465 *) gl_cv_func_btowc_nul="guessing yes" ;;
17466 esac
17467
17468else
17469 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17470/* end confdefs.h. */
17471
698be2d8
CB
17472#include <wchar.h>
17473int main ()
17474{
17475 if (btowc ('\0') != 0)
17476 return 1;
17477 return 0;
17478}
17479_ACEOF
17480if ac_fn_c_try_run "$LINENO"; then :
17481 gl_cv_func_btowc_nul=yes
17482else
17483 gl_cv_func_btowc_nul=no
17484fi
17485rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17486 conftest.$ac_objext conftest.beam conftest.$ac_ext
17487fi
17488
17489
17490fi
17491{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
17492$as_echo "$gl_cv_func_btowc_nul" >&6; }
17493
17494 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
17495$as_echo_n "checking whether btowc(EOF) is correct... " >&6; }
17496if ${gl_cv_func_btowc_eof+:} false; then :
17497 $as_echo_n "(cached) " >&6
17498else
17499
17500 case "$host_os" in
17501 # Guess no on IRIX.
17502 irix*) gl_cv_func_btowc_eof="guessing no" ;;
17503 # Guess yes on native Windows.
17504 mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
17505 # Guess yes otherwise.
17506 *) gl_cv_func_btowc_eof="guessing yes" ;;
17507 esac
17508 if test $LOCALE_FR != none; then
17509 if test "$cross_compiling" = yes; then :
17510 :
17511else
17512 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17513/* end confdefs.h. */
17514
17515#include <locale.h>
698be2d8 17516#include <stdio.h>
698be2d8
CB
17517#include <wchar.h>
17518int main ()
17519{
17520 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
17521 {
17522 if (btowc (EOF) != WEOF)
17523 return 1;
17524 }
17525 return 0;
17526}
17527_ACEOF
17528if ac_fn_c_try_run "$LINENO"; then :
17529 gl_cv_func_btowc_eof=yes
17530else
17531 gl_cv_func_btowc_eof=no
17532fi
17533rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17534 conftest.$ac_objext conftest.beam conftest.$ac_ext
17535fi
17536
17537 fi
17538
17539fi
17540{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
17541$as_echo "$gl_cv_func_btowc_eof" >&6; }
17542
17543 case "$gl_cv_func_btowc_nul" in
17544 *yes) ;;
17545 *) REPLACE_BTOWC=1 ;;
17546 esac
17547 case "$gl_cv_func_btowc_eof" in
17548 *yes) ;;
17549 *) REPLACE_BTOWC=1 ;;
17550 esac
17551 fi
17552
17553 if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
17554
17555
17556
17557
17558
17559
17560
17561
17562 gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext"
17563
17564
17565 :
17566
17567 fi
17568
17569
17570
17571
17572
17573 GNULIB_BTOWC=1
17574
17575
17576
17577
17578
17579$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
17580
17581
17582
17583
c0c3707f
CB
17584 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
17585$as_echo_n "checking for __builtin_expect... " >&6; }
17586if ${gl_cv___builtin_expect+:} false; then :
6ec2e0f5
SDJ
17587 $as_echo_n "(cached) " >&6
17588else
c0c3707f
CB
17589 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17590/* end confdefs.h. */
17591
17592 int
17593 main (int argc, char **argv)
17594 {
17595 argc = __builtin_expect (argc, 100);
17596 return argv[argc != 100][0];
17597 }
17598_ACEOF
17599if ac_fn_c_try_link "$LINENO"; then :
17600 gl_cv___builtin_expect=yes
17601else
17602 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17603/* end confdefs.h. */
17604
17605 #include <builtins.h>
17606 int
17607 main (int argc, char **argv)
17608 {
17609 argc = __builtin_expect (argc, 100);
17610 return argv[argc != 100][0];
17611 }
17612_ACEOF
17613if ac_fn_c_try_link "$LINENO"; then :
17614 gl_cv___builtin_expect="in <builtins.h>"
17615else
17616 gl_cv___builtin_expect=no
6ec2e0f5 17617fi
c0c3707f
CB
17618rm -f core conftest.err conftest.$ac_objext \
17619 conftest$ac_exeext conftest.$ac_ext
17620fi
17621rm -f core conftest.err conftest.$ac_objext \
17622 conftest$ac_exeext conftest.$ac_ext
17623fi
17624{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
17625$as_echo "$gl_cv___builtin_expect" >&6; }
17626 if test "$gl_cv___builtin_expect" = yes; then
17627 $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
8690e634 17628
c0c3707f
CB
17629 elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
17630 $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
8690e634 17631
6ec2e0f5 17632 fi
8690e634
JK
17633
17634
17635
17636
c0c3707f
CB
17637
17638 if test $ac_cv_func_canonicalize_file_name = no; then
17639 HAVE_CANONICALIZE_FILE_NAME=0
17640 if test $ac_cv_func_realpath = no; then
17641 HAVE_REALPATH=0
17642 else
17643 case "$gl_cv_func_realpath_works" in
17644 *yes) ;;
17645 *) REPLACE_REALPATH=1 ;;
17646 esac
17647 fi
17648 else
17649 case "$gl_cv_func_realpath_works" in
17650 *yes)
17651 ;;
17652 *)
17653 REPLACE_CANONICALIZE_FILE_NAME=1
17654 REPLACE_REALPATH=1
17655 ;;
17656 esac
5e8754f9 17657 fi
8690e634 17658
c0c3707f 17659 if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
8690e634
JK
17660
17661
17662
472fa5ee
SM
17663
17664
17665
17666
17667
c0c3707f
CB
17668 gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
17669
6ec2e0f5 17670 fi
8690e634
JK
17671
17672
c0c3707f
CB
17673cat >>confdefs.h <<_ACEOF
17674#define GNULIB_CANONICALIZE_LGPL 1
17675_ACEOF
8690e634 17676
8690e634 17677
8690e634 17678
8690e634 17679
8690e634 17680
8690e634 17681
8690e634 17682
c0c3707f 17683 GNULIB_CANONICALIZE_FILE_NAME=1
8690e634 17684
8690e634 17685
8690e634 17686
6ec2e0f5
SDJ
17687
17688
c0c3707f 17689$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
6ec2e0f5 17690
6ec2e0f5 17691
8690e634
JK
17692
17693
8690e634
JK
17694
17695
17696
17697
c0c3707f 17698 GNULIB_REALPATH=1
6ec2e0f5
SDJ
17699
17700
17701
17702
6ec2e0f5 17703
c0c3707f 17704$as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
6ec2e0f5
SDJ
17705
17706
17707
17708
17709
17710
17711
6ec2e0f5 17712
c0c3707f 17713 GNULIB_CHDIR=1
6ec2e0f5 17714
8690e634 17715
8690e634 17716
6ec2e0f5 17717
6ec2e0f5 17718
c0c3707f
CB
17719$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
17720
17721
17722
17723
17724
9c9d63b1
PM
17725 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system supports file names of any length" >&5
17726$as_echo_n "checking whether this system supports file names of any length... " >&6; }
17727if ${gl_cv_have_unlimited_file_name_length+:} false; then :
c0c3707f 17728 $as_echo_n "(cached) " >&6
8690e634 17729else
c0c3707f
CB
17730 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17731/* end confdefs.h. */
8690e634 17732
c0c3707f
CB
17733/* Arrange to define PATH_MAX, like "pathmax.h" does. */
17734#if HAVE_UNISTD_H
17735# include <unistd.h>
17736#endif
17737#include <limits.h>
17738#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
17739# include <sys/param.h>
17740#endif
17741#if !defined PATH_MAX && defined MAXPATHLEN
17742# define PATH_MAX MAXPATHLEN
17743#endif
17744#ifdef __hpux
17745# undef PATH_MAX
17746# define PATH_MAX 1024
17747#endif
17748#if defined _WIN32 && ! defined __CYGWIN__
17749# undef PATH_MAX
17750# define PATH_MAX 260
17751#endif
6ec2e0f5 17752
c0c3707f
CB
17753#ifdef PATH_MAX
17754have_arbitrary_file_name_length_limit
17755#endif
6ec2e0f5 17756_ACEOF
c0c3707f
CB
17757if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17758 $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then :
9c9d63b1
PM
17759 gl_cv_have_unlimited_file_name_length=no
17760else
17761 gl_cv_have_unlimited_file_name_length=yes
17762fi
17763rm -f conftest*
17764
17765fi
17766{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_unlimited_file_name_length" >&5
17767$as_echo "$gl_cv_have_unlimited_file_name_length" >&6; }
17768
17769 if test $gl_cv_have_unlimited_file_name_length = no; then
17770
17771
17772
17773
17774
17775
17776
17777
17778 gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext"
17779
17780 :
17781 fi
17782
17783
17784
17785 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
17786 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
17787
17788 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
17789 # programs in the package would end up linked with that potentially-shared
17790 # library, inducing unnecessary run-time overhead.
17791 LIB_CLOCK_GETTIME=
17792
17793 gl_saved_libs=$LIBS
17794 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
17795$as_echo_n "checking for library containing clock_gettime... " >&6; }
17796if ${ac_cv_search_clock_gettime+:} false; then :
17797 $as_echo_n "(cached) " >&6
c0c3707f 17798else
9c9d63b1
PM
17799 ac_func_search_save_LIBS=$LIBS
17800cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17801/* end confdefs.h. */
17802
17803/* Override any GCC internal prototype to avoid an error.
17804 Use char because int might match the return type of a GCC
17805 builtin and then its argument prototype would still apply. */
17806#ifdef __cplusplus
17807extern "C"
17808#endif
17809char clock_gettime ();
17810int
17811main ()
17812{
17813return clock_gettime ();
17814 ;
17815 return 0;
17816}
17817_ACEOF
17818for ac_lib in '' rt posix4; do
17819 if test -z "$ac_lib"; then
17820 ac_res="none required"
17821 else
17822 ac_res=-l$ac_lib
17823 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
17824 fi
17825 if ac_fn_c_try_link "$LINENO"; then :
17826 ac_cv_search_clock_gettime=$ac_res
17827fi
17828rm -f core conftest.err conftest.$ac_objext \
17829 conftest$ac_exeext
17830 if ${ac_cv_search_clock_gettime+:} false; then :
17831 break
c0c3707f 17832fi
9c9d63b1
PM
17833done
17834if ${ac_cv_search_clock_gettime+:} false; then :
6ec2e0f5 17835
9c9d63b1
PM
17836else
17837 ac_cv_search_clock_gettime=no
17838fi
17839rm conftest.$ac_ext
17840LIBS=$ac_func_search_save_LIBS
17841fi
17842{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
17843$as_echo "$ac_cv_search_clock_gettime" >&6; }
17844ac_res=$ac_cv_search_clock_gettime
17845if test "$ac_res" != no; then :
17846 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
17847 test "$ac_cv_search_clock_gettime" = "none required" ||
17848 LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
6ec2e0f5 17849fi
472fa5ee 17850
9c9d63b1
PM
17851 for ac_func in clock_gettime clock_settime
17852do :
17853 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
17854ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
17855if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
17856 cat >>confdefs.h <<_ACEOF
17857#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
17858_ACEOF
472fa5ee 17859
9c9d63b1
PM
17860fi
17861done
472fa5ee 17862
9c9d63b1 17863 LIBS=$gl_saved_libs
472fa5ee 17864
8690e634 17865
8690e634 17866
c0c3707f 17867$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
8690e634
JK
17868
17869
17870
17871
17872
8690e634 17873
c0c3707f
CB
17874 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
17875 REPLACE_CLOSE=1
17876 fi
8690e634 17877
6ec2e0f5
SDJ
17878
17879
6ec2e0f5
SDJ
17880
17881
8690e634 17882
c0c3707f
CB
17883 if test $ac_cv_header_sys_socket_h != yes; then
17884 for ac_header in winsock2.h
17885do :
17886 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
17887if test "x$ac_cv_header_winsock2_h" = xyes; then :
17888 cat >>confdefs.h <<_ACEOF
17889#define HAVE_WINSOCK2_H 1
17890_ACEOF
8690e634 17891
c0c3707f 17892fi
8690e634 17893
c0c3707f 17894done
8690e634 17895
c0c3707f
CB
17896 fi
17897 if test "$ac_cv_header_winsock2_h" = yes; then
17898 HAVE_WINSOCK2_H=1
17899 UNISTD_H_HAVE_WINSOCK2_H=1
17900 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
17901 else
17902 HAVE_WINSOCK2_H=0
17903 fi
8690e634 17904
6ec2e0f5 17905
c0c3707f
CB
17906 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
17907 REPLACE_CLOSE=1
17908 fi
6ec2e0f5
SDJ
17909
17910
c0c3707f 17911 if test $REPLACE_CLOSE = 0; then
6ec2e0f5
SDJ
17912
17913
6ec2e0f5 17914
c0c3707f
CB
17915 if test $ac_cv_func_fchdir = no; then
17916 HAVE_FCHDIR=0
17917 fi
6ec2e0f5 17918
c0c3707f
CB
17919 if test $HAVE_FCHDIR = 0; then
17920 REPLACE_CLOSE=1
17921 fi
17922 fi
6ec2e0f5
SDJ
17923
17924
c0c3707f 17925 if test $REPLACE_CLOSE = 1; then
6ec2e0f5
SDJ
17926
17927
17928
17929
17930
6ec2e0f5
SDJ
17931
17932
17933
c0c3707f 17934 gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
6ec2e0f5 17935
c0c3707f 17936 fi
6ec2e0f5 17937
6ec2e0f5
SDJ
17938
17939
17940
17941
c0c3707f 17942 GNULIB_CLOSE=1
6ec2e0f5 17943
6ec2e0f5 17944
6ec2e0f5
SDJ
17945
17946
17947
c0c3707f 17948$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
6ec2e0f5
SDJ
17949
17950
17951
17952
17953
c0c3707f
CB
17954
17955 for ac_func in closedir
17956do :
17957 ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
17958if test "x$ac_cv_func_closedir" = xyes; then :
17959 cat >>confdefs.h <<_ACEOF
17960#define HAVE_CLOSEDIR 1
17961_ACEOF
17962
17963fi
17964done
17965
17966 if test $ac_cv_func_closedir = no; then
17967 HAVE_CLOSEDIR=0
17968 fi
6ec2e0f5 17969
8690e634
JK
17970
17971
8690e634 17972
c0c3707f
CB
17973 if test $ac_cv_func_fchdir = no; then
17974 HAVE_FCHDIR=0
6ec2e0f5 17975 fi
6a29c58e 17976
c0c3707f
CB
17977 if test $HAVE_FCHDIR = 0; then
17978 if test $HAVE_CLOSEDIR = 1; then
17979 REPLACE_CLOSEDIR=1
17980 fi
17981 fi
6a29c58e 17982
c0c3707f
CB
17983 case $host_os,$HAVE_CLOSEDIR in
17984 os2*,1)
17985 REPLACE_CLOSEDIR=1;;
17986 esac
d0ac1c44 17987
c0c3707f 17988 if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
d0ac1c44
SM
17989
17990
d0ac1c44
SM
17991
17992
6a29c58e
YQ
17993
17994
3d99e817 17995
6ec2e0f5 17996
c0c3707f 17997 gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
6ec2e0f5 17998
6ec2e0f5
SDJ
17999 fi
18000
18001
6ec2e0f5
SDJ
18002
18003
3d99e817 18004
c0c3707f 18005 GNULIB_CLOSEDIR=1
3d99e817
AK
18006
18007
18008
18009
18010
c0c3707f 18011$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
3d99e817
AK
18012
18013
18014
698be2d8
CB
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026 if test $gl_cv_have_include_next = yes; then
18027 gl_cv_next_ctype_h='<'ctype.h'>'
18028 else
18029 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5
18030$as_echo_n "checking absolute name of <ctype.h>... " >&6; }
18031if ${gl_cv_next_ctype_h+:} false; then :
18032 $as_echo_n "(cached) " >&6
18033else
18034
18035
18036
18037 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18038/* end confdefs.h. */
18039#include <ctype.h>
18040_ACEOF
18041 case "$host_os" in
18042 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18043 *) gl_absname_cpp="$ac_cpp" ;;
18044 esac
18045
18046 case "$host_os" in
18047 mingw*)
18048 gl_dirsep_regex='[/\\]'
18049 ;;
18050 *)
18051 gl_dirsep_regex='\/'
18052 ;;
18053 esac
18054 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18055 gl_header_literal_regex=`echo 'ctype.h' \
18056 | sed -e "$gl_make_literal_regex_sed"`
18057 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18058 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18059 s|^/[^/]|//&|
18060 p
18061 q
18062 }'
18063
18064 gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18065 sed -n "$gl_absolute_header_sed"`
18066
18067 gl_header=$gl_cv_absolute_ctype_h
18068 gl_cv_next_ctype_h='"'$gl_header'"'
18069
18070
18071fi
18072{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5
18073$as_echo "$gl_cv_next_ctype_h" >&6; }
18074 fi
18075 NEXT_CTYPE_H=$gl_cv_next_ctype_h
18076
18077 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18078 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18079 gl_next_as_first_directive='<'ctype.h'>'
18080 else
18081 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18082 gl_next_as_first_directive=$gl_cv_next_ctype_h
18083 fi
18084 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive
18085
18086
18087
18088
18089
18090
18091
18092
18093
c0c3707f
CB
18094 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
18095$as_echo_n "checking for d_ino member in directory struct... " >&6; }
18096if ${gl_cv_struct_dirent_d_ino+:} false; then :
6ec2e0f5
SDJ
18097 $as_echo_n "(cached) " >&6
18098else
18099 if test "$cross_compiling" = yes; then :
18100 case "$host_os" in
c0c3707f
CB
18101 # Guess yes on glibc systems with Linux kernel.
18102 linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
18103 # Guess yes on musl systems with Linux kernel.
18104 linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
18105 # Guess no on native Windows.
18106 mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
18107 # If we don't know, obey --enable-cross-guesses.
18108 *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
18109 esac
3d99e817 18110
6ec2e0f5
SDJ
18111else
18112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18113/* end confdefs.h. */
c0c3707f
CB
18114#include <sys/types.h>
18115 #include <sys/stat.h>
18116 #include <dirent.h>
3d99e817 18117
6ec2e0f5
SDJ
18118int
18119main ()
18120{
c0c3707f
CB
18121DIR *dp = opendir (".");
18122 struct dirent *e;
18123 struct stat st;
18124 if (! dp)
18125 return 1;
18126 e = readdir (dp);
18127 if (! e)
18128 { closedir (dp); return 2; }
18129 if (lstat (e->d_name, &st) != 0)
18130 { closedir (dp); return 3; }
18131 if (e->d_ino != st.st_ino)
18132 { closedir (dp); return 4; }
18133 closedir (dp);
18134 return 0;
18135
6ec2e0f5
SDJ
18136 ;
18137 return 0;
18138}
3d99e817 18139_ACEOF
6ec2e0f5 18140if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
18141 gl_cv_struct_dirent_d_ino=yes
18142else
18143 gl_cv_struct_dirent_d_ino=no
18144fi
18145rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18146 conftest.$ac_objext conftest.beam conftest.$ac_ext
18147fi
18148
18149fi
18150{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
18151$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
18152 case "$gl_cv_struct_dirent_d_ino" in
18153 *yes)
18154
18155$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
18156
18157 ;;
18158 esac
18159
18160
18161 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5
18162$as_echo_n "checking for d_type member in directory struct... " >&6; }
18163if ${gl_cv_struct_dirent_d_type+:} false; then :
18164 $as_echo_n "(cached) " >&6
18165else
18166 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18167/* end confdefs.h. */
18168
18169#include <sys/types.h>
18170#include <dirent.h>
18171
18172int
18173main ()
18174{
18175struct dirent dp; dp.d_type = 0;
18176 ;
18177 return 0;
18178}
18179_ACEOF
18180if ac_fn_c_try_link "$LINENO"; then :
18181 gl_cv_struct_dirent_d_type=yes
6ec2e0f5 18182else
c0c3707f 18183 gl_cv_struct_dirent_d_type=no
3d99e817 18184fi
c0c3707f
CB
18185rm -f core conftest.err conftest.$ac_objext \
18186 conftest$ac_exeext conftest.$ac_ext
3d99e817 18187
3d99e817 18188
c0c3707f
CB
18189fi
18190{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5
18191$as_echo "$gl_cv_struct_dirent_d_type" >&6; }
18192 if test $gl_cv_struct_dirent_d_type = yes; then
3d99e817 18193
c0c3707f 18194$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
3d99e817 18195
c0c3707f 18196 fi
3d99e817 18197
0750520d 18198
0750520d 18199
0750520d 18200
0750520d
PA
18201
18202
0750520d 18203
0750520d 18204
0750520d 18205
0750520d 18206
0750520d 18207
0750520d 18208
0750520d 18209
0750520d 18210
c0c3707f
CB
18211 if test $gl_cv_have_include_next = yes; then
18212 gl_cv_next_dirent_h='<'dirent.h'>'
18213 else
18214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
18215$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
18216if ${gl_cv_next_dirent_h+:} false; then :
18217 $as_echo_n "(cached) " >&6
18218else
0750520d 18219
c0c3707f 18220 if test $ac_cv_header_dirent_h = yes; then
6ec2e0f5 18221
472fa5ee
SM
18222
18223
18224
c0c3707f
CB
18225 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18226/* end confdefs.h. */
18227#include <dirent.h>
18228_ACEOF
18229 case "$host_os" in
18230 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18231 *) gl_absname_cpp="$ac_cpp" ;;
18232 esac
472fa5ee 18233
c0c3707f
CB
18234 case "$host_os" in
18235 mingw*)
18236 gl_dirsep_regex='[/\\]'
18237 ;;
18238 *)
18239 gl_dirsep_regex='\/'
18240 ;;
18241 esac
18242 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18243 gl_header_literal_regex=`echo 'dirent.h' \
18244 | sed -e "$gl_make_literal_regex_sed"`
18245 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18246 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18247 s|^/[^/]|//&|
18248 p
18249 q
18250 }'
472fa5ee 18251
c0c3707f
CB
18252 gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18253 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 18254
c0c3707f
CB
18255 gl_header=$gl_cv_absolute_dirent_h
18256 gl_cv_next_dirent_h='"'$gl_header'"'
18257 else
18258 gl_cv_next_dirent_h='<'dirent.h'>'
18259 fi
6ec2e0f5
SDJ
18260
18261
c0c3707f
CB
18262fi
18263{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
18264$as_echo "$gl_cv_next_dirent_h" >&6; }
18265 fi
18266 NEXT_DIRENT_H=$gl_cv_next_dirent_h
472fa5ee 18267
c0c3707f
CB
18268 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18269 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18270 gl_next_as_first_directive='<'dirent.h'>'
18271 else
18272 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18273 gl_next_as_first_directive=$gl_cv_next_dirent_h
18274 fi
18275 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
472fa5ee
SM
18276
18277
18278
18279
c0c3707f
CB
18280 if test $ac_cv_header_dirent_h = yes; then
18281 HAVE_DIRENT_H=1
6ec2e0f5 18282 else
c0c3707f 18283 HAVE_DIRENT_H=0
6ec2e0f5
SDJ
18284 fi
18285
6ec2e0f5 18286
0750520d 18287
0750520d 18288
0750520d 18289
472fa5ee
SM
18290
18291
18292
18293
18294
0750520d 18295
c0c3707f
CB
18296 for ac_func in dirfd
18297do :
18298 ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
18299if test "x$ac_cv_func_dirfd" = xyes; then :
18300 cat >>confdefs.h <<_ACEOF
18301#define HAVE_DIRFD 1
18302_ACEOF
0750520d 18303
c0c3707f
CB
18304fi
18305done
0750520d 18306
c0c3707f
CB
18307 ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
18308 #include <dirent.h>
18309"
18310if test "x$ac_cv_have_decl_dirfd" = xyes; then :
18311 ac_have_decl=1
8690e634 18312else
c0c3707f
CB
18313 ac_have_decl=0
18314fi
8690e634 18315
c0c3707f
CB
18316cat >>confdefs.h <<_ACEOF
18317#define HAVE_DECL_DIRFD $ac_have_decl
18318_ACEOF
49e4877c 18319
c0c3707f
CB
18320 if test $ac_cv_have_decl_dirfd = no; then
18321 HAVE_DECL_DIRFD=0
18322 fi
8690e634 18323
c0c3707f
CB
18324 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
18325$as_echo_n "checking whether dirfd is a macro... " >&6; }
18326if ${gl_cv_func_dirfd_macro+:} false; then :
18327 $as_echo_n "(cached) " >&6
18328else
6ec2e0f5
SDJ
18329 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18330/* end confdefs.h. */
8690e634 18331
c0c3707f
CB
18332#include <sys/types.h>
18333#include <dirent.h>
18334#ifdef dirfd
18335 dirent_header_defines_dirfd
6ec2e0f5 18336#endif
8690e634 18337_ACEOF
c0c3707f
CB
18338if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18339 $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
18340 gl_cv_func_dirfd_macro=yes
6ec2e0f5 18341else
c0c3707f 18342 gl_cv_func_dirfd_macro=no
6ec2e0f5 18343fi
c0c3707f 18344rm -f conftest*
472fa5ee 18345
c0c3707f
CB
18346fi
18347{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
18348$as_echo "$gl_cv_func_dirfd_macro" >&6; }
472fa5ee 18349
c0c3707f
CB
18350 # Use the replacement if we have no function or macro with that name,
18351 # or if OS/2 kLIBC whose dirfd() does not work.
18352 # Replace only if the system declares dirfd already.
18353 case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
18354 no,no,*,yes | *,*,os2*,yes)
18355 REPLACE_DIRFD=1
472fa5ee 18356
c0c3707f
CB
18357$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
18358;;
18359 esac
472fa5ee 18360
c0c3707f
CB
18361 if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
18362 || test $REPLACE_DIRFD = 1; then
6ec2e0f5 18363
6ec2e0f5
SDJ
18364
18365
18366
18367
472fa5ee
SM
18368
18369
18370
c0c3707f 18371 gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
472fa5ee
SM
18372
18373
c0c3707f
CB
18374 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
18375$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
18376if ${gl_cv_sys_dir_fd_member_name+:} false; then :
18377 $as_echo_n "(cached) " >&6
18378else
6ec2e0f5 18379
c0c3707f
CB
18380 dirfd_save_CFLAGS=$CFLAGS
18381 for ac_expr in d_fd dd_fd; do
6ec2e0f5 18382
c0c3707f
CB
18383 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
18384 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18385/* end confdefs.h. */
6ec2e0f5 18386
c0c3707f
CB
18387 #include <sys/types.h>
18388 #include <dirent.h>
18389int
18390main ()
18391{
18392DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
18393 ;
18394 return 0;
18395}
18396_ACEOF
18397if ac_fn_c_try_compile "$LINENO"; then :
18398 dir_fd_found=yes
6ec2e0f5 18399
c0c3707f
CB
18400fi
18401rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18402 CFLAGS=$dirfd_save_CFLAGS
18403 test "$dir_fd_found" = yes && break
18404 done
18405 test "$dir_fd_found" = yes || ac_expr=no_such_member
472fa5ee 18406
c0c3707f 18407 gl_cv_sys_dir_fd_member_name=$ac_expr
472fa5ee
SM
18408
18409
c0c3707f
CB
18410fi
18411{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
18412$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
18413 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
472fa5ee 18414
c0c3707f
CB
18415cat >>confdefs.h <<_ACEOF
18416#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
18417_ACEOF
472fa5ee 18418
6ec2e0f5
SDJ
18419 fi
18420
6ec2e0f5 18421
c0c3707f 18422 fi
6ec2e0f5
SDJ
18423
18424
18425
18426
18427
c0c3707f 18428 GNULIB_DIRFD=1
6ec2e0f5
SDJ
18429
18430
18431
6ec2e0f5 18432
8690e634 18433
c0c3707f 18434$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
8690e634
JK
18435
18436
8690e634
JK
18437
18438
18439
c0c3707f
CB
18440 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
18441$as_echo_n "checking whether // is distinct from /... " >&6; }
18442if ${gl_cv_double_slash_root+:} false; then :
18443 $as_echo_n "(cached) " >&6
18444else
18445 if test x"$cross_compiling" = xyes ; then
18446 # When cross-compiling, there is no way to tell whether // is special
18447 # short of a list of hosts. However, the only known hosts to date
18448 # that have a distinct // are Apollo DomainOS (too old to port to),
18449 # Cygwin, and z/OS. If anyone knows of another system for which // has
18450 # special semantics and is distinct from /, please report it to
18451 # <bug-gnulib@gnu.org>.
18452 case $host in
18453 *-cygwin | i370-ibm-openedition)
18454 gl_cv_double_slash_root=yes ;;
18455 *)
18456 # Be optimistic and assume that / and // are the same when we
18457 # don't know.
18458 gl_cv_double_slash_root='unknown, assuming no' ;;
18459 esac
18460 else
18461 set x `ls -di / // 2>/dev/null`
18462 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
18463 gl_cv_double_slash_root=no
18464 else
18465 gl_cv_double_slash_root=yes
18466 fi
18467 fi
18468fi
18469{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
18470$as_echo "$gl_cv_double_slash_root" >&6; }
18471 if test "$gl_cv_double_slash_root" = yes; then
6ec2e0f5 18472
c0c3707f 18473$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
8690e634 18474
c0c3707f 18475 fi
8690e634 18476
63ce7108
TT
18477
18478
18479
18480
c0c3707f
CB
18481 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
18482 REPLACE_DUP=1
18483 fi
8690e634
JK
18484
18485
18486
18487
18488
c0c3707f
CB
18489 if test $ac_cv_func_fchdir = no; then
18490 HAVE_FCHDIR=0
18491 fi
8690e634 18492
c0c3707f
CB
18493 if test $HAVE_FCHDIR = 0; then
18494 REPLACE_DUP=1
18495 fi
8690e634 18496
c0c3707f
CB
18497 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
18498$as_echo_n "checking whether dup works... " >&6; }
18499if ${gl_cv_func_dup_works+:} false; then :
8690e634
JK
18500 $as_echo_n "(cached) " >&6
18501else
c0c3707f
CB
18502 if test "$cross_compiling" = yes; then :
18503 case "$host_os" in
18504 # Guess no on native Windows.
18505 mingw*) gl_cv_func_dup_works="guessing no" ;;
18506 *) gl_cv_func_dup_works="guessing yes" ;;
18507 esac
8690e634 18508
c0c3707f 18509else
4a626d0a 18510 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 18511/* end confdefs.h. */
c0c3707f
CB
18512#include <unistd.h>
18513 #include <fcntl.h>
18514 #include <errno.h>
9c9d63b1
PM
18515
18516
18517$gl_mda_defines
18518
c0c3707f
CB
18519int
18520main ()
18521{
18522/* On OS/2 kLIBC, dup does not work on a directory fd. */
18523 int fd = open (".", O_RDONLY);
18524 return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
8690e634 18525
c0c3707f
CB
18526 ;
18527 return 0;
18528}
8690e634 18529
c0c3707f
CB
18530_ACEOF
18531if ac_fn_c_try_run "$LINENO"; then :
18532 gl_cv_func_dup_works=yes
18533else
18534 gl_cv_func_dup_works=no
18535fi
18536rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18537 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 18538fi
8690e634 18539
8690e634 18540
c0c3707f
CB
18541fi
18542{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
18543$as_echo "$gl_cv_func_dup_works" >&6; }
18544 case "$gl_cv_func_dup_works" in
18545 *yes) ;;
18546 *)
18547 REPLACE_DUP=1
18548 ;;
18549 esac
8690e634 18550
c0c3707f 18551 if test $REPLACE_DUP = 1; then
8690e634
JK
18552
18553
18554
18555
6ec2e0f5
SDJ
18556
18557
18558
18559
c0c3707f 18560 gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
8690e634 18561
c0c3707f
CB
18562 :
18563 fi
8690e634 18564
5e8754f9 18565
8690e634
JK
18566
18567
8839a007 18568
c0c3707f 18569 GNULIB_DUP=1
63ce7108 18570
63ce7108 18571
63ce7108 18572
6ec2e0f5 18573
6ec2e0f5 18574
c0c3707f 18575$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
6ec2e0f5 18576
63ce7108
TT
18577
18578
472fa5ee
SM
18579
18580
18581
9c9d63b1 18582 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
c0c3707f
CB
18583$as_echo_n "checking whether dup2 works... " >&6; }
18584if ${gl_cv_func_dup2_works+:} false; then :
6ec2e0f5
SDJ
18585 $as_echo_n "(cached) " >&6
18586else
18587 if test "$cross_compiling" = yes; then :
18588 case "$host_os" in
9c9d63b1
PM
18589 mingw*) # on this platform, dup2 always returns 0 for success
18590 gl_cv_func_dup2_works="guessing no" ;;
18591 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
18592 gl_cv_func_dup2_works="guessing no" ;;
18593 aix* | freebsd*)
18594 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
18595 # not EBADF.
18596 gl_cv_func_dup2_works="guessing no" ;;
18597 haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
18598 gl_cv_func_dup2_works="guessing no" ;;
18599 *-android*) # implemented using dup3(), which fails if oldfd == newfd
18600 gl_cv_func_dup2_works="guessing no" ;;
18601 os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
18602 gl_cv_func_dup2_works="guessing no" ;;
18603 *) gl_cv_func_dup2_works="guessing yes" ;;
18604 esac
63ce7108
TT
18605else
18606 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18607/* end confdefs.h. */
18608
9c9d63b1
PM
18609 #include <errno.h>
18610 #include <fcntl.h>
18611 #include <limits.h>
18612 #include <sys/resource.h>
18613 #include <unistd.h>
18614
18615
18616$gl_mda_defines
18617
18618 #ifndef RLIM_SAVED_CUR
18619 # define RLIM_SAVED_CUR RLIM_INFINITY
18620 #endif
18621 #ifndef RLIM_SAVED_MAX
18622 # define RLIM_SAVED_MAX RLIM_INFINITY
18623 #endif
63ce7108
TT
18624
18625int
18626main ()
18627{
6ec2e0f5 18628int result = 0;
9c9d63b1
PM
18629 int bad_fd = INT_MAX;
18630 struct rlimit rlim;
18631 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18632 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18633 && rlim.rlim_cur != RLIM_INFINITY
18634 && rlim.rlim_cur != RLIM_SAVED_MAX
18635 && rlim.rlim_cur != RLIM_SAVED_CUR)
18636 bad_fd = rlim.rlim_cur;
18637 #ifdef FD_CLOEXEC
18638 if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
18639 result |= 1;
18640 #endif
18641 if (dup2 (1, 1) != 1)
18642 result |= 2;
18643 #ifdef FD_CLOEXEC
18644 if (fcntl (1, F_GETFD) != FD_CLOEXEC)
18645 result |= 4;
18646 #endif
18647 close (0);
18648 if (dup2 (0, 0) != -1)
18649 result |= 8;
18650 /* Many gnulib modules require POSIX conformance of EBADF. */
18651 if (dup2 (2, bad_fd) == -1 && errno != EBADF)
18652 result |= 16;
18653 /* Flush out some cygwin core dumps. */
18654 if (dup2 (2, -1) != -1 || errno != EBADF)
18655 result |= 32;
18656 dup2 (2, 255);
18657 dup2 (2, 256);
18658 /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
18659 {
18660 int fd = open (".", O_RDONLY);
18661 if (fd == -1)
18662 result |= 64;
18663 else if (dup2 (fd, fd + 1) == -1)
18664 result |= 128;
18665 close (fd);
18666 }
18667 return result;
63ce7108
TT
18668 ;
18669 return 0;
18670}
c0c3707f 18671
63ce7108
TT
18672_ACEOF
18673if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 18674 gl_cv_func_dup2_works=yes
63ce7108 18675else
c0c3707f 18676 gl_cv_func_dup2_works=no
63ce7108
TT
18677fi
18678rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18679 conftest.$ac_objext conftest.beam conftest.$ac_ext
18680fi
18681
c0c3707f 18682
63ce7108 18683fi
c0c3707f
CB
18684{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
18685$as_echo "$gl_cv_func_dup2_works" >&6; }
9c9d63b1
PM
18686 case "$gl_cv_func_dup2_works" in
18687 *yes) ;;
18688 *)
18689 REPLACE_DUP2=1
18690 for ac_func in setdtablesize
c0c3707f
CB
18691do :
18692 ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
18693if test "x$ac_cv_func_setdtablesize" = xyes; then :
18694 cat >>confdefs.h <<_ACEOF
18695#define HAVE_SETDTABLESIZE 1
18696_ACEOF
18697
18698fi
18699done
18700
9c9d63b1
PM
18701 ;;
18702 esac
63ce7108 18703
09607c9e
TT
18704
18705
18706
c0c3707f
CB
18707 if test $ac_cv_func_fchdir = no; then
18708 HAVE_FCHDIR=0
18709 fi
4a626d0a 18710
c0c3707f 18711 if test $HAVE_FCHDIR = 0; then
9c9d63b1 18712 REPLACE_DUP2=1
c0c3707f 18713 fi
4a626d0a
PA
18714
18715
9c9d63b1 18716 if test $REPLACE_DUP2 = 1; then
4a626d0a
PA
18717
18718
18719
18720
18721
18722
4a626d0a 18723
4a626d0a 18724
c0c3707f 18725 gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
4a626d0a
PA
18726
18727
c0c3707f 18728 fi
4a626d0a
PA
18729
18730
18731
18732
18733
c0c3707f 18734 GNULIB_DUP2=1
4a626d0a
PA
18735
18736
18737
18738
09607c9e 18739
c0c3707f 18740$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
09607c9e
TT
18741
18742
472fa5ee
SM
18743
18744
18745
18746
18747
09607c9e 18748
6ec2e0f5 18749
c0c3707f 18750 GNULIB_ENVIRON=1
6ec2e0f5 18751
09607c9e 18752
09607c9e 18753
6ec2e0f5
SDJ
18754
18755
c0c3707f 18756$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
6ec2e0f5
SDJ
18757
18758
6ec2e0f5 18759
5e8754f9 18760
6ec2e0f5 18761
c0c3707f
CB
18762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
18763$as_echo_n "checking for error_at_line... " >&6; }
18764if ${ac_cv_lib_error_at_line+:} false; then :
09607c9e 18765 $as_echo_n "(cached) " >&6
4a626d0a
PA
18766else
18767 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18768/* end confdefs.h. */
c0c3707f
CB
18769#include <error.h>
18770int
18771main ()
18772{
18773error_at_line (0, 0, "", 0, "an error occurred");
18774 ;
4a626d0a
PA
18775 return 0;
18776}
18777_ACEOF
c0c3707f
CB
18778if ac_fn_c_try_link "$LINENO"; then :
18779 ac_cv_lib_error_at_line=yes
4a626d0a 18780else
c0c3707f 18781 ac_cv_lib_error_at_line=no
6ec2e0f5 18782fi
c0c3707f
CB
18783rm -f core conftest.err conftest.$ac_objext \
18784 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5 18785fi
c0c3707f
CB
18786{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
18787$as_echo "$ac_cv_lib_error_at_line" >&6; }
09607c9e 18788
c0c3707f 18789 if test $ac_cv_lib_error_at_line = no; then
09607c9e
TT
18790
18791
18792
18793
18794
18795
18796
18797
c0c3707f 18798 gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
09607c9e 18799
4a626d0a 18800
09607c9e 18801
c0c3707f 18802 :
4a626d0a 18803
c0c3707f 18804 fi
4a626d0a 18805
4a626d0a 18806
09607c9e 18807
09607c9e 18808
09607c9e
TT
18809
18810
09607c9e 18811
c0c3707f
CB
18812 if test $ac_cv_have_decl_fchdir = no; then
18813 HAVE_DECL_FCHDIR=0
18814 fi
09607c9e
TT
18815
18816
c0c3707f 18817 if test $HAVE_FCHDIR = 0; then
09607c9e
TT
18818
18819
18820
c0c3707f
CB
18821
18822
18823
18824
18825
18826 gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
18827
18828 :
18829
18830$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
18831
18832 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
18833$as_echo_n "checking whether open can visit directories... " >&6; }
18834if ${gl_cv_func_open_directory_works+:} false; then :
18835 $as_echo_n "(cached) " >&6
3d99e817 18836else
c0c3707f
CB
18837 if test "$cross_compiling" = yes; then :
18838 case "$host_os" in
9c9d63b1
PM
18839 # Guess yes on Linux systems.
18840 linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
18841 # Guess yes on glibc systems.
18842 *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
18843 # Guess no on native Windows.
18844 mingw*) gl_cv_func_open_directory_works="guessing no" ;;
18845 # If we don't know, obey --enable-cross-guesses.
18846 *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
18847 esac
c0c3707f
CB
18848
18849else
18850 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18851/* end confdefs.h. */
18852#include <fcntl.h>
18853
9c9d63b1
PM
18854
18855$gl_mda_defines
18856
c0c3707f
CB
18857int
18858main ()
18859{
18860return open(".", O_RDONLY) < 0;
18861 ;
18862 return 0;
18863}
18864_ACEOF
18865if ac_fn_c_try_run "$LINENO"; then :
18866 gl_cv_func_open_directory_works=yes
18867else
18868 gl_cv_func_open_directory_works=no
18869fi
18870rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18871 conftest.$ac_objext conftest.beam conftest.$ac_ext
3d99e817
AK
18872fi
18873
c0c3707f
CB
18874fi
18875{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
18876$as_echo "$gl_cv_func_open_directory_works" >&6; }
18877 case "$gl_cv_func_open_directory_works" in
18878 *yes) ;;
18879 *)
3d99e817 18880
c0c3707f 18881$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
09607c9e 18882
c0c3707f
CB
18883 ;;
18884 esac
18885 fi
8690e634 18886
8690e634 18887
8690e634 18888
8690e634 18889
8690e634 18890
6ec2e0f5 18891
c0c3707f 18892 GNULIB_FCHDIR=1
6ec2e0f5
SDJ
18893
18894
6ec2e0f5 18895
8690e634
JK
18896
18897
c0c3707f 18898$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
8690e634
JK
18899
18900
18901
6ec2e0f5
SDJ
18902
18903
18904
6ec2e0f5 18905
8690e634 18906
c0c3707f 18907 if test $ac_cv_func_fcntl = no; then
8690e634
JK
18908
18909
6ec2e0f5 18910
c0c3707f
CB
18911 if test $ac_cv_func_fcntl = no; then
18912 HAVE_FCNTL=0
18913 else
18914 REPLACE_FCNTL=1
18915 fi
5e8754f9 18916
c0c3707f
CB
18917 else
18918 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
18919$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
18920if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
8690e634 18921 $as_echo_n "(cached) " >&6
6ec2e0f5 18922else
c0c3707f
CB
18923 if test "$cross_compiling" = yes; then :
18924 case $host_os in
18925 aix* | cygwin* | haiku*)
18926 gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
18927 *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
18928 esac
18929else
18930 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18931/* end confdefs.h. */
18932#include <errno.h>
18933 #include <fcntl.h>
18934 #include <limits.h>
18935 #include <sys/resource.h>
18936 #include <unistd.h>
9c9d63b1
PM
18937
18938
18939$gl_mda_defines
18940
c0c3707f
CB
18941 #ifndef RLIM_SAVED_CUR
18942 # define RLIM_SAVED_CUR RLIM_INFINITY
18943 #endif
18944 #ifndef RLIM_SAVED_MAX
18945 # define RLIM_SAVED_MAX RLIM_INFINITY
18946 #endif
18947
18948int
18949main ()
18950{
18951int result = 0;
18952 int bad_fd = INT_MAX;
18953 struct rlimit rlim;
18954 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18955 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18956 && rlim.rlim_cur != RLIM_INFINITY
18957 && rlim.rlim_cur != RLIM_SAVED_MAX
18958 && rlim.rlim_cur != RLIM_SAVED_CUR)
18959 bad_fd = rlim.rlim_cur;
18960 if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
18961 if (errno != EINVAL) result |= 2;
18962 if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
18963 if (errno != EINVAL) result |= 8;
18964 /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
18965 {
18966 int fd;
18967 fd = open (".", O_RDONLY);
18968 if (fd == -1)
18969 result |= 16;
18970 else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
18971 result |= 32;
18972
18973 close (fd);
18974 }
18975 return result;
18976 ;
18977 return 0;
18978}
18979_ACEOF
18980if ac_fn_c_try_run "$LINENO"; then :
18981 gl_cv_func_fcntl_f_dupfd_works=yes
18982else
18983 gl_cv_func_fcntl_f_dupfd_works=no
18984fi
18985rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18986 conftest.$ac_objext conftest.beam conftest.$ac_ext
18987fi
18988
18989fi
18990{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
18991$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
18992 case $gl_cv_func_fcntl_f_dupfd_works in
18993 *yes) ;;
18994 *)
18995
18996
18997 if test $ac_cv_func_fcntl = no; then
18998 HAVE_FCNTL=0
18999 else
19000 REPLACE_FCNTL=1
19001 fi
19002
19003
19004$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
19005 ;;
19006 esac
19007
9c9d63b1 19008 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
c0c3707f
CB
19009$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
19010if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
19011 $as_echo_n "(cached) " >&6
9c9d63b1
PM
19012else
19013 if test "$cross_compiling" = yes; then :
19014 case "$host_os" in
19015 # Guess no on NetBSD.
19016 netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
19017 *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
19018 esac
19019
8690e634
JK
19020else
19021 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19022/* end confdefs.h. */
c0c3707f 19023#include <fcntl.h>
9c9d63b1
PM
19024 #include <unistd.h>
19025 int main (int argc, char *argv[])
19026 {
19027 if (argc == 1)
19028 /* parent process */
19029 {
19030 if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
19031 return 1;
19032 return execl ("./conftest", "./conftest", "child", NULL);
19033 }
19034 else
19035 /* child process */
19036 return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
19037 }
c0c3707f 19038
c0c3707f 19039
c0c3707f 19040_ACEOF
9c9d63b1 19041if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
19042 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19043/* end confdefs.h. */
19044
19045#ifdef __linux__
19046/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
19047 it to support the semantics on older kernels that failed with EINVAL. */
19048choke me
19049#endif
8690e634 19050
8690e634
JK
19051int
19052main ()
19053{
19054
19055 ;
19056 return 0;
19057}
19058_ACEOF
c0c3707f
CB
19059if ac_fn_c_try_compile "$LINENO"; then :
19060 gl_cv_func_fcntl_f_dupfd_cloexec=yes
8690e634 19061else
c0c3707f 19062 gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
8690e634 19063fi
c0c3707f 19064rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1 19065
c0c3707f
CB
19066else
19067 gl_cv_func_fcntl_f_dupfd_cloexec=no
19068fi
9c9d63b1
PM
19069rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19070 conftest.$ac_objext conftest.beam conftest.$ac_ext
19071fi
19072
19073
8690e634 19074fi
c0c3707f
CB
19075{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
19076$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
9c9d63b1
PM
19077 case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
19078 *yes) ;;
19079 *)
8690e634 19080
c0c3707f
CB
19081
19082 if test $ac_cv_func_fcntl = no; then
19083 HAVE_FCNTL=0
5e8754f9 19084 else
c0c3707f
CB
19085 REPLACE_FCNTL=1
19086 fi
19087
9c9d63b1
PM
19088 ;;
19089 esac
8690e634
JK
19090 fi
19091
19092
8690e634 19093
8690e634 19094
c0c3707f
CB
19095 if test $ac_cv_func_fchdir = no; then
19096 HAVE_FCHDIR=0
19097 fi
6ec2e0f5 19098
c0c3707f 19099 if test $HAVE_FCHDIR = 0; then
6ec2e0f5
SDJ
19100
19101
19102
c0c3707f
CB
19103 if test $ac_cv_func_fcntl = no; then
19104 HAVE_FCNTL=0
19105 else
19106 REPLACE_FCNTL=1
19107 fi
6ec2e0f5 19108
c0c3707f 19109 fi
6ec2e0f5
SDJ
19110
19111
c0c3707f 19112 if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
6ec2e0f5 19113
6ec2e0f5
SDJ
19114
19115
5e8754f9
SDJ
19116
19117
8690e634 19118
8690e634
JK
19119
19120
c0c3707f 19121 gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
472fa5ee 19122
c0c3707f 19123 fi
472fa5ee
SM
19124
19125
19126
19127
19128
c0c3707f 19129 GNULIB_FCNTL=1
472fa5ee
SM
19130
19131
19132
19133
19134
c0c3707f 19135$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
472fa5ee
SM
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
c0c3707f
CB
19150 if test $gl_cv_have_include_next = yes; then
19151 gl_cv_next_fcntl_h='<'fcntl.h'>'
19152 else
19153 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
19154$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
19155if ${gl_cv_next_fcntl_h+:} false; then :
19156 $as_echo_n "(cached) " >&6
19157else
472fa5ee
SM
19158
19159
472fa5ee 19160
c0c3707f
CB
19161 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19162/* end confdefs.h. */
19163#include <fcntl.h>
19164_ACEOF
19165 case "$host_os" in
19166 aix*) gl_absname_cpp="$ac_cpp -C" ;;
19167 *) gl_absname_cpp="$ac_cpp" ;;
19168 esac
472fa5ee 19169
c0c3707f
CB
19170 case "$host_os" in
19171 mingw*)
19172 gl_dirsep_regex='[/\\]'
19173 ;;
19174 *)
19175 gl_dirsep_regex='\/'
19176 ;;
19177 esac
19178 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
19179 gl_header_literal_regex=`echo 'fcntl.h' \
19180 | sed -e "$gl_make_literal_regex_sed"`
19181 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
19182 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
19183 s|^/[^/]|//&|
19184 p
19185 q
19186 }'
472fa5ee 19187
c0c3707f
CB
19188 gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
19189 sed -n "$gl_absolute_header_sed"`
472fa5ee 19190
c0c3707f
CB
19191 gl_header=$gl_cv_absolute_fcntl_h
19192 gl_cv_next_fcntl_h='"'$gl_header'"'
8690e634
JK
19193
19194
c0c3707f
CB
19195fi
19196{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
19197$as_echo "$gl_cv_next_fcntl_h" >&6; }
19198 fi
19199 NEXT_FCNTL_H=$gl_cv_next_fcntl_h
8690e634 19200
c0c3707f
CB
19201 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
19202 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
19203 gl_next_as_first_directive='<'fcntl.h'>'
19204 else
19205 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
19206 gl_next_as_first_directive=$gl_cv_next_fcntl_h
19207 fi
19208 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
8690e634
JK
19209
19210
19211
19212
5e8754f9
SDJ
19213
19214
19215
19216
472fa5ee
SM
19217
19218
19219
19220
19221
19222
19223
5e8754f9 19224cat >>confdefs.h <<_ACEOF
c0c3707f 19225#define GNULIB_FD_SAFER_FLAG 1
5e8754f9 19226_ACEOF
472fa5ee
SM
19227
19228
c0c3707f
CB
19229
19230
19231
19232
19233
19234 ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
19235#include <dirent.h>
19236
5e8754f9 19237"
c0c3707f 19238if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
5e8754f9
SDJ
19239 ac_have_decl=1
19240else
19241 ac_have_decl=0
19242fi
472fa5ee 19243
5e8754f9 19244cat >>confdefs.h <<_ACEOF
c0c3707f 19245#define HAVE_DECL_FDOPENDIR $ac_have_decl
5e8754f9 19246_ACEOF
c0c3707f 19247if test $ac_have_decl = 1; then :
472fa5ee 19248
c0c3707f
CB
19249else
19250 HAVE_DECL_FDOPENDIR=0
19251fi
472fa5ee
SM
19252
19253
c0c3707f
CB
19254 if test $ac_cv_func_fdopendir = no; then
19255 HAVE_FDOPENDIR=0
19256 else
19257 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
19258$as_echo_n "checking whether fdopendir works... " >&6; }
19259if ${gl_cv_func_fdopendir_works+:} false; then :
19260 $as_echo_n "(cached) " >&6
19261else
19262 if test "$cross_compiling" = yes; then :
19263 case "$host_os" in
19264 # Guess yes on glibc systems.
19265 *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
19266 # Guess yes on musl systems.
19267 *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
19268 # If we don't know, obey --enable-cross-guesses.
19269 *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
19270 esac
472fa5ee 19271
c0c3707f
CB
19272else
19273 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19274/* end confdefs.h. */
472fa5ee 19275
c0c3707f
CB
19276#include <dirent.h>
19277#include <fcntl.h>
19278#include <unistd.h>
9c9d63b1
PM
19279
19280
19281$gl_mda_defines
19282
c0c3707f
CB
19283#if !HAVE_DECL_FDOPENDIR
19284extern
19285# ifdef __cplusplus
19286"C"
19287# endif
19288DIR *fdopendir (int);
19289#endif
472fa5ee 19290
c0c3707f
CB
19291int
19292main ()
19293{
19294int result = 0;
9c9d63b1
PM
19295 int fd = open ("conftest.c", O_RDONLY);
19296 if (fd < 0) result |= 1;
19297 if (fdopendir (fd)) result |= 2;
19298 if (close (fd)) result |= 4;
19299 return result;
19300
c0c3707f
CB
19301 ;
19302 return 0;
19303}
19304_ACEOF
19305if ac_fn_c_try_run "$LINENO"; then :
19306 gl_cv_func_fdopendir_works=yes
19307else
19308 gl_cv_func_fdopendir_works=no
19309fi
19310rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19311 conftest.$ac_objext conftest.beam conftest.$ac_ext
19312fi
472fa5ee 19313
c0c3707f
CB
19314fi
19315{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
19316$as_echo "$gl_cv_func_fdopendir_works" >&6; }
19317 case "$gl_cv_func_fdopendir_works" in
19318 *yes) ;;
19319 *)
19320 REPLACE_FDOPENDIR=1
19321 ;;
19322 esac
19323 fi
472fa5ee 19324
c0c3707f 19325 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
472fa5ee
SM
19326
19327
19328
19329
19330
98399780 19331
5e8754f9
SDJ
19332
19333
c0c3707f 19334 gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
5e8754f9 19335
c0c3707f 19336 fi
5e8754f9
SDJ
19337
19338
19339
19340
19341
c0c3707f 19342 GNULIB_FDOPENDIR=1
5e8754f9
SDJ
19343
19344
19345
19346
19347
c0c3707f 19348$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
5e8754f9
SDJ
19349
19350
5e8754f9
SDJ
19351
19352
19353
c0c3707f
CB
19354cat >>confdefs.h <<_ACEOF
19355#define GNULIB_FDOPENDIR 1
19356_ACEOF
5e8754f9
SDJ
19357
19358
19359
5e8754f9
SDJ
19360
19361
19362
c0c3707f
CB
19363 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
19364$as_echo_n "checking for flexible array member... " >&6; }
19365if ${ac_cv_c_flexmember+:} false; then :
5e8754f9 19366 $as_echo_n "(cached) " >&6
6ec2e0f5 19367else
c0c3707f 19368 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 19369/* end confdefs.h. */
c0c3707f
CB
19370#include <stdlib.h>
19371 #include <stdio.h>
19372 #include <stddef.h>
19373 struct m { struct m *next, **list; char name[]; };
19374 struct s { struct s *p; struct m *m; int n; double d[]; };
5e8754f9
SDJ
19375int
19376main ()
19377{
c0c3707f
CB
19378int m = getchar ();
19379 size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
19380 nbytes += sizeof (struct s) - 1;
19381 nbytes -= nbytes % sizeof (struct s);
19382 struct s *p = malloc (nbytes);
19383 p->p = p;
19384 p->m = NULL;
19385 p->d[0] = 0.0;
19386 return p->d != (double *) NULL;
5e8754f9
SDJ
19387 ;
19388 return 0;
19389}
7a6dbc2f 19390_ACEOF
c0c3707f
CB
19391if ac_fn_c_try_compile "$LINENO"; then :
19392 ac_cv_c_flexmember=yes
5e8754f9 19393else
c0c3707f 19394 ac_cv_c_flexmember=no
5e8754f9 19395fi
c0c3707f 19396rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5e8754f9 19397fi
c0c3707f
CB
19398{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
19399$as_echo "$ac_cv_c_flexmember" >&6; }
19400 if test $ac_cv_c_flexmember = yes; then
19401
19402$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
5e8754f9 19403
c0c3707f
CB
19404 else
19405 $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
98399780 19406
c0c3707f 19407 fi
98399780 19408
472fa5ee
SM
19409
19410
19411
c0c3707f
CB
19412 FLOAT_H=
19413 REPLACE_FLOAT_LDBL=0
19414 case "$host_os" in
19415 aix* | beos* | openbsd* | mirbsd* | irix*)
19416 FLOAT_H=float.h
19417 ;;
19418 freebsd* | dragonfly*)
19419 case "$host_cpu" in
19420 i[34567]86 )
19421 FLOAT_H=float.h
19422 ;;
19423 x86_64 )
19424 # On x86_64 systems, the C compiler may still be generating
19425 # 32-bit code.
19426 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19427/* end confdefs.h. */
19428#if defined __LP64__ || defined __x86_64__ || defined __amd64__
19429 int ok;
19430 #else
19431 error fail
19432 #endif
472fa5ee 19433
c0c3707f
CB
19434_ACEOF
19435if ac_fn_c_try_compile "$LINENO"; then :
472fa5ee 19436
c0c3707f
CB
19437else
19438 FLOAT_H=float.h
19439fi
19440rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19441 ;;
19442 esac
19443 ;;
19444 linux*)
19445 case "$host_cpu" in
19446 powerpc*)
19447 FLOAT_H=float.h
19448 ;;
19449 esac
19450 ;;
19451 esac
19452 case "$host_os" in
19453 aix* | freebsd* | dragonfly* | linux*)
19454 if test -n "$FLOAT_H"; then
19455 REPLACE_FLOAT_LDBL=1
19456 fi
19457 ;;
19458 esac
19459
19460 REPLACE_ITOLD=0
19461 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
19462$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
19463if ${gl_cv_func_itold_works+:} false; then :
5e8754f9
SDJ
19464 $as_echo_n "(cached) " >&6
19465else
19466
19467 if test "$cross_compiling" = yes; then :
c0c3707f
CB
19468 case "$host" in
19469 sparc*-*-linux*)
19470 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19471/* end confdefs.h. */
19472#if defined __LP64__ || defined __arch64__
19473 int ok;
19474 #else
19475 error fail
19476 #endif
19477
19478_ACEOF
19479if ac_fn_c_try_compile "$LINENO"; then :
19480 gl_cv_func_itold_works="guessing no"
19481else
19482 gl_cv_func_itold_works="guessing yes"
19483fi
19484rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19485 ;;
19486 # Guess yes on native Windows.
19487 mingw*) gl_cv_func_itold_works="guessing yes" ;;
19488 *) gl_cv_func_itold_works="guessing yes" ;;
5e8754f9
SDJ
19489 esac
19490
19491else
19492 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19493/* end confdefs.h. */
19494
c0c3707f
CB
19495int i = -1;
19496volatile long double ld;
19497int main ()
5e8754f9 19498{
c0c3707f
CB
19499 ld += i * 1.0L;
19500 if (ld > 0)
19501 return 1;
19502 return 0;
5e8754f9
SDJ
19503}
19504_ACEOF
19505if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 19506 gl_cv_func_itold_works=yes
5e8754f9 19507else
c0c3707f 19508 gl_cv_func_itold_works=no
5e8754f9
SDJ
19509fi
19510rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19511 conftest.$ac_objext conftest.beam conftest.$ac_ext
19512fi
19513
98399780 19514
5e8754f9 19515fi
c0c3707f
CB
19516{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
19517$as_echo "$gl_cv_func_itold_works" >&6; }
19518 case "$gl_cv_func_itold_works" in
19519 *no)
19520 REPLACE_ITOLD=1
19521 FLOAT_H=float.h
19522 ;;
19523 esac
98399780 19524
c0c3707f 19525 if test -n "$FLOAT_H"; then
98399780
YQ
19526
19527
19528
19529
6a29c58e
YQ
19530
19531
19532
19533
c0c3707f
CB
19534 if test $gl_cv_have_include_next = yes; then
19535 gl_cv_next_float_h='<'float.h'>'
19536 else
19537 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
19538$as_echo_n "checking absolute name of <float.h>... " >&6; }
19539if ${gl_cv_next_float_h+:} false; then :
19540 $as_echo_n "(cached) " >&6
19541else
19542
19543
19544
19545 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19546/* end confdefs.h. */
19547#include <float.h>
19548_ACEOF
19549 case "$host_os" in
19550 aix*) gl_absname_cpp="$ac_cpp -C" ;;
19551 *) gl_absname_cpp="$ac_cpp" ;;
19552 esac
19553
19554 case "$host_os" in
19555 mingw*)
19556 gl_dirsep_regex='[/\\]'
19557 ;;
19558 *)
19559 gl_dirsep_regex='\/'
19560 ;;
19561 esac
19562 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
19563 gl_header_literal_regex=`echo 'float.h' \
19564 | sed -e "$gl_make_literal_regex_sed"`
19565 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
19566 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
19567 s|^/[^/]|//&|
19568 p
19569 q
19570 }'
19571
19572 gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
19573 sed -n "$gl_absolute_header_sed"`
19574
19575 gl_header=$gl_cv_absolute_float_h
19576 gl_cv_next_float_h='"'$gl_header'"'
19577
19578
19579fi
19580{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
19581$as_echo "$gl_cv_next_float_h" >&6; }
19582 fi
19583 NEXT_FLOAT_H=$gl_cv_next_float_h
19584
19585 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
19586 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
19587 gl_next_as_first_directive='<'float.h'>'
19588 else
19589 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
19590 gl_next_as_first_directive=$gl_cv_next_float_h
19591 fi
19592 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
19593
19594
19595
6a29c58e 19596
c0c3707f 19597 fi
6a29c58e 19598
c0c3707f
CB
19599 if test -n "$FLOAT_H"; then
19600 GL_GENERATE_FLOAT_H_TRUE=
19601 GL_GENERATE_FLOAT_H_FALSE='#'
19602else
19603 GL_GENERATE_FLOAT_H_TRUE='#'
19604 GL_GENERATE_FLOAT_H_FALSE=
19605fi
6a29c58e
YQ
19606
19607
8690e634 19608
c0c3707f 19609 if test $REPLACE_FLOAT_LDBL = 1; then
8690e634 19610
8690e634 19611
8690e634 19612
8690e634 19613
8690e634 19614
8690e634 19615
8690e634 19616
4a626d0a 19617
c0c3707f 19618 gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
8690e634 19619
c0c3707f
CB
19620 fi
19621 if test $REPLACE_ITOLD = 1; then
8690e634
JK
19622
19623
19624
19625
19626
19627
63ce7108 19628
e26b6bb0 19629
c0c3707f 19630 gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
e26b6bb0 19631
c0c3707f 19632 fi
e26b6bb0
TT
19633
19634
19635
19636
c0c3707f
CB
19637 gl_fnmatch_required_lowercase=`
19638 echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
19639 `
e26b6bb0 19640
c0c3707f
CB
19641 if test $ac_cv_func_fnmatch = no; then
19642 HAVE_FNMATCH=0
19643 else
19644 gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
19645 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
19646$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; }
19647if eval \${$gl_fnmatch_cache_var+:} false; then :
5e8754f9
SDJ
19648 $as_echo_n "(cached) " >&6
19649else
c0c3707f
CB
19650 if test $gl_fnmatch_required = GNU; then
19651 gl_fnmatch_gnu_start=
19652 gl_fnmatch_gnu_end=
19653 else
19654 gl_fnmatch_gnu_start='#if 0'
19655 gl_fnmatch_gnu_end='#endif'
19656 fi
19657 if test "$cross_compiling" = yes; then :
19658 case "$host_os" in
19659 # Guess yes on musl systems.
19660 *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
19661 # Guess no otherwise, even on glibc systems.
19662 *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
19663 esac
e26b6bb0 19664
c0c3707f
CB
19665else
19666 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 19667/* end confdefs.h. */
c0c3707f
CB
19668#include <fnmatch.h>
19669 static int
19670 y (char const *pattern, char const *string, int flags)
19671 {
19672 return fnmatch (pattern, string, flags) == 0;
19673 }
19674 static int
19675 n (char const *pattern, char const *string, int flags)
19676 {
19677 return fnmatch (pattern, string, flags) == FNM_NOMATCH;
19678 }
19679
5e8754f9
SDJ
19680int
19681main ()
19682{
c0c3707f
CB
19683char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
19684 char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
19685 static char const A_1[] = { 'A' - 1, 0 };
19686 static char const A01[] = { 'A' + 1, 0 };
19687 static char const a_1[] = { 'a' - 1, 0 };
19688 static char const a01[] = { 'a' + 1, 0 };
19689 static char const bs_1[] = { '\\\\' - 1, 0 };
19690 static char const bs01[] = { '\\\\' + 1, 0 };
19691 int result = 0;
19692 if (!n ("a*", "", 0))
19693 return 1;
19694 if (!y ("a*", "abc", 0))
19695 return 1;
19696 if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
19697 return 1;
19698 if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
19699 return 2;
19700 if (!y ("a\\\\bc", "abc", 0))
19701 return 3;
19702 if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
19703 return 3;
19704 if (!y ("*x", ".x", 0))
19705 return 4;
19706 if (!n ("*x", ".x", FNM_PERIOD))
19707 return 4;
19708 if (!y (Apat, "\\\\", 0))
19709 return 5;
19710 if (!y (Apat, "A", 0))
19711 return 5;
19712 if (!y (apat, "\\\\", 0))
19713 return 5;
19714 if (!y (apat, "a", 0))
19715 return 5;
19716 if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
19717 return 5;
19718 if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
19719 return 5;
19720 if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
19721 return 5;
19722 if (!(y (apat, a01, 0) == ('a' < '\\\\')))
19723 return 5;
19724 if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
19725 return 5;
19726 if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
19727 return 5;
19728 if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
19729 return 5;
19730 if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
19731 return 5;
19732 $gl_fnmatch_gnu_start
19733 if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
19734 result |= 8;
19735 if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
19736 result |= 16;
19737 if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
19738 result |= 32;
19739 if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
19740 result |= 64;
19741 if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
19742 result |= 64;
19743 if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
19744 result |= 64;
19745 $gl_fnmatch_gnu_end
19746 return result;
19747
5e8754f9
SDJ
19748 ;
19749 return 0;
19750}
19751_ACEOF
c0c3707f
CB
19752if ac_fn_c_try_run "$LINENO"; then :
19753 eval "$gl_fnmatch_cache_var=yes"
5e8754f9 19754else
c0c3707f
CB
19755 eval "$gl_fnmatch_cache_var=no"
19756fi
19757rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19758 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 19759fi
c0c3707f 19760
e26b6bb0 19761
5e8754f9 19762fi
c0c3707f
CB
19763eval ac_res=\$$gl_fnmatch_cache_var
19764 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
19765$as_echo "$ac_res" >&6; }
19766 eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
19767 case "$gl_fnmatch_result" in
19768 *yes) ;;
19769 *) REPLACE_FNMATCH=1 ;;
19770 esac
19771 fi
19772 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
e26b6bb0 19773
e26b6bb0 19774
c0c3707f
CB
19775 FNMATCH_H='fnmatch.h'
19776 if test -n "$FNMATCH_H"; then
19777 GL_GENERATE_FNMATCH_H_TRUE=
19778 GL_GENERATE_FNMATCH_H_FALSE='#'
5e8754f9 19779else
c0c3707f
CB
19780 GL_GENERATE_FNMATCH_H_TRUE='#'
19781 GL_GENERATE_FNMATCH_H_FALSE=
5e8754f9 19782fi
e26b6bb0 19783
18848e28 19784
c0c3707f 19785 fi
18848e28 19786
c0c3707f 19787 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18848e28 19788
18848e28 19789
18848e28 19790
c0c3707f
CB
19791
19792
19793
19794
19795
19796 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19797
19798
19799
c0c3707f
CB
19800
19801
19802 fi
19803
19804
19805
19806
19807
19808 GNULIB_FNMATCH=1
19809
19810
19811
19812
19813
19814$as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h
19815
19816
19817
19818
19819
19820
19821
19822
19823 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
19824
19825
19826
19827
19828
19829
19830
19831
19832 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19833
19834
19835
18848e28 19836
18848e28 19837
5e8754f9 19838 fi
18848e28 19839
18848e28 19840
c0c3707f
CB
19841cat >>confdefs.h <<_ACEOF
19842#define GNULIB_FNMATCH_GNU 1
19843_ACEOF
18848e28 19844
18848e28 19845
18848e28 19846
18848e28 19847
9c9d63b1
PM
19848
19849
19850 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether free is known to preserve errno" >&5
19851$as_echo_n "checking whether free is known to preserve errno... " >&6; }
19852if ${gl_cv_func_free_preserves_errno+:} false; then :
19853 $as_echo_n "(cached) " >&6
19854else
19855 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19856/* end confdefs.h. */
19857#include <stdlib.h>
19858
19859int
19860main ()
19861{
19862#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
19863 #elif defined __OpenBSD__
19864 #elif defined __sun
19865 #else
19866 #error "'free' is not known to preserve errno"
19867 #endif
19868
19869 ;
19870 return 0;
19871}
19872_ACEOF
19873if ac_fn_c_try_compile "$LINENO"; then :
19874 gl_cv_func_free_preserves_errno=yes
19875else
19876 gl_cv_func_free_preserves_errno=no
19877fi
19878rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19879
19880fi
19881{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_free_preserves_errno" >&5
19882$as_echo "$gl_cv_func_free_preserves_errno" >&6; }
19883
19884 case $gl_cv_func_free_preserves_errno in
19885 *yes) ;;
19886 *) REPLACE_FREE=1 ;;
19887 esac
19888
19889 if test $REPLACE_FREE = 1; then
19890
19891
19892
19893
19894
19895
19896
19897
19898 gl_LIBOBJS="$gl_LIBOBJS free.$ac_objext"
19899
19900 :
19901 fi
19902
19903
19904
19905
19906
19907 GNULIB_FREE_POSIX=1
19908
19909
19910
19911
19912
19913$as_echo "#define GNULIB_TEST_FREE_POSIX 1" >>confdefs.h
19914
19915
19916
19917
c0c3707f
CB
19918 if test $gl_func_frexp != yes; then
19919
19920
18848e28
GF
19921
19922
18848e28 19923
18848e28 19924
18848e28 19925
c0c3707f
CB
19926
19927 gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
18848e28
GF
19928
19929 fi
19930
19931
19932
19933
19934
c0c3707f 19935 GNULIB_FREXP=1
18848e28
GF
19936
19937
19938
19939
19940
c0c3707f 19941$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
18848e28
GF
19942
19943
19944
19945
c0c3707f
CB
19946 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
19947
19948
19949
18848e28
GF
19950
19951
19952
5e8754f9
SDJ
19953
19954
c0c3707f
CB
19955 gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
19956
5e8754f9 19957 fi
18848e28 19958
6a29c58e 19959
6a29c58e 19960
6a29c58e 19961
6ec2e0f5 19962
c0c3707f
CB
19963 GNULIB_FREXPL=1
19964
19965
19966
19967
19968
19969$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
19970
19971
19972
19973
19974
19975
19976
19977 case "$host_os" in
19978 mingw* | solaris*)
19979 REPLACE_FSTAT=1
19980 ;;
19981 esac
472fa5ee
SM
19982
19983
19984
19985
19986
6ec2e0f5
SDJ
19987 if test $ac_cv_func_fchdir = no; then
19988 HAVE_FCHDIR=0
6a29c58e
YQ
19989 fi
19990
6ec2e0f5
SDJ
19991 if test $HAVE_FCHDIR = 0; then
19992 case "$gl_cv_func_open_directory_works" in
19993 *yes) ;;
19994 *)
19995 REPLACE_FSTAT=1
19996 ;;
19997 esac
19998 fi
6a29c58e
YQ
19999
20000
6ec2e0f5 20001 if test $REPLACE_FSTAT = 1; then
6a29c58e 20002
3d99e817
AK
20003
20004
20005
3d99e817
AK
20006
20007
20008
20009
6ec2e0f5 20010 gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
3d99e817 20011
c0c3707f
CB
20012 case "$host_os" in
20013 mingw*)
3d99e817
AK
20014
20015
20016
20017
20018
20019
49e4877c 20020
49e4877c 20021
c0c3707f 20022 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
49e4877c 20023
c0c3707f
CB
20024 ;;
20025 esac
49e4877c
PA
20026
20027
9c9d63b1 20028
c0c3707f
CB
20029 :
20030
20031 fi
6a29c58e
YQ
20032
20033
88b48903 20034
8690e634 20035
a512b375 20036
c0c3707f
CB
20037 GNULIB_FSTAT=1
20038
20039
20040
20041
20042
20043$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
20044
20045
88b48903 20046
88b48903 20047
472fa5ee
SM
20048
20049
20050
20051
20052
6ec2e0f5
SDJ
20053
20054 if test $ac_cv_func_fstatat = no; then
20055 HAVE_FSTATAT=0
20056 else
20057 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
20058$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
d0ac1c44 20059if ${gl_cv_func_fstatat_zero_flag+:} false; then :
6ec2e0f5
SDJ
20060 $as_echo_n "(cached) " >&6
20061else
20062 if test "$cross_compiling" = yes; then :
20063 case "$host_os" in
20064 aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
20065 *) gl_cv_func_fstatat_zero_flag="guessing yes";;
20066 esac
88b48903 20067
8690e634
JK
20068else
20069 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20070/* end confdefs.h. */
8690e634 20071
6ec2e0f5
SDJ
20072 #include <fcntl.h>
20073 #include <sys/stat.h>
20074 int
20075 main (void)
20076 {
20077 struct stat a;
20078 return fstatat (AT_FDCWD, ".", &a, 0) != 0;
20079 }
20080
88b48903
WN
20081_ACEOF
20082if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20083 gl_cv_func_fstatat_zero_flag=yes
88b48903 20084else
6ec2e0f5 20085 gl_cv_func_fstatat_zero_flag=no
88b48903
WN
20086fi
20087rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20088 conftest.$ac_objext conftest.beam conftest.$ac_ext
20089fi
20090
20091
20092fi
6ec2e0f5
SDJ
20093{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
20094$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
88b48903 20095
6ec2e0f5
SDJ
20096 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
20097 *yes+*yes) ;;
c0c3707f
CB
20098 *) REPLACE_FSTATAT=1 ;;
20099 esac
20100
20101 case $host_os in
20102 solaris*)
20103 REPLACE_FSTATAT=1 ;;
20104 esac
20105
20106 case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
20107 1,*yes)
88b48903 20108
6ec2e0f5 20109$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
88b48903 20110
7a6dbc2f 20111 ;;
6ec2e0f5
SDJ
20112 esac
20113 fi
88b48903 20114
6ec2e0f5 20115 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
88b48903
WN
20116
20117
20118
20119
20120
88b48903 20121
4a626d0a
PA
20122
20123
6ec2e0f5
SDJ
20124 gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
20125
20126 fi
20127
20128
20129
4a626d0a 20130
6ec2e0f5
SDJ
20131
20132 GNULIB_FSTATAT=1
20133
20134
20135
20136
20137
20138$as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
20139
20140
20141
20142
20143
20144
20145
20146
20147 gl_abort_bug=no
4a626d0a
PA
20148 case "$host_os" in
20149 mingw*)
6ec2e0f5 20150 gl_cv_func_getcwd_path_max=yes
4a626d0a
PA
20151 ;;
20152 *)
88b48903 20153
88b48903 20154
88b48903
WN
20155
20156
88b48903 20157
6ec2e0f5
SDJ
20158 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
20159$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
d0ac1c44 20160if ${gl_cv_func_getcwd_path_max+:} false; then :
6ec2e0f5
SDJ
20161 $as_echo_n "(cached) " >&6
20162else
20163 # Arrange for deletion of the temporary directory this test creates.
20164 ac_clean_files="$ac_clean_files confdir3"
20165 if test "$cross_compiling" = yes; then :
b567ca63 20166 # Cross-compilation guesses:
c0c3707f
CB
20167 case "$host_os" in
20168 aix*) # On AIX, it has the AIX bug.
20169 gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
20170 gnu*) # On Hurd, it is 'yes'.
20171 gl_cv_func_getcwd_path_max='guessing yes' ;;
20172 linux* | kfreebsd*)
20173 # On older Linux+glibc it's 'no, but it is partly working',
20174 # on newer Linux+glibc it's 'yes'.
20175 # On Linux+musl libc, it's 'no, but it is partly working'.
20176 # On kFreeBSD+glibc, it's 'no, but it is partly working'.
20177 gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
20178 *) # If we don't know, obey --enable-cross-guesses.
20179 gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
20180 esac
b567ca63 20181
6ec2e0f5
SDJ
20182else
20183 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20184/* end confdefs.h. */
88b48903 20185
6ec2e0f5
SDJ
20186#include <errno.h>
20187#include <stdlib.h>
20188#if HAVE_UNISTD_H
20189# include <unistd.h>
20190#else
20191# include <direct.h>
20192#endif
20193#include <string.h>
20194#include <limits.h>
20195#include <sys/stat.h>
20196#include <sys/types.h>
20197#include <fcntl.h>
88b48903
WN
20198
20199
6ec2e0f5
SDJ
20200/* Arrange to define PATH_MAX, like "pathmax.h" does. */
20201#if HAVE_UNISTD_H
20202# include <unistd.h>
20203#endif
20204#include <limits.h>
20205#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
20206# include <sys/param.h>
20207#endif
20208#if !defined PATH_MAX && defined MAXPATHLEN
20209# define PATH_MAX MAXPATHLEN
20210#endif
20211#ifdef __hpux
20212# undef PATH_MAX
20213# define PATH_MAX 1024
20214#endif
c0c3707f 20215#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
20216# undef PATH_MAX
20217# define PATH_MAX 260
20218#endif
88b48903 20219
88b48903 20220
6ec2e0f5
SDJ
20221#ifndef AT_FDCWD
20222# define AT_FDCWD 0
20223#endif
20224#ifdef ENAMETOOLONG
20225# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
20226#else
20227# define is_ENAMETOOLONG(x) 0
20228#endif
88b48903 20229
6ec2e0f5
SDJ
20230/* Use the getcwd function, not any macro. */
20231#undef getcwd
88b48903 20232
9c9d63b1
PM
20233
20234
20235$gl_mda_defines
20236
88b48903 20237
6ec2e0f5
SDJ
20238#ifndef S_IRWXU
20239# define S_IRWXU 0700
20240#endif
88b48903 20241
6ec2e0f5
SDJ
20242/* The length of this name must be 8. */
20243#define DIR_NAME "confdir3"
20244#define DIR_NAME_LEN 8
20245#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
88b48903 20246
6ec2e0f5
SDJ
20247/* The length of "../". */
20248#define DOTDOTSLASH_LEN 3
88b48903 20249
6ec2e0f5
SDJ
20250/* Leftover bytes in the buffer, to work around library or OS bugs. */
20251#define BUF_SLOP 20
88b48903 20252
6ec2e0f5
SDJ
20253int
20254main ()
20255{
20256#ifndef PATH_MAX
20257 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
20258 at least not on a local file system. And if we were to start worrying
20259 about remote file systems, we'd have to enable the wrapper function
20260 all of the time, just to be safe. That's not worth the cost. */
20261 exit (0);
20262#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
20263 - DIR_NAME_SIZE - BUF_SLOP) \
20264 <= PATH_MAX)
20265 /* FIXME: Assuming there's a system for which this is true,
20266 this should be done in a compile test. */
20267 exit (0);
20268#else
20269 char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
20270 + DIR_NAME_SIZE + BUF_SLOP];
20271 char *cwd = getcwd (buf, PATH_MAX);
20272 size_t initial_cwd_len;
20273 size_t cwd_len;
20274 int fail = 0;
20275 size_t n_chdirs = 0;
88b48903 20276
6ec2e0f5
SDJ
20277 if (cwd == NULL)
20278 exit (10);
88b48903 20279
6ec2e0f5 20280 cwd_len = initial_cwd_len = strlen (cwd);
88b48903 20281
6ec2e0f5
SDJ
20282 while (1)
20283 {
20284 size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
20285 char *c = NULL;
20286
20287 cwd_len += DIR_NAME_SIZE;
20288 /* If mkdir or chdir fails, it could be that this system cannot create
20289 any file with an absolute name longer than PATH_MAX, such as cygwin.
20290 If so, leave fail as 0, because the current working directory can't
c0c3707f
CB
20291 be too long for getcwd if it can't even be created. On Linux with
20292 the 9p file system, mkdir fails with error EINVAL when cwd_len gets
20293 too long; ignore this failure because the getcwd() system call
20294 produces good results whereas the gnulib substitute calls getdents64
20295 which fails with error EPROTO.
20296 For other errors, be pessimistic and consider that as a failure,
20297 too. */
6ec2e0f5
SDJ
20298 if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
20299 {
20300 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
c0c3707f
CB
20301 #ifdef __linux__
20302 if (! (errno == EINVAL))
20303 #endif
20304 fail = 20;
6ec2e0f5
SDJ
20305 break;
20306 }
88b48903 20307
6ec2e0f5
SDJ
20308 if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
20309 {
20310 struct stat sb;
88b48903 20311
6ec2e0f5
SDJ
20312 c = getcwd (buf, PATH_MAX);
20313 if (!c && errno == ENOENT)
20314 {
20315 fail = 11;
20316 break;
20317 }
20318 if (c)
20319 {
20320 fail = 31;
20321 break;
20322 }
20323 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
20324 {
20325 fail = 21;
20326 break;
20327 }
88b48903 20328
6ec2e0f5
SDJ
20329 /* Our replacement needs to be able to stat() long ../../paths,
20330 so generate a path larger than PATH_MAX to check,
20331 avoiding the replacement if we can't stat(). */
20332 c = getcwd (buf, cwd_len + 1);
20333 if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
20334 {
20335 fail = 32;
20336 break;
20337 }
20338 }
88b48903 20339
6ec2e0f5
SDJ
20340 if (dotdot_max <= cwd_len - initial_cwd_len)
20341 {
20342 if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
20343 break;
20344 c = getcwd (buf, cwd_len + 1);
20345 if (!c)
20346 {
20347 if (! (errno == ERANGE || errno == ENOENT
20348 || is_ENAMETOOLONG (errno)))
20349 {
20350 fail = 22;
20351 break;
20352 }
20353 if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
20354 {
20355 fail = 12;
20356 break;
20357 }
20358 }
20359 }
88b48903 20360
6ec2e0f5
SDJ
20361 if (c && strlen (c) != cwd_len)
20362 {
20363 fail = 23;
20364 break;
20365 }
20366 ++n_chdirs;
20367 }
88b48903 20368
6ec2e0f5
SDJ
20369 /* Leaving behind such a deep directory is not polite.
20370 So clean up here, right away, even though the driving
20371 shell script would also clean up. */
20372 {
20373 size_t i;
88b48903 20374
6ec2e0f5
SDJ
20375 /* Try rmdir first, in case the chdir failed. */
20376 rmdir (DIR_NAME);
20377 for (i = 0; i <= n_chdirs; i++)
20378 {
20379 if (chdir ("..") < 0)
20380 break;
20381 if (rmdir (DIR_NAME) != 0)
20382 break;
20383 }
20384 }
88b48903 20385
6ec2e0f5
SDJ
20386 exit (fail);
20387#endif
20388}
88b48903 20389
6ec2e0f5
SDJ
20390_ACEOF
20391if ac_fn_c_try_run "$LINENO"; then :
20392 gl_cv_func_getcwd_path_max=yes
20393else
20394 case $? in
c0c3707f
CB
20395 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
20396 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
20397 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
20398 *) gl_cv_func_getcwd_path_max=no;;
20399 esac
6ec2e0f5
SDJ
20400fi
20401rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20402 conftest.$ac_objext conftest.beam conftest.$ac_ext
20403fi
88b48903 20404
88b48903 20405
6ec2e0f5
SDJ
20406fi
20407{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
20408$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
88b48903 20409
6ec2e0f5
SDJ
20410 case "$gl_cv_func_getcwd_null" in
20411 *yes)
88b48903
WN
20412
20413
472fa5ee
SM
20414
20415
20416
472fa5ee 20417
c0c3707f
CB
20418 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
20419$as_echo_n "checking for getpagesize... " >&6; }
20420if ${gl_cv_func_getpagesize+:} false; then :
20421 $as_echo_n "(cached) " >&6
20422else
20423 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20424/* end confdefs.h. */
20425#include <unistd.h>
20426int
20427main ()
20428{
20429return getpagesize();
20430 ;
20431 return 0;
20432}
472fa5ee 20433
c0c3707f
CB
20434_ACEOF
20435if ac_fn_c_try_link "$LINENO"; then :
20436 gl_cv_func_getpagesize=yes
20437else
20438 gl_cv_func_getpagesize=no
20439fi
20440rm -f core conftest.err conftest.$ac_objext \
20441 conftest$ac_exeext conftest.$ac_ext
472fa5ee 20442
c0c3707f
CB
20443fi
20444{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
20445$as_echo "$gl_cv_func_getpagesize" >&6; }
88b48903 20446
c0c3707f 20447 if test $gl_cv_func_getpagesize = yes; then
88b48903 20448
c0c3707f 20449cat >>confdefs.h <<_ACEOF
7a6dbc2f
SDJ
20450#define HAVE_GETPAGESIZE 1
20451_ACEOF
20452
c0c3707f 20453 fi
6ec2e0f5 20454
9c9d63b1
PM
20455 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd succeeds when 4k < cwd_length < 16k" >&5
20456$as_echo_n "checking whether getcwd succeeds when 4k < cwd_length < 16k... " >&6; }
20457if ${gl_cv_func_getcwd_succeeds_beyond_4k+:} false; then :
88b48903
WN
20458 $as_echo_n "(cached) " >&6
20459else
6ec2e0f5
SDJ
20460 # Remove any remnants of a previous test.
20461 rm -rf confdir-14B---
20462 # Arrange for deletion of the temporary directory this test creates.
20463 ac_clean_files="$ac_clean_files confdir-14B---"
20464 if test "$cross_compiling" = yes; then :
c0c3707f 20465 case "$host_os" in
9c9d63b1
PM
20466 # Guess yes on musl systems.
20467 *-musl*) gl_cv_func_getcwd_succeeds_beyond_4k="guessing yes" ;;
20468 # Guess no otherwise, even on glibc systems.
20469 *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no"
c0c3707f
CB
20470 esac
20471
88b48903
WN
20472else
20473 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20474/* end confdefs.h. */
6ec2e0f5
SDJ
20475
20476#include <errno.h>
20477#include <stdlib.h>
20478#if HAVE_UNISTD_H
20479# include <unistd.h>
20480#else /* on Windows with MSVC */
20481# include <direct.h>
20482#endif
20483#include <string.h>
20484#include <sys/stat.h>
20485
20486
20487/* Arrange to define PATH_MAX, like "pathmax.h" does. */
20488#if HAVE_UNISTD_H
20489# include <unistd.h>
20490#endif
20491#include <limits.h>
20492#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
20493# include <sys/param.h>
20494#endif
20495#if !defined PATH_MAX && defined MAXPATHLEN
20496# define PATH_MAX MAXPATHLEN
20497#endif
20498#ifdef __hpux
20499# undef PATH_MAX
20500# define PATH_MAX 1024
20501#endif
c0c3707f 20502#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
20503# undef PATH_MAX
20504# define PATH_MAX 260
20505#endif
20506
20507
9c9d63b1
PM
20508
20509$gl_mda_defines
20510
6ec2e0f5
SDJ
20511
20512#ifndef S_IRWXU
20513# define S_IRWXU 0700
20514#endif
20515
20516/* FIXME: skip the run-test altogether on systems without getpagesize. */
20517#if ! HAVE_GETPAGESIZE
20518# define getpagesize() 0
20519#endif
20520
20521/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
20522 the 16kB pagesize on ia64 linux. Those conditions make the code below
20523 trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
20524#define TARGET_LEN (5 * 1024)
88b48903
WN
20525
20526int
20527main ()
20528{
6ec2e0f5
SDJ
20529 char *cwd;
20530 size_t initial_cwd_len;
20531 int fail = 0;
20532
20533 /* The bug is triggered when PATH_MAX < getpagesize (), so skip
20534 this relatively expensive and invasive test if that's not true. */
20535#ifdef PATH_MAX
20536 int bug_possible = PATH_MAX < getpagesize ();
20537#else
20538 int bug_possible = 0;
20539#endif
20540 if (! bug_possible)
20541 return 0;
8690e634 20542
6ec2e0f5
SDJ
20543 cwd = getcwd (NULL, 0);
20544 if (cwd == NULL)
20545 return 2;
20546
20547 initial_cwd_len = strlen (cwd);
20548 free (cwd);
20549
20550 if (1)
20551 {
20552 static char const dir_name[] = "confdir-14B---";
20553 size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
20554 / sizeof dir_name);
20555 size_t d;
20556 for (d = 0; d < desired_depth; d++)
20557 {
20558 if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
20559 {
20560 if (! (errno == ERANGE || errno == ENAMETOOLONG
20561 || errno == ENOENT))
20562 fail = 3; /* Unable to construct deep hierarchy. */
20563 break;
20564 }
20565 }
20566
20567 /* If libc has the bug in question, this invocation of getcwd
20568 results in a failed assertion. */
20569 cwd = getcwd (NULL, 0);
20570 if (cwd == NULL)
20571 fail = 4; /* getcwd didn't assert, but it failed for a long name
20572 where the answer could have been learned. */
20573 free (cwd);
20574
20575 /* Call rmdir first, in case the above chdir failed. */
20576 rmdir (dir_name);
20577 while (0 < d--)
20578 {
20579 if (chdir ("..") < 0)
20580 {
20581 fail = 5;
20582 break;
20583 }
20584 rmdir (dir_name);
20585 }
20586 }
20587
20588 return fail;
8690e634 20589}
6ec2e0f5 20590
8690e634
JK
20591_ACEOF
20592if ac_fn_c_try_run "$LINENO"; then :
9c9d63b1 20593 gl_cv_func_getcwd_succeeds_beyond_4k=yes
8690e634 20594else
c0c3707f
CB
20595 ret=$?
20596 if test $ret -ge 128 || test $ret = 4; then
9c9d63b1 20597 gl_cv_func_getcwd_succeeds_beyond_4k=no
c0c3707f 20598 else
9c9d63b1 20599 gl_cv_func_getcwd_succeeds_beyond_4k=yes
c0c3707f
CB
20600 fi
20601
8690e634
JK
20602fi
20603rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20604 conftest.$ac_objext conftest.beam conftest.$ac_ext
20605fi
20606
20607
20608fi
9c9d63b1
PM
20609{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_succeeds_beyond_4k" >&5
20610$as_echo "$gl_cv_func_getcwd_succeeds_beyond_4k" >&6; }
20611 case "$gl_cv_func_getcwd_succeeds_beyond_4k" in
20612 *no)
c0c3707f
CB
20613 gl_abort_bug=yes
20614 ;;
20615 *)
20616
20617 ;;
20618 esac
6ec2e0f5
SDJ
20619
20620 ;;
20621 esac
20622 ;;
20623 esac
20624 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 20625 *"no" | *"no, it has the AIX bug") ;;
6ec2e0f5
SDJ
20626 *)
20627
20628$as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
20629
20630 ;;
20631 esac
20632 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 20633 *"no, but it is partly working")
6ec2e0f5
SDJ
20634
20635$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
20636
20637 ;;
c0c3707f 20638 *"yes, but with shorter paths")
6ec2e0f5
SDJ
20639
20640$as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
20641
20642 ;;
20643 esac
20644
20645 if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
20646 || test $gl_cv_func_getcwd_posix_signature != yes \
20647 || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
20648 || test $gl_abort_bug = yes; then
20649 REPLACE_GETCWD=1
8690e634
JK
20650 fi
20651
6ec2e0f5 20652 if test $REPLACE_GETCWD = 1; then
8690e634
JK
20653
20654
8690e634
JK
20655
20656
20657
20658
20659
20660
6ec2e0f5 20661 gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
8690e634
JK
20662
20663
8690e634
JK
20664
20665
6ec2e0f5
SDJ
20666 :
20667
20668 fi
20669
8690e634
JK
20670
20671cat >>confdefs.h <<_ACEOF
6ec2e0f5 20672#define GNULIB_GETCWD 1
8690e634
JK
20673_ACEOF
20674
20675
8690e634 20676
8690e634
JK
20677
20678
c971b7fa 20679
c971b7fa 20680
6ec2e0f5
SDJ
20681 GNULIB_GETCWD=1
20682
20683
20684
20685
20686
20687$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
20688
c971b7fa 20689
c971b7fa 20690
c971b7fa 20691
c971b7fa 20692
c971b7fa 20693
c971b7fa 20694
c971b7fa 20695
6ec2e0f5
SDJ
20696 case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
20697 *yes,yes) ;;
20698 *)
20699 REPLACE_GETCWD=1
20700 ;;
20701 esac
c971b7fa 20702
6ec2e0f5 20703 if test $REPLACE_GETCWD = 1; then
c971b7fa 20704
c971b7fa
PA
20705
20706
c971b7fa
PA
20707
20708
c971b7fa 20709
c971b7fa 20710
c971b7fa 20711
6ec2e0f5 20712 gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
c971b7fa 20713
6ec2e0f5 20714 fi
c971b7fa 20715
c971b7fa 20716
c971b7fa 20717
c971b7fa 20718
8690e634 20719
6ec2e0f5 20720 GNULIB_GETCWD=1
c971b7fa 20721
88b48903
WN
20722
20723
20724
88b48903 20725
6ec2e0f5 20726$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
88b48903 20727
88b48903
WN
20728
20729
20730
6ec2e0f5
SDJ
20731
20732
20733
20734
c17253b9
MF
20735
20736
20737
20738 if test $ac_cv_func_getdelim = yes; then
20739 HAVE_GETDELIM=1
20740 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getdelim function" >&5
20741$as_echo_n "checking for working getdelim function... " >&6; }
20742if ${gl_cv_func_working_getdelim+:} false; then :
20743 $as_echo_n "(cached) " >&6
20744else
20745 echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
20746 if test "$cross_compiling" = yes; then :
20747 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20748/* end confdefs.h. */
20749
20750#include <features.h>
20751#ifdef __GNU_LIBRARY__
20752 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
20753 Lucky GNU user
20754 #endif
20755#endif
20756
20757_ACEOF
20758if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20759 $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
20760 gl_cv_func_working_getdelim="guessing yes"
20761else
20762 case "$host_os" in
20763 *-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
20764 *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
20765 esac
20766
20767fi
20768rm -f conftest*
20769
20770
20771else
20772 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20773/* end confdefs.h. */
20774
20775# include <stdio.h>
20776# include <stdlib.h>
20777# include <string.h>
20778 int main ()
20779 {
20780 FILE *in = fopen ("./conftest.data", "r");
20781 if (!in)
20782 return 1;
20783 {
20784 /* Test result for a NULL buffer and a zero size.
20785 Based on a test program from Karl Heuer. */
20786 char *line = NULL;
20787 size_t siz = 0;
20788 int len = getdelim (&line, &siz, '\n', in);
20789 if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
20790 { free (line); fclose (in); return 2; }
20791 free (line);
20792 }
20793 {
20794 /* Test result for a NULL buffer and a non-zero size.
20795 This crashes on FreeBSD 8.0. */
20796 char *line = NULL;
20797 size_t siz = (size_t)(~0) / 4;
20798 if (getdelim (&line, &siz, '\n', in) == -1)
20799 { fclose (in); return 3; }
20800 free (line);
20801 }
20802 fclose (in);
20803 return 0;
20804 }
20805
20806_ACEOF
20807if ac_fn_c_try_run "$LINENO"; then :
20808 gl_cv_func_working_getdelim=yes
20809else
20810 gl_cv_func_working_getdelim=no
20811fi
20812rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20813 conftest.$ac_objext conftest.beam conftest.$ac_ext
20814fi
20815
20816
20817fi
20818{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_getdelim" >&5
20819$as_echo "$gl_cv_func_working_getdelim" >&6; }
20820 case "$gl_cv_func_working_getdelim" in
20821 *yes) ;;
20822 *) REPLACE_GETDELIM=1 ;;
20823 esac
20824 else
20825 HAVE_GETDELIM=0
20826 fi
20827
20828 if test $ac_cv_have_decl_getdelim = no; then
20829 HAVE_DECL_GETDELIM=0
20830 fi
20831
20832 if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then
20833
20834
20835
20836
20837
20838
20839
20840
20841 gl_LIBOBJS="$gl_LIBOBJS getdelim.$ac_objext"
20842
20843
20844 for ac_func in flockfile funlockfile
20845do :
20846 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
20847ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
20848if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
20849 cat >>confdefs.h <<_ACEOF
20850#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
20851_ACEOF
20852
20853fi
20854done
20855
20856 ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
20857if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then :
20858 ac_have_decl=1
20859else
20860 ac_have_decl=0
20861fi
20862
20863cat >>confdefs.h <<_ACEOF
20864#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
20865_ACEOF
20866
20867
20868 fi
20869
20870
20871
20872
20873
20874 GNULIB_GETDELIM=1
20875
20876
20877
20878
20879
20880$as_echo "#define GNULIB_TEST_GETDELIM 1" >>confdefs.h
20881
20882
20883
20884
20885
20886
20887
20888
6ec2e0f5
SDJ
20889 if test $ac_cv_func_getdtablesize = yes &&
20890 test $ac_cv_have_decl_getdtablesize = yes; then
6ec2e0f5
SDJ
20891 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
20892$as_echo_n "checking whether getdtablesize works... " >&6; }
d0ac1c44 20893if ${gl_cv_func_getdtablesize_works+:} false; then :
88b48903
WN
20894 $as_echo_n "(cached) " >&6
20895else
c0c3707f
CB
20896 case "$host_os" in
20897 vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
20898 *)
20899 if test "$cross_compiling" = yes; then :
88b48903 20900 case "$host_os" in
c0c3707f
CB
20901 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
20902 gl_cv_func_getdtablesize_works="guessing no" ;;
20903 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
20904 esac
20905
88b48903
WN
20906else
20907 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20908/* end confdefs.h. */
20909
c0c3707f 20910 #include <unistd.h>
9c9d63b1
PM
20911
20912
20913$gl_mda_defines
20914
20915
6ec2e0f5
SDJ
20916int
20917main ()
88b48903 20918{
6ec2e0f5 20919int size = getdtablesize();
9c9d63b1
PM
20920 if (dup2 (0, getdtablesize()) != -1)
20921 return 1;
20922 if (size != getdtablesize())
20923 return 2;
6ec2e0f5
SDJ
20924
20925 ;
20926 return 0;
88b48903
WN
20927}
20928_ACEOF
20929if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20930 gl_cv_func_getdtablesize_works=yes
88b48903 20931else
6ec2e0f5 20932 gl_cv_func_getdtablesize_works=no
88b48903
WN
20933fi
20934rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20935 conftest.$ac_objext conftest.beam conftest.$ac_ext
20936fi
20937
c0c3707f
CB
20938 ;;
20939 esac
88b48903
WN
20940
20941fi
6ec2e0f5
SDJ
20942{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
20943$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
20944 case "$gl_cv_func_getdtablesize_works" in
c0c3707f 20945 *yes | "no (limitation)") ;;
6ec2e0f5 20946 *) REPLACE_GETDTABLESIZE=1 ;;
88b48903
WN
20947 esac
20948 else
6ec2e0f5 20949 HAVE_GETDTABLESIZE=0
88b48903
WN
20950 fi
20951
6ec2e0f5 20952 if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
88b48903
WN
20953
20954
20955
20956
20957
20958
20959
20960
6ec2e0f5 20961 gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
88b48903 20962
6ec2e0f5 20963 :
88b48903
WN
20964 fi
20965
20966
20967
20968
20969
6ec2e0f5 20970 GNULIB_GETDTABLESIZE=1
88b48903
WN
20971
20972
20973
88b48903 20974
88b48903 20975
6ec2e0f5 20976$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
88b48903 20977
88b48903 20978
88b48903 20979
88b48903 20980
88b48903 20981
88b48903 20982
88b48903 20983
88b48903
WN
20984
20985
c17253b9
MF
20986
20987 gl_getline_needs_run_time_check=no
20988 ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline"
20989if test "x$ac_cv_func_getline" = xyes; then :
20990 gl_getline_needs_run_time_check=yes
20991else
20992 am_cv_func_working_getline=no
20993fi
20994
20995 if test $gl_getline_needs_run_time_check = yes; then
20996 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getline function" >&5
20997$as_echo_n "checking for working getline function... " >&6; }
20998if ${am_cv_func_working_getline+:} false; then :
20999 $as_echo_n "(cached) " >&6
21000else
21001 echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
21002 if test "$cross_compiling" = yes; then :
21003 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21004/* end confdefs.h. */
21005
21006#include <features.h>
21007#ifdef __GNU_LIBRARY__
21008 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
21009 Lucky GNU user
21010 #endif
21011#endif
21012
21013_ACEOF
21014if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21015 $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
21016 am_cv_func_working_getline="guessing yes"
21017else
21018 case "$host_os" in
21019 *-musl*) am_cv_func_working_getline="guessing yes" ;;
21020 *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
21021 esac
21022
21023fi
21024rm -f conftest*
21025
21026
21027else
21028 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21029/* end confdefs.h. */
21030
21031# include <stdio.h>
21032# include <stdlib.h>
21033# include <string.h>
21034 int main ()
21035 {
21036 FILE *in = fopen ("./conftest.data", "r");
21037 if (!in)
21038 return 1;
21039 {
21040 /* Test result for a NULL buffer and a zero size.
21041 Based on a test program from Karl Heuer. */
21042 char *line = NULL;
21043 size_t siz = 0;
21044 int len = getline (&line, &siz, in);
21045 if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
21046 { free (line); fclose (in); return 2; }
21047 free (line);
21048 }
21049 {
21050 /* Test result for a NULL buffer and a non-zero size.
21051 This crashes on FreeBSD 8.0. */
21052 char *line = NULL;
21053 size_t siz = (size_t)(~0) / 4;
21054 if (getline (&line, &siz, in) == -1)
21055 { fclose (in); return 3; }
21056 free (line);
21057 }
21058 fclose (in);
21059 return 0;
21060 }
21061
21062_ACEOF
21063if ac_fn_c_try_run "$LINENO"; then :
21064 am_cv_func_working_getline=yes
21065else
21066 am_cv_func_working_getline=no
21067fi
21068rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21069 conftest.$ac_objext conftest.beam conftest.$ac_ext
21070fi
21071
21072
21073fi
21074{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_working_getline" >&5
21075$as_echo "$am_cv_func_working_getline" >&6; }
21076 fi
21077
21078 if test $ac_cv_have_decl_getline = no; then
21079 HAVE_DECL_GETLINE=0
21080 fi
21081
21082 case "$am_cv_func_working_getline" in
21083 *yes) ;;
21084 *)
21085 REPLACE_GETLINE=1
21086 ;;
21087 esac
21088
21089 if test $REPLACE_GETLINE = 1; then
21090
21091
21092
21093
21094
21095
21096
21097
21098 gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext"
21099
21100
21101 :
21102
21103 fi
21104
21105
21106
21107
21108
21109 GNULIB_GETLINE=1
21110
21111
21112
21113
21114
21115$as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h
21116
21117
21118
21119
21120
21121
21122
21123
21124
6ec2e0f5
SDJ
21125 if test $ac_cv_have_decl_getlogin_r = no; then
21126 HAVE_DECL_GETLOGIN_R=0
21127 fi
88b48903 21128
88b48903 21129
6ec2e0f5
SDJ
21130 if test $ac_cv_func_getlogin_r = no; then
21131 HAVE_GETLOGIN_R=0
21132 else
21133 HAVE_GETLOGIN_R=1
21134
21135 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5
21136$as_echo_n "checking whether getlogin_r works with small buffers... " >&6; }
d0ac1c44 21137if ${gl_cv_func_getlogin_r_works+:} false; then :
6ec2e0f5
SDJ
21138 $as_echo_n "(cached) " >&6
21139else
88b48903 21140
6ec2e0f5 21141 case "$host_os" in
c0c3707f
CB
21142 # Guess no on Mac OS X, OSF/1.
21143 darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;;
21144 # Guess yes otherwise.
21145 *) gl_cv_func_getlogin_r_works="guessing yes" ;;
6ec2e0f5
SDJ
21146 esac
21147 if test "$cross_compiling" = yes; then :
21148 :
88b48903
WN
21149else
21150 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21151/* end confdefs.h. */
21152
6ec2e0f5 21153#include <stddef.h>
c0c3707f 21154#include <string.h>
6ec2e0f5
SDJ
21155#include <unistd.h>
21156#if !HAVE_DECL_GETLOGIN_R
88b48903 21157extern
6ec2e0f5 21158# ifdef __cplusplus
88b48903 21159"C"
6ec2e0f5
SDJ
21160# endif
21161int getlogin_r (char *, size_t);
88b48903 21162#endif
6ec2e0f5
SDJ
21163int
21164main (void)
88b48903
WN
21165{
21166 int result = 0;
6ec2e0f5
SDJ
21167 char buf[100];
21168
21169 if (getlogin_r (buf, 0) == 0)
c0c3707f 21170 result |= 1;
6ec2e0f5 21171 if (getlogin_r (buf, 1) == 0)
c0c3707f
CB
21172 result |= 2;
21173 if (getlogin_r (buf, 100) == 0)
21174 {
21175 size_t n = strlen (buf);
21176 if (getlogin_r (buf, n) == 0)
21177 result |= 4;
21178 }
88b48903
WN
21179 return result;
21180}
21181_ACEOF
21182if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 21183 gl_cv_func_getlogin_r_works=yes
88b48903 21184else
c0c3707f 21185 gl_cv_func_getlogin_r_works=no
88b48903
WN
21186fi
21187rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21188 conftest.$ac_objext conftest.beam conftest.$ac_ext
21189fi
21190
21191
4a626d0a 21192fi
6ec2e0f5
SDJ
21193{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5
21194$as_echo "$gl_cv_func_getlogin_r_works" >&6; }
21195 case "$gl_cv_func_getlogin_r_works" in
21196 *yes) ;;
21197 *) REPLACE_GETLOGIN_R=1 ;;
21198 esac
21199 fi
21200
21201 if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then
21202
21203
21204
21205
21206
21207
21208
21209
21210 gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext"
4a626d0a 21211
4a626d0a 21212
4a626d0a 21213
4a626d0a 21214
4a626d0a
PA
21215 fi
21216
21217
4a626d0a
PA
21218
21219
21220
6ec2e0f5 21221 GNULIB_GETLOGIN_R=1
4a626d0a
PA
21222
21223
21224
21225
21226
6ec2e0f5 21227$as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h
4a626d0a 21228
4a626d0a
PA
21229
21230
21231
21232
472fa5ee 21233
4a626d0a 21234
6ec2e0f5
SDJ
21235 ac_found=0
21236 ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
21237"
d0ac1c44 21238if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
6ec2e0f5
SDJ
21239 ac_have_decl=1
21240else
21241 ac_have_decl=0
21242fi
21243
21244cat >>confdefs.h <<_ACEOF
21245#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
21246_ACEOF
21247if test $ac_have_decl = 1; then :
21248 ac_found=1
21249fi
21250
21251 ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
21252"
d0ac1c44 21253if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
6ec2e0f5
SDJ
21254 ac_have_decl=1
21255else
21256 ac_have_decl=0
21257fi
21258
21259cat >>confdefs.h <<_ACEOF
21260#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
21261_ACEOF
21262if test $ac_have_decl = 1; then :
21263 ac_found=1
21264fi
4a626d0a 21265
6ec2e0f5
SDJ
21266 ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
21267"
d0ac1c44 21268if test "x$ac_cv_have_decl___argv" = xyes; then :
6ec2e0f5
SDJ
21269 ac_have_decl=1
21270else
21271 ac_have_decl=0
21272fi
4a626d0a 21273
6ec2e0f5
SDJ
21274cat >>confdefs.h <<_ACEOF
21275#define HAVE_DECL___ARGV $ac_have_decl
21276_ACEOF
21277if test $ac_have_decl = 1; then :
21278 ac_found=1
21279fi
4a626d0a
PA
21280
21281
6ec2e0f5
SDJ
21282 # Incur the cost of this test only if none of the above worked.
21283 if test $ac_found = 0; then
21284 # On OpenBSD 5.1, using the global __progname variable appears to be
21285 # the only way to implement getprogname.
21286 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
21287$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
d0ac1c44 21288if ${gl_cv_var___progname+:} false; then :
6ec2e0f5
SDJ
21289 $as_echo_n "(cached) " >&6
21290else
4a626d0a 21291
6ec2e0f5
SDJ
21292 gl_cv_var___progname=
21293 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21294/* end confdefs.h. */
21295extern char *__progname;
21296int
21297main ()
21298{
21299return *__progname;
21300
21301 ;
21302 return 0;
21303}
21304_ACEOF
21305if ac_fn_c_try_link "$LINENO"; then :
21306 gl_cv_var___progname=yes
21307
21308fi
21309rm -f core conftest.err conftest.$ac_objext \
21310 conftest$ac_exeext conftest.$ac_ext
21311
21312
21313fi
21314{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
21315$as_echo "$gl_cv_var___progname" >&6; }
21316 if test "$gl_cv_var___progname" = yes; then
21317
21318$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
21319
21320 fi
21321 fi
4a626d0a
PA
21322
21323
21324
21325
21326
698be2d8
CB
21327 if test "$ac_cv_func_getrandom" != yes; then
21328 HAVE_GETRANDOM=0
21329 else
21330 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getrandom is compatible with its GNU+BSD signature" >&5
21331$as_echo_n "checking whether getrandom is compatible with its GNU+BSD signature... " >&6; }
21332if ${gl_cv_func_getrandom_ok+:} false; then :
21333 $as_echo_n "(cached) " >&6
21334else
21335 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21336/* end confdefs.h. */
9c9d63b1
PM
21337/* Additional includes are needed before <sys/random.h> on uClibc
21338 and Mac OS X. */
698be2d8
CB
21339 #include <sys/types.h>
21340 #include <stdlib.h>
21341 #include <sys/random.h>
21342 ssize_t getrandom (void *, size_t, unsigned int);
21343
21344int
21345main ()
21346{
21347
21348 ;
21349 return 0;
21350}
21351
21352_ACEOF
21353if ac_fn_c_try_compile "$LINENO"; then :
21354 gl_cv_func_getrandom_ok=yes
21355else
21356 gl_cv_func_getrandom_ok=no
21357fi
21358rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21359
21360fi
21361{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getrandom_ok" >&5
21362$as_echo "$gl_cv_func_getrandom_ok" >&6; }
21363 if test $gl_cv_func_getrandom_ok = no; then
21364 REPLACE_GETRANDOM=1
21365 fi
21366 fi
21367
21368 case "$host_os" in
21369 mingw*)
21370 for ac_header in bcrypt.h
21371do :
9c9d63b1
PM
21372 ac_fn_c_check_header_compile "$LINENO" "bcrypt.h" "ac_cv_header_bcrypt_h" "#include <windows.h>
21373
21374"
698be2d8
CB
21375if test "x$ac_cv_header_bcrypt_h" = xyes; then :
21376 cat >>confdefs.h <<_ACEOF
21377#define HAVE_BCRYPT_H 1
21378_ACEOF
21379
21380fi
21381
21382done
21383
21384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the bcrypt library is guaranteed to be present" >&5
21385$as_echo_n "checking whether the bcrypt library is guaranteed to be present... " >&6; }
21386if ${gl_cv_lib_assume_bcrypt+:} false; then :
21387 $as_echo_n "(cached) " >&6
21388else
21389 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21390/* end confdefs.h. */
21391#include <windows.h>
21392int
21393main ()
21394{
21395#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
21396 cannot assume it
21397 #endif
21398
21399 ;
21400 return 0;
21401}
21402
21403_ACEOF
21404if ac_fn_c_try_compile "$LINENO"; then :
21405 gl_cv_lib_assume_bcrypt=yes
21406else
21407 gl_cv_lib_assume_bcrypt=no
21408fi
21409rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21410
21411fi
21412{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_assume_bcrypt" >&5
21413$as_echo "$gl_cv_lib_assume_bcrypt" >&6; }
21414 if test $gl_cv_lib_assume_bcrypt = yes; then
21415
21416$as_echo "#define HAVE_LIB_BCRYPT 1" >>confdefs.h
21417
21418 LIB_GETRANDOM='-lbcrypt'
21419 else
21420 LIB_GETRANDOM='-ladvapi32'
21421 fi
21422 ;;
21423 *)
21424 LIB_GETRANDOM= ;;
21425 esac
21426
21427
21428 if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
21429
21430
21431
21432
21433
21434
21435
21436
21437 gl_LIBOBJS="$gl_LIBOBJS getrandom.$ac_objext"
21438
21439 fi
21440
21441
21442
21443
21444
21445 GNULIB_GETRANDOM=1
21446
21447
21448
21449
21450
21451$as_echo "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.h
21452
21453
21454
21455
21456
21457
21458
4a626d0a
PA
21459
21460
21461
472fa5ee 21462
4a626d0a
PA
21463
21464 gl_gettimeofday_timezone=void
21465 if test $ac_cv_func_gettimeofday != yes; then
21466 HAVE_GETTIMEOFDAY=0
21467 else
4a626d0a
PA
21468 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
21469$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
d0ac1c44 21470if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
4a626d0a
PA
21471 $as_echo_n "(cached) " >&6
21472else
21473 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21474/* end confdefs.h. */
21475#include <sys/time.h>
21476 struct timeval c;
21477 int gettimeofday (struct timeval *restrict, void *restrict);
21478
21479int
21480main ()
21481{
21482/* glibc uses struct timezone * rather than the POSIX void *
21483 if _GNU_SOURCE is defined. However, since the only portable
21484 use of gettimeofday uses NULL as the second parameter, and
21485 since the glibc definition is actually more typesafe, it is
21486 not worth wrapping this to get a compliant signature. */
21487 int (*f) (struct timeval *restrict, void *restrict)
21488 = gettimeofday;
21489 int x = f (&c, 0);
21490 return !(x | c.tv_sec | c.tv_usec);
21491
21492 ;
21493 return 0;
21494}
21495_ACEOF
21496if ac_fn_c_try_compile "$LINENO"; then :
21497 gl_cv_func_gettimeofday_posix_signature=yes
21498else
21499 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21500/* end confdefs.h. */
21501#include <sys/time.h>
21502int gettimeofday (struct timeval *restrict, struct timezone *restrict);
21503
21504int
21505main ()
21506{
21507
21508 ;
21509 return 0;
21510}
21511_ACEOF
21512if ac_fn_c_try_compile "$LINENO"; then :
21513 gl_cv_func_gettimeofday_posix_signature=almost
21514else
21515 gl_cv_func_gettimeofday_posix_signature=no
21516fi
21517rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21518fi
21519rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21520fi
21521{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
21522$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
21523 if test $gl_cv_func_gettimeofday_posix_signature = almost; then
21524 gl_gettimeofday_timezone='struct timezone'
21525 elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
21526 REPLACE_GETTIMEOFDAY=1
21527 fi
21528 if test $REPLACE_STRUCT_TIMEVAL = 1; then
21529 REPLACE_GETTIMEOFDAY=1
21530 fi
c0c3707f
CB
21531 case "$host_os" in
21532 mingw*) REPLACE_GETTIMEOFDAY=1 ;;
21533 esac
4a626d0a
PA
21534 fi
21535
21536cat >>confdefs.h <<_ACEOF
c0c3707f
CB
21537#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
21538_ACEOF
88b48903
WN
21539
21540
c0c3707f 21541 if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
88b48903 21542
6ec2e0f5 21543
6ec2e0f5 21544
6ec2e0f5 21545
6ec2e0f5 21546
6ec2e0f5
SDJ
21547
21548
6ec2e0f5 21549
c0c3707f 21550 gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
6ec2e0f5 21551
c0c3707f 21552 :
5e8754f9 21553 fi
6ec2e0f5
SDJ
21554
21555
21556
6ec2e0f5
SDJ
21557
21558
5e8754f9 21559 GNULIB_GETTIMEOFDAY=1
6ec2e0f5
SDJ
21560
21561
21562
7a6dbc2f
SDJ
21563
21564
5e8754f9 21565$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
6ec2e0f5
SDJ
21566
21567
21568
6ec2e0f5 21569
6ec2e0f5 21570
6ec2e0f5
SDJ
21571
21572
c0c3707f
CB
21573 if test $ac_cv_func_glob = no; then
21574 HAVE_GLOB=0
21575 else
21576
21577 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5
21578$as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; }
21579if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then :
6ec2e0f5
SDJ
21580 $as_echo_n "(cached) " >&6
21581else
21582 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21583/* end confdefs.h. */
21584#include <gnu-versions.h>
c0c3707f 21585char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];
6ec2e0f5
SDJ
21586_ACEOF
21587if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 21588 gl_cv_gnu_glob_interface_version_1_2=yes
6ec2e0f5 21589else
c0c3707f 21590 gl_cv_gnu_glob_interface_version_1_2=no
6ec2e0f5
SDJ
21591fi
21592rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21593fi
c0c3707f
CB
21594{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5
21595$as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; }
21596 if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then
21597 REPLACE_GLOB=1
6ec2e0f5 21598 fi
6ec2e0f5 21599
c0c3707f
CB
21600 if test $REPLACE_GLOB = 0; then
21601 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5
6ec2e0f5 21602$as_echo_n "checking whether glob lists broken symlinks... " >&6; }
d0ac1c44 21603if ${gl_cv_glob_lists_symlinks+:} false; then :
6ec2e0f5
SDJ
21604 $as_echo_n "(cached) " >&6
21605else
c0c3707f
CB
21606 if test $cross_compiling != yes; then
21607 if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
21608 gl_cv_glob_lists_symlinks=maybe
21609 else
21610 # If we can't make a symlink, then we cannot test this issue. Be
21611 # pessimistic about this.
21612 gl_cv_glob_lists_symlinks=no
21613 fi
21614 if test $gl_cv_glob_lists_symlinks = maybe; then
21615 if test "$cross_compiling" = yes; then :
21616 :
5e8754f9 21617
6ec2e0f5
SDJ
21618else
21619 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21620/* end confdefs.h. */
6ec2e0f5 21621#include <stddef.h>
c0c3707f 21622 #include <glob.h>
6ec2e0f5
SDJ
21623int
21624main ()
21625{
21626glob_t found;
c0c3707f
CB
21627 if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
21628 return 1;
698be2d8 21629 globfree (&found);
c0c3707f 21630
6ec2e0f5
SDJ
21631 ;
21632 return 0;
21633}
4a626d0a 21634_ACEOF
6ec2e0f5
SDJ
21635if ac_fn_c_try_run "$LINENO"; then :
21636 gl_cv_glob_lists_symlinks=yes
21637else
21638 gl_cv_glob_lists_symlinks=no
21639fi
21640rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21641 conftest.$ac_objext conftest.beam conftest.$ac_ext
21642fi
88b48903 21643
c0c3707f
CB
21644 fi
21645 rm -f conf$$-globtest
21646 else
21647 gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
21648 fi
21649
4a626d0a 21650fi
6ec2e0f5
SDJ
21651{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5
21652$as_echo "$gl_cv_glob_lists_symlinks" >&6; }
c0c3707f
CB
21653 case "$gl_cv_glob_lists_symlinks" in
21654 *yes) ;;
21655 *) REPLACE_GLOB=1 ;;
21656 esac
21657 fi
21658
21659 fi
88b48903 21660
c0c3707f
CB
21661 if test $ac_cv_func_glob_pattern_p = no; then
21662 HAVE_GLOB_PATTERN_P=0
21663 else
21664 if test $REPLACE_GLOB = 1; then
21665 REPLACE_GLOB_PATTERN_P=1
6ec2e0f5
SDJ
21666 fi
21667 fi
4a626d0a 21668
c0c3707f 21669 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
4a626d0a 21670
88b48903 21671
c0c3707f 21672 GLOB_H='glob.h'
6ec2e0f5
SDJ
21673 if test -n "$GLOB_H"; then
21674 GL_GENERATE_GLOB_H_TRUE=
21675 GL_GENERATE_GLOB_H_FALSE='#'
21676else
21677 GL_GENERATE_GLOB_H_TRUE='#'
21678 GL_GENERATE_GLOB_H_FALSE=
21679fi
88b48903 21680
88b48903 21681
c0c3707f
CB
21682 fi
21683
21684 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
472fa5ee
SM
21685
21686
21687
21688
21689
21690
21691
21692
21693 gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext"
21694
21695
21696
7a6dbc2f
SDJ
21697
21698
21699
472fa5ee 21700
472fa5ee 21701
88b48903 21702
c0c3707f 21703 gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext"
88b48903
WN
21704
21705
21706
725e2999
JB
21707
21708
21709
c0c3707f
CB
21710 fi
21711 if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then
21712
725e2999
JB
21713
21714
21715
21716
21717
21718
21719
c0c3707f 21720 gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext"
725e2999
JB
21721
21722 fi
21723
725e2999
JB
21724
21725
21726
21727
c0c3707f
CB
21728 GNULIB_GLOB=1
21729
21730
21731
21732
21733
21734$as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h
21735
21736
725e2999
JB
21737
21738
21739
5df4cba6
SM
21740 LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
21741
21742
725e2999 21743
725e2999
JB
21744
21745
21746
21747
725e2999 21748
c0c3707f
CB
21749 HAVE_INET_NTOP=1
21750 INET_NTOP_LIB=
725e2999
JB
21751
21752
21753
21754
21755 if test $ac_cv_header_sys_socket_h != yes; then
21756 for ac_header in winsock2.h
21757do :
21758 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
21759if test "x$ac_cv_header_winsock2_h" = xyes; then :
21760 cat >>confdefs.h <<_ACEOF
21761#define HAVE_WINSOCK2_H 1
21762_ACEOF
21763
21764fi
21765
21766done
21767
21768 fi
21769 if test "$ac_cv_header_winsock2_h" = yes; then
21770 HAVE_WINSOCK2_H=1
21771 UNISTD_H_HAVE_WINSOCK2_H=1
21772 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
21773 else
21774 HAVE_WINSOCK2_H=0
21775 fi
21776
21777
21778 if test $HAVE_WINSOCK2_H = 1; then
c0c3707f 21779 REPLACE_INET_NTOP=1
725e2999
JB
21780 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
21781"
21782if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
21783 ac_have_decl=1
21784else
21785 ac_have_decl=0
21786fi
21787
21788cat >>confdefs.h <<_ACEOF
21789#define HAVE_DECL_INET_NTOP $ac_have_decl
21790_ACEOF
21791
21792 if test $ac_cv_have_decl_inet_ntop = yes; then
725e2999
JB
21793 INET_NTOP_LIB="-lws2_32"
21794 else
21795 HAVE_DECL_INET_NTOP=0
725e2999
JB
21796 fi
21797 else
21798 gl_save_LIBS=$LIBS
21799 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
21800$as_echo_n "checking for library containing inet_ntop... " >&6; }
21801if ${ac_cv_search_inet_ntop+:} false; then :
21802 $as_echo_n "(cached) " >&6
21803else
21804 ac_func_search_save_LIBS=$LIBS
21805cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21806/* end confdefs.h. */
21807
21808/* Override any GCC internal prototype to avoid an error.
21809 Use char because int might match the return type of a GCC
21810 builtin and then its argument prototype would still apply. */
21811#ifdef __cplusplus
21812extern "C"
21813#endif
21814char inet_ntop ();
21815int
21816main ()
21817{
21818return inet_ntop ();
21819 ;
21820 return 0;
21821}
21822_ACEOF
c0c3707f 21823for ac_lib in '' nsl resolv network; do
725e2999
JB
21824 if test -z "$ac_lib"; then
21825 ac_res="none required"
21826 else
21827 ac_res=-l$ac_lib
21828 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
21829 fi
21830 if ac_fn_c_try_link "$LINENO"; then :
21831 ac_cv_search_inet_ntop=$ac_res
21832fi
21833rm -f core conftest.err conftest.$ac_objext \
21834 conftest$ac_exeext
21835 if ${ac_cv_search_inet_ntop+:} false; then :
21836 break
21837fi
21838done
21839if ${ac_cv_search_inet_ntop+:} false; then :
21840
21841else
21842 ac_cv_search_inet_ntop=no
21843fi
21844rm conftest.$ac_ext
21845LIBS=$ac_func_search_save_LIBS
21846fi
21847{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
21848$as_echo "$ac_cv_search_inet_ntop" >&6; }
21849ac_res=$ac_cv_search_inet_ntop
21850if test "$ac_res" != no; then :
21851 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
21852
21853else
21854 for ac_func in inet_ntop
21855do :
21856 ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
21857if test "x$ac_cv_func_inet_ntop" = xyes; then :
21858 cat >>confdefs.h <<_ACEOF
21859#define HAVE_INET_NTOP 1
21860_ACEOF
21861
21862fi
21863done
21864
21865 if test $ac_cv_func_inet_ntop = no; then
21866 HAVE_INET_NTOP=0
21867 fi
21868
21869fi
21870
21871 LIBS=$gl_save_LIBS
21872
21873 if test "$ac_cv_search_inet_ntop" != "no" \
21874 && test "$ac_cv_search_inet_ntop" != "none required"; then
21875 INET_NTOP_LIB="$ac_cv_search_inet_ntop"
21876 fi
21877
21878
725e2999
JB
21879 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
21880 #if HAVE_NETDB_H
21881 # include <netdb.h>
21882 #endif
21883
21884"
21885if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
21886 ac_have_decl=1
21887else
21888 ac_have_decl=0
21889fi
21890
21891cat >>confdefs.h <<_ACEOF
21892#define HAVE_DECL_INET_NTOP $ac_have_decl
21893_ACEOF
21894
21895 if test $ac_cv_have_decl_inet_ntop = no; then
21896 HAVE_DECL_INET_NTOP=0
21897 fi
21898 fi
21899
21900
21901 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
21902
21903
21904
21905
21906
21907
21908
7a6dbc2f 21909
725e2999 21910 gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext"
7a6dbc2f
SDJ
21911
21912
21913
7a6dbc2f 21914
725e2999 21915 fi
7a6dbc2f
SDJ
21916
21917
21918
21919
7a6dbc2f 21920
725e2999
JB
21921 GNULIB_INET_NTOP=1
21922
7a6dbc2f
SDJ
21923
21924
49e4877c
PA
21925
21926
88b48903
WN
21927
21928
88b48903
WN
21929 PRIPTR_PREFIX=
21930 if test -n "$STDINT_H"; then
9c9d63b1
PM
21931 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21932/* end confdefs.h. */
21933
21934 #ifdef _WIN64
21935 LLP64
21936 #endif
21937
21938int
21939main ()
21940{
21941
21942 ;
21943 return 0;
21944}
21945
21946_ACEOF
21947if ac_fn_c_try_compile "$LINENO"; then :
21948 PRIPTR_PREFIX='"l"'
21949else
21950 PRIPTR_PREFIX='"ll"'
21951fi
21952rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903
WN
21953 else
21954 for glpfx in '' l ll I64; do
21955 case $glpfx in
21956 '') gltype1='int';;
21957 l) gltype1='long int';;
21958 ll) gltype1='long long int';;
21959 I64) gltype1='__int64';;
21960 esac
21961 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21962/* end confdefs.h. */
21963#include <stdint.h>
21964 extern intptr_t foo;
21965 extern $gltype1 foo;
21966int
21967main ()
21968{
21969
21970 ;
21971 return 0;
21972}
21973_ACEOF
21974if ac_fn_c_try_compile "$LINENO"; then :
21975 PRIPTR_PREFIX='"'$glpfx'"'
21976fi
21977rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21978 test -n "$PRIPTR_PREFIX" && break
21979 done
21980 fi
21981
21982
21983
21984 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
21985$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
d0ac1c44 21986if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
88b48903
WN
21987 $as_echo_n "(cached) " >&6
21988else
21989 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21990/* end confdefs.h. */
21991/* Work also in C++ mode. */
21992 #define __STDC_LIMIT_MACROS 1
21993
21994 /* Work if build is not clean. */
21995 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21996
21997 #include <limits.h>
21998 #if HAVE_STDINT_H
21999 #include <stdint.h>
22000 #endif
22001
22002 #if defined INT32_MAX && defined INTMAX_MAX
22003 #define CONDITION (INT32_MAX < INTMAX_MAX)
88b48903 22004 #else
5df4cba6 22005 #define CONDITION (sizeof (int) < sizeof (long long int))
88b48903
WN
22006 #endif
22007 int test[CONDITION ? 1 : -1];
22008int
22009main ()
22010{
22011
22012 ;
22013 return 0;
22014}
22015_ACEOF
22016if ac_fn_c_try_compile "$LINENO"; then :
22017 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
22018else
22019 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
22020fi
22021rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22022fi
22023{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
22024$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
22025 if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
22026 INT32_MAX_LT_INTMAX_MAX=1;
22027 else
22028 INT32_MAX_LT_INTMAX_MAX=0;
22029 fi
22030
22031
22032 if test $APPLE_UNIVERSAL_BUILD = 0; then
22033
22034 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
22035$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
d0ac1c44 22036if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
88b48903
WN
22037 $as_echo_n "(cached) " >&6
22038else
22039 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22040/* end confdefs.h. */
22041/* Work also in C++ mode. */
22042 #define __STDC_LIMIT_MACROS 1
22043
22044 /* Work if build is not clean. */
22045 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
22046
22047 #include <limits.h>
22048 #if HAVE_STDINT_H
22049 #include <stdint.h>
22050 #endif
22051
22052 #if defined INT64_MAX
22053 #define CONDITION (INT64_MAX == LONG_MAX)
88b48903 22054 #else
5df4cba6 22055 #define CONDITION (sizeof (long long int) == sizeof (long int))
88b48903
WN
22056 #endif
22057 int test[CONDITION ? 1 : -1];
22058int
22059main ()
22060{
22061
22062 ;
22063 return 0;
22064}
22065_ACEOF
22066if ac_fn_c_try_compile "$LINENO"; then :
22067 gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
22068else
22069 gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
22070fi
22071rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22072fi
22073{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
22074$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
22075 if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
22076 INT64_MAX_EQ_LONG_MAX=1;
22077 else
22078 INT64_MAX_EQ_LONG_MAX=0;
22079 fi
22080
22081
22082 else
22083 INT64_MAX_EQ_LONG_MAX=-1
22084 fi
22085
22086 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
22087$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
d0ac1c44 22088if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
88b48903
WN
22089 $as_echo_n "(cached) " >&6
22090else
22091 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22092/* end confdefs.h. */
22093/* Work also in C++ mode. */
22094 #define __STDC_LIMIT_MACROS 1
22095
22096 /* Work if build is not clean. */
22097 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
22098
22099 #include <limits.h>
22100 #if HAVE_STDINT_H
22101 #include <stdint.h>
22102 #endif
22103
22104 #if defined UINT32_MAX && defined UINTMAX_MAX
22105 #define CONDITION (UINT32_MAX < UINTMAX_MAX)
88b48903 22106 #else
5df4cba6 22107 #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
88b48903
WN
22108 #endif
22109 int test[CONDITION ? 1 : -1];
22110int
22111main ()
22112{
22113
22114 ;
22115 return 0;
22116}
22117_ACEOF
22118if ac_fn_c_try_compile "$LINENO"; then :
22119 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
22120else
22121 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
22122fi
22123rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22124fi
22125{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
22126$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
22127 if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
22128 UINT32_MAX_LT_UINTMAX_MAX=1;
22129 else
22130 UINT32_MAX_LT_UINTMAX_MAX=0;
22131 fi
22132
22133
22134 if test $APPLE_UNIVERSAL_BUILD = 0; then
22135
22136 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
22137$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
d0ac1c44 22138if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
88b48903
WN
22139 $as_echo_n "(cached) " >&6
22140else
22141 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22142/* end confdefs.h. */
22143/* Work also in C++ mode. */
22144 #define __STDC_LIMIT_MACROS 1
22145
22146 /* Work if build is not clean. */
22147 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
22148
22149 #include <limits.h>
22150 #if HAVE_STDINT_H
22151 #include <stdint.h>
22152 #endif
22153
22154 #if defined UINT64_MAX
22155 #define CONDITION (UINT64_MAX == ULONG_MAX)
88b48903 22156 #else
5df4cba6 22157 #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
88b48903
WN
22158 #endif
22159 int test[CONDITION ? 1 : -1];
22160int
22161main ()
22162{
22163
22164 ;
22165 return 0;
22166}
22167_ACEOF
22168if ac_fn_c_try_compile "$LINENO"; then :
22169 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
22170else
22171 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
22172fi
22173rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22174fi
22175{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
22176$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
22177 if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
22178 UINT64_MAX_EQ_ULONG_MAX=1;
22179 else
22180 UINT64_MAX_EQ_ULONG_MAX=0;
22181 fi
22182
22183
22184 else
22185 UINT64_MAX_EQ_ULONG_MAX=-1
22186 fi
22187
22188
22189
22190
22191
698be2d8
CB
22192
22193
22194
22195 if test $ac_cv_func_isblank = no; then
22196 HAVE_ISBLANK=0
22197 fi
22198
22199 if test $HAVE_ISBLANK = 0; then
22200
22201
22202
22203
22204
22205
22206
22207
22208 gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext"
22209
22210 fi
22211
22212
22213cat >>confdefs.h <<_ACEOF
22214#define GNULIB_ISBLANK 1
22215_ACEOF
22216
22217
22218
22219
22220
22221
22222
22223 GNULIB_ISBLANK=1
22224
22225
22226
22227
22228
22229
88b48903
WN
22230 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
22231$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
d0ac1c44 22232if ${gl_cv_func_isnand_no_libm+:} false; then :
88b48903
WN
22233 $as_echo_n "(cached) " >&6
22234else
22235
22236 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22237/* end confdefs.h. */
22238#include <math.h>
9c9d63b1 22239 #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903
WN
22240 # undef isnand
22241 # define isnand(x) __builtin_isnan ((double)(x))
22242 #else
22243 # undef isnand
22244 # define isnand(x) isnan ((double)(x))
22245 #endif
22246 double x;
22247int
22248main ()
22249{
22250return isnand (x);
22251 ;
22252 return 0;
22253}
22254_ACEOF
22255if ac_fn_c_try_link "$LINENO"; then :
22256 gl_cv_func_isnand_no_libm=yes
22257else
22258 gl_cv_func_isnand_no_libm=no
22259fi
22260rm -f core conftest.err conftest.$ac_objext \
22261 conftest$ac_exeext conftest.$ac_ext
22262
22263fi
22264{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
22265$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
22266
22267 gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
22268 if test $gl_cv_func_isnand_no_libm = yes; then
22269
22270$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
22271
22272 fi
22273
22274 if test $gl_func_isnand_no_libm != yes; then
22275
22276
22277
22278
22279
22280
22281
22282
22283 gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
22284
22285
22286
22287
22288 fi
22289
22290
22291 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
22292$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
d0ac1c44 22293if ${gl_cv_func_isnanl_no_libm+:} false; then :
88b48903
WN
22294 $as_echo_n "(cached) " >&6
22295else
22296
22297 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22298/* end confdefs.h. */
22299#include <math.h>
9c9d63b1 22300 #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903 22301 # undef isnanl
9c9d63b1 22302 # define isnanl(x) __builtin_isnan ((long double)(x))
88b48903
WN
22303 #elif defined isnan
22304 # undef isnanl
22305 # define isnanl(x) isnan ((long double)(x))
22306 #endif
22307 long double x;
22308int
22309main ()
22310{
22311return isnanl (x);
22312 ;
22313 return 0;
22314}
22315_ACEOF
22316if ac_fn_c_try_link "$LINENO"; then :
22317 gl_cv_func_isnanl_no_libm=yes
22318else
22319 gl_cv_func_isnanl_no_libm=no
22320fi
22321rm -f core conftest.err conftest.$ac_objext \
22322 conftest$ac_exeext conftest.$ac_ext
22323
22324fi
22325{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
22326$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
22327
22328 gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
22329 if test $gl_func_isnanl_no_libm = yes; then
22330
22331
22332
22333
22334 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
22335$as_echo_n "checking whether isnanl works... " >&6; }
d0ac1c44 22336if ${gl_cv_func_isnanl_works+:} false; then :
88b48903
WN
22337 $as_echo_n "(cached) " >&6
22338else
22339
22340 if test "$cross_compiling" = yes; then :
c0c3707f
CB
22341 case "$host_os" in
22342 mingw*) # Guess yes on mingw, no on MSVC.
22343 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22344/* end confdefs.h. */
22345
22346#ifdef __MINGW32__
22347 Known
22348#endif
22349
22350_ACEOF
22351if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22352 $EGREP "Known" >/dev/null 2>&1; then :
4a626d0a 22353 gl_cv_func_isnanl_works="guessing yes"
c0c3707f
CB
22354else
22355 gl_cv_func_isnanl_works="guessing no"
22356fi
22357rm -f conftest*
22358
22359 ;;
22360 *) gl_cv_func_isnanl_works="guessing yes" ;;
22361 esac
22362
88b48903
WN
22363else
22364 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22365/* end confdefs.h. */
22366
22367#include <float.h>
22368#include <limits.h>
22369#include <math.h>
9c9d63b1 22370#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903 22371# undef isnanl
9c9d63b1 22372# define isnanl(x) __builtin_isnan ((long double)(x))
88b48903
WN
22373#elif defined isnan
22374# undef isnanl
22375# define isnanl(x) isnan ((long double)(x))
22376#endif
22377#define NWORDS \
22378 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
22379typedef union { unsigned int word[NWORDS]; long double value; }
22380 memory_long_double;
22381/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
22382 runtime type conversion. */
22383#ifdef __sgi
22384static long double NaNl ()
22385{
22386 double zero = 0.0;
22387 return zero / zero;
22388}
22389#else
22390# define NaNl() (0.0L / 0.0L)
22391#endif
22392int main ()
22393{
22394 int result = 0;
22395
22396 if (!isnanl (NaNl ()))
22397 result |= 1;
22398
22399 {
22400 memory_long_double m;
22401 unsigned int i;
22402
22403 /* The isnanl function should be immune against changes in the sign bit and
22404 in the mantissa bits. The xor operation twiddles a bit that can only be
22405 a sign bit or a mantissa bit (since the exponent never extends to
22406 bit 31). */
22407 m.value = NaNl ();
22408 m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
22409 for (i = 0; i < NWORDS; i++)
22410 m.word[i] |= 1;
22411 if (!isnanl (m.value))
22412 result |= 1;
22413 }
22414
22415#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
22416/* Representation of an 80-bit 'long double' as an initializer for a sequence
22417 of 'unsigned int' words. */
22418# ifdef WORDS_BIGENDIAN
22419# define LDBL80_WORDS(exponent,manthi,mantlo) \
22420 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
4a626d0a 22421 ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
88b48903
WN
22422 (unsigned int) (mantlo) << 16 \
22423 }
22424# else
22425# define LDBL80_WORDS(exponent,manthi,mantlo) \
22426 { mantlo, manthi, exponent }
22427# endif
22428 { /* Quiet NaN. */
22429 static memory_long_double x =
22430 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
22431 if (!isnanl (x.value))
22432 result |= 2;
22433 }
22434 {
22435 /* Signalling NaN. */
22436 static memory_long_double x =
22437 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
22438 if (!isnanl (x.value))
22439 result |= 2;
22440 }
4a626d0a 22441 /* isnanl should return something even for noncanonical values. */
88b48903
WN
22442 { /* Pseudo-NaN. */
22443 static memory_long_double x =
22444 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
4a626d0a 22445 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22446 result |= 4;
22447 }
22448 { /* Pseudo-Infinity. */
22449 static memory_long_double x =
22450 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
4a626d0a 22451 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22452 result |= 8;
22453 }
22454 { /* Pseudo-Zero. */
22455 static memory_long_double x =
22456 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
4a626d0a 22457 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22458 result |= 16;
22459 }
22460 { /* Unnormalized number. */
22461 static memory_long_double x =
22462 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
4a626d0a 22463 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22464 result |= 32;
22465 }
22466 { /* Pseudo-Denormal. */
22467 static memory_long_double x =
22468 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
4a626d0a 22469 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22470 result |= 64;
22471 }
22472#endif
22473
22474 return result;
22475}
22476_ACEOF
22477if ac_fn_c_try_run "$LINENO"; then :
22478 gl_cv_func_isnanl_works=yes
22479else
22480 gl_cv_func_isnanl_works=no
22481fi
22482rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22483 conftest.$ac_objext conftest.beam conftest.$ac_ext
22484fi
22485
22486
22487fi
22488{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
22489$as_echo "$gl_cv_func_isnanl_works" >&6; }
22490
22491 case "$gl_cv_func_isnanl_works" in
22492 *yes) ;;
22493 *) gl_func_isnanl_no_libm=no ;;
22494 esac
22495 fi
22496 if test $gl_func_isnanl_no_libm = yes; then
22497
22498$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
22499
22500 fi
22501
22502 if test $gl_func_isnanl_no_libm != yes; then
22503
22504
22505
22506
22507
22508
22509
22510
22511 gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext"
22512
22513
22514
22515
c0c3707f 22516 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
88b48903 22517$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
d0ac1c44 22518if ${gl_cv_cc_long_double_expbit0+:} false; then :
88b48903
WN
22519 $as_echo_n "(cached) " >&6
22520else
22521
22522 if test "$cross_compiling" = yes; then :
22523
22524 gl_cv_cc_long_double_expbit0="unknown"
c0c3707f
CB
22525 case "$host_os" in
22526 mingw*) # On native Windows (little-endian), we know the result
22527 # in two cases: mingw, MSVC.
22528 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22529/* end confdefs.h. */
22530
22531#ifdef __MINGW32__
22532 Known
22533#endif
22534
22535_ACEOF
22536if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22537 $EGREP "Known" >/dev/null 2>&1; then :
22538 gl_cv_cc_long_double_expbit0="word 2 bit 0"
22539fi
22540rm -f conftest*
22541
22542 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22543/* end confdefs.h. */
22544
22545#ifdef _MSC_VER
22546 Known
22547#endif
22548
22549_ACEOF
22550if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22551 $EGREP "Known" >/dev/null 2>&1; then :
22552 gl_cv_cc_long_double_expbit0="word 1 bit 20"
22553fi
22554rm -f conftest*
22555
22556 ;;
22557 esac
88b48903
WN
22558
22559else
22560 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22561/* end confdefs.h. */
22562
22563#include <float.h>
22564#include <stddef.h>
22565#include <stdio.h>
22566#include <string.h>
22567#define NWORDS \
22568 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
22569typedef union { long double value; unsigned int word[NWORDS]; }
22570 memory_long_double;
22571static unsigned int ored_words[NWORDS];
22572static unsigned int anded_words[NWORDS];
698be2d8 22573static void add_to_ored_words (long double *x)
88b48903
WN
22574{
22575 memory_long_double m;
22576 size_t i;
22577 /* Clear it first, in case
22578 sizeof (long double) < sizeof (memory_long_double). */
22579 memset (&m, 0, sizeof (memory_long_double));
698be2d8 22580 m.value = *x;
88b48903
WN
22581 for (i = 0; i < NWORDS; i++)
22582 {
22583 ored_words[i] |= m.word[i];
22584 anded_words[i] &= m.word[i];
22585 }
22586}
22587int main ()
22588{
698be2d8 22589 static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
88b48903
WN
22590 size_t j;
22591 FILE *fp = fopen ("conftest.out", "w");
22592 if (fp == NULL)
22593 return 1;
22594 for (j = 0; j < NWORDS; j++)
22595 anded_words[j] = ~ (unsigned int) 0;
698be2d8
CB
22596 for (j = 0; j < 5; j++)
22597 add_to_ored_words (&samples[j]);
88b48903
WN
22598 /* Remove bits that are common (e.g. if representation of the first mantissa
22599 bit is explicit). */
22600 for (j = 0; j < NWORDS; j++)
22601 ored_words[j] &= ~anded_words[j];
22602 /* Now find the nonzero word. */
22603 for (j = 0; j < NWORDS; j++)
22604 if (ored_words[j] != 0)
22605 break;
22606 if (j < NWORDS)
22607 {
22608 size_t i;
22609 for (i = j + 1; i < NWORDS; i++)
22610 if (ored_words[i] != 0)
22611 {
22612 fprintf (fp, "unknown");
22613 return (fclose (fp) != 0);
22614 }
22615 for (i = 0; ; i++)
22616 if ((ored_words[j] >> i) & 1)
22617 {
22618 fprintf (fp, "word %d bit %d", (int) j, (int) i);
22619 return (fclose (fp) != 0);
22620 }
22621 }
22622 fprintf (fp, "unknown");
22623 return (fclose (fp) != 0);
22624}
22625
22626_ACEOF
22627if ac_fn_c_try_run "$LINENO"; then :
22628 gl_cv_cc_long_double_expbit0=`cat conftest.out`
22629else
22630 gl_cv_cc_long_double_expbit0="unknown"
22631fi
22632rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22633 conftest.$ac_objext conftest.beam conftest.$ac_ext
22634fi
22635
22636 rm -f conftest.out
22637
22638fi
22639{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
22640$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
22641 case "$gl_cv_cc_long_double_expbit0" in
22642 word*bit*)
22643 word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
22644 bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
22645
22646cat >>confdefs.h <<_ACEOF
22647#define LDBL_EXPBIT0_WORD $word
22648_ACEOF
22649
22650
22651cat >>confdefs.h <<_ACEOF
22652#define LDBL_EXPBIT0_BIT $bit
22653_ACEOF
22654
22655 ;;
22656 esac
22657
22658
22659
22660 fi
22661
22662
5df4cba6
SM
22663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
22664$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; }
22665if ${gl_cv_c___inline+:} false; then :
22666 $as_echo_n "(cached) " >&6
22667else
22668 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22669/* end confdefs.h. */
22670typedef int foo_t;
22671 static __inline foo_t foo (void) { return 0; }
22672int
22673main ()
22674{
22675return foo ();
22676 ;
22677 return 0;
22678}
22679_ACEOF
22680if ac_fn_c_try_compile "$LINENO"; then :
22681 gl_cv_c___inline=yes
22682else
22683 gl_cv_c___inline=no
22684fi
22685rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22686fi
22687{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
22688$as_echo "$gl_cv_c___inline" >&6; }
22689 if test $gl_cv_c___inline = yes; then
22690
22691$as_echo "#define HAVE___INLINE 1" >>confdefs.h
22692
22693 fi
22694
22695
22696
22697
22698
22699 LOCALCHARSET_TESTS_ENVIRONMENT=
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711 case "$host_os" in
22712 solaris*)
22713
22714$as_echo "#define _LCONV_C99 1" >>confdefs.h
22715
22716 ;;
22717 esac
22718
22719 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
22720$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; }
22721if ${gl_cv_header_locale_h_posix2001+:} false; then :
22722 $as_echo_n "(cached) " >&6
22723else
22724 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22725/* end confdefs.h. */
22726#include <locale.h>
22727 int x = LC_MESSAGES;
22728 int y = sizeof (((struct lconv *) 0)->decimal_point);
22729int
22730main ()
22731{
22732
22733 ;
22734 return 0;
22735}
22736_ACEOF
22737if ac_fn_c_try_compile "$LINENO"; then :
22738 gl_cv_header_locale_h_posix2001=yes
22739else
22740 gl_cv_header_locale_h_posix2001=no
22741fi
22742rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22743fi
22744{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
22745$as_echo "$gl_cv_header_locale_h_posix2001" >&6; }
22746
22747 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
22748$as_echo_n "checking whether struct lconv is properly defined... " >&6; }
22749if ${gl_cv_sys_struct_lconv_ok+:} false; then :
c0c3707f
CB
22750 $as_echo_n "(cached) " >&6
22751else
22752 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22753/* end confdefs.h. */
5df4cba6
SM
22754#include <locale.h>
22755 struct lconv l;
22756 int x = sizeof (l.decimal_point);
22757 int y = sizeof (l.int_p_cs_precedes);
c0c3707f
CB
22758int
22759main ()
22760{
5df4cba6 22761
c0c3707f
CB
22762 ;
22763 return 0;
22764}
22765_ACEOF
22766if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 22767 gl_cv_sys_struct_lconv_ok=yes
c0c3707f 22768else
5df4cba6 22769 gl_cv_sys_struct_lconv_ok=no
c0c3707f
CB
22770fi
22771rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 22772
c0c3707f 22773fi
5df4cba6
SM
22774{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
22775$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
22776 if test $gl_cv_sys_struct_lconv_ok = no; then
22777 case "$host_os" in
22778 mingw*)
22779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22780/* end confdefs.h. */
c0c3707f 22781
5df4cba6
SM
22782#ifdef _MSC_VER
22783 Special
22784#endif
22785
22786_ACEOF
22787if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22788 $EGREP "Special" >/dev/null 2>&1; then :
22789
22790else
22791 REPLACE_STRUCT_LCONV=1
22792fi
22793rm -f conftest*
c0c3707f 22794
5df4cba6
SM
22795 ;;
22796 *) REPLACE_STRUCT_LCONV=1 ;;
22797 esac
c0c3707f 22798 fi
88b48903
WN
22799
22800
88b48903
WN
22801
22802
472fa5ee 22803
5df4cba6
SM
22804
22805
22806
22807
22808 if test $gl_cv_have_include_next = yes; then
22809 gl_cv_next_locale_h='<'locale.h'>'
22810 else
22811 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
22812$as_echo_n "checking absolute name of <locale.h>... " >&6; }
22813if ${gl_cv_next_locale_h+:} false; then :
22814 $as_echo_n "(cached) " >&6
22815else
22816
22817
22818
22819 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22820/* end confdefs.h. */
22821#include <locale.h>
22822_ACEOF
22823 case "$host_os" in
22824 aix*) gl_absname_cpp="$ac_cpp -C" ;;
22825 *) gl_absname_cpp="$ac_cpp" ;;
22826 esac
22827
22828 case "$host_os" in
22829 mingw*)
22830 gl_dirsep_regex='[/\\]'
22831 ;;
22832 *)
22833 gl_dirsep_regex='\/'
22834 ;;
22835 esac
22836 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
22837 gl_header_literal_regex=`echo 'locale.h' \
22838 | sed -e "$gl_make_literal_regex_sed"`
22839 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
22840 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
22841 s|^/[^/]|//&|
22842 p
22843 q
22844 }'
22845
22846 gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
22847 sed -n "$gl_absolute_header_sed"`
22848
22849 gl_header=$gl_cv_absolute_locale_h
22850 gl_cv_next_locale_h='"'$gl_header'"'
22851
22852
22853fi
22854{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
22855$as_echo "$gl_cv_next_locale_h" >&6; }
22856 fi
22857 NEXT_LOCALE_H=$gl_cv_next_locale_h
22858
22859 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
22860 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
22861 gl_next_as_first_directive='<'locale.h'>'
22862 else
22863 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
22864 gl_next_as_first_directive=$gl_cv_next_locale_h
22865 fi
22866 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
22867
22868
22869
22870
22871
22872
22873
22874
472fa5ee
SM
22875
22876
22877
5abebf3c
CB
22878 if test "$gl_threads_api" = posix; then
22879 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
22880 # pthread_rwlock_* functions.
c0c3707f 22881 has_rwlock=false
5abebf3c
CB
22882 ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
22883"
22884if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
c0c3707f 22885 has_rwlock=true
5abebf3c
CB
22886
22887$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
22888
22889fi
22890
c0c3707f
CB
22891 if $has_rwlock; then
22892
22893
22894 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
22895$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
22896if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
22897 $as_echo_n "(cached) " >&6
22898else
22899 save_LIBS="$LIBS"
22900 LIBS="$LIBS $LIBMULTITHREAD"
22901 if test "$cross_compiling" = yes; then :
22902 case "$host_os" in
22903 # Guess no on glibc systems.
22904 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22905 # Guess no on musl systems.
22906 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22907 # Guess no on bionic systems.
22908 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22909 # Guess yes on native Windows with the mingw-w64 winpthreads library.
22910 # Guess no on native Windows with the gnulib windows-rwlock module.
22911 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
22912 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
22913 else
22914 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
22915 fi
22916 ;;
22917 # If we don't know, obey --enable-cross-guesses.
22918 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
22919 esac
22920
22921else
22922 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22923/* end confdefs.h. */
22924
22925#include <errno.h>
22926#include <pthread.h>
22927#include <stdlib.h>
22928#include <unistd.h>
22929
22930#define SUCCEED() exit (0)
22931#define FAILURE() exit (1)
22932#define UNEXPECTED(n) (exit (10 + (n)))
22933
22934/* The main thread creates the waiting writer and the requesting reader threads
22935 in the default way; this guarantees that they have the same priority.
22936 We can reuse the main thread as first reader thread. */
22937
22938static pthread_rwlock_t lock;
22939static pthread_t reader1;
22940static pthread_t writer;
22941static pthread_t reader2;
22942static pthread_t timer;
22943/* Used to pass control from writer to reader2 and from reader2 to timer,
22944 as in a relay race.
22945 Passing control from one running thread to another running thread
22946 is most likely faster than to create the second thread. */
22947static pthread_mutex_t baton;
22948
22949static void *
22950timer_func (void *ignored)
22951{
22952 /* Step 13 (can be before or after step 12):
22953 The timer thread takes the baton, then waits a moment to make sure
22954 it can tell whether the second reader thread is blocked at step 12. */
22955 if (pthread_mutex_lock (&baton))
22956 UNEXPECTED (13);
22957 usleep (100000);
22958 /* By the time we get here, it's clear that the second reader thread is
22959 blocked at step 12. This is the desired behaviour. */
22960 SUCCEED ();
22961}
22962
22963static void *
22964reader2_func (void *ignored)
22965{
22966 int err;
22967
22968 /* Step 8 (can be before or after step 7):
22969 The second reader thread takes the baton, then waits a moment to make sure
22970 the writer thread has reached step 7. */
22971 if (pthread_mutex_lock (&baton))
22972 UNEXPECTED (8);
22973 usleep (100000);
22974 /* Step 9: The second reader thread requests the lock. */
22975 err = pthread_rwlock_tryrdlock (&lock);
22976 if (err == 0)
22977 FAILURE ();
22978 else if (err != EBUSY)
22979 UNEXPECTED (9);
22980 /* Step 10: Launch a timer, to test whether the next call blocks. */
22981 if (pthread_create (&timer, NULL, timer_func, NULL))
22982 UNEXPECTED (10);
22983 /* Step 11: Release the baton. */
22984 if (pthread_mutex_unlock (&baton))
22985 UNEXPECTED (11);
22986 /* Step 12: The second reader thread requests the lock. */
22987 err = pthread_rwlock_rdlock (&lock);
22988 if (err == 0)
22989 FAILURE ();
22990 else
22991 UNEXPECTED (12);
22992}
22993
22994static void *
22995writer_func (void *ignored)
22996{
22997 /* Step 4: Take the baton, so that the second reader thread does not go ahead
22998 too early. */
22999 if (pthread_mutex_lock (&baton))
23000 UNEXPECTED (4);
23001 /* Step 5: Create the second reader thread. */
23002 if (pthread_create (&reader2, NULL, reader2_func, NULL))
23003 UNEXPECTED (5);
23004 /* Step 6: Release the baton. */
23005 if (pthread_mutex_unlock (&baton))
23006 UNEXPECTED (6);
23007 /* Step 7: The writer thread requests the lock. */
23008 if (pthread_rwlock_wrlock (&lock))
23009 UNEXPECTED (7);
23010 return NULL;
23011}
23012
23013int
23014main ()
23015{
23016 reader1 = pthread_self ();
23017
23018 /* Step 1: The main thread initializes the lock and the baton. */
23019 if (pthread_rwlock_init (&lock, NULL))
23020 UNEXPECTED (1);
23021 if (pthread_mutex_init (&baton, NULL))
23022 UNEXPECTED (1);
23023 /* Step 2: The main thread acquires the lock as a reader. */
23024 if (pthread_rwlock_rdlock (&lock))
23025 UNEXPECTED (2);
23026 /* Step 3: Create the writer thread. */
23027 if (pthread_create (&writer, NULL, writer_func, NULL))
23028 UNEXPECTED (3);
23029 /* Job done. Go to sleep. */
23030 for (;;)
23031 {
23032 sleep (1);
23033 }
23034}
23035
23036_ACEOF
23037if ac_fn_c_try_run "$LINENO"; then :
23038 gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
23039else
23040 gl_cv_pthread_rwlock_rdlock_prefer_writer=no
23041fi
23042rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23043 conftest.$ac_objext conftest.beam conftest.$ac_ext
23044fi
23045
23046 LIBS="$save_LIBS"
23047
23048fi
23049{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
23050$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
23051 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
23052 *yes)
23053
23054$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
23055
23056 ;;
23057 esac
23058
23059 fi
5abebf3c
CB
23060 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
23061 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23062/* end confdefs.h. */
23063
23064 #include <pthread.h>
23065int
23066main ()
23067{
23068
23069#if __FreeBSD__ == 4
23070error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
23071#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
23072 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
23073error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
23074#else
23075int x = (int)PTHREAD_MUTEX_RECURSIVE;
23076return !x;
23077#endif
23078
23079 ;
23080 return 0;
23081}
23082_ACEOF
23083if ac_fn_c_try_compile "$LINENO"; then :
23084
23085$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
23086
23087fi
23088rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23089 fi
23090 :
23091
23092
23093
23094cat >>confdefs.h <<_ACEOF
23095#define GNULIB_LOCK 1
23096_ACEOF
23097
23098
23099
23100
88b48903 23101
472fa5ee 23102
f45c62c4
YQ
23103 if test $ac_cv_func_lstat = yes; then
23104
c0c3707f
CB
23105 case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
23106 solaris* | *no)
f45c62c4
YQ
23107 REPLACE_LSTAT=1
23108 ;;
23109 esac
23110 else
23111 HAVE_LSTAT=0
23112 fi
23113
23114 if test $REPLACE_LSTAT = 1; then
23115
23116
23117
23118
23119
23120
23121
23122
23123 gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
23124
23125 :
23126 fi
23127
23128
23129
23130
23131
23132 GNULIB_LSTAT=1
23133
23134
23135
23136
23137
23138$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
23139
23140
23141
23142
23143
23144
6a29c58e
YQ
23145 if test $gl_cv_func_malloc_posix = yes; then
23146
23147$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
23148
23149 else
23150 REPLACE_MALLOC=1
23151 fi
23152
23153 if test $REPLACE_MALLOC = 1; then
23154
23155
23156
23157
23158
23159
23160
23161
23162 gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
23163
23164 fi
23165
23166
23167
23168
23169
23170 GNULIB_MALLOC_POSIX=1
23171
23172
23173
23174
23175
23176$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
23177
23178
23179
23180
23181
23182
88b48903
WN
23183
23184
23185
23186
23187
88b48903 23188
c971b7fa 23189
c971b7fa 23190
98399780
YQ
23191
23192
23193
88b48903
WN
23194 if test $gl_cv_have_include_next = yes; then
23195 gl_cv_next_math_h='<'math.h'>'
23196 else
23197 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
23198$as_echo_n "checking absolute name of <math.h>... " >&6; }
d0ac1c44 23199if ${gl_cv_next_math_h+:} false; then :
88b48903
WN
23200 $as_echo_n "(cached) " >&6
23201else
c971b7fa 23202
88b48903 23203 if test $ac_cv_header_math_h = yes; then
c971b7fa
PA
23204
23205
4a626d0a
PA
23206
23207
23208 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 23209/* end confdefs.h. */
88b48903 23210#include <math.h>
8690e634 23211_ACEOF
4a626d0a
PA
23212 case "$host_os" in
23213 aix*) gl_absname_cpp="$ac_cpp -C" ;;
23214 *) gl_absname_cpp="$ac_cpp" ;;
23215 esac
23216
23217 case "$host_os" in
23218 mingw*)
23219 gl_dirsep_regex='[/\\]'
23220 ;;
23221 *)
23222 gl_dirsep_regex='\/'
23223 ;;
23224 esac
23225 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
23226 gl_header_literal_regex=`echo 'math.h' \
23227 | sed -e "$gl_make_literal_regex_sed"`
23228 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
23229 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
23230 s|^/[^/]|//&|
23231 p
23232 q
23233 }'
23234
23235 gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
23236 sed -n "$gl_absolute_header_sed"`
23237
23238 gl_header=$gl_cv_absolute_math_h
23239 gl_cv_next_math_h='"'$gl_header'"'
88b48903
WN
23240 else
23241 gl_cv_next_math_h='<'math.h'>'
23242 fi
8690e634 23243
c971b7fa 23244
88b48903
WN
23245fi
23246{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
23247$as_echo "$gl_cv_next_math_h" >&6; }
23248 fi
23249 NEXT_MATH_H=$gl_cv_next_math_h
c971b7fa 23250
88b48903
WN
23251 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
23252 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
23253 gl_next_as_first_directive='<'math.h'>'
23254 else
23255 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
23256 gl_next_as_first_directive=$gl_cv_next_math_h
23257 fi
23258 NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
8690e634 23259
c971b7fa 23260
c971b7fa
PA
23261
23262
c971b7fa 23263
88b48903
WN
23264 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
23265$as_echo_n "checking whether NAN macro works... " >&6; }
d0ac1c44 23266if ${gl_cv_header_math_nan_works+:} false; then :
c971b7fa
PA
23267 $as_echo_n "(cached) " >&6
23268else
8690e634
JK
23269 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23270/* end confdefs.h. */
88b48903 23271#include <math.h>
c971b7fa
PA
23272int
23273main ()
23274{
88b48903
WN
23275/* Solaris 10 has a broken definition of NAN. Other platforms
23276 fail to provide NAN, or provide it only in C99 mode; this
23277 test only needs to fail when NAN is provided but wrong. */
23278 float f = 1.0f;
23279#ifdef NAN
23280 f = NAN;
23281#endif
23282 return f == 0;
c971b7fa
PA
23283 ;
23284 return 0;
23285}
23286_ACEOF
23287if ac_fn_c_try_compile "$LINENO"; then :
88b48903 23288 gl_cv_header_math_nan_works=yes
8690e634 23289else
88b48903 23290 gl_cv_header_math_nan_works=no
c971b7fa
PA
23291fi
23292rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 23293fi
88b48903
WN
23294{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
23295$as_echo "$gl_cv_header_math_nan_works" >&6; }
23296 if test $gl_cv_header_math_nan_works = no; then
23297 REPLACE_NAN=1
c971b7fa 23298 fi
88b48903
WN
23299 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
23300$as_echo_n "checking whether HUGE_VAL works... " >&6; }
d0ac1c44 23301if ${gl_cv_header_math_huge_val_works+:} false; then :
c971b7fa
PA
23302 $as_echo_n "(cached) " >&6
23303else
8690e634 23304 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 23305/* end confdefs.h. */
88b48903 23306#include <math.h>
c971b7fa
PA
23307int
23308main ()
23309{
88b48903
WN
23310/* Solaris 10 has a broken definition of HUGE_VAL. */
23311 double d = HUGE_VAL;
23312 return d == 0;
c971b7fa
PA
23313 ;
23314 return 0;
23315}
23316_ACEOF
23317if ac_fn_c_try_compile "$LINENO"; then :
88b48903 23318 gl_cv_header_math_huge_val_works=yes
8690e634 23319else
88b48903 23320 gl_cv_header_math_huge_val_works=no
c971b7fa
PA
23321fi
23322rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 23323fi
88b48903
WN
23324{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
23325$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
23326 if test $gl_cv_header_math_huge_val_works = no; then
23327 REPLACE_HUGE_VAL=1
8690e634 23328 fi
c971b7fa 23329
c971b7fa 23330
c971b7fa
PA
23331
23332
23333
23334
23335
23336
c971b7fa 23337
c971b7fa 23338
c971b7fa 23339
c971b7fa
PA
23340
23341
c971b7fa 23342
472fa5ee 23343
5df4cba6
SM
23344
23345
23346
23347 if case "$host_os" in
23348 mingw*) true ;;
23349 *) test $ac_cv_func_mbsinit = yes ;;
23350 esac \
23351 && test $ac_cv_func_mbrtowc = yes; then
472fa5ee
SM
23352
23353
23354
23355
c0c3707f
CB
23356 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
23357$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
23358if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
23359 $as_echo_n "(cached) " >&6
23360else
472fa5ee 23361
c0c3707f
CB
23362 case "$host_os" in
23363 # Guess no on AIX and OSF/1.
23364 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
23365 # Guess yes otherwise.
23366 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
23367 esac
23368 if test $LOCALE_JA != none; then
23369 if test "$cross_compiling" = yes; then :
472fa5ee 23370 :
c0c3707f
CB
23371else
23372 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23373/* end confdefs.h. */
472fa5ee 23374
c0c3707f
CB
23375#include <locale.h>
23376#include <string.h>
c0c3707f
CB
23377#include <wchar.h>
23378int main ()
23379{
23380 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23381 {
23382 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23383 mbstate_t state;
23384 wchar_t wc;
472fa5ee 23385
c0c3707f
CB
23386 memset (&state, '\0', sizeof (mbstate_t));
23387 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23388 if (mbsinit (&state))
23389 return 2;
23390 }
23391 return 0;
23392}
23393_ACEOF
23394if ac_fn_c_try_run "$LINENO"; then :
23395 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 23396else
c0c3707f
CB
23397 gl_cv_func_mbrtowc_incomplete_state=no
23398fi
23399rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23400 conftest.$ac_objext conftest.beam conftest.$ac_ext
23401fi
8690e634 23402
c0c3707f
CB
23403 else
23404 if test $LOCALE_FR_UTF8 != none; then
23405 if test "$cross_compiling" = yes; then :
8690e634
JK
23406 :
23407else
c971b7fa
PA
23408 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23409/* end confdefs.h. */
c971b7fa 23410
8690e634
JK
23411#include <locale.h>
23412#include <string.h>
8690e634
JK
23413#include <wchar.h>
23414int main ()
c971b7fa 23415{
c0c3707f 23416 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
8690e634 23417 {
c0c3707f 23418 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
8690e634
JK
23419 mbstate_t state;
23420 wchar_t wc;
23421
23422 memset (&state, '\0', sizeof (mbstate_t));
23423 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23424 if (mbsinit (&state))
c0c3707f 23425 return 2;
8690e634 23426 }
c971b7fa
PA
23427 return 0;
23428}
23429_ACEOF
8690e634
JK
23430if ac_fn_c_try_run "$LINENO"; then :
23431 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 23432else
8690e634 23433 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa 23434fi
8690e634
JK
23435rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23436 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 23437fi
c971b7fa 23438
c0c3707f 23439 fi
8690e634 23440 fi
c971b7fa 23441
8690e634
JK
23442fi
23443{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
23444$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa 23445
c971b7fa 23446
c971b7fa 23447
c971b7fa 23448
8690e634
JK
23449 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
23450$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 23451if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
23452 $as_echo_n "(cached) " >&6
23453else
23454
8690e634
JK
23455 case "$host_os" in
23456 # Guess no on Solaris 8.
23457 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
23458 # Guess yes otherwise.
23459 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
23460 esac
23461 if test $LOCALE_ZH_CN != none; then
23462 if test "$cross_compiling" = yes; then :
23463 :
23464else
23465 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
23466/* end confdefs.h. */
23467
8690e634
JK
23468#include <locale.h>
23469#include <stdlib.h>
23470#include <string.h>
8690e634
JK
23471#include <wchar.h>
23472int main ()
c971b7fa 23473{
8690e634
JK
23474 /* This fails on Solaris 8:
23475 mbrtowc returns 2, and sets wc to 0x00F0.
23476 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
23477 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23478 {
23479 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
23480 mbstate_t state;
23481 wchar_t wc;
23482
23483 memset (&state, '\0', sizeof (mbstate_t));
23484 if (mbrtowc (&wc, input + 3, 6, &state) != 4
23485 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 23486 return 2;
8690e634 23487 }
c971b7fa
PA
23488 return 0;
23489}
23490_ACEOF
8690e634
JK
23491if ac_fn_c_try_run "$LINENO"; then :
23492 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 23493else
8690e634 23494 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 23495fi
8690e634
JK
23496rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23497 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 23498fi
c971b7fa 23499
8690e634 23500 fi
c971b7fa 23501
8690e634
JK
23502fi
23503{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
23504$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
23505
23506 REPLACE_MBSTATE_T=0
23507 case "$gl_cv_func_mbrtowc_incomplete_state" in
23508 *yes) ;;
23509 *) REPLACE_MBSTATE_T=1 ;;
23510 esac
23511 case "$gl_cv_func_mbrtowc_sanitycheck" in
23512 *yes) ;;
23513 *) REPLACE_MBSTATE_T=1 ;;
23514 esac
c971b7fa 23515 else
8690e634 23516 REPLACE_MBSTATE_T=1
c971b7fa
PA
23517 fi
23518
23519
23520
8690e634
JK
23521 if test $ac_cv_func_mbrtowc = no; then
23522 HAVE_MBRTOWC=0
23523 ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
9c9d63b1 23524 #include <wchar.h>
c971b7fa 23525
8690e634 23526"
d0ac1c44 23527if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
8690e634
JK
23528 ac_have_decl=1
23529else
23530 ac_have_decl=0
c971b7fa 23531fi
c971b7fa 23532
8690e634
JK
23533cat >>confdefs.h <<_ACEOF
23534#define HAVE_DECL_MBRTOWC $ac_have_decl
23535_ACEOF
c971b7fa 23536
8690e634
JK
23537 if test $ac_cv_have_decl_mbrtowc = yes; then
23538 REPLACE_MBRTOWC=1
23539 fi
23540 else
23541 if test $REPLACE_MBSTATE_T = 1; then
23542 REPLACE_MBRTOWC=1
23543 else
c971b7fa
PA
23544
23545
23546
8690e634
JK
23547 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
23548$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
d0ac1c44 23549if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
8690e634 23550 $as_echo_n "(cached) " >&6
c971b7fa 23551else
c971b7fa 23552
8690e634
JK
23553 case "$host_os" in
23554 # Guess no on Solaris.
23555 solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
23556 # Guess yes otherwise.
23557 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
23558 esac
23559 if test $LOCALE_FR_UTF8 != none; then
23560 if test "$cross_compiling" = yes; then :
23561 :
23562else
23563 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
23564/* end confdefs.h. */
23565
8690e634
JK
23566#include <locale.h>
23567#include <stdlib.h>
23568#include <string.h>
8690e634
JK
23569#include <wchar.h>
23570int main ()
23571{
23572 int result = 0;
23573
23574 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23575 {
23576 char input[] = "\303\237er";
23577 mbstate_t state;
23578 wchar_t wc;
23579 size_t ret;
23580
23581 memset (&state, '\0', sizeof (mbstate_t));
23582 wc = (wchar_t) 0xBADFACE;
23583 ret = mbrtowc (&wc, input, 5, &state);
23584 if (ret != 2)
23585 result |= 1;
23586 if (!mbsinit (&state))
23587 result |= 2;
c971b7fa 23588
8690e634
JK
23589 memset (&state, '\0', sizeof (mbstate_t));
23590 ret = mbrtowc (NULL, input, 5, &state);
23591 if (ret != 2) /* Solaris 7 fails here: ret is -1. */
23592 result |= 4;
23593 if (!mbsinit (&state))
23594 result |= 8;
23595 }
23596 return result;
23597}
c971b7fa 23598_ACEOF
8690e634
JK
23599if ac_fn_c_try_run "$LINENO"; then :
23600 gl_cv_func_mbrtowc_null_arg1=yes
23601else
23602 gl_cv_func_mbrtowc_null_arg1=no
23603fi
23604rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23605 conftest.$ac_objext conftest.beam conftest.$ac_ext
23606fi
c971b7fa 23607
8690e634 23608 fi
c971b7fa 23609
c971b7fa 23610fi
8690e634
JK
23611{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
23612$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
c971b7fa 23613
c971b7fa 23614
c971b7fa 23615
c971b7fa 23616
8690e634
JK
23617 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
23618$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
d0ac1c44 23619if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
8690e634
JK
23620 $as_echo_n "(cached) " >&6
23621else
c971b7fa 23622
8690e634
JK
23623 case "$host_os" in
23624 # Guess no on OSF/1.
23625 osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
23626 # Guess yes otherwise.
23627 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
23628 esac
23629 if test $LOCALE_FR_UTF8 != none; then
23630 if test "$cross_compiling" = yes; then :
c971b7fa 23631 :
8690e634
JK
23632else
23633 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23634/* end confdefs.h. */
23635
23636#include <locale.h>
23637#include <string.h>
8690e634
JK
23638#include <wchar.h>
23639int main ()
23640{
23641 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23642 {
23643 mbstate_t state;
23644 wchar_t wc;
23645 int ret;
23646
23647 memset (&state, '\0', sizeof (mbstate_t));
23648 wc = (wchar_t) 0xBADFACE;
23649 mbrtowc (&wc, NULL, 5, &state);
23650 /* Check that wc was not modified. */
23651 if (wc != (wchar_t) 0xBADFACE)
c0c3707f 23652 return 2;
8690e634
JK
23653 }
23654 return 0;
23655}
23656_ACEOF
23657if ac_fn_c_try_run "$LINENO"; then :
23658 gl_cv_func_mbrtowc_null_arg2=yes
23659else
23660 gl_cv_func_mbrtowc_null_arg2=no
23661fi
23662rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23663 conftest.$ac_objext conftest.beam conftest.$ac_ext
23664fi
23665
23666 fi
23667
23668fi
23669{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
23670$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
c971b7fa
PA
23671
23672
23673
23674
23675
23676
8690e634
JK
23677 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
23678$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
d0ac1c44 23679if ${gl_cv_func_mbrtowc_retval+:} false; then :
8690e634
JK
23680 $as_echo_n "(cached) " >&6
23681else
23682
23683 case "$host_os" in
23684 # Guess no on HP-UX, Solaris, native Windows.
23685 hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
23686 # Guess yes otherwise.
23687 *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
23688 esac
23689 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
23690 || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
23691 if test "$cross_compiling" = yes; then :
c971b7fa 23692 :
8690e634
JK
23693else
23694 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23695/* end confdefs.h. */
c971b7fa 23696
8690e634
JK
23697#include <locale.h>
23698#include <string.h>
8690e634
JK
23699#include <wchar.h>
23700int main ()
23701{
23702 int result = 0;
23703 int found_some_locale = 0;
23704 /* This fails on Solaris. */
23705 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23706 {
23707 char input[] = "B\303\274\303\237er"; /* "Büßer" */
23708 mbstate_t state;
23709 wchar_t wc;
23710
23711 memset (&state, '\0', sizeof (mbstate_t));
23712 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23713 {
23714 input[1] = '\0';
23715 if (mbrtowc (&wc, input + 2, 5, &state) != 1)
23716 result |= 1;
23717 }
23718 found_some_locale = 1;
23719 }
23720 /* This fails on HP-UX 11.11. */
23721 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23722 {
23723 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23724 mbstate_t state;
23725 wchar_t wc;
23726
23727 memset (&state, '\0', sizeof (mbstate_t));
23728 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23729 {
23730 input[1] = '\0';
23731 if (mbrtowc (&wc, input + 2, 5, &state) != 2)
23732 result |= 2;
23733 }
23734 found_some_locale = 1;
23735 }
5df4cba6
SM
23736 /* This fails on native Windows. */
23737 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
23738 {
23739 char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
23740 mbstate_t state;
23741 wchar_t wc;
23742
23743 memset (&state, '\0', sizeof (mbstate_t));
23744 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23745 {
23746 input[3] = '\0';
23747 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23748 result |= 4;
23749 }
23750 found_some_locale = 1;
23751 }
23752 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
23753 {
23754 char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
23755 mbstate_t state;
23756 wchar_t wc;
23757
23758 memset (&state, '\0', sizeof (mbstate_t));
23759 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23760 {
23761 input[3] = '\0';
23762 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23763 result |= 8;
23764 }
23765 found_some_locale = 1;
23766 }
23767 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
23768 {
23769 char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
23770 mbstate_t state;
23771 wchar_t wc;
23772
23773 memset (&state, '\0', sizeof (mbstate_t));
23774 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23775 {
23776 input[3] = '\0';
23777 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23778 result |= 16;
23779 }
23780 found_some_locale = 1;
23781 }
23782 return (found_some_locale ? result : 77);
23783}
23784_ACEOF
23785if ac_fn_c_try_run "$LINENO"; then :
23786 gl_cv_func_mbrtowc_retval=yes
23787else
23788 if test $? != 77; then
23789 gl_cv_func_mbrtowc_retval=no
23790 fi
23791
23792fi
23793rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23794 conftest.$ac_objext conftest.beam conftest.$ac_ext
23795fi
23796
23797 fi
23798
23799fi
23800{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
23801$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
23802
23803
23804
23805
23806 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
23807$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
23808if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
23809 $as_echo_n "(cached) " >&6
23810else
23811
23812 case "$host_os" in
23813 # Guess no on Solaris 8 and 9.
23814 solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
23815 # Guess yes otherwise.
23816 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
23817 esac
23818 if test $LOCALE_ZH_CN != none; then
23819 if test "$cross_compiling" = yes; then :
23820 :
23821else
23822 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23823/* end confdefs.h. */
23824
23825#include <locale.h>
23826#include <string.h>
5df4cba6
SM
23827#include <wchar.h>
23828int main ()
23829{
23830 /* This fails on Solaris 8 and 9. */
23831 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23832 {
23833 mbstate_t state;
23834 wchar_t wc;
23835
23836 memset (&state, '\0', sizeof (mbstate_t));
23837 if (mbrtowc (&wc, "", 1, &state) != 0)
23838 return 2;
23839 }
23840 return 0;
23841}
23842_ACEOF
23843if ac_fn_c_try_run "$LINENO"; then :
23844 gl_cv_func_mbrtowc_nul_retval=yes
23845else
23846 gl_cv_func_mbrtowc_nul_retval=no
23847fi
23848rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23849 conftest.$ac_objext conftest.beam conftest.$ac_ext
23850fi
23851
23852 fi
23853
23854fi
23855{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
23856$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
23857
23858
23859
23860 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5
23861$as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; }
23862if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then :
23863 $as_echo_n "(cached) " >&6
23864else
23865
23866 case "$host_os" in
23867 # Guess yes on native Windows.
23868 mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
23869 *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
23870 esac
23871 case "$host_os" in
23872 mingw*)
23873 if test "$cross_compiling" = yes; then :
23874 :
23875else
23876 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23877/* end confdefs.h. */
23878
23879#include <locale.h>
23880#include <string.h>
5df4cba6
SM
23881#include <wchar.h>
23882int main ()
23883{
23884 int result = 0;
23885 if (setlocale (LC_ALL, "French_France.65001") != NULL)
23886 {
23887 wchar_t wc = (wchar_t) 0xBADFACE;
23888 mbstate_t state;
23889
23890 memset (&state, '\0', sizeof (mbstate_t));
23891 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
23892 && wc != (wchar_t) 0xBADFACE)
23893 result |= 1;
23894 }
8690e634
JK
23895 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
23896 {
5df4cba6 23897 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23898 mbstate_t state;
8690e634
JK
23899
23900 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23901 if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
23902 && wc != (wchar_t) 0xBADFACE)
23903 result |= 2;
8690e634
JK
23904 }
23905 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
23906 {
5df4cba6 23907 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23908 mbstate_t state;
8690e634
JK
23909
23910 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23911 if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
23912 && wc != (wchar_t) 0xBADFACE)
23913 result |= 4;
8690e634
JK
23914 }
23915 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
23916 {
5df4cba6 23917 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23918 mbstate_t state;
8690e634
JK
23919
23920 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23921 if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
23922 && wc != (wchar_t) 0xBADFACE)
23923 result |= 8;
8690e634 23924 }
5df4cba6 23925 return result;
8690e634
JK
23926}
23927_ACEOF
23928if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23929 gl_cv_func_mbrtowc_stores_incomplete=no
8690e634 23930else
5df4cba6 23931 gl_cv_func_mbrtowc_stores_incomplete=yes
8690e634
JK
23932fi
23933rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23934 conftest.$ac_objext conftest.beam conftest.$ac_ext
23935fi
c971b7fa 23936
5df4cba6
SM
23937 ;;
23938 *)
8690e634 23939
5df4cba6
SM
23940 if test $LOCALE_FR_UTF8 != none; then
23941 if test "$cross_compiling" = yes; then :
8690e634 23942 :
c971b7fa
PA
23943else
23944 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23945/* end confdefs.h. */
23946
8690e634 23947#include <locale.h>
c971b7fa 23948#include <string.h>
8690e634
JK
23949#include <wchar.h>
23950int main ()
c971b7fa 23951{
5df4cba6 23952 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
c971b7fa 23953 {
5df4cba6 23954 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23955 mbstate_t state;
c971b7fa 23956
8690e634 23957 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23958 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
23959 && wc != (wchar_t) 0xBADFACE)
23960 return 1;
8690e634 23961 }
c971b7fa
PA
23962 return 0;
23963}
23964_ACEOF
23965if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23966 gl_cv_func_mbrtowc_stores_incomplete=no
c971b7fa 23967else
5df4cba6 23968 gl_cv_func_mbrtowc_stores_incomplete=yes
c971b7fa
PA
23969fi
23970rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23971 conftest.$ac_objext conftest.beam conftest.$ac_ext
23972fi
23973
5df4cba6
SM
23974 fi
23975 ;;
23976 esac
8690e634 23977
c971b7fa 23978fi
5df4cba6
SM
23979{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5
23980$as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; }
8690e634 23981
4a626d0a
PA
23982
23983
23984 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
23985$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
d0ac1c44 23986if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
4a626d0a
PA
23987 $as_echo_n "(cached) " >&6
23988else
23989
23990 case "$host_os" in
c0c3707f
CB
23991 # Guess no on AIX and glibc systems.
23992 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
23993 # Guess yes on native Windows.
23994 mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
23995 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
4a626d0a
PA
23996 esac
23997 if test "$cross_compiling" = yes; then :
23998 :
23999else
24000 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24001/* end confdefs.h. */
24002
24003 #include <wchar.h>
24004 static wchar_t wc;
24005 static mbstate_t mbs;
24006 int
24007 main (void)
24008 {
49e4877c 24009 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
4a626d0a
PA
24010 }
24011_ACEOF
24012if ac_fn_c_try_run "$LINENO"; then :
4a626d0a 24013 gl_cv_func_mbrtowc_empty_input=yes
49e4877c
PA
24014else
24015 gl_cv_func_mbrtowc_empty_input=no
4a626d0a
PA
24016fi
24017rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24018 conftest.$ac_objext conftest.beam conftest.$ac_ext
24019fi
24020
24021
24022fi
24023{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
24024$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
24025
49e4877c 24026
c0c3707f 24027 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
49e4877c 24028$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
5df4cba6 24029if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then :
49e4877c
PA
24030 $as_echo_n "(cached) " >&6
24031else
24032
5df4cba6 24033 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
49e4877c
PA
24034
24035 if test "$cross_compiling" = yes; then :
c0c3707f
CB
24036 case "$host_os" in
24037 # Guess yes on native Windows.
5df4cba6 24038 mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
c0c3707f
CB
24039 esac
24040
49e4877c
PA
24041else
24042 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24043/* end confdefs.h. */
24044#include <limits.h>
24045 #include <locale.h>
24046 #include <wchar.h>
24047
24048int
24049main ()
24050{
24051
24052 int i;
24053 char *locale = setlocale (LC_ALL, "C");
24054 if (! locale)
c0c3707f 24055 return 2;
49e4877c
PA
24056 for (i = CHAR_MIN; i <= CHAR_MAX; i++)
24057 {
24058 char c = i;
24059 wchar_t wc;
24060 mbstate_t mbs = { 0, };
24061 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
24062 if (1 < ss)
c0c3707f 24063 return 3;
49e4877c
PA
24064 }
24065 return 0;
24066
6ec2e0f5
SDJ
24067 ;
24068 return 0;
24069}
24070_ACEOF
24071if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 24072 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes
6ec2e0f5 24073else
5df4cba6 24074 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no
6ec2e0f5
SDJ
24075fi
24076rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24077 conftest.$ac_objext conftest.beam conftest.$ac_ext
24078fi
24079
c0c3707f 24080
6ec2e0f5 24081fi
5df4cba6
SM
24082{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5
24083$as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; }
6ec2e0f5
SDJ
24084
24085 case "$gl_cv_func_mbrtowc_null_arg1" in
24086 *yes) ;;
24087 *)
24088$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
24089
24090 REPLACE_MBRTOWC=1
24091 ;;
24092 esac
24093 case "$gl_cv_func_mbrtowc_null_arg2" in
24094 *yes) ;;
24095 *)
24096$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
24097
24098 REPLACE_MBRTOWC=1
24099 ;;
24100 esac
24101 case "$gl_cv_func_mbrtowc_retval" in
24102 *yes) ;;
24103 *)
24104$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
24105
24106 REPLACE_MBRTOWC=1
24107 ;;
24108 esac
24109 case "$gl_cv_func_mbrtowc_nul_retval" in
24110 *yes) ;;
24111 *)
24112$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
24113
5df4cba6
SM
24114 REPLACE_MBRTOWC=1
24115 ;;
24116 esac
24117 case "$gl_cv_func_mbrtowc_stores_incomplete" in
24118 *no) ;;
24119 *)
24120$as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h
24121
24122 REPLACE_MBRTOWC=1
24123 ;;
24124 esac
24125 case "$gl_cv_func_mbrtowc_empty_input" in
24126 *yes) ;;
24127 *)
24128$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
24129
24130 REPLACE_MBRTOWC=1
24131 ;;
24132 esac
24133 case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
24134 *yes) ;;
24135 *)
24136$as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
24137
24138 REPLACE_MBRTOWC=1
24139 ;;
24140 esac
24141 fi
24142 fi
24143 if test $REPLACE_MBSTATE_T = 1; then
24144 case "$host_os" in
24145 mingw*) LIB_MBRTOWC= ;;
24146 *)
24147
24148
24149 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
24150$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
24151if ${gl_cv_have_weak+:} false; then :
24152 $as_echo_n "(cached) " >&6
24153else
24154 gl_cv_have_weak=no
24155 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24156/* end confdefs.h. */
24157extern void xyzzy ();
24158#pragma weak xyzzy
24159int
24160main ()
24161{
24162xyzzy();
24163 ;
24164 return 0;
24165}
24166_ACEOF
24167if ac_fn_c_try_link "$LINENO"; then :
24168 gl_cv_have_weak=maybe
24169fi
24170rm -f core conftest.err conftest.$ac_objext \
24171 conftest$ac_exeext conftest.$ac_ext
24172 if test $gl_cv_have_weak = maybe; then
24173 if test "$cross_compiling" = yes; then :
24174 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24175/* end confdefs.h. */
24176#ifdef __ELF__
24177 Extensible Linking Format
24178 #endif
24179
24180_ACEOF
24181if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24182 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
24183 gl_cv_have_weak="guessing yes"
24184else
24185 gl_cv_have_weak="guessing no"
24186fi
24187rm -f conftest*
24188
24189
24190else
24191 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24192/* end confdefs.h. */
24193
24194#include <stdio.h>
24195#pragma weak fputs
24196int main ()
24197{
24198 return (fputs == NULL);
24199}
24200_ACEOF
24201if ac_fn_c_try_run "$LINENO"; then :
24202 gl_cv_have_weak=yes
24203else
24204 gl_cv_have_weak=no
24205fi
24206rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24207 conftest.$ac_objext conftest.beam conftest.$ac_ext
24208fi
24209
24210 fi
24211 case " $LDFLAGS " in
24212 *" -static "*) gl_cv_have_weak=no ;;
24213 esac
24214 case "$gl_cv_have_weak" in
24215 *yes)
24216 case "$host_os" in
24217 freebsd* | dragonfly*)
24218 : > conftest1.c
24219 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
24220 cat <<EOF > conftest2.c
24221#include <pthread.h>
24222#pragma weak pthread_mutexattr_gettype
24223int main ()
24224{
24225 return (pthread_mutexattr_gettype != NULL);
24226}
24227EOF
24228 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
24229 || gl_cv_have_weak=no
24230 rm -f conftest1.c libempty.so conftest2.c conftest
24231 ;;
24232 esac
24233 ;;
24234 esac
24235
24236fi
24237{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
24238$as_echo "$gl_cv_have_weak" >&6; }
24239 case "$gl_cv_have_weak" in
24240 *yes)
24241
24242$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
24243
24244 ;;
24245 esac
24246
24247 case "$gl_cv_have_weak" in
24248 *yes) LIB_MBRTOWC= ;;
24249 *) LIB_MBRTOWC="$LIBPTHREAD" ;;
24250 esac
24251 ;;
24252 esac
24253 else
24254 LIB_MBRTOWC=
24255 fi
24256
24257
24258 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
24259
24260
24261
24262
24263
24264
24265
24266
24267 gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
24268
24269 if test $REPLACE_MBSTATE_T = 1; then
24270
24271
24272
24273
24274
24275
24276
24277
24278 gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext"
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288 gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext"
24289
24290
24291
24292
24293 CFLAG_VISIBILITY=
24294 HAVE_VISIBILITY=0
24295 if test -n "$GCC"; then
24296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
24297$as_echo_n "checking whether the -Werror option is usable... " >&6; }
24298if ${gl_cv_cc_vis_werror+:} false; then :
24299 $as_echo_n "(cached) " >&6
24300else
24301 gl_save_CFLAGS="$CFLAGS"
24302 CFLAGS="$CFLAGS -Werror"
24303 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24304/* end confdefs.h. */
24305
24306int
24307main ()
24308{
24309
24310 ;
24311 return 0;
24312}
24313_ACEOF
24314if ac_fn_c_try_compile "$LINENO"; then :
24315 gl_cv_cc_vis_werror=yes
24316else
24317 gl_cv_cc_vis_werror=no
24318fi
24319rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24320 CFLAGS="$gl_save_CFLAGS"
24321
24322fi
24323{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
24324$as_echo "$gl_cv_cc_vis_werror" >&6; }
24325 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
24326$as_echo_n "checking for simple visibility declarations... " >&6; }
24327if ${gl_cv_cc_visibility+:} false; then :
24328 $as_echo_n "(cached) " >&6
24329else
24330 gl_save_CFLAGS="$CFLAGS"
24331 CFLAGS="$CFLAGS -fvisibility=hidden"
24332 if test $gl_cv_cc_vis_werror = yes; then
24333 CFLAGS="$CFLAGS -Werror"
24334 fi
24335 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24336/* end confdefs.h. */
24337extern __attribute__((__visibility__("hidden"))) int hiddenvar;
24338 extern __attribute__((__visibility__("default"))) int exportedvar;
24339 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
24340 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
24341 void dummyfunc (void) {}
24342
24343int
24344main ()
24345{
6ec2e0f5 24346
5df4cba6
SM
24347 ;
24348 return 0;
24349}
24350_ACEOF
24351if ac_fn_c_try_compile "$LINENO"; then :
24352 gl_cv_cc_visibility=yes
24353else
24354 gl_cv_cc_visibility=no
24355fi
24356rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24357 CFLAGS="$gl_save_CFLAGS"
6ec2e0f5 24358
5df4cba6
SM
24359fi
24360{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
24361$as_echo "$gl_cv_cc_visibility" >&6; }
24362 if test $gl_cv_cc_visibility = yes; then
24363 CFLAG_VISIBILITY="-fvisibility=hidden"
24364 HAVE_VISIBILITY=1
6ec2e0f5
SDJ
24365 fi
24366 fi
24367
6ec2e0f5
SDJ
24368
24369
5df4cba6
SM
24370cat >>confdefs.h <<_ACEOF
24371#define HAVE_VISIBILITY $HAVE_VISIBILITY
24372_ACEOF
6ec2e0f5
SDJ
24373
24374
6ec2e0f5 24375
5df4cba6 24376 fi
6ec2e0f5 24377
c0c3707f 24378
6ec2e0f5
SDJ
24379 :
24380
24381 fi
24382
24383
24384
24385
24386
24387 GNULIB_MBRTOWC=1
24388
24389
24390
24391
24392
24393$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
5df4cba6
SM
24408
24409 if case "$host_os" in
24410 mingw*) true ;;
24411 *) test $ac_cv_func_mbsinit = yes ;;
24412 esac \
24413 && test $ac_cv_func_mbrtowc = yes; then
6ec2e0f5
SDJ
24414
24415
24416
c0c3707f 24417
6ec2e0f5
SDJ
24418 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
24419$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 24420if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
6ec2e0f5
SDJ
24421 $as_echo_n "(cached) " >&6
24422else
24423
24424 case "$host_os" in
24425 # Guess no on AIX and OSF/1.
24426 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
24427 # Guess yes otherwise.
24428 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
24429 esac
24430 if test $LOCALE_JA != none; then
24431 if test "$cross_compiling" = yes; then :
24432 :
24433else
24434 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24435/* end confdefs.h. */
24436
24437#include <locale.h>
24438#include <string.h>
6ec2e0f5
SDJ
24439#include <wchar.h>
24440int main ()
24441{
24442 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
24443 {
24444 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
24445 mbstate_t state;
24446 wchar_t wc;
24447
24448 memset (&state, '\0', sizeof (mbstate_t));
24449 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24450 if (mbsinit (&state))
c0c3707f
CB
24451 return 2;
24452 }
24453 return 0;
24454}
24455_ACEOF
24456if ac_fn_c_try_run "$LINENO"; then :
24457 gl_cv_func_mbrtowc_incomplete_state=yes
24458else
24459 gl_cv_func_mbrtowc_incomplete_state=no
24460fi
24461rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24462 conftest.$ac_objext conftest.beam conftest.$ac_ext
24463fi
24464
24465 else
24466 if test $LOCALE_FR_UTF8 != none; then
24467 if test "$cross_compiling" = yes; then :
24468 :
24469else
24470 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24471/* end confdefs.h. */
24472
24473#include <locale.h>
24474#include <string.h>
c0c3707f
CB
24475#include <wchar.h>
24476int main ()
24477{
24478 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24479 {
24480 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
24481 mbstate_t state;
24482 wchar_t wc;
24483
24484 memset (&state, '\0', sizeof (mbstate_t));
24485 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24486 if (mbsinit (&state))
24487 return 2;
6ec2e0f5
SDJ
24488 }
24489 return 0;
24490}
24491_ACEOF
24492if ac_fn_c_try_run "$LINENO"; then :
24493 gl_cv_func_mbrtowc_incomplete_state=yes
24494else
24495 gl_cv_func_mbrtowc_incomplete_state=no
24496fi
24497rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24498 conftest.$ac_objext conftest.beam conftest.$ac_ext
24499fi
24500
c0c3707f 24501 fi
6ec2e0f5
SDJ
24502 fi
24503
24504fi
24505{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
24506$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
24507
24508
24509
24510
24511 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
24512$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 24513if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
6ec2e0f5
SDJ
24514 $as_echo_n "(cached) " >&6
24515else
24516
24517 case "$host_os" in
24518 # Guess no on Solaris 8.
24519 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
24520 # Guess yes otherwise.
24521 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
24522 esac
24523 if test $LOCALE_ZH_CN != none; then
24524 if test "$cross_compiling" = yes; then :
24525 :
24526else
24527 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24528/* end confdefs.h. */
24529
24530#include <locale.h>
24531#include <stdlib.h>
24532#include <string.h>
6ec2e0f5
SDJ
24533#include <wchar.h>
24534int main ()
24535{
24536 /* This fails on Solaris 8:
24537 mbrtowc returns 2, and sets wc to 0x00F0.
24538 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
24539 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24540 {
24541 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
24542 mbstate_t state;
24543 wchar_t wc;
24544
24545 memset (&state, '\0', sizeof (mbstate_t));
24546 if (mbrtowc (&wc, input + 3, 6, &state) != 4
24547 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 24548 return 2;
6ec2e0f5 24549 }
49e4877c
PA
24550 return 0;
24551}
24552_ACEOF
24553if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24554 gl_cv_func_mbrtowc_sanitycheck=yes
49e4877c 24555else
6ec2e0f5 24556 gl_cv_func_mbrtowc_sanitycheck=no
49e4877c
PA
24557fi
24558rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24559 conftest.$ac_objext conftest.beam conftest.$ac_ext
24560fi
24561
6ec2e0f5
SDJ
24562 fi
24563
49e4877c 24564fi
6ec2e0f5
SDJ
24565{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
24566$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
49e4877c 24567
6ec2e0f5
SDJ
24568 REPLACE_MBSTATE_T=0
24569 case "$gl_cv_func_mbrtowc_incomplete_state" in
24570 *yes) ;;
24571 *) REPLACE_MBSTATE_T=1 ;;
24572 esac
24573 case "$gl_cv_func_mbrtowc_sanitycheck" in
24574 *yes) ;;
24575 *) REPLACE_MBSTATE_T=1 ;;
24576 esac
24577 else
24578 REPLACE_MBSTATE_T=1
24579 fi
8690e634 24580
8690e634 24581
8690e634 24582
6ec2e0f5
SDJ
24583 if test $ac_cv_func_mbsinit = no; then
24584 HAVE_MBSINIT=0
24585 ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
9c9d63b1 24586 #include <wchar.h>
8690e634 24587
6ec2e0f5 24588"
d0ac1c44 24589if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
6ec2e0f5
SDJ
24590 ac_have_decl=1
24591else
24592 ac_have_decl=0
24593fi
4a626d0a 24594
6ec2e0f5
SDJ
24595cat >>confdefs.h <<_ACEOF
24596#define HAVE_DECL_MBSINIT $ac_have_decl
24597_ACEOF
49e4877c 24598
6ec2e0f5
SDJ
24599 if test $ac_cv_have_decl_mbsinit = yes; then
24600 REPLACE_MBSINIT=1
24601 fi
24602 else
24603 if test $REPLACE_MBSTATE_T = 1; then
24604 REPLACE_MBSINIT=1
24605 else
24606 case "$host_os" in
24607 mingw*) REPLACE_MBSINIT=1 ;;
8690e634 24608 esac
c971b7fa
PA
24609 fi
24610 fi
24611
6ec2e0f5 24612 if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
c971b7fa 24613
c971b7fa 24614
c971b7fa
PA
24615
24616
24617
24618
24619
24620
6ec2e0f5 24621 gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
8690e634
JK
24622
24623
24624 :
c971b7fa 24625
a512b375 24626 fi
c971b7fa 24627
8690e634
JK
24628
24629
24630
24631
6ec2e0f5 24632 GNULIB_MBSINIT=1
8690e634
JK
24633
24634
24635
24636
8690e634 24637
6ec2e0f5 24638$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
8690e634
JK
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
c971b7fa 24650
c971b7fa 24651
5df4cba6
SM
24652
24653 if case "$host_os" in
24654 mingw*) true ;;
24655 *) test $ac_cv_func_mbsinit = yes ;;
24656 esac \
24657 && test $ac_cv_func_mbrtowc = yes; then
c971b7fa 24658
8690e634
JK
24659
24660
c0c3707f 24661
8690e634
JK
24662 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
24663$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 24664if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
8690e634
JK
24665 $as_echo_n "(cached) " >&6
24666else
24667
24668 case "$host_os" in
24669 # Guess no on AIX and OSF/1.
24670 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
24671 # Guess yes otherwise.
24672 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
24673 esac
24674 if test $LOCALE_JA != none; then
24675 if test "$cross_compiling" = yes; then :
24676 :
c971b7fa
PA
24677else
24678 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24679/* end confdefs.h. */
24680
8690e634
JK
24681#include <locale.h>
24682#include <string.h>
8690e634
JK
24683#include <wchar.h>
24684int main ()
c971b7fa 24685{
8690e634 24686 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
c971b7fa 24687 {
8690e634
JK
24688 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
24689 mbstate_t state;
24690 wchar_t wc;
24691
24692 memset (&state, '\0', sizeof (mbstate_t));
24693 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24694 if (mbsinit (&state))
c0c3707f
CB
24695 return 2;
24696 }
24697 return 0;
24698}
24699_ACEOF
24700if ac_fn_c_try_run "$LINENO"; then :
24701 gl_cv_func_mbrtowc_incomplete_state=yes
24702else
24703 gl_cv_func_mbrtowc_incomplete_state=no
24704fi
24705rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24706 conftest.$ac_objext conftest.beam conftest.$ac_ext
24707fi
24708
24709 else
24710 if test $LOCALE_FR_UTF8 != none; then
24711 if test "$cross_compiling" = yes; then :
24712 :
24713else
24714 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24715/* end confdefs.h. */
24716
24717#include <locale.h>
24718#include <string.h>
c0c3707f
CB
24719#include <wchar.h>
24720int main ()
24721{
24722 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24723 {
24724 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
24725 mbstate_t state;
24726 wchar_t wc;
24727
24728 memset (&state, '\0', sizeof (mbstate_t));
24729 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24730 if (mbsinit (&state))
24731 return 2;
c971b7fa 24732 }
c971b7fa
PA
24733 return 0;
24734}
24735_ACEOF
24736if ac_fn_c_try_run "$LINENO"; then :
8690e634 24737 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 24738else
8690e634 24739 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa
PA
24740fi
24741rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24742 conftest.$ac_objext conftest.beam conftest.$ac_ext
24743fi
24744
c0c3707f 24745 fi
8690e634 24746 fi
c971b7fa
PA
24747
24748fi
8690e634
JK
24749{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
24750$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa
PA
24751
24752
c971b7fa
PA
24753
24754
8690e634
JK
24755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
24756$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 24757if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
24758 $as_echo_n "(cached) " >&6
24759else
8690e634
JK
24760
24761 case "$host_os" in
24762 # Guess no on Solaris 8.
24763 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
24764 # Guess yes otherwise.
24765 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
24766 esac
24767 if test $LOCALE_ZH_CN != none; then
24768 if test "$cross_compiling" = yes; then :
24769 :
24770else
c971b7fa
PA
24771 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24772/* end confdefs.h. */
8690e634
JK
24773
24774#include <locale.h>
24775#include <stdlib.h>
24776#include <string.h>
8690e634
JK
24777#include <wchar.h>
24778int main ()
c971b7fa 24779{
8690e634
JK
24780 /* This fails on Solaris 8:
24781 mbrtowc returns 2, and sets wc to 0x00F0.
24782 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
24783 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24784 {
24785 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
24786 mbstate_t state;
24787 wchar_t wc;
24788
24789 memset (&state, '\0', sizeof (mbstate_t));
24790 if (mbrtowc (&wc, input + 3, 6, &state) != 4
24791 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 24792 return 2;
8690e634 24793 }
c971b7fa
PA
24794 return 0;
24795}
24796_ACEOF
8690e634
JK
24797if ac_fn_c_try_run "$LINENO"; then :
24798 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 24799else
8690e634 24800 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 24801fi
8690e634
JK
24802rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24803 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24804fi
c971b7fa 24805
8690e634
JK
24806 fi
24807
24808fi
24809{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
24810$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
c971b7fa 24811
8690e634
JK
24812 REPLACE_MBSTATE_T=0
24813 case "$gl_cv_func_mbrtowc_incomplete_state" in
24814 *yes) ;;
24815 *) REPLACE_MBSTATE_T=1 ;;
24816 esac
24817 case "$gl_cv_func_mbrtowc_sanitycheck" in
24818 *yes) ;;
24819 *) REPLACE_MBSTATE_T=1 ;;
24820 esac
24821 else
24822 REPLACE_MBSTATE_T=1
c971b7fa
PA
24823 fi
24824
c971b7fa 24825
8690e634 24826
6ec2e0f5
SDJ
24827 if test $ac_cv_func_mbsrtowcs = no; then
24828 HAVE_MBSRTOWCS=0
24829 ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
9c9d63b1 24830 #include <wchar.h>
8690e634
JK
24831
24832"
d0ac1c44 24833if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then :
8690e634
JK
24834 ac_have_decl=1
24835else
24836 ac_have_decl=0
c971b7fa 24837fi
c971b7fa 24838
8690e634 24839cat >>confdefs.h <<_ACEOF
6ec2e0f5 24840#define HAVE_DECL_MBSRTOWCS $ac_have_decl
c971b7fa 24841_ACEOF
c971b7fa 24842
6ec2e0f5
SDJ
24843 if test $ac_cv_have_decl_mbsrtowcs = yes; then
24844 REPLACE_MBSRTOWCS=1
8690e634
JK
24845 fi
24846 else
24847 if test $REPLACE_MBSTATE_T = 1; then
6ec2e0f5 24848 REPLACE_MBSRTOWCS=1
8690e634 24849 else
6ec2e0f5
SDJ
24850
24851
24852
24853
24854
24855
24856 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
24857$as_echo_n "checking whether mbsrtowcs works... " >&6; }
d0ac1c44 24858if ${gl_cv_func_mbsrtowcs_works+:} false; then :
6ec2e0f5
SDJ
24859 $as_echo_n "(cached) " >&6
24860else
24861
24862 case "$host_os" in
24863 # Guess no on HP-UX, Solaris, mingw.
24864 hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
24865 # Guess yes otherwise.
24866 *) gl_cv_func_mbsrtowcs_works="guessing yes" ;;
24867 esac
24868 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
24869 if test "$cross_compiling" = yes; then :
24870 :
24871else
24872 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24873/* end confdefs.h. */
24874
24875#include <locale.h>
24876#include <string.h>
6ec2e0f5
SDJ
24877#include <wchar.h>
24878int main ()
24879{
24880 int result = 0;
24881 /* Test whether the function supports a NULL destination argument.
24882 This fails on native Windows. */
24883 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
24884 {
24885 const char input[] = "\337er";
24886 const char *src = input;
24887 mbstate_t state;
24888
24889 memset (&state, '\0', sizeof (mbstate_t));
24890 if (mbsrtowcs (NULL, &src, 1, &state) != 3
24891 || src != input)
24892 result |= 1;
24893 }
24894 /* Test whether the function works when started with a conversion state
24895 in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
24896 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24897 {
24898 const char input[] = "B\303\274\303\237er";
24899 mbstate_t state;
24900
24901 memset (&state, '\0', sizeof (mbstate_t));
24902 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24903 if (!mbsinit (&state))
24904 {
24905 const char *src = input + 2;
24906 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24907 result |= 2;
24908 }
24909 }
24910 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
24911 {
24912 const char input[] = "<\306\374\313\334\270\354>";
24913 mbstate_t state;
24914
24915 memset (&state, '\0', sizeof (mbstate_t));
24916 if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
24917 if (!mbsinit (&state))
24918 {
24919 const char *src = input + 4;
24920 if (mbsrtowcs (NULL, &src, 10, &state) != 3)
24921 result |= 4;
24922 }
24923 }
24924 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24925 {
24926 const char input[] = "B\250\271\201\060\211\070er";
24927 mbstate_t state;
24928
24929 memset (&state, '\0', sizeof (mbstate_t));
24930 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24931 if (!mbsinit (&state))
24932 {
24933 const char *src = input + 2;
24934 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24935 result |= 8;
24936 }
24937 }
24938 return result;
24939}
24940_ACEOF
24941if ac_fn_c_try_run "$LINENO"; then :
24942 gl_cv_func_mbsrtowcs_works=yes
24943else
24944 gl_cv_func_mbsrtowcs_works=no
24945fi
24946rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24947 conftest.$ac_objext conftest.beam conftest.$ac_ext
24948fi
24949
24950 fi
24951
24952fi
24953{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
24954$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
24955
24956 case "$gl_cv_func_mbsrtowcs_works" in
24957 *yes) ;;
24958 *) REPLACE_MBSRTOWCS=1 ;;
8690e634
JK
24959 esac
24960 fi
24961 fi
c971b7fa 24962
6ec2e0f5 24963 if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
c971b7fa
PA
24964
24965
24966
24967
24968
24969
24970
24971
698be2d8
CB
24972 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
24983
24984
24985 :
24986
24987 fi
24988
24989
24990
24991
24992
24993 GNULIB_MBSRTOWCS=1
24994
24995
24996
24997
24998
24999$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
25000
25001
25002
25003
25004
25005
25006 for ac_func in mbtowc
25007do :
25008 ac_fn_c_check_func "$LINENO" "mbtowc" "ac_cv_func_mbtowc"
25009if test "x$ac_cv_func_mbtowc" = xyes; then :
25010 cat >>confdefs.h <<_ACEOF
25011#define HAVE_MBTOWC 1
25012_ACEOF
25013
25014fi
25015done
25016
25017 if test $ac_cv_func_mbtowc = no; then
25018 HAVE_MBTOWC=0
25019 else
25020 if false; then
25021 REPLACE_MBTOWC=1
25022 fi
25023 fi
6ec2e0f5 25024
698be2d8 25025 if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
6ec2e0f5
SDJ
25026
25027
25028
25029
25030
25031
25032
25033
698be2d8 25034 gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext"
c971b7fa
PA
25035
25036
8690e634 25037 :
c971b7fa 25038
a512b375 25039 fi
c971b7fa 25040
c971b7fa 25041
c971b7fa 25042
c971b7fa
PA
25043
25044
698be2d8 25045 GNULIB_MBTOWC=1
c971b7fa 25046
c971b7fa
PA
25047
25048
25049
25050
698be2d8 25051$as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
c971b7fa
PA
25052
25053
c971b7fa 25054
c971b7fa 25055
9c9d63b1 25056 if test $REPLACE_MEMCHR = 1; then
c971b7fa
PA
25057
25058
25059
c971b7fa 25060
c971b7fa
PA
25061
25062
25063
25064
6ec2e0f5 25065 gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
8690e634 25066
c971b7fa 25067
6ec2e0f5
SDJ
25068 for ac_header in bp-sym.h
25069do :
25070 ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
d0ac1c44 25071if test "x$ac_cv_header_bp_sym_h" = xyes; then :
6ec2e0f5
SDJ
25072 cat >>confdefs.h <<_ACEOF
25073#define HAVE_BP_SYM_H 1
25074_ACEOF
c971b7fa 25075
6ec2e0f5 25076fi
c971b7fa 25077
6ec2e0f5
SDJ
25078done
25079
25080
25081 fi
25082
25083
25084
25085
25086
25087 GNULIB_MEMCHR=1
25088
25089
25090
25091
25092
25093$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
25094
25095
25096
25097
25098
25099 if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
25100 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5
25101$as_echo_n "checking whether memmem works in linear time... " >&6; }
d0ac1c44 25102if ${gl_cv_func_memmem_works_fast+:} false; then :
8690e634
JK
25103 $as_echo_n "(cached) " >&6
25104else
6ec2e0f5
SDJ
25105 if test "$cross_compiling" = yes; then :
25106 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25107/* end confdefs.h. */
25108
25109#include <features.h>
25110#ifdef __GNU_LIBRARY__
25111 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
25112 && !defined __UCLIBC__
25113 Lucky user
25114 #endif
25115#endif
25116#ifdef __CYGWIN__
25117 #include <cygwin/version.h>
25118 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
25119 Lucky user
25120 #endif
25121#endif
25122
25123_ACEOF
25124if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25125 $EGREP "Lucky user" >/dev/null 2>&1; then :
25126 gl_cv_func_memmem_works_fast="guessing yes"
25127else
c0c3707f 25128 gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"
6ec2e0f5
SDJ
25129fi
25130rm -f conftest*
25131
c971b7fa 25132
8690e634
JK
25133else
25134 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 25135/* end confdefs.h. */
c971b7fa 25136
6ec2e0f5
SDJ
25137#include <signal.h> /* for signal */
25138#include <string.h> /* for memmem */
25139#include <stdlib.h> /* for malloc */
25140#include <unistd.h> /* for alarm */
25141static void quit (int sig) { _exit (sig + 128); }
25142
25143int
25144main ()
8690e634 25145{
8690e634 25146
6ec2e0f5
SDJ
25147 int result = 0;
25148 size_t m = 1000000;
25149 char *haystack = (char *) malloc (2 * m + 1);
25150 char *needle = (char *) malloc (m + 1);
25151 /* Failure to compile this test due to missing alarm is okay,
25152 since all such platforms (mingw) also lack memmem. */
25153 signal (SIGALRM, quit);
25154 alarm (5);
25155 /* Check for quadratic performance. */
25156 if (haystack && needle)
25157 {
25158 memset (haystack, 'A', 2 * m);
25159 haystack[2 * m] = 'B';
25160 memset (needle, 'A', m);
25161 needle[m] = 'B';
25162 if (!memmem (haystack, 2 * m + 1, needle, m + 1))
25163 result |= 1;
25164 }
c0c3707f
CB
25165 /* Free allocated memory, in case some sanitizer is watching. */
25166 free (haystack);
25167 free (needle);
6ec2e0f5
SDJ
25168 return result;
25169
25170 ;
c971b7fa
PA
25171 return 0;
25172}
25173_ACEOF
8690e634 25174if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 25175 gl_cv_func_memmem_works_fast=yes
8690e634 25176else
6ec2e0f5 25177 gl_cv_func_memmem_works_fast=no
8690e634
JK
25178fi
25179rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25180 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 25181fi
c971b7fa
PA
25182
25183
8690e634 25184fi
6ec2e0f5
SDJ
25185{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5
25186$as_echo "$gl_cv_func_memmem_works_fast" >&6; }
25187 case "$gl_cv_func_memmem_works_fast" in
25188 *yes) ;;
25189 *)
25190 REPLACE_MEMMEM=1
25191 ;;
25192 esac
25193 fi
c971b7fa 25194
6ec2e0f5 25195 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
8690e634
JK
25196
25197
25198
6ec2e0f5
SDJ
25199
25200
25201
25202
25203
25204 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
25205
25206 fi
25207
25208
25209
25210
25211 for ac_func in memmem
25212do :
25213 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
d0ac1c44 25214if test "x$ac_cv_func_memmem" = xyes; then :
6ec2e0f5
SDJ
25215 cat >>confdefs.h <<_ACEOF
25216#define HAVE_MEMMEM 1
25217_ACEOF
25218
25219fi
25220done
25221
25222 if test $ac_cv_func_memmem = yes; then
25223 HAVE_MEMMEM=1
25224 else
25225 HAVE_MEMMEM=0
25226 fi
25227
25228 if test $ac_cv_have_decl_memmem = no; then
25229 HAVE_DECL_MEMMEM=0
25230 else
25231 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
25232$as_echo_n "checking whether memmem works... " >&6; }
d0ac1c44 25233if ${gl_cv_func_memmem_works_always+:} false; then :
c971b7fa
PA
25234 $as_echo_n "(cached) " >&6
25235else
6ec2e0f5
SDJ
25236 if test "$cross_compiling" = yes; then :
25237 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25238/* end confdefs.h. */
25239
25240#ifdef __GNU_LIBRARY__
25241 #include <features.h>
25242 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
25243 || __GLIBC_MINOR__ > 12)) \
25244 || (__GLIBC__ > 2)) \
25245 || defined __UCLIBC__
25246 Lucky user
25247 #endif
25248#elif defined __CYGWIN__
25249 #include <cygwin/version.h>
25250 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
25251 Lucky user
25252 #endif
25253#else
25254 Lucky user
25255#endif
25256
25257_ACEOF
25258if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25259 $EGREP "Lucky user" >/dev/null 2>&1; then :
25260 gl_cv_func_memmem_works_always="guessing yes"
25261else
c0c3707f 25262 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
6ec2e0f5
SDJ
25263fi
25264rm -f conftest*
25265
8690e634 25266
8690e634 25267else
c971b7fa
PA
25268 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25269/* end confdefs.h. */
c971b7fa 25270
6ec2e0f5
SDJ
25271#include <string.h> /* for memmem */
25272#define P "_EF_BF_BD"
25273#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
25274#define NEEDLE P P P P P
25275
25276int
25277main ()
c971b7fa 25278{
8690e634 25279
6ec2e0f5
SDJ
25280 int result = 0;
25281 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
25282 result |= 1;
25283 /* Check for empty needle behavior. */
25284 {
25285 const char *haystack = "AAA";
698be2d8 25286 if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
6ec2e0f5 25287 result |= 2;
8690e634 25288 }
6ec2e0f5
SDJ
25289 return result;
25290
25291 ;
c971b7fa
PA
25292 return 0;
25293}
25294_ACEOF
8690e634 25295if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 25296 gl_cv_func_memmem_works_always=yes
c971b7fa 25297else
6ec2e0f5 25298 gl_cv_func_memmem_works_always=no
c971b7fa 25299fi
8690e634
JK
25300rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25301 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 25302fi
8690e634 25303
8690e634
JK
25304
25305fi
6ec2e0f5
SDJ
25306{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
25307$as_echo "$gl_cv_func_memmem_works_always" >&6; }
25308 case "$gl_cv_func_memmem_works_always" in
8690e634 25309 *yes) ;;
6ec2e0f5
SDJ
25310 *)
25311 REPLACE_MEMMEM=1
25312 ;;
8690e634 25313 esac
c971b7fa 25314 fi
6ec2e0f5 25315 :
c971b7fa 25316
6ec2e0f5 25317 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
c971b7fa 25318
c971b7fa 25319
8690e634 25320
c971b7fa 25321
6ec2e0f5
SDJ
25322
25323
25324
25325
25326 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
25327
25328 fi
25329
25330
25331
25332
25333
25334 GNULIB_MEMMEM=1
25335
25336
25337
25338
25339
25340$as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350 for ac_func in mempcpy
25351do :
25352 ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
d0ac1c44 25353if test "x$ac_cv_func_mempcpy" = xyes; then :
6ec2e0f5
SDJ
25354 cat >>confdefs.h <<_ACEOF
25355#define HAVE_MEMPCPY 1
8690e634 25356_ACEOF
c971b7fa 25357
6ec2e0f5
SDJ
25358fi
25359done
c971b7fa 25360
6ec2e0f5
SDJ
25361 if test $ac_cv_func_mempcpy = no; then
25362 HAVE_MEMPCPY=0
25363 fi
8690e634 25364
6ec2e0f5 25365 if test $HAVE_MEMPCPY = 0; then
8690e634
JK
25366
25367
25368
25369
8690e634 25370
6ec2e0f5
SDJ
25371
25372
25373
25374 gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
25375
25376
8690e634 25377 :
c971b7fa 25378
6ec2e0f5 25379 fi
c971b7fa 25380
8690e634 25381
8690e634 25382
8690e634 25383
6ec2e0f5
SDJ
25384
25385 GNULIB_MEMPCPY=1
25386
25387
25388
25389
25390
25391$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
25392
25393
25394
25395
25396
25397
25398
25399
25400 if test $ac_cv_have_decl_memrchr = no; then
25401 HAVE_DECL_MEMRCHR=0
25402 fi
25403
25404 for ac_func in memrchr
25405do :
25406 ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
d0ac1c44 25407if test "x$ac_cv_func_memrchr" = xyes; then :
6ec2e0f5
SDJ
25408 cat >>confdefs.h <<_ACEOF
25409#define HAVE_MEMRCHR 1
c971b7fa 25410_ACEOF
6ec2e0f5 25411
c971b7fa 25412fi
6ec2e0f5 25413done
8690e634 25414
8690e634 25415
6ec2e0f5 25416 if test $ac_cv_func_memrchr = no; then
8690e634 25417
6ec2e0f5
SDJ
25418
25419
25420
25421
25422
25423
25424
25425 gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
25426
25427 :
c971b7fa
PA
25428 fi
25429
25430
c971b7fa 25431
c971b7fa 25432
c971b7fa 25433
6ec2e0f5
SDJ
25434 GNULIB_MEMRCHR=1
25435
25436
25437
25438
25439
25440$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
25441
25442
25443
25444
2d8adcbd 25445
698be2d8
CB
25446
25447
25448
8a99096f
SM
25449 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
25450$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
25451if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then :
25452 $as_echo_n "(cached) " >&6
25453else
25454 rm -rf conftest.dir
9c9d63b1 25455 if test "$cross_compiling" = yes; then :
8a99096f 25456 case "$host_os" in
9c9d63b1
PM
25457 # Guess yes on Linux systems.
25458 linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
25459 # Guess yes on glibc systems.
25460 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
25461 # Guess yes on MSVC, no on mingw.
25462 mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f
CB
25463/* end confdefs.h. */
25464
25465#ifdef _MSC_VER
25466 Known
25467#endif
25468
25469_ACEOF
25470if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25471 $EGREP "Known" >/dev/null 2>&1; then :
25472 gl_cv_func_mkdir_trailing_slash_works="guessing yes"
25473else
25474 gl_cv_func_mkdir_trailing_slash_works="guessing no"
25475fi
25476rm -f conftest*
25477
9c9d63b1
PM
25478 ;;
25479 # If we don't know, obey --enable-cross-guesses.
25480 *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
25481 esac
8a99096f
SM
25482
25483else
25484 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25485/* end confdefs.h. */
25486
9c9d63b1
PM
25487 #include <sys/types.h>
25488 #include <sys/stat.h>
25489
25490
25491$gl_mda_defines
8a99096f
SM
25492
25493int
25494main ()
25495{
25496return mkdir ("conftest.dir/", 0700);
25497 ;
25498 return 0;
25499}
25500_ACEOF
25501if ac_fn_c_try_run "$LINENO"; then :
25502 gl_cv_func_mkdir_trailing_slash_works=yes
25503else
25504 gl_cv_func_mkdir_trailing_slash_works=no
25505fi
25506rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25507 conftest.$ac_objext conftest.beam conftest.$ac_ext
25508fi
25509
9c9d63b1 25510 rm -rf conftest.dir
8a99096f
SM
25511
25512fi
25513{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
25514$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
25515 case "$gl_cv_func_mkdir_trailing_slash_works" in
25516 *yes) ;;
25517 *)
25518 REPLACE_MKDIR=1
25519 ;;
25520 esac
25521
25522 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
25523$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
25524if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then :
25525 $as_echo_n "(cached) " >&6
25526else
25527 rm -rf conftest.dir
9c9d63b1 25528 if test "$cross_compiling" = yes; then :
8a99096f 25529 case "$host_os" in
9c9d63b1
PM
25530 # Guess yes on glibc systems.
25531 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
25532 # Guess yes on musl systems.
25533 *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
25534 # Guess no on native Windows.
25535 mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
25536 # If we don't know, obey --enable-cross-guesses.
25537 *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
25538 esac
8a99096f
SM
25539
25540else
25541 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25542/* end confdefs.h. */
25543
9c9d63b1
PM
25544 #include <sys/types.h>
25545 #include <sys/stat.h>
25546
25547
25548$gl_mda_defines
8a99096f
SM
25549
25550int
25551main ()
25552{
25553return !mkdir ("conftest.dir/./", 0700);
25554 ;
25555 return 0;
25556}
25557_ACEOF
25558if ac_fn_c_try_run "$LINENO"; then :
25559 gl_cv_func_mkdir_trailing_dot_works=yes
25560else
25561 gl_cv_func_mkdir_trailing_dot_works=no
25562fi
25563rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25564 conftest.$ac_objext conftest.beam conftest.$ac_ext
25565fi
25566
9c9d63b1 25567 rm -rf conftest.dir
8a99096f
SM
25568
25569
25570fi
25571{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
25572$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
25573 case "$gl_cv_func_mkdir_trailing_dot_works" in
25574 *yes) ;;
25575 *)
25576 REPLACE_MKDIR=1
25577
25578$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
25579
25580 ;;
25581 esac
25582
25583 if test $REPLACE_MKDIR = 1; then
25584
25585
25586
25587
25588
25589
25590
25591
25592 gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
25593
25594 fi
25595
25596
9c9d63b1
PM
25597
25598
25599
25600 GNULIB_MKDIR=1
25601
25602
25603
25604
25605
25606$as_echo "#define GNULIB_TEST_MKDIR 1" >>confdefs.h
25607
25608
25609
25610
25611
e8d8cce6
SM
25612 for ac_func in mkdtemp
25613do :
25614 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
25615if test "x$ac_cv_func_mkdtemp" = xyes; then :
25616 cat >>confdefs.h <<_ACEOF
25617#define HAVE_MKDTEMP 1
25618_ACEOF
25619
25620fi
25621done
25622
25623 if test $ac_cv_func_mkdtemp = no; then
25624 HAVE_MKDTEMP=0
25625 fi
25626
25627 if test $HAVE_MKDTEMP = 0; then
25628
25629
25630
25631
25632
25633
25634
25635
25636 gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext"
25637
25638 :
25639
25640 fi
25641
25642
25643
25644
25645
25646 GNULIB_MKDTEMP=1
25647
25648
25649
25650
25651
25652$as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
25653
25654
25655
25656
25657
2d8adcbd
MM
25658
25659
b3279b60
TT
25660
25661
b3279b60
TT
25662 if test $ac_cv_func_mkostemp != yes; then
25663 HAVE_MKOSTEMP=0
25664 fi
2d8adcbd 25665
b3279b60 25666 if test $HAVE_MKOSTEMP = 0; then
2d8adcbd 25667
2d8adcbd 25668
2d8adcbd 25669
2d8adcbd 25670
2d8adcbd
MM
25671
25672
25673
25674
b3279b60 25675 gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
2d8adcbd
MM
25676
25677
25678
b3279b60 25679 fi
2d8adcbd 25680
2d8adcbd 25681
b3279b60
TT
25682cat >>confdefs.h <<_ACEOF
25683#define GNULIB_MKOSTEMP 1
25684_ACEOF
2d8adcbd
MM
25685
25686
2d8adcbd
MM
25687
25688
25689
25690
25691
b3279b60 25692 GNULIB_MKOSTEMP=1
2d8adcbd
MM
25693
25694
25695
25696
25697
b3279b60 25698$as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h
2d8adcbd
MM
25699
25700
25701
25702
6ec2e0f5
SDJ
25703 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
25704
25705
25706
c971b7fa 25707
c971b7fa 25708
c971b7fa
PA
25709
25710
8690e634 25711
6ec2e0f5 25712 gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
8690e634 25713
6ec2e0f5 25714 fi
8690e634 25715
6ec2e0f5 25716 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
8690e634
JK
25717
25718
25719
25720
25721
25722
8690e634
JK
25723
25724
6ec2e0f5 25725 gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
8690e634 25726
a512b375 25727 fi
8690e634
JK
25728
25729
c0c3707f
CB
25730cat >>confdefs.h <<_ACEOF
25731#define GNULIB_MSVC_NOTHROW 1
25732_ACEOF
25733
25734
25735
25736
725e2999
JB
25737 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
25738$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
25739if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
25740 $as_echo_n "(cached) " >&6
25741else
25742
25743 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25744/* end confdefs.h. */
25745#include <netinet/in.h>
25746int
25747main ()
25748{
25749
25750 ;
25751 return 0;
25752}
25753_ACEOF
25754if ac_fn_c_try_compile "$LINENO"; then :
25755 gl_cv_header_netinet_in_h_selfcontained=yes
25756else
25757 gl_cv_header_netinet_in_h_selfcontained=no
25758fi
25759rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25760
25761fi
25762{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
25763$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
25764 if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
25765 NETINET_IN_H=''
25766 else
25767 NETINET_IN_H='netinet/in.h'
25768 for ac_header in netinet/in.h
25769do :
25770 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
25771if test "x$ac_cv_header_netinet_in_h" = xyes; then :
25772 cat >>confdefs.h <<_ACEOF
25773#define HAVE_NETINET_IN_H 1
25774_ACEOF
25775
25776fi
25777
25778done
25779
25780
25781
25782
25783
25784
25785
725e2999
JB
25786
25787
25788
25789 if test $gl_cv_have_include_next = yes; then
25790 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
25791 else
25792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
25793$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
25794if ${gl_cv_next_netinet_in_h+:} false; then :
25795 $as_echo_n "(cached) " >&6
25796else
25797
25798 if test $ac_cv_header_netinet_in_h = yes; then
25799
25800
25801
25802
25803 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25804/* end confdefs.h. */
25805#include <netinet/in.h>
25806_ACEOF
25807 case "$host_os" in
25808 aix*) gl_absname_cpp="$ac_cpp -C" ;;
25809 *) gl_absname_cpp="$ac_cpp" ;;
25810 esac
25811
25812 case "$host_os" in
25813 mingw*)
25814 gl_dirsep_regex='[/\\]'
25815 ;;
25816 *)
25817 gl_dirsep_regex='\/'
25818 ;;
25819 esac
25820 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
25821 gl_header_literal_regex=`echo 'netinet/in.h' \
25822 | sed -e "$gl_make_literal_regex_sed"`
25823 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
25824 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
25825 s|^/[^/]|//&|
25826 p
25827 q
25828 }'
25829
25830 gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
25831 sed -n "$gl_absolute_header_sed"`
25832
25833 gl_header=$gl_cv_absolute_netinet_in_h
25834 gl_cv_next_netinet_in_h='"'$gl_header'"'
25835 else
25836 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
25837 fi
25838
25839
25840fi
25841{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
25842$as_echo "$gl_cv_next_netinet_in_h" >&6; }
25843 fi
25844 NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
25845
25846 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
25847 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
25848 gl_next_as_first_directive='<'netinet/in.h'>'
25849 else
25850 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
25851 gl_next_as_first_directive=$gl_cv_next_netinet_in_h
25852 fi
25853 NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
25854
25855
25856
25857
25858 if test $ac_cv_header_netinet_in_h = yes; then
25859 HAVE_NETINET_IN_H=1
25860 else
25861 HAVE_NETINET_IN_H=0
25862 fi
25863
25864 fi
25865
25866 if test -n "$NETINET_IN_H"; then
25867 GL_GENERATE_NETINET_IN_H_TRUE=
25868 GL_GENERATE_NETINET_IN_H_FALSE='#'
25869else
25870 GL_GENERATE_NETINET_IN_H_TRUE='#'
25871 GL_GENERATE_NETINET_IN_H_FALSE=
25872fi
25873
25874
25875
25876
8690e634 25877
c0c3707f 25878
6ec2e0f5
SDJ
25879 case "$host_os" in
25880 mingw* | pw*)
25881 REPLACE_OPEN=1
25882 ;;
25883 *)
25884
c0c3707f
CB
25885 if test "$gl_cv_macro_O_CLOEXEC" != yes; then
25886 REPLACE_OPEN=1
25887 fi
472fa5ee
SM
25888
25889
c0c3707f 25890 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
6ec2e0f5 25891$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
d0ac1c44 25892if ${gl_cv_func_open_slash+:} false; then :
6ec2e0f5
SDJ
25893 $as_echo_n "(cached) " >&6
25894else
25895 # Assume that if we have lstat, we can also check symlinks.
c0c3707f
CB
25896 if test $ac_cv_func_lstat = yes; then
25897 touch conftest.tmp
25898 ln -s conftest.tmp conftest.lnk
25899 fi
25900 if test "$cross_compiling" = yes; then :
8690e634 25901
c0c3707f
CB
25902 case "$host_os" in
25903 freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
25904 gl_cv_func_open_slash="guessing no" ;;
25905 *)
25906 gl_cv_func_open_slash="guessing yes" ;;
25907 esac
8690e634 25908
6ec2e0f5
SDJ
25909else
25910 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25911/* end confdefs.h. */
25912
25913#include <fcntl.h>
25914#if HAVE_UNISTD_H
25915# include <unistd.h>
25916#endif
9c9d63b1
PM
25917
25918
25919$gl_mda_defines
25920
6ec2e0f5
SDJ
25921int main ()
25922{
25923 int result = 0;
25924#if HAVE_LSTAT
25925 if (open ("conftest.lnk/", O_RDONLY) != -1)
25926 result |= 1;
25927#endif
25928 if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
25929 result |= 2;
25930 return result;
25931}
25932_ACEOF
25933if ac_fn_c_try_run "$LINENO"; then :
25934 gl_cv_func_open_slash=yes
25935else
25936 gl_cv_func_open_slash=no
25937fi
25938rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25939 conftest.$ac_objext conftest.beam conftest.$ac_ext
25940fi
8690e634 25941
c0c3707f 25942 rm -f conftest.sl conftest.tmp conftest.lnk
8690e634 25943
6ec2e0f5
SDJ
25944fi
25945{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
25946$as_echo "$gl_cv_func_open_slash" >&6; }
c0c3707f
CB
25947 case "$gl_cv_func_open_slash" in
25948 *no)
8690e634 25949
6ec2e0f5 25950$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
8690e634 25951
6ec2e0f5
SDJ
25952 ;;
25953 esac
8690e634 25954
c0c3707f
CB
25955 case "$gl_cv_func_open_slash" in
25956 *no)
25957 REPLACE_OPEN=1
25958 ;;
25959 esac
25960 ;;
25961 esac
472fa5ee 25962
c0c3707f 25963 if test $REPLACE_OPEN = 0; then
472fa5ee
SM
25964
25965
25966
6ec2e0f5
SDJ
25967 if test $ac_cv_func_fchdir = no; then
25968 HAVE_FCHDIR=0
25969 fi
c971b7fa 25970
6ec2e0f5
SDJ
25971 if test $HAVE_FCHDIR = 0; then
25972 REPLACE_OPEN=1
25973 fi
25974 fi
c971b7fa
PA
25975
25976
25977
6ec2e0f5 25978 if test $REPLACE_OPEN = 1; then
c971b7fa
PA
25979
25980
25981
25982
25983
c971b7fa
PA
25984
25985
c971b7fa 25986
6ec2e0f5 25987 gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
c971b7fa 25988
c971b7fa
PA
25989
25990
6ec2e0f5
SDJ
25991 :
25992
a512b375 25993 fi
c971b7fa
PA
25994
25995
25996
25997
25998
6ec2e0f5 25999 GNULIB_OPEN=1
c971b7fa
PA
26000
26001
26002
26003
26004
6ec2e0f5 26005$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
c971b7fa
PA
26006
26007
26008
26009
26010
c971b7fa 26011
c971b7fa 26012
472fa5ee 26013
63ce7108 26014
c0c3707f
CB
26015 case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
26016 yes+*yes+yes)
6ec2e0f5
SDJ
26017 ;;
26018 yes+*)
c0c3707f 26019 # Solaris 10 lacks O_CLOEXEC.
6ec2e0f5
SDJ
26020 # Solaris 9 has *at functions, but uniformly mishandles trailing
26021 # slash in all of them.
26022 REPLACE_OPENAT=1
26023 ;;
26024 *)
26025 HAVE_OPENAT=0
26026 ;;
26027 esac
63ce7108 26028
6ec2e0f5 26029 if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
63ce7108 26030
63ce7108 26031
63ce7108 26032
63ce7108 26033
63ce7108
TT
26034
26035
63ce7108 26036
63ce7108 26037
6ec2e0f5 26038 gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
63ce7108
TT
26039
26040
26041
6ec2e0f5 26042 :
63ce7108 26043
6ec2e0f5 26044 fi
63ce7108
TT
26045
26046
6ec2e0f5
SDJ
26047cat >>confdefs.h <<_ACEOF
26048#define GNULIB_OPENAT 1
26049_ACEOF
63ce7108 26050
63ce7108 26051
63ce7108
TT
26052
26053
26054
26055
6ec2e0f5 26056 GNULIB_OPENAT=1
63ce7108 26057
63ce7108 26058
63ce7108 26059
63ce7108 26060
63ce7108 26061
6ec2e0f5 26062$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
63ce7108
TT
26063
26064
63ce7108 26065
63ce7108 26066
63ce7108 26067
63ce7108 26068
6ec2e0f5
SDJ
26069 for ac_func in opendir
26070do :
26071 ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
d0ac1c44 26072if test "x$ac_cv_func_opendir" = xyes; then :
6ec2e0f5
SDJ
26073 cat >>confdefs.h <<_ACEOF
26074#define HAVE_OPENDIR 1
63ce7108 26075_ACEOF
6ec2e0f5 26076
63ce7108 26077fi
6ec2e0f5 26078done
63ce7108 26079
6ec2e0f5
SDJ
26080 if test $ac_cv_func_opendir = no; then
26081 HAVE_OPENDIR=0
26082 fi
63ce7108 26083
6ec2e0f5
SDJ
26084
26085
26086
26087 if test $ac_cv_func_fchdir = no; then
26088 HAVE_FCHDIR=0
63ce7108 26089 fi
63ce7108 26090
6ec2e0f5
SDJ
26091 if test $HAVE_FCHDIR = 0; then
26092 if test $HAVE_OPENDIR = 1; then
26093 REPLACE_OPENDIR=1
26094 fi
26095 fi
26096
26097 case $host_os,$HAVE_OPENDIR in
26098 os2*,1)
26099 REPLACE_OPENDIR=1;;
26100 esac
26101
26102 if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
63ce7108
TT
26103
26104
26105
26106
26107
26108
26109
26110
6ec2e0f5 26111 gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
63ce7108
TT
26112
26113 fi
26114
26115
26116
26117
26118
6ec2e0f5 26119 GNULIB_OPENDIR=1
63ce7108
TT
26120
26121
26122
26123
63ce7108 26124
6ec2e0f5 26125$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
63ce7108
TT
26126
26127
26128
26129
26130
26131
26132
2196f55f
YQ
26133
26134
8424cc97 26135
9c9d63b1
PM
26136 if test $ac_cv_func_pipe != yes; then
26137 HAVE_PIPE=0
26138 fi
26139
26140 if test $HAVE_PIPE = 0; then
26141
26142
26143
26144
26145
26146
26147
26148
26149 gl_LIBOBJS="$gl_LIBOBJS pipe.$ac_objext"
26150
26151 fi
26152
26153
26154
26155
26156
26157 GNULIB_PIPE=1
26158
26159
26160
26161
26162
26163$as_echo "#define GNULIB_TEST_PIPE 1" >>confdefs.h
26164
26165
26166
26167
26168
26169
26170
8424cc97
SM
26171 for ac_func in rawmemchr
26172do :
26173 ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
d0ac1c44 26174if test "x$ac_cv_func_rawmemchr" = xyes; then :
8424cc97
SM
26175 cat >>confdefs.h <<_ACEOF
26176#define HAVE_RAWMEMCHR 1
26177_ACEOF
26178
26179fi
26180done
26181
26182 if test $ac_cv_func_rawmemchr = no; then
26183 HAVE_RAWMEMCHR=0
26184 fi
26185
26186 if test $HAVE_RAWMEMCHR = 0; then
26187
26188
26189
26190
26191
26192
26193
26194
26195 gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
26196
26197 :
26198 fi
26199
26200
26201
26202
26203
26204 GNULIB_RAWMEMCHR=1
26205
26206
26207
26208
26209
26210$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
26211
26212
26213
26214
26215
26216
6ec2e0f5
SDJ
26217 for ac_func in readdir
26218do :
26219 ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
d0ac1c44 26220if test "x$ac_cv_func_readdir" = xyes; then :
6ec2e0f5
SDJ
26221 cat >>confdefs.h <<_ACEOF
26222#define HAVE_READDIR 1
26223_ACEOF
26224
26225fi
26226done
26227
26228 if test $ac_cv_func_readdir = no; then
26229 HAVE_READDIR=0
26230 fi
26231
26232 if test $HAVE_READDIR = 0; then
26233
26234
26235
26236
26237
26238
26239
26240
26241 gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
26242
26243 fi
26244
26245
26246
26247
26248
26249 GNULIB_READDIR=1
26250
26251
26252
26253
26254
26255$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
26256
26257
26258
26259
26260
26261
2196f55f
YQ
26262 if test $ac_cv_func_readlink = no; then
26263 HAVE_READLINK=0
26264 else
26265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
26266$as_echo_n "checking whether readlink signature is correct... " >&6; }
d0ac1c44 26267if ${gl_cv_decl_readlink_works+:} false; then :
2196f55f
YQ
26268 $as_echo_n "(cached) " >&6
26269else
26270 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26271/* end confdefs.h. */
26272#include <unistd.h>
26273 /* Cause compilation failure if original declaration has wrong type. */
26274 ssize_t readlink (const char *, char *, size_t);
26275int
26276main ()
26277{
26278
26279 ;
26280 return 0;
26281}
26282_ACEOF
26283if ac_fn_c_try_compile "$LINENO"; then :
26284 gl_cv_decl_readlink_works=yes
26285else
26286 gl_cv_decl_readlink_works=no
26287fi
26288rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26289fi
26290{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
26291$as_echo "$gl_cv_decl_readlink_works" >&6; }
26292 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
26293$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
9c9d63b1 26294if ${gl_cv_func_readlink_trailing_slash+:} false; then :
2196f55f
YQ
26295 $as_echo_n "(cached) " >&6
26296else
26297 # We have readlink, so assume ln -s works.
26298 ln -s conftest.no-such conftest.link
26299 ln -s conftest.link conftest.lnk2
26300 if test "$cross_compiling" = yes; then :
26301 case "$host_os" in
9c9d63b1
PM
26302 # Guess yes on Linux or glibc systems.
26303 linux-* | linux | *-gnu* | gnu*)
26304 gl_cv_func_readlink_trailing_slash="guessing yes" ;;
26305 # Guess no on AIX or HP-UX.
26306 aix* | hpux*)
26307 gl_cv_func_readlink_trailing_slash="guessing no" ;;
26308 # If we don't know, obey --enable-cross-guesses.
26309 *)
26310 gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;;
2196f55f
YQ
26311 esac
26312
26313else
26314 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26315/* end confdefs.h. */
26316#include <unistd.h>
26317
26318int
26319main ()
26320{
26321char buf[20];
26322 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
26323 ;
26324 return 0;
26325}
26326_ACEOF
26327if ac_fn_c_try_run "$LINENO"; then :
9c9d63b1 26328 gl_cv_func_readlink_trailing_slash=yes
2196f55f 26329else
9c9d63b1 26330 gl_cv_func_readlink_trailing_slash=no
2196f55f
YQ
26331fi
26332rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26333 conftest.$ac_objext conftest.beam conftest.$ac_ext
26334fi
26335
26336 rm -f conftest.link conftest.lnk2
26337fi
9c9d63b1
PM
26338{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_trailing_slash" >&5
26339$as_echo "$gl_cv_func_readlink_trailing_slash" >&6; }
26340 case "$gl_cv_func_readlink_trailing_slash" in
2196f55f
YQ
26341 *yes)
26342 if test "$gl_cv_decl_readlink_works" != yes; then
26343 REPLACE_READLINK=1
26344 fi
26345 ;;
26346 *)
26347
26348$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
26349
26350 REPLACE_READLINK=1
26351 ;;
26352 esac
9c9d63b1
PM
26353
26354 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink truncates results correctly" >&5
26355$as_echo_n "checking whether readlink truncates results correctly... " >&6; }
26356if ${gl_cv_func_readlink_truncate+:} false; then :
26357 $as_echo_n "(cached) " >&6
26358else
26359 # We have readlink, so assume ln -s works.
26360 ln -s ab conftest.link
26361 if test "$cross_compiling" = yes; then :
26362 case "$host_os" in
26363 # Guess yes on Linux or glibc systems.
26364 linux-* | linux | *-gnu* | gnu*)
26365 gl_cv_func_readlink_truncate="guessing yes" ;;
26366 # Guess no on AIX or HP-UX.
26367 aix* | hpux*)
26368 gl_cv_func_readlink_truncate="guessing no" ;;
26369 # If we don't know, obey --enable-cross-guesses.
26370 *)
26371 gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;;
26372 esac
26373
26374else
26375 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26376/* end confdefs.h. */
26377#include <unistd.h>
26378
26379int
26380main ()
26381{
26382char c;
26383 return readlink ("conftest.link", &c, 1) != 1;
26384 ;
26385 return 0;
26386}
26387_ACEOF
26388if ac_fn_c_try_run "$LINENO"; then :
26389 gl_cv_func_readlink_truncate=yes
26390else
26391 gl_cv_func_readlink_truncate=no
26392fi
26393rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26394 conftest.$ac_objext conftest.beam conftest.$ac_ext
26395fi
26396
26397 rm -f conftest.link conftest.lnk2
26398fi
26399{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_truncate" >&5
26400$as_echo "$gl_cv_func_readlink_truncate" >&6; }
26401 case $gl_cv_func_readlink_truncate in
26402 *yes)
26403 if test "$gl_cv_decl_readlink_works" != yes; then
26404 REPLACE_READLINK=1
26405 fi
26406 ;;
26407 *)
26408
26409$as_echo "#define READLINK_TRUNCATE_BUG 1" >>confdefs.h
26410
26411 REPLACE_READLINK=1
26412 ;;
26413 esac
2196f55f
YQ
26414 fi
26415
26416 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
26417
26418
26419
26420
26421
26422
26423
26424
26425 gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
26426
26427
26428 :
26429
26430 fi
26431
26432
26433
26434
26435
26436 GNULIB_READLINK=1
26437
26438
26439
26440
26441
26442$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
26443
26444
26445
26446
6a29c58e
YQ
26447
26448
6ec2e0f5
SDJ
26449 if test $gl_cv_func_malloc_posix = yes; then
26450
26451$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
26452
26453 else
26454 REPLACE_REALLOC=1
26455 fi
26456
26457 if test $REPLACE_REALLOC = 1; then
26458
26459
26460
26461
26462
26463
26464
26465
26466 gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
26467
26468 fi
26469
26470
26471
26472
26473
26474 GNULIB_REALLOC_POSIX=1
26475
26476
26477
26478
26479
26480$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
26481
26482
26483
26484
26485
26486
6a29c58e
YQ
26487
26488
26489 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
26490$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
d0ac1c44 26491if ${gl_cv_func_rename_slash_dst_works+:} false; then :
6a29c58e
YQ
26492 $as_echo_n "(cached) " >&6
26493else
26494 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
26495 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 26496 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26497 # Assume that if we have lstat, we can also check symlinks.
26498 if test $ac_cv_func_lstat = yes; then
26499 ln -s conftest.f conftest.lnk
26500 fi
26501 if test "$cross_compiling" = yes; then :
26502 case "$host_os" in
c0c3707f
CB
26503 # Guess yes on Linux systems.
26504 linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
26505 # Guess yes on glibc systems.
26506 *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
26507 # Guess no on native Windows.
26508 mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
26509 # If we don't know, obey --enable-cross-guesses.
26510 *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26511 esac
26512
26513else
26514 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26515/* end confdefs.h. */
26516
26517# include <stdio.h>
26518# include <stdlib.h>
26519
26520int
26521main ()
26522{
26523int result = 0;
26524 if (rename ("conftest.f1", "conftest.f2/") == 0)
26525 result |= 1;
26526 if (rename ("conftest.d1", "conftest.d2/") != 0)
26527 result |= 2;
26528#if HAVE_LSTAT
26529 if (rename ("conftest.f", "conftest.lnk/") == 0)
26530 result |= 4;
26531#endif
26532 return result;
26533
26534 ;
26535 return 0;
26536}
26537_ACEOF
26538if ac_fn_c_try_run "$LINENO"; then :
26539 gl_cv_func_rename_slash_dst_works=yes
26540else
26541 gl_cv_func_rename_slash_dst_works=no
26542fi
26543rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26544 conftest.$ac_objext conftest.beam conftest.$ac_ext
26545fi
26546
26547 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
26548
26549fi
26550{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
26551$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
26552 case "$gl_cv_func_rename_slash_dst_works" in
26553 *yes) ;;
26554 *)
26555 REPLACE_RENAME=1
26556
26557$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
26558
26559 ;;
26560 esac
26561
26562 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
26563$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
d0ac1c44 26564if ${gl_cv_func_rename_slash_src_works+:} false; then :
6a29c58e
YQ
26565 $as_echo_n "(cached) " >&6
26566else
26567 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
26568 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 26569 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26570 # Assume that if we have lstat, we can also check symlinks.
26571 if test $ac_cv_func_lstat = yes; then
26572 ln -s conftest.f conftest.lnk
26573 fi
26574 if test "$cross_compiling" = yes; then :
26575 case "$host_os" in
c0c3707f
CB
26576 # Guess yes on Linux systems.
26577 linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26578 # Guess yes on glibc systems.
26579 *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26580 # Guess yes on native Windows.
26581 mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26582 # If we don't know, obey --enable-cross-guesses.
26583 *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26584 esac
26585
26586else
26587 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26588/* end confdefs.h. */
26589
26590# include <stdio.h>
26591# include <stdlib.h>
26592
26593int
26594main ()
26595{
26596int result = 0;
26597 if (rename ("conftest.f1/", "conftest.d3") == 0)
26598 result |= 1;
26599 if (rename ("conftest.d1/", "conftest.d2") != 0)
26600 result |= 2;
26601#if HAVE_LSTAT
26602 if (rename ("conftest.lnk/", "conftest.f") == 0)
26603 result |= 4;
26604#endif
26605 return result;
26606
26607 ;
26608 return 0;
26609}
26610_ACEOF
26611if ac_fn_c_try_run "$LINENO"; then :
26612 gl_cv_func_rename_slash_src_works=yes
26613else
26614 gl_cv_func_rename_slash_src_works=no
26615fi
26616rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26617 conftest.$ac_objext conftest.beam conftest.$ac_ext
26618fi
26619
26620 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
26621
26622fi
26623{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
26624$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
26625 case "$gl_cv_func_rename_slash_src_works" in
26626 *yes) ;;
26627 *)
26628 REPLACE_RENAME=1
26629
26630$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
26631
26632 ;;
26633 esac
26634
26635
26636 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
26637$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
d0ac1c44 26638if ${gl_cv_func_rename_link_works+:} false; then :
6a29c58e
YQ
26639 $as_echo_n "(cached) " >&6
26640else
26641 if test $ac_cv_func_link = yes; then
c0c3707f
CB
26642 if test $cross_compiling != yes; then
26643 rm -rf conftest.f conftest.f1 conftest.f2
26644 if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
26645 set x `ls -i conftest.f conftest.f1` && test "" = ""; then
26646 if test "$cross_compiling" = yes; then :
26647 :
6a29c58e
YQ
26648
26649else
26650 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26651/* end confdefs.h. */
26652
c0c3707f
CB
26653# include <errno.h>
26654# include <stdio.h>
26655# include <stdlib.h>
26656# include <unistd.h>
6a29c58e 26657
9c9d63b1
PM
26658
26659$gl_mda_defines
26660
6a29c58e
YQ
26661int
26662main ()
26663{
26664int result = 0;
c0c3707f
CB
26665 if (rename ("conftest.f", "conftest.f1"))
26666 result |= 1;
26667 if (unlink ("conftest.f1"))
26668 result |= 2;
26669
26670 /* Allow either the POSIX-required behavior, where the
26671 previous rename kept conftest.f, or the (better) NetBSD
26672 behavior, where it removed conftest.f. */
26673 if (rename ("conftest.f", "conftest.f") != 0
26674 && errno != ENOENT)
26675 result |= 4;
26676
26677 if (rename ("conftest.f1", "conftest.f1") == 0)
26678 result |= 8;
26679 if (rename ("conftest.f2", "conftest.f2") != 0)
26680 result |= 16;
26681 return result;
6a29c58e
YQ
26682
26683 ;
26684 return 0;
26685}
26686_ACEOF
26687if ac_fn_c_try_run "$LINENO"; then :
26688 gl_cv_func_rename_link_works=yes
26689else
26690 gl_cv_func_rename_link_works=no
26691fi
26692rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26693 conftest.$ac_objext conftest.beam conftest.$ac_ext
26694fi
26695
c0c3707f
CB
26696 else
26697 gl_cv_func_rename_link_works="guessing no"
26698 fi
26699 rm -rf conftest.f conftest.f1 conftest.f2
6a29c58e 26700 else
c0c3707f
CB
26701 case "$host_os" in
26702 # Guess yes on Linux systems.
26703 linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
26704 # Guess yes on glibc systems.
26705 *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
26706 # Guess yes on native Windows.
26707 mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
26708 # If we don't know, obey --enable-cross-guesses.
26709 *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
26710 esac
6a29c58e 26711 fi
6a29c58e
YQ
26712 else
26713 gl_cv_func_rename_link_works=yes
26714 fi
26715
26716fi
26717{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
26718$as_echo "$gl_cv_func_rename_link_works" >&6; }
26719 case "$gl_cv_func_rename_link_works" in
26720 *yes) ;;
26721 *)
26722 REPLACE_RENAME=1
26723
26724$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
26725
26726 ;;
26727 esac
26728
26729 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
26730$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
d0ac1c44 26731if ${gl_cv_func_rename_dest_works+:} false; then :
6a29c58e
YQ
26732 $as_echo_n "(cached) " >&6
26733else
26734 rm -rf conftest.f conftest.d1 conftest.d2
26735 touch conftest.f && mkdir conftest.d1 conftest.d2 ||
d0ac1c44 26736 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26737 if test "$cross_compiling" = yes; then :
26738 case "$host_os" in
c0c3707f
CB
26739 # Guess yes on Linux systems.
26740 linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
26741 # Guess yes on glibc systems.
26742 *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
26743 # Guess no on native Windows.
26744 mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
26745 # If we don't know, obey --enable-cross-guesses.
26746 *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26747 esac
26748
26749else
26750 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26751/* end confdefs.h. */
26752
26753# include <stdio.h>
26754# include <stdlib.h>
26755
26756int
26757main ()
26758{
26759int result = 0;
26760 if (rename ("conftest.d1", "conftest.d2") != 0)
26761 result |= 1;
26762 if (rename ("conftest.d2", "conftest.f") == 0)
26763 result |= 2;
26764 return result;
26765
26766 ;
26767 return 0;
26768}
26769_ACEOF
26770if ac_fn_c_try_run "$LINENO"; then :
26771 gl_cv_func_rename_dest_works=yes
26772else
26773 gl_cv_func_rename_dest_works=no
26774fi
26775rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26776 conftest.$ac_objext conftest.beam conftest.$ac_ext
26777fi
26778
26779 rm -rf conftest.f conftest.d1 conftest.d2
26780
26781fi
26782{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
26783$as_echo "$gl_cv_func_rename_dest_works" >&6; }
26784 case "$gl_cv_func_rename_dest_works" in
26785 *yes) ;;
26786 *)
26787 REPLACE_RENAME=1
26788
26789$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
26790
26791 ;;
26792 esac
26793
26794 if test $REPLACE_RENAME = 1; then
26795
26796
26797
26798
26799
26800
26801
26802
26803 gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext"
26804
26805 fi
26806
26807
26808
26809
26810
26811 GNULIB_RENAME=1
26812
26813
26814
26815
26816
26817$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
26818
26819
26820
26821
26822
26823
6ec2e0f5
SDJ
26824 for ac_func in rewinddir
26825do :
26826 ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
d0ac1c44 26827if test "x$ac_cv_func_rewinddir" = xyes; then :
6ec2e0f5
SDJ
26828 cat >>confdefs.h <<_ACEOF
26829#define HAVE_REWINDDIR 1
26830_ACEOF
26831
26832fi
26833done
26834
26835 if test $ac_cv_func_rewinddir = no; then
26836 HAVE_REWINDDIR=0
26837 fi
26838
26839 if test $HAVE_REWINDDIR = 0; then
26840
26841
26842
26843
26844
26845
26846
26847
26848 gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext"
26849
26850 fi
26851
26852
26853
26854
26855
26856 GNULIB_REWINDDIR=1
26857
26858
26859
26860
26861
26862$as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
26863
26864
26865
26866
26867
26868
6a29c58e
YQ
26869 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
26870$as_echo_n "checking whether rmdir works... " >&6; }
d0ac1c44 26871if ${gl_cv_func_rmdir_works+:} false; then :
6a29c58e
YQ
26872 $as_echo_n "(cached) " >&6
26873else
26874 mkdir conftest.dir
26875 touch conftest.file
26876 if test "$cross_compiling" = yes; then :
26877 case "$host_os" in
c0c3707f
CB
26878 # Guess yes on Linux systems.
26879 linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
26880 # Guess yes on glibc systems.
26881 *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
26882 # Guess no on native Windows.
26883 mingw*) gl_cv_func_rmdir_works="guessing no" ;;
26884 # If we don't know, obey --enable-cross-guesses.
26885 *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26886 esac
26887
26888else
26889 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26890/* end confdefs.h. */
26891#include <stdio.h>
26892 #include <errno.h>
26893 #if HAVE_UNISTD_H
26894 # include <unistd.h>
26895 #else /* on Windows with MSVC */
26896 # include <direct.h>
26897 #endif
26898
9c9d63b1
PM
26899
26900$gl_mda_defines
26901
6a29c58e
YQ
26902int
26903main ()
26904{
26905int result = 0;
9c9d63b1
PM
26906 if (!rmdir ("conftest.file/"))
26907 result |= 1;
26908 else if (errno != ENOTDIR)
26909 result |= 2;
26910 if (!rmdir ("conftest.dir/./"))
26911 result |= 4;
26912 return result;
6a29c58e
YQ
26913
26914 ;
26915 return 0;
26916}
26917_ACEOF
26918if ac_fn_c_try_run "$LINENO"; then :
26919 gl_cv_func_rmdir_works=yes
26920else
26921 gl_cv_func_rmdir_works=no
26922fi
26923rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26924 conftest.$ac_objext conftest.beam conftest.$ac_ext
26925fi
26926
26927 rm -rf conftest.dir conftest.file
26928fi
26929{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
26930$as_echo "$gl_cv_func_rmdir_works" >&6; }
26931 case "$gl_cv_func_rmdir_works" in
26932 *yes) ;;
26933 *)
26934 REPLACE_RMDIR=1
26935 ;;
26936 esac
26937
26938 if test $REPLACE_RMDIR = 1; then
26939
26940
26941
26942
26943
26944
26945
26946
26947 gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
26948
26949 fi
26950
26951
26952
26953
26954
26955 GNULIB_RMDIR=1
26956
26957
26958
26959
26960
26961$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
26962
26963
26964
26965
0750520d 26966
5e8754f9
SDJ
26967
26968
26969
3d99e817
AK
26970 if test $ac_cv_func_setenv = no; then
26971 HAVE_SETENV=0
26972 else
26973 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
26974$as_echo_n "checking whether setenv validates arguments... " >&6; }
d0ac1c44 26975if ${gl_cv_func_setenv_works+:} false; then :
3d99e817
AK
26976 $as_echo_n "(cached) " >&6
26977else
26978 if test "$cross_compiling" = yes; then :
26979 case "$host_os" in
c0c3707f
CB
26980 # Guess yes on glibc systems.
26981 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
26982 # Guess yes on musl systems.
26983 *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
26984 # If we don't know, obey --enable-cross-guesses.
26985 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
26986 esac
26987
26988else
26989 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26990/* end confdefs.h. */
26991
26992 #include <stdlib.h>
26993 #include <errno.h>
26994 #include <string.h>
26995
26996int
26997main ()
26998{
26999
27000 int result = 0;
27001 {
27002 if (setenv ("", "", 0) != -1)
27003 result |= 1;
27004 else if (errno != EINVAL)
27005 result |= 2;
27006 }
27007 {
27008 if (setenv ("a", "=", 1) != 0)
27009 result |= 4;
27010 else if (strcmp (getenv ("a"), "=") != 0)
27011 result |= 8;
27012 }
27013 return result;
27014
27015 ;
27016 return 0;
27017}
27018_ACEOF
27019if ac_fn_c_try_run "$LINENO"; then :
27020 gl_cv_func_setenv_works=yes
27021else
27022 gl_cv_func_setenv_works=no
27023fi
27024rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27025 conftest.$ac_objext conftest.beam conftest.$ac_ext
27026fi
27027
27028fi
27029{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
27030$as_echo "$gl_cv_func_setenv_works" >&6; }
27031 case "$gl_cv_func_setenv_works" in
27032 *yes) ;;
27033 *)
27034 REPLACE_SETENV=1
27035 ;;
27036 esac
27037 fi
27038
27039 if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
27040
27041
27042
27043
27044
27045
27046
27047
27048 gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
27049
27050 fi
27051
27052
27053
27054
27055
27056 GNULIB_SETENV=1
27057
27058
27059
27060
27061
27062$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
27063
27064
27065
27066
27067
0750520d
PA
27068
27069
27070
5df4cba6
SM
27071 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
27072$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
27073if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
27074 $as_echo_n "(cached) " >&6
27075else
27076 case "$host_os" in
27077 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
27078 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
27079 gl_cv_func_setlocale_null_all_mtsafe=no ;;
27080 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
27081 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
27082 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
27083 # If we don't know, obey --enable-cross-guesses.
27084 *)
27085 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
27086 esac
27087
27088fi
27089{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
27090$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
27091 case "$host_os" in
27092 mingw*) ;;
27093 *)
27094 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
27095 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
27096 fi
27097 ;;
27098 esac
27099 case "$gl_cv_func_setlocale_null_all_mtsafe" in
27100 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
27101 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
27102 esac
27103
27104cat >>confdefs.h <<_ACEOF
27105#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
27106_ACEOF
27107
27108
27109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
27110$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
27111if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
27112 $as_echo_n "(cached) " >&6
27113else
27114 case "$host_os" in
27115 # Guess no on OpenBSD, AIX.
27116 openbsd* | aix*)
27117 gl_cv_func_setlocale_null_one_mtsafe=no ;;
27118 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
27119 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
27120 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
27121 # If we don't know, obey --enable-cross-guesses.
27122 *)
27123 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
27124 esac
27125
27126fi
27127{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
27128$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
27129 case "$host_os" in
27130 mingw*) ;;
27131 *)
27132 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
27133 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
27134 fi
27135 ;;
27136 esac
27137 case "$gl_cv_func_setlocale_null_one_mtsafe" in
27138 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
27139 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
27140 esac
27141
27142cat >>confdefs.h <<_ACEOF
27143#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
27144_ACEOF
27145
27146
27147 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
27148 case "$host_os" in
27149 mingw*) LIB_SETLOCALE_NULL= ;;
27150 *)
27151
27152
27153 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
27154$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
27155if ${gl_cv_have_weak+:} false; then :
27156 $as_echo_n "(cached) " >&6
27157else
27158 gl_cv_have_weak=no
27159 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27160/* end confdefs.h. */
27161extern void xyzzy ();
27162#pragma weak xyzzy
27163int
27164main ()
27165{
27166xyzzy();
27167 ;
27168 return 0;
27169}
27170_ACEOF
27171if ac_fn_c_try_link "$LINENO"; then :
27172 gl_cv_have_weak=maybe
27173fi
27174rm -f core conftest.err conftest.$ac_objext \
27175 conftest$ac_exeext conftest.$ac_ext
27176 if test $gl_cv_have_weak = maybe; then
27177 if test "$cross_compiling" = yes; then :
27178 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27179/* end confdefs.h. */
27180#ifdef __ELF__
27181 Extensible Linking Format
27182 #endif
27183
27184_ACEOF
27185if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
27186 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
27187 gl_cv_have_weak="guessing yes"
27188else
27189 gl_cv_have_weak="guessing no"
27190fi
27191rm -f conftest*
27192
27193
27194else
27195 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27196/* end confdefs.h. */
27197
27198#include <stdio.h>
27199#pragma weak fputs
27200int main ()
27201{
27202 return (fputs == NULL);
27203}
27204_ACEOF
27205if ac_fn_c_try_run "$LINENO"; then :
27206 gl_cv_have_weak=yes
27207else
27208 gl_cv_have_weak=no
27209fi
27210rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27211 conftest.$ac_objext conftest.beam conftest.$ac_ext
27212fi
27213
27214 fi
27215 case " $LDFLAGS " in
27216 *" -static "*) gl_cv_have_weak=no ;;
27217 esac
27218 case "$gl_cv_have_weak" in
27219 *yes)
27220 case "$host_os" in
27221 freebsd* | dragonfly*)
27222 : > conftest1.c
27223 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
27224 cat <<EOF > conftest2.c
27225#include <pthread.h>
27226#pragma weak pthread_mutexattr_gettype
27227int main ()
27228{
27229 return (pthread_mutexattr_gettype != NULL);
27230}
27231EOF
27232 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
27233 || gl_cv_have_weak=no
27234 rm -f conftest1.c libempty.so conftest2.c conftest
27235 ;;
27236 esac
27237 ;;
27238 esac
27239
27240fi
27241{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
27242$as_echo "$gl_cv_have_weak" >&6; }
27243 case "$gl_cv_have_weak" in
27244 *yes)
27245
27246$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
27247
27248 ;;
27249 esac
27250
27251 case "$gl_cv_have_weak" in
27252 *yes) LIB_SETLOCALE_NULL= ;;
27253 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
27254 esac
27255 ;;
27256 esac
27257 else
27258 LIB_SETLOCALE_NULL=
27259 fi
27260
27261
27262 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
27263
27264
27265
27266
27267
27268
27269
27270
27271 gl_LIBOBJS="$gl_LIBOBJS setlocale-lock.$ac_objext"
27272
27273
27274
27275
27276 CFLAG_VISIBILITY=
27277 HAVE_VISIBILITY=0
27278 if test -n "$GCC"; then
27279 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
27280$as_echo_n "checking whether the -Werror option is usable... " >&6; }
27281if ${gl_cv_cc_vis_werror+:} false; then :
27282 $as_echo_n "(cached) " >&6
27283else
27284 gl_save_CFLAGS="$CFLAGS"
27285 CFLAGS="$CFLAGS -Werror"
27286 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27287/* end confdefs.h. */
27288
27289int
27290main ()
27291{
27292
27293 ;
27294 return 0;
27295}
27296_ACEOF
27297if ac_fn_c_try_compile "$LINENO"; then :
27298 gl_cv_cc_vis_werror=yes
27299else
27300 gl_cv_cc_vis_werror=no
27301fi
27302rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27303 CFLAGS="$gl_save_CFLAGS"
27304
27305fi
27306{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
27307$as_echo "$gl_cv_cc_vis_werror" >&6; }
27308 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
27309$as_echo_n "checking for simple visibility declarations... " >&6; }
27310if ${gl_cv_cc_visibility+:} false; then :
27311 $as_echo_n "(cached) " >&6
27312else
27313 gl_save_CFLAGS="$CFLAGS"
27314 CFLAGS="$CFLAGS -fvisibility=hidden"
27315 if test $gl_cv_cc_vis_werror = yes; then
27316 CFLAGS="$CFLAGS -Werror"
27317 fi
27318 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27319/* end confdefs.h. */
27320extern __attribute__((__visibility__("hidden"))) int hiddenvar;
27321 extern __attribute__((__visibility__("default"))) int exportedvar;
27322 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
27323 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
27324 void dummyfunc (void) {}
27325
27326int
27327main ()
27328{
27329
27330 ;
27331 return 0;
27332}
27333_ACEOF
27334if ac_fn_c_try_compile "$LINENO"; then :
27335 gl_cv_cc_visibility=yes
27336else
27337 gl_cv_cc_visibility=no
27338fi
27339rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27340 CFLAGS="$gl_save_CFLAGS"
27341
27342fi
27343{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
27344$as_echo "$gl_cv_cc_visibility" >&6; }
27345 if test $gl_cv_cc_visibility = yes; then
27346 CFLAG_VISIBILITY="-fvisibility=hidden"
27347 HAVE_VISIBILITY=1
27348 fi
27349 fi
27350
27351
27352
27353cat >>confdefs.h <<_ACEOF
27354#define HAVE_VISIBILITY $HAVE_VISIBILITY
27355_ACEOF
27356
27357
27358
27359 fi
27360
27361
27362
27363
27364
27365 GNULIB_SETLOCALE_NULL=1
27366
27367
27368
27369
27370
27371$as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h
27372
27373
27374
27375
27376
27377
27378
27379
0750520d
PA
27380
27381
27382
27383
27384
27385
27386 if test $gl_cv_have_include_next = yes; then
27387 gl_cv_next_signal_h='<'signal.h'>'
27388 else
27389 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
27390$as_echo_n "checking absolute name of <signal.h>... " >&6; }
d0ac1c44 27391if ${gl_cv_next_signal_h+:} false; then :
0750520d
PA
27392 $as_echo_n "(cached) " >&6
27393else
27394
27395
27396
27397 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27398/* end confdefs.h. */
27399#include <signal.h>
27400_ACEOF
27401 case "$host_os" in
27402 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27403 *) gl_absname_cpp="$ac_cpp" ;;
27404 esac
27405
27406 case "$host_os" in
27407 mingw*)
27408 gl_dirsep_regex='[/\\]'
27409 ;;
27410 *)
27411 gl_dirsep_regex='\/'
27412 ;;
27413 esac
27414 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27415 gl_header_literal_regex=`echo 'signal.h' \
27416 | sed -e "$gl_make_literal_regex_sed"`
27417 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27418 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27419 s|^/[^/]|//&|
27420 p
27421 q
27422 }'
27423
27424 gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27425 sed -n "$gl_absolute_header_sed"`
27426
27427 gl_header=$gl_cv_absolute_signal_h
27428 gl_cv_next_signal_h='"'$gl_header'"'
27429
27430
27431fi
27432{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
27433$as_echo "$gl_cv_next_signal_h" >&6; }
27434 fi
27435 NEXT_SIGNAL_H=$gl_cv_next_signal_h
27436
27437 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27438 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27439 gl_next_as_first_directive='<'signal.h'>'
27440 else
27441 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27442 gl_next_as_first_directive=$gl_cv_next_signal_h
27443 fi
27444 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
27445
27446
27447
27448
27449
27450# AIX declares sig_atomic_t to already include volatile, and C89 compilers
27451# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
27452 ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
27453#include <signal.h>
27454
27455"
d0ac1c44 27456if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
0750520d
PA
27457
27458else
27459 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
27460fi
27461
27462
27463
27464
27465
27466
27467
27468 ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
27469#include <signal.h>
27470
27471"
d0ac1c44 27472if test "x$ac_cv_type_sighandler_t" = xyes; then :
0750520d
PA
27473
27474else
27475 HAVE_SIGHANDLER_T=0
27476fi
27477
27478
27479
0750520d 27480
0750520d
PA
27481
27482
698be2d8
CB
27483
27484
725e2999
JB
27485 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
27486/* <sys/types.h> is not needed according to POSIX, but the
27487 <sys/socket.h> in i386-unknown-freebsd4.10 and
27488 powerpc-apple-darwin5.5 required it. */
27489#include <sys/types.h>
27490#if HAVE_SYS_SOCKET_H
27491# include <sys/socket.h>
27492#elif HAVE_WS2TCPIP_H
27493# include <ws2tcpip.h>
27494#endif
27495
27496"
27497if test "x$ac_cv_type_socklen_t" = xyes; then :
27498
27499else
27500 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
27501$as_echo_n "checking for socklen_t equivalent... " >&6; }
c0c3707f 27502if ${gl_cv_socklen_t_equiv+:} false; then :
725e2999
JB
27503 $as_echo_n "(cached) " >&6
27504else
27505 # Systems have either "struct sockaddr *" or
27506 # "void *" as the second argument to getpeername
27507 gl_cv_socklen_t_equiv=
27508 for arg2 in "struct sockaddr" void; do
27509 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
27510 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27511/* end confdefs.h. */
27512#include <sys/types.h>
27513 #include <sys/socket.h>
27514
27515 int getpeername (int, $arg2 *, $t *);
27516int
27517main ()
27518{
27519$t len;
27520 getpeername (0, 0, &len);
27521 ;
27522 return 0;
27523}
27524_ACEOF
27525if ac_fn_c_try_compile "$LINENO"; then :
27526 gl_cv_socklen_t_equiv="$t"
27527fi
27528rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27529 test "$gl_cv_socklen_t_equiv" != "" && break
27530 done
27531 test "$gl_cv_socklen_t_equiv" != "" && break
27532 done
c0c3707f
CB
27533 if test "$gl_cv_socklen_t_equiv" = ""; then
27534 as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
27535 fi
725e2999
JB
27536
27537fi
c0c3707f 27538{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
725e2999
JB
27539$as_echo "$gl_cv_socklen_t_equiv" >&6; }
27540
27541cat >>confdefs.h <<_ACEOF
27542#define socklen_t $gl_cv_socklen_t_equiv
27543_ACEOF
27544
27545fi
27546
0750520d 27547
63ce7108
TT
27548 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
27549$as_echo_n "checking for ssize_t... " >&6; }
d0ac1c44 27550if ${gt_cv_ssize_t+:} false; then :
63ce7108
TT
27551 $as_echo_n "(cached) " >&6
27552else
27553 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27554/* end confdefs.h. */
27555#include <sys/types.h>
27556int
27557main ()
27558{
27559int x = sizeof (ssize_t *) + sizeof (ssize_t);
27560 return !x;
27561 ;
27562 return 0;
27563}
27564_ACEOF
27565if ac_fn_c_try_compile "$LINENO"; then :
27566 gt_cv_ssize_t=yes
27567else
27568 gt_cv_ssize_t=no
27569fi
27570rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27571fi
27572{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
27573$as_echo "$gt_cv_ssize_t" >&6; }
27574 if test $gt_cv_ssize_t = no; then
27575
27576$as_echo "#define ssize_t int" >>confdefs.h
27577
27578 fi
27579
27580
27581
27582
472fa5ee 27583
c0c3707f
CB
27584 case "$host_os" in
27585 mingw*)
d706b69e 27586 ;;
c0c3707f
CB
27587 *)
27588 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
27589$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
27590if ${gl_cv_func_stat_file_slash+:} false; then :
2196f55f
YQ
27591 $as_echo_n "(cached) " >&6
27592else
c0c3707f
CB
27593 touch conftest.tmp
27594 # Assume that if we have lstat, we can also check symlinks.
27595 if test $ac_cv_func_lstat = yes; then
27596 ln -s conftest.tmp conftest.lnk
27597 fi
27598 if test "$cross_compiling" = yes; then :
27599 case "$host_os" in
27600 # Guess yes on Linux systems.
27601 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
27602 # Guess yes on glibc systems.
27603 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
27604 # If we don't know, obey --enable-cross-guesses.
27605 *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
27606 esac
27607
2196f55f
YQ
27608else
27609 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27610/* end confdefs.h. */
27611#include <sys/stat.h>
27612
27613int
27614main ()
27615{
c0c3707f
CB
27616int result = 0;
27617 struct stat st;
27618 if (!stat ("conftest.tmp/", &st))
27619 result |= 1;
27620#if HAVE_LSTAT
27621 if (!stat ("conftest.lnk/", &st))
27622 result |= 2;
27623#endif
27624 return result;
27625
2196f55f
YQ
27626 ;
27627 return 0;
27628}
27629_ACEOF
27630if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 27631 gl_cv_func_stat_file_slash=yes
2196f55f 27632else
c0c3707f 27633 gl_cv_func_stat_file_slash=no
2196f55f
YQ
27634fi
27635rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27636 conftest.$ac_objext conftest.beam conftest.$ac_ext
27637fi
27638
c0c3707f 27639 rm -f conftest.tmp conftest.lnk
2196f55f 27640fi
c0c3707f
CB
27641{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
27642$as_echo "$gl_cv_func_stat_file_slash" >&6; }
27643 case $gl_cv_func_stat_file_slash in
27644 *no)
27645 REPLACE_STAT=1
27646
27647$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
27648;;
27649 esac
27650 case $host_os in
27651 solaris*)
27652 REPLACE_FSTAT=1 ;;
27653 esac
27654 ;;
27655 esac
27656
27657 if test $REPLACE_STAT = 1; then
27658
27659
27660
27661
27662
27663
27664
27665
27666 gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
27667
27668 case "$host_os" in
27669 mingw*)
27670
27671
27672
27673
27674
27675
27676
27677
27678 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
27679
27680 ;;
27681 esac
27682
27683
9c9d63b1 27684
c0c3707f
CB
27685 :
27686
27687 fi
27688
27689
27690
27691
27692
27693 GNULIB_STAT=1
27694
27695
27696
27697
27698
27699$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
27700
27701
27702
27703
7a6dbc2f 27704
c0c3707f
CB
27705
27706
27707 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>
27708 #include <sys/stat.h>
27709"
27710if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
27711
27712cat >>confdefs.h <<_ACEOF
27713#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
27714_ACEOF
27715
27716{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
27717$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
27718if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
27719 $as_echo_n "(cached) " >&6
2196f55f 27720else
5e8754f9
SDJ
27721 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27722/* end confdefs.h. */
c0c3707f
CB
27723
27724 #include <sys/types.h>
27725 #include <sys/stat.h>
27726 #if HAVE_SYS_TIME_H
27727 # include <sys/time.h>
27728 #endif
27729 #include <time.h>
27730 struct timespec ts;
27731 struct stat st;
7a6dbc2f 27732
5e8754f9
SDJ
27733int
27734main ()
27735{
c0c3707f
CB
27736
27737 st.st_atim = ts;
7a6dbc2f 27738
5e8754f9
SDJ
27739 ;
27740 return 0;
27741}
27742_ACEOF
c0c3707f
CB
27743if ac_fn_c_try_compile "$LINENO"; then :
27744 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
5e8754f9 27745else
c0c3707f 27746 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
2196f55f 27747fi
c0c3707f 27748rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2196f55f 27749fi
c0c3707f
CB
27750{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
27751$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
27752 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
2196f55f 27753
c0c3707f 27754$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
2196f55f 27755
c0c3707f
CB
27756 fi
27757else
27758 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>
27759 #include <sys/stat.h>
27760"
27761if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
2196f55f 27762
c0c3707f
CB
27763cat >>confdefs.h <<_ACEOF
27764#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
27765_ACEOF
2196f55f 27766
c0c3707f
CB
27767
27768else
27769 ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
27770 #include <sys/stat.h>
27771"
27772if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
27773
27774cat >>confdefs.h <<_ACEOF
27775#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
27776_ACEOF
2196f55f
YQ
27777
27778
c0c3707f
CB
27779else
27780 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>
27781 #include <sys/stat.h>
27782"
27783if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
2196f55f 27784
c0c3707f
CB
27785cat >>confdefs.h <<_ACEOF
27786#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
27787_ACEOF
2196f55f
YQ
27788
27789
c0c3707f 27790fi
2196f55f 27791
c0c3707f 27792fi
2196f55f 27793
c0c3707f 27794fi
2196f55f 27795
c0c3707f 27796fi
2196f55f
YQ
27797
27798
27799
27800
27801
c0c3707f
CB
27802 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>
27803 #include <sys/stat.h>
27804"
27805if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
2196f55f 27806
c0c3707f
CB
27807cat >>confdefs.h <<_ACEOF
27808#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
27809_ACEOF
2196f55f
YQ
27810
27811
c0c3707f
CB
27812else
27813 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
27814 #include <sys/stat.h>
27815"
27816if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
2196f55f 27817
c0c3707f
CB
27818cat >>confdefs.h <<_ACEOF
27819#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
27820_ACEOF
2196f55f 27821
2196f55f 27822
c0c3707f
CB
27823else
27824 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>
27825 #include <sys/stat.h>
27826"
27827if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
27828
27829cat >>confdefs.h <<_ACEOF
27830#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
27831_ACEOF
27832
27833
27834fi
27835
27836fi
5e8754f9 27837
c0c3707f 27838fi
2196f55f
YQ
27839
27840
27841
725e2999
JB
27842 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
27843$as_echo_n "checking for working stdalign.h... " >&6; }
27844if ${gl_cv_header_working_stdalign_h+:} false; then :
27845 $as_echo_n "(cached) " >&6
27846else
27847 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27848/* end confdefs.h. */
27849#include <stdalign.h>
27850 #include <stddef.h>
27851
27852 /* Test that alignof yields a result consistent with offsetof.
27853 This catches GCC bug 52023
c0c3707f 27854 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
725e2999
JB
27855 #ifdef __cplusplus
27856 template <class t> struct alignof_helper { char a; t b; };
27857 # define ao(type) offsetof (alignof_helper<type>, b)
27858 #else
27859 # define ao(type) offsetof (struct { char a; type b; }, b)
27860 #endif
27861 char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
27862 char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
27863 char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
27864
27865 /* Test _Alignas only on platforms where gnulib can help. */
27866 #if \
27867 ((defined __cplusplus && 201103 <= __cplusplus) \
27868 || (defined __APPLE__ && defined __MACH__ \
27869 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
27870 : __GNUC__) \
c0c3707f
CB
27871 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
27872 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
725e2999
JB
27873 || 1300 <= _MSC_VER)
27874 struct alignas_test { char c; char alignas (8) alignas_8; };
27875 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
27876 ? 1 : -1];
27877 #endif
27878
27879int
27880main ()
27881{
27882
27883 ;
27884 return 0;
27885}
27886_ACEOF
27887if ac_fn_c_try_compile "$LINENO"; then :
27888 gl_cv_header_working_stdalign_h=yes
27889else
27890 gl_cv_header_working_stdalign_h=no
27891fi
27892rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27893fi
27894{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
27895$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
27896
27897 if test $gl_cv_header_working_stdalign_h = yes; then
27898 STDALIGN_H=''
27899 else
27900 STDALIGN_H='stdalign.h'
27901 fi
27902
27903
27904 if test -n "$STDALIGN_H"; then
27905 GL_GENERATE_STDALIGN_H_TRUE=
27906 GL_GENERATE_STDALIGN_H_FALSE='#'
27907else
27908 GL_GENERATE_STDALIGN_H_TRUE='#'
27909 GL_GENERATE_STDALIGN_H_FALSE=
27910fi
27911
27912
27913
2196f55f
YQ
27914
27915
63ce7108 27916
c0c3707f
CB
27917 if test "$ac_cv_header_stdbool_h" = yes; then
27918 case "$host_os" in
27919 solaris*)
27920 if test -z "$GCC"; then
27921 STDBOOL_H='stdbool.h'
27922 else
27923 STDBOOL_H=''
27924 fi
27925 ;;
27926 *)
27927 STDBOOL_H=''
27928 ;;
27929 esac
63ce7108
TT
27930 else
27931 STDBOOL_H='stdbool.h'
27932 fi
27933
27934 if test -n "$STDBOOL_H"; then
27935 GL_GENERATE_STDBOOL_H_TRUE=
27936 GL_GENERATE_STDBOOL_H_FALSE='#'
27937else
27938 GL_GENERATE_STDBOOL_H_TRUE='#'
27939 GL_GENERATE_STDBOOL_H_FALSE=
27940fi
27941
27942
27943 if test "$ac_cv_type__Bool" = yes; then
27944 HAVE__BOOL=1
27945 else
27946 HAVE__BOOL=0
27947 fi
27948
27949
27950
27951
27952
9c9d63b1
PM
27953
27954
27955
63ce7108 27956 STDDEF_H=
4a626d0a 27957
c0c3707f
CB
27958 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
27959$as_echo_n "checking for good max_align_t... " >&6; }
27960if ${gl_cv_type_max_align_t+:} false; then :
27961 $as_echo_n "(cached) " >&6
27962else
27963 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27964/* end confdefs.h. */
27965#include <stddef.h>
27966 unsigned int s = sizeof (max_align_t);
9c9d63b1 27967 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
c0c3707f
CB
27968 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
27969 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
27970 #endif
9c9d63b1
PM
27971 typedef struct { char a; max_align_t b; } max_helper;
27972 typedef struct { char a; long b; } long_helper;
27973 typedef struct { char a; double b; } double_helper;
27974 typedef struct { char a; long double b; } long_double_helper;
27975 int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
27976 int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
27977 int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
c0c3707f
CB
27978
27979int
27980main ()
27981{
4a626d0a 27982
c0c3707f
CB
27983 ;
27984 return 0;
27985}
27986_ACEOF
27987if ac_fn_c_try_compile "$LINENO"; then :
27988 gl_cv_type_max_align_t=yes
4a626d0a 27989else
c0c3707f 27990 gl_cv_type_max_align_t=no
4a626d0a 27991fi
c0c3707f
CB
27992rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27993
27994fi
27995{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
27996$as_echo "$gl_cv_type_max_align_t" >&6; }
27997 if test $gl_cv_type_max_align_t = no; then
27998 HAVE_MAX_ALIGN_T=0
27999 STDDEF_H=stddef.h
28000 fi
4a626d0a 28001
63ce7108
TT
28002 if test $gt_cv_c_wchar_t = no; then
28003 HAVE_WCHAR_T=0
28004 STDDEF_H=stddef.h
28005 fi
c0c3707f 28006
63ce7108
TT
28007 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
28008$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
d0ac1c44 28009if ${gl_cv_decl_null_works+:} false; then :
63ce7108
TT
28010 $as_echo_n "(cached) " >&6
28011else
28012 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28013/* end confdefs.h. */
28014#include <stddef.h>
28015 int test[2 * (sizeof NULL == sizeof (void *)) -1];
28016
28017int
28018main ()
28019{
28020
28021 ;
28022 return 0;
28023}
28024_ACEOF
28025if ac_fn_c_try_compile "$LINENO"; then :
28026 gl_cv_decl_null_works=yes
28027else
28028 gl_cv_decl_null_works=no
28029fi
28030rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28031fi
28032{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
28033$as_echo "$gl_cv_decl_null_works" >&6; }
28034 if test $gl_cv_decl_null_works = no; then
28035 REPLACE_NULL=1
28036 STDDEF_H=stddef.h
28037 fi
28038
c0c3707f 28039
63ce7108
TT
28040 if test -n "$STDDEF_H"; then
28041 GL_GENERATE_STDDEF_H_TRUE=
28042 GL_GENERATE_STDDEF_H_FALSE='#'
28043else
28044 GL_GENERATE_STDDEF_H_TRUE='#'
28045 GL_GENERATE_STDDEF_H_FALSE=
28046fi
28047
28048 if test -n "$STDDEF_H"; then
28049
28050
28051
28052
28053
28054
28055
28056
28057 if test $gl_cv_have_include_next = yes; then
28058 gl_cv_next_stddef_h='<'stddef.h'>'
28059 else
28060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
28061$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
d0ac1c44 28062if ${gl_cv_next_stddef_h+:} false; then :
63ce7108
TT
28063 $as_echo_n "(cached) " >&6
28064else
28065
4a626d0a
PA
28066
28067
28068 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63ce7108
TT
28069/* end confdefs.h. */
28070#include <stddef.h>
63ce7108 28071_ACEOF
4a626d0a
PA
28072 case "$host_os" in
28073 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28074 *) gl_absname_cpp="$ac_cpp" ;;
28075 esac
63ce7108 28076
4a626d0a
PA
28077 case "$host_os" in
28078 mingw*)
28079 gl_dirsep_regex='[/\\]'
28080 ;;
28081 *)
28082 gl_dirsep_regex='\/'
28083 ;;
28084 esac
28085 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28086 gl_header_literal_regex=`echo 'stddef.h' \
28087 | sed -e "$gl_make_literal_regex_sed"`
28088 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28089 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28090 s|^/[^/]|//&|
28091 p
28092 q
28093 }'
63ce7108 28094
4a626d0a
PA
28095 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28096 sed -n "$gl_absolute_header_sed"`
28097
28098 gl_header=$gl_cv_absolute_stddef_h
28099 gl_cv_next_stddef_h='"'$gl_header'"'
63ce7108
TT
28100
28101
28102fi
28103{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
28104$as_echo "$gl_cv_next_stddef_h" >&6; }
28105 fi
28106 NEXT_STDDEF_H=$gl_cv_next_stddef_h
28107
28108 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28109 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28110 gl_next_as_first_directive='<'stddef.h'>'
28111 else
28112 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28113 gl_next_as_first_directive=$gl_cv_next_stddef_h
28114 fi
28115 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
28116
28117
28118
28119
28120 fi
28121
28122
28123
28124
49e4877c 28125 $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
63ce7108
TT
28126
28127
28128
98399780
YQ
28129
28130
28131
28132
28133
4a626d0a
PA
28134
28135
6a29c58e
YQ
28136 if test $gl_cv_have_include_next = yes; then
28137 gl_cv_next_stdio_h='<'stdio.h'>'
28138 else
28139 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
28140$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
d0ac1c44 28141if ${gl_cv_next_stdio_h+:} false; then :
6a29c58e
YQ
28142 $as_echo_n "(cached) " >&6
28143else
28144
4a626d0a
PA
28145
28146
28147 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6a29c58e
YQ
28148/* end confdefs.h. */
28149#include <stdio.h>
6a29c58e 28150_ACEOF
4a626d0a
PA
28151 case "$host_os" in
28152 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28153 *) gl_absname_cpp="$ac_cpp" ;;
28154 esac
28155
28156 case "$host_os" in
28157 mingw*)
28158 gl_dirsep_regex='[/\\]'
28159 ;;
28160 *)
28161 gl_dirsep_regex='\/'
28162 ;;
28163 esac
28164 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28165 gl_header_literal_regex=`echo 'stdio.h' \
28166 | sed -e "$gl_make_literal_regex_sed"`
28167 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28168 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28169 s|^/[^/]|//&|
28170 p
28171 q
28172 }'
6a29c58e 28173
4a626d0a
PA
28174 gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28175 sed -n "$gl_absolute_header_sed"`
6a29c58e 28176
4a626d0a
PA
28177 gl_header=$gl_cv_absolute_stdio_h
28178 gl_cv_next_stdio_h='"'$gl_header'"'
6a29c58e
YQ
28179
28180
28181fi
28182{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
28183$as_echo "$gl_cv_next_stdio_h" >&6; }
28184 fi
28185 NEXT_STDIO_H=$gl_cv_next_stdio_h
28186
28187 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28188 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28189 gl_next_as_first_directive='<'stdio.h'>'
28190 else
28191 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28192 gl_next_as_first_directive=$gl_cv_next_stdio_h
28193 fi
28194 NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
28195
28196
28197
28198
28199
4a626d0a
PA
28200 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
28201$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
d0ac1c44 28202if ${gl_cv_func_printf_attribute_flavor+:} false; then :
4a626d0a
PA
28203 $as_echo_n "(cached) " >&6
28204else
28205 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28206/* end confdefs.h. */
28207
28208 #define __STDC_FORMAT_MACROS 1
28209 #include <stdio.h>
28210 #include <inttypes.h>
28211 /* For non-mingw systems, compilation will trivially succeed.
28212 For mingw, compilation will succeed for older mingw (system
28213 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
c0c3707f 28214 #if (defined _WIN32 && ! defined __CYGWIN__) && \
4a626d0a
PA
28215 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
28216 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
28217 #endif
28218
28219int
28220main ()
28221{
28222
28223 ;
28224 return 0;
28225}
28226_ACEOF
28227if ac_fn_c_try_compile "$LINENO"; then :
28228 gl_cv_func_printf_attribute_flavor=system
28229else
28230 gl_cv_func_printf_attribute_flavor=gnu
28231fi
28232rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28233fi
28234{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
28235$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
28236 if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
28237
28238$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
28239
28240 fi
28241
6a29c58e
YQ
28242 GNULIB_FSCANF=1
28243
28244
28245cat >>confdefs.h <<_ACEOF
28246#define GNULIB_FSCANF 1
28247_ACEOF
28248
28249
28250 GNULIB_SCANF=1
28251
28252
28253cat >>confdefs.h <<_ACEOF
28254#define GNULIB_SCANF 1
28255_ACEOF
28256
28257
28258 GNULIB_FGETC=1
28259 GNULIB_GETC=1
28260 GNULIB_GETCHAR=1
28261 GNULIB_FGETS=1
28262 GNULIB_FREAD=1
28263
28264
28265 GNULIB_FPRINTF=1
28266 GNULIB_PRINTF=1
28267 GNULIB_VFPRINTF=1
28268 GNULIB_VPRINTF=1
28269 GNULIB_FPUTC=1
28270 GNULIB_PUTC=1
28271 GNULIB_PUTCHAR=1
28272 GNULIB_FPUTS=1
28273 GNULIB_PUTS=1
28274 GNULIB_FWRITE=1
28275
28276
28277
28278
6a29c58e 28279
6a29c58e
YQ
28280
28281
28282
28283
28284
9c9d63b1
PM
28285 if test $ac_cv_have_decl_fcloseall = no; then
28286 HAVE_DECL_FCLOSEALL=0
28287 fi
28288
28289
6a29c58e
YQ
28290
28291
28292
28293
28294
28295
28296
698be2d8
CB
28297
28298
98399780
YQ
28299 if test $gl_cv_have_include_next = yes; then
28300 gl_cv_next_stdlib_h='<'stdlib.h'>'
28301 else
28302 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
28303$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
d0ac1c44 28304if ${gl_cv_next_stdlib_h+:} false; then :
98399780
YQ
28305 $as_echo_n "(cached) " >&6
28306else
28307
4a626d0a
PA
28308
28309
28310 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98399780
YQ
28311/* end confdefs.h. */
28312#include <stdlib.h>
98399780 28313_ACEOF
4a626d0a
PA
28314 case "$host_os" in
28315 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28316 *) gl_absname_cpp="$ac_cpp" ;;
28317 esac
28318
28319 case "$host_os" in
28320 mingw*)
28321 gl_dirsep_regex='[/\\]'
28322 ;;
28323 *)
28324 gl_dirsep_regex='\/'
28325 ;;
28326 esac
28327 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28328 gl_header_literal_regex=`echo 'stdlib.h' \
28329 | sed -e "$gl_make_literal_regex_sed"`
28330 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28331 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28332 s|^/[^/]|//&|
28333 p
28334 q
28335 }'
98399780 28336
4a626d0a
PA
28337 gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28338 sed -n "$gl_absolute_header_sed"`
98399780 28339
4a626d0a
PA
28340 gl_header=$gl_cv_absolute_stdlib_h
28341 gl_cv_next_stdlib_h='"'$gl_header'"'
98399780
YQ
28342
28343
28344fi
28345{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
28346$as_echo "$gl_cv_next_stdlib_h" >&6; }
28347 fi
28348 NEXT_STDLIB_H=$gl_cv_next_stdlib_h
28349
28350 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28351 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28352 gl_next_as_first_directive='<'stdlib.h'>'
28353 else
28354 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28355 gl_next_as_first_directive=$gl_cv_next_stdlib_h
28356 fi
28357 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
28358
28359
28360
28361
28362
28363
98399780 28364
98399780
YQ
28365
28366
28367
28368
28369
9c9d63b1
PM
28370 if test $ac_cv_have_decl_ecvt = no; then
28371 HAVE_DECL_ECVT=0
28372 fi
28373
28374 if test $ac_cv_have_decl_fcvt = no; then
28375 HAVE_DECL_FCVT=0
28376 fi
28377
28378 if test $ac_cv_have_decl_gcvt = no; then
28379 HAVE_DECL_GCVT=0
28380 fi
28381
28382
98399780 28383
698be2d8
CB
28384
28385
8424cc97
SM
28386 for ac_func in strchrnul
28387do :
28388 ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
d0ac1c44 28389if test "x$ac_cv_func_strchrnul" = xyes; then :
8424cc97
SM
28390 cat >>confdefs.h <<_ACEOF
28391#define HAVE_STRCHRNUL 1
28392_ACEOF
28393
28394fi
28395done
28396
28397 if test $ac_cv_func_strchrnul = no; then
28398 HAVE_STRCHRNUL=0
28399 else
28400 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
28401$as_echo_n "checking whether strchrnul works... " >&6; }
d0ac1c44 28402if ${gl_cv_func_strchrnul_works+:} false; then :
8424cc97
SM
28403 $as_echo_n "(cached) " >&6
28404else
28405 if test "$cross_compiling" = yes; then :
28406 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28407/* end confdefs.h. */
28408
28409#if defined __CYGWIN__
28410 #include <cygwin/version.h>
28411 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
28412 Lucky user
28413 #endif
28414#else
28415 Lucky user
28416#endif
28417
28418_ACEOF
28419if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28420 $EGREP "Lucky user" >/dev/null 2>&1; then :
28421 gl_cv_func_strchrnul_works="guessing yes"
28422else
28423 gl_cv_func_strchrnul_works="guessing no"
28424fi
28425rm -f conftest*
28426
28427
28428else
28429 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28430/* end confdefs.h. */
28431
28432#include <string.h> /* for strchrnul */
28433
28434int
28435main ()
28436{
28437const char *buf = "a";
28438 return strchrnul (buf, 'b') != buf + 1;
28439
28440 ;
28441 return 0;
28442}
28443_ACEOF
28444if ac_fn_c_try_run "$LINENO"; then :
28445 gl_cv_func_strchrnul_works=yes
28446else
28447 gl_cv_func_strchrnul_works=no
28448fi
28449rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28450 conftest.$ac_objext conftest.beam conftest.$ac_ext
28451fi
28452
28453
28454fi
28455{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
28456$as_echo "$gl_cv_func_strchrnul_works" >&6; }
28457 case "$gl_cv_func_strchrnul_works" in
28458 *yes) ;;
28459 *) REPLACE_STRCHRNUL=1 ;;
28460 esac
28461 fi
28462
28463 if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
28464
28465
28466
28467
28468
28469
28470
28471
28472 gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext"
28473
28474 :
28475 fi
28476
28477
28478
28479
28480
28481 GNULIB_STRCHRNUL=1
28482
28483
28484
28485
28486
28487$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
28488
28489
28490
28491
28492
28493
9c9d63b1
PM
28494 if test $gl_cv_func_malloc_posix != yes; then
28495 REPLACE_STRDUP=1
6ec2e0f5
SDJ
28496 fi
28497
28498 if test $ac_cv_have_decl_strdup = no; then
28499 HAVE_DECL_STRDUP=0
28500 fi
28501
9c9d63b1 28502 if test $REPLACE_STRDUP = 1; then
6ec2e0f5
SDJ
28503
28504
28505
28506
28507
28508
28509
28510
28511 gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
28512
28513 :
28514 fi
28515
28516
28517
28518
28519
28520 GNULIB_STRDUP=1
28521
28522
28523
28524
28525
28526$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
28527
28528
28529
28530
28531
28532
28533
28534
5abebf3c
CB
28535
28536
6ec2e0f5
SDJ
28537 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
28538 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
28539$as_echo_n "checking for working strerror function... " >&6; }
d0ac1c44 28540if ${gl_cv_func_working_strerror+:} false; then :
6ec2e0f5
SDJ
28541 $as_echo_n "(cached) " >&6
28542else
28543 if test "$cross_compiling" = yes; then :
28544 case "$host_os" in
c0c3707f
CB
28545 # Guess yes on glibc systems.
28546 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
28547 # Guess yes on musl systems.
28548 *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
28549 # If we don't know, obey --enable-cross-guesses.
28550 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
6ec2e0f5
SDJ
28551 esac
28552
28553else
28554 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28555/* end confdefs.h. */
28556#include <string.h>
28557
28558int
28559main ()
28560{
28561if (!*strerror (-2)) return 1;
28562 ;
28563 return 0;
28564}
28565_ACEOF
28566if ac_fn_c_try_run "$LINENO"; then :
28567 gl_cv_func_working_strerror=yes
28568else
28569 gl_cv_func_working_strerror=no
28570fi
28571rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28572 conftest.$ac_objext conftest.beam conftest.$ac_ext
28573fi
28574
28575
28576fi
28577{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
28578$as_echo "$gl_cv_func_working_strerror" >&6; }
28579 case "$gl_cv_func_working_strerror" in
28580 *yes) ;;
28581 *)
28582 REPLACE_STRERROR=1
28583 ;;
28584 esac
28585
5abebf3c
CB
28586 case "$gl_cv_func_strerror_r_works" in
28587 *no) REPLACE_STRERROR=1 ;;
28588 esac
28589
6ec2e0f5
SDJ
28590 else
28591 REPLACE_STRERROR=1
28592 fi
28593
28594 if test $REPLACE_STRERROR = 1; then
28595
28596
28597
28598
28599
28600
28601
28602
28603 gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
28604
28605 fi
28606
28607
28608cat >>confdefs.h <<_ACEOF
28609#define GNULIB_STRERROR 1
28610_ACEOF
28611
28612
28613
28614
28615
28616
28617
28618 GNULIB_STRERROR=1
28619
28620
28621
28622
28623
28624$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
28625
28626
28627
28628
28629
28630 if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
28631
28632
28633
28634
28635
28636
28637
28638
28639 gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
28640
28641
28642
28643
28644
28645 if test $ac_cv_header_sys_socket_h != yes; then
28646 for ac_header in winsock2.h
28647do :
28648 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
d0ac1c44 28649if test "x$ac_cv_header_winsock2_h" = xyes; then :
6ec2e0f5
SDJ
28650 cat >>confdefs.h <<_ACEOF
28651#define HAVE_WINSOCK2_H 1
28652_ACEOF
28653
28654fi
28655
28656done
28657
28658 fi
28659 if test "$ac_cv_header_winsock2_h" = yes; then
28660 HAVE_WINSOCK2_H=1
28661 UNISTD_H_HAVE_WINSOCK2_H=1
28662 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
28663 else
28664 HAVE_WINSOCK2_H=0
28665 fi
28666
28667
28668 fi
28669
28670
28671
28672
98399780 28673
5abebf3c 28674
5abebf3c 28675
c0c3707f
CB
28676 if test $ac_cv_have_decl_strerror_r = no; then
28677 HAVE_DECL_STRERROR_R=0
28678 fi
5abebf3c
CB
28679
28680 if test $ac_cv_func_strerror_r = yes; then
28681 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
28682 if test $gl_cv_func_strerror_r_posix_signature = yes; then
28683 case "$gl_cv_func_strerror_r_works" in
28684 *no) REPLACE_STRERROR_R=1 ;;
28685 esac
28686 else
28687 REPLACE_STRERROR_R=1
28688 fi
28689 else
28690 REPLACE_STRERROR_R=1
28691 fi
28692 fi
28693
5abebf3c
CB
28694 if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
28695
28696
28697
28698
28699
28700
28701
28702
28703 gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext"
28704
28705
28706
5abebf3c
CB
28707
28708
28709
c0c3707f 28710 fi
5abebf3c
CB
28711
28712
28713
28714
5abebf3c 28715
c0c3707f 28716 GNULIB_STRERROR_R=1
5abebf3c
CB
28717
28718
28719
28720
5abebf3c 28721
c0c3707f 28722$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
5abebf3c
CB
28723
28724
28725
28726
5abebf3c 28727
c0c3707f
CB
28728cat >>confdefs.h <<_ACEOF
28729#define GNULIB_STRERROR_R_POSIX 1
28730_ACEOF
5abebf3c
CB
28731
28732
28733
28734
28735
28736
28737
698be2d8
CB
28738
28739
28740
28741
28742 if test $ac_cv_have_decl_strnlen = no; then
28743 HAVE_DECL_STRNLEN=0
28744 else
28745
28746 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
28747$as_echo_n "checking for working strnlen... " >&6; }
28748if ${ac_cv_func_strnlen_working+:} false; then :
28749 $as_echo_n "(cached) " >&6
28750else
28751 if test "$cross_compiling" = yes; then :
28752 # Guess no on AIX systems, yes otherwise.
28753 case "$host_os" in
28754 aix*) ac_cv_func_strnlen_working=no;;
28755 *) ac_cv_func_strnlen_working=yes;;
28756 esac
28757else
28758 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28759/* end confdefs.h. */
28760$ac_includes_default
28761int
28762main ()
28763{
28764
28765#define S "foobar"
28766#define S_LEN (sizeof S - 1)
28767
28768 /* At least one implementation is buggy: that of AIX 4.3 would
28769 give strnlen (S, 1) == 3. */
28770
28771 int i;
28772 for (i = 0; i < S_LEN + 1; ++i)
28773 {
28774 int expected = i <= S_LEN ? i : S_LEN;
28775 if (strnlen (S, i) != expected)
28776 return 1;
28777 }
28778 return 0;
28779
28780 ;
28781 return 0;
28782}
28783_ACEOF
28784if ac_fn_c_try_run "$LINENO"; then :
28785 ac_cv_func_strnlen_working=yes
28786else
28787 ac_cv_func_strnlen_working=no
28788fi
28789rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28790 conftest.$ac_objext conftest.beam conftest.$ac_ext
28791fi
28792
28793fi
28794{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5
28795$as_echo "$ac_cv_func_strnlen_working" >&6; }
28796test $ac_cv_func_strnlen_working = no && :
28797
28798
28799 if test $ac_cv_func_strnlen_working = no; then
28800 REPLACE_STRNLEN=1
28801 fi
28802 fi
28803
28804 if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
28805
28806
28807
28808
28809
28810
28811
28812
28813 gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
28814
28815 :
28816 fi
28817
28818
28819
28820
28821
28822 GNULIB_STRNLEN=1
28823
28824
28825
28826
28827
28828$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
28829
28830
28831
28832
28833
63ce7108
TT
28834 if test $REPLACE_STRSTR = 0; then
28835 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
28836$as_echo_n "checking whether strstr works in linear time... " >&6; }
d0ac1c44 28837if ${gl_cv_func_strstr_linear+:} false; then :
63ce7108
TT
28838 $as_echo_n "(cached) " >&6
28839else
28840 if test "$cross_compiling" = yes; then :
28841 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28842/* end confdefs.h. */
28843
28844#include <features.h>
28845#ifdef __GNU_LIBRARY__
28846 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
28847 && !(defined __i386__ || defined __x86_64__) \
28848 && !defined __UCLIBC__
28849 Lucky user
28850 #endif
28851#endif
28852#ifdef __CYGWIN__
28853 #include <cygwin/version.h>
28854 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
28855 Lucky user
28856 #endif
28857#endif
28858
28859_ACEOF
28860if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28861 $EGREP "Lucky user" >/dev/null 2>&1; then :
28862 gl_cv_func_strstr_linear="guessing yes"
c971b7fa 28863else
c0c3707f 28864 gl_cv_func_strstr_linear="$gl_cross_guess_normal"
c971b7fa
PA
28865fi
28866rm -f conftest*
28867
28868
28869else
28870 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28871/* end confdefs.h. */
28872
49e4877c
PA
28873#ifdef __MVS__
28874/* z/OS does not deliver signals while strstr() is running (thanks to
28875 restrictions on its LE runtime), which prevents us from limiting the
28876 running time of this test. */
28877# error "This test does not work properly on z/OS"
28878#endif
c971b7fa 28879#include <signal.h> /* for signal */
63ce7108 28880#include <string.h> /* for strstr */
c971b7fa
PA
28881#include <stdlib.h> /* for malloc */
28882#include <unistd.h> /* for alarm */
49e4877c 28883static void quit (int sig) { _exit (sig + 128); }
c971b7fa
PA
28884
28885int
28886main ()
28887{
28888
28889 int result = 0;
28890 size_t m = 1000000;
63ce7108
TT
28891 char *haystack = (char *) malloc (2 * m + 2);
28892 char *needle = (char *) malloc (m + 2);
c971b7fa 28893 /* Failure to compile this test due to missing alarm is okay,
63ce7108 28894 since all such platforms (mingw) also have quadratic strstr. */
c971b7fa
PA
28895 signal (SIGALRM, quit);
28896 alarm (5);
28897 /* Check for quadratic performance. */
28898 if (haystack && needle)
28899 {
28900 memset (haystack, 'A', 2 * m);
28901 haystack[2 * m] = 'B';
63ce7108 28902 haystack[2 * m + 1] = 0;
c971b7fa
PA
28903 memset (needle, 'A', m);
28904 needle[m] = 'B';
63ce7108
TT
28905 needle[m + 1] = 0;
28906 if (!strstr (haystack, needle))
c971b7fa
PA
28907 result |= 1;
28908 }
c0c3707f
CB
28909 /* Free allocated memory, in case some sanitizer is watching. */
28910 free (haystack);
28911 free (needle);
c971b7fa
PA
28912 return result;
28913
28914 ;
28915 return 0;
28916}
28917_ACEOF
28918if ac_fn_c_try_run "$LINENO"; then :
63ce7108 28919 gl_cv_func_strstr_linear=yes
c971b7fa 28920else
63ce7108 28921 gl_cv_func_strstr_linear=no
c971b7fa
PA
28922fi
28923rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28924 conftest.$ac_objext conftest.beam conftest.$ac_ext
28925fi
28926
28927
28928fi
63ce7108
TT
28929{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
28930$as_echo "$gl_cv_func_strstr_linear" >&6; }
28931 case "$gl_cv_func_strstr_linear" in
40a73391
JK
28932 *yes) ;;
28933 *)
63ce7108 28934 REPLACE_STRSTR=1
40a73391
JK
28935 ;;
28936 esac
c971b7fa
PA
28937 fi
28938
63ce7108 28939 if test $REPLACE_STRSTR = 1; then
c971b7fa
PA
28940
28941
28942
28943
28944
28945
28946
28947
63ce7108 28948 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
c971b7fa 28949
a512b375 28950 fi
c971b7fa
PA
28951
28952
28953
9c9d63b1 28954 if test $REPLACE_MEMCHR = 1; then
63ce7108 28955 REPLACE_STRSTR=1
c971b7fa 28956 else
c0c3707f 28957 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
63ce7108 28958$as_echo_n "checking whether strstr works... " >&6; }
d0ac1c44 28959if ${gl_cv_func_strstr_works_always+:} false; then :
c971b7fa
PA
28960 $as_echo_n "(cached) " >&6
28961else
28962 if test "$cross_compiling" = yes; then :
c0c3707f 28963 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
28964/* end confdefs.h. */
28965
28966#ifdef __GNU_LIBRARY__
28967 #include <features.h>
63ce7108 28968 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
c971b7fa
PA
28969 || defined __UCLIBC__
28970 Lucky user
28971 #endif
28972#elif defined __CYGWIN__
28973 #include <cygwin/version.h>
28974 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
28975 Lucky user
28976 #endif
28977#else
28978 Lucky user
28979#endif
28980
28981_ACEOF
28982if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28983 $EGREP "Lucky user" >/dev/null 2>&1; then :
63ce7108 28984 gl_cv_func_strstr_works_always="guessing yes"
c971b7fa 28985else
c0c3707f 28986 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
c971b7fa
PA
28987fi
28988rm -f conftest*
28989
28990
28991else
28992 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28993/* end confdefs.h. */
28994
63ce7108 28995#include <string.h> /* for strstr */
c0c3707f
CB
28996#ifdef __GNU_LIBRARY__
28997 #include <features.h>
28998 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
28999 Unlucky user
29000 #endif
29001#endif
c971b7fa
PA
29002#define P "_EF_BF_BD"
29003#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
29004#define NEEDLE P P P P P
29005
29006int
29007main ()
29008{
63ce7108 29009return !!strstr (HAYSTACK, NEEDLE);
c971b7fa
PA
29010
29011 ;
29012 return 0;
29013}
29014_ACEOF
29015if ac_fn_c_try_run "$LINENO"; then :
63ce7108 29016 gl_cv_func_strstr_works_always=yes
c971b7fa 29017else
63ce7108 29018 gl_cv_func_strstr_works_always=no
c971b7fa
PA
29019fi
29020rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29021 conftest.$ac_objext conftest.beam conftest.$ac_ext
29022fi
29023
29024
29025fi
63ce7108
TT
29026{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
29027$as_echo "$gl_cv_func_strstr_works_always" >&6; }
29028 case "$gl_cv_func_strstr_works_always" in
40a73391
JK
29029 *yes) ;;
29030 *)
63ce7108 29031 REPLACE_STRSTR=1
40a73391
JK
29032 ;;
29033 esac
c971b7fa 29034 fi
8839a007 29035
63ce7108 29036 if test $REPLACE_STRSTR = 1; then
8839a007 29037
8690e634
JK
29038
29039
8690e634
JK
29040
29041
29042
29043
29044
63ce7108 29045 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
8690e634 29046
8690e634
JK
29047 fi
29048
8690e634
JK
29049
29050
8690e634 29051
8690e634 29052
63ce7108 29053 GNULIB_STRSTR=1
8690e634
JK
29054
29055
29056
8690e634
JK
29057
29058
63ce7108 29059$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
8690e634
JK
29060
29061
29062
29063
29064
29065
29066
421693b0
PA
29067 for ac_func in strtok_r
29068do :
29069 ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r"
d0ac1c44 29070if test "x$ac_cv_func_strtok_r" = xyes; then :
421693b0
PA
29071 cat >>confdefs.h <<_ACEOF
29072#define HAVE_STRTOK_R 1
29073_ACEOF
29074
29075fi
29076done
29077
29078 if test $ac_cv_func_strtok_r = yes; then
29079 HAVE_STRTOK_R=1
29080 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5
29081$as_echo_n "checking whether strtok_r works... " >&6; }
d0ac1c44 29082if ${gl_cv_func_strtok_r_works+:} false; then :
421693b0
PA
29083 $as_echo_n "(cached) " >&6
29084else
29085 if test "$cross_compiling" = yes; then :
c0c3707f
CB
29086 case "$host_os" in
29087 # Guess no on glibc systems.
29088 *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;;
29089 # Guess yes on native Windows.
29090 mingw*) gl_cv_func_strtok_r_works="guessing yes" ;;
29091 *) gl_cv_func_strtok_r_works="guessing yes" ;;
421693b0
PA
29092 esac
29093
29094else
29095 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29096/* end confdefs.h. */
29097
29098 #ifndef __OPTIMIZE__
29099 # define __OPTIMIZE__ 1
29100 #endif
29101 #undef __OPTIMIZE_SIZE__
29102 #undef __NO_INLINE__
29103 #include <stdlib.h>
29104 #include <string.h>
29105
29106int
29107main ()
29108{
29109static const char dummy[] = "\177\01a";
29110 char delimiters[] = "xxxxxxxx";
29111 char *save_ptr = (char *) dummy;
29112 strtok_r (delimiters, "x", &save_ptr);
29113 strtok_r (NULL, "x", &save_ptr);
29114 return 0;
29115
29116 ;
29117 return 0;
29118}
29119
29120_ACEOF
29121if ac_fn_c_try_run "$LINENO"; then :
29122 gl_cv_func_strtok_r_works=yes
29123else
29124 gl_cv_func_strtok_r_works=no
29125fi
29126rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29127 conftest.$ac_objext conftest.beam conftest.$ac_ext
29128fi
29129
29130
29131fi
29132{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5
29133$as_echo "$gl_cv_func_strtok_r_works" >&6; }
29134 case "$gl_cv_func_strtok_r_works" in
29135 *no)
29136 UNDEFINE_STRTOK_R=1
29137 ;;
29138 esac
29139 else
29140 HAVE_STRTOK_R=0
29141 fi
29142
29143 if test $ac_cv_have_decl_strtok_r = no; then
29144 HAVE_DECL_STRTOK_R=0
29145 fi
29146
29147 if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then
29148
29149
29150
29151
29152
29153
29154
29155
29156 gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext"
29157
29158
29159 :
29160
29161 fi
29162
29163
29164
29165
29166
29167 GNULIB_STRTOK_R=1
29168
29169
29170
29171
29172
29173$as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h
29174
29175
29176
29177
29178
29179
29180
8690e634
JK
29181
29182
29183
29184
29185
8690e634 29186
09607c9e 29187
698be2d8
CB
29188 if test $gl_cv_have_include_next = yes; then
29189 gl_cv_next_sys_random_h='<'sys/random.h'>'
29190 else
29191 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/random.h>" >&5
29192$as_echo_n "checking absolute name of <sys/random.h>... " >&6; }
29193if ${gl_cv_next_sys_random_h+:} false; then :
29194 $as_echo_n "(cached) " >&6
29195else
29196
29197 if test $ac_cv_header_sys_random_h = yes; then
29198
29199
29200
29201
29202 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29203/* end confdefs.h. */
29204#include <sys/random.h>
29205_ACEOF
29206 case "$host_os" in
29207 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29208 *) gl_absname_cpp="$ac_cpp" ;;
29209 esac
29210
29211 case "$host_os" in
29212 mingw*)
29213 gl_dirsep_regex='[/\\]'
29214 ;;
29215 *)
29216 gl_dirsep_regex='\/'
29217 ;;
29218 esac
29219 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29220 gl_header_literal_regex=`echo 'sys/random.h' \
29221 | sed -e "$gl_make_literal_regex_sed"`
29222 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29223 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29224 s|^/[^/]|//&|
29225 p
29226 q
29227 }'
29228
29229 gl_cv_absolute_sys_random_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29230 sed -n "$gl_absolute_header_sed"`
29231
29232 gl_header=$gl_cv_absolute_sys_random_h
29233 gl_cv_next_sys_random_h='"'$gl_header'"'
29234 else
29235 gl_cv_next_sys_random_h='<'sys/random.h'>'
29236 fi
29237
29238
29239fi
29240{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_random_h" >&5
29241$as_echo "$gl_cv_next_sys_random_h" >&6; }
29242 fi
29243 NEXT_SYS_RANDOM_H=$gl_cv_next_sys_random_h
29244
29245 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29246 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29247 gl_next_as_first_directive='<'sys/random.h'>'
29248 else
29249 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29250 gl_next_as_first_directive=$gl_cv_next_sys_random_h
29251 fi
29252 NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H=$gl_next_as_first_directive
29253
29254
29255
29256
29257 if test $ac_cv_header_sys_random_h = yes; then
29258 HAVE_SYS_RANDOM_H=1
29259 else
29260 HAVE_SYS_RANDOM_H=0
29261 fi
29262
29263
29264
29265 if test $ac_cv_header_sys_random_h = yes; then
29266 UNISTD_H_HAVE_SYS_RANDOM_H=1
29267 fi
29268
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
725e2999
JB
29285
29286
09607c9e
TT
29287
29288
29289
29290 if test $gl_cv_have_include_next = yes; then
29291 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
29292 else
29293 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
29294$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
d0ac1c44 29295if ${gl_cv_next_sys_stat_h+:} false; then :
09607c9e
TT
29296 $as_echo_n "(cached) " >&6
29297else
29298
29299 if test $ac_cv_header_sys_stat_h = yes; then
29300
29301
4a626d0a
PA
29302
29303
29304 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
09607c9e
TT
29305/* end confdefs.h. */
29306#include <sys/stat.h>
09607c9e 29307_ACEOF
4a626d0a
PA
29308 case "$host_os" in
29309 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29310 *) gl_absname_cpp="$ac_cpp" ;;
29311 esac
29312
29313 case "$host_os" in
29314 mingw*)
29315 gl_dirsep_regex='[/\\]'
29316 ;;
29317 *)
29318 gl_dirsep_regex='\/'
29319 ;;
29320 esac
29321 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29322 gl_header_literal_regex=`echo 'sys/stat.h' \
29323 | sed -e "$gl_make_literal_regex_sed"`
29324 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29325 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29326 s|^/[^/]|//&|
29327 p
29328 q
29329 }'
29330
29331 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29332 sed -n "$gl_absolute_header_sed"`
29333
29334 gl_header=$gl_cv_absolute_sys_stat_h
29335 gl_cv_next_sys_stat_h='"'$gl_header'"'
09607c9e
TT
29336 else
29337 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
29338 fi
29339
29340
29341fi
29342{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
29343$as_echo "$gl_cv_next_sys_stat_h" >&6; }
29344 fi
29345 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
29346
29347 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29348 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29349 gl_next_as_first_directive='<'sys/stat.h'>'
29350 else
29351 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29352 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
29353 fi
29354 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
29355
29356
29357
29358
29359
29360
29361
29362
c0c3707f
CB
29363 WINDOWS_STAT_TIMESPEC=0
29364
29365
2196f55f 29366
09607c9e
TT
29367
29368
09607c9e 29369
09607c9e 29370
09607c9e
TT
29371
29372 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
29373 #include <sys/stat.h>
29374"
d0ac1c44 29375if test "x$ac_cv_type_nlink_t" = xyes; then :
09607c9e
TT
29376
29377else
29378
c0c3707f 29379$as_echo "#define nlink_t int" >>confdefs.h
09607c9e 29380
c0c3707f 29381fi
09607c9e
TT
29382
29383
29384
29385
29386
29387
29388
29389
29390
29391
725e2999
JB
29392
29393
29394
29395
29396
29397
725e2999
JB
29398
29399
29400
29401
29402
698be2d8
CB
29403
29404
725e2999
JB
29405
29406
29407
29408 if test $gl_cv_have_include_next = yes; then
29409 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
29410 else
29411 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
29412$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
29413if ${gl_cv_next_sys_uio_h+:} false; then :
29414 $as_echo_n "(cached) " >&6
29415else
29416
29417 if test $ac_cv_header_sys_uio_h = yes; then
29418
29419
29420
29421
29422 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29423/* end confdefs.h. */
29424#include <sys/uio.h>
29425_ACEOF
29426 case "$host_os" in
29427 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29428 *) gl_absname_cpp="$ac_cpp" ;;
29429 esac
29430
29431 case "$host_os" in
29432 mingw*)
29433 gl_dirsep_regex='[/\\]'
29434 ;;
29435 *)
29436 gl_dirsep_regex='\/'
29437 ;;
29438 esac
29439 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29440 gl_header_literal_regex=`echo 'sys/uio.h' \
29441 | sed -e "$gl_make_literal_regex_sed"`
29442 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29443 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29444 s|^/[^/]|//&|
29445 p
29446 q
29447 }'
29448
29449 gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29450 sed -n "$gl_absolute_header_sed"`
29451
29452 gl_header=$gl_cv_absolute_sys_uio_h
29453 gl_cv_next_sys_uio_h='"'$gl_header'"'
29454 else
29455 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
29456 fi
29457
29458
29459fi
29460{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
29461$as_echo "$gl_cv_next_sys_uio_h" >&6; }
29462 fi
29463 NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
29464
29465 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29466 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29467 gl_next_as_first_directive='<'sys/uio.h'>'
29468 else
29469 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29470 gl_next_as_first_directive=$gl_cv_next_sys_uio_h
29471 fi
29472 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
29473
29474
29475
29476
29477 if test $ac_cv_header_sys_uio_h = yes; then
29478 HAVE_SYS_UIO_H=1
29479 else
29480 HAVE_SYS_UIO_H=0
29481 fi
29482
29483
29484
29485
29486
2d8adcbd
MM
29487 :
29488
29489
29490
29491
9c9d63b1
PM
29492cat >>confdefs.h <<_ACEOF
29493#define GNULIB_TEMPNAME 1
29494_ACEOF
29495
29496
29497
29498
09607c9e
TT
29499
29500
29501
8839a007
PA
29502
29503
29504
29505
09607c9e 29506
c0c3707f
CB
29507 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,
29508 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29509 been included before. */
29510 #if defined __MINGW32__
29511 # include <unistd.h>
29512 #endif
29513 #include <time.h>
09607c9e 29514
f8e27d88
CB
29515"
29516if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
29517 ac_have_decl=1
29518else
29519 ac_have_decl=0
29520fi
29521
29522cat >>confdefs.h <<_ACEOF
29523#define HAVE_DECL_LOCALTIME_R $ac_have_decl
29524_ACEOF
29525
29526 if test $ac_cv_have_decl_localtime_r = no; then
29527 HAVE_DECL_LOCALTIME_R=0
29528 fi
29529
29530
f8e27d88
CB
29531 if test $ac_cv_func_localtime_r = yes; then
29532 HAVE_LOCALTIME_R=1
29533 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
29534$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
29535if ${gl_cv_time_r_posix+:} false; then :
29536 $as_echo_n "(cached) " >&6
29537else
29538 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29539/* end confdefs.h. */
c0c3707f
CB
29540/* mingw's <time.h> provides the functions asctime_r, ctime_r,
29541 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29542 been included before. */
29543 #if defined __MINGW32__
29544 # include <unistd.h>
29545 #endif
29546 #include <time.h>
29547
f8e27d88
CB
29548int
29549main ()
29550{
29551/* We don't need to append 'restrict's to the argument types,
29552 even though the POSIX signature has the 'restrict's,
29553 since C99 says they can't affect type compatibility. */
29554 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
29555 if (ptr) return 0;
29556 /* Check the return type is a pointer.
29557 On HP-UX 10 it is 'int'. */
29558 *localtime_r (0, 0);
29559 ;
29560 return 0;
29561}
29562
29563_ACEOF
29564if ac_fn_c_try_compile "$LINENO"; then :
29565 gl_cv_time_r_posix=yes
29566else
29567 gl_cv_time_r_posix=no
29568fi
29569rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29570
29571fi
29572{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
29573$as_echo "$gl_cv_time_r_posix" >&6; }
29574 if test $gl_cv_time_r_posix = yes; then
29575 REPLACE_LOCALTIME_R=0
29576 else
29577 REPLACE_LOCALTIME_R=1
29578 fi
29579 else
29580 HAVE_LOCALTIME_R=0
c0c3707f
CB
29581 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5
29582$as_echo_n "checking whether localtime_r exists as an inline function... " >&6; }
29583if ${gl_cv_func_localtime_r_inline+:} false; then :
29584 $as_echo_n "(cached) " >&6
29585else
29586 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29587/* end confdefs.h. */
29588/* mingw's <time.h> provides the functions asctime_r, ctime_r,
29589 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29590 been included before. */
29591 #if defined __MINGW32__
29592 # include <unistd.h>
29593 #endif
29594 #include <time.h>
29595
29596int
29597main ()
29598{
29599time_t a;
29600 struct tm r;
29601 localtime_r (&a, &r);
29602
29603 ;
29604 return 0;
29605}
29606
29607_ACEOF
29608if ac_fn_c_try_link "$LINENO"; then :
29609 gl_cv_func_localtime_r_inline=yes
29610else
29611 gl_cv_func_localtime_r_inline=no
29612fi
29613rm -f core conftest.err conftest.$ac_objext \
29614 conftest$ac_exeext conftest.$ac_ext
29615
29616fi
29617{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5
29618$as_echo "$gl_cv_func_localtime_r_inline" >&6; }
29619 if test $gl_cv_func_localtime_r_inline = yes; then
29620 REPLACE_LOCALTIME_R=1
29621 fi
f8e27d88
CB
29622 fi
29623
29624 if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
29625
29626
29627
29628
29629
29630
29631
29632
29633 gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
29634
29635
29636 :
29637
29638 fi
29639
29640
29641
29642
29643
29644 GNULIB_TIME_R=1
29645
29646
29647
29648
29649
29650$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
29651
29652
29653
29654
29655
29656
29657
29658
29659
5abebf3c
CB
29660
29661
29662
8839a007
PA
29663
29664
29665
29666 if test $gl_cv_have_include_next = yes; then
29667 gl_cv_next_unistd_h='<'unistd.h'>'
29668 else
29669 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
29670$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
d0ac1c44 29671if ${gl_cv_next_unistd_h+:} false; then :
8839a007
PA
29672 $as_echo_n "(cached) " >&6
29673else
29674
29675 if test $ac_cv_header_unistd_h = yes; then
29676
29677
4a626d0a
PA
29678
29679
29680 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8839a007
PA
29681/* end confdefs.h. */
29682#include <unistd.h>
8839a007 29683_ACEOF
4a626d0a
PA
29684 case "$host_os" in
29685 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29686 *) gl_absname_cpp="$ac_cpp" ;;
29687 esac
29688
29689 case "$host_os" in
29690 mingw*)
29691 gl_dirsep_regex='[/\\]'
29692 ;;
29693 *)
29694 gl_dirsep_regex='\/'
29695 ;;
29696 esac
29697 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29698 gl_header_literal_regex=`echo 'unistd.h' \
29699 | sed -e "$gl_make_literal_regex_sed"`
29700 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29701 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29702 s|^/[^/]|//&|
29703 p
29704 q
29705 }'
29706
29707 gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29708 sed -n "$gl_absolute_header_sed"`
29709
29710 gl_header=$gl_cv_absolute_unistd_h
29711 gl_cv_next_unistd_h='"'$gl_header'"'
8839a007
PA
29712 else
29713 gl_cv_next_unistd_h='<'unistd.h'>'
29714 fi
29715
29716
29717fi
29718{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
29719$as_echo "$gl_cv_next_unistd_h" >&6; }
29720 fi
29721 NEXT_UNISTD_H=$gl_cv_next_unistd_h
29722
29723 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29724 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29725 gl_next_as_first_directive='<'unistd.h'>'
29726 else
29727 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29728 gl_next_as_first_directive=$gl_cv_next_unistd_h
29729 fi
29730 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
29731
29732
29733
29734
29735 if test $ac_cv_header_unistd_h = yes; then
29736 HAVE_UNISTD_H=1
29737 else
29738 HAVE_UNISTD_H=0
29739 fi
29740
29741
29742
29743
29744
29745
29746
472fa5ee
SM
29747
29748
29749
29750
29751
8839a007 29752
9c9d63b1
PM
29753 if test $ac_cv_have_decl_execvpe = no; then
29754 HAVE_DECL_EXECVPE=0
29755 fi
29756
29757
6ec2e0f5
SDJ
29758
29759
29760
698be2d8
CB
29761
29762
3d99e817
AK
29763 if test $ac_cv_have_decl_unsetenv = no; then
29764 HAVE_DECL_UNSETENV=0
29765 fi
29766 for ac_func in unsetenv
29767do :
29768 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
d0ac1c44 29769if test "x$ac_cv_func_unsetenv" = xyes; then :
3d99e817
AK
29770 cat >>confdefs.h <<_ACEOF
29771#define HAVE_UNSETENV 1
29772_ACEOF
29773
29774fi
29775done
29776
29777 if test $ac_cv_func_unsetenv = no; then
29778 HAVE_UNSETENV=0
29779 else
29780 HAVE_UNSETENV=1
29781 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
29782$as_echo_n "checking for unsetenv() return type... " >&6; }
d0ac1c44 29783if ${gt_cv_func_unsetenv_ret+:} false; then :
3d99e817
AK
29784 $as_echo_n "(cached) " >&6
29785else
29786 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29787/* end confdefs.h. */
29788
29789#undef _BSD
29790#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
29791#include <stdlib.h>
29792extern
29793#ifdef __cplusplus
29794"C"
29795#endif
29796int unsetenv (const char *name);
29797
29798int
29799main ()
29800{
29801
29802 ;
29803 return 0;
29804}
29805_ACEOF
29806if ac_fn_c_try_compile "$LINENO"; then :
29807 gt_cv_func_unsetenv_ret='int'
29808else
29809 gt_cv_func_unsetenv_ret='void'
29810fi
29811rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29812fi
29813{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
29814$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
29815 if test $gt_cv_func_unsetenv_ret = 'void'; then
29816
29817$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
29818
29819 REPLACE_UNSETENV=1
29820 fi
29821
29822 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
29823$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
d0ac1c44 29824if ${gl_cv_func_unsetenv_works+:} false; then :
3d99e817
AK
29825 $as_echo_n "(cached) " >&6
29826else
29827 if test "$cross_compiling" = yes; then :
29828 case "$host_os" in
9c9d63b1
PM
29829 # Guess yes on glibc systems.
29830 *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
29831 # If we don't know, obey --enable-cross-guesses.
29832 *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
29833 esac
3d99e817
AK
29834
29835else
29836 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29837/* end confdefs.h. */
29838
9c9d63b1
PM
29839 #include <stdlib.h>
29840 #include <errno.h>
29841 extern char **environ;
29842
29843
29844$gl_mda_defines
3d99e817
AK
29845
29846int
29847main ()
29848{
29849
9c9d63b1
PM
29850 char entry1[] = "a=1";
29851 char entry2[] = "b=2";
29852 char *env[] = { entry1, entry2, NULL };
29853 if (putenv ((char *) "a=1")) return 1;
29854 if (putenv (entry2)) return 2;
29855 entry2[0] = 'a';
29856 unsetenv ("a");
29857 if (getenv ("a")) return 3;
29858 if (!unsetenv ("") || errno != EINVAL) return 4;
29859 entry2[0] = 'b';
29860 environ = env;
29861 if (!getenv ("a")) return 5;
29862 entry2[0] = 'a';
29863 unsetenv ("a");
29864 if (getenv ("a")) return 6;
3d99e817
AK
29865
29866 ;
29867 return 0;
29868}
29869_ACEOF
29870if ac_fn_c_try_run "$LINENO"; then :
29871 gl_cv_func_unsetenv_works=yes
29872else
29873 gl_cv_func_unsetenv_works=no
29874fi
29875rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29876 conftest.$ac_objext conftest.beam conftest.$ac_ext
29877fi
29878
9c9d63b1 29879
3d99e817
AK
29880fi
29881{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
29882$as_echo "$gl_cv_func_unsetenv_works" >&6; }
29883 case "$gl_cv_func_unsetenv_works" in
29884 *yes) ;;
29885 *)
29886 REPLACE_UNSETENV=1
29887 ;;
29888 esac
29889 fi
29890
29891 if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
29892
29893
29894
29895
29896
29897
29898
29899
29900 gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
29901
29902
29903
29904
29905
29906 fi
29907
29908
29909
29910
29911
29912 GNULIB_UNSETENV=1
29913
29914
29915
29916
29917
29918$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
29919
29920
29921
29922
29923
29924
8839a007
PA
29925
29926
29927
29928
29929
29930
29931
8690e634
JK
29932
29933
29934 if test $gl_cv_have_include_next = yes; then
29935 gl_cv_next_wchar_h='<'wchar.h'>'
29936 else
29937 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
29938$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
d0ac1c44 29939if ${gl_cv_next_wchar_h+:} false; then :
8690e634
JK
29940 $as_echo_n "(cached) " >&6
29941else
29942
29943 if test $ac_cv_header_wchar_h = yes; then
29944
29945
4a626d0a
PA
29946
29947
29948 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
29949/* end confdefs.h. */
29950#include <wchar.h>
8690e634 29951_ACEOF
4a626d0a
PA
29952 case "$host_os" in
29953 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29954 *) gl_absname_cpp="$ac_cpp" ;;
29955 esac
29956
29957 case "$host_os" in
29958 mingw*)
29959 gl_dirsep_regex='[/\\]'
29960 ;;
29961 *)
29962 gl_dirsep_regex='\/'
29963 ;;
29964 esac
29965 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29966 gl_header_literal_regex=`echo 'wchar.h' \
29967 | sed -e "$gl_make_literal_regex_sed"`
29968 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29969 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29970 s|^/[^/]|//&|
29971 p
29972 q
29973 }'
29974
29975 gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29976 sed -n "$gl_absolute_header_sed"`
29977
29978 gl_header=$gl_cv_absolute_wchar_h
29979 gl_cv_next_wchar_h='"'$gl_header'"'
8690e634
JK
29980 else
29981 gl_cv_next_wchar_h='<'wchar.h'>'
29982 fi
29983
29984
29985fi
29986{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
29987$as_echo "$gl_cv_next_wchar_h" >&6; }
29988 fi
29989 NEXT_WCHAR_H=$gl_cv_next_wchar_h
29990
29991 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29992 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29993 gl_next_as_first_directive='<'wchar.h'>'
29994 else
29995 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29996 gl_next_as_first_directive=$gl_cv_next_wchar_h
29997 fi
29998 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
29999
30000
30001
30002
30003 if test $ac_cv_header_wchar_h = yes; then
30004 HAVE_WCHAR_H=1
30005 else
30006 HAVE_WCHAR_H=0
30007 fi
30008
c971b7fa
PA
30009
30010
30011
30012
8690e634
JK
30013 if test $gt_cv_c_wint_t = yes; then
30014 HAVE_WINT_T=1
30015 else
30016 HAVE_WINT_T=0
30017 fi
c971b7fa
PA
30018
30019
30020
8690e634
JK
30021
30022
30023
30024
30025
472fa5ee
SM
30026
30027
9c9d63b1
PM
30028 ac_fn_c_check_decl "$LINENO" "wcsdup" "ac_cv_have_decl_wcsdup" "
30029 #include <wchar.h>
30030
30031"
30032if test "x$ac_cv_have_decl_wcsdup" = xyes; then :
30033 ac_have_decl=1
30034else
30035 ac_have_decl=0
30036fi
30037
30038cat >>confdefs.h <<_ACEOF
30039#define HAVE_DECL_WCSDUP $ac_have_decl
30040_ACEOF
30041
30042 if test $ac_cv_have_decl_wcsdup = no; then
30043 HAVE_DECL_WCSDUP=0
30044 fi
30045
472fa5ee
SM
30046
30047
30048
698be2d8
CB
30049
30050
8690e634
JK
30051 if test $ac_cv_func_iswcntrl = yes; then
30052 HAVE_ISWCNTRL=1
30053 else
30054 HAVE_ISWCNTRL=0
30055 fi
30056
30057
30058
8690e634
JK
30059 if test $gt_cv_c_wint_t = yes; then
30060 HAVE_WINT_T=1
30061 else
30062 HAVE_WINT_T=0
30063 fi
30064
30065
30066
30067
30068
30069
c971b7fa 30070
8690e634 30071
472fa5ee
SM
30072
30073
c971b7fa
PA
30074
30075
30076
30077 if test $gl_cv_have_include_next = yes; then
8690e634 30078 gl_cv_next_wctype_h='<'wctype.h'>'
c971b7fa 30079 else
8690e634
JK
30080 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
30081$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
d0ac1c44 30082if ${gl_cv_next_wctype_h+:} false; then :
c971b7fa
PA
30083 $as_echo_n "(cached) " >&6
30084else
30085
8690e634
JK
30086 if test $ac_cv_header_wctype_h = yes; then
30087
30088
4a626d0a
PA
30089
30090
30091 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 30092/* end confdefs.h. */
8690e634 30093#include <wctype.h>
c971b7fa 30094_ACEOF
4a626d0a
PA
30095 case "$host_os" in
30096 aix*) gl_absname_cpp="$ac_cpp -C" ;;
30097 *) gl_absname_cpp="$ac_cpp" ;;
30098 esac
30099
30100 case "$host_os" in
30101 mingw*)
30102 gl_dirsep_regex='[/\\]'
30103 ;;
30104 *)
30105 gl_dirsep_regex='\/'
30106 ;;
30107 esac
30108 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
30109 gl_header_literal_regex=`echo 'wctype.h' \
30110 | sed -e "$gl_make_literal_regex_sed"`
30111 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
30112 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
30113 s|^/[^/]|//&|
30114 p
30115 q
30116 }'
30117
30118 gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
30119 sed -n "$gl_absolute_header_sed"`
30120
30121 gl_header=$gl_cv_absolute_wctype_h
30122 gl_cv_next_wctype_h='"'$gl_header'"'
8690e634
JK
30123 else
30124 gl_cv_next_wctype_h='<'wctype.h'>'
30125 fi
c971b7fa
PA
30126
30127
30128fi
8690e634
JK
30129{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
30130$as_echo "$gl_cv_next_wctype_h" >&6; }
c971b7fa 30131 fi
8690e634 30132 NEXT_WCTYPE_H=$gl_cv_next_wctype_h
c971b7fa
PA
30133
30134 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
30135 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8690e634 30136 gl_next_as_first_directive='<'wctype.h'>'
c971b7fa
PA
30137 else
30138 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8690e634 30139 gl_next_as_first_directive=$gl_cv_next_wctype_h
c971b7fa 30140 fi
8690e634
JK
30141 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
30142
30143
30144
30145
30146 if test $ac_cv_header_wctype_h = yes; then
30147 if test $ac_cv_func_iswcntrl = yes; then
30148 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
30149$as_echo_n "checking whether iswcntrl works... " >&6; }
d0ac1c44 30150if ${gl_cv_func_iswcntrl_works+:} false; then :
8690e634
JK
30151 $as_echo_n "(cached) " >&6
30152else
30153
30154 if test "$cross_compiling" = yes; then :
c0c3707f 30155 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
30156/* end confdefs.h. */
30157#include <stdlib.h>
30158 #if __GNU_LIBRARY__ == 1
30159 Linux libc5 i18n is broken.
30160 #endif
30161int
30162main ()
30163{
30164
30165 ;
30166 return 0;
30167}
30168_ACEOF
30169if ac_fn_c_try_compile "$LINENO"; then :
30170 gl_cv_func_iswcntrl_works="guessing yes"
30171else
30172 gl_cv_func_iswcntrl_works="guessing no"
30173fi
30174rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
30175
30176else
30177 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30178/* end confdefs.h. */
30179
8690e634
JK
30180 #include <wchar.h>
30181 #include <wctype.h>
30182 int main () { return iswprint ('x') == 0; }
30183
30184_ACEOF
30185if ac_fn_c_try_run "$LINENO"; then :
30186 gl_cv_func_iswcntrl_works=yes
30187else
30188 gl_cv_func_iswcntrl_works=no
30189fi
30190rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
30191 conftest.$ac_objext conftest.beam conftest.$ac_ext
30192fi
30193
30194
30195fi
30196{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
30197$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
30198 fi
30199 HAVE_WCTYPE_H=1
30200 else
30201 HAVE_WCTYPE_H=0
30202 fi
30203
30204
c0c3707f
CB
30205 if test $GNULIB_OVERRIDES_WINT_T = 1; then
30206 REPLACE_ISWCNTRL=1
30207 else
30208 case "$gl_cv_func_iswcntrl_works" in
30209 *yes) REPLACE_ISWCNTRL=0 ;;
30210 *) REPLACE_ISWCNTRL=1 ;;
30211 esac
30212 fi
8690e634
JK
30213
30214
30215 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
30216 :
30217 fi
30218
30219 if test $REPLACE_ISWCNTRL = 1; then
30220 REPLACE_TOWLOWER=1
30221 else
30222 for ac_func in towlower
30223do :
30224 ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
d0ac1c44 30225if test "x$ac_cv_func_towlower" = xyes; then :
8690e634
JK
30226 cat >>confdefs.h <<_ACEOF
30227#define HAVE_TOWLOWER 1
30228_ACEOF
30229
30230fi
30231done
30232
30233 if test $ac_cv_func_towlower = yes; then
30234 REPLACE_TOWLOWER=0
30235 else
9c9d63b1 30236 ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include <wchar.h>
8690e634
JK
30237 #if HAVE_WCTYPE_H
30238 # include <wctype.h>
30239 #endif
30240
30241"
d0ac1c44 30242if test "x$ac_cv_have_decl_towlower" = xyes; then :
8690e634
JK
30243 ac_have_decl=1
30244else
30245 ac_have_decl=0
30246fi
30247
30248cat >>confdefs.h <<_ACEOF
30249#define HAVE_DECL_TOWLOWER $ac_have_decl
30250_ACEOF
30251
30252 if test $ac_cv_have_decl_towlower = yes; then
30253 REPLACE_TOWLOWER=1
30254 else
30255 REPLACE_TOWLOWER=0
30256 fi
30257 fi
30258 fi
30259
30260
30261 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
30262 :
30263 fi
30264
30265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
30266$as_echo_n "checking for wctype_t... " >&6; }
d0ac1c44 30267if ${gl_cv_type_wctype_t+:} false; then :
8690e634
JK
30268 $as_echo_n "(cached) " >&6
30269else
30270 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30271/* end confdefs.h. */
9c9d63b1 30272#include <wchar.h>
8690e634
JK
30273 #if HAVE_WCTYPE_H
30274 # include <wctype.h>
30275 #endif
30276 wctype_t a;
30277
30278int
30279main ()
30280{
30281
30282 ;
30283 return 0;
30284}
30285_ACEOF
30286if ac_fn_c_try_compile "$LINENO"; then :
30287 gl_cv_type_wctype_t=yes
30288else
30289 gl_cv_type_wctype_t=no
30290fi
30291rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 30292
8690e634
JK
30293fi
30294{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
30295$as_echo "$gl_cv_type_wctype_t" >&6; }
30296 if test $gl_cv_type_wctype_t = no; then
30297 HAVE_WCTYPE_T=0
30298 fi
30299
30300 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
30301$as_echo_n "checking for wctrans_t... " >&6; }
d0ac1c44 30302if ${gl_cv_type_wctrans_t+:} false; then :
8690e634
JK
30303 $as_echo_n "(cached) " >&6
30304else
30305 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30306/* end confdefs.h. */
9c9d63b1 30307#include <wchar.h>
8690e634
JK
30308 #include <wctype.h>
30309 wctrans_t a;
c971b7fa 30310
8690e634
JK
30311int
30312main ()
30313{
c971b7fa 30314
8690e634
JK
30315 ;
30316 return 0;
30317}
30318_ACEOF
30319if ac_fn_c_try_compile "$LINENO"; then :
30320 gl_cv_type_wctrans_t=yes
30321else
30322 gl_cv_type_wctrans_t=no
30323fi
30324rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 30325
8690e634
JK
30326fi
30327{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
30328$as_echo "$gl_cv_type_wctrans_t" >&6; }
30329 if test $gl_cv_type_wctrans_t = no; then
30330 HAVE_WCTRANS_T=0
c971b7fa
PA
30331 fi
30332
30333
5e8754f9 30334
5e8754f9 30335
c971b7fa 30336
c0c3707f
CB
30337
30338 case "$host_os" in
30339 mingw*)
30340
30341
30342
30343
30344
30345
30346
30347
30348 gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext"
30349
30350 ;;
30351 esac
30352
30353 case "$host_os" in
30354 mingw*)
30355
30356
30357
30358
30359
30360
30361
30362
30363 gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext"
30364
30365 ;;
30366 esac
30367
30368 case "$host_os" in
30369 mingw*)
30370
30371
c971b7fa
PA
30372
30373
c0c3707f
CB
30374
30375
30376
30377
30378 gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext"
30379
30380 ;;
30381 esac
30382
30383 case "$host_os" in
30384 mingw*)
30385
30386
30387
30388
30389
30390
30391
30392
30393 gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext"
30394
30395 ;;
30396 esac
698be2d8
CB
30397
30398
30399 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wmemchr" >&5
30400$as_echo_n "checking for wmemchr... " >&6; }
30401if ${gl_cv_func_wmemchr+:} false; then :
30402 $as_echo_n "(cached) " >&6
30403else
30404 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30405/* end confdefs.h. */
698be2d8
CB
30406#include <wchar.h>
30407
30408int
30409main ()
30410{
30411return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0);
30412 ;
30413 return 0;
30414}
30415
30416_ACEOF
30417if ac_fn_c_try_link "$LINENO"; then :
30418 gl_cv_func_wmemchr=yes
30419else
30420 gl_cv_func_wmemchr=no
30421fi
30422rm -f core conftest.err conftest.$ac_objext \
30423 conftest$ac_exeext conftest.$ac_ext
30424
30425fi
30426{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wmemchr" >&5
30427$as_echo "$gl_cv_func_wmemchr" >&6; }
30428 if test $gl_cv_func_wmemchr = no; then
30429 HAVE_WMEMCHR=0
30430 fi
30431
30432 if test $HAVE_WMEMCHR = 0; then
30433
30434
30435
30436
30437
30438
30439
30440
30441 gl_LIBOBJS="$gl_LIBOBJS wmemchr.$ac_objext"
30442
30443 fi
30444
30445
30446
30447
30448
30449 GNULIB_WMEMCHR=1
30450
30451
30452
30453
30454
30455$as_echo "#define GNULIB_TEST_WMEMCHR 1" >>confdefs.h
30456
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467 if test $ac_cv_func_wmempcpy = no; then
30468 HAVE_WMEMPCPY=0
30469 fi
30470
30471 if test $HAVE_WMEMPCPY = 0; then
30472
30473
30474
30475
30476
30477
30478
30479
30480 gl_LIBOBJS="$gl_LIBOBJS wmempcpy.$ac_objext"
30481
30482 fi
30483
30484
30485
30486
30487
30488 GNULIB_WMEMPCPY=1
30489
30490
30491
30492
30493
30494$as_echo "#define GNULIB_TEST_WMEMPCPY 1" >>confdefs.h
30495
30496
30497
c971b7fa
PA
30498 # End of code from modules
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508 gltests_libdeps=
30509 gltests_ltlibdeps=
30510
30511
30512
30513
30514
30515
30516
30517
30518
5df4cba6 30519
c971b7fa
PA
30520 gl_source_base='tests'
30521 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
30522
30523 gl_module_indicator_condition=$gltests_WITNESS
30524
30525
30526
30527
30528
30529
30530
30531
30532
30533 LIBGNU_LIBDEPS="$gl_libdeps"
30534
30535 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
30536
30537
30538
d0ac1c44 30539am__api_version='1.15'
c971b7fa
PA
30540
30541# Find a good install program. We prefer a C program (faster),
30542# so one script is as good as another. But avoid the broken or
30543# incompatible versions:
30544# SysV /etc/install, /usr/sbin/install
30545# SunOS /usr/etc/install
30546# IRIX /sbin/install
30547# AIX /bin/install
30548# AmigaOS /C/install, which installs bootblocks on floppy discs
30549# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
30550# AFS /usr/afsws/bin/install, which mishandles nonexistent args
30551# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
30552# OS/2's system install, which has a completely different semantic
30553# ./install, which can be erroneously created by make from ./install.sh.
30554# Reject install programs that cannot install multiple files.
30555{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
30556$as_echo_n "checking for a BSD-compatible install... " >&6; }
30557if test -z "$INSTALL"; then
d0ac1c44 30558if ${ac_cv_path_install+:} false; then :
c971b7fa
PA
30559 $as_echo_n "(cached) " >&6
30560else
30561 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30562for as_dir in $PATH
30563do
30564 IFS=$as_save_IFS
30565 test -z "$as_dir" && as_dir=.
30566 # Account for people who put trailing slashes in PATH elements.
30567case $as_dir/ in #((
30568 ./ | .// | /[cC]/* | \
30569 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
30570 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
30571 /usr/ucb/* ) ;;
30572 *)
30573 # OSF1 and SCO ODT 3.0 have their own names for install.
30574 # Don't use installbsd from OSF since it installs stuff as root
30575 # by default.
30576 for ac_prog in ginstall scoinst install; do
30577 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30578 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
c971b7fa
PA
30579 if test $ac_prog = install &&
30580 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
30581 # AIX install. It has an incompatible calling convention.
30582 :
30583 elif test $ac_prog = install &&
30584 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
30585 # program-specific install script used by HP pwplus--don't use.
30586 :
30587 else
30588 rm -rf conftest.one conftest.two conftest.dir
30589 echo one > conftest.one
30590 echo two > conftest.two
30591 mkdir conftest.dir
30592 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
30593 test -s conftest.one && test -s conftest.two &&
30594 test -s conftest.dir/conftest.one &&
30595 test -s conftest.dir/conftest.two
30596 then
30597 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
30598 break 3
30599 fi
30600 fi
30601 fi
30602 done
30603 done
30604 ;;
30605esac
30606
30607 done
30608IFS=$as_save_IFS
30609
30610rm -rf conftest.one conftest.two conftest.dir
30611
30612fi
30613 if test "${ac_cv_path_install+set}" = set; then
30614 INSTALL=$ac_cv_path_install
30615 else
30616 # As a last resort, use the slow shell script. Don't cache a
30617 # value for INSTALL within a source directory, because that will
30618 # break other packages using the cache if that directory is
30619 # removed, or if the value is a relative name.
30620 INSTALL=$ac_install_sh
30621 fi
30622fi
30623{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
30624$as_echo "$INSTALL" >&6; }
30625
30626# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
30627# It thinks the first close brace ends the variable substitution.
30628test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
30629
30630test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
30631
30632test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
30633
30634{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
30635$as_echo_n "checking whether build environment is sane... " >&6; }
c971b7fa
PA
30636# Reject unsafe characters in $srcdir or the absolute working directory
30637# name. Accept space and tab only in the latter.
30638am_lf='
30639'
30640case `pwd` in
30641 *[\\\"\#\$\&\'\`$am_lf]*)
d0ac1c44 30642 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
c971b7fa
PA
30643esac
30644case $srcdir in
30645 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
d0ac1c44 30646 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
c971b7fa
PA
30647esac
30648
d0ac1c44 30649# Do 'set' in a subshell so we don't clobber the current shell's
c971b7fa
PA
30650# arguments. Must try -L first in case configure is actually a
30651# symlink; some systems play weird games with the mod time of symlinks
30652# (eg FreeBSD returns the mod time of the symlink's containing
30653# directory).
30654if (
d0ac1c44
SM
30655 am_has_slept=no
30656 for am_try in 1 2; do
30657 echo "timestamp, slept: $am_has_slept" > conftest.file
30658 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
30659 if test "$*" = "X"; then
30660 # -L didn't work.
30661 set X `ls -t "$srcdir/configure" conftest.file`
30662 fi
30663 if test "$*" != "X $srcdir/configure conftest.file" \
30664 && test "$*" != "X conftest.file $srcdir/configure"; then
30665
30666 # If neither matched, then we have a broken ls. This can happen
30667 # if, for instance, CONFIG_SHELL is bash and it inherits a
30668 # broken ls alias from the environment. This has actually
30669 # happened. Such a system could not be considered "sane".
30670 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
30671 alias in your environment" "$LINENO" 5
30672 fi
30673 if test "$2" = conftest.file || test $am_try -eq 2; then
30674 break
30675 fi
30676 # Just in case.
30677 sleep 1
30678 am_has_slept=yes
30679 done
c971b7fa
PA
30680 test "$2" = conftest.file
30681 )
30682then
30683 # Ok.
30684 :
30685else
d0ac1c44 30686 as_fn_error $? "newly created file is older than distributed files!
c971b7fa
PA
30687Check your system clock" "$LINENO" 5
30688fi
30689{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30690$as_echo "yes" >&6; }
d0ac1c44
SM
30691# If we didn't sleep, we still need to ensure time stamps of config.status and
30692# generated files are strictly newer.
30693am_sleep_pid=
30694if grep 'slept: no' conftest.file >/dev/null 2>&1; then
30695 ( sleep 1 ) &
30696 am_sleep_pid=$!
30697fi
30698
30699rm -f conftest.file
30700
c971b7fa
PA
30701test "$program_prefix" != NONE &&
30702 program_transform_name="s&^&$program_prefix&;$program_transform_name"
30703# Use a double $ so make ignores it.
30704test "$program_suffix" != NONE &&
30705 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
30706# Double any \ or $.
30707# By default was `s,x,x', remove it if useless.
30708ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
30709program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
30710
c0c3707f
CB
30711# Expand $ac_aux_dir to an absolute path.
30712am_aux_dir=`cd "$ac_aux_dir" && pwd`
30713
c971b7fa
PA
30714if test x"${MISSING+set}" != xset; then
30715 case $am_aux_dir in
30716 *\ * | *\ *)
30717 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
30718 *)
30719 MISSING="\${SHELL} $am_aux_dir/missing" ;;
30720 esac
30721fi
30722# Use eval to expand $SHELL
d0ac1c44
SM
30723if eval "$MISSING --is-lightweight"; then
30724 am_missing_run="$MISSING "
c971b7fa
PA
30725else
30726 am_missing_run=
d0ac1c44
SM
30727 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
30728$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
c971b7fa
PA
30729fi
30730
d0ac1c44 30731if test x"${install_sh+set}" != xset; then
c971b7fa
PA
30732 case $am_aux_dir in
30733 *\ * | *\ *)
30734 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
30735 *)
30736 install_sh="\${SHELL} $am_aux_dir/install-sh"
30737 esac
30738fi
30739
d0ac1c44
SM
30740# Installed binaries are usually stripped using 'strip' when the user
30741# run "make install-strip". However 'strip' might not be the right
c971b7fa 30742# tool to use in cross-compilation environments, therefore Automake
d0ac1c44 30743# will honor the 'STRIP' environment variable to overrule this program.
c971b7fa
PA
30744if test "$cross_compiling" != no; then
30745 if test -n "$ac_tool_prefix"; then
30746 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
30747set dummy ${ac_tool_prefix}strip; ac_word=$2
30748{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30749$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30750if ${ac_cv_prog_STRIP+:} false; then :
c971b7fa
PA
30751 $as_echo_n "(cached) " >&6
30752else
30753 if test -n "$STRIP"; then
30754 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
30755else
30756as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30757for as_dir in $PATH
30758do
30759 IFS=$as_save_IFS
30760 test -z "$as_dir" && as_dir=.
30761 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30762 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30763 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
30764 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30765 break 2
30766 fi
30767done
30768 done
30769IFS=$as_save_IFS
30770
30771fi
30772fi
30773STRIP=$ac_cv_prog_STRIP
30774if test -n "$STRIP"; then
30775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
30776$as_echo "$STRIP" >&6; }
30777else
30778 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30779$as_echo "no" >&6; }
30780fi
30781
30782
30783fi
30784if test -z "$ac_cv_prog_STRIP"; then
30785 ac_ct_STRIP=$STRIP
30786 # Extract the first word of "strip", so it can be a program name with args.
30787set dummy strip; ac_word=$2
30788{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30789$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30790if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
c971b7fa
PA
30791 $as_echo_n "(cached) " >&6
30792else
30793 if test -n "$ac_ct_STRIP"; then
30794 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
30795else
30796as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30797for as_dir in $PATH
30798do
30799 IFS=$as_save_IFS
30800 test -z "$as_dir" && as_dir=.
30801 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30802 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30803 ac_cv_prog_ac_ct_STRIP="strip"
30804 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30805 break 2
30806 fi
30807done
30808 done
30809IFS=$as_save_IFS
30810
30811fi
30812fi
30813ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
30814if test -n "$ac_ct_STRIP"; then
30815 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
30816$as_echo "$ac_ct_STRIP" >&6; }
30817else
30818 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30819$as_echo "no" >&6; }
30820fi
30821
30822 if test "x$ac_ct_STRIP" = x; then
30823 STRIP=":"
30824 else
30825 case $cross_compiling:$ac_tool_warned in
30826yes:)
30827{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
30828$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
30829ac_tool_warned=yes ;;
30830esac
30831 STRIP=$ac_ct_STRIP
30832 fi
30833else
30834 STRIP="$ac_cv_prog_STRIP"
30835fi
30836
30837fi
30838INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
30839
c971b7fa
PA
30840for ac_prog in gawk mawk nawk awk
30841do
30842 # Extract the first word of "$ac_prog", so it can be a program name with args.
30843set dummy $ac_prog; ac_word=$2
30844{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30845$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30846if ${ac_cv_prog_AWK+:} false; then :
c971b7fa
PA
30847 $as_echo_n "(cached) " >&6
30848else
30849 if test -n "$AWK"; then
30850 ac_cv_prog_AWK="$AWK" # Let the user override the test.
30851else
30852as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30853for as_dir in $PATH
30854do
30855 IFS=$as_save_IFS
30856 test -z "$as_dir" && as_dir=.
30857 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30858 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30859 ac_cv_prog_AWK="$ac_prog"
30860 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30861 break 2
30862 fi
30863done
30864 done
30865IFS=$as_save_IFS
30866
30867fi
30868fi
30869AWK=$ac_cv_prog_AWK
30870if test -n "$AWK"; then
30871 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
30872$as_echo "$AWK" >&6; }
30873else
30874 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30875$as_echo "no" >&6; }
30876fi
30877
30878
30879 test -n "$AWK" && break
30880done
30881
30882{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
30883$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
30884set x ${MAKE-make}
30885ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
d0ac1c44 30886if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
c971b7fa
PA
30887 $as_echo_n "(cached) " >&6
30888else
30889 cat >conftest.make <<\_ACEOF
30890SHELL = /bin/sh
30891all:
30892 @echo '@@@%%%=$(MAKE)=@@@%%%'
30893_ACEOF
d0ac1c44 30894# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
c971b7fa
PA
30895case `${MAKE-make} -f conftest.make 2>/dev/null` in
30896 *@@@%%%=?*=@@@%%%*)
30897 eval ac_cv_prog_make_${ac_make}_set=yes;;
30898 *)
30899 eval ac_cv_prog_make_${ac_make}_set=no;;
30900esac
30901rm -f conftest.make
30902fi
30903if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
30904 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30905$as_echo "yes" >&6; }
30906 SET_MAKE=
30907else
30908 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30909$as_echo "no" >&6; }
30910 SET_MAKE="MAKE=${MAKE-make}"
30911fi
30912
30913rm -rf .tst 2>/dev/null
30914mkdir .tst 2>/dev/null
30915if test -d .tst; then
30916 am__leading_dot=.
30917else
30918 am__leading_dot=_
30919fi
30920rmdir .tst 2>/dev/null
30921
30922DEPDIR="${am__leading_dot}deps"
30923
30924ac_config_commands="$ac_config_commands depfiles"
30925
30926
30927am_make=${MAKE-make}
30928cat > confinc << 'END'
30929am__doit:
30930 @echo this is the am__doit target
30931.PHONY: am__doit
30932END
30933# If we don't find an include directive, just comment out the code.
30934{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
30935$as_echo_n "checking for style of include used by $am_make... " >&6; }
30936am__include="#"
30937am__quote=
30938_am_result=none
30939# First try GNU make style include.
30940echo "include confinc" > confmf
d0ac1c44 30941# Ignore all kinds of additional output from 'make'.
c971b7fa
PA
30942case `$am_make -s -f confmf 2> /dev/null` in #(
30943*the\ am__doit\ target*)
30944 am__include=include
30945 am__quote=
30946 _am_result=GNU
30947 ;;
30948esac
30949# Now try BSD make style include.
30950if test "$am__include" = "#"; then
30951 echo '.include "confinc"' > confmf
30952 case `$am_make -s -f confmf 2> /dev/null` in #(
30953 *the\ am__doit\ target*)
30954 am__include=.include
30955 am__quote="\""
30956 _am_result=BSD
30957 ;;
30958 esac
30959fi
30960
30961
30962{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
30963$as_echo "$_am_result" >&6; }
30964rm -f confinc confmf
30965
30966# Check whether --enable-dependency-tracking was given.
30967if test "${enable_dependency_tracking+set}" = set; then :
30968 enableval=$enable_dependency_tracking;
30969fi
30970
30971if test "x$enable_dependency_tracking" != xno; then
30972 am_depcomp="$ac_aux_dir/depcomp"
30973 AMDEPBACKSLASH='\'
d0ac1c44 30974 am__nodep='_no'
c971b7fa
PA
30975fi
30976 if test "x$enable_dependency_tracking" != xno; then
30977 AMDEP_TRUE=
30978 AMDEP_FALSE='#'
30979else
30980 AMDEP_TRUE='#'
30981 AMDEP_FALSE=
30982fi
30983
30984
d0ac1c44
SM
30985# Check whether --enable-silent-rules was given.
30986if test "${enable_silent_rules+set}" = set; then :
30987 enableval=$enable_silent_rules;
30988fi
30989
30990case $enable_silent_rules in # (((
30991 yes) AM_DEFAULT_VERBOSITY=0;;
30992 no) AM_DEFAULT_VERBOSITY=1;;
30993 *) AM_DEFAULT_VERBOSITY=1;;
30994esac
30995am_make=${MAKE-make}
30996{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
30997$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
30998if ${am_cv_make_support_nested_variables+:} false; then :
30999 $as_echo_n "(cached) " >&6
31000else
31001 if $as_echo 'TRUE=$(BAR$(V))
31002BAR0=false
31003BAR1=true
31004V=1
31005am__doit:
31006 @$(TRUE)
31007.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
31008 am_cv_make_support_nested_variables=yes
31009else
31010 am_cv_make_support_nested_variables=no
31011fi
31012fi
31013{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
31014$as_echo "$am_cv_make_support_nested_variables" >&6; }
31015if test $am_cv_make_support_nested_variables = yes; then
31016 AM_V='$(V)'
31017 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
31018else
31019 AM_V=$AM_DEFAULT_VERBOSITY
31020 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
31021fi
31022AM_BACKSLASH='\'
31023
c971b7fa
PA
31024if test "`cd $srcdir && pwd`" != "`pwd`"; then
31025 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
31026 # is not polluted with repeated "-I."
31027 am__isrc=' -I$(srcdir)'
31028 # test to see if srcdir already configured
31029 if test -f $srcdir/config.status; then
d0ac1c44 31030 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
c971b7fa
PA
31031 fi
31032fi
31033
31034# test whether we have cygpath
31035if test -z "$CYGPATH_W"; then
31036 if (cygpath --version) >/dev/null 2>/dev/null; then
31037 CYGPATH_W='cygpath -w'
31038 else
31039 CYGPATH_W=echo
31040 fi
31041fi
31042
31043
31044# Define the identity of the package.
d0ac1c44
SM
31045 PACKAGE='libgnu'
31046 VERSION='UNUSED-VERSION'
c971b7fa
PA
31047
31048
31049# Some tools Automake needs.
31050
31051ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
31052
31053
31054AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
31055
31056
31057AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
31058
31059
31060AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
31061
31062
31063MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
31064
d0ac1c44
SM
31065# For better backward compatibility. To be removed once Automake 1.9.x
31066# dies out for good. For more background, see:
31067# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
31068# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
31069mkdir_p='$(MKDIR_P)'
31070
31071# We need awk for the "check" target (and possibly the TAP driver). The
31072# system "awk" is bad on some platforms.
31073# Always define AMTAR for backward compatibility. Yes, it's still used
31074# in the wild :-( We should find a proper way to deprecate it ...
31075AMTAR='$${TAR-tar}'
31076
31077
31078# We'll loop over all known methods to create a tar archive until one works.
31079_am_tools='gnutar pax cpio none'
c971b7fa 31080
d0ac1c44 31081am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
c971b7fa 31082
c971b7fa
PA
31083
31084
31085
31086
31087depcc="$CC" am_compiler_list=
31088
31089{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
31090$as_echo_n "checking dependency style of $depcc... " >&6; }
d0ac1c44 31091if ${am_cv_CC_dependencies_compiler_type+:} false; then :
c971b7fa
PA
31092 $as_echo_n "(cached) " >&6
31093else
31094 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
31095 # We make a subdir and do the tests there. Otherwise we can end up
31096 # making bogus files that we don't know about and never remove. For
31097 # instance it was reported that on HP-UX the gcc test will end up
d0ac1c44
SM
31098 # making a dummy file named 'D' -- because '-MD' means "put the output
31099 # in D".
31100 rm -rf conftest.dir
c971b7fa
PA
31101 mkdir conftest.dir
31102 # Copy depcomp to subdir because otherwise we won't find it if we're
31103 # using a relative directory.
31104 cp "$am_depcomp" conftest.dir
31105 cd conftest.dir
31106 # We will build objects and dependencies in a subdirectory because
31107 # it helps to detect inapplicable dependency modes. For instance
31108 # both Tru64's cc and ICC support -MD to output dependencies as a
31109 # side effect of compilation, but ICC will put the dependencies in
31110 # the current directory while Tru64 will put them in the object
31111 # directory.
31112 mkdir sub
31113
31114 am_cv_CC_dependencies_compiler_type=none
31115 if test "$am_compiler_list" = ""; then
31116 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
31117 fi
31118 am__universal=false
31119 case " $depcc " in #(
31120 *\ -arch\ *\ -arch\ *) am__universal=true ;;
31121 esac
31122
31123 for depmode in $am_compiler_list; do
31124 # Setup a source with many dependencies, because some compilers
31125 # like to wrap large dependency lists on column 80 (with \), and
31126 # we should not choose a depcomp mode which is confused by this.
31127 #
31128 # We need to recreate these files for each test, as the compiler may
31129 # overwrite some of them when testing with obscure command lines.
31130 # This happens at least with the AIX C compiler.
31131 : > sub/conftest.c
31132 for i in 1 2 3 4 5 6; do
31133 echo '#include "conftst'$i'.h"' >> sub/conftest.c
d0ac1c44
SM
31134 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
31135 # Solaris 10 /bin/sh.
31136 echo '/* dummy */' > sub/conftst$i.h
c971b7fa
PA
31137 done
31138 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
31139
d0ac1c44 31140 # We check with '-c' and '-o' for the sake of the "dashmstdout"
c971b7fa 31141 # mode. It turns out that the SunPro C++ compiler does not properly
d0ac1c44
SM
31142 # handle '-M -o', and we need to detect this. Also, some Intel
31143 # versions had trouble with output in subdirs.
c971b7fa
PA
31144 am__obj=sub/conftest.${OBJEXT-o}
31145 am__minus_obj="-o $am__obj"
31146 case $depmode in
31147 gcc)
31148 # This depmode causes a compiler race in universal mode.
31149 test "$am__universal" = false || continue
31150 ;;
31151 nosideeffect)
d0ac1c44
SM
31152 # After this tag, mechanisms are not by side-effect, so they'll
31153 # only be used when explicitly requested.
c971b7fa
PA
31154 if test "x$enable_dependency_tracking" = xyes; then
31155 continue
31156 else
31157 break
31158 fi
31159 ;;
d0ac1c44
SM
31160 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
31161 # This compiler won't grok '-c -o', but also, the minuso test has
c971b7fa
PA
31162 # not run yet. These depmodes are late enough in the game, and
31163 # so weak that their functioning should not be impacted.
31164 am__obj=conftest.${OBJEXT-o}
31165 am__minus_obj=
31166 ;;
31167 none) break ;;
31168 esac
31169 if depmode=$depmode \
31170 source=sub/conftest.c object=$am__obj \
31171 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
31172 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
31173 >/dev/null 2>conftest.err &&
31174 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
31175 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
31176 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
31177 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
31178 # icc doesn't choke on unknown options, it will just issue warnings
31179 # or remarks (even with -Werror). So we grep stderr for any message
31180 # that says an option was ignored or not supported.
31181 # When given -MP, icc 7.0 and 7.1 complain thusly:
31182 # icc: Command line warning: ignoring option '-M'; no argument required
31183 # The diagnosis changed in icc 8.0:
31184 # icc: Command line remark: option '-MP' not supported
31185 if (grep 'ignoring option' conftest.err ||
31186 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
31187 am_cv_CC_dependencies_compiler_type=$depmode
31188 break
31189 fi
31190 fi
31191 done
31192
31193 cd ..
31194 rm -rf conftest.dir
31195else
31196 am_cv_CC_dependencies_compiler_type=none
31197fi
31198
31199fi
31200{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
31201$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
31202CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
31203
31204 if
31205 test "x$enable_dependency_tracking" != xno \
31206 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
31207 am__fastdepCC_TRUE=
31208 am__fastdepCC_FALSE='#'
31209else
31210 am__fastdepCC_TRUE='#'
31211 am__fastdepCC_FALSE=
31212fi
31213
31214
31215
d0ac1c44
SM
31216# POSIX will say in a future version that running "rm -f" with no argument
31217# is OK; and we want to be able to make that assumption in our Makefile
31218# recipes. So use an aggressive probe to check that the usage we want is
31219# actually supported "in the wild" to an acceptable degree.
31220# See automake bug#10828.
31221# To make any issue more visible, cause the running configure to be aborted
31222# by default if the 'rm' program in use doesn't match our expectations; the
31223# user can still override this though.
31224if rm -f && rm -fr && rm -rf; then : OK; else
31225 cat >&2 <<'END'
31226Oops!
31227
31228Your 'rm' program seems unable to run without file operands specified
31229on the command line, even when the '-f' option is present. This is contrary
31230to the behaviour of most rm programs out there, and not conforming with
31231the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
31232
31233Please tell bug-automake@gnu.org about your system, including the value
31234of your $PATH and any error possibly output before this message. This
31235can help us improve future automake versions.
31236
31237END
31238 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
31239 echo 'Configuration will proceed anyway, since you have set the' >&2
31240 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
31241 echo >&2
31242 else
31243 cat >&2 <<'END'
31244Aborting the configuration process, to ensure you take notice of the issue.
31245
31246You can download and install GNU coreutils to get an 'rm' implementation
31247that behaves properly: <http://www.gnu.org/software/coreutils/>.
31248
31249If you want to complete the configuration process using your problematic
31250'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
31251to "yes", and re-run configure.
31252
31253END
31254 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
31255 fi
31256fi
31257
c971b7fa 31258
39be3c7e
SM
31259# Check whether --enable-silent-rules was given.
31260if test "${enable_silent_rules+set}" = set; then :
31261 enableval=$enable_silent_rules;
31262fi
31263
d0ac1c44
SM
31264case $enable_silent_rules in # (((
31265 yes) AM_DEFAULT_VERBOSITY=0;;
31266 no) AM_DEFAULT_VERBOSITY=1;;
31267 *) AM_DEFAULT_VERBOSITY=0;;
39be3c7e 31268esac
d0ac1c44
SM
31269am_make=${MAKE-make}
31270{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
31271$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
31272if ${am_cv_make_support_nested_variables+:} false; then :
31273 $as_echo_n "(cached) " >&6
31274else
31275 if $as_echo 'TRUE=$(BAR$(V))
31276BAR0=false
31277BAR1=true
31278V=1
31279am__doit:
31280 @$(TRUE)
31281.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
31282 am_cv_make_support_nested_variables=yes
31283else
31284 am_cv_make_support_nested_variables=no
31285fi
31286fi
31287{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
31288$as_echo "$am_cv_make_support_nested_variables" >&6; }
31289if test $am_cv_make_support_nested_variables = yes; then
31290 AM_V='$(V)'
31291 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
31292else
31293 AM_V=$AM_DEFAULT_VERBOSITY
31294 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
31295fi
39be3c7e
SM
31296AM_BACKSLASH='\'
31297
31298
c971b7fa
PA
31299# --------------------- #
31300# Checks for programs. #
31301# --------------------- #
31302
31303
31304{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
31305$as_echo_n "checking whether ln -s works... " >&6; }
31306LN_S=$as_ln_s
31307if test "$LN_S" = "ln -s"; then
31308 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
31309$as_echo "yes" >&6; }
31310else
31311 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
31312$as_echo "no, using $LN_S" >&6; }
31313fi
31314
31315if test -n "$ac_tool_prefix"; then
31316 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
31317set dummy ${ac_tool_prefix}ranlib; ac_word=$2
31318{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31319$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31320if ${ac_cv_prog_RANLIB+:} false; then :
c971b7fa
PA
31321 $as_echo_n "(cached) " >&6
31322else
31323 if test -n "$RANLIB"; then
31324 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
31325else
31326as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31327for as_dir in $PATH
31328do
31329 IFS=$as_save_IFS
31330 test -z "$as_dir" && as_dir=.
31331 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31332 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31333 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
31334 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31335 break 2
31336 fi
31337done
31338 done
31339IFS=$as_save_IFS
31340
31341fi
31342fi
31343RANLIB=$ac_cv_prog_RANLIB
31344if test -n "$RANLIB"; then
31345 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
31346$as_echo "$RANLIB" >&6; }
31347else
31348 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31349$as_echo "no" >&6; }
31350fi
31351
31352
31353fi
31354if test -z "$ac_cv_prog_RANLIB"; then
31355 ac_ct_RANLIB=$RANLIB
31356 # Extract the first word of "ranlib", so it can be a program name with args.
31357set dummy ranlib; ac_word=$2
31358{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31359$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31360if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
31361 $as_echo_n "(cached) " >&6
31362else
31363 if test -n "$ac_ct_RANLIB"; then
31364 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
31365else
31366as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31367for as_dir in $PATH
31368do
31369 IFS=$as_save_IFS
31370 test -z "$as_dir" && as_dir=.
31371 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31372 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31373 ac_cv_prog_ac_ct_RANLIB="ranlib"
31374 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31375 break 2
31376 fi
31377done
31378 done
31379IFS=$as_save_IFS
31380
31381fi
31382fi
31383ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
31384if test -n "$ac_ct_RANLIB"; then
31385 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
31386$as_echo "$ac_ct_RANLIB" >&6; }
31387else
31388 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31389$as_echo "no" >&6; }
31390fi
31391
31392 if test "x$ac_ct_RANLIB" = x; then
31393 RANLIB=":"
31394 else
31395 case $cross_compiling:$ac_tool_warned in
31396yes:)
31397{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
31398$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
31399ac_tool_warned=yes ;;
31400esac
31401 RANLIB=$ac_ct_RANLIB
31402 fi
31403else
31404 RANLIB="$ac_cv_prog_RANLIB"
31405fi
31406
31407
31408if test -n "$ac_tool_prefix"; then
31409 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
31410set dummy ${ac_tool_prefix}ar; ac_word=$2
31411{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31412$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31413if ${ac_cv_prog_AR+:} false; then :
c971b7fa
PA
31414 $as_echo_n "(cached) " >&6
31415else
31416 if test -n "$AR"; then
31417 ac_cv_prog_AR="$AR" # Let the user override the test.
31418else
31419as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31420for as_dir in $PATH
31421do
31422 IFS=$as_save_IFS
31423 test -z "$as_dir" && as_dir=.
31424 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31425 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31426 ac_cv_prog_AR="${ac_tool_prefix}ar"
31427 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31428 break 2
31429 fi
31430done
31431 done
31432IFS=$as_save_IFS
31433
31434fi
31435fi
31436AR=$ac_cv_prog_AR
31437if test -n "$AR"; then
31438 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
31439$as_echo "$AR" >&6; }
31440else
31441 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31442$as_echo "no" >&6; }
31443fi
31444
31445
31446fi
31447if test -z "$ac_cv_prog_AR"; then
31448 ac_ct_AR=$AR
31449 # Extract the first word of "ar", so it can be a program name with args.
31450set dummy ar; ac_word=$2
31451{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31452$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31453if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
31454 $as_echo_n "(cached) " >&6
31455else
31456 if test -n "$ac_ct_AR"; then
31457 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
31458else
31459as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31460for as_dir in $PATH
31461do
31462 IFS=$as_save_IFS
31463 test -z "$as_dir" && as_dir=.
31464 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31465 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31466 ac_cv_prog_ac_ct_AR="ar"
31467 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31468 break 2
31469 fi
31470done
31471 done
31472IFS=$as_save_IFS
31473
31474fi
31475fi
31476ac_ct_AR=$ac_cv_prog_ac_ct_AR
31477if test -n "$ac_ct_AR"; then
31478 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
31479$as_echo "$ac_ct_AR" >&6; }
31480else
31481 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31482$as_echo "no" >&6; }
31483fi
31484
31485 if test "x$ac_ct_AR" = x; then
31486 AR=""
31487 else
31488 case $cross_compiling:$ac_tool_warned in
31489yes:)
31490{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
31491$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
31492ac_tool_warned=yes ;;
31493esac
31494 AR=$ac_ct_AR
31495 fi
31496else
31497 AR="$ac_cv_prog_AR"
31498fi
31499
31500
31501# ---------------------- #
31502# Checks for libraries. #
31503# ---------------------- #
31504
361cb219
AB
31505ac_config_files="$ac_config_files Makefile.gnulib.inc"
31506
31507
c971b7fa
PA
31508ac_config_files="$ac_config_files Makefile import/Makefile"
31509
31510ac_config_commands="$ac_config_commands default"
31511
31512cat >confcache <<\_ACEOF
31513# This file is a shell script that caches the results of configure
31514# tests run on this system so they can be shared between configure
31515# scripts and configure runs, see configure's option --config-cache.
31516# It is not useful on other systems. If it contains results you don't
31517# want to keep, you may remove or edit it.
31518#
31519# config.status only pays attention to the cache file if you give it
31520# the --recheck option to rerun configure.
31521#
31522# `ac_cv_env_foo' variables (set or unset) will be overridden when
31523# loading this file, other *unset* `ac_cv_foo' will be assigned the
31524# following values.
31525
31526_ACEOF
31527
31528# The following way of writing the cache mishandles newlines in values,
31529# but we know of no workaround that is simple, portable, and efficient.
31530# So, we kill variables containing newlines.
31531# Ultrix sh set writes to stderr and can't be redirected directly,
31532# and sets the high bit in the cache file unless we assign to the vars.
31533(
31534 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
31535 eval ac_val=\$$ac_var
31536 case $ac_val in #(
31537 *${as_nl}*)
31538 case $ac_var in #(
31539 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
31540$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
31541 esac
31542 case $ac_var in #(
31543 _ | IFS | as_nl) ;; #(
31544 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
31545 *) { eval $ac_var=; unset $ac_var;} ;;
31546 esac ;;
31547 esac
31548 done
31549
31550 (set) 2>&1 |
31551 case $as_nl`(ac_space=' '; set) 2>&1` in #(
31552 *${as_nl}ac_space=\ *)
31553 # `set' does not quote correctly, so add quotes: double-quote
31554 # substitution turns \\\\ into \\, and sed turns \\ into \.
31555 sed -n \
31556 "s/'/'\\\\''/g;
31557 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
31558 ;; #(
31559 *)
31560 # `set' quotes correctly as required by POSIX, so do not add quotes.
31561 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
31562 ;;
31563 esac |
31564 sort
31565) |
31566 sed '
31567 /^ac_cv_env_/b end
31568 t clear
31569 :clear
31570 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
31571 t end
31572 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
31573 :end' >>confcache
31574if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
31575 if test -w "$cache_file"; then
d0ac1c44 31576 if test "x$cache_file" != "x/dev/null"; then
c971b7fa
PA
31577 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
31578$as_echo "$as_me: updating cache $cache_file" >&6;}
d0ac1c44
SM
31579 if test ! -f "$cache_file" || test -h "$cache_file"; then
31580 cat confcache >"$cache_file"
31581 else
31582 case $cache_file in #(
31583 */* | ?:*)
31584 mv -f confcache "$cache_file"$$ &&
31585 mv -f "$cache_file"$$ "$cache_file" ;; #(
31586 *)
31587 mv -f confcache "$cache_file" ;;
31588 esac
31589 fi
31590 fi
c971b7fa
PA
31591 else
31592 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
31593$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
31594 fi
31595fi
31596rm -f confcache
31597
31598test "x$prefix" = xNONE && prefix=$ac_default_prefix
31599# Let make expand exec_prefix.
31600test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
31601
31602DEFS=-DHAVE_CONFIG_H
31603
31604ac_libobjs=
31605ac_ltlibobjs=
31606for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
31607 # 1. Remove the extension, and $U if already installed.
31608 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
31609 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
31610 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
31611 # will be set to the directory where LIBOBJS objects are built.
31612 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
31613 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
31614done
31615LIBOBJS=$ac_libobjs
31616
31617LTLIBOBJS=$ac_ltlibobjs
31618
31619
31620if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
d0ac1c44 31621 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
c971b7fa
PA
31622Usually this means the macro was only invoked conditionally." "$LINENO" 5
31623fi
31624if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
d0ac1c44 31625 as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
c971b7fa
PA
31626Usually this means the macro was only invoked conditionally." "$LINENO" 5
31627fi
8690e634 31628if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
d0ac1c44 31629 as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
8690e634
JK
31630Usually this means the macro was only invoked conditionally." "$LINENO" 5
31631fi
18848e28 31632if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
d0ac1c44 31633 as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
18848e28
GF
31634Usually this means the macro was only invoked conditionally." "$LINENO" 5
31635fi
88b48903 31636if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
d0ac1c44 31637 as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
88b48903
WN
31638Usually this means the macro was only invoked conditionally." "$LINENO" 5
31639fi
8690e634 31640if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
d0ac1c44 31641 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
8690e634
JK
31642Usually this means the macro was only invoked conditionally." "$LINENO" 5
31643fi
c0c3707f
CB
31644if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
31645 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
31646Usually this means the macro was only invoked conditionally." "$LINENO" 5
31647fi
31648if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
31649 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
31650Usually this means the macro was only invoked conditionally." "$LINENO" 5
31651fi
6ec2e0f5 31652if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
d0ac1c44 31653 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
6ec2e0f5
SDJ
31654Usually this means the macro was only invoked conditionally." "$LINENO" 5
31655fi
49e4877c 31656if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 31657 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
31658Usually this means the macro was only invoked conditionally." "$LINENO" 5
31659fi
31660if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 31661 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
31662Usually this means the macro was only invoked conditionally." "$LINENO" 5
31663fi
c971b7fa 31664if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
d0ac1c44 31665 as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
c971b7fa
PA
31666Usually this means the macro was only invoked conditionally." "$LINENO" 5
31667fi
88b48903
WN
31668
31669
5df4cba6
SM
31670if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
31671 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
31672Usually this means the macro was only invoked conditionally." "$LINENO" 5
31673fi
725e2999
JB
31674if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
31675 as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
31676Usually this means the macro was only invoked conditionally." "$LINENO" 5
31677fi
31678if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
31679 as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
31680Usually this means the macro was only invoked conditionally." "$LINENO" 5
31681fi
8690e634 31682if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
d0ac1c44 31683 as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
8690e634
JK
31684Usually this means the macro was only invoked conditionally." "$LINENO" 5
31685fi
c971b7fa 31686if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
d0ac1c44 31687 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
c971b7fa
PA
31688Usually this means the macro was only invoked conditionally." "$LINENO" 5
31689fi
31690
31691 gl_libobjs=
31692 gl_ltlibobjs=
31693 if test -n "$gl_LIBOBJS"; then
31694 # Remove the extension.
31695 sed_drop_objext='s/\.o$//;s/\.obj$//'
31696 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
31697 gl_libobjs="$gl_libobjs $i.$ac_objext"
31698 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
31699 done
31700 fi
31701 gl_LIBOBJS=$gl_libobjs
31702
31703 gl_LTLIBOBJS=$gl_ltlibobjs
31704
31705
31706
31707 gltests_libobjs=
31708 gltests_ltlibobjs=
31709 if test -n "$gltests_LIBOBJS"; then
31710 # Remove the extension.
31711 sed_drop_objext='s/\.o$//;s/\.obj$//'
31712 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
31713 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
31714 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
31715 done
31716 fi
31717 gltests_LIBOBJS=$gltests_libobjs
31718
31719 gltests_LTLIBOBJS=$gltests_ltlibobjs
31720
31721
d0ac1c44
SM
31722{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
31723$as_echo_n "checking that generated files are newer than configure... " >&6; }
31724 if test -n "$am_sleep_pid"; then
31725 # Hide warnings about reused PIDs.
31726 wait $am_sleep_pid 2>/dev/null
31727 fi
31728 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
31729$as_echo "done" >&6; }
c971b7fa 31730if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
d0ac1c44 31731 as_fn_error $? "conditional \"AMDEP\" was never defined.
c971b7fa
PA
31732Usually this means the macro was only invoked conditionally." "$LINENO" 5
31733fi
31734if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
d0ac1c44 31735 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
c971b7fa
PA
31736Usually this means the macro was only invoked conditionally." "$LINENO" 5
31737fi
31738 if test -n "$EXEEXT"; then
31739 am__EXEEXT_TRUE=
31740 am__EXEEXT_FALSE='#'
31741else
31742 am__EXEEXT_TRUE='#'
31743 am__EXEEXT_FALSE=
31744fi
31745
31746
d0ac1c44 31747: "${CONFIG_STATUS=./config.status}"
c971b7fa
PA
31748ac_write_fail=0
31749ac_clean_files_save=$ac_clean_files
31750ac_clean_files="$ac_clean_files $CONFIG_STATUS"
31751{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
31752$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
31753as_write_fail=0
31754cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
31755#! $SHELL
31756# Generated by $as_me.
31757# Run this file to recreate the current configuration.
31758# Compiler output produced by configure, useful for debugging
31759# configure, is in config.log if it exists.
31760
31761debug=false
31762ac_cs_recheck=false
31763ac_cs_silent=false
31764
31765SHELL=\${CONFIG_SHELL-$SHELL}
31766export SHELL
31767_ASEOF
31768cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
31769## -------------------- ##
31770## M4sh Initialization. ##
31771## -------------------- ##
31772
31773# Be more Bourne compatible
31774DUALCASE=1; export DUALCASE # for MKS sh
31775if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
31776 emulate sh
31777 NULLCMD=:
31778 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
31779 # is contrary to our usage. Disable this feature.
31780 alias -g '${1+"$@"}'='"$@"'
31781 setopt NO_GLOB_SUBST
31782else
31783 case `(set -o) 2>/dev/null` in #(
31784 *posix*) :
31785 set -o posix ;; #(
31786 *) :
31787 ;;
31788esac
31789fi
31790
31791
31792as_nl='
31793'
31794export as_nl
31795# Printing a long string crashes Solaris 7 /usr/bin/printf.
31796as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
31797as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
31798as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
31799# Prefer a ksh shell builtin over an external printf program on Solaris,
31800# but without wasting forks for bash or zsh.
31801if test -z "$BASH_VERSION$ZSH_VERSION" \
31802 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
31803 as_echo='print -r --'
31804 as_echo_n='print -rn --'
31805elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
31806 as_echo='printf %s\n'
31807 as_echo_n='printf %s'
31808else
31809 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
31810 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
31811 as_echo_n='/usr/ucb/echo -n'
31812 else
31813 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
31814 as_echo_n_body='eval
31815 arg=$1;
31816 case $arg in #(
31817 *"$as_nl"*)
31818 expr "X$arg" : "X\\(.*\\)$as_nl";
31819 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
31820 esac;
31821 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
31822 '
31823 export as_echo_n_body
31824 as_echo_n='sh -c $as_echo_n_body as_echo'
31825 fi
31826 export as_echo_body
31827 as_echo='sh -c $as_echo_body as_echo'
31828fi
31829
31830# The user is always right.
31831if test "${PATH_SEPARATOR+set}" != set; then
31832 PATH_SEPARATOR=:
31833 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
31834 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
31835 PATH_SEPARATOR=';'
31836 }
31837fi
31838
31839
31840# IFS
31841# We need space, tab and new line, in precisely that order. Quoting is
31842# there to prevent editors from complaining about space-tab.
31843# (If _AS_PATH_WALK were called with IFS unset, it would disable word
31844# splitting by setting IFS to empty value.)
31845IFS=" "" $as_nl"
31846
31847# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 31848as_myself=
c971b7fa
PA
31849case $0 in #((
31850 *[\\/]* ) as_myself=$0 ;;
31851 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31852for as_dir in $PATH
31853do
31854 IFS=$as_save_IFS
31855 test -z "$as_dir" && as_dir=.
31856 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
31857 done
31858IFS=$as_save_IFS
31859
31860 ;;
31861esac
31862# We did not find ourselves, most probably we were run as `sh COMMAND'
31863# in which case we are not to be found in the path.
31864if test "x$as_myself" = x; then
31865 as_myself=$0
31866fi
31867if test ! -f "$as_myself"; then
31868 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
31869 exit 1
31870fi
31871
31872# Unset variables that we do not need and which cause bugs (e.g. in
31873# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
31874# suppresses any "Segmentation fault" message there. '((' could
31875# trigger a bug in pdksh 5.2.14.
31876for as_var in BASH_ENV ENV MAIL MAILPATH
31877do eval test x\${$as_var+set} = xset \
31878 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
31879done
31880PS1='$ '
31881PS2='> '
31882PS4='+ '
31883
31884# NLS nuisances.
31885LC_ALL=C
31886export LC_ALL
31887LANGUAGE=C
31888export LANGUAGE
31889
31890# CDPATH.
31891(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
31892
31893
d0ac1c44
SM
31894# as_fn_error STATUS ERROR [LINENO LOG_FD]
31895# ----------------------------------------
c971b7fa
PA
31896# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
31897# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 31898# script with STATUS, using 1 if that was 0.
c971b7fa
PA
31899as_fn_error ()
31900{
d0ac1c44
SM
31901 as_status=$1; test $as_status -eq 0 && as_status=1
31902 if test "$4"; then
31903 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
31904 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 31905 fi
d0ac1c44 31906 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
31907 as_fn_exit $as_status
31908} # as_fn_error
31909
31910
31911# as_fn_set_status STATUS
31912# -----------------------
31913# Set $? to STATUS, without forking.
31914as_fn_set_status ()
31915{
31916 return $1
31917} # as_fn_set_status
31918
31919# as_fn_exit STATUS
31920# -----------------
31921# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
31922as_fn_exit ()
31923{
31924 set +e
31925 as_fn_set_status $1
31926 exit $1
31927} # as_fn_exit
31928
31929# as_fn_unset VAR
31930# ---------------
31931# Portably unset VAR.
31932as_fn_unset ()
31933{
31934 { eval $1=; unset $1;}
31935}
31936as_unset=as_fn_unset
31937# as_fn_append VAR VALUE
31938# ----------------------
31939# Append the text in VALUE to the end of the definition contained in VAR. Take
31940# advantage of any shell optimizations that allow amortized linear growth over
31941# repeated appends, instead of the typical quadratic growth present in naive
31942# implementations.
31943if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
31944 eval 'as_fn_append ()
31945 {
31946 eval $1+=\$2
31947 }'
31948else
31949 as_fn_append ()
31950 {
31951 eval $1=\$$1\$2
31952 }
31953fi # as_fn_append
31954
31955# as_fn_arith ARG...
31956# ------------------
31957# Perform arithmetic evaluation on the ARGs, and store the result in the
31958# global $as_val. Take advantage of shells that can avoid forks. The arguments
31959# must be portable across $(()) and expr.
31960if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
31961 eval 'as_fn_arith ()
31962 {
31963 as_val=$(( $* ))
31964 }'
31965else
31966 as_fn_arith ()
31967 {
31968 as_val=`expr "$@" || test $? -eq 1`
31969 }
31970fi # as_fn_arith
31971
31972
31973if expr a : '\(a\)' >/dev/null 2>&1 &&
31974 test "X`expr 00001 : '.*\(...\)'`" = X001; then
31975 as_expr=expr
31976else
31977 as_expr=false
31978fi
31979
31980if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
31981 as_basename=basename
31982else
31983 as_basename=false
31984fi
31985
31986if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
31987 as_dirname=dirname
31988else
31989 as_dirname=false
31990fi
31991
31992as_me=`$as_basename -- "$0" ||
31993$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
31994 X"$0" : 'X\(//\)$' \| \
31995 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
31996$as_echo X/"$0" |
31997 sed '/^.*\/\([^/][^/]*\)\/*$/{
31998 s//\1/
31999 q
32000 }
32001 /^X\/\(\/\/\)$/{
32002 s//\1/
32003 q
32004 }
32005 /^X\/\(\/\).*/{
32006 s//\1/
32007 q
32008 }
32009 s/.*/./; q'`
32010
32011# Avoid depending upon Character Ranges.
32012as_cr_letters='abcdefghijklmnopqrstuvwxyz'
32013as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
32014as_cr_Letters=$as_cr_letters$as_cr_LETTERS
32015as_cr_digits='0123456789'
32016as_cr_alnum=$as_cr_Letters$as_cr_digits
32017
32018ECHO_C= ECHO_N= ECHO_T=
32019case `echo -n x` in #(((((
32020-n*)
32021 case `echo 'xy\c'` in
32022 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
32023 xy) ECHO_C='\c';;
32024 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
32025 ECHO_T=' ';;
32026 esac;;
32027*)
32028 ECHO_N='-n';;
32029esac
32030
32031rm -f conf$$ conf$$.exe conf$$.file
32032if test -d conf$$.dir; then
32033 rm -f conf$$.dir/conf$$.file
32034else
32035 rm -f conf$$.dir
32036 mkdir conf$$.dir 2>/dev/null
32037fi
32038if (echo >conf$$.file) 2>/dev/null; then
32039 if ln -s conf$$.file conf$$ 2>/dev/null; then
32040 as_ln_s='ln -s'
32041 # ... but there are two gotchas:
32042 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
32043 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 32044 # In both cases, we have to default to `cp -pR'.
c971b7fa 32045 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 32046 as_ln_s='cp -pR'
c971b7fa
PA
32047 elif ln conf$$.file conf$$ 2>/dev/null; then
32048 as_ln_s=ln
32049 else
d0ac1c44 32050 as_ln_s='cp -pR'
c971b7fa
PA
32051 fi
32052else
d0ac1c44 32053 as_ln_s='cp -pR'
c971b7fa
PA
32054fi
32055rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
32056rmdir conf$$.dir 2>/dev/null
32057
32058
32059# as_fn_mkdir_p
32060# -------------
32061# Create "$as_dir" as a directory, including parents if necessary.
32062as_fn_mkdir_p ()
32063{
32064
32065 case $as_dir in #(
32066 -*) as_dir=./$as_dir;;
32067 esac
32068 test -d "$as_dir" || eval $as_mkdir_p || {
32069 as_dirs=
32070 while :; do
32071 case $as_dir in #(
32072 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
32073 *) as_qdir=$as_dir;;
32074 esac
32075 as_dirs="'$as_qdir' $as_dirs"
32076 as_dir=`$as_dirname -- "$as_dir" ||
32077$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32078 X"$as_dir" : 'X\(//\)[^/]' \| \
32079 X"$as_dir" : 'X\(//\)$' \| \
32080 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
32081$as_echo X"$as_dir" |
32082 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32083 s//\1/
32084 q
32085 }
32086 /^X\(\/\/\)[^/].*/{
32087 s//\1/
32088 q
32089 }
32090 /^X\(\/\/\)$/{
32091 s//\1/
32092 q
32093 }
32094 /^X\(\/\).*/{
32095 s//\1/
32096 q
32097 }
32098 s/.*/./; q'`
32099 test -d "$as_dir" && break
32100 done
32101 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 32102 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
32103
32104
32105} # as_fn_mkdir_p
32106if mkdir -p . 2>/dev/null; then
32107 as_mkdir_p='mkdir -p "$as_dir"'
32108else
32109 test -d ./-p && rmdir ./-p
32110 as_mkdir_p=false
32111fi
32112
d0ac1c44
SM
32113
32114# as_fn_executable_p FILE
32115# -----------------------
32116# Test if FILE is an executable regular file.
32117as_fn_executable_p ()
32118{
32119 test -f "$1" && test -x "$1"
32120} # as_fn_executable_p
32121as_test_x='test -x'
32122as_executable_p=as_fn_executable_p
c971b7fa
PA
32123
32124# Sed expression to map a string onto a valid CPP name.
32125as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
32126
32127# Sed expression to map a string onto a valid variable name.
32128as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
32129
32130
32131exec 6>&1
32132## ----------------------------------- ##
32133## Main body of $CONFIG_STATUS script. ##
32134## ----------------------------------- ##
32135_ASEOF
32136test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
32137
32138cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32139# Save the log message, to keep $0 and so on meaningful, and to
32140# report actual input values of CONFIG_FILES etc. instead of their
32141# values after options handling.
32142ac_log="
d0ac1c44
SM
32143This file was extended by libgnu $as_me UNUSED-VERSION, which was
32144generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
32145
32146 CONFIG_FILES = $CONFIG_FILES
32147 CONFIG_HEADERS = $CONFIG_HEADERS
32148 CONFIG_LINKS = $CONFIG_LINKS
32149 CONFIG_COMMANDS = $CONFIG_COMMANDS
32150 $ $0 $@
32151
32152on `(hostname || uname -n) 2>/dev/null | sed 1q`
32153"
32154
32155_ACEOF
32156
32157case $ac_config_files in *"
32158"*) set x $ac_config_files; shift; ac_config_files=$*;;
32159esac
32160
32161case $ac_config_headers in *"
32162"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
32163esac
32164
32165
32166cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32167# Files that config.status was made for.
32168config_files="$ac_config_files"
32169config_headers="$ac_config_headers"
32170config_commands="$ac_config_commands"
32171
32172_ACEOF
32173
32174cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32175ac_cs_usage="\
32176\`$as_me' instantiates files and other configuration actions
32177from templates according to the current configuration. Unless the files
32178and actions are specified as TAGs, all are instantiated by default.
32179
32180Usage: $0 [OPTION]... [TAG]...
32181
32182 -h, --help print this help, then exit
32183 -V, --version print version number and configuration settings, then exit
d0ac1c44 32184 --config print configuration, then exit
c971b7fa
PA
32185 -q, --quiet, --silent
32186 do not print progress messages
32187 -d, --debug don't remove temporary files
32188 --recheck update $as_me by reconfiguring in the same conditions
32189 --file=FILE[:TEMPLATE]
32190 instantiate the configuration file FILE
32191 --header=FILE[:TEMPLATE]
32192 instantiate the configuration header FILE
32193
32194Configuration files:
32195$config_files
32196
32197Configuration headers:
32198$config_headers
32199
32200Configuration commands:
32201$config_commands
32202
32203Report bugs to the package provider."
32204
32205_ACEOF
32206cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 32207ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
c971b7fa 32208ac_cs_version="\\
d0ac1c44
SM
32209libgnu config.status UNUSED-VERSION
32210configured by $0, generated by GNU Autoconf 2.69,
32211 with options \\"\$ac_cs_config\\"
c971b7fa 32212
d0ac1c44 32213Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
32214This config.status script is free software; the Free Software Foundation
32215gives unlimited permission to copy, distribute and modify it."
32216
32217ac_pwd='$ac_pwd'
32218srcdir='$srcdir'
32219INSTALL='$INSTALL'
32220MKDIR_P='$MKDIR_P'
32221AWK='$AWK'
32222test -n "\$AWK" || AWK=awk
32223_ACEOF
32224
32225cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32226# The default lists apply if the user does not specify any file.
32227ac_need_defaults=:
32228while test $# != 0
32229do
32230 case $1 in
d0ac1c44 32231 --*=?*)
c971b7fa
PA
32232 ac_option=`expr "X$1" : 'X\([^=]*\)='`
32233 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
32234 ac_shift=:
32235 ;;
d0ac1c44
SM
32236 --*=)
32237 ac_option=`expr "X$1" : 'X\([^=]*\)='`
32238 ac_optarg=
32239 ac_shift=:
32240 ;;
c971b7fa
PA
32241 *)
32242 ac_option=$1
32243 ac_optarg=$2
32244 ac_shift=shift
32245 ;;
32246 esac
32247
32248 case $ac_option in
32249 # Handling of the options.
32250 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
32251 ac_cs_recheck=: ;;
32252 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
32253 $as_echo "$ac_cs_version"; exit ;;
d0ac1c44
SM
32254 --config | --confi | --conf | --con | --co | --c )
32255 $as_echo "$ac_cs_config"; exit ;;
c971b7fa
PA
32256 --debug | --debu | --deb | --de | --d | -d )
32257 debug=: ;;
32258 --file | --fil | --fi | --f )
32259 $ac_shift
32260 case $ac_optarg in
32261 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
d0ac1c44 32262 '') as_fn_error $? "missing file argument" ;;
c971b7fa
PA
32263 esac
32264 as_fn_append CONFIG_FILES " '$ac_optarg'"
32265 ac_need_defaults=false;;
32266 --header | --heade | --head | --hea )
32267 $ac_shift
32268 case $ac_optarg in
32269 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
32270 esac
32271 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
32272 ac_need_defaults=false;;
32273 --he | --h)
32274 # Conflict between --help and --header
d0ac1c44 32275 as_fn_error $? "ambiguous option: \`$1'
c971b7fa
PA
32276Try \`$0 --help' for more information.";;
32277 --help | --hel | -h )
32278 $as_echo "$ac_cs_usage"; exit ;;
32279 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
32280 | -silent | --silent | --silen | --sile | --sil | --si | --s)
32281 ac_cs_silent=: ;;
32282
32283 # This is an error.
d0ac1c44 32284 -*) as_fn_error $? "unrecognized option: \`$1'
c971b7fa
PA
32285Try \`$0 --help' for more information." ;;
32286
32287 *) as_fn_append ac_config_targets " $1"
32288 ac_need_defaults=false ;;
32289
32290 esac
32291 shift
32292done
32293
32294ac_configure_extra_args=
32295
32296if $ac_cs_silent; then
32297 exec 6>/dev/null
32298 ac_configure_extra_args="$ac_configure_extra_args --silent"
32299fi
32300
32301_ACEOF
32302cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32303if \$ac_cs_recheck; then
d0ac1c44 32304 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
c971b7fa
PA
32305 shift
32306 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
32307 CONFIG_SHELL='$SHELL'
32308 export CONFIG_SHELL
32309 exec "\$@"
32310fi
32311
32312_ACEOF
32313cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32314exec 5>>config.log
32315{
32316 echo
32317 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
32318## Running $as_me. ##
32319_ASBOX
32320 $as_echo "$ac_log"
32321} >&5
32322
32323_ACEOF
32324cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32325#
32326# INIT-COMMANDS
32327#
32328AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
32329
32330_ACEOF
32331
32332cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32333
32334# Handling of arguments.
32335for ac_config_target in $ac_config_targets
32336do
32337 case $ac_config_target in
32338 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
32339 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
361cb219 32340 "Makefile.gnulib.inc") CONFIG_FILES="$CONFIG_FILES Makefile.gnulib.inc" ;;
c971b7fa
PA
32341 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
32342 "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;;
32343 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
32344
d0ac1c44 32345 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
c971b7fa
PA
32346 esac
32347done
32348
32349
32350# If the user did not use the arguments to specify the items to instantiate,
32351# then the envvar interface is used. Set only those that are not.
32352# We use the long form for the default assignment because of an extremely
32353# bizarre bug on SunOS 4.1.3.
32354if $ac_need_defaults; then
32355 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
32356 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
32357 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
32358fi
32359
32360# Have a temporary directory for convenience. Make it in the build tree
32361# simply because there is no reason against having it here, and in addition,
32362# creating and moving files from /tmp can sometimes cause problems.
32363# Hook for its removal unless debugging.
32364# Note that there is a small window in which the directory will not be cleaned:
32365# after its creation but before its name has been assigned to `$tmp'.
32366$debug ||
32367{
d0ac1c44 32368 tmp= ac_tmp=
c971b7fa 32369 trap 'exit_status=$?
d0ac1c44
SM
32370 : "${ac_tmp:=$tmp}"
32371 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
c971b7fa
PA
32372' 0
32373 trap 'as_fn_exit 1' 1 2 13 15
32374}
32375# Create a (secure) tmp directory for tmp files.
32376
32377{
32378 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
d0ac1c44 32379 test -d "$tmp"
c971b7fa
PA
32380} ||
32381{
32382 tmp=./conf$$-$RANDOM
32383 (umask 077 && mkdir "$tmp")
d0ac1c44
SM
32384} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
32385ac_tmp=$tmp
c971b7fa
PA
32386
32387# Set up the scripts for CONFIG_FILES section.
32388# No need to generate them if there are no CONFIG_FILES.
32389# This happens for instance with `./config.status config.h'.
32390if test -n "$CONFIG_FILES"; then
32391
32392
32393ac_cr=`echo X | tr X '\015'`
32394# On cygwin, bash can eat \r inside `` if the user requested igncr.
32395# But we know of no other shell where ac_cr would be empty at this
32396# point, so we can use a bashism as a fallback.
32397if test "x$ac_cr" = x; then
32398 eval ac_cr=\$\'\\r\'
32399fi
32400ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
32401if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
d0ac1c44 32402 ac_cs_awk_cr='\\r'
c971b7fa
PA
32403else
32404 ac_cs_awk_cr=$ac_cr
32405fi
32406
d0ac1c44 32407echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
c971b7fa
PA
32408_ACEOF
32409
32410
32411{
32412 echo "cat >conf$$subs.awk <<_ACEOF" &&
32413 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
32414 echo "_ACEOF"
32415} >conf$$subs.sh ||
d0ac1c44
SM
32416 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
32417ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
c971b7fa
PA
32418ac_delim='%!_!# '
32419for ac_last_try in false false false false false :; do
32420 . ./conf$$subs.sh ||
d0ac1c44 32421 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
32422
32423 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
32424 if test $ac_delim_n = $ac_delim_num; then
32425 break
32426 elif $ac_last_try; then
d0ac1c44 32427 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
32428 else
32429 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
32430 fi
32431done
32432rm -f conf$$subs.sh
32433
32434cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 32435cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
c971b7fa
PA
32436_ACEOF
32437sed -n '
32438h
32439s/^/S["/; s/!.*/"]=/
32440p
32441g
32442s/^[^!]*!//
32443:repl
32444t repl
32445s/'"$ac_delim"'$//
32446t delim
32447:nl
32448h
d0ac1c44 32449s/\(.\{148\}\)..*/\1/
c971b7fa
PA
32450t more1
32451s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
32452p
32453n
32454b repl
32455:more1
32456s/["\\]/\\&/g; s/^/"/; s/$/"\\/
32457p
32458g
32459s/.\{148\}//
32460t nl
32461:delim
32462h
d0ac1c44 32463s/\(.\{148\}\)..*/\1/
c971b7fa
PA
32464t more2
32465s/["\\]/\\&/g; s/^/"/; s/$/"/
32466p
32467b
32468:more2
32469s/["\\]/\\&/g; s/^/"/; s/$/"\\/
32470p
32471g
32472s/.\{148\}//
32473t delim
32474' <conf$$subs.awk | sed '
32475/^[^""]/{
32476 N
32477 s/\n//
32478}
32479' >>$CONFIG_STATUS || ac_write_fail=1
32480rm -f conf$$subs.awk
32481cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32482_ACAWK
d0ac1c44 32483cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
c971b7fa
PA
32484 for (key in S) S_is_set[key] = 1
32485 FS = "\a"
32486
32487}
32488{
32489 line = $ 0
32490 nfields = split(line, field, "@")
32491 substed = 0
32492 len = length(field[1])
32493 for (i = 2; i < nfields; i++) {
32494 key = field[i]
32495 keylen = length(key)
32496 if (S_is_set[key]) {
32497 value = S[key]
32498 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
32499 len += length(value) + length(field[++i])
32500 substed = 1
32501 } else
32502 len += 1 + keylen
32503 }
32504
32505 print line
32506}
32507
32508_ACAWK
32509_ACEOF
32510cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32511if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
32512 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
32513else
32514 cat
d0ac1c44
SM
32515fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
32516 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
c971b7fa
PA
32517_ACEOF
32518
d0ac1c44
SM
32519# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
32520# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
c971b7fa
PA
32521# trailing colons and then remove the whole line if VPATH becomes empty
32522# (actually we leave an empty line to preserve line numbers).
32523if test "x$srcdir" = x.; then
d0ac1c44
SM
32524 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
32525h
32526s///
32527s/^/:/
32528s/[ ]*$/:/
32529s/:\$(srcdir):/:/g
32530s/:\${srcdir}:/:/g
32531s/:@srcdir@:/:/g
32532s/^:*//
c971b7fa 32533s/:*$//
d0ac1c44
SM
32534x
32535s/\(=[ ]*\).*/\1/
32536G
32537s/\n//
c971b7fa
PA
32538s/^[^=]*=[ ]*$//
32539}'
32540fi
32541
32542cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32543fi # test -n "$CONFIG_FILES"
32544
32545# Set up the scripts for CONFIG_HEADERS section.
32546# No need to generate them if there are no CONFIG_HEADERS.
32547# This happens for instance with `./config.status Makefile'.
32548if test -n "$CONFIG_HEADERS"; then
d0ac1c44 32549cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
c971b7fa
PA
32550BEGIN {
32551_ACEOF
32552
32553# Transform confdefs.h into an awk script `defines.awk', embedded as
32554# here-document in config.status, that substitutes the proper values into
32555# config.h.in to produce config.h.
32556
32557# Create a delimiter string that does not exist in confdefs.h, to ease
32558# handling of long lines.
32559ac_delim='%!_!# '
32560for ac_last_try in false false :; do
d0ac1c44
SM
32561 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
32562 if test -z "$ac_tt"; then
c971b7fa
PA
32563 break
32564 elif $ac_last_try; then
d0ac1c44 32565 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
c971b7fa
PA
32566 else
32567 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
32568 fi
32569done
32570
32571# For the awk script, D is an array of macro values keyed by name,
32572# likewise P contains macro parameters if any. Preserve backslash
32573# newline sequences.
32574
32575ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
32576sed -n '
32577s/.\{148\}/&'"$ac_delim"'/g
32578t rset
32579:rset
32580s/^[ ]*#[ ]*define[ ][ ]*/ /
32581t def
32582d
32583:def
32584s/\\$//
32585t bsnl
32586s/["\\]/\\&/g
32587s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
32588D["\1"]=" \3"/p
32589s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
32590d
32591:bsnl
32592s/["\\]/\\&/g
32593s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
32594D["\1"]=" \3\\\\\\n"\\/p
32595t cont
32596s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
32597t cont
32598d
32599:cont
32600n
32601s/.\{148\}/&'"$ac_delim"'/g
32602t clear
32603:clear
32604s/\\$//
32605t bsnlc
32606s/["\\]/\\&/g; s/^/"/; s/$/"/p
32607d
32608:bsnlc
32609s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
32610b cont
32611' <confdefs.h | sed '
32612s/'"$ac_delim"'/"\\\
32613"/g' >>$CONFIG_STATUS || ac_write_fail=1
32614
32615cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32616 for (key in D) D_is_set[key] = 1
32617 FS = "\a"
32618}
32619/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
32620 line = \$ 0
32621 split(line, arg, " ")
32622 if (arg[1] == "#") {
32623 defundef = arg[2]
32624 mac1 = arg[3]
32625 } else {
32626 defundef = substr(arg[1], 2)
32627 mac1 = arg[2]
32628 }
32629 split(mac1, mac2, "(") #)
32630 macro = mac2[1]
32631 prefix = substr(line, 1, index(line, defundef) - 1)
32632 if (D_is_set[macro]) {
32633 # Preserve the white space surrounding the "#".
32634 print prefix "define", macro P[macro] D[macro]
32635 next
32636 } else {
32637 # Replace #undef with comments. This is necessary, for example,
32638 # in the case of _POSIX_SOURCE, which is predefined and required
32639 # on some systems where configure will not decide to define it.
32640 if (defundef == "undef") {
32641 print "/*", prefix defundef, macro, "*/"
32642 next
32643 }
32644 }
32645}
32646{ print }
32647_ACAWK
32648_ACEOF
32649cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
d0ac1c44 32650 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
c971b7fa
PA
32651fi # test -n "$CONFIG_HEADERS"
32652
32653
32654eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
32655shift
32656for ac_tag
32657do
32658 case $ac_tag in
32659 :[FHLC]) ac_mode=$ac_tag; continue;;
32660 esac
32661 case $ac_mode$ac_tag in
32662 :[FHL]*:*);;
d0ac1c44 32663 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
c971b7fa
PA
32664 :[FH]-) ac_tag=-:-;;
32665 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
32666 esac
32667 ac_save_IFS=$IFS
32668 IFS=:
32669 set x $ac_tag
32670 IFS=$ac_save_IFS
32671 shift
32672 ac_file=$1
32673 shift
32674
32675 case $ac_mode in
32676 :L) ac_source=$1;;
32677 :[FH])
32678 ac_file_inputs=
32679 for ac_f
32680 do
32681 case $ac_f in
d0ac1c44 32682 -) ac_f="$ac_tmp/stdin";;
c971b7fa
PA
32683 *) # Look for the file first in the build tree, then in the source tree
32684 # (if the path is not absolute). The absolute path cannot be DOS-style,
32685 # because $ac_f cannot contain `:'.
32686 test -f "$ac_f" ||
32687 case $ac_f in
32688 [\\/$]*) false;;
32689 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
32690 esac ||
d0ac1c44 32691 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
c971b7fa
PA
32692 esac
32693 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
32694 as_fn_append ac_file_inputs " '$ac_f'"
32695 done
32696
32697 # Let's still pretend it is `configure' which instantiates (i.e., don't
32698 # use $as_me), people would be surprised to read:
32699 # /* config.h. Generated by config.status. */
32700 configure_input='Generated from '`
32701 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
32702 `' by configure.'
32703 if test x"$ac_file" != x-; then
32704 configure_input="$ac_file. $configure_input"
32705 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
32706$as_echo "$as_me: creating $ac_file" >&6;}
32707 fi
32708 # Neutralize special characters interpreted by sed in replacement strings.
32709 case $configure_input in #(
32710 *\&* | *\|* | *\\* )
32711 ac_sed_conf_input=`$as_echo "$configure_input" |
32712 sed 's/[\\\\&|]/\\\\&/g'`;; #(
32713 *) ac_sed_conf_input=$configure_input;;
32714 esac
32715
32716 case $ac_tag in
d0ac1c44
SM
32717 *:-:* | *:-) cat >"$ac_tmp/stdin" \
32718 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
c971b7fa
PA
32719 esac
32720 ;;
32721 esac
32722
32723 ac_dir=`$as_dirname -- "$ac_file" ||
32724$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32725 X"$ac_file" : 'X\(//\)[^/]' \| \
32726 X"$ac_file" : 'X\(//\)$' \| \
32727 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
32728$as_echo X"$ac_file" |
32729 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32730 s//\1/
32731 q
32732 }
32733 /^X\(\/\/\)[^/].*/{
32734 s//\1/
32735 q
32736 }
32737 /^X\(\/\/\)$/{
32738 s//\1/
32739 q
32740 }
32741 /^X\(\/\).*/{
32742 s//\1/
32743 q
32744 }
32745 s/.*/./; q'`
32746 as_dir="$ac_dir"; as_fn_mkdir_p
32747 ac_builddir=.
32748
32749case "$ac_dir" in
32750.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
32751*)
32752 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
32753 # A ".." for each directory in $ac_dir_suffix.
32754 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
32755 case $ac_top_builddir_sub in
32756 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
32757 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
32758 esac ;;
32759esac
32760ac_abs_top_builddir=$ac_pwd
32761ac_abs_builddir=$ac_pwd$ac_dir_suffix
32762# for backward compatibility:
32763ac_top_builddir=$ac_top_build_prefix
32764
32765case $srcdir in
32766 .) # We are building in place.
32767 ac_srcdir=.
32768 ac_top_srcdir=$ac_top_builddir_sub
32769 ac_abs_top_srcdir=$ac_pwd ;;
32770 [\\/]* | ?:[\\/]* ) # Absolute name.
32771 ac_srcdir=$srcdir$ac_dir_suffix;
32772 ac_top_srcdir=$srcdir
32773 ac_abs_top_srcdir=$srcdir ;;
32774 *) # Relative name.
32775 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
32776 ac_top_srcdir=$ac_top_build_prefix$srcdir
32777 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
32778esac
32779ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
32780
32781
32782 case $ac_mode in
32783 :F)
32784 #
32785 # CONFIG_FILE
32786 #
32787
32788 case $INSTALL in
32789 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
32790 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
32791 esac
32792 ac_MKDIR_P=$MKDIR_P
32793 case $MKDIR_P in
32794 [\\/$]* | ?:[\\/]* ) ;;
32795 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
32796 esac
32797_ACEOF
32798
32799cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32800# If the template does not know about datarootdir, expand it.
32801# FIXME: This hack should be removed a few years after 2.60.
32802ac_datarootdir_hack=; ac_datarootdir_seen=
32803ac_sed_dataroot='
32804/datarootdir/ {
32805 p
32806 q
32807}
32808/@datadir@/p
32809/@docdir@/p
32810/@infodir@/p
32811/@localedir@/p
32812/@mandir@/p'
32813case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
32814*datarootdir*) ac_datarootdir_seen=yes;;
32815*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
32816 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
32817$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
32818_ACEOF
32819cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32820 ac_datarootdir_hack='
32821 s&@datadir@&$datadir&g
32822 s&@docdir@&$docdir&g
32823 s&@infodir@&$infodir&g
32824 s&@localedir@&$localedir&g
32825 s&@mandir@&$mandir&g
32826 s&\\\${datarootdir}&$datarootdir&g' ;;
32827esac
32828_ACEOF
32829
32830# Neutralize VPATH when `$srcdir' = `.'.
32831# Shell code in configure.ac might set extrasub.
32832# FIXME: do we really want to maintain this feature?
32833cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32834ac_sed_extra="$ac_vpsub
32835$extrasub
32836_ACEOF
32837cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32838:t
32839/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
32840s|@configure_input@|$ac_sed_conf_input|;t t
32841s&@top_builddir@&$ac_top_builddir_sub&;t t
32842s&@top_build_prefix@&$ac_top_build_prefix&;t t
32843s&@srcdir@&$ac_srcdir&;t t
32844s&@abs_srcdir@&$ac_abs_srcdir&;t t
32845s&@top_srcdir@&$ac_top_srcdir&;t t
32846s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
32847s&@builddir@&$ac_builddir&;t t
32848s&@abs_builddir@&$ac_abs_builddir&;t t
32849s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
32850s&@INSTALL@&$ac_INSTALL&;t t
32851s&@MKDIR_P@&$ac_MKDIR_P&;t t
32852$ac_datarootdir_hack
32853"
d0ac1c44
SM
32854eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
32855 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32856
32857test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
d0ac1c44
SM
32858 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
32859 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
32860 "$ac_tmp/out"`; test -z "$ac_out"; } &&
c971b7fa 32861 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 32862which seems to be undefined. Please make sure it is defined" >&5
c971b7fa 32863$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 32864which seems to be undefined. Please make sure it is defined" >&2;}
c971b7fa 32865
d0ac1c44 32866 rm -f "$ac_tmp/stdin"
c971b7fa 32867 case $ac_file in
d0ac1c44
SM
32868 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
32869 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
c971b7fa 32870 esac \
d0ac1c44 32871 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32872 ;;
32873 :H)
32874 #
32875 # CONFIG_HEADER
32876 #
32877 if test x"$ac_file" != x-; then
32878 {
32879 $as_echo "/* $configure_input */" \
d0ac1c44
SM
32880 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
32881 } >"$ac_tmp/config.h" \
32882 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
32883 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
c971b7fa
PA
32884 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
32885$as_echo "$as_me: $ac_file is unchanged" >&6;}
32886 else
32887 rm -f "$ac_file"
d0ac1c44
SM
32888 mv "$ac_tmp/config.h" "$ac_file" \
32889 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32890 fi
32891 else
32892 $as_echo "/* $configure_input */" \
d0ac1c44
SM
32893 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
32894 || as_fn_error $? "could not create -" "$LINENO" 5
c971b7fa
PA
32895 fi
32896# Compute "$ac_file"'s index in $config_headers.
32897_am_arg="$ac_file"
32898_am_stamp_count=1
32899for _am_header in $config_headers :; do
32900 case $_am_header in
32901 $_am_arg | $_am_arg:* )
32902 break ;;
32903 * )
32904 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
32905 esac
32906done
32907echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
32908$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32909 X"$_am_arg" : 'X\(//\)[^/]' \| \
32910 X"$_am_arg" : 'X\(//\)$' \| \
32911 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
32912$as_echo X"$_am_arg" |
32913 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32914 s//\1/
32915 q
32916 }
32917 /^X\(\/\/\)[^/].*/{
32918 s//\1/
32919 q
32920 }
32921 /^X\(\/\/\)$/{
32922 s//\1/
32923 q
32924 }
32925 /^X\(\/\).*/{
32926 s//\1/
32927 q
32928 }
32929 s/.*/./; q'`/stamp-h$_am_stamp_count
32930 ;;
32931
32932 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
32933$as_echo "$as_me: executing $ac_file commands" >&6;}
32934 ;;
32935 esac
32936
32937
32938 case $ac_file$ac_mode in
32939 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
d0ac1c44 32940 # Older Autoconf quotes --file arguments for eval, but not when files
c971b7fa
PA
32941 # are listed without --file. Let's play safe and only enable the eval
32942 # if we detect the quoting.
32943 case $CONFIG_FILES in
32944 *\'*) eval set x "$CONFIG_FILES" ;;
32945 *) set x $CONFIG_FILES ;;
32946 esac
32947 shift
32948 for mf
32949 do
32950 # Strip MF so we end up with the name of the file.
32951 mf=`echo "$mf" | sed -e 's/:.*$//'`
32952 # Check whether this is an Automake generated Makefile or not.
d0ac1c44 32953 # We used to match only the files named 'Makefile.in', but
c971b7fa
PA
32954 # some people rename them; so instead we look at the file content.
32955 # Grep'ing the first line is not enough: some people post-process
32956 # each Makefile.in and add a new line on top of each file to say so.
32957 # Grep'ing the whole file is not good either: AIX grep has a line
32958 # limit of 2048, but all sed's we know have understand at least 4000.
32959 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
32960 dirpart=`$as_dirname -- "$mf" ||
32961$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32962 X"$mf" : 'X\(//\)[^/]' \| \
32963 X"$mf" : 'X\(//\)$' \| \
32964 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
32965$as_echo X"$mf" |
32966 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32967 s//\1/
32968 q
32969 }
32970 /^X\(\/\/\)[^/].*/{
32971 s//\1/
32972 q
32973 }
32974 /^X\(\/\/\)$/{
32975 s//\1/
32976 q
32977 }
32978 /^X\(\/\).*/{
32979 s//\1/
32980 q
32981 }
32982 s/.*/./; q'`
32983 else
32984 continue
32985 fi
32986 # Extract the definition of DEPDIR, am__include, and am__quote
d0ac1c44 32987 # from the Makefile without running 'make'.
c971b7fa
PA
32988 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
32989 test -z "$DEPDIR" && continue
32990 am__include=`sed -n 's/^am__include = //p' < "$mf"`
d0ac1c44 32991 test -z "$am__include" && continue
c971b7fa 32992 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
c971b7fa
PA
32993 # Find all dependency output files, they are included files with
32994 # $(DEPDIR) in their names. We invoke sed twice because it is the
32995 # simplest approach to changing $(DEPDIR) to its actual value in the
32996 # expansion.
32997 for file in `sed -n "
32998 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
d0ac1c44 32999 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
c971b7fa
PA
33000 # Make sure the directory exists.
33001 test -f "$dirpart/$file" && continue
33002 fdir=`$as_dirname -- "$file" ||
33003$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
33004 X"$file" : 'X\(//\)[^/]' \| \
33005 X"$file" : 'X\(//\)$' \| \
33006 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
33007$as_echo X"$file" |
33008 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
33009 s//\1/
33010 q
33011 }
33012 /^X\(\/\/\)[^/].*/{
33013 s//\1/
33014 q
33015 }
33016 /^X\(\/\/\)$/{
33017 s//\1/
33018 q
33019 }
33020 /^X\(\/\).*/{
33021 s//\1/
33022 q
33023 }
33024 s/.*/./; q'`
33025 as_dir=$dirpart/$fdir; as_fn_mkdir_p
33026 # echo "creating $dirpart/$file"
33027 echo '# dummy' > "$dirpart/$file"
33028 done
33029 done
33030}
33031 ;;
33032 "default":C)
33033case x$CONFIG_HEADERS in
33034xconfig.h:config.in)
33035echo > stamp-h ;;
33036esac
33037 ;;
33038
33039 esac
33040done # for ac_tag
33041
33042
33043as_fn_exit 0
33044_ACEOF
33045ac_clean_files=$ac_clean_files_save
33046
33047test $ac_write_fail = 0 ||
d0ac1c44 33048 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
33049
33050
33051# configure is writing to config.log, and then calls config.status.
33052# config.status does its own redirection, appending to config.log.
33053# Unfortunately, on DOS this fails, as config.log is still kept open
33054# by configure, so config.status won't be able to write to it; its
33055# output is simply discarded. So we exec the FD to /dev/null,
33056# effectively closing config.log, so it can be properly (re)opened and
33057# appended to by config.status. When coming back to configure, we
33058# need to make the FD available again.
33059if test "$no_create" != yes; then
33060 ac_cs_success=:
33061 ac_config_status_args=
33062 test "$silent" = yes &&
33063 ac_config_status_args="$ac_config_status_args --quiet"
33064 exec 5>/dev/null
33065 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
33066 exec 5>>config.log
33067 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
33068 # would make configure fail if this is the last instruction.
d0ac1c44 33069 $ac_cs_success || as_fn_exit 1
c971b7fa
PA
33070fi
33071if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
33072 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
33073$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
33074fi
33075
33076
33077exit 0
This page took 3.460258 seconds and 4 git commands to generate.