nm: Add --quiet to suppress "no symbols" diagnostic
[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
6a29c58e
YQ
776REPLACE_VSPRINTF
777REPLACE_VSNPRINTF
778REPLACE_VPRINTF
779REPLACE_VFPRINTF
780REPLACE_VDPRINTF
781REPLACE_VASPRINTF
782REPLACE_TMPFILE
783REPLACE_STDIO_WRITE_FUNCS
784REPLACE_STDIO_READ_FUNCS
785REPLACE_SPRINTF
786REPLACE_SNPRINTF
787REPLACE_RENAMEAT
788REPLACE_RENAME
789REPLACE_REMOVE
790REPLACE_PRINTF
791REPLACE_POPEN
792REPLACE_PERROR
793REPLACE_OBSTACK_PRINTF
794REPLACE_GETLINE
795REPLACE_GETDELIM
796REPLACE_FTELLO
797REPLACE_FTELL
798REPLACE_FSEEKO
799REPLACE_FSEEK
800REPLACE_FREOPEN
801REPLACE_FPURGE
802REPLACE_FPRINTF
803REPLACE_FOPEN
804REPLACE_FFLUSH
805REPLACE_FDOPEN
806REPLACE_FCLOSE
807REPLACE_DPRINTF
808HAVE_VDPRINTF
809HAVE_VASPRINTF
810HAVE_RENAMEAT
811HAVE_POPEN
812HAVE_PCLOSE
813HAVE_FTELLO
814HAVE_FSEEKO
815HAVE_DPRINTF
816HAVE_DECL_VSNPRINTF
817HAVE_DECL_SNPRINTF
818HAVE_DECL_OBSTACK_PRINTF
819HAVE_DECL_GETLINE
820HAVE_DECL_GETDELIM
821HAVE_DECL_FTELLO
822HAVE_DECL_FSEEKO
823HAVE_DECL_FPURGE
9c9d63b1
PM
824HAVE_DECL_FCLOSEALL
825GNULIB_MDA_TEMPNAM
826GNULIB_MDA_PUTW
827GNULIB_MDA_GETW
828GNULIB_MDA_FILENO
829GNULIB_MDA_FDOPEN
830GNULIB_MDA_FCLOSEALL
6a29c58e
YQ
831GNULIB_VSPRINTF_POSIX
832GNULIB_VSNPRINTF
833GNULIB_VPRINTF_POSIX
834GNULIB_VPRINTF
835GNULIB_VFPRINTF_POSIX
836GNULIB_VFPRINTF
837GNULIB_VDPRINTF
838GNULIB_VSCANF
839GNULIB_VFSCANF
840GNULIB_VASPRINTF
841GNULIB_TMPFILE
842GNULIB_STDIO_H_SIGPIPE
843GNULIB_STDIO_H_NONBLOCKING
844GNULIB_SPRINTF_POSIX
845GNULIB_SNPRINTF
846GNULIB_SCANF
847GNULIB_RENAMEAT
848GNULIB_RENAME
849GNULIB_REMOVE
850GNULIB_PUTS
851GNULIB_PUTCHAR
852GNULIB_PUTC
853GNULIB_PRINTF_POSIX
854GNULIB_PRINTF
855GNULIB_POPEN
856GNULIB_PERROR
857GNULIB_PCLOSE
858GNULIB_OBSTACK_PRINTF_POSIX
859GNULIB_OBSTACK_PRINTF
860GNULIB_GETLINE
861GNULIB_GETDELIM
862GNULIB_GETCHAR
863GNULIB_GETC
864GNULIB_FWRITE
865GNULIB_FTELLO
866GNULIB_FTELL
867GNULIB_FSEEKO
868GNULIB_FSEEK
869GNULIB_FSCANF
870GNULIB_FREOPEN
871GNULIB_FREAD
872GNULIB_FPUTS
873GNULIB_FPUTC
874GNULIB_FPURGE
875GNULIB_FPRINTF_POSIX
876GNULIB_FPRINTF
877GNULIB_FOPEN
878GNULIB_FGETS
879GNULIB_FGETC
880GNULIB_FFLUSH
881GNULIB_FDOPEN
882GNULIB_FCLOSE
883GNULIB_DPRINTF
725e2999
JB
884GL_GENERATE_NETINET_IN_H_FALSE
885GL_GENERATE_NETINET_IN_H_TRUE
886NETINET_IN_H
887HAVE_NETINET_IN_H
888NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
889NEXT_NETINET_IN_H
c971b7fa 890UNDEFINE_STRTOK_R
c971b7fa 891REPLACE_STRSIGNAL
9c9d63b1 892REPLACE_STRERRORNAME_NP
c971b7fa
PA
893REPLACE_STRERROR_R
894REPLACE_STRERROR
c0c3707f 895REPLACE_STRTOK_R
c971b7fa
PA
896REPLACE_STRCASESTR
897REPLACE_STRSTR
c0c3707f
CB
898REPLACE_STRNLEN
899REPLACE_STRNDUP
900REPLACE_STRNCAT
c971b7fa 901REPLACE_STRDUP
c0c3707f 902REPLACE_STRCHRNUL
c971b7fa
PA
903REPLACE_STPNCPY
904REPLACE_MEMMEM
905REPLACE_MEMCHR
9c9d63b1 906REPLACE_FFSLL
c971b7fa
PA
907HAVE_STRVERSCMP
908HAVE_DECL_STRSIGNAL
9c9d63b1
PM
909HAVE_SIGDESCR_NP
910HAVE_SIGABBREV_NP
911HAVE_STRERRORNAME_NP
c971b7fa
PA
912HAVE_DECL_STRERROR_R
913HAVE_DECL_STRTOK_R
914HAVE_STRCASESTR
915HAVE_STRSEP
916HAVE_STRPBRK
917HAVE_DECL_STRNLEN
918HAVE_DECL_STRNDUP
919HAVE_DECL_STRDUP
920HAVE_STRCHRNUL
921HAVE_STPNCPY
922HAVE_STPCPY
923HAVE_RAWMEMCHR
924HAVE_DECL_MEMRCHR
925HAVE_MEMPCPY
926HAVE_DECL_MEMMEM
c971b7fa
PA
927HAVE_FFSLL
928HAVE_FFSL
c0c3707f 929HAVE_EXPLICIT_BZERO
9c9d63b1
PM
930GNULIB_MDA_STRDUP
931GNULIB_MDA_MEMCCPY
c971b7fa
PA
932HAVE_MBSLEN
933GNULIB_STRVERSCMP
934GNULIB_STRSIGNAL
9c9d63b1
PM
935GNULIB_SIGDESCR_NP
936GNULIB_SIGABBREV_NP
937GNULIB_STRERRORNAME_NP
c971b7fa
PA
938GNULIB_STRERROR_R
939GNULIB_STRERROR
940GNULIB_MBSTOK_R
941GNULIB_MBSSEP
942GNULIB_MBSSPN
943GNULIB_MBSPBRK
944GNULIB_MBSCSPN
945GNULIB_MBSCASESTR
946GNULIB_MBSPCASECMP
947GNULIB_MBSNCASECMP
948GNULIB_MBSCASECMP
949GNULIB_MBSSTR
950GNULIB_MBSRCHR
951GNULIB_MBSCHR
952GNULIB_MBSNLEN
953GNULIB_MBSLEN
954GNULIB_STRTOK_R
955GNULIB_STRCASESTR
956GNULIB_STRSTR
957GNULIB_STRSEP
958GNULIB_STRPBRK
959GNULIB_STRNLEN
960GNULIB_STRNDUP
961GNULIB_STRNCAT
962GNULIB_STRDUP
963GNULIB_STRCHRNUL
964GNULIB_STPNCPY
965GNULIB_STPCPY
966GNULIB_RAWMEMCHR
967GNULIB_MEMRCHR
968GNULIB_MEMPCPY
969GNULIB_MEMMEM
970GNULIB_MEMCHR
971GNULIB_FFSLL
972GNULIB_FFSL
c0c3707f 973GNULIB_EXPLICIT_BZERO
5df4cba6
SM
974HAVE_VISIBILITY
975CFLAG_VISIBILITY
976LIB_MBRTOWC
8690e634 977LOCALE_ZH_CN
c0c3707f 978LOCALE_FR_UTF8
8690e634 979LOCALE_JA
88b48903
WN
980NEXT_AS_FIRST_DIRECTIVE_MATH_H
981NEXT_MATH_H
5abebf3c
CB
982LTLIBMULTITHREAD
983LIBMULTITHREAD
984LTLIBTHREAD
985LIBTHREAD
5df4cba6
SM
986LIBSTDTHREAD
987NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
988NEXT_LOCALE_H
989HAVE_XLOCALE_H
990NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
991NEXT_STDDEF_H
992GL_GENERATE_STDDEF_H_FALSE
993GL_GENERATE_STDDEF_H_TRUE
994STDDEF_H
995HAVE_WCHAR_T
996HAVE_MAX_ALIGN_T
997REPLACE_NULL
998REPLACE_STRUCT_LCONV
999REPLACE_FREELOCALE
1000REPLACE_DUPLOCALE
1001REPLACE_NEWLOCALE
1002REPLACE_SETLOCALE
1003REPLACE_LOCALECONV
1004HAVE_FREELOCALE
1005HAVE_DUPLOCALE
1006HAVE_NEWLOCALE
1007GNULIB_LOCALENAME
1008GNULIB_DUPLOCALE
1009GNULIB_SETLOCALE_NULL
1010GNULIB_SETLOCALE
1011GNULIB_LOCALECONV
8690e634 1012LOCALCHARSET_TESTS_ENVIRONMENT
c971b7fa
PA
1013NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
1014NEXT_INTTYPES_H
1015UINT64_MAX_EQ_ULONG_MAX
1016UINT32_MAX_LT_UINTMAX_MAX
1017PRIPTR_PREFIX
c971b7fa
PA
1018INT64_MAX_EQ_LONG_MAX
1019INT32_MAX_LT_INTMAX_MAX
4a626d0a 1020REPLACE_STRTOUMAX
c971b7fa 1021REPLACE_STRTOIMAX
c0c3707f 1022HAVE_IMAXDIV_T
c971b7fa
PA
1023HAVE_DECL_STRTOUMAX
1024HAVE_DECL_STRTOIMAX
1025HAVE_DECL_IMAXDIV
1026HAVE_DECL_IMAXABS
1027GNULIB_STRTOUMAX
1028GNULIB_STRTOIMAX
1029GNULIB_IMAXDIV
1030GNULIB_IMAXABS
1031GL_GENERATE_STDINT_H_FALSE
1032GL_GENERATE_STDINT_H_TRUE
1033STDINT_H
49e4877c
PA
1034HAVE_SYS_INTTYPES_H
1035HAVE_SYS_BITYPES_H
1036HAVE_C99_STDINT_H
c971b7fa
PA
1037WINT_T_SUFFIX
1038WCHAR_T_SUFFIX
1039SIG_ATOMIC_T_SUFFIX
1040SIZE_T_SUFFIX
1041PTRDIFF_T_SUFFIX
1042HAVE_SIGNED_WINT_T
1043HAVE_SIGNED_WCHAR_T
1044HAVE_SIGNED_SIG_ATOMIC_T
1045BITSIZEOF_WINT_T
1046BITSIZEOF_WCHAR_T
1047BITSIZEOF_SIG_ATOMIC_T
1048BITSIZEOF_SIZE_T
1049BITSIZEOF_PTRDIFF_T
1050APPLE_UNIVERSAL_BUILD
c971b7fa
PA
1051HAVE_STDINT_H
1052NEXT_AS_FIRST_DIRECTIVE_STDINT_H
1053NEXT_STDINT_H
c971b7fa
PA
1054HAVE_SYS_TYPES_H
1055HAVE_INTTYPES_H
1056HAVE_WCHAR_H
c0c3707f 1057GNULIB_OVERRIDES_WINT_T
49e4877c
PA
1058GL_GENERATE_LIMITS_H_FALSE
1059GL_GENERATE_LIMITS_H_TRUE
1060LIMITS_H
1061NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
1062NEXT_LIMITS_H
725e2999
JB
1063HAVE_SYS_SOCKET_H
1064NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
1065NEXT_SYS_SOCKET_H
1066HAVE_ACCEPT4
1067HAVE_SA_FAMILY_T
1068HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
1069HAVE_STRUCT_SOCKADDR_STORAGE
1070GNULIB_ACCEPT4
1071GNULIB_SHUTDOWN
1072GNULIB_SETSOCKOPT
1073GNULIB_SENDTO
1074GNULIB_RECVFROM
1075GNULIB_SEND
1076GNULIB_RECV
1077GNULIB_LISTEN
1078GNULIB_GETSOCKOPT
1079GNULIB_GETSOCKNAME
1080GNULIB_GETPEERNAME
1081GNULIB_BIND
1082GNULIB_ACCEPT
1083GNULIB_CONNECT
1084GNULIB_SOCKET
1085INET_NTOP_LIB
5df4cba6
SM
1086LIB_HARD_LOCALE
1087LIB_SETLOCALE_NULL
1088LIB_SCHED_YIELD
1089LIBPMULTITHREAD
1090LIBPTHREAD
6ec2e0f5
SDJ
1091GL_GENERATE_GLOB_H_FALSE
1092GL_GENERATE_GLOB_H_TRUE
1093GLOB_H
c0c3707f
CB
1094HAVE_GLOB_H
1095NEXT_AS_FIRST_DIRECTIVE_GLOB_H
1096NEXT_GLOB_H
1097REPLACE_GLOB_PATTERN_P
1098REPLACE_GLOB
1099HAVE_GLOB_PATTERN_P
1100HAVE_GLOB
1101GNULIB_GLOB
4a626d0a
PA
1102NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
1103NEXT_SYS_TIME_H
1104REPLACE_STRUCT_TIMEVAL
1105REPLACE_GETTIMEOFDAY
4a626d0a
PA
1106HAVE_SYS_TIME_H
1107HAVE_STRUCT_TIMEVAL
1108HAVE_GETTIMEOFDAY
1109GNULIB_GETTIMEOFDAY
6ec2e0f5
SDJ
1110LTLIBINTL
1111LIBINTL
698be2d8
CB
1112LIB_GETRANDOM
1113REPLACE_GETRANDOM
1114HAVE_GETRANDOM
1115GNULIB_GETRANDOM
c0c3707f 1116LIB_GETLOGIN
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"
3734as_fn_append ac_func_list " getdtablesize"
3735as_fn_append ac_func_list " getlogin_r"
3736as_fn_append ac_func_list " getprogname"
3737as_fn_append ac_func_list " getexecname"
698be2d8 3738as_fn_append ac_func_list " getrandom"
c0c3707f
CB
3739as_fn_append ac_header_list " sys/time.h"
3740as_fn_append ac_func_list " gettimeofday"
3741as_fn_append ac_header_list " glob.h"
3742as_fn_append ac_func_list " glob"
3743as_fn_append ac_func_list " glob_pattern_p"
3744as_fn_append ac_func_list " getpwnam_r"
5df4cba6 3745as_fn_append ac_header_list " threads.h"
c0c3707f
CB
3746as_fn_append ac_header_list " netdb.h"
3747as_fn_append ac_header_list " netinet/in.h"
3748as_fn_append ac_header_list " limits.h"
c0c3707f 3749as_fn_append ac_header_list " inttypes.h"
9c9d63b1
PM
3750as_fn_append ac_header_list " sys/types.h"
3751as_fn_append ac_header_list " stdint.h"
698be2d8 3752as_fn_append ac_func_list " isblank"
5df4cba6 3753as_fn_append ac_header_list " xlocale.h"
c0c3707f
CB
3754as_fn_append ac_func_list " lstat"
3755as_fn_append ac_header_list " math.h"
3756as_fn_append ac_func_list " mbsinit"
3757as_fn_append ac_func_list " mbrtowc"
3758as_fn_append ac_header_list " sys/mman.h"
3759as_fn_append ac_func_list " mprotect"
3760as_fn_append ac_func_list " mkostemp"
3761as_fn_append ac_func_list " openat"
9c9d63b1
PM
3762as_fn_append ac_func_list " pipe"
3763as_fn_append ac_func_list " readlink"
c0c3707f
CB
3764as_fn_append ac_func_list " link"
3765as_fn_append ac_func_list " setenv"
c0c3707f
CB
3766as_fn_append ac_func_list " strerror_r"
3767as_fn_append ac_func_list " __xpg_strerror_r"
3768as_fn_append ac_func_list " catgets"
3769as_fn_append ac_func_list " snprintf"
698be2d8 3770as_fn_append ac_header_list " sys/random.h"
c0c3707f
CB
3771as_fn_append ac_header_list " sys/uio.h"
3772as_fn_append ac_func_list " localtime_r"
c0c3707f
CB
3773as_fn_append ac_header_list " crtdefs.h"
3774as_fn_append ac_func_list " iswcntrl"
698be2d8
CB
3775as_fn_append ac_header_list " wctype.h"
3776as_fn_append ac_func_list " wmempcpy"
c971b7fa
PA
3777# Check that the precious variables saved in the cache have kept the same
3778# value.
3779ac_cache_corrupted=false
3780for ac_var in $ac_precious_vars; do
3781 eval ac_old_set=\$ac_cv_env_${ac_var}_set
3782 eval ac_new_set=\$ac_env_${ac_var}_set
3783 eval ac_old_val=\$ac_cv_env_${ac_var}_value
3784 eval ac_new_val=\$ac_env_${ac_var}_value
3785 case $ac_old_set,$ac_new_set in
3786 set,)
3787 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
3788$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
3789 ac_cache_corrupted=: ;;
3790 ,set)
3791 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
3792$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
3793 ac_cache_corrupted=: ;;
3794 ,);;
3795 *)
3796 if test "x$ac_old_val" != "x$ac_new_val"; then
3797 # differences in whitespace do not lead to failure.
3798 ac_old_val_w=`echo x $ac_old_val`
3799 ac_new_val_w=`echo x $ac_new_val`
3800 if test "$ac_old_val_w" != "$ac_new_val_w"; then
3801 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
3802$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
3803 ac_cache_corrupted=:
3804 else
3805 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
3806$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
3807 eval $ac_var=\$ac_old_val
3808 fi
3809 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
3810$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
3811 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
3812$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
3813 fi;;
3814 esac
3815 # Pass precious variables to config.status.
3816 if test "$ac_new_set" = set; then
3817 case $ac_new_val in
3818 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
3819 *) ac_arg=$ac_var=$ac_new_val ;;
3820 esac
3821 case " $ac_configure_args " in
3822 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
3823 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
3824 esac
3825 fi
3826done
3827if $ac_cache_corrupted; then
3828 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3829$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3830 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
3831$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
d0ac1c44 3832 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
c971b7fa
PA
3833fi
3834## -------------------- ##
3835## Main body of script. ##
3836## -------------------- ##
3837
3838ac_ext=c
3839ac_cpp='$CPP $CPPFLAGS'
3840ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3841ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3842ac_compiler_gnu=$ac_cv_c_compiler_gnu
3843
3844
d0ac1c44 3845
73cc7272
TT
3846
3847
3848
c971b7fa
PA
3849ac_config_headers="$ac_config_headers config.h:config.in"
3850
3851
5abebf3c
CB
3852
3853
c971b7fa
PA
3854{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
3855$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
3856 # Check whether --enable-maintainer-mode was given.
3857if test "${enable_maintainer_mode+set}" = set; then :
3858 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
3859else
3860 USE_MAINTAINER_MODE=no
3861fi
3862
3863 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
3864$as_echo "$USE_MAINTAINER_MODE" >&6; }
3865 if test $USE_MAINTAINER_MODE = yes; then
3866 MAINTAINER_MODE_TRUE=
3867 MAINTAINER_MODE_FALSE='#'
3868else
3869 MAINTAINER_MODE_TRUE='#'
3870 MAINTAINER_MODE_FALSE=
3871fi
3872
3873 MAINT=$MAINTAINER_MODE_TRUE
3874
3875
3876
3877ac_ext=c
3878ac_cpp='$CPP $CPPFLAGS'
3879ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3880ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3881ac_compiler_gnu=$ac_cv_c_compiler_gnu
3882if test -n "$ac_tool_prefix"; then
3883 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3884set dummy ${ac_tool_prefix}gcc; ac_word=$2
3885{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3886$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3887if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3888 $as_echo_n "(cached) " >&6
3889else
3890 if test -n "$CC"; then
3891 ac_cv_prog_CC="$CC" # Let the user override the test.
3892else
3893as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3894for as_dir in $PATH
3895do
3896 IFS=$as_save_IFS
3897 test -z "$as_dir" && as_dir=.
3898 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3899 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3900 ac_cv_prog_CC="${ac_tool_prefix}gcc"
3901 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3902 break 2
3903 fi
3904done
3905 done
3906IFS=$as_save_IFS
3907
3908fi
3909fi
3910CC=$ac_cv_prog_CC
3911if test -n "$CC"; then
3912 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3913$as_echo "$CC" >&6; }
3914else
3915 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3916$as_echo "no" >&6; }
3917fi
3918
3919
3920fi
3921if test -z "$ac_cv_prog_CC"; then
3922 ac_ct_CC=$CC
3923 # Extract the first word of "gcc", so it can be a program name with args.
3924set dummy gcc; ac_word=$2
3925{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3926$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3927if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
3928 $as_echo_n "(cached) " >&6
3929else
3930 if test -n "$ac_ct_CC"; then
3931 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3932else
3933as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3934for as_dir in $PATH
3935do
3936 IFS=$as_save_IFS
3937 test -z "$as_dir" && as_dir=.
3938 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3939 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3940 ac_cv_prog_ac_ct_CC="gcc"
3941 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3942 break 2
3943 fi
3944done
3945 done
3946IFS=$as_save_IFS
3947
3948fi
3949fi
3950ac_ct_CC=$ac_cv_prog_ac_ct_CC
3951if test -n "$ac_ct_CC"; then
3952 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3953$as_echo "$ac_ct_CC" >&6; }
3954else
3955 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3956$as_echo "no" >&6; }
3957fi
3958
3959 if test "x$ac_ct_CC" = x; then
3960 CC=""
3961 else
3962 case $cross_compiling:$ac_tool_warned in
3963yes:)
3964{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3965$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3966ac_tool_warned=yes ;;
3967esac
3968 CC=$ac_ct_CC
3969 fi
3970else
3971 CC="$ac_cv_prog_CC"
3972fi
3973
3974if test -z "$CC"; then
3975 if test -n "$ac_tool_prefix"; then
3976 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3977set dummy ${ac_tool_prefix}cc; ac_word=$2
3978{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3979$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3980if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3981 $as_echo_n "(cached) " >&6
3982else
3983 if test -n "$CC"; then
3984 ac_cv_prog_CC="$CC" # Let the user override the test.
3985else
3986as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3987for as_dir in $PATH
3988do
3989 IFS=$as_save_IFS
3990 test -z "$as_dir" && as_dir=.
3991 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3992 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3993 ac_cv_prog_CC="${ac_tool_prefix}cc"
3994 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3995 break 2
3996 fi
3997done
3998 done
3999IFS=$as_save_IFS
4000
4001fi
4002fi
4003CC=$ac_cv_prog_CC
4004if test -n "$CC"; then
4005 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4006$as_echo "$CC" >&6; }
4007else
4008 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4009$as_echo "no" >&6; }
4010fi
4011
4012
4013 fi
4014fi
4015if test -z "$CC"; then
4016 # Extract the first word of "cc", so it can be a program name with args.
4017set dummy cc; ac_word=$2
4018{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4019$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4020if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
4021 $as_echo_n "(cached) " >&6
4022else
4023 if test -n "$CC"; then
4024 ac_cv_prog_CC="$CC" # Let the user override the test.
4025else
4026 ac_prog_rejected=no
4027as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4028for as_dir in $PATH
4029do
4030 IFS=$as_save_IFS
4031 test -z "$as_dir" && as_dir=.
4032 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4033 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4034 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
4035 ac_prog_rejected=yes
4036 continue
4037 fi
4038 ac_cv_prog_CC="cc"
4039 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4040 break 2
4041 fi
4042done
4043 done
4044IFS=$as_save_IFS
4045
4046if test $ac_prog_rejected = yes; then
4047 # We found a bogon in the path, so make sure we never use it.
4048 set dummy $ac_cv_prog_CC
4049 shift
4050 if test $# != 0; then
4051 # We chose a different compiler from the bogus one.
4052 # However, it has the same basename, so the bogon will be chosen
4053 # first if we set CC to just the basename; use the full file name.
4054 shift
4055 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
4056 fi
4057fi
4058fi
4059fi
4060CC=$ac_cv_prog_CC
4061if test -n "$CC"; then
4062 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4063$as_echo "$CC" >&6; }
4064else
4065 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4066$as_echo "no" >&6; }
4067fi
4068
4069
4070fi
4071if test -z "$CC"; then
4072 if test -n "$ac_tool_prefix"; then
4073 for ac_prog in cl.exe
4074 do
4075 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4076set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4077{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4078$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4079if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
4080 $as_echo_n "(cached) " >&6
4081else
4082 if test -n "$CC"; then
4083 ac_cv_prog_CC="$CC" # Let the user override the test.
4084else
4085as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4086for as_dir in $PATH
4087do
4088 IFS=$as_save_IFS
4089 test -z "$as_dir" && as_dir=.
4090 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4091 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4092 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
4093 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4094 break 2
4095 fi
4096done
4097 done
4098IFS=$as_save_IFS
4099
4100fi
4101fi
4102CC=$ac_cv_prog_CC
4103if test -n "$CC"; then
4104 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4105$as_echo "$CC" >&6; }
4106else
4107 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4108$as_echo "no" >&6; }
4109fi
4110
4111
4112 test -n "$CC" && break
4113 done
4114fi
4115if test -z "$CC"; then
4116 ac_ct_CC=$CC
4117 for ac_prog in cl.exe
4118do
4119 # Extract the first word of "$ac_prog", so it can be a program name with args.
4120set dummy $ac_prog; ac_word=$2
4121{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4122$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 4123if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
4124 $as_echo_n "(cached) " >&6
4125else
4126 if test -n "$ac_ct_CC"; then
4127 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4128else
4129as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4130for as_dir in $PATH
4131do
4132 IFS=$as_save_IFS
4133 test -z "$as_dir" && as_dir=.
4134 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 4135 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
4136 ac_cv_prog_ac_ct_CC="$ac_prog"
4137 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4138 break 2
4139 fi
4140done
4141 done
4142IFS=$as_save_IFS
4143
4144fi
4145fi
4146ac_ct_CC=$ac_cv_prog_ac_ct_CC
4147if test -n "$ac_ct_CC"; then
4148 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4149$as_echo "$ac_ct_CC" >&6; }
4150else
4151 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4152$as_echo "no" >&6; }
4153fi
4154
4155
4156 test -n "$ac_ct_CC" && break
4157done
4158
4159 if test "x$ac_ct_CC" = x; then
4160 CC=""
4161 else
4162 case $cross_compiling:$ac_tool_warned in
4163yes:)
4164{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4165$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4166ac_tool_warned=yes ;;
4167esac
4168 CC=$ac_ct_CC
4169 fi
4170fi
4171
c0c3707f
CB
4172fi
4173if test -z "$CC"; then
4174 if test -n "$ac_tool_prefix"; then
4175 # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
4176set dummy ${ac_tool_prefix}clang; ac_word=$2
4177{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4178$as_echo_n "checking for $ac_word... " >&6; }
4179if ${ac_cv_prog_CC+:} false; then :
4180 $as_echo_n "(cached) " >&6
4181else
4182 if test -n "$CC"; then
4183 ac_cv_prog_CC="$CC" # Let the user override the test.
4184else
4185as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4186for as_dir in $PATH
4187do
4188 IFS=$as_save_IFS
4189 test -z "$as_dir" && as_dir=.
4190 for ac_exec_ext in '' $ac_executable_extensions; do
4191 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4192 ac_cv_prog_CC="${ac_tool_prefix}clang"
4193 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4194 break 2
4195 fi
4196done
4197 done
4198IFS=$as_save_IFS
4199
4200fi
4201fi
4202CC=$ac_cv_prog_CC
4203if test -n "$CC"; then
4204 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4205$as_echo "$CC" >&6; }
4206else
4207 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4208$as_echo "no" >&6; }
4209fi
4210
4211
4212fi
4213if test -z "$ac_cv_prog_CC"; then
4214 ac_ct_CC=$CC
4215 # Extract the first word of "clang", so it can be a program name with args.
4216set dummy clang; ac_word=$2
4217{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4218$as_echo_n "checking for $ac_word... " >&6; }
4219if ${ac_cv_prog_ac_ct_CC+:} false; then :
4220 $as_echo_n "(cached) " >&6
4221else
4222 if test -n "$ac_ct_CC"; then
4223 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4224else
4225as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4226for as_dir in $PATH
4227do
4228 IFS=$as_save_IFS
4229 test -z "$as_dir" && as_dir=.
4230 for ac_exec_ext in '' $ac_executable_extensions; do
4231 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4232 ac_cv_prog_ac_ct_CC="clang"
4233 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4234 break 2
4235 fi
4236done
4237 done
4238IFS=$as_save_IFS
4239
4240fi
4241fi
4242ac_ct_CC=$ac_cv_prog_ac_ct_CC
4243if test -n "$ac_ct_CC"; then
4244 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4245$as_echo "$ac_ct_CC" >&6; }
4246else
4247 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4248$as_echo "no" >&6; }
4249fi
4250
4251 if test "x$ac_ct_CC" = x; then
4252 CC=""
4253 else
4254 case $cross_compiling:$ac_tool_warned in
4255yes:)
4256{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4257$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4258ac_tool_warned=yes ;;
4259esac
4260 CC=$ac_ct_CC
4261 fi
4262else
4263 CC="$ac_cv_prog_CC"
4264fi
4265
c971b7fa
PA
4266fi
4267
4268
4269test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4270$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4271as_fn_error $? "no acceptable C compiler found in \$PATH
4272See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4273
4274# Provide some information about the compiler.
4275$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4276set X $ac_compile
4277ac_compiler=$2
c0c3707f 4278for ac_option in --version -v -V -qversion -version; do
c971b7fa
PA
4279 { { ac_try="$ac_compiler $ac_option >&5"
4280case "(($ac_try" in
4281 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4282 *) ac_try_echo=$ac_try;;
4283esac
4284eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4285$as_echo "$ac_try_echo"; } >&5
4286 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4287 ac_status=$?
4288 if test -s conftest.err; then
4289 sed '10a\
4290... rest of stderr output deleted ...
4291 10q' conftest.err >conftest.er1
4292 cat conftest.er1 >&5
c971b7fa 4293 fi
d0ac1c44 4294 rm -f conftest.er1 conftest.err
c971b7fa
PA
4295 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4296 test $ac_status = 0; }
4297done
4298
4299cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4300/* end confdefs.h. */
d0ac1c44 4301
c971b7fa
PA
4302int
4303main ()
4304{
c971b7fa
PA
4305
4306 ;
4307 return 0;
4308}
4309_ACEOF
4310ac_clean_files_save=$ac_clean_files
d0ac1c44 4311ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
c971b7fa
PA
4312# Try to create an executable without -o first, disregard a.out.
4313# It will help us diagnose broken compilers, and finding out an intuition
4314# of exeext.
d0ac1c44
SM
4315{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
4316$as_echo_n "checking whether the C compiler works... " >&6; }
c971b7fa
PA
4317ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
4318
4319# The possible output files:
4320ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
4321
4322ac_rmfiles=
4323for ac_file in $ac_files
4324do
4325 case $ac_file in
4326 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4327 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
4328 esac
4329done
4330rm -f $ac_rmfiles
4331
4332if { { ac_try="$ac_link_default"
4333case "(($ac_try" in
4334 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4335 *) ac_try_echo=$ac_try;;
4336esac
4337eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4338$as_echo "$ac_try_echo"; } >&5
4339 (eval "$ac_link_default") 2>&5
4340 ac_status=$?
4341 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4342 test $ac_status = 0; }; then :
4343 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
4344# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
4345# in a Makefile. We should not override ac_cv_exeext if it was cached,
4346# so that the user can short-circuit this test for compilers unknown to
4347# Autoconf.
4348for ac_file in $ac_files ''
4349do
4350 test -f "$ac_file" || continue
4351 case $ac_file in
4352 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
4353 ;;
4354 [ab].out )
4355 # We found the default executable, but exeext='' is most
4356 # certainly right.
4357 break;;
4358 *.* )
4359 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
4360 then :; else
4361 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4362 fi
4363 # We set ac_cv_exeext here because the later test for it is not
4364 # safe: cross compilers may not add the suffix if given an `-o'
4365 # argument, so we may need to know it at that point already.
4366 # Even if this section looks crufty: it has the advantage of
4367 # actually working.
4368 break;;
4369 * )
4370 break;;
4371 esac
4372done
4373test "$ac_cv_exeext" = no && ac_cv_exeext=
4374
4375else
4376 ac_file=''
4377fi
c971b7fa 4378if test -z "$ac_file"; then :
d0ac1c44
SM
4379 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4380$as_echo "no" >&6; }
4381$as_echo "$as_me: failed program was:" >&5
c971b7fa
PA
4382sed 's/^/| /' conftest.$ac_ext >&5
4383
4384{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4385$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4386as_fn_error 77 "C compiler cannot create executables
4387See \`config.log' for more details" "$LINENO" 5; }
4388else
4389 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4390$as_echo "yes" >&6; }
c971b7fa 4391fi
d0ac1c44
SM
4392{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
4393$as_echo_n "checking for C compiler default output file name... " >&6; }
4394{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
4395$as_echo "$ac_file" >&6; }
c971b7fa
PA
4396ac_exeext=$ac_cv_exeext
4397
d0ac1c44 4398rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
c971b7fa 4399ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4400{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
4401$as_echo_n "checking for suffix of executables... " >&6; }
4402if { { ac_try="$ac_link"
4403case "(($ac_try" in
4404 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4405 *) ac_try_echo=$ac_try;;
4406esac
4407eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4408$as_echo "$ac_try_echo"; } >&5
4409 (eval "$ac_link") 2>&5
4410 ac_status=$?
4411 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4412 test $ac_status = 0; }; then :
4413 # If both `conftest.exe' and `conftest' are `present' (well, observable)
4414# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
4415# work properly (i.e., refer to `conftest.exe'), while it won't with
4416# `rm'.
4417for ac_file in conftest.exe conftest conftest.*; do
4418 test -f "$ac_file" || continue
4419 case $ac_file in
4420 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4421 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4422 break;;
4423 * ) break;;
4424 esac
4425done
4426else
4427 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4428$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4429as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4430See \`config.log' for more details" "$LINENO" 5; }
c971b7fa 4431fi
d0ac1c44 4432rm -f conftest conftest$ac_cv_exeext
c971b7fa
PA
4433{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4434$as_echo "$ac_cv_exeext" >&6; }
4435
4436rm -f conftest.$ac_ext
4437EXEEXT=$ac_cv_exeext
4438ac_exeext=$EXEEXT
d0ac1c44
SM
4439cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4440/* end confdefs.h. */
4441#include <stdio.h>
4442int
4443main ()
4444{
4445FILE *f = fopen ("conftest.out", "w");
4446 return ferror (f) || fclose (f) != 0;
4447
4448 ;
4449 return 0;
4450}
4451_ACEOF
4452ac_clean_files="$ac_clean_files conftest.out"
4453# Check that the compiler produces executables we can run. If not, either
4454# the compiler is broken, or we cross compile.
4455{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4456$as_echo_n "checking whether we are cross compiling... " >&6; }
4457if test "$cross_compiling" != yes; then
4458 { { ac_try="$ac_link"
4459case "(($ac_try" in
4460 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4461 *) ac_try_echo=$ac_try;;
4462esac
4463eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4464$as_echo "$ac_try_echo"; } >&5
4465 (eval "$ac_link") 2>&5
4466 ac_status=$?
4467 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4468 test $ac_status = 0; }
4469 if { ac_try='./conftest$ac_cv_exeext'
4470 { { case "(($ac_try" in
4471 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4472 *) ac_try_echo=$ac_try;;
4473esac
4474eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4475$as_echo "$ac_try_echo"; } >&5
4476 (eval "$ac_try") 2>&5
4477 ac_status=$?
4478 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4479 test $ac_status = 0; }; }; then
4480 cross_compiling=no
4481 else
4482 if test "$cross_compiling" = maybe; then
4483 cross_compiling=yes
4484 else
4485 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4486$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4487as_fn_error $? "cannot run C compiled programs.
4488If you meant to cross compile, use \`--host'.
4489See \`config.log' for more details" "$LINENO" 5; }
4490 fi
4491 fi
4492fi
4493{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4494$as_echo "$cross_compiling" >&6; }
4495
4496rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4497ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4498{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4499$as_echo_n "checking for suffix of object files... " >&6; }
d0ac1c44 4500if ${ac_cv_objext+:} false; then :
c971b7fa
PA
4501 $as_echo_n "(cached) " >&6
4502else
4503 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4504/* end confdefs.h. */
4505
4506int
4507main ()
4508{
4509
4510 ;
4511 return 0;
4512}
4513_ACEOF
4514rm -f conftest.o conftest.obj
4515if { { ac_try="$ac_compile"
4516case "(($ac_try" in
4517 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4518 *) ac_try_echo=$ac_try;;
4519esac
4520eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4521$as_echo "$ac_try_echo"; } >&5
4522 (eval "$ac_compile") 2>&5
4523 ac_status=$?
4524 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4525 test $ac_status = 0; }; then :
4526 for ac_file in conftest.o conftest.obj conftest.*; do
4527 test -f "$ac_file" || continue;
4528 case $ac_file in
4529 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4530 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4531 break;;
4532 esac
4533done
4534else
4535 $as_echo "$as_me: failed program was:" >&5
4536sed 's/^/| /' conftest.$ac_ext >&5
4537
4538{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4539$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4540as_fn_error $? "cannot compute suffix of object files: cannot compile
4541See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4542fi
4543rm -f conftest.$ac_cv_objext conftest.$ac_ext
4544fi
4545{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4546$as_echo "$ac_cv_objext" >&6; }
4547OBJEXT=$ac_cv_objext
4548ac_objext=$OBJEXT
4549{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4550$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
d0ac1c44 4551if ${ac_cv_c_compiler_gnu+:} false; then :
c971b7fa
PA
4552 $as_echo_n "(cached) " >&6
4553else
4554 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4555/* end confdefs.h. */
4556
4557int
4558main ()
4559{
4560#ifndef __GNUC__
4561 choke me
4562#endif
4563
4564 ;
4565 return 0;
4566}
4567_ACEOF
4568if ac_fn_c_try_compile "$LINENO"; then :
4569 ac_compiler_gnu=yes
4570else
4571 ac_compiler_gnu=no
4572fi
4573rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4574ac_cv_c_compiler_gnu=$ac_compiler_gnu
4575
4576fi
4577{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4578$as_echo "$ac_cv_c_compiler_gnu" >&6; }
4579if test $ac_compiler_gnu = yes; then
4580 GCC=yes
4581else
4582 GCC=
4583fi
4584ac_test_CFLAGS=${CFLAGS+set}
4585ac_save_CFLAGS=$CFLAGS
4586{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4587$as_echo_n "checking whether $CC accepts -g... " >&6; }
d0ac1c44 4588if ${ac_cv_prog_cc_g+:} false; then :
c971b7fa
PA
4589 $as_echo_n "(cached) " >&6
4590else
4591 ac_save_c_werror_flag=$ac_c_werror_flag
4592 ac_c_werror_flag=yes
4593 ac_cv_prog_cc_g=no
4594 CFLAGS="-g"
4595 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4596/* end confdefs.h. */
4597
4598int
4599main ()
4600{
4601
4602 ;
4603 return 0;
4604}
4605_ACEOF
4606if ac_fn_c_try_compile "$LINENO"; then :
4607 ac_cv_prog_cc_g=yes
4608else
4609 CFLAGS=""
4610 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4611/* end confdefs.h. */
4612
4613int
4614main ()
4615{
4616
4617 ;
4618 return 0;
4619}
4620_ACEOF
4621if ac_fn_c_try_compile "$LINENO"; then :
4622
4623else
4624 ac_c_werror_flag=$ac_save_c_werror_flag
4625 CFLAGS="-g"
4626 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4627/* end confdefs.h. */
4628
4629int
4630main ()
4631{
4632
4633 ;
4634 return 0;
4635}
4636_ACEOF
4637if ac_fn_c_try_compile "$LINENO"; then :
4638 ac_cv_prog_cc_g=yes
4639fi
4640rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4641fi
4642rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4643fi
4644rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4645 ac_c_werror_flag=$ac_save_c_werror_flag
4646fi
4647{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4648$as_echo "$ac_cv_prog_cc_g" >&6; }
4649if test "$ac_test_CFLAGS" = set; then
4650 CFLAGS=$ac_save_CFLAGS
4651elif test $ac_cv_prog_cc_g = yes; then
4652 if test "$GCC" = yes; then
4653 CFLAGS="-g -O2"
4654 else
4655 CFLAGS="-g"
4656 fi
4657else
4658 if test "$GCC" = yes; then
4659 CFLAGS="-O2"
4660 else
4661 CFLAGS=
4662 fi
4663fi
c0c3707f
CB
4664{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
4665$as_echo_n "checking for $CC option to enable C11 features... " >&6; }
4666if ${ac_cv_prog_cc_c11+:} false; then :
c971b7fa
PA
4667 $as_echo_n "(cached) " >&6
4668else
c0c3707f 4669 ac_cv_prog_cc_c11=no
c971b7fa
PA
4670ac_save_CC=$CC
4671cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4672/* end confdefs.h. */
4673#include <stdarg.h>
c0c3707f
CB
4674#include <stdbool.h>
4675#include <stddef.h>
4676#include <stdlib.h>
4677#include <wchar.h>
c971b7fa 4678#include <stdio.h>
c0c3707f
CB
4679
4680// Check varargs macros. These examples are taken from C99 6.10.3.5.
4681#define debug(...) fprintf (stderr, __VA_ARGS__)
4682#define showlist(...) puts (#__VA_ARGS__)
4683#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4684static void
4685test_varargs_macros (void)
7a6dbc2f 4686{
c0c3707f
CB
4687 int x = 1234;
4688 int y = 5678;
4689 debug ("Flag");
4690 debug ("X = %d\n", x);
4691 showlist (The first, second, and third items.);
4692 report (x>y, "x is %d but y is %d", x, y);
c971b7fa 4693}
c0c3707f
CB
4694
4695// Check long long types.
4696#define BIG64 18446744073709551615ull
4697#define BIG32 4294967295ul
4698#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4699#if !BIG_OK
4700 your preprocessor is broken;
4701#endif
4702#if BIG_OK
4703#else
4704 your preprocessor is broken;
4705#endif
4706static long long int bignum = -9223372036854775807LL;
4707static unsigned long long int ubignum = BIG64;
4708
4709struct incomplete_array
7a6dbc2f 4710{
c0c3707f
CB
4711 int datasize;
4712 double data[];
4713};
4714
4715struct named_init {
4716 int number;
4717 const wchar_t *name;
4718 double average;
4719};
4720
4721typedef const char *ccp;
4722
4723static inline int
4724test_restrict (ccp restrict text)
4725{
4726 // See if C++-style comments work.
4727 // Iterate through items via the restricted pointer.
4728 // Also check for declarations in for loops.
4729 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4730 continue;
4731 return 0;
7a6dbc2f 4732}
7a6dbc2f 4733
c0c3707f
CB
4734// Check varargs and va_copy.
4735static bool
4736test_varargs (const char *format, ...)
4737{
4738 va_list args;
4739 va_start (args, format);
4740 va_list args_copy;
4741 va_copy (args_copy, args);
7a6dbc2f 4742
c0c3707f
CB
4743 const char *str = "";
4744 int number = 0;
4745 float fnumber = 0;
4746
4747 while (*format)
4748 {
4749 switch (*format++)
4750 {
4751 case 's': // string
4752 str = va_arg (args_copy, const char *);
4753 break;
4754 case 'd': // int
4755 number = va_arg (args_copy, int);
4756 break;
4757 case 'f': // float
4758 fnumber = va_arg (args_copy, double);
4759 break;
4760 default:
4761 break;
4762 }
4763 }
4764 va_end (args_copy);
4765 va_end (args);
4766
4767 return *str && number && fnumber;
4768}
4769// Check _Alignas.
4770char _Alignas (double) aligned_as_double;
4771char _Alignas (0) no_special_alignment;
4772extern char aligned_as_int;
4773char _Alignas (0) _Alignas (int) aligned_as_int;
4774
4775// Check _Alignof.
4776enum
4777{
4778 int_alignment = _Alignof (int),
4779 int_array_alignment = _Alignof (int[100]),
4780 char_alignment = _Alignof (char)
4781};
4782_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
4783
4784// Check _Noreturn.
4785int _Noreturn does_not_return (void) { for (;;) continue; }
4786
4787// Check _Static_assert.
4788struct test_static_assert
4789{
4790 int x;
4791 _Static_assert (sizeof (int) <= sizeof (long int),
4792 "_Static_assert does not work in struct");
4793 long int y;
4794};
4795
4796// Check UTF-8 literals.
4797#define u8 syntax error!
4798char const utf8_literal[] = u8"happens to be ASCII" "another string";
4799
4800// Check duplicate typedefs.
4801typedef long *long_ptr;
4802typedef long int *long_ptr;
4803typedef long_ptr long_ptr;
4804
4805// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
4806struct anonymous
4807{
4808 union {
4809 struct { int i; int j; };
4810 struct { int k; long int l; } w;
4811 };
4812 int m;
4813} v1;
c971b7fa 4814
c971b7fa
PA
4815int
4816main ()
4817{
c0c3707f
CB
4818
4819 // Check bool.
4820 _Bool success = false;
4821
4822 // Check restrict.
4823 if (test_restrict ("String literal") == 0)
4824 success = true;
4825 char *restrict newvar = "Another string";
4826
4827 // Check varargs.
4828 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4829 test_varargs_macros ();
4830
4831 // Check flexible array members.
4832 struct incomplete_array *ia =
4833 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4834 ia->datasize = 10;
4835 for (int i = 0; i < ia->datasize; ++i)
4836 ia->data[i] = i * 1.234;
4837
4838 // Check named initializers.
4839 struct named_init ni = {
4840 .number = 34,
4841 .name = L"Test wide string",
4842 .average = 543.34343,
4843 };
4844
4845 ni.number = 58;
4846
4847 int dynamic_array[ni.number];
4848 dynamic_array[ni.number - 1] = 543;
4849
4850 // work around unused variable warnings
4851 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4852 || dynamic_array[ni.number - 1] != 543);
4853
4854 v1.i = 2;
4855 v1.w.k = 5;
4856 _Static_assert ((offsetof (struct anonymous, i)
4857 == offsetof (struct anonymous, w.k)),
4858 "Anonymous union alignment botch");
4859
c971b7fa
PA
4860 ;
4861 return 0;
4862}
4863_ACEOF
c0c3707f 4864for ac_arg in '' -std=gnu11
c971b7fa
PA
4865do
4866 CC="$ac_save_CC $ac_arg"
4867 if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 4868 ac_cv_prog_cc_c11=$ac_arg
c971b7fa
PA
4869fi
4870rm -f core conftest.err conftest.$ac_objext
c0c3707f 4871 test "x$ac_cv_prog_cc_c11" != "xno" && break
c971b7fa
PA
4872done
4873rm -f conftest.$ac_ext
4874CC=$ac_save_CC
4875
4876fi
4877# AC_CACHE_VAL
c0c3707f
CB
4878ac_prog_cc_stdc_options=
4879case "x$ac_cv_prog_cc_c11" in
c971b7fa
PA
4880 x)
4881 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4882$as_echo "none needed" >&6; } ;;
4883 xno)
4884 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4885$as_echo "unsupported" >&6; } ;;
4886 *)
c0c3707f
CB
4887 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
4888 CC=$CC$ac_prog_cc_stdc_options
4889 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
4890$as_echo "$ac_cv_prog_cc_c11" >&6; } ;;
c971b7fa 4891esac
c0c3707f
CB
4892if test "x$ac_cv_prog_cc_c11" != xno; then :
4893 ac_prog_cc_stdc=c11
4894 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
4895else
4896 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
4897$as_echo_n "checking for $CC option to enable C99 features... " >&6; }
4898if ${ac_cv_prog_cc_c99+:} false; then :
4899 $as_echo_n "(cached) " >&6
4900else
4901 ac_cv_prog_cc_c99=no
4902ac_save_CC=$CC
4903cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4904/* end confdefs.h. */
4905#include <stdarg.h>
4906#include <stdbool.h>
4907#include <stddef.h>
4908#include <stdlib.h>
4909#include <wchar.h>
4910#include <stdio.h>
7a6dbc2f 4911
c0c3707f
CB
4912// Check varargs macros. These examples are taken from C99 6.10.3.5.
4913#define debug(...) fprintf (stderr, __VA_ARGS__)
4914#define showlist(...) puts (#__VA_ARGS__)
4915#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4916static void
4917test_varargs_macros (void)
4918{
4919 int x = 1234;
4920 int y = 5678;
4921 debug ("Flag");
4922 debug ("X = %d\n", x);
4923 showlist (The first, second, and third items.);
4924 report (x>y, "x is %d but y is %d", x, y);
4925}
7a6dbc2f 4926
c0c3707f
CB
4927// Check long long types.
4928#define BIG64 18446744073709551615ull
4929#define BIG32 4294967295ul
4930#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4931#if !BIG_OK
4932 your preprocessor is broken;
4933#endif
4934#if BIG_OK
4935#else
4936 your preprocessor is broken;
4937#endif
4938static long long int bignum = -9223372036854775807LL;
4939static unsigned long long int ubignum = BIG64;
7a6dbc2f 4940
c0c3707f
CB
4941struct incomplete_array
4942{
4943 int datasize;
4944 double data[];
4945};
7a6dbc2f 4946
c0c3707f
CB
4947struct named_init {
4948 int number;
4949 const wchar_t *name;
4950 double average;
4951};
7a6dbc2f 4952
c0c3707f 4953typedef const char *ccp;
7a6dbc2f 4954
c0c3707f
CB
4955static inline int
4956test_restrict (ccp restrict text)
4957{
4958 // See if C++-style comments work.
4959 // Iterate through items via the restricted pointer.
4960 // Also check for declarations in for loops.
4961 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4962 continue;
4963 return 0;
4964}
7a6dbc2f 4965
c0c3707f
CB
4966// Check varargs and va_copy.
4967static bool
4968test_varargs (const char *format, ...)
4969{
4970 va_list args;
4971 va_start (args, format);
4972 va_list args_copy;
4973 va_copy (args_copy, args);
4974
4975 const char *str = "";
4976 int number = 0;
4977 float fnumber = 0;
4978
4979 while (*format)
4980 {
4981 switch (*format++)
4982 {
4983 case 's': // string
4984 str = va_arg (args_copy, const char *);
4985 break;
4986 case 'd': // int
4987 number = va_arg (args_copy, int);
4988 break;
4989 case 'f': // float
4990 fnumber = va_arg (args_copy, double);
4991 break;
4992 default:
4993 break;
4994 }
4995 }
4996 va_end (args_copy);
4997 va_end (args);
4998
4999 return *str && number && fnumber;
5000}
5001int
5002main ()
5003{
5004
5005 // Check bool.
5006 _Bool success = false;
5007
5008 // Check restrict.
5009 if (test_restrict ("String literal") == 0)
5010 success = true;
5011 char *restrict newvar = "Another string";
5012
5013 // Check varargs.
5014 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
5015 test_varargs_macros ();
5016
5017 // Check flexible array members.
5018 struct incomplete_array *ia =
5019 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
5020 ia->datasize = 10;
5021 for (int i = 0; i < ia->datasize; ++i)
5022 ia->data[i] = i * 1.234;
5023
5024 // Check named initializers.
5025 struct named_init ni = {
5026 .number = 34,
5027 .name = L"Test wide string",
5028 .average = 543.34343,
5029 };
5030
5031 ni.number = 58;
5032
5033 int dynamic_array[ni.number];
5034 dynamic_array[ni.number - 1] = 543;
5035
5036 // work around unused variable warnings
5037 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
5038 || dynamic_array[ni.number - 1] != 543);
5039
5040 ;
5041 return 0;
5042}
5043_ACEOF
5044for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
5045do
5046 CC="$ac_save_CC $ac_arg"
5047 if ac_fn_c_try_compile "$LINENO"; then :
5048 ac_cv_prog_cc_c99=$ac_arg
5049fi
5050rm -f core conftest.err conftest.$ac_objext
5051 test "x$ac_cv_prog_cc_c99" != "xno" && break
5052done
5053rm -f conftest.$ac_ext
5054CC=$ac_save_CC
5055
5056fi
5057# AC_CACHE_VAL
5058ac_prog_cc_stdc_options=
5059case "x$ac_cv_prog_cc_c99" in
5060 x)
5061 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5062$as_echo "none needed" >&6; } ;;
5063 xno)
5064 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5065$as_echo "unsupported" >&6; } ;;
5066 *)
5067 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
5068 CC=$CC$ac_prog_cc_stdc_options
5069 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
5070$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
5071esac
5072if test "x$ac_cv_prog_cc_c99" != xno; then :
5073 ac_prog_cc_stdc=c99
5074 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
5075else
5076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
5077$as_echo_n "checking for $CC option to enable C89 features... " >&6; }
5078if ${ac_cv_prog_cc_c89+:} false; then :
d0ac1c44
SM
5079 $as_echo_n "(cached) " >&6
5080else
c0c3707f
CB
5081 ac_cv_prog_cc_c89=no
5082ac_save_CC=$CC
5083cat confdefs.h - <<_ACEOF >conftest.$ac_ext
d0ac1c44 5084/* end confdefs.h. */
c0c3707f
CB
5085#include <stdarg.h>
5086#include <stdio.h>
5087struct stat;
5088/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
5089struct buf { int x; };
5090FILE * (*rcsopen) (struct buf *, struct stat *, int);
5091static char *e (p, i)
5092 char **p;
5093 int i;
5094{
5095 return p[i];
5096}
5097static char *f (char * (*g) (char **, int), char **p, ...)
5098{
5099 char *s;
5100 va_list v;
5101 va_start (v,p);
5102 s = g (p, va_arg (v,int));
5103 va_end (v);
5104 return s;
5105}
5106
5107/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
5108 function prototypes and stuff, but not '\xHH' hex character constants.
5109 These don't provoke an error unfortunately, instead are silently treated
5110 as 'x'. The following induces an error, until -std is added to get
5111 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
5112 array size at least. It's necessary to write '\x00'==0 to get something
5113 that's true only with -std. */
5114int osf4_cc_array ['\x00' == 0 ? 1 : -1];
5115
5116/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
5117 inside strings and character constants. */
5118#define FOO(x) 'x'
5119int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
d0ac1c44 5120
c0c3707f
CB
5121int test (int i, double x);
5122struct s1 {int (*f) (int a);};
5123struct s2 {int (*f) (double a);};
5124int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
5125int argc;
5126char **argv;
d0ac1c44
SM
5127int
5128main ()
5129{
c0c3707f 5130return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
d0ac1c44
SM
5131 ;
5132 return 0;
5133}
5134_ACEOF
c0c3707f
CB
5135for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
5136 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
5137do
5138 CC="$ac_save_CC $ac_arg"
5139 if ac_fn_c_try_compile "$LINENO"; then :
5140 ac_cv_prog_cc_c89=$ac_arg
5141fi
5142rm -f core conftest.err conftest.$ac_objext
5143 test "x$ac_cv_prog_cc_c89" != "xno" && break
5144done
5145rm -f conftest.$ac_ext
5146CC=$ac_save_CC
5147
5148fi
5149# AC_CACHE_VAL
5150ac_prog_cc_stdc_options=
5151case "x$ac_cv_prog_cc_c89" in
5152 x)
5153 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5154$as_echo "none needed" >&6; } ;;
5155 xno)
5156 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5157$as_echo "unsupported" >&6; } ;;
5158 *)
5159 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
5160 CC=$CC$ac_prog_cc_stdc_options
5161 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
5162$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
5163esac
5164if test "x$ac_cv_prog_cc_c89" != xno; then :
5165 ac_prog_cc_stdc=c89
5166 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
5167else
5168 ac_prog_cc_stdc=no
5169 ac_cv_prog_cc_stdc=no
5170fi
5171
5172fi
5173
7a6dbc2f 5174fi
c0c3707f 5175
d0ac1c44
SM
5176ac_ext=c
5177ac_cpp='$CPP $CPPFLAGS'
5178ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5179ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5180ac_compiler_gnu=$ac_cv_c_compiler_gnu
5181
5182
5df4cba6
SM
5183 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
5184$as_echo_n "checking whether the compiler is clang... " >&6; }
5185if ${gl_cv_compiler_clang+:} false; then :
5186 $as_echo_n "(cached) " >&6
5187else
5188 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5189/* end confdefs.h. */
5190
5191 #ifdef __clang__
5192 barfbarf
5193 #endif
5194
5195int
5196main ()
5197{
5198
5199 ;
5200 return 0;
5201}
5202
5203_ACEOF
5204if ac_fn_c_try_compile "$LINENO"; then :
5205 gl_cv_compiler_clang=no
5206else
5207 gl_cv_compiler_clang=yes
5208fi
5209rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5210
5211fi
5212{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5
5213$as_echo "$gl_cv_compiler_clang" >&6; }
5214
5215
5216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5
5217$as_echo_n "checking for compiler option needed when checking for declarations... " >&6; }
5218if ${gl_cv_compiler_check_decl_option+:} false; then :
5219 $as_echo_n "(cached) " >&6
5220else
5221 if test $gl_cv_compiler_clang = yes; then
5222 save_ac_compile="$ac_compile"
5223 ac_compile="$ac_compile -Werror=implicit-function-declaration"
5224 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5225/* end confdefs.h. */
5226
5227int
5228main ()
5229{
5230
5231 ;
5232 return 0;
5233}
5234_ACEOF
5235if ac_fn_c_try_compile "$LINENO"; then :
5236 gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'
5237else
5238 gl_cv_compiler_check_decl_option=none
5239fi
5240rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5241 ac_compile="$save_ac_compile"
5242 else
5243 gl_cv_compiler_check_decl_option=none
5244 fi
5245
5246fi
5247{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5
5248$as_echo "$gl_cv_compiler_check_decl_option" >&6; }
5249 if test "x$gl_cv_compiler_check_decl_option" != xnone; then
5250 ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
5251 else
5252 ac_compile_for_check_decl="$ac_compile"
5253 fi
5254
5255
5256
9c9d63b1 5257
c971b7fa
PA
5258ac_ext=c
5259ac_cpp='$CPP $CPPFLAGS'
5260ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5261ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5262ac_compiler_gnu=$ac_cv_c_compiler_gnu
5263{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5264$as_echo_n "checking how to run the C preprocessor... " >&6; }
5265# On Suns, sometimes $CPP names a directory.
5266if test -n "$CPP" && test -d "$CPP"; then
5267 CPP=
5268fi
5269if test -z "$CPP"; then
d0ac1c44 5270 if ${ac_cv_prog_CPP+:} false; then :
c971b7fa
PA
5271 $as_echo_n "(cached) " >&6
5272else
5273 # Double quotes because CPP needs to be expanded
5274 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5275 do
5276 ac_preproc_ok=false
5277for ac_c_preproc_warn_flag in '' yes
5278do
5279 # Use a header file that comes with gcc, so configuring glibc
5280 # with a fresh cross-compiler works.
5281 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5282 # <limits.h> exists even on freestanding compilers.
5283 # On the NeXT, cc -E runs the code through the compiler's parser,
5284 # not just through cpp. "Syntax error" is here to catch this case.
5285 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5286/* end confdefs.h. */
5287#ifdef __STDC__
5288# include <limits.h>
5289#else
5290# include <assert.h>
5291#endif
5292 Syntax error
5293_ACEOF
5294if ac_fn_c_try_cpp "$LINENO"; then :
5295
5296else
5297 # Broken: fails on valid input.
5298continue
5299fi
d0ac1c44 5300rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5301
5302 # OK, works on sane cases. Now check whether nonexistent headers
5303 # can be detected and how.
5304 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5305/* end confdefs.h. */
5306#include <ac_nonexistent.h>
5307_ACEOF
5308if ac_fn_c_try_cpp "$LINENO"; then :
5309 # Broken: success on invalid input.
5310continue
5311else
5312 # Passes both tests.
5313ac_preproc_ok=:
5314break
5315fi
d0ac1c44 5316rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5317
5318done
5319# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5320rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5321if $ac_preproc_ok; then :
5322 break
5323fi
5324
5325 done
5326 ac_cv_prog_CPP=$CPP
5327
5328fi
5329 CPP=$ac_cv_prog_CPP
5330else
5331 ac_cv_prog_CPP=$CPP
5332fi
5333{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5334$as_echo "$CPP" >&6; }
5335ac_preproc_ok=false
5336for ac_c_preproc_warn_flag in '' yes
5337do
5338 # Use a header file that comes with gcc, so configuring glibc
5339 # with a fresh cross-compiler works.
5340 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5341 # <limits.h> exists even on freestanding compilers.
5342 # On the NeXT, cc -E runs the code through the compiler's parser,
5343 # not just through cpp. "Syntax error" is here to catch this case.
5344 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5345/* end confdefs.h. */
5346#ifdef __STDC__
5347# include <limits.h>
5348#else
5349# include <assert.h>
5350#endif
5351 Syntax error
5352_ACEOF
5353if ac_fn_c_try_cpp "$LINENO"; then :
5354
5355else
5356 # Broken: fails on valid input.
5357continue
5358fi
d0ac1c44 5359rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5360
5361 # OK, works on sane cases. Now check whether nonexistent headers
5362 # can be detected and how.
5363 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5364/* end confdefs.h. */
5365#include <ac_nonexistent.h>
5366_ACEOF
5367if ac_fn_c_try_cpp "$LINENO"; then :
5368 # Broken: success on invalid input.
5369continue
5370else
5371 # Passes both tests.
5372ac_preproc_ok=:
5373break
5374fi
d0ac1c44 5375rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5376
5377done
5378# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5379rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5380if $ac_preproc_ok; then :
5381
5382else
5383 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5384$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
5385as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5386See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
5387fi
5388
5389ac_ext=c
5390ac_cpp='$CPP $CPPFLAGS'
5391ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5392ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5393ac_compiler_gnu=$ac_cv_c_compiler_gnu
5394
5395
5396{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
5397$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
d0ac1c44 5398if ${ac_cv_path_GREP+:} false; then :
c971b7fa
PA
5399 $as_echo_n "(cached) " >&6
5400else
5401 if test -z "$GREP"; then
5402 ac_path_GREP_found=false
5403 # Loop through the user's path and test for each of PROGNAME-LIST
5404 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5405for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5406do
5407 IFS=$as_save_IFS
5408 test -z "$as_dir" && as_dir=.
5409 for ac_prog in grep ggrep; do
5410 for ac_exec_ext in '' $ac_executable_extensions; do
5411 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5412 as_fn_executable_p "$ac_path_GREP" || continue
c971b7fa
PA
5413# Check for GNU ac_path_GREP and select it if it is found.
5414 # Check for GNU $ac_path_GREP
5415case `"$ac_path_GREP" --version 2>&1` in
5416*GNU*)
5417 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
5418*)
5419 ac_count=0
5420 $as_echo_n 0123456789 >"conftest.in"
5421 while :
5422 do
5423 cat "conftest.in" "conftest.in" >"conftest.tmp"
5424 mv "conftest.tmp" "conftest.in"
5425 cp "conftest.in" "conftest.nl"
5426 $as_echo 'GREP' >> "conftest.nl"
5427 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5428 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5429 as_fn_arith $ac_count + 1 && ac_count=$as_val
5430 if test $ac_count -gt ${ac_path_GREP_max-0}; then
5431 # Best one so far, save it but keep looking for a better one
5432 ac_cv_path_GREP="$ac_path_GREP"
5433 ac_path_GREP_max=$ac_count
5434 fi
5435 # 10*(2^10) chars as input seems more than enough
5436 test $ac_count -gt 10 && break
5437 done
5438 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5439esac
5440
5441 $ac_path_GREP_found && break 3
5442 done
5443 done
5444 done
5445IFS=$as_save_IFS
5446 if test -z "$ac_cv_path_GREP"; then
d0ac1c44 5447 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5448 fi
5449else
5450 ac_cv_path_GREP=$GREP
5451fi
5452
5453fi
5454{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
5455$as_echo "$ac_cv_path_GREP" >&6; }
5456 GREP="$ac_cv_path_GREP"
5457
5458
5459{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
5460$as_echo_n "checking for egrep... " >&6; }
d0ac1c44 5461if ${ac_cv_path_EGREP+:} false; then :
c971b7fa
PA
5462 $as_echo_n "(cached) " >&6
5463else
5464 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
5465 then ac_cv_path_EGREP="$GREP -E"
5466 else
5467 if test -z "$EGREP"; then
5468 ac_path_EGREP_found=false
5469 # Loop through the user's path and test for each of PROGNAME-LIST
5470 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5471for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5472do
5473 IFS=$as_save_IFS
5474 test -z "$as_dir" && as_dir=.
5475 for ac_prog in egrep; do
5476 for ac_exec_ext in '' $ac_executable_extensions; do
5477 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5478 as_fn_executable_p "$ac_path_EGREP" || continue
c971b7fa
PA
5479# Check for GNU ac_path_EGREP and select it if it is found.
5480 # Check for GNU $ac_path_EGREP
5481case `"$ac_path_EGREP" --version 2>&1` in
5482*GNU*)
5483 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
5484*)
5485 ac_count=0
5486 $as_echo_n 0123456789 >"conftest.in"
5487 while :
5488 do
5489 cat "conftest.in" "conftest.in" >"conftest.tmp"
5490 mv "conftest.tmp" "conftest.in"
5491 cp "conftest.in" "conftest.nl"
5492 $as_echo 'EGREP' >> "conftest.nl"
5493 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5494 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5495 as_fn_arith $ac_count + 1 && ac_count=$as_val
5496 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
5497 # Best one so far, save it but keep looking for a better one
5498 ac_cv_path_EGREP="$ac_path_EGREP"
5499 ac_path_EGREP_max=$ac_count
5500 fi
5501 # 10*(2^10) chars as input seems more than enough
5502 test $ac_count -gt 10 && break
5503 done
5504 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5505esac
5506
5507 $ac_path_EGREP_found && break 3
5508 done
5509 done
5510 done
5511IFS=$as_save_IFS
5512 if test -z "$ac_cv_path_EGREP"; then
d0ac1c44 5513 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5514 fi
5515else
5516 ac_cv_path_EGREP=$EGREP
5517fi
5518
5519 fi
5520fi
5521{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
5522$as_echo "$ac_cv_path_EGREP" >&6; }
5523 EGREP="$ac_cv_path_EGREP"
5524
5525
5526{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
5527$as_echo_n "checking for ANSI C header files... " >&6; }
d0ac1c44 5528if ${ac_cv_header_stdc+:} false; then :
c971b7fa
PA
5529 $as_echo_n "(cached) " >&6
5530else
5531 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5532/* end confdefs.h. */
5533#include <stdlib.h>
5534#include <stdarg.h>
5535#include <string.h>
5536#include <float.h>
5537
5538int
5539main ()
5540{
5541
5542 ;
5543 return 0;
5544}
5545_ACEOF
5546if ac_fn_c_try_compile "$LINENO"; then :
5547 ac_cv_header_stdc=yes
5548else
5549 ac_cv_header_stdc=no
5550fi
5551rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5552
5553if test $ac_cv_header_stdc = yes; then
5554 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5555 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5556/* end confdefs.h. */
5557#include <string.h>
5558
5559_ACEOF
5560if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5561 $EGREP "memchr" >/dev/null 2>&1; then :
5562
5563else
5564 ac_cv_header_stdc=no
5565fi
5566rm -f conftest*
5567
5568fi
5569
5570if test $ac_cv_header_stdc = yes; then
5571 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5572 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5573/* end confdefs.h. */
5574#include <stdlib.h>
5575
5576_ACEOF
5577if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5578 $EGREP "free" >/dev/null 2>&1; then :
5579
5580else
5581 ac_cv_header_stdc=no
5582fi
5583rm -f conftest*
5584
5585fi
5586
5587if test $ac_cv_header_stdc = yes; then
5588 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5589 if test "$cross_compiling" = yes; then :
5590 :
5591else
5592 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5593/* end confdefs.h. */
5594#include <ctype.h>
5595#include <stdlib.h>
5596#if ((' ' & 0x0FF) == 0x020)
5597# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5598# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5599#else
5600# define ISLOWER(c) \
5601 (('a' <= (c) && (c) <= 'i') \
5602 || ('j' <= (c) && (c) <= 'r') \
5603 || ('s' <= (c) && (c) <= 'z'))
5604# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
5605#endif
5606
5607#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5608int
5609main ()
5610{
5611 int i;
5612 for (i = 0; i < 256; i++)
5613 if (XOR (islower (i), ISLOWER (i))
5614 || toupper (i) != TOUPPER (i))
5615 return 2;
5616 return 0;
5617}
5618_ACEOF
5619if ac_fn_c_try_run "$LINENO"; then :
5620
5621else
5622 ac_cv_header_stdc=no
5623fi
5624rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5625 conftest.$ac_objext conftest.beam conftest.$ac_ext
5626fi
5627
5628fi
5629fi
5630{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
5631$as_echo "$ac_cv_header_stdc" >&6; }
5632if test $ac_cv_header_stdc = yes; then
5633
5634$as_echo "#define STDC_HEADERS 1" >>confdefs.h
5635
5636fi
5637
5638# On IRIX 5.3, sys/types and inttypes.h are conflicting.
5639for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
5640 inttypes.h stdint.h unistd.h
5641do :
5642 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5643ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5644"
d0ac1c44 5645if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
c971b7fa
PA
5646 cat >>confdefs.h <<_ACEOF
5647#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5648_ACEOF
5649
5650fi
5651
5652done
5653
5654
5655
c971b7fa
PA
5656
5657
9c9d63b1
PM
5658 for ac_header in $ac_header_list
5659do :
5660 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5661ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5662"
5663if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
5664 cat >>confdefs.h <<_ACEOF
5665#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5666_ACEOF
c971b7fa 5667
9c9d63b1
PM
5668fi
5669
5670done
c971b7fa
PA
5671
5672
c971b7fa
PA
5673
5674
c971b7fa 5675
c971b7fa 5676
c971b7fa 5677
c971b7fa
PA
5678
5679
5680 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
5681$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
d0ac1c44 5682if ${ac_cv_safe_to_define___extensions__+:} false; then :
c971b7fa
PA
5683 $as_echo_n "(cached) " >&6
5684else
5685 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5686/* end confdefs.h. */
5687
5688# define __EXTENSIONS__ 1
5689 $ac_includes_default
5690int
5691main ()
5692{
5693
5694 ;
5695 return 0;
5696}
5697_ACEOF
5698if ac_fn_c_try_compile "$LINENO"; then :
5699 ac_cv_safe_to_define___extensions__=yes
5700else
5701 ac_cv_safe_to_define___extensions__=no
5702fi
5703rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5704fi
5705{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
5706$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
c971b7fa 5707
4a626d0a
PA
5708 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
5709$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
d0ac1c44 5710if ${ac_cv_should_define__xopen_source+:} false; then :
4a626d0a
PA
5711 $as_echo_n "(cached) " >&6
5712else
5713 ac_cv_should_define__xopen_source=no
9c9d63b1
PM
5714 if test $ac_cv_header_wchar_h = yes; then :
5715 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4a626d0a
PA
5716/* end confdefs.h. */
5717
5718 #include <wchar.h>
5719 mbstate_t x;
5720int
5721main ()
5722{
5723
5724 ;
5725 return 0;
5726}
5727_ACEOF
5728if ac_fn_c_try_compile "$LINENO"; then :
5729
5730else
5731 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5732/* end confdefs.h. */
5733
9c9d63b1
PM
5734 #define _XOPEN_SOURCE 500
5735 #include <wchar.h>
5736 mbstate_t x;
4a626d0a
PA
5737int
5738main ()
5739{
5740
5741 ;
5742 return 0;
5743}
5744_ACEOF
5745if ac_fn_c_try_compile "$LINENO"; then :
5746 ac_cv_should_define__xopen_source=yes
5747fi
d0ac1c44
SM
5748rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5749fi
5750rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5751fi
9c9d63b1 5752fi
d0ac1c44
SM
5753{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
5754$as_echo "$ac_cv_should_define__xopen_source" >&6; }
9c9d63b1
PM
5755
5756 $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
5757
5758 $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
5759
5760 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
d0ac1c44 5761
c0c3707f
CB
5762 $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
5763
9c9d63b1
PM
5764 $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
5765
5766 $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h
5767
5768 $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
5769
5770 $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
5771
5772 $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
5773
5774 $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
5775
5776 $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
5777
5778 $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
5779
5780 $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
5781
5782 $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
5783
5784 $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
5785
5786 if test $ac_cv_header_minix_config_h = yes; then :
5787 MINIX=yes
5788 $as_echo "#define _MINIX 1" >>confdefs.h
5789
5790 $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
5791
5792 $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
5793
5794else
5795 MINIX=
5796fi
5797 if test $ac_cv_safe_to_define___extensions__ = yes; then :
5798 $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
5799
5800fi
5801 if test $ac_cv_should_define__xopen_source = yes; then :
5802 $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
5803
5804fi
d0ac1c44 5805
c8693053
RO
5806# Needs to run before gl_EARLY so it can override AC_SYS_LARGEFILE included
5807# there.
c0c3707f
CB
5808ac_aux_dir=
5809for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
5810 if test -f "$ac_dir/install-sh"; then
5811 ac_aux_dir=$ac_dir
5812 ac_install_sh="$ac_aux_dir/install-sh -c"
5813 break
5814 elif test -f "$ac_dir/install.sh"; then
5815 ac_aux_dir=$ac_dir
5816 ac_install_sh="$ac_aux_dir/install.sh -c"
5817 break
5818 elif test -f "$ac_dir/shtool"; then
5819 ac_aux_dir=$ac_dir
5820 ac_install_sh="$ac_aux_dir/shtool install -c"
5821 break
5822 fi
5823done
5824if test -z "$ac_aux_dir"; then
5825 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
5826fi
5827
5828# These three variables are undocumented and unsupported,
5829# and are intended to be withdrawn in a future Autoconf release.
5830# They can cause serious problems if a builder's source tree is in a directory
5831# whose full name contains unusual characters.
5832ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
5833ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
5834ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
5835
5836
4a626d0a
PA
5837# Make sure we can run config.sub.
5838$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
d0ac1c44 5839 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4a626d0a
PA
5840
5841{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
5842$as_echo_n "checking build system type... " >&6; }
d0ac1c44 5843if ${ac_cv_build+:} false; then :
4a626d0a
PA
5844 $as_echo_n "(cached) " >&6
5845else
5846 ac_build_alias=$build_alias
5847test "x$ac_build_alias" = x &&
5848 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
5849test "x$ac_build_alias" = x &&
d0ac1c44 5850 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4a626d0a 5851ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
d0ac1c44 5852 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4a626d0a
PA
5853
5854fi
5855{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
5856$as_echo "$ac_cv_build" >&6; }
5857case $ac_cv_build in
5858*-*-*) ;;
d0ac1c44 5859*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4a626d0a
PA
5860esac
5861build=$ac_cv_build
5862ac_save_IFS=$IFS; IFS='-'
5863set x $ac_cv_build
5864shift
5865build_cpu=$1
5866build_vendor=$2
5867shift; shift
5868# Remember, the first character of IFS is used to create $*,
5869# except with old shells:
5870build_os=$*
5871IFS=$ac_save_IFS
5872case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
5873
5874
5875{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
5876$as_echo_n "checking host system type... " >&6; }
d0ac1c44 5877if ${ac_cv_host+:} false; then :
4a626d0a
PA
5878 $as_echo_n "(cached) " >&6
5879else
5880 if test "x$host_alias" = x; then
5881 ac_cv_host=$ac_cv_build
5882else
5883 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
d0ac1c44 5884 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4a626d0a
PA
5885fi
5886
5887fi
5888{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
5889$as_echo "$ac_cv_host" >&6; }
5890case $ac_cv_host in
5891*-*-*) ;;
d0ac1c44 5892*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4a626d0a
PA
5893esac
5894host=$ac_cv_host
5895ac_save_IFS=$IFS; IFS='-'
5896set x $ac_cv_host
5897shift
5898host_cpu=$1
5899host_vendor=$2
5900shift; shift
5901# Remember, the first character of IFS is used to create $*,
5902# except with old shells:
5903host_os=$*
5904IFS=$ac_save_IFS
5905case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
5906
5907
c8693053
RO
5908{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
5909$as_echo_n "checking target system type... " >&6; }
5910if ${ac_cv_target+:} false; then :
5911 $as_echo_n "(cached) " >&6
5912else
5913 if test "x$target_alias" = x; then
5914 ac_cv_target=$ac_cv_host
5915else
5916 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
5917 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
5918fi
c971b7fa 5919
c8693053
RO
5920fi
5921{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
5922$as_echo "$ac_cv_target" >&6; }
5923case $ac_cv_target in
5924*-*-*) ;;
5925*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
5926esac
5927target=$ac_cv_target
5928ac_save_IFS=$IFS; IFS='-'
5929set x $ac_cv_target
5930shift
5931target_cpu=$1
5932target_vendor=$2
5933shift; shift
5934# Remember, the first character of IFS is used to create $*,
5935# except with old shells:
5936target_os=$*
5937IFS=$ac_save_IFS
5938case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
c971b7fa 5939
88b48903 5940
c8693053
RO
5941# The aliases save the names the user supplied, while $host etc.
5942# will get canonicalized.
5943test -n "$target_alias" &&
5944 test "$program_prefix$program_suffix$program_transform_name" = \
5945 NONENONEs,x,x, &&
5946 program_prefix=${target_alias}-
5947
5948# The tests for host and target for $enable_largefile require
5949# canonical names.
5950
5951
5952
5953# As the $enable_largefile decision depends on --enable-plugins we must set it
5954# even in directories otherwise not depending on the $plugins option.
5955
5956
5957 maybe_plugins=no
5958 for ac_header in dlfcn.h
5959do :
5960 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
5961"
5962if test "x$ac_cv_header_dlfcn_h" = xyes; then :
5963 cat >>confdefs.h <<_ACEOF
5964#define HAVE_DLFCN_H 1
5965_ACEOF
5966 maybe_plugins=yes
5967fi
5968
5969done
5970
5971 for ac_header in windows.h
5972do :
5973 ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
5974"
5975if test "x$ac_cv_header_windows_h" = xyes; then :
5976 cat >>confdefs.h <<_ACEOF
5977#define HAVE_WINDOWS_H 1
5978_ACEOF
5979 maybe_plugins=yes
5980fi
5981
5982done
5983
5984
5985 # Check whether --enable-plugins was given.
5986if test "${enable_plugins+set}" = set; then :
5987 enableval=$enable_plugins; case "${enableval}" in
5988 no) plugins=no ;;
5989 *) plugins=yes
5990 if test "$maybe_plugins" != "yes" ; then
5991 as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
5992 fi ;;
5993 esac
5994else
5995 plugins=$maybe_plugins
5996
5997fi
5998
5999 if test "$plugins" = "yes"; then
6000 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5
6001$as_echo_n "checking for library containing dlsym... " >&6; }
6002if ${ac_cv_search_dlsym+:} false; then :
6003 $as_echo_n "(cached) " >&6
6004else
6005 ac_func_search_save_LIBS=$LIBS
6006cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6007/* end confdefs.h. */
6008
6009/* Override any GCC internal prototype to avoid an error.
6010 Use char because int might match the return type of a GCC
6011 builtin and then its argument prototype would still apply. */
6012#ifdef __cplusplus
6013extern "C"
6014#endif
6015char dlsym ();
6016int
6017main ()
6018{
6019return dlsym ();
6020 ;
6021 return 0;
6022}
6023_ACEOF
6024for ac_lib in '' dl; do
6025 if test -z "$ac_lib"; then
6026 ac_res="none required"
6027 else
6028 ac_res=-l$ac_lib
6029 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6030 fi
6031 if ac_fn_c_try_link "$LINENO"; then :
6032 ac_cv_search_dlsym=$ac_res
6033fi
6034rm -f core conftest.err conftest.$ac_objext \
6035 conftest$ac_exeext
6036 if ${ac_cv_search_dlsym+:} false; then :
6037 break
6038fi
6039done
6040if ${ac_cv_search_dlsym+:} false; then :
6041
6042else
6043 ac_cv_search_dlsym=no
6044fi
6045rm conftest.$ac_ext
6046LIBS=$ac_func_search_save_LIBS
6047fi
6048{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5
6049$as_echo "$ac_cv_search_dlsym" >&6; }
6050ac_res=$ac_cv_search_dlsym
6051if test "$ac_res" != no; then :
6052 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6053
6054fi
6055
6056 fi
6057
6058
6059case "${host}" in
6060 sparc-*-solaris*|i?86-*-solaris*)
6061 # On native 32-bit Solaris/SPARC and x86, large-file and procfs support
6062 # were mutually exclusive until Solaris 11.3. Without procfs support,
6063 # the bfd/ elf module cannot provide certain routines such as
6064 # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user
6065 # explicitly requested large-file support through the
6066 # --enable-largefile switch, disable large-file support in favor of
6067 # procfs support.
6068 #
6069 # Check if <sys/procfs.h> is incompatible with large-file support.
6070 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6071/* end confdefs.h. */
6072#define _FILE_OFFSET_BITS 64
6073#define _STRUCTURED_PROC 1
6074#include <sys/procfs.h>
6075int
6076main ()
6077{
6078
6079 ;
6080 return 0;
6081}
6082_ACEOF
6083if ac_fn_c_try_compile "$LINENO"; then :
6084 acx_cv_procfs_lfs=yes
6085else
6086 acx_cv_procfs_lfs=no
6087fi
6088rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6089 #
6090 # Forcefully disable large-file support only if necessary, gdb is in
6091 # tree and enabled.
6092 if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \
6093 -a -d $srcdir/../gdb -a "$enable_gdb" != no; then
6094 : ${enable_largefile="no"}
6095 if test "$plugins" = yes; then
6096 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
6097plugin support disabled; require large-file support which is incompatible with GDB." >&5
6098$as_echo "$as_me: WARNING:
6099plugin support disabled; require large-file support which is incompatible with GDB." >&2;}
6100 plugins=no
88b48903 6101 fi
c8693053
RO
6102 fi
6103 #
6104 # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the
6105 # benefit of g++ 9+ which predefines it on Solaris.
6106 if test "$enable_largefile" = no; then
6107 LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS"
6108
6109 fi
6110 ;;
6111esac
88b48903 6112
2196f55f
YQ
6113# Check whether --enable-largefile was given.
6114if test "${enable_largefile+set}" = set; then :
6115 enableval=$enable_largefile;
6116fi
6117
6118if test "$enable_largefile" != no; then
6119
6120 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
6121$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
d0ac1c44 6122if ${ac_cv_sys_largefile_CC+:} false; then :
2196f55f
YQ
6123 $as_echo_n "(cached) " >&6
6124else
6125 ac_cv_sys_largefile_CC=no
6126 if test "$GCC" != yes; then
6127 ac_save_CC=$CC
6128 while :; do
6129 # IRIX 6.2 and later do not support large files by default,
6130 # so use the C compiler's -n32 option if that helps.
6131 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6132/* end confdefs.h. */
6133#include <sys/types.h>
6134 /* Check that off_t can represent 2**63 - 1 correctly.
6135 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6136 since some C++ compilers masquerading as C compilers
6137 incorrectly reject 9223372036854775807. */
9c9d63b1 6138#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6139 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6140 && LARGE_OFF_T % 2147483647 == 1)
6141 ? 1 : -1];
6142int
6143main ()
6144{
6145
6146 ;
6147 return 0;
6148}
6149_ACEOF
6150 if ac_fn_c_try_compile "$LINENO"; then :
6151 break
6152fi
6153rm -f core conftest.err conftest.$ac_objext
6154 CC="$CC -n32"
6155 if ac_fn_c_try_compile "$LINENO"; then :
6156 ac_cv_sys_largefile_CC=' -n32'; break
6157fi
6158rm -f core conftest.err conftest.$ac_objext
6159 break
6160 done
6161 CC=$ac_save_CC
6162 rm -f conftest.$ac_ext
6163 fi
6164fi
6165{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6166$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6167 if test "$ac_cv_sys_largefile_CC" != no; then
6168 CC=$CC$ac_cv_sys_largefile_CC
6169 fi
6170
6171 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6172$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
d0ac1c44 6173if ${ac_cv_sys_file_offset_bits+:} false; then :
2196f55f
YQ
6174 $as_echo_n "(cached) " >&6
6175else
6176 while :; do
6177 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6178/* end confdefs.h. */
6179#include <sys/types.h>
6180 /* Check that off_t can represent 2**63 - 1 correctly.
6181 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6182 since some C++ compilers masquerading as C compilers
6183 incorrectly reject 9223372036854775807. */
9c9d63b1 6184#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6185 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6186 && LARGE_OFF_T % 2147483647 == 1)
6187 ? 1 : -1];
6188int
6189main ()
6190{
6191
6192 ;
6193 return 0;
6194}
6195_ACEOF
6196if ac_fn_c_try_compile "$LINENO"; then :
6197 ac_cv_sys_file_offset_bits=no; break
6198fi
6199rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6200 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6201/* end confdefs.h. */
6202#define _FILE_OFFSET_BITS 64
6203#include <sys/types.h>
6204 /* Check that off_t can represent 2**63 - 1 correctly.
6205 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6206 since some C++ compilers masquerading as C compilers
6207 incorrectly reject 9223372036854775807. */
9c9d63b1 6208#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6209 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6210 && LARGE_OFF_T % 2147483647 == 1)
6211 ? 1 : -1];
6212int
6213main ()
6214{
6215
6216 ;
6217 return 0;
6218}
6219_ACEOF
6220if ac_fn_c_try_compile "$LINENO"; then :
6221 ac_cv_sys_file_offset_bits=64; break
6222fi
6223rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6224 ac_cv_sys_file_offset_bits=unknown
6225 break
6226done
6227fi
6228{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6229$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6230case $ac_cv_sys_file_offset_bits in #(
6231 no | unknown) ;;
6232 *)
6233cat >>confdefs.h <<_ACEOF
6234#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6235_ACEOF
6236;;
6237esac
6238rm -rf conftest*
6239 if test $ac_cv_sys_file_offset_bits = unknown; then
6240 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6241$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
d0ac1c44 6242if ${ac_cv_sys_large_files+:} false; then :
2196f55f
YQ
6243 $as_echo_n "(cached) " >&6
6244else
6245 while :; do
6246 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6247/* end confdefs.h. */
6248#include <sys/types.h>
6249 /* Check that off_t can represent 2**63 - 1 correctly.
6250 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6251 since some C++ compilers masquerading as C compilers
6252 incorrectly reject 9223372036854775807. */
9c9d63b1 6253#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6254 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6255 && LARGE_OFF_T % 2147483647 == 1)
6256 ? 1 : -1];
6257int
6258main ()
6259{
6260
6261 ;
6262 return 0;
6263}
6264_ACEOF
6265if ac_fn_c_try_compile "$LINENO"; then :
6266 ac_cv_sys_large_files=no; break
6267fi
6268rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6269 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6270/* end confdefs.h. */
6271#define _LARGE_FILES 1
6272#include <sys/types.h>
6273 /* Check that off_t can represent 2**63 - 1 correctly.
6274 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6275 since some C++ compilers masquerading as C compilers
6276 incorrectly reject 9223372036854775807. */
9c9d63b1 6277#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
2196f55f
YQ
6278 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6279 && LARGE_OFF_T % 2147483647 == 1)
6280 ? 1 : -1];
6281int
6282main ()
6283{
6284
6285 ;
6286 return 0;
6287}
6288_ACEOF
6289if ac_fn_c_try_compile "$LINENO"; then :
6290 ac_cv_sys_large_files=1; break
6291fi
6292rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6293 ac_cv_sys_large_files=unknown
6294 break
6295done
6296fi
6297{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6298$as_echo "$ac_cv_sys_large_files" >&6; }
6299case $ac_cv_sys_large_files in #(
6300 no | unknown) ;;
6301 *)
6302cat >>confdefs.h <<_ACEOF
6303#define _LARGE_FILES $ac_cv_sys_large_files
6304_ACEOF
6305;;
6306esac
6307rm -rf conftest*
6308 fi
2196f55f
YQ
6309fi
6310
88b48903
WN
6311
6312
5abebf3c
CB
6313
6314
6315
9c9d63b1
PM
6316 case "$host_os" in
6317 openbsd*)
6318
6319$as_echo "#define _ISOC11_SOURCE 1" >>confdefs.h
c0c3707f 6320
9c9d63b1
PM
6321 ;;
6322 esac
5abebf3c 6323
5abebf3c 6324
c0c3707f
CB
6325
6326
c8693053
RO
6327 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
6328$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
6329if ${gl_cv_c_amsterdam_compiler+:} false; then :
6330 $as_echo_n "(cached) " >&6
6331else
c0c3707f 6332
c8693053
RO
6333 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6334/* end confdefs.h. */
5abebf3c 6335
c8693053
RO
6336#ifdef __ACK__
6337Amsterdam
6338#endif
5abebf3c 6339
c8693053
RO
6340_ACEOF
6341if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6342 $EGREP "Amsterdam" >/dev/null 2>&1; then :
6343 gl_cv_c_amsterdam_compiler=yes
6344else
6345 gl_cv_c_amsterdam_compiler=no
6346fi
6347rm -f conftest*
5abebf3c
CB
6348
6349
c8693053
RO
6350fi
6351{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
6352$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
5abebf3c 6353
c8693053
RO
6354 if test $gl_cv_c_amsterdam_compiler = yes; then
6355 if test -z "$AR"; then
6356 AR='cc -c.a'
6357 fi
6358 if test -z "$ARFLAGS"; then
6359 ARFLAGS='-o'
6360 fi
6361 else
6362 :
6363 fi
c971b7fa 6364
c8693053
RO
6365 if test -n "$ac_tool_prefix"; then
6366 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6367set dummy ${ac_tool_prefix}ar; ac_word=$2
6368{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6369$as_echo_n "checking for $ac_word... " >&6; }
6370if ${ac_cv_prog_AR+:} false; then :
6371 $as_echo_n "(cached) " >&6
6372else
6373 if test -n "$AR"; then
6374 ac_cv_prog_AR="$AR" # Let the user override the test.
6375else
6376as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6377for as_dir in $PATH
6378do
6379 IFS=$as_save_IFS
6380 test -z "$as_dir" && as_dir=.
6381 for ac_exec_ext in '' $ac_executable_extensions; do
6382 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6383 ac_cv_prog_AR="${ac_tool_prefix}ar"
6384 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6385 break 2
6386 fi
6387done
6388 done
6389IFS=$as_save_IFS
c971b7fa 6390
c8693053
RO
6391fi
6392fi
6393AR=$ac_cv_prog_AR
6394if test -n "$AR"; then
6395 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
6396$as_echo "$AR" >&6; }
6397else
6398 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6399$as_echo "no" >&6; }
6400fi
c971b7fa 6401
c971b7fa 6402
c8693053
RO
6403fi
6404if test -z "$ac_cv_prog_AR"; then
6405 ac_ct_AR=$AR
6406 # Extract the first word of "ar", so it can be a program name with args.
6407set dummy ar; ac_word=$2
6408{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6409$as_echo_n "checking for $ac_word... " >&6; }
6410if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
6411 $as_echo_n "(cached) " >&6
6412else
c8693053
RO
6413 if test -n "$ac_ct_AR"; then
6414 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5e8754f9 6415else
c8693053
RO
6416as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6417for as_dir in $PATH
6418do
6419 IFS=$as_save_IFS
6420 test -z "$as_dir" && as_dir=.
6421 for ac_exec_ext in '' $ac_executable_extensions; do
6422 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6423 ac_cv_prog_ac_ct_AR="ar"
6424 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6425 break 2
6426 fi
6427done
6428 done
6429IFS=$as_save_IFS
7a6dbc2f 6430
c971b7fa 6431fi
c8693053
RO
6432fi
6433ac_ct_AR=$ac_cv_prog_ac_ct_AR
6434if test -n "$ac_ct_AR"; then
6435 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
6436$as_echo "$ac_ct_AR" >&6; }
6437else
6438 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6439$as_echo "no" >&6; }
6440fi
5e8754f9 6441
c8693053
RO
6442 if test "x$ac_ct_AR" = x; then
6443 AR="ar"
6444 else
6445 case $cross_compiling:$ac_tool_warned in
6446yes:)
6447{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6448$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6449ac_tool_warned=yes ;;
6450esac
6451 AR=$ac_ct_AR
6452 fi
6453else
6454 AR="$ac_cv_prog_AR"
6455fi
c0c3707f 6456
c8693053
RO
6457 if test -z "$ARFLAGS"; then
6458 ARFLAGS='cr'
6459 fi
7a6dbc2f 6460
7a6dbc2f 6461
c0c3707f 6462
c8693053
RO
6463 if test -z "$RANLIB"; then
6464 if test $gl_cv_c_amsterdam_compiler = yes; then
6465 RANLIB=':'
6466 else
6467 if test -n "$ac_tool_prefix"; then
6468 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6469set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6470{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6471$as_echo_n "checking for $ac_word... " >&6; }
6472if ${ac_cv_prog_RANLIB+:} false; then :
6473 $as_echo_n "(cached) " >&6
6474else
6475 if test -n "$RANLIB"; then
6476 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6477else
6478as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6479for as_dir in $PATH
6480do
6481 IFS=$as_save_IFS
6482 test -z "$as_dir" && as_dir=.
6483 for ac_exec_ext in '' $ac_executable_extensions; do
6484 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6485 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6486 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6487 break 2
6488 fi
5e8754f9 6489done
c8693053
RO
6490 done
6491IFS=$as_save_IFS
5e8754f9 6492
c971b7fa 6493fi
c8693053
RO
6494fi
6495RANLIB=$ac_cv_prog_RANLIB
6496if test -n "$RANLIB"; then
6497 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6498$as_echo "$RANLIB" >&6; }
c0c3707f 6499else
c8693053
RO
6500 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6501$as_echo "no" >&6; }
5e8754f9 6502fi
c0c3707f 6503
c8693053
RO
6504
6505fi
6506if test -z "$ac_cv_prog_RANLIB"; then
6507 ac_ct_RANLIB=$RANLIB
6508 # Extract the first word of "ranlib", so it can be a program name with args.
6509set dummy ranlib; ac_word=$2
6510{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6511$as_echo_n "checking for $ac_word... " >&6; }
6512if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
6513 $as_echo_n "(cached) " >&6
6514else
c8693053
RO
6515 if test -n "$ac_ct_RANLIB"; then
6516 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6517else
6518as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6519for as_dir in $PATH
6520do
6521 IFS=$as_save_IFS
6522 test -z "$as_dir" && as_dir=.
6523 for ac_exec_ext in '' $ac_executable_extensions; do
6524 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6525 ac_cv_prog_ac_ct_RANLIB="ranlib"
6526 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6527 break 2
5e8754f9
SDJ
6528 fi
6529done
c8693053
RO
6530 done
6531IFS=$as_save_IFS
5e8754f9
SDJ
6532
6533fi
6534fi
c8693053
RO
6535ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6536if test -n "$ac_ct_RANLIB"; then
6537 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6538$as_echo "$ac_ct_RANLIB" >&6; }
6539else
6540 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6541$as_echo "no" >&6; }
6542fi
c0c3707f 6543
c8693053
RO
6544 if test "x$ac_ct_RANLIB" = x; then
6545 RANLIB=":"
6546 else
6547 case $cross_compiling:$ac_tool_warned in
6548yes:)
6549{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6550$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6551ac_tool_warned=yes ;;
6552esac
6553 RANLIB=$ac_ct_RANLIB
6554 fi
6555else
6556 RANLIB="$ac_cv_prog_RANLIB"
5e8754f9
SDJ
6557fi
6558
c8693053 6559 fi
c0c3707f 6560 fi
5e8754f9 6561
5e8754f9 6562
5e8754f9 6563
5e8754f9
SDJ
6564
6565
5e8754f9 6566
c8693053
RO
6567 # IEEE behaviour is the default on all CPUs except Alpha and SH
6568 # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
6569 # and the GCC 4.1.2 manual).
6570 case "$host_cpu" in
6571 alpha*)
6572 # On Alpha systems, a compiler option provides the behaviour.
6573 # See the ieee(3) manual page, also available at
6574 # <https://backdrift.org/man/tru64/man3/ieee.3.html>
6575 if test -n "$GCC"; then
6576 # GCC has the option -mieee.
6577 # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
6578 CPPFLAGS="$CPPFLAGS -mieee"
6579 else
6580 # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
6581 # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
6582 CPPFLAGS="$CPPFLAGS -ieee"
6583 fi
6584 ;;
6585 sh*)
6586 if test -n "$GCC"; then
6587 # GCC has the option -mieee.
6588 CPPFLAGS="$CPPFLAGS -mieee"
6589 fi
6590 ;;
6591 esac
c0c3707f 6592
c971b7fa 6593
c971b7fa 6594
c8693053
RO
6595
6596
6597
6598
6599 # Check whether --enable-threads was given.
6600if test "${enable_threads+set}" = set; then :
6601 enableval=$enable_threads; gl_use_threads=$enableval
5e8754f9 6602else
c8693053
RO
6603 if test -n "$gl_use_threads_default"; then
6604 gl_use_threads="$gl_use_threads_default"
6605 else
6606 case "$host_os" in
6607 osf*) gl_use_threads=no ;;
6608 cygwin*)
6609 case `uname -r` in
6610 1.[0-5].*) gl_use_threads=no ;;
6611 *) gl_use_threads=yes ;;
6612 esac
6613 ;;
6614 mingw*)
6615 case "$gl_use_winpthreads_default" in
6616 yes) gl_use_threads=posix ;;
6617 no) gl_use_threads=windows ;;
6618 *) gl_use_threads=yes ;;
6619 esac
6620 ;;
6621 *) gl_use_threads=yes ;;
6622 esac
6623 fi
c971b7fa 6624
5e8754f9 6625fi
c0c3707f 6626
c8693053
RO
6627 if test "$gl_use_threads" = yes \
6628 || test "$gl_use_threads" = isoc \
6629 || test "$gl_use_threads" = posix \
6630 || test "$gl_use_threads" = isoc+posix; then
6631 # For using <threads.h> or <pthread.h>:
6632
6633
6634 if test -z "$gl_anythreadlib_early_done"; then
6635 case "$host_os" in
6636 osf*)
6637 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
6638 # groks <pthread.h>. cc also understands the flag -pthread, but
6639 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
6640 # 2. putting a flag into CPPFLAGS that has an effect on the linker
6641 # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
6642 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
6643 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
6644 ;;
6645 esac
6646 # Some systems optimize for single-threaded programs by default, and
6647 # need special flags to disable these optimizations. For example, the
6648 # definition of 'errno' in <errno.h>.
6649 case "$host_os" in
6650 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
6651 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
6652 esac
6653 gl_anythreadlib_early_done=done
5e8754f9 6654 fi
c0c3707f 6655
c8693053 6656 fi
c0c3707f 6657
c0c3707f 6658
c971b7fa 6659
c8693053
RO
6660 # Pre-early section.
6661
6662
6663
6664
6665 # Code from module absolute-header:
6666 # Code from module alloca:
6667 # Code from module alloca-opt:
6668 # Code from module arpa_inet:
6669 # Code from module assure:
6670 # Code from module at-internal:
698be2d8 6671 # Code from module attribute:
9c9d63b1 6672 # Code from module basename-lgpl:
698be2d8 6673 # Code from module btowc:
c8693053
RO
6674 # Code from module builtin-expect:
6675 # Code from module c99:
6676 # Code from module canonicalize-lgpl:
6677 # Code from module chdir:
6678 # Code from module chdir-long:
9c9d63b1 6679 # Code from module clock-time:
c8693053
RO
6680 # Code from module cloexec:
6681 # Code from module close:
6682 # Code from module closedir:
6683 # Code from module count-one-bits:
698be2d8 6684 # Code from module ctype:
c8693053
RO
6685 # Code from module d-ino:
6686 # Code from module d-type:
6687 # Code from module dirent:
6688 # Code from module dirfd:
6689 # Code from module dirname-lgpl:
c8693053
RO
6690 # Code from module double-slash-root:
6691 # Code from module dup:
6692 # Code from module dup2:
9c9d63b1 6693 # Code from module eloop-threshold:
c8693053
RO
6694 # Code from module environ:
6695 # Code from module errno:
6696 # Code from module error:
6697 # Code from module exitfail:
6698 # Code from module extensions:
6699 # Code from module extern-inline:
6700 # Code from module fchdir:
6701 # Code from module fcntl:
6702 # Code from module fcntl-h:
6703 # Code from module fd-hook:
6704 # Code from module fd-safer-flag:
6705 # Code from module fdopendir:
6706 # Code from module filename:
6707 # Code from module filenamecat-lgpl:
6708 # Code from module flexmember:
6709 # Code from module float:
6710 # Code from module fnmatch:
6711 # Code from module fnmatch-gnu:
6712 # Code from module fnmatch-h:
6713 # Code from module fpieee:
6714
6715 # Code from module fpucw:
9c9d63b1 6716 # Code from module free-posix:
c8693053
RO
6717 # Code from module frexp:
6718 # Code from module frexpl:
6719 # Code from module fstat:
6720 # Code from module fstatat:
6721 # Code from module getcwd:
6722 # Code from module getcwd-lgpl:
6723 # Code from module getdtablesize:
6724 # Code from module getlogin_r:
6725 # Code from module getprogname:
698be2d8 6726 # Code from module getrandom:
c8693053
RO
6727 # Code from module gettext-h:
6728 # Code from module gettimeofday:
6729 # Code from module glob:
6730 # Code from module glob-h:
6731 # Code from module hard-locale:
9c9d63b1 6732 # Code from module idx:
c8693053
RO
6733 # Code from module include_next:
6734 # Code from module inet_ntop:
6735 # Code from module intprops:
6736 # Code from module inttypes:
6737 # Code from module inttypes-incomplete:
698be2d8 6738 # Code from module isblank:
c8693053
RO
6739 # Code from module isnand-nolibm:
6740 # Code from module isnanl-nolibm:
6741 # Code from module largefile:
6742
6743 # Code from module libc-config:
6744 # Code from module limits-h:
6745 # Code from module localcharset:
6746 # Code from module locale:
c8693053
RO
6747 # Code from module lock:
6748 # Code from module lstat:
6749 # Code from module malloc-posix:
6750 # Code from module malloca:
6751 # Code from module math:
6752 # Code from module mbrtowc:
6753 # Code from module mbsinit:
6754 # Code from module mbsrtowcs:
698be2d8 6755 # Code from module mbtowc:
c8693053
RO
6756 # Code from module memchr:
6757 # Code from module memmem:
6758 # Code from module memmem-simple:
6759 # Code from module mempcpy:
6760 # Code from module memrchr:
698be2d8 6761 # Code from module minmax:
c8693053
RO
6762 # Code from module mkdir:
6763 # Code from module mkdtemp:
6764 # Code from module mkostemp:
6765 # Code from module msvc-inval:
6766 # Code from module msvc-nothrow:
6767 # Code from module multiarch:
6768 # Code from module netinet_in:
6769 # Code from module nocrash:
6770 # Code from module open:
6771 # Code from module openat:
6772 # Code from module openat-die:
6773 # Code from module openat-h:
6774 # Code from module opendir:
6775 # Code from module pathmax:
9c9d63b1 6776 # Code from module pipe-posix:
c8693053
RO
6777 # Code from module rawmemchr:
6778 # Code from module readdir:
6779 # Code from module readlink:
6780 # Code from module realloc-posix:
6781 # Code from module rename:
6782 # Code from module rewinddir:
6783 # Code from module rmdir:
6784 # Code from module same-inode:
6785 # Code from module save-cwd:
6786 # Code from module scratch_buffer:
6787 # Code from module setenv:
6788 # Code from module setlocale-null:
6789 # Code from module signal-h:
6790 # Code from module snippet/_Noreturn:
6791 # Code from module snippet/arg-nonnull:
6792 # Code from module snippet/c++defs:
6793 # Code from module snippet/warn-on-use:
6794 # Code from module socklen:
6795 # Code from module ssize_t:
6796 # Code from module stat:
6797 # Code from module stat-time:
6798 # Code from module std-gnu11:
6799 # Code from module stdalign:
6800 # Code from module stdbool:
6801 # Code from module stddef:
6802 # Code from module stdint:
6803 # Code from module stdio:
6804 # Code from module stdlib:
6805 # Code from module strchrnul:
6806 # Code from module strdup-posix:
6807 # Code from module streq:
6808 # Code from module strerror:
6809 # Code from module strerror-override:
6810 # Code from module strerror_r-posix:
6811 # Code from module string:
698be2d8 6812 # Code from module strnlen:
c8693053
RO
6813 # Code from module strnlen1:
6814 # Code from module strstr:
6815 # Code from module strstr-simple:
6816 # Code from module strtok_r:
698be2d8 6817 # Code from module sys_random:
c8693053
RO
6818 # Code from module sys_socket:
6819 # Code from module sys_stat:
6820 # Code from module sys_time:
6821 # Code from module sys_types:
6822 # Code from module sys_uio:
6823 # Code from module tempname:
6824 # Code from module threadlib:
6825
6826
6827
6828 # Code from module time:
6829 # Code from module time_r:
6830 # Code from module unistd:
6831 # Code from module unistd-safer:
6832 # Code from module unsetenv:
6833 # Code from module update-copyright:
6834 # Code from module verify:
6835 # Code from module wchar:
6836 # Code from module wctype-h:
6837 # Code from module windows-mutex:
6838 # Code from module windows-once:
6839 # Code from module windows-recmutex:
6840 # Code from module windows-rwlock:
698be2d8
CB
6841 # Code from module wmemchr:
6842 # Code from module wmempcpy:
c8693053
RO
6843 # Code from module xalloc-oversized:
6844
6845
6846am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
c971b7fa
PA
6847
6848
c0c3707f
CB
6849ac_aux_dir=
6850for ac_dir in .. "$srcdir"/..; do
6851 if test -f "$ac_dir/install-sh"; then
6852 ac_aux_dir=$ac_dir
6853 ac_install_sh="$ac_aux_dir/install-sh -c"
6854 break
6855 elif 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/shtool"; then
6860 ac_aux_dir=$ac_dir
6861 ac_install_sh="$ac_aux_dir/shtool install -c"
6862 break
6863 fi
6864done
6865if test -z "$ac_aux_dir"; then
6866 as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5
6867fi
6868
6869# These three variables are undocumented and unsupported,
6870# and are intended to be withdrawn in a future Autoconf release.
6871# They can cause serious problems if a builder's source tree is in a directory
6872# whose full name contains unusual characters.
6873ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
6874ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
6875ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
698be2d8 6886
9c9d63b1 6887
c0c3707f
CB
6888 # Check whether --enable-cross-guesses was given.
6889if test "${enable_cross_guesses+set}" = set; then :
6890 enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
6891 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
6892$as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
6893 enableval=conservative
6894 fi
6895 gl_cross_guesses="$enableval"
6896else
6897 gl_cross_guesses=conservative
6898fi
6899
6900 if test $gl_cross_guesses = risky; then
6901 gl_cross_guess_normal="guessing yes"
6902 gl_cross_guess_inverted="guessing no"
6903 else
6904 gl_cross_guess_normal="guessing no"
6905 gl_cross_guess_inverted="guessing yes"
6906 fi
6907 LIBC_FATAL_STDERR_=1
6908 export LIBC_FATAL_STDERR_
6909
5df4cba6 6910
c0c3707f
CB
6911ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
6912if test "x$ac_cv_type_size_t" = xyes; then :
6913
6914else
6915
6916cat >>confdefs.h <<_ACEOF
6917#define size_t unsigned int
6918_ACEOF
6919
6920fi
6921
6922# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
6923# for constant arguments. Useless!
6924{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
6925$as_echo_n "checking for working alloca.h... " >&6; }
6926if ${ac_cv_working_alloca_h+:} false; then :
6927 $as_echo_n "(cached) " >&6
6928else
6929 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6930/* end confdefs.h. */
6931#include <alloca.h>
5e8754f9
SDJ
6932int
6933main ()
6934{
c0c3707f
CB
6935char *p = (char *) alloca (2 * sizeof (int));
6936 if (p) return 0;
5e8754f9
SDJ
6937 ;
6938 return 0;
6939}
6940_ACEOF
c0c3707f
CB
6941if ac_fn_c_try_link "$LINENO"; then :
6942 ac_cv_working_alloca_h=yes
6943else
6944 ac_cv_working_alloca_h=no
5e8754f9 6945fi
c0c3707f
CB
6946rm -f core conftest.err conftest.$ac_objext \
6947 conftest$ac_exeext conftest.$ac_ext
5e8754f9 6948fi
c0c3707f
CB
6949{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
6950$as_echo "$ac_cv_working_alloca_h" >&6; }
6951if test $ac_cv_working_alloca_h = yes; then
c971b7fa 6952
c0c3707f 6953$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
c971b7fa 6954
c0c3707f 6955fi
d0ac1c44 6956
c0c3707f
CB
6957{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
6958$as_echo_n "checking for alloca... " >&6; }
6959if ${ac_cv_func_alloca_works+:} false; then :
5e8754f9
SDJ
6960 $as_echo_n "(cached) " >&6
6961else
6962 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6963/* end confdefs.h. */
c0c3707f
CB
6964#ifdef __GNUC__
6965# define alloca __builtin_alloca
6966#else
6967# ifdef _MSC_VER
6968# include <malloc.h>
6969# define alloca _alloca
6970# else
6971# ifdef HAVE_ALLOCA_H
6972# include <alloca.h>
6973# else
6974# ifdef _AIX
6975 #pragma alloca
6976# else
6977# ifndef alloca /* predefined by HP cc +Olibcalls */
6978void *alloca (size_t);
6979# endif
6980# endif
6981# endif
6982# endif
6983#endif
d0ac1c44 6984
5e8754f9
SDJ
6985int
6986main ()
6987{
c0c3707f
CB
6988char *p = (char *) alloca (1);
6989 if (p) return 0;
5e8754f9
SDJ
6990 ;
6991 return 0;
6992}
6993_ACEOF
c0c3707f
CB
6994if ac_fn_c_try_link "$LINENO"; then :
6995 ac_cv_func_alloca_works=yes
6996else
6997 ac_cv_func_alloca_works=no
5e8754f9 6998fi
c0c3707f
CB
6999rm -f core conftest.err conftest.$ac_objext \
7000 conftest$ac_exeext conftest.$ac_ext
7001fi
7002{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
7003$as_echo "$ac_cv_func_alloca_works" >&6; }
7a6dbc2f 7004
c0c3707f 7005if test $ac_cv_func_alloca_works = yes; then
7a6dbc2f 7006
c0c3707f 7007$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
7a6dbc2f 7008
5e8754f9 7009else
c0c3707f
CB
7010 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
7011# that cause trouble. Some versions do not even contain alloca or
7012# contain a buggy version. If you still want to use their alloca,
7013# use ar to extract alloca.o from them instead of compiling alloca.c.
c971b7fa
PA
7014
7015
7a6dbc2f 7016
73cc7272
TT
7017
7018
c0c3707f 7019ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
73cc7272 7020
c0c3707f 7021$as_echo "#define C_ALLOCA 1" >>confdefs.h
73cc7272
TT
7022
7023
c0c3707f
CB
7024{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
7025$as_echo_n "checking stack direction for C alloca... " >&6; }
7026if ${ac_cv_c_stack_direction+:} false; then :
73cc7272
TT
7027 $as_echo_n "(cached) " >&6
7028else
c0c3707f
CB
7029 if test "$cross_compiling" = yes; then :
7030 ac_cv_c_stack_direction=0
7031else
7032 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7033/* end confdefs.h. */
c0c3707f
CB
7034$ac_includes_default
7035int
7036find_stack_direction (int *addr, int depth)
7037{
7038 int dir, dummy = 0;
7039 if (! addr)
7040 addr = &dummy;
7041 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
7042 dir = depth ? find_stack_direction (addr, depth - 1) : 0;
7043 return dir + dummy;
7044}
73cc7272 7045
73cc7272 7046int
c0c3707f 7047main (int argc, char **argv)
73cc7272 7048{
c0c3707f 7049 return find_stack_direction (0, argc + !argv + 20) < 0;
73cc7272
TT
7050}
7051_ACEOF
c0c3707f
CB
7052if ac_fn_c_try_run "$LINENO"; then :
7053 ac_cv_c_stack_direction=1
7054else
7055 ac_cv_c_stack_direction=-1
73cc7272 7056fi
c0c3707f
CB
7057rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7058 conftest.$ac_objext conftest.beam conftest.$ac_ext
73cc7272 7059fi
73cc7272 7060
73cc7272 7061fi
9c9d63b1
PM
7062{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
7063$as_echo "$ac_cv_c_stack_direction" >&6; }
7064cat >>confdefs.h <<_ACEOF
7065#define STACK_DIRECTION $ac_cv_c_stack_direction
c0c3707f
CB
7066_ACEOF
7067
9c9d63b1 7068
73cc7272
TT
7069fi
7070
9c9d63b1
PM
7071
7072 GNULIB_INET_NTOP=0;
7073 GNULIB_INET_PTON=0;
7074 HAVE_DECL_INET_NTOP=1;
7075 HAVE_DECL_INET_PTON=1;
7076 REPLACE_INET_NTOP=0;
7077 REPLACE_INET_PTON=0;
73cc7272 7078
c0c3707f
CB
7079
7080
7081
7082
7083 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
7084$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
7085if ${gl_cv_have_include_next+:} false; then :
73cc7272
TT
7086 $as_echo_n "(cached) " >&6
7087else
c0c3707f
CB
7088 rm -rf conftestd1a conftestd1b conftestd2
7089 mkdir conftestd1a conftestd1b conftestd2
7090 cat <<EOF > conftestd1a/conftest.h
7091#define DEFINED_IN_CONFTESTD1
7092#include_next <conftest.h>
7093#ifdef DEFINED_IN_CONFTESTD2
7094int foo;
7095#else
7096#error "include_next doesn't work"
7097#endif
7098EOF
7099 cat <<EOF > conftestd1b/conftest.h
7100#define DEFINED_IN_CONFTESTD1
7101#include <stdio.h>
7102#include_next <conftest.h>
7103#ifdef DEFINED_IN_CONFTESTD2
7104int foo;
7105#else
7106#error "include_next doesn't work"
7107#endif
7108EOF
7109 cat <<EOF > conftestd2/conftest.h
7110#ifndef DEFINED_IN_CONFTESTD1
7111#error "include_next test doesn't work"
7112#endif
7113#define DEFINED_IN_CONFTESTD2
7114EOF
7115 gl_save_CPPFLAGS="$CPPFLAGS"
7116 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
7117 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7118/* end confdefs.h. */
c0c3707f 7119#include <conftest.h>
73cc7272 7120_ACEOF
c0c3707f
CB
7121if ac_fn_c_try_compile "$LINENO"; then :
7122 gl_cv_have_include_next=yes
7123else
7124 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
7125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7126/* end confdefs.h. */
7127#include <conftest.h>
7128_ACEOF
7129if ac_fn_c_try_compile "$LINENO"; then :
7130 gl_cv_have_include_next=buggy
7131else
7132 gl_cv_have_include_next=no
73cc7272 7133fi
c0c3707f
CB
7134rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7135
73cc7272 7136fi
c0c3707f
CB
7137rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7138 CPPFLAGS="$gl_save_CPPFLAGS"
7139 rm -rf conftestd1a conftestd1b conftestd2
7140
73cc7272 7141fi
c0c3707f
CB
7142{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
7143$as_echo "$gl_cv_have_include_next" >&6; }
7144 PRAGMA_SYSTEM_HEADER=
7145 if test $gl_cv_have_include_next = yes; then
7146 INCLUDE_NEXT=include_next
7147 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7148 if test -n "$GCC"; then
7149 PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
7150 fi
7151 else
7152 if test $gl_cv_have_include_next = buggy; then
7153 INCLUDE_NEXT=include
7154 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7155 else
7156 INCLUDE_NEXT=include
7157 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
7158 fi
73cc7272
TT
7159 fi
7160
73cc7272 7161
73cc7272 7162
9c9d63b1
PM
7163
7164 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether source code line length is unlimited" >&5
7165$as_echo_n "checking whether source code line length is unlimited... " >&6; }
7166if ${gl_cv_source_line_length_unlimited+:} false; then :
73cc7272
TT
7167 $as_echo_n "(cached) " >&6
7168else
9c9d63b1 7169 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7170/* end confdefs.h. */
73cc7272 7171
c0c3707f
CB
7172#ifdef __TANDEM
7173choke me
7174#endif
73cc7272 7175
73cc7272 7176_ACEOF
c0c3707f
CB
7177if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7178 $EGREP "choke me" >/dev/null 2>&1; then :
9c9d63b1 7179 gl_cv_source_line_length_unlimited=no
c0c3707f 7180else
9c9d63b1 7181 gl_cv_source_line_length_unlimited=yes
73cc7272 7182fi
c0c3707f 7183rm -f conftest*
73cc7272 7184
73cc7272
TT
7185
7186fi
9c9d63b1
PM
7187{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_source_line_length_unlimited" >&5
7188$as_echo "$gl_cv_source_line_length_unlimited" >&6; }
7189 if test $gl_cv_source_line_length_unlimited = no; then
c0c3707f
CB
7190 PRAGMA_COLUMNS="#pragma COLUMNS 10000"
7191 else
7192 PRAGMA_COLUMNS=
7193 fi
73cc7272
TT
7194
7195
7196
73cc7272 7197
73cc7272
TT
7198
7199
c0c3707f
CB
7200 if test $ac_cv_header_features_h = yes; then
7201 HAVE_FEATURES_H=1
7202 else
7203 HAVE_FEATURES_H=0
7204 fi
73cc7272 7205
7a6dbc2f
SDJ
7206
7207
7208
7209
c0c3707f
CB
7210 if test $ac_cv_header_sys_socket_h = no; then
7211 for ac_header in ws2tcpip.h
7212do :
7213 ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
7214if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
7215 cat >>confdefs.h <<_ACEOF
7216#define HAVE_WS2TCPIP_H 1
7217_ACEOF
7a6dbc2f 7218
c0c3707f 7219fi
7a6dbc2f 7220
c0c3707f 7221done
7a6dbc2f 7222
c0c3707f 7223 fi
7a6dbc2f 7224
c0c3707f
CB
7225{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7226$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7227if test -z "$MKDIR_P"; then
7228 if ${ac_cv_path_mkdir+:} false; then :
7229 $as_echo_n "(cached) " >&6
5e8754f9 7230else
c0c3707f
CB
7231 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7232for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7233do
7234 IFS=$as_save_IFS
7235 test -z "$as_dir" && as_dir=.
7236 for ac_prog in mkdir gmkdir; do
7237 for ac_exec_ext in '' $ac_executable_extensions; do
7238 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7239 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7240 'mkdir (GNU coreutils) '* | \
7241 'mkdir (coreutils) '* | \
7242 'mkdir (fileutils) '4.1*)
7243 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7244 break 3;;
7245 esac
7246 done
7247 done
7248 done
7249IFS=$as_save_IFS
7a6dbc2f 7250
5e8754f9 7251fi
7a6dbc2f 7252
c0c3707f
CB
7253 test -d ./--version && rmdir ./--version
7254 if test "${ac_cv_path_mkdir+set}" = set; then
7255 MKDIR_P="$ac_cv_path_mkdir -p"
7256 else
7257 # As a last resort, use the slow shell script. Don't cache a
7258 # value for MKDIR_P within a source directory, because that will
7259 # break other packages using the cache if that directory is
7260 # removed, or if the value is a relative name.
7261 MKDIR_P="$ac_install_sh -d"
7262 fi
5e8754f9 7263fi
c0c3707f
CB
7264{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7265$as_echo "$MKDIR_P" >&6; }
7a6dbc2f 7266
5e8754f9 7267
698be2d8
CB
7268 GNULIB_BTOWC=0;
7269 GNULIB_WCTOB=0;
7270 GNULIB_MBSINIT=0;
7271 GNULIB_MBRTOWC=0;
7272 GNULIB_MBRLEN=0;
7273 GNULIB_MBSRTOWCS=0;
7274 GNULIB_MBSNRTOWCS=0;
7275 GNULIB_WCRTOMB=0;
7276 GNULIB_WCSRTOMBS=0;
7277 GNULIB_WCSNRTOMBS=0;
7278 GNULIB_WCWIDTH=0;
7279 GNULIB_WMEMCHR=0;
7280 GNULIB_WMEMCMP=0;
7281 GNULIB_WMEMCPY=0;
7282 GNULIB_WMEMMOVE=0;
7283 GNULIB_WMEMPCPY=0;
7284 GNULIB_WMEMSET=0;
7285 GNULIB_WCSLEN=0;
7286 GNULIB_WCSNLEN=0;
7287 GNULIB_WCSCPY=0;
7288 GNULIB_WCPCPY=0;
7289 GNULIB_WCSNCPY=0;
7290 GNULIB_WCPNCPY=0;
7291 GNULIB_WCSCAT=0;
7292 GNULIB_WCSNCAT=0;
7293 GNULIB_WCSCMP=0;
7294 GNULIB_WCSNCMP=0;
7295 GNULIB_WCSCASECMP=0;
7296 GNULIB_WCSNCASECMP=0;
7297 GNULIB_WCSCOLL=0;
7298 GNULIB_WCSXFRM=0;
7299 GNULIB_WCSDUP=0;
7300 GNULIB_WCSCHR=0;
7301 GNULIB_WCSRCHR=0;
7302 GNULIB_WCSCSPN=0;
7303 GNULIB_WCSSPN=0;
7304 GNULIB_WCSPBRK=0;
7305 GNULIB_WCSSTR=0;
7306 GNULIB_WCSTOK=0;
7307 GNULIB_WCSWIDTH=0;
7308 GNULIB_WCSFTIME=0;
9c9d63b1 7309 GNULIB_MDA_WCSDUP=1;
698be2d8
CB
7310 HAVE_BTOWC=1;
7311 HAVE_MBSINIT=1;
7312 HAVE_MBRTOWC=1;
7313 HAVE_MBRLEN=1;
7314 HAVE_MBSRTOWCS=1;
7315 HAVE_MBSNRTOWCS=1;
7316 HAVE_WCRTOMB=1;
7317 HAVE_WCSRTOMBS=1;
7318 HAVE_WCSNRTOMBS=1;
7319 HAVE_WMEMCHR=1;
7320 HAVE_WMEMCMP=1;
7321 HAVE_WMEMCPY=1;
7322 HAVE_WMEMMOVE=1;
7323 HAVE_WMEMPCPY=1;
7324 HAVE_WMEMSET=1;
7325 HAVE_WCSLEN=1;
7326 HAVE_WCSNLEN=1;
7327 HAVE_WCSCPY=1;
7328 HAVE_WCPCPY=1;
7329 HAVE_WCSNCPY=1;
7330 HAVE_WCPNCPY=1;
7331 HAVE_WCSCAT=1;
7332 HAVE_WCSNCAT=1;
7333 HAVE_WCSCMP=1;
7334 HAVE_WCSNCMP=1;
7335 HAVE_WCSCASECMP=1;
7336 HAVE_WCSNCASECMP=1;
7337 HAVE_WCSCOLL=1;
7338 HAVE_WCSXFRM=1;
7339 HAVE_WCSDUP=1;
7340 HAVE_WCSCHR=1;
7341 HAVE_WCSRCHR=1;
7342 HAVE_WCSCSPN=1;
7343 HAVE_WCSSPN=1;
7344 HAVE_WCSPBRK=1;
7345 HAVE_WCSSTR=1;
7346 HAVE_WCSTOK=1;
7347 HAVE_WCSWIDTH=1;
7348 HAVE_WCSFTIME=1;
7349 HAVE_DECL_WCTOB=1;
9c9d63b1 7350 HAVE_DECL_WCSDUP=1;
698be2d8
CB
7351 HAVE_DECL_WCWIDTH=1;
7352 REPLACE_MBSTATE_T=0;
7353 REPLACE_BTOWC=0;
7354 REPLACE_WCTOB=0;
7355 REPLACE_MBSINIT=0;
7356 REPLACE_MBRTOWC=0;
7357 REPLACE_MBRLEN=0;
7358 REPLACE_MBSRTOWCS=0;
7359 REPLACE_MBSNRTOWCS=0;
7360 REPLACE_WCRTOMB=0;
7361 REPLACE_WCSRTOMBS=0;
7362 REPLACE_WCSNRTOMBS=0;
7363 REPLACE_WCWIDTH=0;
7364 REPLACE_WCSWIDTH=0;
7365 REPLACE_WCSFTIME=0;
7366 REPLACE_WCSTOK=0;
7367
7368
9c9d63b1
PM
7369
7370 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
698be2d8
CB
7371$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
7372if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
7373 $as_echo_n "(cached) " >&6
7374else
7375 gl_cv_header_wchar_h_correct_inline=yes
9c9d63b1
PM
7376 case "$host_os" in
7377 *-gnu* | gnu*)
7378 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
698be2d8
CB
7379/* end confdefs.h. */
7380
9c9d63b1
PM
7381
7382 #define wcstod renamed_wcstod
7383 #include <wchar.h>
7384 extern int zero (void);
7385 int main () { return zero(); }
698be2d8
CB
7386
7387_ACEOF
9c9d63b1
PM
7388 save_ac_compile="$ac_compile"
7389 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
7390 if echo '#include "conftest.c"' >conftest1.c \
7391 && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
698be2d8
CB
7392 (eval $ac_compile) 2>&5
7393 ac_status=$?
7394 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7395 test $ac_status = 0; }; then
9c9d63b1 7396 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
698be2d8
CB
7397/* end confdefs.h. */
7398
9c9d63b1
PM
7399
7400 #define wcstod renamed_wcstod
7401 #include <wchar.h>
7402 int zero (void) { return 0; }
698be2d8
CB
7403
7404_ACEOF
9c9d63b1
PM
7405 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
7406 if echo '#include "conftest.c"' >conftest2.c \
7407 && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
698be2d8
CB
7408 (eval $ac_compile) 2>&5
7409 ac_status=$?
7410 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7411 test $ac_status = 0; }; then
9c9d63b1
PM
7412 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
7413 :
7414 else
7415 gl_cv_header_wchar_h_correct_inline=no
7416 fi
7417 fi
698be2d8 7418 fi
9c9d63b1
PM
7419 ac_compile="$save_ac_compile"
7420 rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
7421 ;;
7422 esac
698be2d8
CB
7423
7424fi
7425{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
7426$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
7427 if test $gl_cv_header_wchar_h_correct_inline = no; then
7428 as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
7429This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
7430C99 mode. You have four options:
7431 - Add the flag -fgnu89-inline to CC and reconfigure, or
7432 - Fix your include files, using parts of
7433 <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
7434 - Use a gcc version older than 4.3, or
7435 - Don't use the flags -std=c99 or -std=gnu99.
7436Configuration aborted." "$LINENO" 5
7437 fi
7438
7439
7440
7441
7442 for ac_func in $ac_func_list
7443do :
7444 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
7445ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
7446if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
7447 cat >>confdefs.h <<_ACEOF
7448#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
7449_ACEOF
7450
7451fi
7452done
7453
7454
7455
7456
7457 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
7458$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
7459if ${am_cv_langinfo_codeset+:} false; then :
7460 $as_echo_n "(cached) " >&6
7461else
7462 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7463/* end confdefs.h. */
7464#include <langinfo.h>
7465int
7466main ()
7467{
7468char* cs = nl_langinfo(CODESET); return !cs;
7469 ;
7470 return 0;
7471}
7472_ACEOF
7473if ac_fn_c_try_link "$LINENO"; then :
7474 am_cv_langinfo_codeset=yes
7475else
7476 am_cv_langinfo_codeset=no
7477fi
7478rm -f core conftest.err conftest.$ac_objext \
7479 conftest$ac_exeext conftest.$ac_ext
7480
7481fi
7482{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
7483$as_echo "$am_cv_langinfo_codeset" >&6; }
7484 if test $am_cv_langinfo_codeset = yes; then
7485
7486$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
7487
7488 fi
7489
7490
7491
7492
7493 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
7494$as_echo_n "checking for a traditional french locale... " >&6; }
7495if ${gt_cv_locale_fr+:} false; then :
7496 $as_echo_n "(cached) " >&6
7497else
7498
7499 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7500/* end confdefs.h. */
7501
7502#include <locale.h>
7503#include <time.h>
7504#if HAVE_LANGINFO_CODESET
7505# include <langinfo.h>
7506#endif
7507#include <stdlib.h>
7508#include <string.h>
7509struct tm t;
7510char buf[16];
7511int main () {
7512 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
7513 imitates locale dependent behaviour by looking at the environment
7514 variables, and all locales use the UTF-8 encoding. */
7515#if defined __BEOS__ || defined __HAIKU__
7516 return 1;
7517#else
7518 /* Check whether the given locale name is recognized by the system. */
7519# if defined _WIN32 && !defined __CYGWIN__
7520 /* On native Windows, setlocale(category, "") looks at the system settings,
7521 not at the environment variables. Also, when an encoding suffix such
7522 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
7523 category of the locale to "C". */
7524 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
7525 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
7526 return 1;
7527# else
7528 if (setlocale (LC_ALL, "") == NULL) return 1;
7529# endif
7530 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
7531 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
7532 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
7533 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
7534 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
7535 some unit tests fail.
7536 On MirBSD 10, when an unsupported locale is specified, setlocale()
7537 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
7538# if HAVE_LANGINFO_CODESET
7539 {
7540 const char *cs = nl_langinfo (CODESET);
7541 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
7542 || strcmp (cs, "UTF-8") == 0)
7543 return 1;
7544 }
7545# endif
7546# ifdef __CYGWIN__
7547 /* On Cygwin, avoid locale names without encoding suffix, because the
7548 locale_charset() function relies on the encoding suffix. Note that
7549 LC_ALL is set on the command line. */
7550 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
7551# endif
7552 /* Check whether in the abbreviation of the second month, the second
7553 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
7554 one byte long. This excludes the UTF-8 encoding. */
7555 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
7556 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
7557# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
7558 /* Check whether the decimal separator is a comma.
7559 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
7560 are nl_langinfo(RADIXCHAR) are both ".". */
7561 if (localeconv () ->decimal_point[0] != ',') return 1;
7562# endif
7563 return 0;
7564#endif
7565}
7566
7567_ACEOF
7568 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
7569 (eval $ac_link) 2>&5
7570 ac_status=$?
7571 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7572 test $ac_status = 0; } && test -s conftest$ac_exeext; then
7573 case "$host_os" in
7574 # Handle native Windows specially, because there setlocale() interprets
7575 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
7576 # "fr" or "fra" as "French" or "French_France.1252",
7577 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
7578 # "ja" as "Japanese" or "Japanese_Japan.932",
7579 # and similar.
7580 mingw*)
7581 # Test for the native Windows locale name.
7582 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7583 gt_cv_locale_fr=French_France.1252
7584 else
7585 # None found.
7586 gt_cv_locale_fr=none
7587 fi
7588 ;;
7589 *)
7590 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
7591 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
7592 # configure script would override the LC_ALL setting. Likewise for
7593 # LC_CTYPE, which is also set at the beginning of the configure script.
7594 # Test for the usual locale name.
7595 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7596 gt_cv_locale_fr=fr_FR
7597 else
7598 # Test for the locale name with explicit encoding suffix.
7599 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7600 gt_cv_locale_fr=fr_FR.ISO-8859-1
7601 else
7602 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
7603 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7604 gt_cv_locale_fr=fr_FR.ISO8859-1
7605 else
7606 # Test for the HP-UX locale name.
7607 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7608 gt_cv_locale_fr=fr_FR.iso88591
7609 else
7610 # Test for the Solaris 7 locale name.
7611 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
7612 gt_cv_locale_fr=fr
7613 else
7614 # None found.
7615 gt_cv_locale_fr=none
7616 fi
7617 fi
7618 fi
7619 fi
7620 fi
7621 ;;
7622 esac
7623 fi
7624 rm -fr conftest*
7625
7626fi
7627{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
7628$as_echo "$gt_cv_locale_fr" >&6; }
7629 LOCALE_FR=$gt_cv_locale_fr
7630
7631
7632
7633 GNULIB__EXIT=0;
9c9d63b1 7634 GNULIB_ALIGNED_ALLOC=0;
698be2d8
CB
7635 GNULIB_ATOLL=0;
7636 GNULIB_CALLOC_POSIX=0;
7637 GNULIB_CANONICALIZE_FILE_NAME=0;
9c9d63b1 7638 GNULIB_FREE_POSIX=0;
698be2d8
CB
7639 GNULIB_GETLOADAVG=0;
7640 GNULIB_GETSUBOPT=0;
7641 GNULIB_GRANTPT=0;
7642 GNULIB_MALLOC_POSIX=0;
7643 GNULIB_MBTOWC=0;
7644 GNULIB_MKDTEMP=0;
7645 GNULIB_MKOSTEMP=0;
7646 GNULIB_MKOSTEMPS=0;
7647 GNULIB_MKSTEMP=0;
7648 GNULIB_MKSTEMPS=0;
9c9d63b1 7649 GNULIB_POSIX_MEMALIGN=0;
698be2d8
CB
7650 GNULIB_POSIX_OPENPT=0;
7651 GNULIB_PTSNAME=0;
7652 GNULIB_PTSNAME_R=0;
7653 GNULIB_PUTENV=0;
7654 GNULIB_QSORT_R=0;
7655 GNULIB_RANDOM=0;
7656 GNULIB_RANDOM_R=0;
7657 GNULIB_REALLOCARRAY=0;
7658 GNULIB_REALLOC_POSIX=0;
7659 GNULIB_REALPATH=0;
7660 GNULIB_RPMATCH=0;
7661 GNULIB_SECURE_GETENV=0;
7662 GNULIB_SETENV=0;
7663 GNULIB_STRTOD=0;
7664 GNULIB_STRTOLD=0;
7665 GNULIB_STRTOLL=0;
7666 GNULIB_STRTOULL=0;
7667 GNULIB_SYSTEM_POSIX=0;
7668 GNULIB_UNLOCKPT=0;
7669 GNULIB_UNSETENV=0;
7670 GNULIB_WCTOMB=0;
9c9d63b1
PM
7671 GNULIB_MDA_ECVT=1;
7672 GNULIB_MDA_FCVT=1;
7673 GNULIB_MDA_GCVT=1;
7674 GNULIB_MDA_MKTEMP=1;
7675 GNULIB_MDA_PUTENV=1;
698be2d8 7676 HAVE__EXIT=1;
9c9d63b1 7677 HAVE_ALIGNED_ALLOC=1;
698be2d8
CB
7678 HAVE_ATOLL=1;
7679 HAVE_CANONICALIZE_FILE_NAME=1;
9c9d63b1
PM
7680 HAVE_DECL_ECVT=1;
7681 HAVE_DECL_FCVT=1;
7682 HAVE_DECL_GCVT=1;
698be2d8
CB
7683 HAVE_DECL_GETLOADAVG=1;
7684 HAVE_GETSUBOPT=1;
7685 HAVE_GRANTPT=1;
7686 HAVE_INITSTATE=1;
7687 HAVE_DECL_INITSTATE=1;
7688 HAVE_MBTOWC=1;
7689 HAVE_MKDTEMP=1;
7690 HAVE_MKOSTEMP=1;
7691 HAVE_MKOSTEMPS=1;
7692 HAVE_MKSTEMP=1;
7693 HAVE_MKSTEMPS=1;
9c9d63b1 7694 HAVE_POSIX_MEMALIGN=1;
698be2d8
CB
7695 HAVE_POSIX_OPENPT=1;
7696 HAVE_PTSNAME=1;
7697 HAVE_PTSNAME_R=1;
c0c3707f
CB
7698 HAVE_QSORT_R=1;
7699 HAVE_RANDOM=1;
7700 HAVE_RANDOM_H=1;
7701 HAVE_RANDOM_R=1;
7702 HAVE_REALLOCARRAY=1;
7703 HAVE_REALPATH=1;
7704 HAVE_RPMATCH=1;
7705 HAVE_SECURE_GETENV=1;
7706 HAVE_SETENV=1;
7707 HAVE_DECL_SETENV=1;
7708 HAVE_SETSTATE=1;
7709 HAVE_DECL_SETSTATE=1;
7710 HAVE_STRTOD=1;
7711 HAVE_STRTOLD=1;
7712 HAVE_STRTOLL=1;
7713 HAVE_STRTOULL=1;
7714 HAVE_STRUCT_RANDOM_DATA=1;
7715 HAVE_SYS_LOADAVG_H=0;
7716 HAVE_UNLOCKPT=1;
7717 HAVE_DECL_UNSETENV=1;
9c9d63b1 7718 REPLACE_ALIGNED_ALLOC=0;
c0c3707f
CB
7719 REPLACE_CALLOC=0;
7720 REPLACE_CANONICALIZE_FILE_NAME=0;
9c9d63b1 7721 REPLACE_FREE=0;
c0c3707f
CB
7722 REPLACE_INITSTATE=0;
7723 REPLACE_MALLOC=0;
7724 REPLACE_MBTOWC=0;
7725 REPLACE_MKSTEMP=0;
9c9d63b1 7726 REPLACE_POSIX_MEMALIGN=0;
c0c3707f
CB
7727 REPLACE_PTSNAME=0;
7728 REPLACE_PTSNAME_R=0;
7729 REPLACE_PUTENV=0;
7730 REPLACE_QSORT_R=0;
7731 REPLACE_RANDOM=0;
7732 REPLACE_RANDOM_R=0;
7733 REPLACE_REALLOC=0;
7734 REPLACE_REALPATH=0;
7735 REPLACE_SETENV=0;
7736 REPLACE_SETSTATE=0;
7737 REPLACE_STRTOD=0;
7738 REPLACE_STRTOLD=0;
7739 REPLACE_UNSETENV=0;
7740 REPLACE_WCTOMB=0;
7a6dbc2f 7741
7a6dbc2f 7742
9c9d63b1
PM
7743 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
7744$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
7745if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
7746 $as_echo_n "(cached) " >&6
7747else
7748 rm -f conftest.sym conftest.file
7749 echo >conftest.file
7750 if test "$cross_compiling" = yes; then :
7751 case "$host_os" in
7752 linux-* | linux)
7753 # Guess yes on Linux systems.
7754 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
7755 *-gnu* | gnu*)
7756 # Guess yes on glibc systems.
7757 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
7758 mingw*)
7759 # Guess no on native Windows.
7760 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
7761 *)
7762 # If we don't know, obey --enable-cross-guesses.
7763 gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
7764 esac
7765
7766else
7767 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7768/* end confdefs.h. */
7769$ac_includes_default
7770int
7771main ()
7772{
7773struct stat sbuf;
7774 if (symlink ("conftest.file", "conftest.sym") != 0)
7775 return 1;
7776 /* Linux will dereference the symlink and fail, as required by
7777 POSIX. That is better in the sense that it means we will not
7778 have to compile and use the lstat wrapper. */
7779 return lstat ("conftest.sym/", &sbuf) == 0;
7780
7781 ;
7782 return 0;
7783}
7784_ACEOF
7785if ac_fn_c_try_run "$LINENO"; then :
7786 gl_cv_func_lstat_dereferences_slashed_symlink=yes
7787else
7788 gl_cv_func_lstat_dereferences_slashed_symlink=no
7789fi
7790rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7791 conftest.$ac_objext conftest.beam conftest.$ac_ext
7792fi
7793
7794 rm -f conftest.sym conftest.file
7795
7796fi
7797{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
7798$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
7799 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
7800 *yes)
7801
7802cat >>confdefs.h <<_ACEOF
7803#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
7804_ACEOF
7805
7806 ;;
7807 esac
98399780 7808
98399780 7809
472fa5ee
SM
7810
7811
7812
7813
7814
c0c3707f
CB
7815 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
7816$as_echo_n "checking whether // is distinct from /... " >&6; }
7817if ${gl_cv_double_slash_root+:} false; then :
7818 $as_echo_n "(cached) " >&6
5e8754f9 7819else
c0c3707f
CB
7820 if test x"$cross_compiling" = xyes ; then
7821 # When cross-compiling, there is no way to tell whether // is special
7822 # short of a list of hosts. However, the only known hosts to date
7823 # that have a distinct // are Apollo DomainOS (too old to port to),
7824 # Cygwin, and z/OS. If anyone knows of another system for which // has
7825 # special semantics and is distinct from /, please report it to
7826 # <bug-gnulib@gnu.org>.
7827 case $host in
7828 *-cygwin | i370-ibm-openedition)
7829 gl_cv_double_slash_root=yes ;;
7830 *)
7831 # Be optimistic and assume that / and // are the same when we
7832 # don't know.
7833 gl_cv_double_slash_root='unknown, assuming no' ;;
7834 esac
7835 else
7836 set x `ls -di / // 2>/dev/null`
7837 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
7838 gl_cv_double_slash_root=no
7839 else
7840 gl_cv_double_slash_root=yes
7841 fi
7842 fi
5e8754f9 7843fi
c0c3707f
CB
7844{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
7845$as_echo "$gl_cv_double_slash_root" >&6; }
7846 if test "$gl_cv_double_slash_root" = yes; then
472fa5ee 7847
c0c3707f 7848$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
472fa5ee 7849
c0c3707f 7850 fi
472fa5ee
SM
7851
7852
472fa5ee 7853
c0c3707f
CB
7854
7855
7856 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
7857$as_echo_n "checking whether realpath works... " >&6; }
7858if ${gl_cv_func_realpath_works+:} false; then :
5e8754f9
SDJ
7859 $as_echo_n "(cached) " >&6
7860else
c0c3707f 7861
9c9d63b1 7862 rm -rf conftest.a conftest.d
c0c3707f
CB
7863 touch conftest.a
7864 mkdir conftest.d
7865 if test "$cross_compiling" = yes; then :
7866 case "$host_os" in
7867 # Guess yes on glibc systems.
7868 *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
7869 # Guess yes on musl systems.
7870 *-musl*) gl_cv_func_realpath_works="guessing yes" ;;
7871 # Guess no on native Windows.
7872 mingw*) gl_cv_func_realpath_works="guessing no" ;;
7873 # If we don't know, obey --enable-cross-guesses.
7874 *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
7875 esac
7876
5e8754f9
SDJ
7877else
7878 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7879/* end confdefs.h. */
c0c3707f
CB
7880
7881
7882
7883#include <stdlib.h>
7884#if defined __MACH__ && defined __APPLE__
7885/* Avoid a crash on Mac OS X. */
7886#include <mach/mach.h>
7887#include <mach/mach_error.h>
7888#include <mach/thread_status.h>
7889#include <mach/exception.h>
7890#include <mach/task.h>
7891#include <pthread.h>
7892/* The exception port on which our thread listens. */
7893static mach_port_t our_exception_port;
7894/* The main function of the thread listening for exceptions of type
7895 EXC_BAD_ACCESS. */
7896static void *
7897mach_exception_thread (void *arg)
5e8754f9 7898{
c0c3707f
CB
7899 /* Buffer for a message to be received. */
7900 struct {
7901 mach_msg_header_t head;
7902 mach_msg_body_t msgh_body;
7903 char data[1024];
7904 } msg;
7905 mach_msg_return_t retval;
7906 /* Wait for a message on the exception port. */
7907 retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
7908 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
7909 if (retval != MACH_MSG_SUCCESS)
7910 abort ();
7911 exit (1);
7912}
7913static void
7914nocrash_init (void)
7915{
7916 mach_port_t self = mach_task_self ();
7917 /* Allocate a port on which the thread shall listen for exceptions. */
7918 if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
7919 == KERN_SUCCESS) {
7920 /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
7921 if (mach_port_insert_right (self, our_exception_port, our_exception_port,
7922 MACH_MSG_TYPE_MAKE_SEND)
7923 == KERN_SUCCESS) {
7924 /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
7925 for us. */
7926 exception_mask_t mask = EXC_MASK_BAD_ACCESS;
7927 /* Create the thread listening on the exception port. */
7928 pthread_attr_t attr;
7929 pthread_t thread;
7930 if (pthread_attr_init (&attr) == 0
7931 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
7932 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
7933 pthread_attr_destroy (&attr);
7934 /* Replace the exception port info for these exceptions with our own.
7935 Note that we replace the exception port for the entire task, not only
7936 for a particular thread. This has the effect that when our exception
7937 port gets the message, the thread specific exception port has already
7938 been asked, and we don't need to bother about it.
7939 See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
7940 task_set_exception_ports (self, mask, our_exception_port,
7941 EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
7942 }
7943 }
7944 }
7945}
7946#elif defined _WIN32 && ! defined __CYGWIN__
7947/* Avoid a crash on native Windows. */
7948#define WIN32_LEAN_AND_MEAN
7949#include <windows.h>
7950#include <winerror.h>
7951static LONG WINAPI
7952exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
7953{
7954 switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
7955 {
7956 case EXCEPTION_ACCESS_VIOLATION:
7957 case EXCEPTION_IN_PAGE_ERROR:
7958 case EXCEPTION_STACK_OVERFLOW:
7959 case EXCEPTION_GUARD_PAGE:
7960 case EXCEPTION_PRIV_INSTRUCTION:
7961 case EXCEPTION_ILLEGAL_INSTRUCTION:
7962 case EXCEPTION_DATATYPE_MISALIGNMENT:
7963 case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
7964 case EXCEPTION_NONCONTINUABLE_EXCEPTION:
7965 exit (1);
7966 }
7967 return EXCEPTION_CONTINUE_SEARCH;
7968}
7969static void
7970nocrash_init (void)
7971{
7972 SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
7973}
7974#else
7975/* Avoid a crash on POSIX systems. */
7976#include <signal.h>
7977#include <unistd.h>
7978/* A POSIX signal handler. */
7979static void
7980exception_handler (int sig)
7981{
7982 _exit (1);
7983}
7984static void
7985nocrash_init (void)
7986{
7987#ifdef SIGSEGV
7988 signal (SIGSEGV, exception_handler);
7989#endif
7990#ifdef SIGBUS
7991 signal (SIGBUS, exception_handler);
7992#endif
5e8754f9 7993}
c0c3707f
CB
7994#endif
7995
7996 #include <stdlib.h>
7997 #include <string.h>
472fa5ee 7998
5e8754f9 7999int
c0c3707f 8000main ()
5e8754f9 8001{
c0c3707f
CB
8002
8003 int result = 0;
8004 {
8005 char *name = realpath ("conftest.a", NULL);
8006 if (!(name && *name == '/'))
8007 result |= 1;
8008 free (name);
8009 }
8010 {
8011 char *name = realpath ("conftest.b/../conftest.a", NULL);
8012 if (name != NULL)
8013 result |= 2;
8014 free (name);
8015 }
8016 {
8017 char *name = realpath ("conftest.a/", NULL);
8018 if (name != NULL)
8019 result |= 4;
8020 free (name);
8021 }
8022 {
8023 char *name1 = realpath (".", NULL);
8024 char *name2 = realpath ("conftest.d//./..", NULL);
8025 if (! name1 || ! name2 || strcmp (name1, name2))
8026 result |= 8;
8027 free (name1);
8028 free (name2);
8029 }
8030 return result;
8031
8032 ;
8033 return 0;
5e8754f9 8034}
c0c3707f 8035
5e8754f9
SDJ
8036_ACEOF
8037if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 8038 gl_cv_func_realpath_works=yes
5e8754f9 8039else
c0c3707f 8040 gl_cv_func_realpath_works=no
5e8754f9
SDJ
8041fi
8042rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8043 conftest.$ac_objext conftest.beam conftest.$ac_ext
8044fi
472fa5ee 8045
c0c3707f 8046 rm -rf conftest.a conftest.d
98399780 8047
5e8754f9 8048fi
c0c3707f
CB
8049{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
8050$as_echo "$gl_cv_func_realpath_works" >&6; }
8051 case "$gl_cv_func_realpath_works" in
8052 *yes)
98399780 8053
c0c3707f 8054$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
98399780 8055
c0c3707f
CB
8056 ;;
8057 esac
725e2999
JB
8058
8059
725e2999 8060
725e2999 8061
725e2999
JB
8062
8063
8064
8065
8066
9c9d63b1
PM
8067 case "$host_os" in
8068 mingw*) ;;
8069 *) for ac_func in getcwd
8070do :
8071 ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
8072if test "x$ac_cv_func_getcwd" = xyes; then :
8073 cat >>confdefs.h <<_ACEOF
8074#define HAVE_GETCWD 1
8075_ACEOF
8076
8077fi
8078done
8079 ;;
8080 esac
8081
8082
8083
8084
725e2999
JB
8085
8086
c0c3707f
CB
8087 GNULIB_ACCESS=0;
8088 GNULIB_CHDIR=0;
8089 GNULIB_CHOWN=0;
8090 GNULIB_CLOSE=0;
8091 GNULIB_COPY_FILE_RANGE=0;
8092 GNULIB_DUP=0;
8093 GNULIB_DUP2=0;
8094 GNULIB_DUP3=0;
8095 GNULIB_ENVIRON=0;
8096 GNULIB_EUIDACCESS=0;
9c9d63b1
PM
8097 GNULIB_EXECL=0;
8098 GNULIB_EXECLE=0;
8099 GNULIB_EXECLP=0;
8100 GNULIB_EXECV=0;
8101 GNULIB_EXECVE=0;
8102 GNULIB_EXECVP=0;
8103 GNULIB_EXECVPE=0;
c0c3707f
CB
8104 GNULIB_FACCESSAT=0;
8105 GNULIB_FCHDIR=0;
8106 GNULIB_FCHOWNAT=0;
8107 GNULIB_FDATASYNC=0;
8108 GNULIB_FSYNC=0;
8109 GNULIB_FTRUNCATE=0;
8110 GNULIB_GETCWD=0;
8111 GNULIB_GETDOMAINNAME=0;
8112 GNULIB_GETDTABLESIZE=0;
698be2d8 8113 GNULIB_GETENTROPY=0;
c0c3707f
CB
8114 GNULIB_GETGROUPS=0;
8115 GNULIB_GETHOSTNAME=0;
8116 GNULIB_GETLOGIN=0;
8117 GNULIB_GETLOGIN_R=0;
5df4cba6 8118 GNULIB_GETOPT_POSIX=0;
c0c3707f
CB
8119 GNULIB_GETPAGESIZE=0;
8120 GNULIB_GETPASS=0;
8121 GNULIB_GETUSERSHELL=0;
8122 GNULIB_GROUP_MEMBER=0;
8123 GNULIB_ISATTY=0;
8124 GNULIB_LCHOWN=0;
8125 GNULIB_LINK=0;
8126 GNULIB_LINKAT=0;
8127 GNULIB_LSEEK=0;
8128 GNULIB_PIPE=0;
8129 GNULIB_PIPE2=0;
8130 GNULIB_PREAD=0;
8131 GNULIB_PWRITE=0;
8132 GNULIB_READ=0;
8133 GNULIB_READLINK=0;
8134 GNULIB_READLINKAT=0;
8135 GNULIB_RMDIR=0;
8136 GNULIB_SETHOSTNAME=0;
8137 GNULIB_SLEEP=0;
8138 GNULIB_SYMLINK=0;
8139 GNULIB_SYMLINKAT=0;
8140 GNULIB_TRUNCATE=0;
8141 GNULIB_TTYNAME_R=0;
8142 GNULIB_UNISTD_H_NONBLOCKING=0;
8143 GNULIB_UNISTD_H_SIGPIPE=0;
8144 GNULIB_UNLINK=0;
8145 GNULIB_UNLINKAT=0;
8146 GNULIB_USLEEP=0;
8147 GNULIB_WRITE=0;
9c9d63b1
PM
8148 GNULIB_MDA_ACCESS=1;
8149 GNULIB_MDA_CHDIR=1;
8150 GNULIB_MDA_CLOSE=1;
8151 GNULIB_MDA_DUP=1;
8152 GNULIB_MDA_DUP2=1;
8153 GNULIB_MDA_EXECL=1;
8154 GNULIB_MDA_EXECLE=1;
8155 GNULIB_MDA_EXECLP=1;
8156 GNULIB_MDA_EXECV=1;
8157 GNULIB_MDA_EXECVE=1;
8158 GNULIB_MDA_EXECVP=1;
8159 GNULIB_MDA_EXECVPE=1;
8160 GNULIB_MDA_GETCWD=1;
8161 GNULIB_MDA_GETPID=1;
8162 GNULIB_MDA_ISATTY=1;
8163 GNULIB_MDA_LSEEK=1;
8164 GNULIB_MDA_READ=1;
8165 GNULIB_MDA_RMDIR=1;
8166 GNULIB_MDA_SWAB=1;
8167 GNULIB_MDA_UNLINK=1;
8168 GNULIB_MDA_WRITE=1;
c0c3707f
CB
8169 HAVE_CHOWN=1;
8170 HAVE_COPY_FILE_RANGE=1;
c0c3707f
CB
8171 HAVE_DUP3=1;
8172 HAVE_EUIDACCESS=1;
9c9d63b1 8173 HAVE_EXECVPE=1;
c0c3707f
CB
8174 HAVE_FACCESSAT=1;
8175 HAVE_FCHDIR=1;
8176 HAVE_FCHOWNAT=1;
8177 HAVE_FDATASYNC=1;
8178 HAVE_FSYNC=1;
8179 HAVE_FTRUNCATE=1;
8180 HAVE_GETDTABLESIZE=1;
698be2d8 8181 HAVE_GETENTROPY=1;
c0c3707f
CB
8182 HAVE_GETGROUPS=1;
8183 HAVE_GETHOSTNAME=1;
8184 HAVE_GETLOGIN=1;
8185 HAVE_GETPAGESIZE=1;
8186 HAVE_GETPASS=1;
8187 HAVE_GROUP_MEMBER=1;
8188 HAVE_LCHOWN=1;
8189 HAVE_LINK=1;
8190 HAVE_LINKAT=1;
8191 HAVE_PIPE=1;
8192 HAVE_PIPE2=1;
8193 HAVE_PREAD=1;
8194 HAVE_PWRITE=1;
8195 HAVE_READLINK=1;
8196 HAVE_READLINKAT=1;
8197 HAVE_SETHOSTNAME=1;
8198 HAVE_SLEEP=1;
8199 HAVE_SYMLINK=1;
8200 HAVE_SYMLINKAT=1;
8201 HAVE_UNLINKAT=1;
8202 HAVE_USLEEP=1;
8203 HAVE_DECL_ENVIRON=1;
9c9d63b1 8204 HAVE_DECL_EXECVPE=1;
c0c3707f
CB
8205 HAVE_DECL_FCHDIR=1;
8206 HAVE_DECL_FDATASYNC=1;
8207 HAVE_DECL_GETDOMAINNAME=1;
8208 HAVE_DECL_GETLOGIN=1;
8209 HAVE_DECL_GETLOGIN_R=1;
8210 HAVE_DECL_GETPAGESIZE=1;
8211 HAVE_DECL_GETUSERSHELL=1;
8212 HAVE_DECL_SETHOSTNAME=1;
8213 HAVE_DECL_TRUNCATE=1;
8214 HAVE_DECL_TTYNAME_R=1;
8215 HAVE_OS_H=0;
8216 HAVE_SYS_PARAM_H=0;
8217 REPLACE_ACCESS=0;
8218 REPLACE_CHOWN=0;
8219 REPLACE_CLOSE=0;
8220 REPLACE_DUP=0;
8221 REPLACE_DUP2=0;
9c9d63b1
PM
8222 REPLACE_EXECL=0;
8223 REPLACE_EXECLE=0;
8224 REPLACE_EXECLP=0;
8225 REPLACE_EXECV=0;
8226 REPLACE_EXECVE=0;
8227 REPLACE_EXECVP=0;
8228 REPLACE_EXECVPE=0;
c0c3707f
CB
8229 REPLACE_FACCESSAT=0;
8230 REPLACE_FCHOWNAT=0;
8231 REPLACE_FTRUNCATE=0;
8232 REPLACE_GETCWD=0;
8233 REPLACE_GETDOMAINNAME=0;
8234 REPLACE_GETDTABLESIZE=0;
8235 REPLACE_GETLOGIN_R=0;
8236 REPLACE_GETGROUPS=0;
8237 REPLACE_GETPAGESIZE=0;
8238 REPLACE_GETPASS=0;
8239 REPLACE_ISATTY=0;
8240 REPLACE_LCHOWN=0;
8241 REPLACE_LINK=0;
8242 REPLACE_LINKAT=0;
8243 REPLACE_LSEEK=0;
8244 REPLACE_PREAD=0;
8245 REPLACE_PWRITE=0;
8246 REPLACE_READ=0;
8247 REPLACE_READLINK=0;
8248 REPLACE_READLINKAT=0;
8249 REPLACE_RMDIR=0;
8250 REPLACE_SLEEP=0;
8251 REPLACE_SYMLINK=0;
8252 REPLACE_SYMLINKAT=0;
8253 REPLACE_TRUNCATE=0;
8254 REPLACE_TTYNAME_R=0;
8255 REPLACE_UNLINK=0;
8256 REPLACE_UNLINKAT=0;
8257 REPLACE_USLEEP=0;
8258 REPLACE_WRITE=0;
698be2d8 8259 UNISTD_H_HAVE_SYS_RANDOM_H=0;
c0c3707f
CB
8260 UNISTD_H_HAVE_WINSOCK2_H=0;
8261 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
725e2999 8262
725e2999 8263
725e2999
JB
8264
8265
8266
725e2999 8267
725e2999 8268
725e2999
JB
8269
8270
c0c3707f
CB
8271
8272
8273 if test $ac_cv_func__set_invalid_parameter_handler = yes; then
8274 HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
8275
8276$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
8277
725e2999 8278 else
c0c3707f 8279 HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
725e2999
JB
8280 fi
8281
8282
8283
8284
8285
c0c3707f
CB
8286 GNULIB_OPENDIR=0;
8287 GNULIB_READDIR=0;
8288 GNULIB_REWINDDIR=0;
8289 GNULIB_CLOSEDIR=0;
8290 GNULIB_DIRFD=0;
8291 GNULIB_FDOPENDIR=0;
8292 GNULIB_SCANDIR=0;
8293 GNULIB_ALPHASORT=0;
8294 HAVE_OPENDIR=1;
8295 HAVE_READDIR=1;
8296 HAVE_REWINDDIR=1;
8297 HAVE_CLOSEDIR=1;
8298 HAVE_DECL_DIRFD=1;
8299 HAVE_DECL_FDOPENDIR=1;
8300 HAVE_FDOPENDIR=1;
8301 HAVE_SCANDIR=1;
8302 HAVE_ALPHASORT=1;
8303 REPLACE_OPENDIR=0;
8304 REPLACE_CLOSEDIR=0;
8305 REPLACE_DIRFD=0;
8306 REPLACE_FDOPENDIR=0;
725e2999
JB
8307
8308
698be2d8
CB
8309 GNULIB_ISBLANK=0;
8310 HAVE_ISBLANK=1;
8311
8312
725e2999 8313
9c9d63b1
PM
8314gl_mda_defines='
8315#if defined _WIN32 && !defined __CYGWIN__
8316#define access _access
8317#define chdir _chdir
8318#define chmod _chmod
8319#define close _close
8320#define creat _creat
8321#define dup _dup
8322#define dup2 _dup2
8323#define ecvt _ecvt
8324#define execl _execl
8325#define execle _execle
8326#define execlp _execlp
8327#define execv _execv
8328#define execve _execve
8329#define execvp _execvp
8330#define execvpe _execvpe
8331#define fcloseall _fcloseall
8332#define fcvt _fcvt
8333#define fdopen _fdopen
8334#define fileno _fileno
8335#define gcvt _gcvt
8336#define getcwd _getcwd
8337#define getpid _getpid
8338#define getw _getw
8339#define isatty _isatty
8340#define j0 _j0
8341#define j1 _j1
8342#define jn _jn
8343#define lfind _lfind
8344#define lsearch _lsearch
8345#define lseek _lseek
8346#define memccpy _memccpy
8347#define mkdir _mkdir
8348#define mktemp _mktemp
8349#define open _open
8350#define putenv _putenv
8351#define putw _putw
8352#define read _read
8353#define rmdir _rmdir
8354#define strdup _strdup
8355#define swab _swab
8356#define tempnam _tempnam
8357#define tzset _tzset
8358#define umask _umask
8359#define unlink _unlink
8360#define utime _utime
8361#define wcsdup _wcsdup
8362#define write _write
8363#define y0 _y0
8364#define y1 _y1
8365#define yn _yn
8366#endif
8367'
8368
725e2999 8369
725e2999
JB
8370
8371
8372
8373
725e2999
JB
8374
8375
c0c3707f
CB
8376 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
8377$as_echo_n "checking if environ is properly declared... " >&6; }
8378if ${gt_cv_var_environ_declaration+:} false; then :
725e2999
JB
8379 $as_echo_n "(cached) " >&6
8380else
c0c3707f
CB
8381 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8382/* end confdefs.h. */
8383#if HAVE_UNISTD_H
8384 #include <unistd.h>
8385 #endif
8386 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
8387 #include <stdlib.h>
725e2999 8388
c0c3707f
CB
8389 extern struct { int foo; } environ;
8390int
8391main ()
8392{
8393environ.foo = 1;
8394 ;
8395 return 0;
8396}
8397_ACEOF
8398if ac_fn_c_try_compile "$LINENO"; then :
8399 gt_cv_var_environ_declaration=no
8400else
8401 gt_cv_var_environ_declaration=yes
725e2999 8402fi
c0c3707f
CB
8403rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8404fi
8405{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
8406$as_echo "$gt_cv_var_environ_declaration" >&6; }
8407 if test $gt_cv_var_environ_declaration = yes; then
8408
8409$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
725e2999 8410
725e2999 8411 fi
725e2999
JB
8412
8413
c0c3707f
CB
8414 if test $gt_cv_var_environ_declaration != yes; then
8415 HAVE_DECL_ENVIRON=0
8416 fi
6ec2e0f5
SDJ
8417
8418
8419
c0c3707f
CB
8420 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
8421$as_echo_n "checking for complete errno.h... " >&6; }
8422if ${gl_cv_header_errno_h_complete+:} false; then :
8423 $as_echo_n "(cached) " >&6
8424else
6ec2e0f5 8425
c0c3707f
CB
8426 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8427/* end confdefs.h. */
472fa5ee 8428
c0c3707f
CB
8429#include <errno.h>
8430#if !defined ETXTBSY
8431booboo
8432#endif
8433#if !defined ENOMSG
8434booboo
8435#endif
8436#if !defined EIDRM
8437booboo
8438#endif
8439#if !defined ENOLINK
8440booboo
8441#endif
8442#if !defined EPROTO
8443booboo
8444#endif
8445#if !defined EMULTIHOP
8446booboo
8447#endif
8448#if !defined EBADMSG
8449booboo
8450#endif
8451#if !defined EOVERFLOW
8452booboo
8453#endif
8454#if !defined ENOTSUP
8455booboo
8456#endif
8457#if !defined ENETRESET
8458booboo
8459#endif
8460#if !defined ECONNABORTED
8461booboo
8462#endif
8463#if !defined ESTALE
8464booboo
8465#endif
8466#if !defined EDQUOT
8467booboo
8468#endif
8469#if !defined ECANCELED
8470booboo
8471#endif
8472#if !defined EOWNERDEAD
8473booboo
8474#endif
8475#if !defined ENOTRECOVERABLE
8476booboo
8477#endif
8478#if !defined EILSEQ
8479booboo
8480#endif
472fa5ee 8481
c0c3707f
CB
8482_ACEOF
8483if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8484 $EGREP "booboo" >/dev/null 2>&1; then :
8485 gl_cv_header_errno_h_complete=no
8486else
8487 gl_cv_header_errno_h_complete=yes
5e8754f9 8488fi
c0c3707f 8489rm -f conftest*
472fa5ee
SM
8490
8491
c0c3707f
CB
8492fi
8493{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
8494$as_echo "$gl_cv_header_errno_h_complete" >&6; }
8495 if test $gl_cv_header_errno_h_complete = yes; then
8496 ERRNO_H=''
8497 else
472fa5ee
SM
8498
8499
8500
8501
8502
472fa5ee
SM
8503
8504
8505
c0c3707f
CB
8506 if test $gl_cv_have_include_next = yes; then
8507 gl_cv_next_errno_h='<'errno.h'>'
8508 else
8509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
8510$as_echo_n "checking absolute name of <errno.h>... " >&6; }
8511if ${gl_cv_next_errno_h+:} false; then :
5e8754f9
SDJ
8512 $as_echo_n "(cached) " >&6
8513else
6ec2e0f5 8514
6ec2e0f5 8515
6ec2e0f5 8516
c0c3707f
CB
8517 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8518/* end confdefs.h. */
8519#include <errno.h>
8520_ACEOF
8521 case "$host_os" in
8522 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8523 *) gl_absname_cpp="$ac_cpp" ;;
8524 esac
6ec2e0f5 8525
c0c3707f
CB
8526 case "$host_os" in
8527 mingw*)
8528 gl_dirsep_regex='[/\\]'
8529 ;;
8530 *)
8531 gl_dirsep_regex='\/'
8532 ;;
8533 esac
8534 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
8535 gl_header_literal_regex=`echo 'errno.h' \
8536 | sed -e "$gl_make_literal_regex_sed"`
8537 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8538 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8539 s|^/[^/]|//&|
8540 p
8541 q
8542 }'
6ec2e0f5 8543
c0c3707f
CB
8544 gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
8545 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 8546
c0c3707f
CB
8547 gl_header=$gl_cv_absolute_errno_h
8548 gl_cv_next_errno_h='"'$gl_header'"'
6ec2e0f5
SDJ
8549
8550
c0c3707f
CB
8551fi
8552{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
8553$as_echo "$gl_cv_next_errno_h" >&6; }
8554 fi
8555 NEXT_ERRNO_H=$gl_cv_next_errno_h
6ec2e0f5 8556
c0c3707f
CB
8557 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8558 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8559 gl_next_as_first_directive='<'errno.h'>'
8560 else
8561 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8562 gl_next_as_first_directive=$gl_cv_next_errno_h
8563 fi
8564 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
6ec2e0f5 8565
472fa5ee
SM
8566
8567
8568
c0c3707f
CB
8569 ERRNO_H='errno.h'
8570 fi
472fa5ee 8571
c0c3707f
CB
8572 if test -n "$ERRNO_H"; then
8573 GL_GENERATE_ERRNO_H_TRUE=
8574 GL_GENERATE_ERRNO_H_FALSE='#'
5e8754f9 8575else
c0c3707f
CB
8576 GL_GENERATE_ERRNO_H_TRUE='#'
8577 GL_GENERATE_ERRNO_H_FALSE=
8578fi
472fa5ee
SM
8579
8580
c0c3707f
CB
8581 if test -n "$ERRNO_H"; then
8582 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
8583$as_echo_n "checking for EMULTIHOP value... " >&6; }
8584if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
8585 $as_echo_n "(cached) " >&6
5e8754f9 8586else
e26b6bb0 8587
c0c3707f
CB
8588 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8589/* end confdefs.h. */
e26b6bb0 8590
c0c3707f
CB
8591#include <errno.h>
8592#ifdef EMULTIHOP
8593yes
88b48903 8594#endif
88b48903 8595
c0c3707f
CB
8596_ACEOF
8597if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8598 $EGREP "yes" >/dev/null 2>&1; then :
8599 gl_cv_header_errno_h_EMULTIHOP=yes
8600else
8601 gl_cv_header_errno_h_EMULTIHOP=no
8602fi
8603rm -f conftest*
88b48903 8604
c0c3707f
CB
8605 if test $gl_cv_header_errno_h_EMULTIHOP = no; then
8606 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8607/* end confdefs.h. */
88b48903 8608
c0c3707f
CB
8609#define _XOPEN_SOURCE_EXTENDED 1
8610#include <errno.h>
8611#ifdef EMULTIHOP
8612yes
8613#endif
88b48903
WN
8614
8615_ACEOF
c0c3707f
CB
8616if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8617 $EGREP "yes" >/dev/null 2>&1; then :
8618 gl_cv_header_errno_h_EMULTIHOP=hidden
88b48903 8619fi
c0c3707f 8620rm -f conftest*
88b48903 8621
c0c3707f
CB
8622 if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
8623 if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
8624#define _XOPEN_SOURCE_EXTENDED 1
8625#include <errno.h>
8626/* The following two lines are a workaround against an autoconf-2.52 bug. */
8627#include <stdio.h>
8628#include <stdlib.h>
8629"; then :
88b48903
WN
8630
8631fi
88b48903 8632
c0c3707f
CB
8633 fi
8634 fi
88b48903 8635
c0c3707f
CB
8636fi
8637{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
8638$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
8639 case $gl_cv_header_errno_h_EMULTIHOP in
8640 yes | no)
8641 EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
8642 ;;
8643 *)
8644 EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
8645 ;;
8646 esac
88b48903 8647
e26b6bb0 8648
c0c3707f 8649 fi
e26b6bb0 8650
3d99e817 8651
c0c3707f
CB
8652 if test -n "$ERRNO_H"; then
8653 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
8654$as_echo_n "checking for ENOLINK value... " >&6; }
8655if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
8656 $as_echo_n "(cached) " >&6
8657else
472fa5ee 8658
c0c3707f
CB
8659 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8660/* end confdefs.h. */
472fa5ee 8661
c0c3707f
CB
8662#include <errno.h>
8663#ifdef ENOLINK
8664yes
8665#endif
472fa5ee 8666
c0c3707f
CB
8667_ACEOF
8668if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8669 $EGREP "yes" >/dev/null 2>&1; then :
8670 gl_cv_header_errno_h_ENOLINK=yes
8671else
8672 gl_cv_header_errno_h_ENOLINK=no
8673fi
8674rm -f conftest*
472fa5ee 8675
c0c3707f
CB
8676 if test $gl_cv_header_errno_h_ENOLINK = no; then
8677 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8678/* end confdefs.h. */
3d99e817 8679
c0c3707f
CB
8680#define _XOPEN_SOURCE_EXTENDED 1
8681#include <errno.h>
8682#ifdef ENOLINK
8683yes
8684#endif
3d99e817 8685
c0c3707f
CB
8686_ACEOF
8687if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8688 $EGREP "yes" >/dev/null 2>&1; then :
8689 gl_cv_header_errno_h_ENOLINK=hidden
8690fi
8691rm -f conftest*
3d99e817 8692
c0c3707f
CB
8693 if test $gl_cv_header_errno_h_ENOLINK = hidden; then
8694 if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
8695#define _XOPEN_SOURCE_EXTENDED 1
8696#include <errno.h>
8697/* The following two lines are a workaround against an autoconf-2.52 bug. */
8698#include <stdio.h>
8699#include <stdlib.h>
8700"; then :
3d99e817 8701
c0c3707f 8702fi
3d99e817 8703
c0c3707f
CB
8704 fi
8705 fi
3d99e817 8706
c0c3707f
CB
8707fi
8708{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
8709$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
8710 case $gl_cv_header_errno_h_ENOLINK in
8711 yes | no)
8712 ENOLINK_HIDDEN=0; ENOLINK_VALUE=
8713 ;;
8714 *)
8715 ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
8716 ;;
8717 esac
18848e28 8718
18848e28 8719
c0c3707f 8720 fi
18848e28 8721
18848e28 8722
c0c3707f
CB
8723 if test -n "$ERRNO_H"; then
8724 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
8725$as_echo_n "checking for EOVERFLOW value... " >&6; }
8726if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
8727 $as_echo_n "(cached) " >&6
8728else
18848e28 8729
c0c3707f
CB
8730 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8731/* end confdefs.h. */
18848e28 8732
c0c3707f
CB
8733#include <errno.h>
8734#ifdef EOVERFLOW
8735yes
8736#endif
18848e28 8737
c0c3707f
CB
8738_ACEOF
8739if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8740 $EGREP "yes" >/dev/null 2>&1; then :
8741 gl_cv_header_errno_h_EOVERFLOW=yes
8742else
8743 gl_cv_header_errno_h_EOVERFLOW=no
8744fi
8745rm -f conftest*
18848e28 8746
c0c3707f
CB
8747 if test $gl_cv_header_errno_h_EOVERFLOW = no; then
8748 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8749/* end confdefs.h. */
18848e28 8750
c0c3707f
CB
8751#define _XOPEN_SOURCE_EXTENDED 1
8752#include <errno.h>
8753#ifdef EOVERFLOW
8754yes
8755#endif
18848e28 8756
c0c3707f
CB
8757_ACEOF
8758if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8759 $EGREP "yes" >/dev/null 2>&1; then :
8760 gl_cv_header_errno_h_EOVERFLOW=hidden
8761fi
8762rm -f conftest*
18848e28 8763
c0c3707f
CB
8764 if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
8765 if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
8766#define _XOPEN_SOURCE_EXTENDED 1
8767#include <errno.h>
8768/* The following two lines are a workaround against an autoconf-2.52 bug. */
8769#include <stdio.h>
8770#include <stdlib.h>
8771"; then :
18848e28 8772
c0c3707f 8773fi
18848e28 8774
c0c3707f
CB
8775 fi
8776 fi
18848e28 8777
c0c3707f
CB
8778fi
8779{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
8780$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
8781 case $gl_cv_header_errno_h_EOVERFLOW in
8782 yes | no)
8783 EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
8784 ;;
8785 *)
8786 EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
8787 ;;
8788 esac
4a626d0a
PA
8789
8790
c0c3707f 8791 fi
18848e28 8792
4a626d0a 8793
c0c3707f
CB
8794ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
8795if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
8796 ac_have_decl=1
8797else
8798 ac_have_decl=0
8799fi
4a626d0a 8800
c0c3707f
CB
8801cat >>confdefs.h <<_ACEOF
8802#define HAVE_DECL_STRERROR_R $ac_have_decl
8803_ACEOF
4a626d0a 8804
c0c3707f
CB
8805for ac_func in strerror_r
8806do :
8807 ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
8808if test "x$ac_cv_func_strerror_r" = xyes; then :
8809 cat >>confdefs.h <<_ACEOF
8810#define HAVE_STRERROR_R 1
8811_ACEOF
4a626d0a 8812
c0c3707f
CB
8813fi
8814done
18848e28 8815
c0c3707f
CB
8816{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
8817$as_echo_n "checking whether strerror_r returns char *... " >&6; }
8818if ${ac_cv_func_strerror_r_char_p+:} false; then :
8819 $as_echo_n "(cached) " >&6
8820else
18848e28 8821
c0c3707f
CB
8822 ac_cv_func_strerror_r_char_p=no
8823 if test $ac_cv_have_decl_strerror_r = yes; then
8824 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8825/* end confdefs.h. */
8826$ac_includes_default
8827int
8828main ()
8829{
18848e28 8830
c0c3707f
CB
8831 char buf[100];
8832 char x = *strerror_r (0, buf, sizeof buf);
8833 char *p = strerror_r (0, buf, sizeof buf);
8834 return !p || x;
18848e28 8835
c0c3707f
CB
8836 ;
8837 return 0;
8838}
8839_ACEOF
8840if ac_fn_c_try_compile "$LINENO"; then :
8841 ac_cv_func_strerror_r_char_p=yes
8842fi
8843rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8844 else
8845 # strerror_r is not declared. Choose between
8846 # systems that have relatively inaccessible declarations for the
8847 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
8848 # former has a strerror_r that returns char*, while the latter
8849 # has a strerror_r that returns `int'.
8850 # This test should segfault on the DEC system.
8851 if test "$cross_compiling" = yes; then :
8852 :
8853else
8854 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8855/* end confdefs.h. */
8856$ac_includes_default
8857 extern char *strerror_r ();
8858int
8859main ()
8860{
8861char buf[100];
8862 char x = *strerror_r (0, buf, sizeof buf);
8863 return ! isalpha (x);
8864 ;
8865 return 0;
8866}
8867_ACEOF
8868if ac_fn_c_try_run "$LINENO"; then :
8869 ac_cv_func_strerror_r_char_p=yes
8870fi
8871rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8872 conftest.$ac_objext conftest.beam conftest.$ac_ext
8873fi
18848e28 8874
c0c3707f 8875 fi
18848e28 8876
c0c3707f
CB
8877fi
8878{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
8879$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
8880if test $ac_cv_func_strerror_r_char_p = yes; then
18848e28 8881
c0c3707f 8882$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
18848e28 8883
c0c3707f 8884fi
18848e28 8885
18848e28 8886
18848e28 8887
18848e28 8888
c0c3707f
CB
8889ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
8890if test "x$ac_cv_have_decl_fchdir" = xyes; then :
8891 ac_have_decl=1
8892else
8893 ac_have_decl=0
8894fi
18848e28 8895
c0c3707f
CB
8896cat >>confdefs.h <<_ACEOF
8897#define HAVE_DECL_FCHDIR $ac_have_decl
8898_ACEOF
18848e28 8899
18848e28 8900
c0c3707f
CB
8901 GNULIB_CREAT=0;
8902 GNULIB_FCNTL=0;
8903 GNULIB_NONBLOCKING=0;
8904 GNULIB_OPEN=0;
8905 GNULIB_OPENAT=0;
9c9d63b1
PM
8906 GNULIB_MDA_CREAT=1;
8907 GNULIB_MDA_OPEN=1;
c0c3707f
CB
8908 HAVE_FCNTL=1;
8909 HAVE_OPENAT=1;
8910 REPLACE_CREAT=0;
8911 REPLACE_FCNTL=0;
8912 REPLACE_OPEN=0;
8913 REPLACE_OPENAT=0;
18848e28 8914
18848e28 8915
18848e28 8916
18848e28
GF
8917
8918
18848e28
GF
8919
8920
18848e28 8921
18848e28 8922
18848e28 8923
c0c3707f
CB
8924 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
8925$as_echo_n "checking for working fcntl.h... " >&6; }
8926if ${gl_cv_header_working_fcntl_h+:} false; then :
8927 $as_echo_n "(cached) " >&6
8928else
8929 if test "$cross_compiling" = yes; then :
8930 case "$host_os" in
8931 # Guess 'no' on native Windows.
8932 mingw*) gl_cv_header_working_fcntl_h='no' ;;
8933 *) gl_cv_header_working_fcntl_h=cross-compiling ;;
8934 esac
18848e28 8935
c0c3707f
CB
8936else
8937 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8938/* end confdefs.h. */
8939#include <sys/types.h>
8940 #include <sys/stat.h>
8941 #if HAVE_UNISTD_H
8942 # include <unistd.h>
8943 #else /* on Windows with MSVC */
8944 # include <io.h>
8945 # include <stdlib.h>
8946 # defined sleep(n) _sleep ((n) * 1000)
8947 #endif
8948 #include <fcntl.h>
9c9d63b1
PM
8949
8950
8951$gl_mda_defines
8952
c0c3707f
CB
8953 #ifndef O_NOATIME
8954 #define O_NOATIME 0
8955 #endif
8956 #ifndef O_NOFOLLOW
8957 #define O_NOFOLLOW 0
8958 #endif
8959 static int const constants[] =
8960 {
8961 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
8962 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
8963 };
18848e28 8964
c0c3707f
CB
8965int
8966main ()
8967{
18848e28 8968
c0c3707f
CB
8969 int result = !constants;
8970 #if HAVE_SYMLINK
8971 {
8972 static char const sym[] = "conftest.sym";
8973 if (symlink ("/dev/null", sym) != 0)
8974 result |= 2;
8975 else
8976 {
8977 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
8978 if (fd >= 0)
8979 {
8980 close (fd);
8981 result |= 4;
8982 }
8983 }
8984 if (unlink (sym) != 0 || symlink (".", sym) != 0)
8985 result |= 2;
8986 else
8987 {
8988 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
8989 if (fd >= 0)
8990 {
8991 close (fd);
8992 result |= 4;
8993 }
8994 }
8995 unlink (sym);
8996 }
8997 #endif
8998 {
8999 static char const file[] = "confdefs.h";
9000 int fd = open (file, O_RDONLY | O_NOATIME);
9001 if (fd < 0)
9002 result |= 8;
9003 else
9004 {
9005 struct stat st0;
9006 if (fstat (fd, &st0) != 0)
9007 result |= 16;
9008 else
9009 {
9010 char c;
9011 sleep (1);
9012 if (read (fd, &c, 1) != 1)
9013 result |= 24;
9014 else
9015 {
9016 if (close (fd) != 0)
9017 result |= 32;
9018 else
9019 {
9020 struct stat st1;
9021 if (stat (file, &st1) != 0)
9022 result |= 40;
9023 else
9024 if (st0.st_atime != st1.st_atime)
9025 result |= 64;
9026 }
9027 }
9028 }
9029 }
9030 }
9031 return result;
9032 ;
9033 return 0;
9034}
9035_ACEOF
9036if ac_fn_c_try_run "$LINENO"; then :
9037 gl_cv_header_working_fcntl_h=yes
9038else
9039 case $? in #(
9040 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
9041 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
9042 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
9043 *) gl_cv_header_working_fcntl_h='no';;
9044 esac
9045fi
9046rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9047 conftest.$ac_objext conftest.beam conftest.$ac_ext
9048fi
18848e28 9049
18848e28 9050
c0c3707f
CB
9051fi
9052{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
9053$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
18848e28 9054
c0c3707f
CB
9055 case $gl_cv_header_working_fcntl_h in #(
9056 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
9057 *) ac_val=1;;
9058 esac
18848e28 9059
c0c3707f
CB
9060cat >>confdefs.h <<_ACEOF
9061#define HAVE_WORKING_O_NOATIME $ac_val
9062_ACEOF
18848e28
GF
9063
9064
c0c3707f
CB
9065 case $gl_cv_header_working_fcntl_h in #(
9066 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
9067 *) ac_val=1;;
9068 esac
18848e28 9069
c0c3707f
CB
9070cat >>confdefs.h <<_ACEOF
9071#define HAVE_WORKING_O_NOFOLLOW $ac_val
9072_ACEOF
18848e28 9073
63ce7108 9074
9c9d63b1
PM
9075
9076 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default
9077"
c0c3707f 9078if test "x$ac_cv_type_pid_t" = xyes; then :
63ce7108 9079
c0c3707f 9080else
9c9d63b1
PM
9081 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9082/* end confdefs.h. */
9083
9084 #if defined _WIN64 && !defined __CYGWIN__
9085 LLP64
9086 #endif
9087
9088int
9089main ()
9090{
9091
9092 ;
9093 return 0;
9094}
9095
9096_ACEOF
9097if ac_fn_c_try_compile "$LINENO"; then :
9098 gl_pid_type='int'
9099else
9100 gl_pid_type='__int64'
9101fi
9102rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63ce7108 9103
c0c3707f 9104cat >>confdefs.h <<_ACEOF
9c9d63b1 9105#define pid_t $gl_pid_type
c0c3707f 9106_ACEOF
63ce7108 9107
9c9d63b1 9108
c0c3707f 9109fi
63ce7108 9110
9c9d63b1 9111
c0c3707f
CB
9112ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
9113if test "x$ac_cv_type_mode_t" = xyes; then :
63ce7108 9114
c0c3707f 9115else
63ce7108 9116
c0c3707f
CB
9117cat >>confdefs.h <<_ACEOF
9118#define mode_t int
9119_ACEOF
63ce7108 9120
c0c3707f 9121fi
63ce7108 9122
472fa5ee
SM
9123
9124
9125
9126
9127
c0c3707f
CB
9128 GNULIB_FNMATCH=0;
9129 HAVE_FNMATCH=1;
9130 REPLACE_FNMATCH=0;
472fa5ee
SM
9131
9132
9133
9134
9135
9136
472fa5ee
SM
9137
9138
472fa5ee
SM
9139
9140
9141
9142
9143
9144
9145
9146
7a6dbc2f 9147 if test $gl_cv_have_include_next = yes; then
c0c3707f 9148 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
7a6dbc2f 9149 else
c0c3707f
CB
9150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5
9151$as_echo_n "checking absolute name of <fnmatch.h>... " >&6; }
9152if ${gl_cv_next_fnmatch_h+:} false; then :
7a6dbc2f
SDJ
9153 $as_echo_n "(cached) " >&6
9154else
472fa5ee 9155
c0c3707f
CB
9156 if test $ac_cv_header_fnmatch_h = yes; then
9157
9158
472fa5ee
SM
9159
9160
7a6dbc2f
SDJ
9161 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9162/* end confdefs.h. */
c0c3707f 9163#include <fnmatch.h>
7a6dbc2f
SDJ
9164_ACEOF
9165 case "$host_os" in
9166 aix*) gl_absname_cpp="$ac_cpp -C" ;;
9167 *) gl_absname_cpp="$ac_cpp" ;;
9168 esac
472fa5ee 9169
7a6dbc2f
SDJ
9170 case "$host_os" in
9171 mingw*)
9172 gl_dirsep_regex='[/\\]'
9173 ;;
9174 *)
9175 gl_dirsep_regex='\/'
9176 ;;
9177 esac
9178 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 9179 gl_header_literal_regex=`echo 'fnmatch.h' \
7a6dbc2f
SDJ
9180 | sed -e "$gl_make_literal_regex_sed"`
9181 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
9182 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
9183 s|^/[^/]|//&|
9184 p
9185 q
9186 }'
9187
c0c3707f 9188 gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
7a6dbc2f
SDJ
9189 sed -n "$gl_absolute_header_sed"`
9190
c0c3707f
CB
9191 gl_header=$gl_cv_absolute_fnmatch_h
9192 gl_cv_next_fnmatch_h='"'$gl_header'"'
9193 else
9194 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
9195 fi
7a6dbc2f
SDJ
9196
9197
9198fi
c0c3707f
CB
9199{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5
9200$as_echo "$gl_cv_next_fnmatch_h" >&6; }
7a6dbc2f 9201 fi
c0c3707f 9202 NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h
7a6dbc2f
SDJ
9203
9204 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
9205 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 9206 gl_next_as_first_directive='<'fnmatch.h'>'
7a6dbc2f
SDJ
9207 else
9208 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 9209 gl_next_as_first_directive=$gl_cv_next_fnmatch_h
7a6dbc2f 9210 fi
c0c3707f 9211 NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive
7a6dbc2f
SDJ
9212
9213
9214
9215
7a6dbc2f 9216
7a6dbc2f
SDJ
9217
9218
c0c3707f
CB
9219 if test $ac_cv_header_fnmatch_h = yes; then
9220 HAVE_FNMATCH_H=1
9221 else
9222 HAVE_FNMATCH_H=0
9223 fi
7a6dbc2f
SDJ
9224
9225
c0c3707f
CB
9226 FNMATCH_H=''
9227 if false; then
9228 FNMATCH_H=fnmatch.h
9229 else
9230 if test $ac_cv_header_fnmatch_h != yes; then
9231 FNMATCH_H=fnmatch.h
9232 fi
9233 fi
7a6dbc2f 9234
c0c3707f
CB
9235
9236 if test -n "$FNMATCH_H"; then
9237 GL_GENERATE_FNMATCH_H_TRUE=
9238 GL_GENERATE_FNMATCH_H_FALSE='#'
7a6dbc2f 9239else
c0c3707f
CB
9240 GL_GENERATE_FNMATCH_H_TRUE='#'
9241 GL_GENERATE_FNMATCH_H_FALSE=
7a6dbc2f 9242fi
7a6dbc2f 9243
7a6dbc2f 9244
7a6dbc2f 9245
7a6dbc2f
SDJ
9246
9247
9248
9249
9250
9251
9252
c0c3707f
CB
9253 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
9254$as_echo_n "checking for mbstate_t... " >&6; }
9255if ${ac_cv_type_mbstate_t+:} false; then :
5e8754f9
SDJ
9256 $as_echo_n "(cached) " >&6
9257else
c0c3707f 9258 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 9259/* end confdefs.h. */
c0c3707f 9260$ac_includes_default
9c9d63b1 9261 #include <wchar.h>
c0c3707f
CB
9262int
9263main ()
9264{
9265mbstate_t x; return sizeof x;
9266 ;
9267 return 0;
9268}
5e8754f9 9269_ACEOF
c0c3707f
CB
9270if ac_fn_c_try_compile "$LINENO"; then :
9271 ac_cv_type_mbstate_t=yes
5e8754f9 9272else
c0c3707f 9273 ac_cv_type_mbstate_t=no
5e8754f9 9274fi
c0c3707f
CB
9275rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9276fi
9277{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
9278$as_echo "$ac_cv_type_mbstate_t" >&6; }
9279 if test $ac_cv_type_mbstate_t = yes; then
5e8754f9 9280
c0c3707f 9281$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
5e8754f9 9282
c0c3707f 9283 else
5e8754f9 9284
c0c3707f 9285$as_echo "#define mbstate_t int" >>confdefs.h
5e8754f9 9286
c0c3707f 9287 fi
5e8754f9
SDJ
9288
9289
9290
9291
5e8754f9
SDJ
9292 GNULIB_ACOSF=0;
9293 GNULIB_ACOSL=0;
9294 GNULIB_ASINF=0;
9295 GNULIB_ASINL=0;
9296 GNULIB_ATANF=0;
9297 GNULIB_ATANL=0;
9298 GNULIB_ATAN2F=0;
9299 GNULIB_CBRT=0;
9300 GNULIB_CBRTF=0;
9301 GNULIB_CBRTL=0;
9302 GNULIB_CEIL=0;
9303 GNULIB_CEILF=0;
9304 GNULIB_CEILL=0;
9305 GNULIB_COPYSIGN=0;
9306 GNULIB_COPYSIGNF=0;
9307 GNULIB_COPYSIGNL=0;
9308 GNULIB_COSF=0;
9309 GNULIB_COSL=0;
9310 GNULIB_COSHF=0;
9311 GNULIB_EXPF=0;
9312 GNULIB_EXPL=0;
9313 GNULIB_EXP2=0;
9314 GNULIB_EXP2F=0;
9315 GNULIB_EXP2L=0;
9316 GNULIB_EXPM1=0;
9317 GNULIB_EXPM1F=0;
9318 GNULIB_EXPM1L=0;
9319 GNULIB_FABSF=0;
9320 GNULIB_FABSL=0;
9321 GNULIB_FLOOR=0;
9322 GNULIB_FLOORF=0;
9323 GNULIB_FLOORL=0;
9324 GNULIB_FMA=0;
9325 GNULIB_FMAF=0;
9326 GNULIB_FMAL=0;
9327 GNULIB_FMOD=0;
9328 GNULIB_FMODF=0;
9329 GNULIB_FMODL=0;
9330 GNULIB_FREXPF=0;
9331 GNULIB_FREXP=0;
9332 GNULIB_FREXPL=0;
9333 GNULIB_HYPOT=0;
9334 GNULIB_HYPOTF=0;
9335 GNULIB_HYPOTL=0;
9336 GNULIB_ILOGB=0;
9337 GNULIB_ILOGBF=0;
9338 GNULIB_ILOGBL=0;
9339 GNULIB_ISFINITE=0;
9340 GNULIB_ISINF=0;
9341 GNULIB_ISNAN=0;
9342 GNULIB_ISNANF=0;
9343 GNULIB_ISNAND=0;
9344 GNULIB_ISNANL=0;
9345 GNULIB_LDEXPF=0;
9346 GNULIB_LDEXPL=0;
9347 GNULIB_LOG=0;
9348 GNULIB_LOGF=0;
9349 GNULIB_LOGL=0;
9350 GNULIB_LOG10=0;
9351 GNULIB_LOG10F=0;
9352 GNULIB_LOG10L=0;
9353 GNULIB_LOG1P=0;
9354 GNULIB_LOG1PF=0;
9355 GNULIB_LOG1PL=0;
9356 GNULIB_LOG2=0;
9357 GNULIB_LOG2F=0;
9358 GNULIB_LOG2L=0;
9359 GNULIB_LOGB=0;
9360 GNULIB_LOGBF=0;
9361 GNULIB_LOGBL=0;
9362 GNULIB_MODF=0;
9363 GNULIB_MODFF=0;
9364 GNULIB_MODFL=0;
9365 GNULIB_POWF=0;
9366 GNULIB_REMAINDER=0;
9367 GNULIB_REMAINDERF=0;
9368 GNULIB_REMAINDERL=0;
9369 GNULIB_RINT=0;
9370 GNULIB_RINTF=0;
9371 GNULIB_RINTL=0;
9372 GNULIB_ROUND=0;
9373 GNULIB_ROUNDF=0;
9374 GNULIB_ROUNDL=0;
9375 GNULIB_SIGNBIT=0;
9376 GNULIB_SINF=0;
9377 GNULIB_SINL=0;
9378 GNULIB_SINHF=0;
9379 GNULIB_SQRTF=0;
9380 GNULIB_SQRTL=0;
9381 GNULIB_TANF=0;
9382 GNULIB_TANL=0;
9383 GNULIB_TANHF=0;
9384 GNULIB_TRUNC=0;
9385 GNULIB_TRUNCF=0;
9386 GNULIB_TRUNCL=0;
9c9d63b1
PM
9387 GNULIB_MDA_J0=1;
9388 GNULIB_MDA_J1=1;
9389 GNULIB_MDA_JN=1;
9390 GNULIB_MDA_Y0=1;
9391 GNULIB_MDA_Y1=1;
9392 GNULIB_MDA_YN=1;
5e8754f9
SDJ
9393 HAVE_ACOSF=1;
9394 HAVE_ACOSL=1;
9395 HAVE_ASINF=1;
9396 HAVE_ASINL=1;
9397 HAVE_ATANF=1;
9398 HAVE_ATANL=1;
9399 HAVE_ATAN2F=1;
9400 HAVE_CBRT=1;
9401 HAVE_CBRTF=1;
9402 HAVE_CBRTL=1;
9403 HAVE_COPYSIGN=1;
9404 HAVE_COPYSIGNL=1;
9405 HAVE_COSF=1;
9406 HAVE_COSL=1;
9407 HAVE_COSHF=1;
9408 HAVE_EXPF=1;
9409 HAVE_EXPL=1;
9410 HAVE_EXPM1=1;
9411 HAVE_EXPM1F=1;
9412 HAVE_FABSF=1;
9413 HAVE_FABSL=1;
9414 HAVE_FMA=1;
9415 HAVE_FMAF=1;
9416 HAVE_FMAL=1;
9417 HAVE_FMODF=1;
9418 HAVE_FMODL=1;
9419 HAVE_FREXPF=1;
9420 HAVE_HYPOTF=1;
9421 HAVE_HYPOTL=1;
9422 HAVE_ILOGB=1;
9423 HAVE_ILOGBF=1;
9424 HAVE_ILOGBL=1;
9425 HAVE_ISNANF=1;
9426 HAVE_ISNAND=1;
9427 HAVE_ISNANL=1;
9428 HAVE_LDEXPF=1;
9429 HAVE_LOGF=1;
9430 HAVE_LOGL=1;
9431 HAVE_LOG10F=1;
9432 HAVE_LOG10L=1;
9433 HAVE_LOG1P=1;
9434 HAVE_LOG1PF=1;
9435 HAVE_LOG1PL=1;
9436 HAVE_LOGBF=1;
9437 HAVE_LOGBL=1;
9438 HAVE_MODFF=1;
9439 HAVE_MODFL=1;
9440 HAVE_POWF=1;
9441 HAVE_REMAINDER=1;
9442 HAVE_REMAINDERF=1;
9443 HAVE_RINT=1;
9444 HAVE_RINTL=1;
9445 HAVE_SINF=1;
9446 HAVE_SINL=1;
9447 HAVE_SINHF=1;
9448 HAVE_SQRTF=1;
9449 HAVE_SQRTL=1;
9450 HAVE_TANF=1;
9451 HAVE_TANL=1;
9452 HAVE_TANHF=1;
9453 HAVE_DECL_ACOSL=1;
9454 HAVE_DECL_ASINL=1;
9455 HAVE_DECL_ATANL=1;
9456 HAVE_DECL_CBRTF=1;
9457 HAVE_DECL_CBRTL=1;
9458 HAVE_DECL_CEILF=1;
9459 HAVE_DECL_CEILL=1;
9460 HAVE_DECL_COPYSIGNF=1;
9461 HAVE_DECL_COSL=1;
9462 HAVE_DECL_EXPL=1;
9463 HAVE_DECL_EXP2=1;
9464 HAVE_DECL_EXP2F=1;
9465 HAVE_DECL_EXP2L=1;
9466 HAVE_DECL_EXPM1L=1;
9467 HAVE_DECL_FLOORF=1;
9468 HAVE_DECL_FLOORL=1;
9469 HAVE_DECL_FREXPL=1;
9470 HAVE_DECL_LDEXPL=1;
9471 HAVE_DECL_LOGL=1;
9472 HAVE_DECL_LOG10L=1;
9473 HAVE_DECL_LOG2=1;
9474 HAVE_DECL_LOG2F=1;
9475 HAVE_DECL_LOG2L=1;
9476 HAVE_DECL_LOGB=1;
9477 HAVE_DECL_REMAINDER=1;
9478 HAVE_DECL_REMAINDERL=1;
9479 HAVE_DECL_RINTF=1;
9480 HAVE_DECL_ROUND=1;
9481 HAVE_DECL_ROUNDF=1;
9482 HAVE_DECL_ROUNDL=1;
9483 HAVE_DECL_SINL=1;
9484 HAVE_DECL_SQRTL=1;
9485 HAVE_DECL_TANL=1;
9486 HAVE_DECL_TRUNC=1;
9487 HAVE_DECL_TRUNCF=1;
9488 HAVE_DECL_TRUNCL=1;
c0c3707f
CB
9489 REPLACE_ACOSF=0;
9490 REPLACE_ASINF=0;
9491 REPLACE_ATANF=0;
9492 REPLACE_ATAN2F=0;
5e8754f9
SDJ
9493 REPLACE_CBRTF=0;
9494 REPLACE_CBRTL=0;
9495 REPLACE_CEIL=0;
9496 REPLACE_CEILF=0;
9497 REPLACE_CEILL=0;
c0c3707f
CB
9498 REPLACE_COSF=0;
9499 REPLACE_COSHF=0;
9500 REPLACE_EXPF=0;
9501 REPLACE_EXPL=0;
5e8754f9
SDJ
9502 REPLACE_EXPM1=0;
9503 REPLACE_EXPM1F=0;
c0c3707f 9504 REPLACE_EXPM1L=0;
5e8754f9
SDJ
9505 REPLACE_EXP2=0;
9506 REPLACE_EXP2L=0;
9507 REPLACE_FABSL=0;
9508 REPLACE_FLOOR=0;
9509 REPLACE_FLOORF=0;
9510 REPLACE_FLOORL=0;
9511 REPLACE_FMA=0;
9512 REPLACE_FMAF=0;
9513 REPLACE_FMAL=0;
9514 REPLACE_FMOD=0;
9515 REPLACE_FMODF=0;
9516 REPLACE_FMODL=0;
9517 REPLACE_FREXPF=0;
9518 REPLACE_FREXP=0;
9519 REPLACE_FREXPL=0;
9520 REPLACE_HUGE_VAL=0;
9521 REPLACE_HYPOT=0;
9522 REPLACE_HYPOTF=0;
9523 REPLACE_HYPOTL=0;
9524 REPLACE_ILOGB=0;
9525 REPLACE_ILOGBF=0;
c0c3707f 9526 REPLACE_ILOGBL=0;
5e8754f9
SDJ
9527 REPLACE_ISFINITE=0;
9528 REPLACE_ISINF=0;
9529 REPLACE_ISNAN=0;
9530 REPLACE_LDEXPL=0;
9531 REPLACE_LOG=0;
9532 REPLACE_LOGF=0;
9533 REPLACE_LOGL=0;
9534 REPLACE_LOG10=0;
9535 REPLACE_LOG10F=0;
9536 REPLACE_LOG10L=0;
9537 REPLACE_LOG1P=0;
9538 REPLACE_LOG1PF=0;
9539 REPLACE_LOG1PL=0;
9540 REPLACE_LOG2=0;
9541 REPLACE_LOG2F=0;
9542 REPLACE_LOG2L=0;
9543 REPLACE_LOGB=0;
9544 REPLACE_LOGBF=0;
9545 REPLACE_LOGBL=0;
9546 REPLACE_MODF=0;
9547 REPLACE_MODFF=0;
9548 REPLACE_MODFL=0;
9549 REPLACE_NAN=0;
9550 REPLACE_REMAINDER=0;
9551 REPLACE_REMAINDERF=0;
9552 REPLACE_REMAINDERL=0;
c0c3707f 9553 REPLACE_RINTL=0;
5e8754f9 9554 REPLACE_ROUND=0;
c0c3707f
CB
9555 REPLACE_ROUNDF=0;
9556 REPLACE_ROUNDL=0;
9557 REPLACE_SIGNBIT=0;
9c9d63b1 9558 REPLACE_SIGNBIT_USING_BUILTINS=0;
c0c3707f
CB
9559 REPLACE_SINF=0;
9560 REPLACE_SINHF=0;
9561 REPLACE_SQRTF=0;
9562 REPLACE_SQRTL=0;
9563 REPLACE_TANF=0;
9564 REPLACE_TANHF=0;
9565 REPLACE_TRUNC=0;
9566 REPLACE_TRUNCF=0;
9567 REPLACE_TRUNCL=0;
49e4877c 9568
49e4877c 9569
c0c3707f
CB
9570 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
9571$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
9572if ${gl_cv_func_frexp_no_libm+:} false; then :
9573 $as_echo_n "(cached) " >&6
9574else
8690e634 9575
c0c3707f
CB
9576 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9577/* end confdefs.h. */
9578#include <math.h>
9579 double x;
9580int
9581main ()
9582{
9583int e; return frexp (x, &e) > 0;
9584 ;
9585 return 0;
9586}
9587_ACEOF
9588if ac_fn_c_try_link "$LINENO"; then :
9589 gl_cv_func_frexp_no_libm=yes
9590else
9591 gl_cv_func_frexp_no_libm=no
9592fi
9593rm -f core conftest.err conftest.$ac_objext \
9594 conftest$ac_exeext conftest.$ac_ext
8690e634 9595
c0c3707f
CB
9596fi
9597{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
9598$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
8690e634 9599
c0c3707f
CB
9600ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
9601if test "x$ac_cv_have_decl_alarm" = xyes; then :
9602 ac_have_decl=1
9603else
9604 ac_have_decl=0
9605fi
472fa5ee 9606
c0c3707f
CB
9607cat >>confdefs.h <<_ACEOF
9608#define HAVE_DECL_ALARM $ac_have_decl
9609_ACEOF
472fa5ee
SM
9610
9611
9612
9613
c0c3707f
CB
9614 FREXP_LIBM=
9615 if test $gl_cv_func_frexp_no_libm = no; then
9616 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5
9617$as_echo_n "checking whether frexp() can be used with libm... " >&6; }
9618if ${gl_cv_func_frexp_in_libm+:} false; then :
9619 $as_echo_n "(cached) " >&6
9620else
8690e634 9621
c0c3707f
CB
9622 save_LIBS="$LIBS"
9623 LIBS="$LIBS -lm"
9624 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9625/* end confdefs.h. */
9626#include <math.h>
9627 double x;
9628int
9629main ()
9630{
9631int e; return frexp (x, &e) > 0;
9632 ;
9633 return 0;
9634}
9635_ACEOF
9636if ac_fn_c_try_link "$LINENO"; then :
9637 gl_cv_func_frexp_in_libm=yes
9638else
9639 gl_cv_func_frexp_in_libm=no
9640fi
9641rm -f core conftest.err conftest.$ac_objext \
9642 conftest$ac_exeext conftest.$ac_ext
9643 LIBS="$save_LIBS"
8690e634 9644
c0c3707f
CB
9645fi
9646{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5
9647$as_echo "$gl_cv_func_frexp_in_libm" >&6; }
9648 if test $gl_cv_func_frexp_in_libm = yes; then
9649 FREXP_LIBM=-lm
9650 fi
6ec2e0f5 9651 fi
c0c3707f
CB
9652 if test $gl_cv_func_frexp_no_libm = yes \
9653 || test $gl_cv_func_frexp_in_libm = yes; then
9654 save_LIBS="$LIBS"
9655 LIBS="$LIBS $FREXP_LIBM"
8690e634
JK
9656
9657
8690e634 9658
c0c3707f
CB
9659 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
9660$as_echo_n "checking whether frexp works... " >&6; }
9661if ${gl_cv_func_frexp_works+:} false; then :
9662 $as_echo_n "(cached) " >&6
9663else
8690e634 9664
c0c3707f
CB
9665 if test "$cross_compiling" = yes; then :
9666 case "$host_os" in
9667 netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
9668 mingw*) # Guess yes with MSVC, no with mingw.
9669 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9670/* end confdefs.h. */
8690e634 9671
c0c3707f
CB
9672#ifdef _MSC_VER
9673 Good
9674#endif
8690e634 9675
c0c3707f
CB
9676_ACEOF
9677if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9678 $EGREP "Good" >/dev/null 2>&1; then :
9679 gl_cv_func_frexp_works="guessing yes"
9680else
9681 gl_cv_func_frexp_works="guessing no"
9682fi
9683rm -f conftest*
8690e634 9684
c0c3707f
CB
9685 ;;
9686 *) gl_cv_func_frexp_works="guessing yes" ;;
9687 esac
8690e634 9688
c0c3707f
CB
9689else
9690 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9691/* end confdefs.h. */
8690e634 9692
c0c3707f
CB
9693#include <float.h>
9694#include <math.h>
9695#include <string.h>
9696#if HAVE_DECL_ALARM
9697# include <signal.h>
9698# include <unistd.h>
9699#endif
9700/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
9701 ICC 10.0 has a bug when optimizing the expression -zero.
9702 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
9703 to PowerPC on Mac OS X 10.5. */
9704#if defined __hpux || defined __sgi || defined __ICC
9705static double
9706compute_minus_zero (void)
9707{
9708 return -DBL_MIN * DBL_MIN;
9709}
9710# define minus_zero compute_minus_zero ()
9711#else
9712double minus_zero = -0.0;
9713#endif
9714int main()
9715{
9716 int result = 0;
9717 int i;
9718 volatile double x;
9719 double zero = 0.0;
9720#if HAVE_DECL_ALARM
9721 /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
9722 number. Let the test fail in this case. */
9723 signal (SIGALRM, SIG_DFL);
9724 alarm (5);
9725#endif
9726 /* Test on denormalized numbers. */
9727 for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
9728 ;
9729 if (x > 0.0)
9730 {
9731 int exp;
9732 double y = frexp (x, &exp);
9733 /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
9734 On NetBSD: y = 0.75. Correct: y = 0.5. */
9735 if (y != 0.5)
9736 result |= 1;
9737 }
9738 /* Test on infinite numbers. */
9739 x = 1.0 / zero;
9740 {
9741 int exp;
9742 double y = frexp (x, &exp);
9743 if (y != x)
9744 result |= 2;
9745 }
9746 /* Test on negative zero. */
9747 x = minus_zero;
9748 {
9749 int exp;
9750 double y = frexp (x, &exp);
9751 if (memcmp (&y, &x, sizeof x))
9752 result |= 4;
9753 }
9754 return result;
9755}
9756_ACEOF
9757if ac_fn_c_try_run "$LINENO"; then :
9758 gl_cv_func_frexp_works=yes
9759else
9760 gl_cv_func_frexp_works=no
9761fi
9762rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9763 conftest.$ac_objext conftest.beam conftest.$ac_ext
9764fi
472fa5ee
SM
9765
9766
c0c3707f
CB
9767fi
9768{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
9769$as_echo "$gl_cv_func_frexp_works" >&6; }
472fa5ee 9770
c0c3707f
CB
9771 LIBS="$save_LIBS"
9772 case "$gl_cv_func_frexp_works" in
9773 *yes) gl_func_frexp=yes ;;
9774 *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
9775 esac
9776 else
9777 gl_func_frexp=no
9778 fi
9779 if test $gl_func_frexp = yes; then
472fa5ee 9780
c0c3707f 9781$as_echo "#define HAVE_FREXP 1" >>confdefs.h
472fa5ee 9782
c0c3707f 9783 fi
8690e634 9784
6ec2e0f5
SDJ
9785
9786
c0c3707f
CB
9787 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
9788$as_echo_n "checking whether long double and double are the same... " >&6; }
9789if ${gl_cv_long_double_equals_double+:} false; then :
8690e634
JK
9790 $as_echo_n "(cached) " >&6
9791else
c0c3707f
CB
9792 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9793/* end confdefs.h. */
9794#include <float.h>
9795int
9796main ()
9797{
9798typedef int check[sizeof (long double) == sizeof (double)
9799 && LDBL_MANT_DIG == DBL_MANT_DIG
9800 && LDBL_MAX_EXP == DBL_MAX_EXP
9801 && LDBL_MIN_EXP == DBL_MIN_EXP
9802 ? 1 : -1];
8690e634 9803
c0c3707f
CB
9804 ;
9805 return 0;
9806}
9807_ACEOF
9808if ac_fn_c_try_compile "$LINENO"; then :
9809 gl_cv_long_double_equals_double=yes
9810else
9811 gl_cv_long_double_equals_double=no
9812fi
9813rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9814
c0c3707f
CB
9815fi
9816{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
9817$as_echo "$gl_cv_long_double_equals_double" >&6; }
9818 if test $gl_cv_long_double_equals_double = yes; then
8690e634 9819
c0c3707f 9820$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
6ec2e0f5 9821
c0c3707f
CB
9822 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
9823 else
9824 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
9825 fi
8690e634 9826
6ec2e0f5 9827
6ec2e0f5 9828
6ec2e0f5
SDJ
9829
9830
6ec2e0f5 9831
8690e634
JK
9832
9833
c0c3707f
CB
9834 ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
9835"
9836if test "x$ac_cv_have_decl_frexpl" = xyes; then :
8690e634 9837
c0c3707f
CB
9838else
9839 HAVE_DECL_FREXPL=0
9840fi
8690e634 9841
6ec2e0f5 9842
c0c3707f
CB
9843 FREXPL_LIBM=
9844 if test $HAVE_DECL_FREXPL = 1; then
6ec2e0f5 9845
c0c3707f
CB
9846 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
9847$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
9848if ${gl_cv_func_frexpl_no_libm+:} false; then :
8690e634
JK
9849 $as_echo_n "(cached) " >&6
9850else
c0c3707f
CB
9851
9852 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9853/* end confdefs.h. */
c0c3707f
CB
9854#include <math.h>
9855 long double x;
9856int
9857main ()
9858{
9859int e; return frexpl (x, &e) > 0;
9860 ;
9861 return 0;
9862}
9863_ACEOF
9864if ac_fn_c_try_link "$LINENO"; then :
9865 gl_cv_func_frexpl_no_libm=yes
9866else
9867 gl_cv_func_frexpl_no_libm=no
9868fi
9869rm -f core conftest.err conftest.$ac_objext \
9870 conftest$ac_exeext conftest.$ac_ext
8690e634 9871
c0c3707f
CB
9872fi
9873{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
9874$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
6ec2e0f5 9875
c0c3707f
CB
9876 if test $gl_cv_func_frexpl_no_libm = no; then
9877 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5
9878$as_echo_n "checking whether frexpl() can be used with libm... " >&6; }
9879if ${gl_cv_func_frexpl_in_libm+:} false; then :
9880 $as_echo_n "(cached) " >&6
9881else
6ec2e0f5 9882
c0c3707f
CB
9883 save_LIBS="$LIBS"
9884 LIBS="$LIBS -lm"
9885 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9886/* end confdefs.h. */
9887#include <math.h>
9888 long double x;
9889int
9890main ()
9891{
9892int e; return frexpl (x, &e) > 0;
9893 ;
9894 return 0;
9895}
9896_ACEOF
9897if ac_fn_c_try_link "$LINENO"; then :
9898 gl_cv_func_frexpl_in_libm=yes
9899else
9900 gl_cv_func_frexpl_in_libm=no
9901fi
9902rm -f core conftest.err conftest.$ac_objext \
9903 conftest$ac_exeext conftest.$ac_ext
9904 LIBS="$save_LIBS"
6ec2e0f5 9905
c0c3707f
CB
9906fi
9907{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5
9908$as_echo "$gl_cv_func_frexpl_in_libm" >&6; }
9909 if test $gl_cv_func_frexpl_in_libm = yes; then
9910 FREXPL_LIBM=-lm
9911 fi
9912 fi
9913 if test $gl_cv_func_frexpl_no_libm = yes \
9914 || test $gl_cv_func_frexpl_in_libm = yes; then
9915 save_LIBS="$LIBS"
9916 LIBS="$LIBS $FREXPL_LIBM"
8690e634 9917
8690e634 9918
c0c3707f
CB
9919 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
9920$as_echo_n "checking whether frexpl works... " >&6; }
9921if ${gl_cv_func_frexpl_works+:} false; then :
9922 $as_echo_n "(cached) " >&6
9923else
8690e634 9924
c0c3707f 9925 if test "$cross_compiling" = yes; then :
8690e634 9926
c0c3707f
CB
9927 case "$host_os" in
9928 aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
9929 gl_cv_func_frexpl_works="guessing no";;
9930 *) gl_cv_func_frexpl_works="guessing yes";;
9931 esac
8690e634 9932
c0c3707f
CB
9933else
9934 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9935/* end confdefs.h. */
8690e634 9936
c0c3707f
CB
9937#include <float.h>
9938#include <math.h>
9939/* Override the values of <float.h>, like done in float.in.h. */
9940#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
9941# undef LDBL_MIN_EXP
9942# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9943#endif
c0c3707f
CB
9944#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
9945# undef LDBL_MIN_EXP
9946# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9947#endif
c0c3707f
CB
9948#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
9949# undef LDBL_MIN_EXP
9950# define LDBL_MIN_EXP DBL_MIN_EXP
6ec2e0f5 9951#endif
c0c3707f
CB
9952#if defined __sgi && (LDBL_MANT_DIG >= 106)
9953# if defined __GNUC__
9954# undef LDBL_MIN_EXP
9955# define LDBL_MIN_EXP DBL_MIN_EXP
9956# endif
6ec2e0f5 9957#endif
c0c3707f
CB
9958extern
9959#ifdef __cplusplus
9960"C"
9961#endif
9962long double frexpl (long double, int *);
9c9d63b1 9963long double zero = 0.0L;
c0c3707f 9964int main()
8690e634 9965{
c0c3707f
CB
9966 int result = 0;
9967 volatile long double x;
9968 /* Test on finite numbers that fails on AIX 5.1. */
9969 x = 16.0L;
9970 {
9971 int exp = -9999;
9972 frexpl (x, &exp);
9973 if (exp != 5)
9974 result |= 1;
9975 }
9976 /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
9977 function returns an invalid (incorrectly normalized) value: it returns
9978 y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
9979 but the correct result is
9980 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
9981 x = 1.01L;
9982 {
9983 int exp = -9999;
9984 long double y = frexpl (x, &exp);
9985 if (!(exp == 1 && y == 0.505L))
9986 result |= 2;
9987 }
9988 /* Test on large finite numbers. This fails on BeOS at i = 16322, while
9989 LDBL_MAX_EXP = 16384.
9990 In the loop end test, we test x against Infinity, rather than comparing
9991 i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
9992 {
9993 int i;
9994 for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
9995 {
9996 int exp = -9999;
9997 frexpl (x, &exp);
9998 if (exp != i)
9999 {
10000 result |= 4;
10001 break;
10002 }
10003 }
10004 }
10005 /* Test on denormalized numbers. */
10006 {
10007 int i;
10008 for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
10009 ;
10010 if (x > 0.0L)
10011 {
10012 int exp;
10013 long double y = frexpl (x, &exp);
10014 /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
10015 exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
10016 if (exp != LDBL_MIN_EXP - 1)
10017 result |= 8;
10018 }
10019 }
10020 /* Test on infinite numbers. */
9c9d63b1
PM
10021 /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */
10022 x = 1.0L / zero;
c0c3707f
CB
10023 {
10024 int exp;
10025 long double y = frexpl (x, &exp);
10026 if (y != x)
10027 result |= 16;
10028 }
10029 return result;
8690e634
JK
10030}
10031_ACEOF
c0c3707f
CB
10032if ac_fn_c_try_run "$LINENO"; then :
10033 gl_cv_func_frexpl_works=yes
6ec2e0f5 10034else
c0c3707f
CB
10035 gl_cv_func_frexpl_works=no
10036fi
10037rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10038 conftest.$ac_objext conftest.beam conftest.$ac_ext
10039fi
8690e634 10040
8690e634 10041
c0c3707f
CB
10042fi
10043{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
10044$as_echo "$gl_cv_func_frexpl_works" >&6; }
8690e634 10045
c0c3707f
CB
10046 LIBS="$save_LIBS"
10047 case "$gl_cv_func_frexpl_works" in
10048 *yes) gl_func_frexpl=yes ;;
10049 *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
10050 esac
10051 else
10052 gl_func_frexpl=no
10053 fi
10054 if test $gl_func_frexpl = yes; then
8690e634 10055
c0c3707f 10056$as_echo "#define HAVE_FREXPL 1" >>confdefs.h
8690e634 10057
c0c3707f
CB
10058 fi
10059 fi
10060 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
10061 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
8690e634 10062
c0c3707f
CB
10063 FREXPL_LIBM="$FREXP_LIBM"
10064 else
10065 FREXPL_LIBM=
10066 fi
10067 fi
6ec2e0f5 10068
6ec2e0f5 10069
6ec2e0f5 10070
c0c3707f
CB
10071 GNULIB_FCHMODAT=0;
10072 GNULIB_FSTAT=0;
10073 GNULIB_FSTATAT=0;
10074 GNULIB_FUTIMENS=0;
9c9d63b1 10075 GNULIB_GETUMASK=0;
c0c3707f
CB
10076 GNULIB_LCHMOD=0;
10077 GNULIB_LSTAT=0;
9c9d63b1 10078 GNULIB_MKDIR=0;
c0c3707f
CB
10079 GNULIB_MKDIRAT=0;
10080 GNULIB_MKFIFO=0;
10081 GNULIB_MKFIFOAT=0;
10082 GNULIB_MKNOD=0;
10083 GNULIB_MKNODAT=0;
10084 GNULIB_STAT=0;
10085 GNULIB_UTIMENSAT=0;
10086 GNULIB_OVERRIDES_STRUCT_STAT=0;
9c9d63b1
PM
10087 GNULIB_MDA_CHMOD=1;
10088 GNULIB_MDA_MKDIR=1;
10089 GNULIB_MDA_UMASK=1;
c0c3707f
CB
10090 HAVE_FCHMODAT=1;
10091 HAVE_FSTATAT=1;
10092 HAVE_FUTIMENS=1;
9c9d63b1 10093 HAVE_GETUMASK=1;
c0c3707f
CB
10094 HAVE_LCHMOD=1;
10095 HAVE_LSTAT=1;
10096 HAVE_MKDIRAT=1;
10097 HAVE_MKFIFO=1;
10098 HAVE_MKFIFOAT=1;
10099 HAVE_MKNOD=1;
10100 HAVE_MKNODAT=1;
10101 HAVE_UTIMENSAT=1;
5df4cba6 10102 REPLACE_FCHMODAT=0;
c0c3707f
CB
10103 REPLACE_FSTAT=0;
10104 REPLACE_FSTATAT=0;
10105 REPLACE_FUTIMENS=0;
10106 REPLACE_LSTAT=0;
10107 REPLACE_MKDIR=0;
10108 REPLACE_MKFIFO=0;
9c9d63b1 10109 REPLACE_MKFIFOAT=0;
c0c3707f 10110 REPLACE_MKNOD=0;
9c9d63b1 10111 REPLACE_MKNODAT=0;
c0c3707f
CB
10112 REPLACE_STAT=0;
10113 REPLACE_UTIMENSAT=0;
10114
10115{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
10116$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
10117if ${ac_cv_header_stat_broken+:} false; then :
10118 $as_echo_n "(cached) " >&6
10119else
10120 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10121/* end confdefs.h. */
10122#include <sys/types.h>
10123#include <sys/stat.h>
10124
10125#if defined S_ISBLK && defined S_IFDIR
10126extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
10127#endif
10128
10129#if defined S_ISBLK && defined S_IFCHR
10130extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
10131#endif
10132
10133#if defined S_ISLNK && defined S_IFREG
10134extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
10135#endif
8690e634 10136
c0c3707f
CB
10137#if defined S_ISSOCK && defined S_IFREG
10138extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
10139#endif
8690e634 10140
c0c3707f
CB
10141_ACEOF
10142if ac_fn_c_try_compile "$LINENO"; then :
10143 ac_cv_header_stat_broken=no
10144else
10145 ac_cv_header_stat_broken=yes
6ec2e0f5
SDJ
10146fi
10147rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 10148fi
c0c3707f
CB
10149{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
10150$as_echo "$ac_cv_header_stat_broken" >&6; }
10151if test $ac_cv_header_stat_broken = yes; then
8690e634 10152
c0c3707f 10153$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
49e4877c 10154
c0c3707f 10155fi
49e4877c
PA
10156
10157
10158
10159
8690e634 10160
c0c3707f
CB
10161 case "$host_os" in
10162 mingw*)
10163 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
10164$as_echo_n "checking for 64-bit off_t... " >&6; }
10165if ${gl_cv_type_off_t_64+:} false; then :
10166 $as_echo_n "(cached) " >&6
10167else
10168 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10169/* end confdefs.h. */
10170#include <sys/types.h>
10171 int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
8690e634 10172
6ec2e0f5
SDJ
10173int
10174main ()
10175{
8690e634 10176
6ec2e0f5
SDJ
10177 ;
10178 return 0;
10179}
10180_ACEOF
10181if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
10182 gl_cv_type_off_t_64=yes
10183else
10184 gl_cv_type_off_t_64=no
6ec2e0f5
SDJ
10185fi
10186rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 10187
c0c3707f
CB
10188fi
10189{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
10190$as_echo "$gl_cv_type_off_t_64" >&6; }
10191 if test $gl_cv_type_off_t_64 = no; then
10192 WINDOWS_64_BIT_OFF_T=1
10193 else
10194 WINDOWS_64_BIT_OFF_T=0
10195 fi
10196 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
10197$as_echo_n "checking for 64-bit st_size... " >&6; }
10198if ${gl_cv_member_st_size_64+:} false; then :
6ec2e0f5
SDJ
10199 $as_echo_n "(cached) " >&6
10200else
c0c3707f 10201 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10202/* end confdefs.h. */
c0c3707f
CB
10203#include <sys/types.h>
10204 struct stat buf;
10205 int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
8690e634 10206
6ec2e0f5
SDJ
10207int
10208main ()
10209{
8690e634 10210
6ec2e0f5
SDJ
10211 ;
10212 return 0;
10213}
10214_ACEOF
10215if ac_fn_c_try_compile "$LINENO"; then :
698be2d8
CB
10216 gl_cv_member_st_size_64=yes
10217else
10218 gl_cv_member_st_size_64=no
10219fi
10220rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10221
10222fi
10223{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
10224$as_echo "$gl_cv_member_st_size_64" >&6; }
10225 if test $gl_cv_member_st_size_64 = no; then
10226 WINDOWS_64_BIT_ST_SIZE=1
10227 else
10228 WINDOWS_64_BIT_ST_SIZE=0
10229 fi
10230 ;;
10231 *)
10232 WINDOWS_64_BIT_OFF_T=0
10233 WINDOWS_64_BIT_ST_SIZE=0
10234 ;;
10235 esac
10236
10237{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
10238$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
10239if ${ac_cv_c_restrict+:} false; then :
10240 $as_echo_n "(cached) " >&6
10241else
10242 ac_cv_c_restrict=no
9c9d63b1
PM
10243 # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
10244 # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
10245 # Put 'restrict' last, because C++ lacks it.
10246 for ac_kw in __restrict__ __restrict _Restrict restrict; do
698be2d8
CB
10247 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10248/* end confdefs.h. */
10249typedef int *int_ptr;
10250 int foo (int_ptr $ac_kw ip) { return ip[0]; }
10251 int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
10252 int bar (int ip[$ac_kw]) { return ip[0]; }
10253
10254int
10255main ()
10256{
10257int s[1];
10258 int *$ac_kw t = s;
10259 t[0] = 0;
10260 return foo (t) + bar (t);
10261
10262 ;
10263 return 0;
10264}
10265_ACEOF
10266if ac_fn_c_try_compile "$LINENO"; then :
10267 ac_cv_c_restrict=$ac_kw
6ec2e0f5
SDJ
10268fi
10269rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
698be2d8
CB
10270 test "$ac_cv_c_restrict" != no && break
10271 done
8690e634 10272
6ec2e0f5 10273fi
698be2d8
CB
10274{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
10275$as_echo "$ac_cv_c_restrict" >&6; }
10276
10277 case $ac_cv_c_restrict in
10278 restrict) ;;
10279 no) $as_echo "#define restrict /**/" >>confdefs.h
10280 ;;
10281 *) cat >>confdefs.h <<_ACEOF
10282#define restrict $ac_cv_c_restrict
10283_ACEOF
10284 ;;
10285 esac
8690e634
JK
10286
10287
10288
10289
10290
10291
c0c3707f
CB
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301 if test $gl_cv_have_include_next = yes; then
10302 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
10303 else
10304 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
10305$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
10306if ${gl_cv_next_sys_stat_h+:} false; then :
8690e634
JK
10307 $as_echo_n "(cached) " >&6
10308else
10309
c0c3707f 10310 if test $ac_cv_header_sys_stat_h = yes; then
4a626d0a
PA
10311
10312
4a626d0a 10313
c0c3707f
CB
10314
10315 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10316/* end confdefs.h. */
10317#include <sys/stat.h>
6ec2e0f5 10318_ACEOF
c0c3707f
CB
10319 case "$host_os" in
10320 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10321 *) gl_absname_cpp="$ac_cpp" ;;
10322 esac
10323
10324 case "$host_os" in
10325 mingw*)
10326 gl_dirsep_regex='[/\\]'
10327 ;;
10328 *)
10329 gl_dirsep_regex='\/'
10330 ;;
10331 esac
10332 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10333 gl_header_literal_regex=`echo 'sys/stat.h' \
10334 | sed -e "$gl_make_literal_regex_sed"`
10335 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10336 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10337 s|^/[^/]|//&|
10338 p
10339 q
10340 }'
10341
10342 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10343 sed -n "$gl_absolute_header_sed"`
10344
10345 gl_header=$gl_cv_absolute_sys_stat_h
10346 gl_cv_next_sys_stat_h='"'$gl_header'"'
10347 else
10348 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
10349 fi
10350
10351
10352fi
10353{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
10354$as_echo "$gl_cv_next_sys_stat_h" >&6; }
10355 fi
10356 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
10357
10358 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10359 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10360 gl_next_as_first_directive='<'sys/stat.h'>'
10361 else
10362 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10363 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
10364 fi
10365 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
10366
10367
10368
10369
10370
10371
10372
10373
10374 WINDOWS_STAT_TIMESPEC=0
10375
10376
10377
10378
4a626d0a 10379
4a626d0a 10380
8690e634
JK
10381
10382
c0c3707f
CB
10383 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
10384 #include <sys/stat.h>
10385"
10386if test "x$ac_cv_type_nlink_t" = xyes; then :
8690e634 10387
6ec2e0f5 10388else
8690e634 10389
c0c3707f 10390$as_echo "#define nlink_t int" >>confdefs.h
6ec2e0f5 10391
6ec2e0f5 10392fi
8690e634
JK
10393
10394
10395
10396
10397
10398
10399
698be2d8
CB
10400
10401
6ec2e0f5 10402
9c9d63b1
PM
10403 case "$host_os" in
10404 mingw*)
10405 for ac_header in sdkddkver.h
10406do :
10407 ac_fn_c_check_header_mongrel "$LINENO" "sdkddkver.h" "ac_cv_header_sdkddkver_h" "$ac_includes_default"
10408if test "x$ac_cv_header_sdkddkver_h" = xyes; then :
10409 cat >>confdefs.h <<_ACEOF
10410#define HAVE_SDKDDKVER_H 1
8690e634 10411_ACEOF
6ec2e0f5 10412
8690e634 10413fi
c0c3707f 10414
9c9d63b1 10415done
8690e634 10416
c0c3707f
CB
10417 ;;
10418 esac
8690e634 10419
8690e634 10420
8690e634 10421
8690e634 10422
c0c3707f
CB
10423
10424 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
10425$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
10426if ${gl_cv_func_getcwd_null+:} false; then :
8690e634
JK
10427 $as_echo_n "(cached) " >&6
10428else
c0c3707f
CB
10429 if test "$cross_compiling" = yes; then :
10430 case "$host_os" in
10431 # Guess yes on glibc systems.
10432 *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
10433 # Guess yes on musl systems.
10434 *-musl*) gl_cv_func_getcwd_null="guessing yes";;
10435 # Guess yes on Cygwin.
10436 cygwin*) gl_cv_func_getcwd_null="guessing yes";;
10437 # If we don't know, obey --enable-cross-guesses.
10438 *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
10439 esac
10440
10441else
10442 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
10443/* end confdefs.h. */
10444
c0c3707f
CB
10445# include <stdlib.h>
10446# if HAVE_UNISTD_H
10447# include <unistd.h>
10448# else /* on Windows with MSVC */
10449# include <direct.h>
10450# endif
9c9d63b1
PM
10451
10452
10453$gl_mda_defines
10454
c0c3707f
CB
10455# ifndef getcwd
10456 char *getcwd ();
10457# endif
8690e634
JK
10458
10459int
10460main ()
10461{
10462
c0c3707f 10463#if defined _WIN32 && ! defined __CYGWIN__
9c9d63b1 10464/* mingw cwd does not start with '/', but _getcwd does allocate.
c0c3707f
CB
10465 However, mingw fails to honor non-zero size. */
10466#else
10467 if (chdir ("/") != 0)
10468 return 1;
10469 else
10470 {
10471 char *f = getcwd (NULL, 0);
10472 if (! f)
10473 return 2;
10474 if (f[0] != '/')
10475 { free (f); return 3; }
10476 if (f[1] != '\0')
10477 { free (f); return 4; }
10478 free (f);
10479 return 0;
10480 }
10481#endif
10482
8690e634
JK
10483 ;
10484 return 0;
10485}
10486_ACEOF
c0c3707f
CB
10487if ac_fn_c_try_run "$LINENO"; then :
10488 gl_cv_func_getcwd_null=yes
10489else
10490 gl_cv_func_getcwd_null=no
8690e634 10491fi
c0c3707f
CB
10492rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10493 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 10494fi
8690e634 10495
c0c3707f
CB
10496fi
10497{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
10498$as_echo "$gl_cv_func_getcwd_null" >&6; }
8690e634 10499
6ec2e0f5 10500
c0c3707f
CB
10501 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
10502$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
10503if ${gl_cv_func_getcwd_posix_signature+:} false; then :
8690e634
JK
10504 $as_echo_n "(cached) " >&6
10505else
c0c3707f 10506 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 10507/* end confdefs.h. */
c0c3707f 10508#include <unistd.h>
9c9d63b1
PM
10509
10510
10511$gl_mda_defines
10512
88b48903
WN
10513int
10514main ()
10515{
c0c3707f
CB
10516extern
10517 #ifdef __cplusplus
10518 "C"
10519 #endif
10520 char *getcwd (char *, size_t);
88b48903
WN
10521
10522 ;
10523 return 0;
10524}
c0c3707f 10525
88b48903
WN
10526_ACEOF
10527if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
10528 gl_cv_func_getcwd_posix_signature=yes
10529else
10530 gl_cv_func_getcwd_posix_signature=no
8690e634 10531fi
88b48903 10532rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 10533
c0c3707f
CB
10534fi
10535{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
10536$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
8690e634 10537
c0c3707f
CB
10538ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
10539if test "x$ac_cv_have_decl_getcwd" = xyes; then :
10540 ac_have_decl=1
10541else
10542 ac_have_decl=0
10543fi
8690e634 10544
c0c3707f
CB
10545cat >>confdefs.h <<_ACEOF
10546#define HAVE_DECL_GETCWD $ac_have_decl
10547_ACEOF
8690e634
JK
10548
10549
7a6dbc2f 10550
c0c3707f
CB
10551ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
10552if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
10553 ac_have_decl=1
88b48903 10554else
c0c3707f 10555 ac_have_decl=0
88b48903 10556fi
8690e634 10557
c0c3707f
CB
10558cat >>confdefs.h <<_ACEOF
10559#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
10560_ACEOF
8690e634 10561
c0c3707f
CB
10562ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default"
10563if test "x$ac_cv_have_decl_getlogin_r" = xyes; then :
10564 ac_have_decl=1
10565else
10566 ac_have_decl=0
10567fi
8690e634 10568
c0c3707f
CB
10569cat >>confdefs.h <<_ACEOF
10570#define HAVE_DECL_GETLOGIN_R $ac_have_decl
10571_ACEOF
8690e634
JK
10572
10573
6ec2e0f5 10574
c0c3707f
CB
10575ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default"
10576if test "x$ac_cv_have_decl_getlogin" = xyes; then :
10577 ac_have_decl=1
6ec2e0f5 10578else
c0c3707f 10579 ac_have_decl=0
88b48903 10580fi
8690e634 10581
c0c3707f
CB
10582cat >>confdefs.h <<_ACEOF
10583#define HAVE_DECL_GETLOGIN $ac_have_decl
10584_ACEOF
8690e634
JK
10585
10586
10587
c0c3707f
CB
10588 case $host_os in
10589 mingw*)
10590 LIB_GETLOGIN='-ladvapi32' ;;
10591 *)
10592 LIB_GETLOGIN= ;;
10593 esac
6ec2e0f5 10594
472fa5ee
SM
10595
10596
10597
6ec2e0f5
SDJ
10598
10599
10600
698be2d8
CB
10601 GNULIB_GETRANDOM=0;
10602 HAVE_GETRANDOM=1;
10603 REPLACE_GETRANDOM=0;
10604
10605
10606
10607
c0c3707f
CB
10608 GNULIB_GETTIMEOFDAY=0;
10609 HAVE_GETTIMEOFDAY=1;
10610 HAVE_STRUCT_TIMEVAL=1;
10611 HAVE_SYS_TIME_H=1;
10612 REPLACE_GETTIMEOFDAY=0;
10613 REPLACE_STRUCT_TIMEVAL=0;
472fa5ee 10614
472fa5ee 10615
6ec2e0f5
SDJ
10616
10617
10618
10619
10620
10621
472fa5ee
SM
10622
10623
10624
6ec2e0f5
SDJ
10625
10626
10627
10628
10629
10630 if test $gl_cv_have_include_next = yes; then
c0c3707f 10631 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10632 else
c0c3707f
CB
10633 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
10634$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
10635if ${gl_cv_next_sys_time_h+:} false; then :
6ec2e0f5 10636 $as_echo_n "(cached) " >&6
88b48903 10637else
8690e634 10638
c0c3707f 10639 if test $ac_cv_header_sys_time_h = yes; then
8690e634
JK
10640
10641
8690e634
JK
10642
10643
6ec2e0f5
SDJ
10644 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10645/* end confdefs.h. */
c0c3707f 10646#include <sys/time.h>
88b48903 10647_ACEOF
6ec2e0f5
SDJ
10648 case "$host_os" in
10649 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10650 *) gl_absname_cpp="$ac_cpp" ;;
10651 esac
8690e634 10652
6ec2e0f5
SDJ
10653 case "$host_os" in
10654 mingw*)
10655 gl_dirsep_regex='[/\\]'
10656 ;;
10657 *)
10658 gl_dirsep_regex='\/'
88b48903
WN
10659 ;;
10660 esac
6ec2e0f5 10661 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 10662 gl_header_literal_regex=`echo 'sys/time.h' \
6ec2e0f5
SDJ
10663 | sed -e "$gl_make_literal_regex_sed"`
10664 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10665 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10666 s|^/[^/]|//&|
10667 p
10668 q
10669 }'
8690e634 10670
c0c3707f 10671 gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5 10672 sed -n "$gl_absolute_header_sed"`
8690e634 10673
c0c3707f
CB
10674 gl_header=$gl_cv_absolute_sys_time_h
10675 gl_cv_next_sys_time_h='"'$gl_header'"'
6ec2e0f5 10676 else
c0c3707f 10677 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10678 fi
88b48903 10679
88b48903 10680
88b48903 10681fi
c0c3707f
CB
10682{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
10683$as_echo "$gl_cv_next_sys_time_h" >&6; }
6ec2e0f5 10684 fi
c0c3707f 10685 NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
88b48903 10686
6ec2e0f5
SDJ
10687 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10688 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 10689 gl_next_as_first_directive='<'sys/time.h'>'
6ec2e0f5
SDJ
10690 else
10691 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f
CB
10692 gl_next_as_first_directive=$gl_cv_next_sys_time_h
10693 fi
10694 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
6ec2e0f5 10695
6ec2e0f5
SDJ
10696
10697
10698
6ec2e0f5 10699
c0c3707f
CB
10700 if test $ac_cv_header_sys_time_h != yes; then
10701 HAVE_SYS_TIME_H=0
10702 fi
6ec2e0f5 10703
6ec2e0f5 10704
6ec2e0f5 10705
6ec2e0f5 10706
6ec2e0f5 10707
c0c3707f
CB
10708 if test $ac_cv_header_sys_socket_h != yes; then
10709 for ac_header in winsock2.h
10710do :
10711 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10712if test "x$ac_cv_header_winsock2_h" = xyes; then :
10713 cat >>confdefs.h <<_ACEOF
10714#define HAVE_WINSOCK2_H 1
6ec2e0f5 10715_ACEOF
6ec2e0f5 10716
6ec2e0f5 10717fi
6ec2e0f5 10718
c0c3707f 10719done
6ec2e0f5 10720
c0c3707f
CB
10721 fi
10722 if test "$ac_cv_header_winsock2_h" = yes; then
10723 HAVE_WINSOCK2_H=1
10724 UNISTD_H_HAVE_WINSOCK2_H=1
10725 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
10726 else
10727 HAVE_WINSOCK2_H=0
10728 fi
10729
10730
10731 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
10732$as_echo_n "checking for struct timeval... " >&6; }
10733if ${gl_cv_sys_struct_timeval+:} false; then :
10734 $as_echo_n "(cached) " >&6
10735else
10736 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10737/* end confdefs.h. */
c0c3707f
CB
10738#if HAVE_SYS_TIME_H
10739 #include <sys/time.h>
10740 #endif
10741 #include <time.h>
10742 #if HAVE_WINSOCK2_H
10743 # include <winsock2.h>
10744 #endif
6ec2e0f5
SDJ
10745
10746int
10747main ()
10748{
c0c3707f 10749static struct timeval x; x.tv_sec = x.tv_usec;
6ec2e0f5
SDJ
10750 ;
10751 return 0;
10752}
10753_ACEOF
10754if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10755 gl_cv_sys_struct_timeval=yes
6ec2e0f5 10756else
c0c3707f 10757 gl_cv_sys_struct_timeval=no
6ec2e0f5
SDJ
10758fi
10759rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903 10760
c0c3707f
CB
10761fi
10762{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
10763$as_echo "$gl_cv_sys_struct_timeval" >&6; }
10764 if test $gl_cv_sys_struct_timeval != yes; then
10765 HAVE_STRUCT_TIMEVAL=0
10766 else
10767 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
10768$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
10769if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
10770 $as_echo_n "(cached) " >&6
10771else
10772 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88b48903 10773/* end confdefs.h. */
c0c3707f
CB
10774#if HAVE_SYS_TIME_H
10775 #include <sys/time.h>
10776 #endif
10777 #include <time.h>
10778 #if HAVE_WINSOCK2_H
10779 # include <winsock2.h>
10780 #endif
88b48903
WN
10781
10782int
10783main ()
10784{
c0c3707f
CB
10785static struct timeval x;
10786 typedef int verify_tv_sec_type[
10787 sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
10788 ];
88b48903
WN
10789
10790 ;
10791 return 0;
10792}
10793_ACEOF
10794if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10795 gl_cv_sys_struct_timeval_tv_sec=yes
88b48903 10796else
c0c3707f 10797 gl_cv_sys_struct_timeval_tv_sec=no
88b48903
WN
10798fi
10799rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10800
88b48903 10801fi
c0c3707f
CB
10802{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
10803$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
10804 if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
10805 REPLACE_STRUCT_TIMEVAL=1
88b48903 10806 fi
c0c3707f 10807 fi
88b48903 10808
c0c3707f
CB
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
c0c3707f
CB
10819 GNULIB_GLOB=0;
10820 HAVE_GLOB=1;
10821 HAVE_GLOB_PATTERN_P=1;
10822 REPLACE_GLOB=0;
10823 REPLACE_GLOB_PATTERN_P=0;
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841 if test $gl_cv_have_include_next = yes; then
10842 gl_cv_next_glob_h='<'glob.h'>'
10843 else
10844 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5
10845$as_echo_n "checking absolute name of <glob.h>... " >&6; }
10846if ${gl_cv_next_glob_h+:} false; then :
10847 $as_echo_n "(cached) " >&6
88b48903 10848else
c0c3707f
CB
10849
10850 if test $ac_cv_header_glob_h = yes; then
10851
10852
10853
10854
88b48903
WN
10855 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10856/* end confdefs.h. */
c0c3707f
CB
10857#include <glob.h>
10858_ACEOF
10859 case "$host_os" in
10860 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10861 *) gl_absname_cpp="$ac_cpp" ;;
10862 esac
88b48903 10863
c0c3707f
CB
10864 case "$host_os" in
10865 mingw*)
10866 gl_dirsep_regex='[/\\]'
10867 ;;
10868 *)
10869 gl_dirsep_regex='\/'
10870 ;;
10871 esac
10872 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10873 gl_header_literal_regex=`echo 'glob.h' \
10874 | sed -e "$gl_make_literal_regex_sed"`
10875 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10876 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10877 s|^/[^/]|//&|
10878 p
10879 q
10880 }'
10881
10882 gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10883 sed -n "$gl_absolute_header_sed"`
10884
10885 gl_header=$gl_cv_absolute_glob_h
10886 gl_cv_next_glob_h='"'$gl_header'"'
10887 else
10888 gl_cv_next_glob_h='<'glob.h'>'
10889 fi
88b48903 10890
88b48903 10891
88b48903 10892fi
c0c3707f
CB
10893{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5
10894$as_echo "$gl_cv_next_glob_h" >&6; }
10895 fi
10896 NEXT_GLOB_H=$gl_cv_next_glob_h
88b48903 10897
c0c3707f
CB
10898 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10899 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10900 gl_next_as_first_directive='<'glob.h'>'
10901 else
10902 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10903 gl_next_as_first_directive=$gl_cv_next_glob_h
10904 fi
10905 NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive
88b48903 10906
88b48903
WN
10907
10908
10909
2196f55f 10910
c0c3707f
CB
10911 if test $ac_cv_header_glob_h = yes; then
10912 HAVE_GLOB_H=1
10913 else
10914 HAVE_GLOB_H=0
10915 fi
2196f55f 10916
6ec2e0f5 10917
c0c3707f
CB
10918 GLOB_H=''
10919 if false; then
10920 GLOB_H=glob.h
10921 else
10922 if test $ac_cv_header_glob_h != yes; then
10923 GLOB_H=glob.h
10924 fi
10925 fi
10926
10927
10928 if test -n "$GLOB_H"; then
10929 GL_GENERATE_GLOB_H_TRUE=
10930 GL_GENERATE_GLOB_H_FALSE='#'
88b48903 10931else
c0c3707f
CB
10932 GL_GENERATE_GLOB_H_TRUE='#'
10933 GL_GENERATE_GLOB_H_FALSE=
6ec2e0f5
SDJ
10934fi
10935
88b48903 10936
88b48903 10937
88b48903 10938
88b48903
WN
10939
10940
10941
10942
10943
10944
10945
10946
8690e634 10947
c0c3707f
CB
10948
10949
c0c3707f 10950
5df4cba6
SM
10951 if test -z "$gl_pthreadlib_body_done"; then
10952 gl_pthread_api=no
10953 LIBPTHREAD=
10954 LIBPMULTITHREAD=
10955 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
10956 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
10957 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
10958if test "x$ac_cv_header_pthread_h" = xyes; then :
10959 gl_have_pthread_h=yes
c0c3707f 10960else
5df4cba6
SM
10961 gl_have_pthread_h=no
10962fi
c0c3707f 10963
5df4cba6
SM
10964
10965 if test "$gl_have_pthread_h" = yes; then
10966 # Other possible tests:
10967 # -lpthreads (FSU threads, PCthreads)
10968 # -lgthreads
10969 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
10970 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
10971 # the second one only in libpthread, and lock.c needs it.
10972 #
10973 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
10974 # needs -pthread for some reason. See:
10975 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
10976 save_LIBS=$LIBS
10977 for gl_pthread in '' '-pthread'; do
10978 LIBS="$LIBS $gl_pthread"
10979 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 10980/* end confdefs.h. */
5df4cba6
SM
10981#include <pthread.h>
10982 pthread_mutex_t m;
10983 pthread_mutexattr_t ma;
10984
8690e634
JK
10985int
10986main ()
10987{
5df4cba6
SM
10988pthread_mutex_lock (&m);
10989 pthread_mutexattr_init (&ma);
8690e634
JK
10990 ;
10991 return 0;
10992}
10993_ACEOF
5df4cba6
SM
10994if ac_fn_c_try_link "$LINENO"; then :
10995 gl_pthread_api=yes
10996 LIBPTHREAD=$gl_pthread
10997 LIBPMULTITHREAD=$gl_pthread
c0c3707f 10998fi
5df4cba6
SM
10999rm -f core conftest.err conftest.$ac_objext \
11000 conftest$ac_exeext conftest.$ac_ext
11001 LIBS=$save_LIBS
11002 test $gl_pthread_api = yes && break
11003 done
6ec2e0f5 11004
5df4cba6
SM
11005 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
11006 # since it is defined as a macro on OSF/1.)
11007 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
11008 # The program links fine without libpthread. But it may actually
11009 # need to link with libpthread in order to create multiple threads.
11010 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
11011$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
11012if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
11013 $as_echo_n "(cached) " >&6
11014else
5df4cba6
SM
11015 ac_check_lib_save_LIBS=$LIBS
11016LIBS="-lpthread $LIBS"
11017cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11018/* end confdefs.h. */
5df4cba6
SM
11019
11020/* Override any GCC internal prototype to avoid an error.
11021 Use char because int might match the return type of a GCC
11022 builtin and then its argument prototype would still apply. */
11023#ifdef __cplusplus
11024extern "C"
11025#endif
11026char pthread_kill ();
6ec2e0f5
SDJ
11027int
11028main ()
11029{
5df4cba6 11030return pthread_kill ();
6ec2e0f5
SDJ
11031 ;
11032 return 0;
11033}
11034_ACEOF
5df4cba6
SM
11035if ac_fn_c_try_link "$LINENO"; then :
11036 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 11037else
5df4cba6 11038 ac_cv_lib_pthread_pthread_kill=no
8690e634 11039fi
5df4cba6
SM
11040rm -f core conftest.err conftest.$ac_objext \
11041 conftest$ac_exeext conftest.$ac_ext
11042LIBS=$ac_check_lib_save_LIBS
11043fi
11044{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
11045$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
11046if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
11047 LIBPMULTITHREAD=-lpthread
11048 # On Solaris and HP-UX, most pthread functions exist also in libc.
11049 # Therefore pthread_in_use() needs to actually try to create a
11050 # thread: pthread_create from libc will fail, whereas
11051 # pthread_create will actually create a thread.
11052 # On Solaris 10 or newer, this test is no longer needed, because
11053 # libc contains the fully functional pthread functions.
11054 case "$host_os" in
11055 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
11056
11057$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
11058
11059 esac
c0c3707f 11060
6ec2e0f5 11061fi
8690e634 11062
5df4cba6
SM
11063 elif test $gl_pthread_api != yes; then
11064 # Some library is needed. Try libpthread and libc_r.
11065 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
11066$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
11067if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
11068 $as_echo_n "(cached) " >&6
11069else
11070 ac_check_lib_save_LIBS=$LIBS
11071LIBS="-lpthread $LIBS"
11072cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11073/* end confdefs.h. */
c0c3707f 11074
5df4cba6
SM
11075/* Override any GCC internal prototype to avoid an error.
11076 Use char because int might match the return type of a GCC
11077 builtin and then its argument prototype would still apply. */
11078#ifdef __cplusplus
11079extern "C"
11080#endif
11081char pthread_kill ();
11082int
11083main ()
11084{
11085return pthread_kill ();
11086 ;
11087 return 0;
11088}
11089_ACEOF
11090if ac_fn_c_try_link "$LINENO"; then :
11091 ac_cv_lib_pthread_pthread_kill=yes
11092else
11093 ac_cv_lib_pthread_pthread_kill=no
11094fi
11095rm -f core conftest.err conftest.$ac_objext \
11096 conftest$ac_exeext conftest.$ac_ext
11097LIBS=$ac_check_lib_save_LIBS
11098fi
11099{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
11100$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
11101if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
11102 gl_pthread_api=yes
11103 LIBPTHREAD=-lpthread
11104 LIBPMULTITHREAD=-lpthread
11105fi
c0c3707f 11106
5df4cba6
SM
11107 if test $gl_pthread_api != yes; then
11108 # For FreeBSD 4.
11109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
11110$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
11111if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
11112 $as_echo_n "(cached) " >&6
11113else
11114 ac_check_lib_save_LIBS=$LIBS
11115LIBS="-lc_r $LIBS"
11116cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11117/* end confdefs.h. */
c0c3707f 11118
5df4cba6
SM
11119/* Override any GCC internal prototype to avoid an error.
11120 Use char because int might match the return type of a GCC
11121 builtin and then its argument prototype would still apply. */
11122#ifdef __cplusplus
11123extern "C"
11124#endif
11125char pthread_kill ();
11126int
11127main ()
11128{
11129return pthread_kill ();
11130 ;
11131 return 0;
11132}
11133_ACEOF
11134if ac_fn_c_try_link "$LINENO"; then :
11135 ac_cv_lib_c_r_pthread_kill=yes
11136else
11137 ac_cv_lib_c_r_pthread_kill=no
11138fi
11139rm -f core conftest.err conftest.$ac_objext \
11140 conftest$ac_exeext conftest.$ac_ext
11141LIBS=$ac_check_lib_save_LIBS
11142fi
11143{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
11144$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
11145if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
11146 gl_pthread_api=yes
11147 LIBPTHREAD=-lc_r
11148 LIBPMULTITHREAD=-lc_r
11149fi
c0c3707f 11150
5df4cba6
SM
11151 fi
11152 fi
11153 fi
11154 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
11155$as_echo_n "checking whether POSIX threads API is available... " >&6; }
11156 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
11157$as_echo "$gl_pthread_api" >&6; }
c0c3707f
CB
11158
11159
5df4cba6 11160 if test $gl_pthread_api = yes; then
c0c3707f 11161
5df4cba6 11162$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
c0c3707f 11163
5df4cba6 11164 fi
c0c3707f 11165
5df4cba6
SM
11166 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11167/* end confdefs.h. */
11168#include <sched.h>
11169int
11170main ()
11171{
11172sched_yield ();
11173 ;
11174 return 0;
11175}
11176_ACEOF
11177if ac_fn_c_try_link "$LINENO"; then :
11178 LIB_SCHED_YIELD=
c0c3707f 11179
5df4cba6
SM
11180else
11181 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
11182$as_echo_n "checking for sched_yield in -lrt... " >&6; }
11183if ${ac_cv_lib_rt_sched_yield+:} false; then :
c0c3707f 11184 $as_echo_n "(cached) " >&6
6ec2e0f5 11185else
5df4cba6
SM
11186 ac_check_lib_save_LIBS=$LIBS
11187LIBS="-lrt $LIBS"
11188cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 11189/* end confdefs.h. */
6ec2e0f5 11190
5df4cba6
SM
11191/* Override any GCC internal prototype to avoid an error.
11192 Use char because int might match the return type of a GCC
11193 builtin and then its argument prototype would still apply. */
11194#ifdef __cplusplus
11195extern "C"
11196#endif
11197char sched_yield ();
11198int
11199main ()
11200{
11201return sched_yield ();
11202 ;
11203 return 0;
11204}
11205_ACEOF
11206if ac_fn_c_try_link "$LINENO"; then :
11207 ac_cv_lib_rt_sched_yield=yes
11208else
11209 ac_cv_lib_rt_sched_yield=no
11210fi
11211rm -f core conftest.err conftest.$ac_objext \
11212 conftest$ac_exeext conftest.$ac_ext
11213LIBS=$ac_check_lib_save_LIBS
11214fi
11215{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
11216$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
11217if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
11218 LIB_SCHED_YIELD=-lrt
11219else
11220 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
11221$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
11222if ${ac_cv_lib_posix4_sched_yield+:} false; then :
11223 $as_echo_n "(cached) " >&6
11224else
11225 ac_check_lib_save_LIBS=$LIBS
11226LIBS="-lposix4 $LIBS"
11227cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11228/* end confdefs.h. */
6ec2e0f5 11229
5df4cba6
SM
11230/* Override any GCC internal prototype to avoid an error.
11231 Use char because int might match the return type of a GCC
11232 builtin and then its argument prototype would still apply. */
11233#ifdef __cplusplus
11234extern "C"
11235#endif
11236char sched_yield ();
11237int
11238main ()
11239{
11240return sched_yield ();
11241 ;
11242 return 0;
11243}
11244_ACEOF
11245if ac_fn_c_try_link "$LINENO"; then :
11246 ac_cv_lib_posix4_sched_yield=yes
11247else
11248 ac_cv_lib_posix4_sched_yield=no
11249fi
11250rm -f core conftest.err conftest.$ac_objext \
11251 conftest$ac_exeext conftest.$ac_ext
11252LIBS=$ac_check_lib_save_LIBS
11253fi
11254{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
11255$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
11256if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
11257 LIB_SCHED_YIELD=-lposix4
6ec2e0f5 11258fi
8690e634 11259
5df4cba6 11260fi
8690e634 11261
8690e634 11262
5df4cba6
SM
11263fi
11264rm -f core conftest.err conftest.$ac_objext \
11265 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5
SDJ
11266
11267
5df4cba6 11268 gl_pthreadlib_body_done=done
c0c3707f 11269 fi
6ec2e0f5 11270
6ec2e0f5 11271
8690e634
JK
11272
11273
472fa5ee 11274
c0c3707f 11275
c0c3707f 11276
c0c3707f 11277
c0c3707f 11278
5df4cba6
SM
11279 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
11280$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
11281if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
11282 $as_echo_n "(cached) " >&6
11283else
11284 case "$host_os" in
11285 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
11286 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
11287 gl_cv_func_setlocale_null_all_mtsafe=no ;;
11288 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
11289 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
11290 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
11291 # If we don't know, obey --enable-cross-guesses.
11292 *)
11293 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
11294 esac
c0c3707f 11295
5e8754f9 11296fi
5df4cba6
SM
11297{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
11298$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
11299 case "$host_os" in
11300 mingw*) ;;
11301 *)
11302 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
11303 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
11304 fi
11305 ;;
11306 esac
11307 case "$gl_cv_func_setlocale_null_all_mtsafe" in
11308 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
11309 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
11310 esac
5e8754f9
SDJ
11311
11312cat >>confdefs.h <<_ACEOF
5df4cba6 11313#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
5e8754f9
SDJ
11314_ACEOF
11315
11316
5df4cba6
SM
11317 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
11318$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
11319if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
11320 $as_echo_n "(cached) " >&6
11321else
11322 case "$host_os" in
11323 # Guess no on OpenBSD, AIX.
11324 openbsd* | aix*)
11325 gl_cv_func_setlocale_null_one_mtsafe=no ;;
11326 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
11327 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
11328 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
11329 # If we don't know, obey --enable-cross-guesses.
11330 *)
11331 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
11332 esac
5abebf3c 11333
5df4cba6
SM
11334fi
11335{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
11336$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
11337 case "$host_os" in
11338 mingw*) ;;
11339 *)
11340 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
11341 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
11342 fi
11343 ;;
11344 esac
11345 case "$gl_cv_func_setlocale_null_one_mtsafe" in
11346 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
11347 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
11348 esac
5abebf3c 11349
c0c3707f 11350cat >>confdefs.h <<_ACEOF
5df4cba6 11351#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
5abebf3c 11352_ACEOF
c0c3707f
CB
11353
11354
5df4cba6
SM
11355 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
11356 case "$host_os" in
11357 mingw*) LIB_SETLOCALE_NULL= ;;
11358 *)
11359
11360
11361 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
11362$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
11363if ${gl_cv_have_weak+:} false; then :
11364 $as_echo_n "(cached) " >&6
5abebf3c 11365else
5df4cba6
SM
11366 gl_cv_have_weak=no
11367 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11368/* end confdefs.h. */
11369extern void xyzzy ();
11370#pragma weak xyzzy
11371int
11372main ()
11373{
11374xyzzy();
11375 ;
11376 return 0;
11377}
11378_ACEOF
11379if ac_fn_c_try_link "$LINENO"; then :
11380 gl_cv_have_weak=maybe
5abebf3c 11381fi
5df4cba6
SM
11382rm -f core conftest.err conftest.$ac_objext \
11383 conftest$ac_exeext conftest.$ac_ext
11384 if test $gl_cv_have_weak = maybe; then
11385 if test "$cross_compiling" = yes; then :
11386 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11387/* end confdefs.h. */
11388#ifdef __ELF__
11389 Extensible Linking Format
11390 #endif
c0c3707f 11391
5df4cba6
SM
11392_ACEOF
11393if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11394 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
11395 gl_cv_have_weak="guessing yes"
11396else
11397 gl_cv_have_weak="guessing no"
11398fi
11399rm -f conftest*
5abebf3c
CB
11400
11401
5df4cba6
SM
11402else
11403 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11404/* end confdefs.h. */
5abebf3c 11405
5df4cba6
SM
11406#include <stdio.h>
11407#pragma weak fputs
11408int main ()
11409{
11410 return (fputs == NULL);
11411}
c0c3707f 11412_ACEOF
5df4cba6
SM
11413if ac_fn_c_try_run "$LINENO"; then :
11414 gl_cv_have_weak=yes
11415else
11416 gl_cv_have_weak=no
11417fi
11418rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11419 conftest.$ac_objext conftest.beam conftest.$ac_ext
11420fi
11421
11422 fi
11423 case " $LDFLAGS " in
11424 *" -static "*) gl_cv_have_weak=no ;;
11425 esac
11426 case "$gl_cv_have_weak" in
11427 *yes)
11428 case "$host_os" in
11429 freebsd* | dragonfly*)
11430 : > conftest1.c
11431 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
11432 cat <<EOF > conftest2.c
11433#include <pthread.h>
11434#pragma weak pthread_mutexattr_gettype
11435int main ()
11436{
11437 return (pthread_mutexattr_gettype != NULL);
11438}
11439EOF
11440 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
11441 || gl_cv_have_weak=no
11442 rm -f conftest1.c libempty.so conftest2.c conftest
11443 ;;
11444 esac
11445 ;;
11446 esac
5abebf3c 11447
c0c3707f 11448fi
5df4cba6
SM
11449{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
11450$as_echo "$gl_cv_have_weak" >&6; }
11451 case "$gl_cv_have_weak" in
11452 *yes)
5abebf3c 11453
5df4cba6 11454$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
5abebf3c 11455
5df4cba6
SM
11456 ;;
11457 esac
11458
11459 case "$gl_cv_have_weak" in
11460 *yes) LIB_SETLOCALE_NULL= ;;
11461 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
11462 esac
11463 ;;
11464 esac
5abebf3c 11465 else
5df4cba6 11466 LIB_SETLOCALE_NULL=
5abebf3c 11467 fi
5abebf3c
CB
11468
11469
11470
5abebf3c 11471
5abebf3c 11472
5df4cba6
SM
11473 GNULIB_SOCKET=0;
11474 GNULIB_CONNECT=0;
11475 GNULIB_ACCEPT=0;
11476 GNULIB_BIND=0;
11477 GNULIB_GETPEERNAME=0;
11478 GNULIB_GETSOCKNAME=0;
11479 GNULIB_GETSOCKOPT=0;
11480 GNULIB_LISTEN=0;
11481 GNULIB_RECV=0;
11482 GNULIB_SEND=0;
11483 GNULIB_RECVFROM=0;
11484 GNULIB_SENDTO=0;
11485 GNULIB_SETSOCKOPT=0;
11486 GNULIB_SHUTDOWN=0;
11487 GNULIB_ACCEPT4=0;
11488 HAVE_STRUCT_SOCKADDR_STORAGE=1;
11489 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
11490
11491 HAVE_SA_FAMILY_T=1;
11492 HAVE_ACCEPT4=1;
c0c3707f
CB
11493
11494
11495
11496
11497
5df4cba6
SM
11498 case "$host_os" in
11499 osf*)
c0c3707f 11500
5df4cba6 11501$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
c0c3707f 11502
5df4cba6
SM
11503 ;;
11504 esac
c0c3707f 11505
5df4cba6
SM
11506 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
11507$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
11508if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
5abebf3c
CB
11509 $as_echo_n "(cached) " >&6
11510else
5df4cba6
SM
11511
11512 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11513/* end confdefs.h. */
c0c3707f 11514#include <sys/socket.h>
c0c3707f
CB
11515int
11516main ()
11517{
5df4cba6 11518
c0c3707f
CB
11519 ;
11520 return 0;
11521}
11522_ACEOF
11523if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11524 gl_cv_header_sys_socket_h_selfcontained=yes
5abebf3c 11525else
5df4cba6 11526 gl_cv_header_sys_socket_h_selfcontained=no
5abebf3c 11527fi
c0c3707f 11528rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11529
5df4cba6
SM
11530fi
11531{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
11532$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
11533 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
11534 for ac_func in shutdown
11535do :
11536 ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
11537if test "x$ac_cv_func_shutdown" = xyes; then :
11538 cat >>confdefs.h <<_ACEOF
11539#define HAVE_SHUTDOWN 1
11540_ACEOF
c0c3707f 11541
5df4cba6
SM
11542fi
11543done
c0c3707f 11544
5df4cba6
SM
11545 if test $ac_cv_func_shutdown = yes; then
11546 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
11547$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
11548if ${gl_cv_header_sys_socket_h_shut+:} false; then :
5abebf3c
CB
11549 $as_echo_n "(cached) " >&6
11550else
5df4cba6
SM
11551
11552 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 11553/* end confdefs.h. */
c0c3707f 11554#include <sys/socket.h>
c0c3707f
CB
11555int
11556main ()
11557{
5df4cba6 11558int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
c0c3707f
CB
11559 ;
11560 return 0;
11561}
11562_ACEOF
11563if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11564 gl_cv_header_sys_socket_h_shut=yes
c0c3707f 11565else
5df4cba6 11566 gl_cv_header_sys_socket_h_shut=no
c0c3707f
CB
11567fi
11568rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11569
5df4cba6
SM
11570fi
11571{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
11572$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
11573 if test $gl_cv_header_sys_socket_h_shut = no; then
11574 SYS_SOCKET_H='sys/socket.h'
11575 fi
11576 fi
c0c3707f 11577 fi
5df4cba6 11578 # We need to check for ws2tcpip.h now.
5abebf3c 11579
5abebf3c 11580
5abebf3c 11581
5abebf3c
CB
11582
11583
11584
11585
c0c3707f
CB
11586
11587
11588
11589
11590 if test $gl_cv_have_include_next = yes; then
5df4cba6 11591 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11592 else
5df4cba6
SM
11593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
11594$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
11595if ${gl_cv_next_sys_socket_h+:} false; then :
5abebf3c
CB
11596 $as_echo_n "(cached) " >&6
11597else
5abebf3c 11598
5df4cba6 11599 if test $ac_cv_header_sys_socket_h = yes; then
5abebf3c 11600
5abebf3c
CB
11601
11602
c0c3707f
CB
11603
11604 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11605/* end confdefs.h. */
5df4cba6 11606#include <sys/socket.h>
c0c3707f
CB
11607_ACEOF
11608 case "$host_os" in
11609 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11610 *) gl_absname_cpp="$ac_cpp" ;;
11611 esac
11612
11613 case "$host_os" in
11614 mingw*)
11615 gl_dirsep_regex='[/\\]'
5abebf3c
CB
11616 ;;
11617 *)
c0c3707f 11618 gl_dirsep_regex='\/'
5abebf3c
CB
11619 ;;
11620 esac
c0c3707f 11621 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
5df4cba6 11622 gl_header_literal_regex=`echo 'sys/socket.h' \
c0c3707f
CB
11623 | sed -e "$gl_make_literal_regex_sed"`
11624 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11625 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11626 s|^/[^/]|//&|
11627 p
11628 q
11629 }'
5abebf3c 11630
5df4cba6 11631 gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
c0c3707f 11632 sed -n "$gl_absolute_header_sed"`
5abebf3c 11633
5df4cba6
SM
11634 gl_header=$gl_cv_absolute_sys_socket_h
11635 gl_cv_next_sys_socket_h='"'$gl_header'"'
c0c3707f 11636 else
5df4cba6 11637 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
c0c3707f 11638 fi
5abebf3c 11639
5abebf3c 11640
5abebf3c 11641fi
5df4cba6
SM
11642{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
11643$as_echo "$gl_cv_next_sys_socket_h" >&6; }
c0c3707f 11644 fi
5df4cba6 11645 NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
c0c3707f
CB
11646
11647 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11648 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
5df4cba6 11649 gl_next_as_first_directive='<'sys/socket.h'>'
c0c3707f
CB
11650 else
11651 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
5df4cba6 11652 gl_next_as_first_directive=$gl_cv_next_sys_socket_h
c0c3707f 11653 fi
5df4cba6 11654 NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
5abebf3c
CB
11655
11656
c0c3707f
CB
11657
11658
5df4cba6
SM
11659 if test $ac_cv_header_sys_socket_h = yes; then
11660 HAVE_SYS_SOCKET_H=1
11661 else
11662 HAVE_SYS_SOCKET_H=0
11663 fi
c0c3707f 11664
5abebf3c 11665
c0c3707f 11666
5df4cba6
SM
11667 if test $ac_cv_header_sys_socket_h = yes; then
11668 HAVE_WS2TCPIP_H=0
11669 else
11670 if test $ac_cv_header_ws2tcpip_h = yes; then
11671 HAVE_WS2TCPIP_H=1
11672 else
11673 HAVE_WS2TCPIP_H=0
11674 fi
11675 fi
11676
11677
11678
11679 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
11680 /* sys/types.h is not needed according to POSIX, but the
11681 sys/socket.h in i386-unknown-freebsd4.10 and
11682 powerpc-apple-darwin5.5 required it. */
11683#include <sys/types.h>
11684#ifdef HAVE_SYS_SOCKET_H
11685#include <sys/socket.h>
11686#endif
11687#ifdef HAVE_WS2TCPIP_H
11688#include <ws2tcpip.h>
11689#endif
11690
11691"
11692if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
11693
11694cat >>confdefs.h <<_ACEOF
11695#define HAVE_STRUCT_SOCKADDR_STORAGE 1
5abebf3c 11696_ACEOF
5df4cba6
SM
11697
11698
5abebf3c 11699fi
5df4cba6
SM
11700ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
11701 /* sys/types.h is not needed according to POSIX, but the
11702 sys/socket.h in i386-unknown-freebsd4.10 and
11703 powerpc-apple-darwin5.5 required it. */
11704#include <sys/types.h>
11705#ifdef HAVE_SYS_SOCKET_H
11706#include <sys/socket.h>
11707#endif
11708#ifdef HAVE_WS2TCPIP_H
11709#include <ws2tcpip.h>
11710#endif
11711
11712"
11713if test "x$ac_cv_type_sa_family_t" = xyes; then :
11714
11715cat >>confdefs.h <<_ACEOF
11716#define HAVE_SA_FAMILY_T 1
11717_ACEOF
11718
11719
5abebf3c 11720fi
5df4cba6
SM
11721
11722 if test $ac_cv_type_struct_sockaddr_storage = no; then
11723 HAVE_STRUCT_SOCKADDR_STORAGE=0
11724 fi
11725 if test $ac_cv_type_sa_family_t = no; then
11726 HAVE_SA_FAMILY_T=0
c0c3707f 11727 fi
5df4cba6
SM
11728 if test $ac_cv_type_struct_sockaddr_storage != no; then
11729 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
11730 #ifdef HAVE_SYS_SOCKET_H
11731 #include <sys/socket.h>
11732 #endif
11733 #ifdef HAVE_WS2TCPIP_H
11734 #include <ws2tcpip.h>
11735 #endif
11736
11737"
11738if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
11739
11740cat >>confdefs.h <<_ACEOF
11741#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
11742_ACEOF
11743
5abebf3c 11744
5abebf3c 11745else
5df4cba6 11746 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
5abebf3c
CB
11747fi
11748
5df4cba6
SM
11749 fi
11750 if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
11751 || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
11752 SYS_SOCKET_H='sys/socket.h'
11753 fi
5abebf3c 11754
5abebf3c 11755
5df4cba6
SM
11756
11757
11758 if test $ac_cv_header_sys_socket_h != yes; then
11759 for ac_header in winsock2.h
11760do :
11761 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
11762if test "x$ac_cv_header_winsock2_h" = xyes; then :
11763 cat >>confdefs.h <<_ACEOF
11764#define HAVE_WINSOCK2_H 1
11765_ACEOF
11766
11767fi
11768
11769done
11770
11771 fi
11772 if test "$ac_cv_header_winsock2_h" = yes; then
11773 HAVE_WINSOCK2_H=1
11774 UNISTD_H_HAVE_WINSOCK2_H=1
11775 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
11776 else
11777 HAVE_WINSOCK2_H=0
11778 fi
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
698be2d8
CB
11792
11793
5df4cba6
SM
11794 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
11795$as_echo_n "checking for IPv4 sockets... " >&6; }
11796if ${gl_cv_socket_ipv4+:} false; then :
5abebf3c
CB
11797 $as_echo_n "(cached) " >&6
11798else
c0c3707f 11799 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11800/* end confdefs.h. */
5df4cba6
SM
11801#include <sys/types.h>
11802#ifdef HAVE_SYS_SOCKET_H
11803#include <sys/socket.h>
11804#endif
11805#ifdef HAVE_NETINET_IN_H
11806#include <netinet/in.h>
11807#endif
11808#ifdef HAVE_WINSOCK2_H
11809#include <winsock2.h>
11810#endif
5abebf3c
CB
11811int
11812main ()
11813{
5df4cba6
SM
11814int x = AF_INET; struct in_addr y; struct sockaddr_in z;
11815 if (&x && &y && &z) return 0;
5abebf3c
CB
11816 ;
11817 return 0;
11818}
11819_ACEOF
c0c3707f 11820if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11821 gl_cv_socket_ipv4=yes
5abebf3c 11822else
5df4cba6 11823 gl_cv_socket_ipv4=no
5abebf3c 11824fi
c0c3707f 11825rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11826fi
5df4cba6
SM
11827{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
11828$as_echo "$gl_cv_socket_ipv4" >&6; }
11829 if test $gl_cv_socket_ipv4 = yes; then
5abebf3c 11830
5df4cba6 11831$as_echo "#define HAVE_IPV4 1" >>confdefs.h
5abebf3c 11832
5df4cba6 11833 fi
5abebf3c 11834
5df4cba6
SM
11835 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
11836$as_echo_n "checking for IPv6 sockets... " >&6; }
11837if ${gl_cv_socket_ipv6+:} false; then :
5abebf3c
CB
11838 $as_echo_n "(cached) " >&6
11839else
c0c3707f 11840 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11841/* end confdefs.h. */
5df4cba6
SM
11842#include <sys/types.h>
11843#ifdef HAVE_SYS_SOCKET_H
11844#include <sys/socket.h>
5abebf3c 11845#endif
5df4cba6
SM
11846#ifdef HAVE_NETINET_IN_H
11847#include <netinet/in.h>
11848#endif
11849#ifdef HAVE_WINSOCK2_H
11850#include <winsock2.h>
11851#endif
11852#ifdef HAVE_WS2TCPIP_H
11853#include <ws2tcpip.h>
11854#endif
11855int
11856main ()
11857{
11858int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
11859 if (&x && &y && &z) return 0;
11860 ;
11861 return 0;
11862}
11863_ACEOF
11864if ac_fn_c_try_compile "$LINENO"; then :
11865 gl_cv_socket_ipv6=yes
11866else
11867 gl_cv_socket_ipv6=no
11868fi
11869rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11870fi
11871{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
11872$as_echo "$gl_cv_socket_ipv6" >&6; }
11873 if test $gl_cv_socket_ipv6 = yes; then
11874
11875$as_echo "#define HAVE_IPV6 1" >>confdefs.h
11876
11877 fi
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891 if test $gl_cv_have_include_next = yes; then
11892 gl_cv_next_limits_h='<'limits.h'>'
11893 else
11894 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
11895$as_echo_n "checking absolute name of <limits.h>... " >&6; }
11896if ${gl_cv_next_limits_h+:} false; then :
11897 $as_echo_n "(cached) " >&6
11898else
11899
11900 if test $ac_cv_header_limits_h = yes; then
11901
11902
11903
11904
11905 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11906/* end confdefs.h. */
11907#include <limits.h>
11908_ACEOF
11909 case "$host_os" in
11910 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11911 *) gl_absname_cpp="$ac_cpp" ;;
11912 esac
11913
11914 case "$host_os" in
11915 mingw*)
11916 gl_dirsep_regex='[/\\]'
11917 ;;
11918 *)
11919 gl_dirsep_regex='\/'
11920 ;;
11921 esac
11922 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11923 gl_header_literal_regex=`echo 'limits.h' \
11924 | sed -e "$gl_make_literal_regex_sed"`
11925 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11926 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11927 s|^/[^/]|//&|
11928 p
11929 q
11930 }'
11931
11932 gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11933 sed -n "$gl_absolute_header_sed"`
11934
11935 gl_header=$gl_cv_absolute_limits_h
11936 gl_cv_next_limits_h='"'$gl_header'"'
11937 else
11938 gl_cv_next_limits_h='<'limits.h'>'
11939 fi
11940
11941
11942fi
11943{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
11944$as_echo "$gl_cv_next_limits_h" >&6; }
11945 fi
11946 NEXT_LIMITS_H=$gl_cv_next_limits_h
11947
11948 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11949 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11950 gl_next_as_first_directive='<'limits.h'>'
11951 else
11952 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11953 gl_next_as_first_directive=$gl_cv_next_limits_h
11954 fi
11955 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
11956
11957
11958
11959
11960
11961 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
11962$as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
11963if ${gl_cv_header_limits_width+:} false; then :
11964 $as_echo_n "(cached) " >&6
11965else
11966 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11967/* end confdefs.h. */
11968#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
11969 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
11970 #endif
11971 #include <limits.h>
11972 long long llm = LLONG_MAX;
11973 int wb = WORD_BIT;
11974 int ullw = ULLONG_WIDTH;
c0c3707f 11975
5abebf3c
CB
11976int
11977main ()
11978{
c0c3707f 11979
5abebf3c
CB
11980 ;
11981 return 0;
11982}
11983_ACEOF
c0c3707f 11984if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 11985 gl_cv_header_limits_width=yes
5abebf3c 11986else
5df4cba6 11987 gl_cv_header_limits_width=no
5abebf3c 11988fi
c0c3707f 11989rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11990fi
5df4cba6
SM
11991{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
11992$as_echo "$gl_cv_header_limits_width" >&6; }
11993 if test "$gl_cv_header_limits_width" = yes; then
11994 LIMITS_H=
c0c3707f 11995 else
5df4cba6 11996 LIMITS_H=limits.h
c0c3707f 11997 fi
5abebf3c 11998
5df4cba6
SM
11999 if test -n "$LIMITS_H"; then
12000 GL_GENERATE_LIMITS_H_TRUE=
12001 GL_GENERATE_LIMITS_H_FALSE='#'
12002else
12003 GL_GENERATE_LIMITS_H_TRUE='#'
12004 GL_GENERATE_LIMITS_H_FALSE=
12005fi
c0c3707f
CB
12006
12007
5abebf3c 12008
5df4cba6
SM
12009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
12010$as_echo_n "checking for wint_t... " >&6; }
12011if ${gt_cv_c_wint_t+:} false; then :
c0c3707f 12012 $as_echo_n "(cached) " >&6
c0c3707f
CB
12013else
12014 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 12015/* end confdefs.h. */
5df4cba6
SM
12016#include <wchar.h>
12017 wint_t foo = (wchar_t)'\0';
5abebf3c
CB
12018int
12019main ()
12020{
5df4cba6 12021
5abebf3c
CB
12022 ;
12023 return 0;
12024}
12025_ACEOF
5df4cba6
SM
12026if ac_fn_c_try_compile "$LINENO"; then :
12027 gt_cv_c_wint_t=yes
c0c3707f 12028else
5df4cba6 12029 gt_cv_c_wint_t=no
c0c3707f 12030fi
5df4cba6 12031rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 12032fi
5df4cba6
SM
12033{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
12034$as_echo "$gt_cv_c_wint_t" >&6; }
12035 if test $gt_cv_c_wint_t = yes; then
5abebf3c 12036
5df4cba6 12037$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
5abebf3c
CB
12038
12039
9c9d63b1
PM
12040 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is large enough" >&5
12041$as_echo_n "checking whether wint_t is large enough... " >&6; }
12042if ${gl_cv_type_wint_t_large_enough+:} false; then :
5df4cba6
SM
12043 $as_echo_n "(cached) " >&6
12044else
12045 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12046/* end confdefs.h. */
5df4cba6 12047#include <wchar.h>
9c9d63b1 12048 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
5df4cba6
SM
12049
12050int
12051main ()
12052{
12053
12054 ;
12055 return 0;
12056}
12057_ACEOF
12058if ac_fn_c_try_compile "$LINENO"; then :
9c9d63b1 12059 gl_cv_type_wint_t_large_enough=yes
5df4cba6 12060else
9c9d63b1 12061 gl_cv_type_wint_t_large_enough=no
5df4cba6
SM
12062fi
12063rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12064fi
9c9d63b1
PM
12065{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_large_enough" >&5
12066$as_echo "$gl_cv_type_wint_t_large_enough" >&6; }
12067 if test $gl_cv_type_wint_t_large_enough = no; then
5df4cba6
SM
12068 GNULIB_OVERRIDES_WINT_T=1
12069 else
12070 GNULIB_OVERRIDES_WINT_T=0
12071 fi
12072 else
12073 GNULIB_OVERRIDES_WINT_T=0
c0c3707f 12074 fi
5abebf3c 12075
5abebf3c
CB
12076
12077
12078
12079
12080
5df4cba6 12081
9c9d63b1
PM
12082
12083
12084 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler produces multi-arch binaries" >&5
12085$as_echo_n "checking whether the compiler produces multi-arch binaries... " >&6; }
12086if ${gl_cv_c_multiarch+:} false; then :
12087 $as_echo_n "(cached) " >&6
12088else
12089 gl_cv_c_multiarch=no
12090 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f
CB
12091/* end confdefs.h. */
12092#ifndef __APPLE_CC__
9c9d63b1
PM
12093 not a universal capable compiler
12094 #endif
12095 typedef int dummy;
5abebf3c 12096
c0c3707f
CB
12097_ACEOF
12098if ac_fn_c_try_compile "$LINENO"; then :
5abebf3c 12099
9c9d63b1
PM
12100 arch=
12101 prev=
12102 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
12103 if test -n "$prev"; then
12104 case $word in
12105 i?86 | x86_64 | ppc | ppc64 | arm | arm64)
12106 if test -z "$arch" || test "$arch" = "$word"; then
12107 arch="$word"
12108 else
12109 gl_cv_c_multiarch=yes
12110 fi
12111 ;;
12112 esac
12113 prev=
12114 else
12115 if test "x$word" = "x-arch"; then
12116 prev=arch
12117 fi
12118 fi
12119 done
5abebf3c 12120
c0c3707f
CB
12121fi
12122rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1
PM
12123
12124fi
12125{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_multiarch" >&5
12126$as_echo "$gl_cv_c_multiarch" >&6; }
c0c3707f
CB
12127 if test $gl_cv_c_multiarch = yes; then
12128 APPLE_UNIVERSAL_BUILD=1
12129 else
12130 APPLE_UNIVERSAL_BUILD=0
12131 fi
5abebf3c 12132
5abebf3c 12133
5abebf3c 12134
5abebf3c
CB
12135
12136
5abebf3c 12137
5abebf3c 12138
5abebf3c 12139
5df4cba6 12140$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 12141
5abebf3c 12142
5df4cba6 12143$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 12144
c0c3707f
CB
12145
12146
12147 if test $ac_cv_header_wchar_h = yes; then
12148 HAVE_WCHAR_H=1
12149 else
12150 HAVE_WCHAR_H=0
5abebf3c 12151 fi
c0c3707f
CB
12152
12153
9c9d63b1
PM
12154
12155 if test $ac_cv_header_inttypes_h = yes; then
c0c3707f
CB
12156 HAVE_INTTYPES_H=1
12157 else
12158 HAVE_INTTYPES_H=0
5abebf3c
CB
12159 fi
12160
12161
9c9d63b1
PM
12162
12163 if test $ac_cv_header_sys_types_h = yes; then
c0c3707f
CB
12164 HAVE_SYS_TYPES_H=1
12165 else
12166 HAVE_SYS_TYPES_H=0
12167 fi
12168
5abebf3c
CB
12169
12170
12171
12172
5abebf3c 12173
5abebf3c 12174
5abebf3c 12175
5abebf3c 12176
5abebf3c
CB
12177
12178
c0c3707f
CB
12179 if test $gl_cv_have_include_next = yes; then
12180 gl_cv_next_stdint_h='<'stdint.h'>'
12181 else
12182 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
12183$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
12184if ${gl_cv_next_stdint_h+:} false; then :
12185 $as_echo_n "(cached) " >&6
12186else
5abebf3c 12187
c0c3707f 12188 if test $ac_cv_header_stdint_h = yes; then
5abebf3c 12189
5abebf3c
CB
12190
12191
12192
c0c3707f 12193 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 12194/* end confdefs.h. */
c0c3707f 12195#include <stdint.h>
5abebf3c 12196_ACEOF
c0c3707f
CB
12197 case "$host_os" in
12198 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12199 *) gl_absname_cpp="$ac_cpp" ;;
12200 esac
5abebf3c 12201
c0c3707f
CB
12202 case "$host_os" in
12203 mingw*)
12204 gl_dirsep_regex='[/\\]'
12205 ;;
12206 *)
12207 gl_dirsep_regex='\/'
12208 ;;
12209 esac
12210 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12211 gl_header_literal_regex=`echo 'stdint.h' \
12212 | sed -e "$gl_make_literal_regex_sed"`
12213 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12214 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12215 s|^/[^/]|//&|
12216 p
12217 q
12218 }'
5abebf3c 12219
c0c3707f
CB
12220 gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12221 sed -n "$gl_absolute_header_sed"`
5abebf3c 12222
c0c3707f
CB
12223 gl_header=$gl_cv_absolute_stdint_h
12224 gl_cv_next_stdint_h='"'$gl_header'"'
12225 else
12226 gl_cv_next_stdint_h='<'stdint.h'>'
12227 fi
5abebf3c 12228
5abebf3c 12229
c0c3707f
CB
12230fi
12231{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
12232$as_echo "$gl_cv_next_stdint_h" >&6; }
12233 fi
12234 NEXT_STDINT_H=$gl_cv_next_stdint_h
5abebf3c 12235
c0c3707f
CB
12236 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12237 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12238 gl_next_as_first_directive='<'stdint.h'>'
12239 else
12240 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12241 gl_next_as_first_directive=$gl_cv_next_stdint_h
12242 fi
12243 NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
5abebf3c 12244
5e8754f9 12245
5e8754f9 12246
5e8754f9 12247
c0c3707f
CB
12248 if test $ac_cv_header_stdint_h = yes; then
12249 HAVE_STDINT_H=1
12250 else
12251 HAVE_STDINT_H=0
12252 fi
5e8754f9
SDJ
12253
12254
c0c3707f
CB
12255 if test $ac_cv_header_stdint_h = yes; then
12256 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
12257$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
12258if ${gl_cv_header_working_stdint_h+:} false; then :
12259 $as_echo_n "(cached) " >&6
12260else
12261 gl_cv_header_working_stdint_h=no
12262 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12263/* end confdefs.h. */
5e8754f9 12264
5e8754f9 12265
c0c3707f
CB
12266#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12267#define __STDC_CONSTANT_MACROS 1
12268#define __STDC_LIMIT_MACROS 1
12269#include <stdint.h>
12270/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
12271#if !(defined WCHAR_MIN && defined WCHAR_MAX)
12272#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
12273#endif
5e8754f9
SDJ
12274
12275
c0c3707f
CB
12276 #include <stddef.h>
12277 #include <signal.h>
12278 #if HAVE_WCHAR_H
c0c3707f
CB
12279 # include <wchar.h>
12280 #endif
f45c62c4
YQ
12281
12282
c0c3707f
CB
12283#ifdef INT8_MAX
12284int8_t a1 = INT8_MAX;
12285int8_t a1min = INT8_MIN;
12286#endif
12287#ifdef INT16_MAX
12288int16_t a2 = INT16_MAX;
12289int16_t a2min = INT16_MIN;
12290#endif
12291#ifdef INT32_MAX
12292int32_t a3 = INT32_MAX;
12293int32_t a3min = INT32_MIN;
12294#endif
12295#ifdef INT64_MAX
12296int64_t a4 = INT64_MAX;
12297int64_t a4min = INT64_MIN;
12298#endif
12299#ifdef UINT8_MAX
12300uint8_t b1 = UINT8_MAX;
12301#else
12302typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
12303#endif
12304#ifdef UINT16_MAX
12305uint16_t b2 = UINT16_MAX;
12306#endif
12307#ifdef UINT32_MAX
12308uint32_t b3 = UINT32_MAX;
12309#endif
12310#ifdef UINT64_MAX
12311uint64_t b4 = UINT64_MAX;
12312#endif
12313int_least8_t c1 = INT8_C (0x7f);
12314int_least8_t c1max = INT_LEAST8_MAX;
12315int_least8_t c1min = INT_LEAST8_MIN;
12316int_least16_t c2 = INT16_C (0x7fff);
12317int_least16_t c2max = INT_LEAST16_MAX;
12318int_least16_t c2min = INT_LEAST16_MIN;
12319int_least32_t c3 = INT32_C (0x7fffffff);
12320int_least32_t c3max = INT_LEAST32_MAX;
12321int_least32_t c3min = INT_LEAST32_MIN;
12322int_least64_t c4 = INT64_C (0x7fffffffffffffff);
12323int_least64_t c4max = INT_LEAST64_MAX;
12324int_least64_t c4min = INT_LEAST64_MIN;
12325uint_least8_t d1 = UINT8_C (0xff);
12326uint_least8_t d1max = UINT_LEAST8_MAX;
12327uint_least16_t d2 = UINT16_C (0xffff);
12328uint_least16_t d2max = UINT_LEAST16_MAX;
12329uint_least32_t d3 = UINT32_C (0xffffffff);
12330uint_least32_t d3max = UINT_LEAST32_MAX;
12331uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
12332uint_least64_t d4max = UINT_LEAST64_MAX;
12333int_fast8_t e1 = INT_FAST8_MAX;
12334int_fast8_t e1min = INT_FAST8_MIN;
12335int_fast16_t e2 = INT_FAST16_MAX;
12336int_fast16_t e2min = INT_FAST16_MIN;
12337int_fast32_t e3 = INT_FAST32_MAX;
12338int_fast32_t e3min = INT_FAST32_MIN;
12339int_fast64_t e4 = INT_FAST64_MAX;
12340int_fast64_t e4min = INT_FAST64_MIN;
12341uint_fast8_t f1 = UINT_FAST8_MAX;
12342uint_fast16_t f2 = UINT_FAST16_MAX;
12343uint_fast32_t f3 = UINT_FAST32_MAX;
12344uint_fast64_t f4 = UINT_FAST64_MAX;
12345#ifdef INTPTR_MAX
12346intptr_t g = INTPTR_MAX;
12347intptr_t gmin = INTPTR_MIN;
12348#endif
12349#ifdef UINTPTR_MAX
12350uintptr_t h = UINTPTR_MAX;
12351#endif
12352intmax_t i = INTMAX_MAX;
12353uintmax_t j = UINTMAX_MAX;
472fa5ee 12354
c0c3707f
CB
12355/* Check that SIZE_MAX has the correct type, if possible. */
12356#if 201112 <= __STDC_VERSION__
12357int k = _Generic (SIZE_MAX, size_t: 0);
9c9d63b1 12358#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
c0c3707f
CB
12359 || (0x5110 <= __SUNPRO_C && !__STDC__))
12360extern size_t k;
12361extern __typeof__ (SIZE_MAX) k;
12362#endif
472fa5ee 12363
c0c3707f
CB
12364#include <limits.h> /* for CHAR_BIT */
12365#define TYPE_MINIMUM(t) \
12366 ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
12367#define TYPE_MAXIMUM(t) \
12368 ((t) ((t) 0 < (t) -1 \
12369 ? (t) -1 \
12370 : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
12371struct s {
12372 int check_PTRDIFF:
12373 PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
12374 && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
12375 ? 1 : -1;
12376 /* Detect bug in FreeBSD 6.0 / ia64. */
12377 int check_SIG_ATOMIC:
12378 SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
12379 && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
12380 ? 1 : -1;
12381 int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
12382 int check_WCHAR:
12383 WCHAR_MIN == TYPE_MINIMUM (wchar_t)
12384 && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
12385 ? 1 : -1;
12386 /* Detect bug in mingw. */
12387 int check_WINT:
12388 WINT_MIN == TYPE_MINIMUM (wint_t)
12389 && WINT_MAX == TYPE_MAXIMUM (wint_t)
12390 ? 1 : -1;
472fa5ee 12391
c0c3707f
CB
12392 /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
12393 int check_UINT8_C:
12394 (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
12395 int check_UINT16_C:
12396 (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
f45c62c4 12397
c0c3707f
CB
12398 /* Detect bugs in OpenBSD 3.9 stdint.h. */
12399#ifdef UINT8_MAX
12400 int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
12401#endif
12402#ifdef UINT16_MAX
12403 int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
12404#endif
12405#ifdef UINT32_MAX
12406 int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
12407#endif
12408#ifdef UINT64_MAX
12409 int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
12410#endif
12411 int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
12412 int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
12413 int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
12414 int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
12415 int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
12416 int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
12417 int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
12418 int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
12419 int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
12420 int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
12421 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
12422};
6ec2e0f5 12423
f45c62c4
YQ
12424int
12425main ()
12426{
f45c62c4
YQ
12427
12428 ;
12429 return 0;
12430}
12431_ACEOF
6ec2e0f5 12432if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 12433 if test "$cross_compiling" = yes; then :
6a29c58e 12434 case "$host_os" in
c0c3707f
CB
12435 # Guess yes on native Windows.
12436 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
12437 # In general, assume it works.
12438 *) gl_cv_header_working_stdint_h="guessing yes" ;;
12439 esac
6a29c58e 12440
98399780
YQ
12441else
12442 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12443/* end confdefs.h. */
98399780
YQ
12444
12445
c0c3707f
CB
12446#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12447#define __STDC_CONSTANT_MACROS 1
12448#define __STDC_LIMIT_MACROS 1
12449#include <stdint.h>
98399780 12450
88b48903 12451
c0c3707f
CB
12452 #include <stddef.h>
12453 #include <signal.h>
12454 #if HAVE_WCHAR_H
c0c3707f
CB
12455 # include <wchar.h>
12456 #endif
88b48903 12457
472fa5ee 12458
c0c3707f
CB
12459#include <stdio.h>
12460#include <string.h>
12461#define MVAL(macro) MVAL1(macro)
12462#define MVAL1(expression) #expression
12463static const char *macro_values[] =
12464 {
12465#ifdef INT8_MAX
12466 MVAL (INT8_MAX),
12467#endif
12468#ifdef INT16_MAX
12469 MVAL (INT16_MAX),
12470#endif
12471#ifdef INT32_MAX
12472 MVAL (INT32_MAX),
12473#endif
12474#ifdef INT64_MAX
12475 MVAL (INT64_MAX),
12476#endif
12477#ifdef UINT8_MAX
12478 MVAL (UINT8_MAX),
12479#endif
12480#ifdef UINT16_MAX
12481 MVAL (UINT16_MAX),
12482#endif
12483#ifdef UINT32_MAX
12484 MVAL (UINT32_MAX),
12485#endif
12486#ifdef UINT64_MAX
12487 MVAL (UINT64_MAX),
12488#endif
12489 NULL
12490 };
472fa5ee 12491
c0c3707f
CB
12492int
12493main ()
12494{
472fa5ee 12495
c0c3707f
CB
12496 const char **mv;
12497 for (mv = macro_values; *mv != NULL; mv++)
12498 {
12499 const char *value = *mv;
12500 /* Test whether it looks like a cast expression. */
12501 if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
12502 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
12503 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
12504 || strncmp (value, "((int)"/*)*/, 6) == 0
12505 || strncmp (value, "((signed short)"/*)*/, 15) == 0
12506 || strncmp (value, "((signed char)"/*)*/, 14) == 0)
12507 return mv - macro_values + 1;
12508 }
12509 return 0;
12510
12511 ;
12512 return 0;
12513}
12514_ACEOF
12515if ac_fn_c_try_run "$LINENO"; then :
12516 gl_cv_header_working_stdint_h=yes
12517fi
12518rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12519 conftest.$ac_objext conftest.beam conftest.$ac_ext
12520fi
12521
12522
12523fi
12524rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 12525
c0c3707f
CB
12526fi
12527{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
12528$as_echo "$gl_cv_header_working_stdint_h" >&6; }
12529 fi
8690e634 12530
c0c3707f
CB
12531 HAVE_C99_STDINT_H=0
12532 HAVE_SYS_BITYPES_H=0
12533 HAVE_SYS_INTTYPES_H=0
12534 STDINT_H=stdint.h
12535 case "$gl_cv_header_working_stdint_h" in
12536 *yes)
12537 HAVE_C99_STDINT_H=1
9c9d63b1
PM
12538 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h works without ISO C predefines" >&5
12539$as_echo_n "checking whether stdint.h works without ISO C predefines... " >&6; }
12540if ${gl_cv_header_stdint_without_STDC_macros+:} false; then :
c0c3707f
CB
12541 $as_echo_n "(cached) " >&6
12542else
9c9d63b1 12543 gl_cv_header_stdint_without_STDC_macros=no
c0c3707f
CB
12544 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12545/* end confdefs.h. */
8690e634
JK
12546
12547
c0c3707f
CB
12548#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
12549#include <stdint.h>
8690e634
JK
12550
12551
c0c3707f
CB
12552 #include <stddef.h>
12553 #include <signal.h>
12554 #if HAVE_WCHAR_H
c0c3707f
CB
12555 # include <wchar.h>
12556 #endif
8690e634
JK
12557
12558
c0c3707f
CB
12559intmax_t im = INTMAX_MAX;
12560int32_t i32 = INT32_C (0x7fffffff);
472fa5ee 12561
c0c3707f
CB
12562int
12563main ()
12564{
472fa5ee 12565
c0c3707f
CB
12566 ;
12567 return 0;
12568}
12569_ACEOF
12570if ac_fn_c_try_compile "$LINENO"; then :
9c9d63b1 12571 gl_cv_header_stdint_without_STDC_macros=yes
c0c3707f
CB
12572fi
12573rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1 12574
c0c3707f 12575fi
9c9d63b1
PM
12576{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_without_STDC_macros" >&5
12577$as_echo "$gl_cv_header_stdint_without_STDC_macros" >&6; }
472fa5ee 12578
9c9d63b1 12579 if test $gl_cv_header_stdint_without_STDC_macros = no; then
472fa5ee 12580
c0c3707f 12581$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
472fa5ee
SM
12582
12583
c0c3707f
CB
12584$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
12585
12586 fi
12587 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
12588$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
12589if ${gl_cv_header_stdint_width+:} false; then :
8690e634
JK
12590 $as_echo_n "(cached) " >&6
12591else
c0c3707f
CB
12592 gl_cv_header_stdint_width=no
12593 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12594/* end confdefs.h. */
12595
c0c3707f
CB
12596 /* Work if build is not clean. */
12597 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
12598 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
12599 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
12600 #endif
12601 #include <stdint.h>
12602
c0c3707f
CB
12603 #include <stddef.h>
12604 #include <signal.h>
12605 #if HAVE_WCHAR_H
c0c3707f
CB
12606 # include <wchar.h>
12607 #endif
12608
12609 int iw = UINTMAX_WIDTH;
12610
12611int
12612main ()
8690e634 12613{
c0c3707f
CB
12614
12615 ;
8690e634
JK
12616 return 0;
12617}
8690e634 12618_ACEOF
c0c3707f
CB
12619if ac_fn_c_try_compile "$LINENO"; then :
12620 gl_cv_header_stdint_width=yes
12621fi
12622rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12623fi
12624{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
12625$as_echo "$gl_cv_header_stdint_width" >&6; }
12626 if test "$gl_cv_header_stdint_width" = yes; then
12627 STDINT_H=
12628 fi
12629 ;;
12630 *)
12631 for ac_header in sys/inttypes.h sys/bitypes.h
12632do :
12633 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12634ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
12635if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12636 cat >>confdefs.h <<_ACEOF
12637#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12638_ACEOF
12639
12640fi
12641
12642done
12643
12644 if test $ac_cv_header_sys_inttypes_h = yes; then
12645 HAVE_SYS_INTTYPES_H=1
12646 fi
12647 if test $ac_cv_header_sys_bitypes_h = yes; then
12648 HAVE_SYS_BITYPES_H=1
12649 fi
12650
12651
12652 if test $APPLE_UNIVERSAL_BUILD = 0; then
12653
12654
12655 for gltype in ptrdiff_t size_t ; do
12656 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12657$as_echo_n "checking for bit size of $gltype... " >&6; }
12658if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
12659 $as_echo_n "(cached) " >&6
12660else
12661 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
c0c3707f
CB
12662 #include <stddef.h>
12663 #include <signal.h>
12664 #if HAVE_WCHAR_H
c0c3707f
CB
12665 # include <wchar.h>
12666 #endif
12667
12668#include <limits.h>"; then :
12669
12670else
12671 result=unknown
12672fi
12673
12674 eval gl_cv_bitsizeof_${gltype}=\$result
12675
12676fi
12677eval ac_res=\$gl_cv_bitsizeof_${gltype}
12678 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12679$as_echo "$ac_res" >&6; }
12680 eval result=\$gl_cv_bitsizeof_${gltype}
12681 if test $result = unknown; then
12682 result=0
8690e634 12683 fi
c0c3707f
CB
12684 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12685 cat >>confdefs.h <<_ACEOF
12686#define BITSIZEOF_${GLTYPE} $result
12687_ACEOF
8690e634 12688
c0c3707f
CB
12689 eval BITSIZEOF_${GLTYPE}=\$result
12690 done
8690e634
JK
12691
12692
c0c3707f 12693 fi
8690e634
JK
12694
12695
c0c3707f
CB
12696 for gltype in sig_atomic_t wchar_t wint_t ; do
12697 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
12698$as_echo_n "checking for bit size of $gltype... " >&6; }
12699if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
8690e634
JK
12700 $as_echo_n "(cached) " >&6
12701else
c0c3707f 12702 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
c0c3707f
CB
12703 #include <stddef.h>
12704 #include <signal.h>
12705 #if HAVE_WCHAR_H
c0c3707f
CB
12706 # include <wchar.h>
12707 #endif
8690e634 12708
c0c3707f 12709#include <limits.h>"; then :
8690e634 12710
c0c3707f
CB
12711else
12712 result=unknown
12713fi
8690e634 12714
c0c3707f 12715 eval gl_cv_bitsizeof_${gltype}=\$result
8690e634
JK
12716
12717fi
c0c3707f
CB
12718eval ac_res=\$gl_cv_bitsizeof_${gltype}
12719 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12720$as_echo "$ac_res" >&6; }
12721 eval result=\$gl_cv_bitsizeof_${gltype}
12722 if test $result = unknown; then
12723 result=0
12724 fi
12725 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12726 cat >>confdefs.h <<_ACEOF
12727#define BITSIZEOF_${GLTYPE} $result
12728_ACEOF
12729
12730 eval BITSIZEOF_${GLTYPE}=\$result
12731 done
8690e634
JK
12732
12733
12734
12735
c0c3707f
CB
12736 for gltype in sig_atomic_t wchar_t wint_t ; do
12737 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
12738$as_echo_n "checking whether $gltype is signed... " >&6; }
12739if eval \${gl_cv_type_${gltype}_signed+:} false; then :
8690e634
JK
12740 $as_echo_n "(cached) " >&6
12741else
c0c3707f 12742 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12743/* end confdefs.h. */
12744
c0c3707f
CB
12745 #include <stddef.h>
12746 #include <signal.h>
12747 #if HAVE_WCHAR_H
c0c3707f
CB
12748 # include <wchar.h>
12749 #endif
12750
12751 int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
12752int
12753main ()
12754{
12755
12756 ;
8690e634
JK
12757 return 0;
12758}
c0c3707f
CB
12759_ACEOF
12760if ac_fn_c_try_compile "$LINENO"; then :
12761 result=yes
12762else
12763 result=no
12764fi
12765rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12766 eval gl_cv_type_${gltype}_signed=\$result
8690e634 12767
c0c3707f
CB
12768fi
12769eval ac_res=\$gl_cv_type_${gltype}_signed
12770 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12771$as_echo "$ac_res" >&6; }
12772 eval result=\$gl_cv_type_${gltype}_signed
12773 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12774 if test "$result" = yes; then
12775 cat >>confdefs.h <<_ACEOF
12776#define HAVE_SIGNED_${GLTYPE} 1
8690e634 12777_ACEOF
c0c3707f
CB
12778
12779 eval HAVE_SIGNED_${GLTYPE}=1
12780 else
12781 eval HAVE_SIGNED_${GLTYPE}=0
8690e634 12782 fi
c0c3707f
CB
12783 done
12784
12785
12786 gl_cv_type_ptrdiff_t_signed=yes
12787 gl_cv_type_size_t_signed=no
12788 if test $APPLE_UNIVERSAL_BUILD = 0; then
12789
12790
12791 for gltype in ptrdiff_t size_t ; do
12792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12793$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
12794if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
12795 $as_echo_n "(cached) " >&6
12796else
12797 eval gl_cv_type_${gltype}_suffix=no
12798 eval result=\$gl_cv_type_${gltype}_signed
12799 if test "$result" = yes; then
12800 glsufu=
12801 else
12802 glsufu=u
12803 fi
12804 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
12805 case $glsuf in
12806 '') gltype1='int';;
12807 l) gltype1='long int';;
12808 ll) gltype1='long long int';;
12809 i64) gltype1='__int64';;
12810 u) gltype1='unsigned int';;
12811 ul) gltype1='unsigned long int';;
12812 ull) gltype1='unsigned long long int';;
12813 ui64)gltype1='unsigned __int64';;
12814 esac
12815 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12816/* end confdefs.h. */
12817
c0c3707f
CB
12818 #include <stddef.h>
12819 #include <signal.h>
12820 #if HAVE_WCHAR_H
c0c3707f
CB
12821 # include <wchar.h>
12822 #endif
8690e634 12823
c0c3707f
CB
12824 extern $gltype foo;
12825 extern $gltype1 foo;
12826int
12827main ()
12828{
12829
12830 ;
12831 return 0;
12832}
12833_ACEOF
12834if ac_fn_c_try_compile "$LINENO"; then :
12835 eval gl_cv_type_${gltype}_suffix=\$glsuf
8690e634 12836fi
c0c3707f
CB
12837rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12838 eval result=\$gl_cv_type_${gltype}_suffix
12839 test "$result" != no && break
12840 done
12841fi
12842eval ac_res=\$gl_cv_type_${gltype}_suffix
12843 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12844$as_echo "$ac_res" >&6; }
12845 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12846 eval result=\$gl_cv_type_${gltype}_suffix
12847 test "$result" = no && result=
12848 eval ${GLTYPE}_SUFFIX=\$result
12849 cat >>confdefs.h <<_ACEOF
12850#define ${GLTYPE}_SUFFIX $result
12851_ACEOF
8690e634 12852
c0c3707f 12853 done
8690e634
JK
12854
12855
c0c3707f 12856 fi
8690e634
JK
12857
12858
c0c3707f
CB
12859 for gltype in sig_atomic_t wchar_t wint_t ; do
12860 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
12861$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
12862if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
8690e634
JK
12863 $as_echo_n "(cached) " >&6
12864else
c0c3707f
CB
12865 eval gl_cv_type_${gltype}_suffix=no
12866 eval result=\$gl_cv_type_${gltype}_signed
12867 if test "$result" = yes; then
12868 glsufu=
12869 else
12870 glsufu=u
12871 fi
12872 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
12873 case $glsuf in
12874 '') gltype1='int';;
12875 l) gltype1='long int';;
12876 ll) gltype1='long long int';;
12877 i64) gltype1='__int64';;
12878 u) gltype1='unsigned int';;
12879 ul) gltype1='unsigned long int';;
12880 ull) gltype1='unsigned long long int';;
12881 ui64)gltype1='unsigned __int64';;
12882 esac
12883 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
12884/* end confdefs.h. */
12885
c0c3707f
CB
12886 #include <stddef.h>
12887 #include <signal.h>
12888 #if HAVE_WCHAR_H
c0c3707f
CB
12889 # include <wchar.h>
12890 #endif
12891
12892 extern $gltype foo;
12893 extern $gltype1 foo;
12894int
12895main ()
12896{
12897
12898 ;
5e8754f9 12899 return 0;
8690e634 12900}
c0c3707f
CB
12901_ACEOF
12902if ac_fn_c_try_compile "$LINENO"; then :
12903 eval gl_cv_type_${gltype}_suffix=\$glsuf
12904fi
12905rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12906 eval result=\$gl_cv_type_${gltype}_suffix
12907 test "$result" != no && break
12908 done
12909fi
12910eval ac_res=\$gl_cv_type_${gltype}_suffix
12911 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12912$as_echo "$ac_res" >&6; }
12913 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12914 eval result=\$gl_cv_type_${gltype}_suffix
12915 test "$result" = no && result=
12916 eval ${GLTYPE}_SUFFIX=\$result
12917 cat >>confdefs.h <<_ACEOF
12918#define ${GLTYPE}_SUFFIX $result
12919_ACEOF
12920
12921 done
12922
12923
12924
12925 if test $GNULIB_OVERRIDES_WINT_T = 1; then
12926 BITSIZEOF_WINT_T=32
12927 fi
12928
12929 ;;
12930 esac
8690e634 12931
8690e634 12932
c0c3707f
CB
12933
12934 LIMITS_H='limits.h'
12935 if test -n "$LIMITS_H"; then
12936 GL_GENERATE_LIMITS_H_TRUE=
12937 GL_GENERATE_LIMITS_H_FALSE='#'
12938else
12939 GL_GENERATE_LIMITS_H_TRUE='#'
12940 GL_GENERATE_LIMITS_H_FALSE=
8690e634 12941fi
6ec2e0f5
SDJ
12942
12943
12944
12945
12946
12947
12948
c0c3707f
CB
12949 if test -n "$STDINT_H"; then
12950 GL_GENERATE_STDINT_H_TRUE=
12951 GL_GENERATE_STDINT_H_FALSE='#'
12952else
12953 GL_GENERATE_STDINT_H_TRUE='#'
12954 GL_GENERATE_STDINT_H_FALSE=
12955fi
472fa5ee
SM
12956
12957
12958
c0c3707f
CB
12959 GNULIB_IMAXABS=0;
12960 GNULIB_IMAXDIV=0;
12961 GNULIB_STRTOIMAX=0;
12962 GNULIB_STRTOUMAX=0;
12963 HAVE_DECL_IMAXABS=1;
12964 HAVE_DECL_IMAXDIV=1;
12965 HAVE_DECL_STRTOIMAX=1;
12966 HAVE_DECL_STRTOUMAX=1;
12967 HAVE_IMAXDIV_T=1;
12968 REPLACE_STRTOIMAX=0;
12969 REPLACE_STRTOUMAX=0;
12970 INT32_MAX_LT_INTMAX_MAX=1;
12971 INT64_MAX_EQ_LONG_MAX='defined _LP64';
c0c3707f
CB
12972 PRIPTR_PREFIX=__PRIPTR_PREFIX;
12973 UINT32_MAX_LT_UINTMAX_MAX=1;
12974 UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
472fa5ee 12975
6ec2e0f5
SDJ
12976
12977
12978
12979
12980
6ec2e0f5
SDJ
12981
12982
6ec2e0f5 12983
6ec2e0f5 12984
6ec2e0f5 12985
6ec2e0f5 12986
6ec2e0f5 12987
c0c3707f
CB
12988
12989
12990 if test $gl_cv_have_include_next = yes; then
12991 gl_cv_next_inttypes_h='<'inttypes.h'>'
12992 else
12993 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
12994$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
12995if ${gl_cv_next_inttypes_h+:} false; then :
12996 $as_echo_n "(cached) " >&6
12997else
12998
12999 if test $ac_cv_header_inttypes_h = yes; then
13000
13001
13002
13003
13004 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13005/* end confdefs.h. */
13006#include <inttypes.h>
6ec2e0f5 13007_ACEOF
c0c3707f
CB
13008 case "$host_os" in
13009 aix*) gl_absname_cpp="$ac_cpp -C" ;;
13010 *) gl_absname_cpp="$ac_cpp" ;;
13011 esac
6ec2e0f5 13012
c0c3707f
CB
13013 case "$host_os" in
13014 mingw*)
13015 gl_dirsep_regex='[/\\]'
13016 ;;
13017 *)
13018 gl_dirsep_regex='\/'
13019 ;;
13020 esac
13021 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13022 gl_header_literal_regex=`echo 'inttypes.h' \
13023 | sed -e "$gl_make_literal_regex_sed"`
13024 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13025 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13026 s|^/[^/]|//&|
13027 p
13028 q
13029 }'
6ec2e0f5 13030
c0c3707f
CB
13031 gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13032 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 13033
c0c3707f
CB
13034 gl_header=$gl_cv_absolute_inttypes_h
13035 gl_cv_next_inttypes_h='"'$gl_header'"'
13036 else
13037 gl_cv_next_inttypes_h='<'inttypes.h'>'
13038 fi
6ec2e0f5 13039
6ec2e0f5 13040
c0c3707f
CB
13041fi
13042{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
13043$as_echo "$gl_cv_next_inttypes_h" >&6; }
13044 fi
13045 NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
6ec2e0f5 13046
c0c3707f
CB
13047 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13048 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13049 gl_next_as_first_directive='<'inttypes.h'>'
13050 else
13051 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13052 gl_next_as_first_directive=$gl_cv_next_inttypes_h
13053 fi
13054 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
6ec2e0f5 13055
472fa5ee
SM
13056
13057
13058
13059
13060
13061
472fa5ee
SM
13062
13063
13064
13065
6ec2e0f5 13066
698be2d8
CB
13067
13068
698be2d8
CB
13069
13070
5df4cba6
SM
13071 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
13072$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
13073if ${gl_cv_cc_double_expbit0+:} false; then :
13074 $as_echo_n "(cached) " >&6
13075else
13076
13077 if test "$cross_compiling" = yes; then :
13078
13079 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13080/* end confdefs.h. */
13081
13082#if defined arm || defined __arm || defined __arm__
13083 mixed_endianness
13084#endif
13085
13086_ACEOF
13087if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13088 $EGREP "mixed_endianness" >/dev/null 2>&1; then :
13089 gl_cv_cc_double_expbit0="unknown"
13090else
13091
13092 :
13093if ${ac_cv_c_bigendian+:} false; then :
13094 $as_echo_n "(cached) " >&6
13095else
13096 ac_cv_c_bigendian=unknown
13097 # See if we're dealing with a universal compiler.
13098 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13099/* end confdefs.h. */
13100#ifndef __APPLE_CC__
13101 not a universal capable compiler
13102 #endif
13103 typedef int dummy;
13104
13105_ACEOF
13106if ac_fn_c_try_compile "$LINENO"; then :
13107
13108 # Check for potential -arch flags. It is not universal unless
13109 # there are at least two -arch flags with different values.
13110 ac_arch=
13111 ac_prev=
13112 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13113 if test -n "$ac_prev"; then
13114 case $ac_word in
13115 i?86 | x86_64 | ppc | ppc64)
13116 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13117 ac_arch=$ac_word
13118 else
13119 ac_cv_c_bigendian=universal
13120 break
13121 fi
13122 ;;
13123 esac
13124 ac_prev=
13125 elif test "x$ac_word" = "x-arch"; then
13126 ac_prev=arch
13127 fi
13128 done
13129fi
13130rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13131 if test $ac_cv_c_bigendian = unknown; then
13132 # See if sys/param.h defines the BYTE_ORDER macro.
13133 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13134/* end confdefs.h. */
13135#include <sys/types.h>
13136 #include <sys/param.h>
13137
13138int
13139main ()
13140{
13141#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13142 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13143 && LITTLE_ENDIAN)
13144 bogus endian macros
13145 #endif
13146
13147 ;
13148 return 0;
13149}
13150_ACEOF
13151if ac_fn_c_try_compile "$LINENO"; then :
13152 # It does; now see whether it defined to BIG_ENDIAN or not.
13153 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13154/* end confdefs.h. */
13155#include <sys/types.h>
13156 #include <sys/param.h>
13157
13158int
13159main ()
13160{
13161#if BYTE_ORDER != BIG_ENDIAN
13162 not big endian
13163 #endif
13164
13165 ;
13166 return 0;
13167}
13168_ACEOF
13169if ac_fn_c_try_compile "$LINENO"; then :
13170 ac_cv_c_bigendian=yes
13171else
13172 ac_cv_c_bigendian=no
13173fi
13174rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13175fi
13176rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13177 fi
13178 if test $ac_cv_c_bigendian = unknown; then
13179 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13181/* end confdefs.h. */
13182#include <limits.h>
13183
13184int
13185main ()
13186{
13187#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13188 bogus endian macros
13189 #endif
13190
13191 ;
13192 return 0;
13193}
13194_ACEOF
13195if ac_fn_c_try_compile "$LINENO"; then :
13196 # It does; now see whether it defined to _BIG_ENDIAN or not.
13197 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13198/* end confdefs.h. */
13199#include <limits.h>
13200
13201int
13202main ()
13203{
13204#ifndef _BIG_ENDIAN
13205 not big endian
13206 #endif
13207
13208 ;
13209 return 0;
13210}
13211_ACEOF
13212if ac_fn_c_try_compile "$LINENO"; then :
13213 ac_cv_c_bigendian=yes
13214else
13215 ac_cv_c_bigendian=no
13216fi
13217rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13218fi
13219rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13220 fi
13221 if test $ac_cv_c_bigendian = unknown; then
13222 # Compile a test program.
13223 if test "$cross_compiling" = yes; then :
13224 # Try to guess by grepping values from an object file.
13225 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13226/* end confdefs.h. */
13227short int ascii_mm[] =
13228 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13229 short int ascii_ii[] =
13230 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13231 int use_ascii (int i) {
13232 return ascii_mm[i] + ascii_ii[i];
13233 }
13234 short int ebcdic_ii[] =
13235 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13236 short int ebcdic_mm[] =
13237 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13238 int use_ebcdic (int i) {
13239 return ebcdic_mm[i] + ebcdic_ii[i];
13240 }
13241 extern int foo;
13242
13243int
13244main ()
13245{
13246return use_ascii (foo) == use_ebcdic (foo);
13247 ;
13248 return 0;
13249}
13250_ACEOF
13251if ac_fn_c_try_compile "$LINENO"; then :
13252 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13253 ac_cv_c_bigendian=yes
13254 fi
13255 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13256 if test "$ac_cv_c_bigendian" = unknown; then
13257 ac_cv_c_bigendian=no
13258 else
13259 # finding both strings is unlikely to happen, but who knows?
13260 ac_cv_c_bigendian=unknown
13261 fi
13262 fi
13263fi
13264rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13265else
13266 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13267/* end confdefs.h. */
13268$ac_includes_default
13269int
13270main ()
13271{
13272
13273 /* Are we little or big endian? From Harbison&Steele. */
13274 union
13275 {
13276 long int l;
13277 char c[sizeof (long int)];
13278 } u;
13279 u.l = 1;
13280 return u.c[sizeof (long int) - 1] == 1;
13281
13282 ;
13283 return 0;
13284}
13285_ACEOF
13286if ac_fn_c_try_run "$LINENO"; then :
13287 ac_cv_c_bigendian=no
13288else
13289 ac_cv_c_bigendian=yes
13290fi
13291rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13292 conftest.$ac_objext conftest.beam conftest.$ac_ext
13293fi
13294
13295 fi
13296fi
13297:
13298 case $ac_cv_c_bigendian in #(
13299 yes)
13300 gl_cv_cc_double_expbit0="word 0 bit 20";; #(
13301 no)
13302 gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
13303 universal)
13304
13305$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13306
13307 ;; #(
13308 *)
13309 gl_cv_cc_double_expbit0="unknown" ;;
13310 esac
13311
13312
13313fi
13314rm -f conftest*
13315
13316
13317else
13318 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13319/* end confdefs.h. */
13320
13321#include <float.h>
13322#include <stddef.h>
13323#include <stdio.h>
13324#include <string.h>
13325#define NWORDS \
13326 ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
13327typedef union { double value; unsigned int word[NWORDS]; } memory_double;
13328static unsigned int ored_words[NWORDS];
13329static unsigned int anded_words[NWORDS];
13330static void add_to_ored_words (double x)
13331{
13332 memory_double m;
13333 size_t i;
13334 /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
13335 memset (&m, 0, sizeof (memory_double));
13336 m.value = x;
13337 for (i = 0; i < NWORDS; i++)
13338 {
13339 ored_words[i] |= m.word[i];
13340 anded_words[i] &= m.word[i];
13341 }
13342}
13343int main ()
13344{
13345 size_t j;
13346 FILE *fp = fopen ("conftest.out", "w");
13347 if (fp == NULL)
13348 return 1;
13349 for (j = 0; j < NWORDS; j++)
13350 anded_words[j] = ~ (unsigned int) 0;
13351 add_to_ored_words (0.25);
13352 add_to_ored_words (0.5);
13353 add_to_ored_words (1.0);
13354 add_to_ored_words (2.0);
13355 add_to_ored_words (4.0);
13356 /* Remove bits that are common (e.g. if representation of the first mantissa
13357 bit is explicit). */
13358 for (j = 0; j < NWORDS; j++)
13359 ored_words[j] &= ~anded_words[j];
13360 /* Now find the nonzero word. */
13361 for (j = 0; j < NWORDS; j++)
13362 if (ored_words[j] != 0)
13363 break;
13364 if (j < NWORDS)
13365 {
13366 size_t i;
13367 for (i = j + 1; i < NWORDS; i++)
13368 if (ored_words[i] != 0)
13369 {
13370 fprintf (fp, "unknown");
13371 return (fclose (fp) != 0);
13372 }
13373 for (i = 0; ; i++)
13374 if ((ored_words[j] >> i) & 1)
13375 {
13376 fprintf (fp, "word %d bit %d", (int) j, (int) i);
13377 return (fclose (fp) != 0);
13378 }
13379 }
13380 fprintf (fp, "unknown");
13381 return (fclose (fp) != 0);
13382}
13383
13384_ACEOF
13385if ac_fn_c_try_run "$LINENO"; then :
13386 gl_cv_cc_double_expbit0=`cat conftest.out`
13387else
13388 gl_cv_cc_double_expbit0="unknown"
6ec2e0f5 13389fi
5df4cba6
SM
13390rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13391 conftest.$ac_objext conftest.beam conftest.$ac_ext
13392fi
13393
13394 rm -f conftest.out
6ec2e0f5
SDJ
13395
13396fi
5df4cba6
SM
13397{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
13398$as_echo "$gl_cv_cc_double_expbit0" >&6; }
13399 case "$gl_cv_cc_double_expbit0" in
13400 word*bit*)
13401 word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
13402 bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
6ec2e0f5
SDJ
13403
13404cat >>confdefs.h <<_ACEOF
5df4cba6 13405#define DBL_EXPBIT0_WORD $word
6ec2e0f5
SDJ
13406_ACEOF
13407
c0c3707f 13408
5df4cba6
SM
13409cat >>confdefs.h <<_ACEOF
13410#define DBL_EXPBIT0_BIT $bit
13411_ACEOF
6ec2e0f5 13412
5df4cba6
SM
13413 ;;
13414 esac
6ec2e0f5 13415
6ec2e0f5 13416
5df4cba6
SM
13417 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
13418$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
c0c3707f
CB
13419if ${ac_cv_c_bigendian+:} false; then :
13420 $as_echo_n "(cached) " >&6
6ec2e0f5 13421else
c0c3707f
CB
13422 ac_cv_c_bigendian=unknown
13423 # See if we're dealing with a universal compiler.
13424 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13425/* end confdefs.h. */
c0c3707f
CB
13426#ifndef __APPLE_CC__
13427 not a universal capable compiler
13428 #endif
13429 typedef int dummy;
6ec2e0f5 13430
c0c3707f
CB
13431_ACEOF
13432if ac_fn_c_try_compile "$LINENO"; then :
13433
13434 # Check for potential -arch flags. It is not universal unless
13435 # there are at least two -arch flags with different values.
13436 ac_arch=
13437 ac_prev=
13438 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13439 if test -n "$ac_prev"; then
13440 case $ac_word in
13441 i?86 | x86_64 | ppc | ppc64)
13442 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13443 ac_arch=$ac_word
13444 else
13445 ac_cv_c_bigendian=universal
13446 break
13447 fi
13448 ;;
13449 esac
13450 ac_prev=
13451 elif test "x$ac_word" = "x-arch"; then
13452 ac_prev=arch
13453 fi
13454 done
13455fi
13456rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13457 if test $ac_cv_c_bigendian = unknown; then
13458 # See if sys/param.h defines the BYTE_ORDER macro.
13459 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13460/* end confdefs.h. */
13461#include <sys/types.h>
13462 #include <sys/param.h>
6ec2e0f5
SDJ
13463
13464int
13465main ()
13466{
c0c3707f
CB
13467#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13468 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13469 && LITTLE_ENDIAN)
13470 bogus endian macros
13471 #endif
6ec2e0f5 13472
c0c3707f
CB
13473 ;
13474 return 0;
13475}
13476_ACEOF
13477if ac_fn_c_try_compile "$LINENO"; then :
13478 # It does; now see whether it defined to BIG_ENDIAN or not.
13479 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13480/* end confdefs.h. */
13481#include <sys/types.h>
13482 #include <sys/param.h>
13483
13484int
13485main ()
13486{
13487#if BYTE_ORDER != BIG_ENDIAN
13488 not big endian
13489 #endif
6ec2e0f5
SDJ
13490
13491 ;
13492 return 0;
13493}
13494_ACEOF
c0c3707f
CB
13495if ac_fn_c_try_compile "$LINENO"; then :
13496 ac_cv_c_bigendian=yes
6ec2e0f5 13497else
c0c3707f 13498 ac_cv_c_bigendian=no
6ec2e0f5 13499fi
c0c3707f 13500rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13501fi
c0c3707f
CB
13502rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13503 fi
13504 if test $ac_cv_c_bigendian = unknown; then
13505 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13506 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13507/* end confdefs.h. */
13508#include <limits.h>
472fa5ee 13509
c0c3707f
CB
13510int
13511main ()
13512{
13513#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13514 bogus endian macros
13515 #endif
6ec2e0f5 13516
c0c3707f
CB
13517 ;
13518 return 0;
13519}
6ec2e0f5 13520_ACEOF
c0c3707f
CB
13521if ac_fn_c_try_compile "$LINENO"; then :
13522 # It does; now see whether it defined to _BIG_ENDIAN or not.
13523 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13524/* end confdefs.h. */
c0c3707f
CB
13525#include <limits.h>
13526
6ec2e0f5
SDJ
13527int
13528main ()
13529{
5df4cba6
SM
13530#ifndef _BIG_ENDIAN
13531 not big endian
13532 #endif
13533
13534 ;
13535 return 0;
13536}
13537_ACEOF
13538if ac_fn_c_try_compile "$LINENO"; then :
13539 ac_cv_c_bigendian=yes
13540else
13541 ac_cv_c_bigendian=no
13542fi
13543rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13544fi
13545rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13546 fi
13547 if test $ac_cv_c_bigendian = unknown; then
13548 # Compile a test program.
13549 if test "$cross_compiling" = yes; then :
13550 # Try to guess by grepping values from an object file.
13551 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13552/* end confdefs.h. */
13553short int ascii_mm[] =
13554 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13555 short int ascii_ii[] =
13556 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13557 int use_ascii (int i) {
13558 return ascii_mm[i] + ascii_ii[i];
13559 }
13560 short int ebcdic_ii[] =
13561 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13562 short int ebcdic_mm[] =
13563 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13564 int use_ebcdic (int i) {
13565 return ebcdic_mm[i] + ebcdic_ii[i];
13566 }
13567 extern int foo;
13568
13569int
13570main ()
13571{
13572return use_ascii (foo) == use_ebcdic (foo);
13573 ;
13574 return 0;
13575}
13576_ACEOF
13577if ac_fn_c_try_compile "$LINENO"; then :
13578 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13579 ac_cv_c_bigendian=yes
13580 fi
13581 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13582 if test "$ac_cv_c_bigendian" = unknown; then
13583 ac_cv_c_bigendian=no
13584 else
13585 # finding both strings is unlikely to happen, but who knows?
13586 ac_cv_c_bigendian=unknown
13587 fi
13588 fi
13589fi
13590rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13591else
13592 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13593/* end confdefs.h. */
13594$ac_includes_default
13595int
13596main ()
13597{
13598
13599 /* Are we little or big endian? From Harbison&Steele. */
13600 union
13601 {
13602 long int l;
13603 char c[sizeof (long int)];
13604 } u;
13605 u.l = 1;
13606 return u.c[sizeof (long int) - 1] == 1;
13607
13608 ;
13609 return 0;
13610}
13611_ACEOF
13612if ac_fn_c_try_run "$LINENO"; then :
13613 ac_cv_c_bigendian=no
13614else
13615 ac_cv_c_bigendian=yes
13616fi
13617rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13618 conftest.$ac_objext conftest.beam conftest.$ac_ext
13619fi
13620
13621 fi
13622fi
13623{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
13624$as_echo "$ac_cv_c_bigendian" >&6; }
13625 case $ac_cv_c_bigendian in #(
13626 yes)
13627 $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
13628;; #(
13629 no)
13630 ;; #(
13631 universal)
13632
13633$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13634
13635 ;; #(
13636 *)
13637 as_fn_error $? "unknown endianness
13638 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
13639 esac
13640
13641
13642
5df4cba6
SM
13643 GNULIB_LOCALECONV=0;
13644 GNULIB_SETLOCALE=0;
13645 GNULIB_SETLOCALE_NULL=0;
13646 GNULIB_DUPLOCALE=0;
13647 GNULIB_LOCALENAME=0;
13648 HAVE_NEWLOCALE=1;
13649 HAVE_DUPLOCALE=1;
13650 HAVE_FREELOCALE=1;
13651 REPLACE_LOCALECONV=0;
13652 REPLACE_SETLOCALE=0;
13653 REPLACE_NEWLOCALE=0;
13654 REPLACE_DUPLOCALE=0;
13655 REPLACE_FREELOCALE=0;
13656 REPLACE_STRUCT_LCONV=0;
13657
13658
13659 REPLACE_NULL=0;
13660 HAVE_MAX_ALIGN_T=1;
13661 HAVE_WCHAR_T=1;
13662
13663
13664 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
13665$as_echo_n "checking for wchar_t... " >&6; }
13666if ${gt_cv_c_wchar_t+:} false; then :
13667 $as_echo_n "(cached) " >&6
13668else
13669 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13670/* end confdefs.h. */
13671#include <stddef.h>
13672 wchar_t foo = (wchar_t)'\0';
13673int
13674main ()
13675{
13676
13677 ;
13678 return 0;
13679}
13680_ACEOF
13681if ac_fn_c_try_compile "$LINENO"; then :
13682 gt_cv_c_wchar_t=yes
13683else
13684 gt_cv_c_wchar_t=no
13685fi
13686rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13687fi
13688{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
13689$as_echo "$gt_cv_c_wchar_t" >&6; }
13690 if test $gt_cv_c_wchar_t = yes; then
13691
13692$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
13693
13694 fi
13695
13696
13697
13698
9c9d63b1
PM
13699
13700
13701
5df4cba6
SM
13702 STDDEF_H=
13703
13704 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
13705$as_echo_n "checking for good max_align_t... " >&6; }
13706if ${gl_cv_type_max_align_t+:} false; then :
13707 $as_echo_n "(cached) " >&6
13708else
13709 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13710/* end confdefs.h. */
13711#include <stddef.h>
13712 unsigned int s = sizeof (max_align_t);
9c9d63b1 13713 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
5df4cba6
SM
13714 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
13715 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
13716 #endif
9c9d63b1
PM
13717 typedef struct { char a; max_align_t b; } max_helper;
13718 typedef struct { char a; long b; } long_helper;
13719 typedef struct { char a; double b; } double_helper;
13720 typedef struct { char a; long double b; } long_double_helper;
13721 int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
13722 int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
13723 int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
5df4cba6
SM
13724
13725int
13726main ()
13727{
c0c3707f 13728
6ec2e0f5
SDJ
13729 ;
13730 return 0;
13731}
13732_ACEOF
13733if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 13734 gl_cv_type_max_align_t=yes
6ec2e0f5 13735else
5df4cba6 13736 gl_cv_type_max_align_t=no
6ec2e0f5 13737fi
c0c3707f 13738rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 13739
c0c3707f 13740fi
5df4cba6
SM
13741{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
13742$as_echo "$gl_cv_type_max_align_t" >&6; }
13743 if test $gl_cv_type_max_align_t = no; then
13744 HAVE_MAX_ALIGN_T=0
13745 STDDEF_H=stddef.h
13746 fi
13747
13748 if test $gt_cv_c_wchar_t = no; then
13749 HAVE_WCHAR_T=0
13750 STDDEF_H=stddef.h
13751 fi
13752
13753 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
13754$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
13755if ${gl_cv_decl_null_works+:} false; then :
13756 $as_echo_n "(cached) " >&6
c0c3707f
CB
13757else
13758 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13759/* end confdefs.h. */
5df4cba6
SM
13760#include <stddef.h>
13761 int test[2 * (sizeof NULL == sizeof (void *)) -1];
13762
c0c3707f
CB
13763int
13764main ()
13765{
6ec2e0f5 13766
c0c3707f
CB
13767 ;
13768 return 0;
13769}
13770_ACEOF
5df4cba6
SM
13771if ac_fn_c_try_compile "$LINENO"; then :
13772 gl_cv_decl_null_works=yes
c0c3707f 13773else
5df4cba6 13774 gl_cv_decl_null_works=no
c0c3707f 13775fi
5df4cba6 13776rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 13777fi
5df4cba6
SM
13778{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
13779$as_echo "$gl_cv_decl_null_works" >&6; }
13780 if test $gl_cv_decl_null_works = no; then
13781 REPLACE_NULL=1
13782 STDDEF_H=stddef.h
13783 fi
6ec2e0f5 13784
5df4cba6
SM
13785
13786 if test -n "$STDDEF_H"; then
13787 GL_GENERATE_STDDEF_H_TRUE=
13788 GL_GENERATE_STDDEF_H_FALSE='#'
13789else
13790 GL_GENERATE_STDDEF_H_TRUE='#'
13791 GL_GENERATE_STDDEF_H_FALSE=
c0c3707f 13792fi
6ec2e0f5 13793
5df4cba6 13794 if test -n "$STDDEF_H"; then
6ec2e0f5 13795
472fa5ee
SM
13796
13797
5e8754f9
SDJ
13798
13799
5df4cba6
SM
13800
13801
13802
13803 if test $gl_cv_have_include_next = yes; then
13804 gl_cv_next_stddef_h='<'stddef.h'>'
13805 else
13806 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
13807$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
13808if ${gl_cv_next_stddef_h+:} false; then :
13809 $as_echo_n "(cached) " >&6
c0c3707f 13810else
5df4cba6
SM
13811
13812
13813
c0c3707f
CB
13814 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13815/* end confdefs.h. */
c0c3707f 13816#include <stddef.h>
c0c3707f 13817_ACEOF
5df4cba6
SM
13818 case "$host_os" in
13819 aix*) gl_absname_cpp="$ac_cpp -C" ;;
13820 *) gl_absname_cpp="$ac_cpp" ;;
13821 esac
13822
13823 case "$host_os" in
13824 mingw*)
13825 gl_dirsep_regex='[/\\]'
13826 ;;
13827 *)
13828 gl_dirsep_regex='\/'
13829 ;;
13830 esac
13831 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13832 gl_header_literal_regex=`echo 'stddef.h' \
13833 | sed -e "$gl_make_literal_regex_sed"`
13834 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13835 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13836 s|^/[^/]|//&|
13837 p
13838 q
13839 }'
13840
13841 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13842 sed -n "$gl_absolute_header_sed"`
13843
13844 gl_header=$gl_cv_absolute_stddef_h
13845 gl_cv_next_stddef_h='"'$gl_header'"'
5e8754f9
SDJ
13846
13847
c0c3707f 13848fi
5df4cba6
SM
13849{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
13850$as_echo "$gl_cv_next_stddef_h" >&6; }
13851 fi
13852 NEXT_STDDEF_H=$gl_cv_next_stddef_h
13853
13854 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13855 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13856 gl_next_as_first_directive='<'stddef.h'>'
13857 else
13858 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13859 gl_next_as_first_directive=$gl_cv_next_stddef_h
13860 fi
13861 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
5e8754f9
SDJ
13862
13863
13864
13865
5df4cba6 13866 fi
5e8754f9
SDJ
13867
13868
13869
13870
13871
13872
5df4cba6
SM
13873 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
13874$as_echo_n "checking whether locale.h defines locale_t... " >&6; }
13875if ${gl_cv_header_locale_has_locale_t+:} false; then :
13876 $as_echo_n "(cached) " >&6
13877else
13878 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13879/* end confdefs.h. */
5df4cba6
SM
13880#include <locale.h>
13881 locale_t x;
c0c3707f
CB
13882int
13883main ()
13884{
5e8754f9 13885
c0c3707f
CB
13886 ;
13887 return 0;
13888}
13889_ACEOF
13890if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 13891 gl_cv_header_locale_has_locale_t=yes
c0c3707f 13892else
5df4cba6 13893 gl_cv_header_locale_has_locale_t=no
c0c3707f
CB
13894fi
13895rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 13896
c0c3707f 13897fi
5df4cba6
SM
13898{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
13899$as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
13900
13901
13902 if test $ac_cv_header_xlocale_h = yes; then
13903 HAVE_XLOCALE_H=1
13904 if test $gl_cv_header_locale_has_locale_t = yes; then
13905 gl_cv_header_locale_h_needs_xlocale_h=no
13906 else
13907 gl_cv_header_locale_h_needs_xlocale_h=yes
c0c3707f 13908 fi
5df4cba6
SM
13909 HAVE_LOCALE_T=1
13910 else
13911 HAVE_XLOCALE_H=0
13912 gl_cv_header_locale_h_needs_xlocale_h=no
13913 if test $gl_cv_header_locale_has_locale_t = yes; then
13914 HAVE_LOCALE_T=1
13915 else
13916 HAVE_LOCALE_T=0
13917 fi
13918 fi
13919
13920
5e8754f9 13921
5df4cba6
SM
13922
13923 gl_threads_api=none
13924 LIBTHREAD=
13925 LTLIBTHREAD=
13926 LIBMULTITHREAD=
13927 LTLIBMULTITHREAD=
13928 if test "$gl_use_threads" != no; then
13929
13930
13931 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
13932$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
13933if ${gl_cv_have_weak+:} false; then :
13934 $as_echo_n "(cached) " >&6
13935else
13936 gl_cv_have_weak=no
13937 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13938/* end confdefs.h. */
13939extern void xyzzy ();
13940#pragma weak xyzzy
c0c3707f
CB
13941int
13942main ()
13943{
5df4cba6 13944xyzzy();
c0c3707f
CB
13945 ;
13946 return 0;
13947}
13948_ACEOF
5df4cba6
SM
13949if ac_fn_c_try_link "$LINENO"; then :
13950 gl_cv_have_weak=maybe
13951fi
13952rm -f core conftest.err conftest.$ac_objext \
13953 conftest$ac_exeext conftest.$ac_ext
13954 if test $gl_cv_have_weak = maybe; then
13955 if test "$cross_compiling" = yes; then :
13956 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 13957/* end confdefs.h. */
5df4cba6
SM
13958#ifdef __ELF__
13959 Extensible Linking Format
13960 #endif
5e8754f9 13961
5df4cba6
SM
13962_ACEOF
13963if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13964 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
13965 gl_cv_have_weak="guessing yes"
13966else
13967 gl_cv_have_weak="guessing no"
13968fi
13969rm -f conftest*
5e8754f9 13970
5df4cba6
SM
13971
13972else
13973 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13974/* end confdefs.h. */
13975
13976#include <stdio.h>
13977#pragma weak fputs
13978int main ()
13979{
13980 return (fputs == NULL);
c0c3707f
CB
13981}
13982_ACEOF
5df4cba6
SM
13983if ac_fn_c_try_run "$LINENO"; then :
13984 gl_cv_have_weak=yes
c0c3707f 13985else
5df4cba6 13986 gl_cv_have_weak=no
c0c3707f 13987fi
5df4cba6
SM
13988rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13989 conftest.$ac_objext conftest.beam conftest.$ac_ext
c0c3707f 13990fi
5df4cba6
SM
13991
13992 fi
13993 case " $LDFLAGS " in
13994 *" -static "*) gl_cv_have_weak=no ;;
13995 esac
13996 case "$gl_cv_have_weak" in
13997 *yes)
13998 case "$host_os" in
13999 freebsd* | dragonfly*)
14000 : > conftest1.c
14001 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
14002 cat <<EOF > conftest2.c
14003#include <pthread.h>
14004#pragma weak pthread_mutexattr_gettype
14005int main ()
14006{
14007 return (pthread_mutexattr_gettype != NULL);
14008}
14009EOF
14010 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
14011 || gl_cv_have_weak=no
14012 rm -f conftest1.c libempty.so conftest2.c conftest
14013 ;;
14014 esac
14015 ;;
14016 esac
14017
14018fi
14019{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
14020$as_echo "$gl_cv_have_weak" >&6; }
14021 case "$gl_cv_have_weak" in
14022 *yes)
14023
14024$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
14025
14026 ;;
14027 esac
14028
14029 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
14030
14031 :
c0c3707f 14032 fi
5df4cba6
SM
14033 if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
14034
14035 gl_have_isoc_threads="$ac_cv_header_threads_h"
14036 fi
14037 if test "$gl_use_threads" = yes \
14038 || test "$gl_use_threads" = posix \
14039 || test "$gl_use_threads" = isoc+posix; then
14040
14041
14042 if test -z "$gl_pthreadlib_body_done"; then
14043 gl_pthread_api=no
14044 LIBPTHREAD=
14045 LIBPMULTITHREAD=
14046 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
14047 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
14048 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
14049if test "x$ac_cv_header_pthread_h" = xyes; then :
14050 gl_have_pthread_h=yes
14051else
14052 gl_have_pthread_h=no
14053fi
14054
14055
14056 if test "$gl_have_pthread_h" = yes; then
14057 # Other possible tests:
14058 # -lpthreads (FSU threads, PCthreads)
14059 # -lgthreads
14060 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
14061 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
14062 # the second one only in libpthread, and lock.c needs it.
14063 #
14064 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
14065 # needs -pthread for some reason. See:
14066 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
14067 save_LIBS=$LIBS
14068 for gl_pthread in '' '-pthread'; do
14069 LIBS="$LIBS $gl_pthread"
14070 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14071/* end confdefs.h. */
14072#include <pthread.h>
14073 pthread_mutex_t m;
14074 pthread_mutexattr_t ma;
5e8754f9 14075
c0c3707f
CB
14076int
14077main ()
14078{
5df4cba6
SM
14079pthread_mutex_lock (&m);
14080 pthread_mutexattr_init (&ma);
c0c3707f
CB
14081 ;
14082 return 0;
14083}
14084_ACEOF
5df4cba6
SM
14085if ac_fn_c_try_link "$LINENO"; then :
14086 gl_pthread_api=yes
14087 LIBPTHREAD=$gl_pthread
14088 LIBPMULTITHREAD=$gl_pthread
c0c3707f 14089fi
5df4cba6
SM
14090rm -f core conftest.err conftest.$ac_objext \
14091 conftest$ac_exeext conftest.$ac_ext
14092 LIBS=$save_LIBS
14093 test $gl_pthread_api = yes && break
14094 done
14095
14096 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
14097 # since it is defined as a macro on OSF/1.)
14098 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
14099 # The program links fine without libpthread. But it may actually
14100 # need to link with libpthread in order to create multiple threads.
14101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14102$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14103if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
14104 $as_echo_n "(cached) " >&6
c0c3707f 14105else
5df4cba6
SM
14106 ac_check_lib_save_LIBS=$LIBS
14107LIBS="-lpthread $LIBS"
14108cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14109/* end confdefs.h. */
5df4cba6
SM
14110
14111/* Override any GCC internal prototype to avoid an error.
14112 Use char because int might match the return type of a GCC
14113 builtin and then its argument prototype would still apply. */
14114#ifdef __cplusplus
14115extern "C"
14116#endif
14117char pthread_kill ();
c0c3707f
CB
14118int
14119main ()
14120{
5df4cba6 14121return pthread_kill ();
c0c3707f
CB
14122 ;
14123 return 0;
14124}
14125_ACEOF
5df4cba6
SM
14126if ac_fn_c_try_link "$LINENO"; then :
14127 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 14128else
5df4cba6 14129 ac_cv_lib_pthread_pthread_kill=no
6ec2e0f5 14130fi
5df4cba6
SM
14131rm -f core conftest.err conftest.$ac_objext \
14132 conftest$ac_exeext conftest.$ac_ext
14133LIBS=$ac_check_lib_save_LIBS
c0c3707f 14134fi
5df4cba6
SM
14135{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14136$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14137if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14138 LIBPMULTITHREAD=-lpthread
14139 # On Solaris and HP-UX, most pthread functions exist also in libc.
14140 # Therefore pthread_in_use() needs to actually try to create a
14141 # thread: pthread_create from libc will fail, whereas
14142 # pthread_create will actually create a thread.
14143 # On Solaris 10 or newer, this test is no longer needed, because
14144 # libc contains the fully functional pthread functions.
14145 case "$host_os" in
14146 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
472fa5ee 14147
5df4cba6 14148$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
472fa5ee 14149
5df4cba6 14150 esac
472fa5ee 14151
5df4cba6 14152fi
472fa5ee 14153
5df4cba6
SM
14154 elif test $gl_pthread_api != yes; then
14155 # Some library is needed. Try libpthread and libc_r.
14156 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14157$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14158if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
c0c3707f
CB
14159 $as_echo_n "(cached) " >&6
14160else
5df4cba6
SM
14161 ac_check_lib_save_LIBS=$LIBS
14162LIBS="-lpthread $LIBS"
14163cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14164/* end confdefs.h. */
5df4cba6
SM
14165
14166/* Override any GCC internal prototype to avoid an error.
14167 Use char because int might match the return type of a GCC
14168 builtin and then its argument prototype would still apply. */
14169#ifdef __cplusplus
14170extern "C"
14171#endif
14172char pthread_kill ();
c0c3707f
CB
14173int
14174main ()
14175{
5df4cba6 14176return pthread_kill ();
c0c3707f
CB
14177 ;
14178 return 0;
14179}
14180_ACEOF
14181if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14182 ac_cv_lib_pthread_pthread_kill=yes
c0c3707f 14183else
5df4cba6 14184 ac_cv_lib_pthread_pthread_kill=no
c0c3707f
CB
14185fi
14186rm -f core conftest.err conftest.$ac_objext \
14187 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14188LIBS=$ac_check_lib_save_LIBS
14189fi
14190{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14191$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14192if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14193 gl_pthread_api=yes
14194 LIBPTHREAD=-lpthread
14195 LIBPMULTITHREAD=-lpthread
c0c3707f 14196fi
472fa5ee 14197
5df4cba6
SM
14198 if test $gl_pthread_api != yes; then
14199 # For FreeBSD 4.
14200 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14201$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14202if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14203 $as_echo_n "(cached) " >&6
14204else
14205 ac_check_lib_save_LIBS=$LIBS
14206LIBS="-lc_r $LIBS"
14207cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14208/* end confdefs.h. */
472fa5ee 14209
5df4cba6
SM
14210/* Override any GCC internal prototype to avoid an error.
14211 Use char because int might match the return type of a GCC
14212 builtin and then its argument prototype would still apply. */
14213#ifdef __cplusplus
14214extern "C"
14215#endif
14216char pthread_kill ();
14217int
14218main ()
14219{
14220return pthread_kill ();
14221 ;
14222 return 0;
14223}
14224_ACEOF
14225if ac_fn_c_try_link "$LINENO"; then :
14226 ac_cv_lib_c_r_pthread_kill=yes
14227else
14228 ac_cv_lib_c_r_pthread_kill=no
14229fi
14230rm -f core conftest.err conftest.$ac_objext \
14231 conftest$ac_exeext conftest.$ac_ext
14232LIBS=$ac_check_lib_save_LIBS
14233fi
14234{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14235$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14236if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14237 gl_pthread_api=yes
14238 LIBPTHREAD=-lc_r
14239 LIBPMULTITHREAD=-lc_r
14240fi
6ec2e0f5 14241
5df4cba6
SM
14242 fi
14243 fi
14244 fi
14245 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14246$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14247 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14248$as_echo "$gl_pthread_api" >&6; }
472fa5ee
SM
14249
14250
5df4cba6 14251 if test $gl_pthread_api = yes; then
472fa5ee 14252
5df4cba6 14253$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
472fa5ee 14254
5df4cba6 14255 fi
472fa5ee 14256
5df4cba6 14257 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14258/* end confdefs.h. */
5df4cba6 14259#include <sched.h>
c0c3707f
CB
14260int
14261main ()
14262{
5df4cba6 14263sched_yield ();
c0c3707f
CB
14264 ;
14265 return 0;
14266}
14267_ACEOF
14268if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14269 LIB_SCHED_YIELD=
6ec2e0f5 14270
c0c3707f 14271else
5df4cba6
SM
14272 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14273$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14274if ${ac_cv_lib_rt_sched_yield+:} false; then :
14275 $as_echo_n "(cached) " >&6
c0c3707f 14276else
5df4cba6
SM
14277 ac_check_lib_save_LIBS=$LIBS
14278LIBS="-lrt $LIBS"
14279cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14280/* end confdefs.h. */
6ec2e0f5 14281
5df4cba6
SM
14282/* Override any GCC internal prototype to avoid an error.
14283 Use char because int might match the return type of a GCC
14284 builtin and then its argument prototype would still apply. */
14285#ifdef __cplusplus
14286extern "C"
14287#endif
14288char sched_yield ();
14289int
14290main ()
c0c3707f 14291{
5df4cba6
SM
14292return sched_yield ();
14293 ;
14294 return 0;
c0c3707f 14295}
6ec2e0f5 14296_ACEOF
5df4cba6
SM
14297if ac_fn_c_try_link "$LINENO"; then :
14298 ac_cv_lib_rt_sched_yield=yes
c0c3707f 14299else
5df4cba6 14300 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14301fi
5df4cba6
SM
14302rm -f core conftest.err conftest.$ac_objext \
14303 conftest$ac_exeext conftest.$ac_ext
14304LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14305fi
5df4cba6
SM
14306{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14307$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14308if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14309 LIB_SCHED_YIELD=-lrt
14310else
14311 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14312$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14313if ${ac_cv_lib_posix4_sched_yield+:} false; then :
14314 $as_echo_n "(cached) " >&6
14315else
14316 ac_check_lib_save_LIBS=$LIBS
14317LIBS="-lposix4 $LIBS"
14318cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f 14319/* end confdefs.h. */
6ec2e0f5 14320
5df4cba6
SM
14321/* Override any GCC internal prototype to avoid an error.
14322 Use char because int might match the return type of a GCC
14323 builtin and then its argument prototype would still apply. */
14324#ifdef __cplusplus
14325extern "C"
14326#endif
14327char sched_yield ();
c0c3707f
CB
14328int
14329main ()
14330{
5df4cba6 14331return sched_yield ();
c0c3707f
CB
14332 ;
14333 return 0;
14334}
14335_ACEOF
14336if ac_fn_c_try_link "$LINENO"; then :
5df4cba6
SM
14337 ac_cv_lib_posix4_sched_yield=yes
14338else
14339 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14340fi
14341rm -f core conftest.err conftest.$ac_objext \
14342 conftest$ac_exeext conftest.$ac_ext
5df4cba6
SM
14343LIBS=$ac_check_lib_save_LIBS
14344fi
14345{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14346$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14347if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14348 LIB_SCHED_YIELD=-lposix4
14349fi
14350
14351fi
14352
14353
14354fi
14355rm -f core conftest.err conftest.$ac_objext \
14356 conftest$ac_exeext conftest.$ac_ext
14357
14358
14359 gl_pthreadlib_body_done=done
14360 fi
14361
14362 LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
14363 LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
14364 if test $gl_pthread_api = yes; then
14365 if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
14366 gl_threads_api='isoc+posix'
14367
14368$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
14369
14370 LIBTHREAD= LTLIBTHREAD=
14371 else
14372 gl_threads_api=posix
14373
14374$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
14375
14376 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
14377 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
14378
14379$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
14380
14381 LIBTHREAD= LTLIBTHREAD=
9c9d63b1
PM
14382 else
14383 case "$host_os" in
14384 freebsd* | dragonfly*)
14385 if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
14386
14387$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
14388
14389 fi
14390 ;;
14391 esac
5df4cba6
SM
14392 fi
14393 fi
14394 fi
c0c3707f
CB
14395 fi
14396 fi
5df4cba6
SM
14397 if test $gl_threads_api = none; then
14398 if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
14399
14400
14401
14402 if test -z "$gl_stdthreadlib_body_done"; then
14403
14404
14405 case "$host_os" in
14406 mingw*)
14407 LIBSTDTHREAD=
14408 ;;
14409 *)
c0c3707f
CB
14410
14411
5df4cba6 14412 if test -z "$gl_pthreadlib_body_done"; then
c0c3707f
CB
14413 gl_pthread_api=no
14414 LIBPTHREAD=
14415 LIBPMULTITHREAD=
14416 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
14417 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
14418 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
14419if test "x$ac_cv_header_pthread_h" = xyes; then :
14420 gl_have_pthread_h=yes
14421else
14422 gl_have_pthread_h=no
14423fi
6ec2e0f5 14424
6ec2e0f5 14425
c0c3707f
CB
14426 if test "$gl_have_pthread_h" = yes; then
14427 # Other possible tests:
14428 # -lpthreads (FSU threads, PCthreads)
14429 # -lgthreads
14430 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
14431 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
14432 # the second one only in libpthread, and lock.c needs it.
14433 #
14434 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
14435 # needs -pthread for some reason. See:
14436 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
14437 save_LIBS=$LIBS
14438 for gl_pthread in '' '-pthread'; do
14439 LIBS="$LIBS $gl_pthread"
14440 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14441/* end confdefs.h. */
14442#include <pthread.h>
14443 pthread_mutex_t m;
14444 pthread_mutexattr_t ma;
6ec2e0f5 14445
c0c3707f
CB
14446int
14447main ()
14448{
14449pthread_mutex_lock (&m);
14450 pthread_mutexattr_init (&ma);
14451 ;
14452 return 0;
14453}
6ec2e0f5 14454_ACEOF
c0c3707f
CB
14455if ac_fn_c_try_link "$LINENO"; then :
14456 gl_pthread_api=yes
14457 LIBPTHREAD=$gl_pthread
14458 LIBPMULTITHREAD=$gl_pthread
6ec2e0f5 14459fi
c0c3707f
CB
14460rm -f core conftest.err conftest.$ac_objext \
14461 conftest$ac_exeext conftest.$ac_ext
14462 LIBS=$save_LIBS
14463 test $gl_pthread_api = yes && break
14464 done
6ec2e0f5 14465
c0c3707f
CB
14466 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
14467 # since it is defined as a macro on OSF/1.)
14468 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
14469 # The program links fine without libpthread. But it may actually
14470 # need to link with libpthread in order to create multiple threads.
14471 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14472$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14473if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
14474 $as_echo_n "(cached) " >&6
14475else
c0c3707f 14476 ac_check_lib_save_LIBS=$LIBS
5df4cba6
SM
14477LIBS="-lpthread $LIBS"
14478cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14479/* end confdefs.h. */
14480
14481/* Override any GCC internal prototype to avoid an error.
14482 Use char because int might match the return type of a GCC
14483 builtin and then its argument prototype would still apply. */
14484#ifdef __cplusplus
14485extern "C"
14486#endif
14487char pthread_kill ();
14488int
14489main ()
14490{
14491return pthread_kill ();
14492 ;
14493 return 0;
14494}
14495_ACEOF
14496if ac_fn_c_try_link "$LINENO"; then :
14497 ac_cv_lib_pthread_pthread_kill=yes
14498else
14499 ac_cv_lib_pthread_pthread_kill=no
14500fi
14501rm -f core conftest.err conftest.$ac_objext \
14502 conftest$ac_exeext conftest.$ac_ext
14503LIBS=$ac_check_lib_save_LIBS
14504fi
14505{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14506$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14507if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14508 LIBPMULTITHREAD=-lpthread
14509 # On Solaris and HP-UX, most pthread functions exist also in libc.
14510 # Therefore pthread_in_use() needs to actually try to create a
14511 # thread: pthread_create from libc will fail, whereas
14512 # pthread_create will actually create a thread.
14513 # On Solaris 10 or newer, this test is no longer needed, because
14514 # libc contains the fully functional pthread functions.
14515 case "$host_os" in
14516 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
14517
14518$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
14519
14520 esac
14521
14522fi
14523
14524 elif test $gl_pthread_api != yes; then
14525 # Some library is needed. Try libpthread and libc_r.
14526 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
14527$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
14528if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
14529 $as_echo_n "(cached) " >&6
14530else
14531 ac_check_lib_save_LIBS=$LIBS
14532LIBS="-lpthread $LIBS"
14533cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14534/* end confdefs.h. */
14535
14536/* Override any GCC internal prototype to avoid an error.
14537 Use char because int might match the return type of a GCC
14538 builtin and then its argument prototype would still apply. */
14539#ifdef __cplusplus
14540extern "C"
14541#endif
14542char pthread_kill ();
14543int
14544main ()
14545{
14546return pthread_kill ();
14547 ;
14548 return 0;
14549}
14550_ACEOF
14551if ac_fn_c_try_link "$LINENO"; then :
14552 ac_cv_lib_pthread_pthread_kill=yes
14553else
14554 ac_cv_lib_pthread_pthread_kill=no
14555fi
14556rm -f core conftest.err conftest.$ac_objext \
14557 conftest$ac_exeext conftest.$ac_ext
14558LIBS=$ac_check_lib_save_LIBS
14559fi
14560{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
14561$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
14562if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
14563 gl_pthread_api=yes
14564 LIBPTHREAD=-lpthread
14565 LIBPMULTITHREAD=-lpthread
14566fi
14567
14568 if test $gl_pthread_api != yes; then
14569 # For FreeBSD 4.
14570 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
14571$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
14572if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
14573 $as_echo_n "(cached) " >&6
14574else
14575 ac_check_lib_save_LIBS=$LIBS
14576LIBS="-lc_r $LIBS"
14577cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14578/* end confdefs.h. */
14579
14580/* Override any GCC internal prototype to avoid an error.
14581 Use char because int might match the return type of a GCC
14582 builtin and then its argument prototype would still apply. */
14583#ifdef __cplusplus
14584extern "C"
14585#endif
14586char pthread_kill ();
14587int
14588main ()
14589{
14590return pthread_kill ();
14591 ;
14592 return 0;
14593}
14594_ACEOF
14595if ac_fn_c_try_link "$LINENO"; then :
14596 ac_cv_lib_c_r_pthread_kill=yes
14597else
14598 ac_cv_lib_c_r_pthread_kill=no
14599fi
14600rm -f core conftest.err conftest.$ac_objext \
14601 conftest$ac_exeext conftest.$ac_ext
14602LIBS=$ac_check_lib_save_LIBS
14603fi
14604{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
14605$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
14606if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
14607 gl_pthread_api=yes
14608 LIBPTHREAD=-lc_r
14609 LIBPMULTITHREAD=-lc_r
14610fi
14611
14612 fi
14613 fi
14614 fi
14615 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
14616$as_echo_n "checking whether POSIX threads API is available... " >&6; }
14617 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
14618$as_echo "$gl_pthread_api" >&6; }
14619
14620
14621 if test $gl_pthread_api = yes; then
14622
14623$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
14624
14625 fi
14626
14627 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14628/* end confdefs.h. */
14629#include <sched.h>
14630int
14631main ()
14632{
14633sched_yield ();
14634 ;
14635 return 0;
14636}
14637_ACEOF
14638if ac_fn_c_try_link "$LINENO"; then :
14639 LIB_SCHED_YIELD=
14640
14641else
14642 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
14643$as_echo_n "checking for sched_yield in -lrt... " >&6; }
14644if ${ac_cv_lib_rt_sched_yield+:} false; then :
14645 $as_echo_n "(cached) " >&6
14646else
14647 ac_check_lib_save_LIBS=$LIBS
14648LIBS="-lrt $LIBS"
c0c3707f 14649cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14650/* end confdefs.h. */
6ec2e0f5 14651
c0c3707f
CB
14652/* Override any GCC internal prototype to avoid an error.
14653 Use char because int might match the return type of a GCC
14654 builtin and then its argument prototype would still apply. */
14655#ifdef __cplusplus
14656extern "C"
14657#endif
5df4cba6 14658char sched_yield ();
c0c3707f
CB
14659int
14660main ()
14661{
5df4cba6 14662return sched_yield ();
c0c3707f
CB
14663 ;
14664 return 0;
14665}
6ec2e0f5 14666_ACEOF
c0c3707f 14667if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14668 ac_cv_lib_rt_sched_yield=yes
6ec2e0f5 14669else
5df4cba6 14670 ac_cv_lib_rt_sched_yield=no
6ec2e0f5 14671fi
c0c3707f
CB
14672rm -f core conftest.err conftest.$ac_objext \
14673 conftest$ac_exeext conftest.$ac_ext
14674LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 14675fi
5df4cba6
SM
14676{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
14677$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
14678if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
14679 LIB_SCHED_YIELD=-lrt
14680else
14681 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
14682$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
14683if ${ac_cv_lib_posix4_sched_yield+:} false; then :
6ec2e0f5
SDJ
14684 $as_echo_n "(cached) " >&6
14685else
c0c3707f 14686 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14687LIBS="-lposix4 $LIBS"
c0c3707f 14688cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
14689/* end confdefs.h. */
14690
c0c3707f
CB
14691/* Override any GCC internal prototype to avoid an error.
14692 Use char because int might match the return type of a GCC
14693 builtin and then its argument prototype would still apply. */
14694#ifdef __cplusplus
14695extern "C"
14696#endif
5df4cba6 14697char sched_yield ();
6ec2e0f5
SDJ
14698int
14699main ()
14700{
5df4cba6 14701return sched_yield ();
c0c3707f
CB
14702 ;
14703 return 0;
14704}
14705_ACEOF
14706if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14707 ac_cv_lib_posix4_sched_yield=yes
c0c3707f 14708else
5df4cba6 14709 ac_cv_lib_posix4_sched_yield=no
c0c3707f
CB
14710fi
14711rm -f core conftest.err conftest.$ac_objext \
14712 conftest$ac_exeext conftest.$ac_ext
14713LIBS=$ac_check_lib_save_LIBS
14714fi
5df4cba6
SM
14715{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
14716$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
14717if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
14718 LIB_SCHED_YIELD=-lposix4
c0c3707f 14719fi
6ec2e0f5 14720
5df4cba6
SM
14721fi
14722
14723
14724fi
14725rm -f core conftest.err conftest.$ac_objext \
14726 conftest$ac_exeext conftest.$ac_ext
14727
14728
14729 gl_pthreadlib_body_done=done
14730 fi
14731
14732 if test $ac_cv_header_threads_h = yes; then
14733 for ac_func in thrd_create
14734do :
14735 ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create"
14736if test "x$ac_cv_func_thrd_create" = xyes; then :
14737 cat >>confdefs.h <<_ACEOF
14738#define HAVE_THRD_CREATE 1
14739_ACEOF
14740
14741fi
14742done
14743
14744 if test $ac_cv_func_thrd_create = yes; then
14745 LIBSTDTHREAD=
14746 else
14747 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5
14748$as_echo_n "checking for thrd_create in -lstdthreads... " >&6; }
14749if ${ac_cv_lib_stdthreads_thrd_create+:} false; then :
c0c3707f
CB
14750 $as_echo_n "(cached) " >&6
14751else
14752 ac_check_lib_save_LIBS=$LIBS
5df4cba6 14753LIBS="-lstdthreads $LIBS"
c0c3707f
CB
14754cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14755/* end confdefs.h. */
6ec2e0f5 14756
c0c3707f
CB
14757/* Override any GCC internal prototype to avoid an error.
14758 Use char because int might match the return type of a GCC
14759 builtin and then its argument prototype would still apply. */
14760#ifdef __cplusplus
14761extern "C"
14762#endif
5df4cba6 14763char thrd_create ();
c0c3707f
CB
14764int
14765main ()
14766{
5df4cba6 14767return thrd_create ();
6ec2e0f5
SDJ
14768 ;
14769 return 0;
14770}
14771_ACEOF
c0c3707f 14772if ac_fn_c_try_link "$LINENO"; then :
5df4cba6 14773 ac_cv_lib_stdthreads_thrd_create=yes
6ec2e0f5 14774else
5df4cba6 14775 ac_cv_lib_stdthreads_thrd_create=no
6ec2e0f5 14776fi
c0c3707f
CB
14777rm -f core conftest.err conftest.$ac_objext \
14778 conftest$ac_exeext conftest.$ac_ext
14779LIBS=$ac_check_lib_save_LIBS
14780fi
5df4cba6
SM
14781{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5
14782$as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; }
14783if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then :
6ec2e0f5 14784
5df4cba6 14785 LIBSTDTHREAD='-lstdthreads -lpthread'
6ec2e0f5 14786
5df4cba6 14787else
6ec2e0f5 14788
5df4cba6 14789 LIBSTDTHREAD="$LIBPMULTITHREAD"
6ec2e0f5 14790
5df4cba6 14791fi
6ec2e0f5 14792
5df4cba6 14793 fi
c0c3707f 14794 else
5df4cba6
SM
14795 LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
14796 fi
14797 ;;
14798 esac
c0c3707f 14799
c0c3707f 14800
5df4cba6
SM
14801 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5
14802$as_echo_n "checking whether ISO C threads API is available... " >&6; }
14803 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5
14804$as_echo "$ac_cv_header_threads_h" >&6; }
14805 gl_stdthreadlib_body_done=done
14806 fi
c0c3707f 14807
5df4cba6
SM
14808 LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
14809 LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
c0c3707f
CB
14810 gl_threads_api=isoc
14811
14812$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
14813
14814 fi
14815 fi
14816 if test $gl_threads_api = none; then
14817 case "$gl_use_threads" in
14818 yes | windows | win32) # The 'win32' is for backward compatibility.
14819 if { case "$host_os" in
14820 mingw*) true;;
14821 *) false;;
14822 esac
14823 }; then
14824 gl_threads_api=windows
14825
14826$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
14827
14828 fi
14829 ;;
14830 esac
14831 fi
14832 fi
14833 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
14834$as_echo_n "checking for multithread API to use... " >&6; }
14835 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
14836$as_echo "$gl_threads_api" >&6; }
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
14850$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
14851if ${gl_cv_func_malloc_posix+:} false; then :
6ec2e0f5
SDJ
14852 $as_echo_n "(cached) " >&6
14853else
c0c3707f
CB
14854
14855 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14856/* end confdefs.h. */
c0c3707f 14857
6ec2e0f5
SDJ
14858int
14859main ()
14860{
c0c3707f
CB
14861#if defined _WIN32 && ! defined __CYGWIN__
14862 choke me
14863 #endif
6ec2e0f5
SDJ
14864
14865 ;
14866 return 0;
14867}
14868_ACEOF
14869if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 14870 gl_cv_func_malloc_posix=yes
6ec2e0f5 14871else
c0c3707f 14872 gl_cv_func_malloc_posix=no
6ec2e0f5
SDJ
14873fi
14874rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
472fa5ee 14875
c0c3707f
CB
14876fi
14877{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
14878$as_echo "$gl_cv_func_malloc_posix" >&6; }
472fa5ee
SM
14879
14880
6ec2e0f5 14881
9c9d63b1 14882 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
c0c3707f
CB
14883$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
14884if ${ac_cv_func_malloc_0_nonnull+:} false; then :
6ec2e0f5
SDJ
14885 $as_echo_n "(cached) " >&6
14886else
14887 if test "$cross_compiling" = yes; then :
14888 case "$host_os" in
c0c3707f
CB
14889 # Guess yes on platforms where we know the result.
14890 *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
14891 | hpux* | solaris* | cygwin* | mingw*)
14892 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
14893 # If we don't know, obey --enable-cross-guesses.
14894 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
14895 esac
6ec2e0f5
SDJ
14896
14897else
14898 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14899/* end confdefs.h. */
9c9d63b1 14900#include <stdlib.h>
6ec2e0f5
SDJ
14901
14902int
14903main ()
14904{
c0c3707f
CB
14905char *p = malloc (0);
14906 int result = !p;
14907 free (p);
14908 return result;
6ec2e0f5
SDJ
14909 ;
14910 return 0;
698be2d8
CB
14911}
14912
14913_ACEOF
14914if ac_fn_c_try_run "$LINENO"; then :
14915 ac_cv_func_malloc_0_nonnull=yes
14916else
14917 ac_cv_func_malloc_0_nonnull=no
14918fi
14919rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14920 conftest.$ac_objext conftest.beam conftest.$ac_ext
14921fi
14922
14923
14924fi
14925{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
14926$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
14927 case "$ac_cv_func_malloc_0_nonnull" in
14928 *yes)
14929 gl_cv_func_malloc_0_nonnull=1
14930 ;;
14931 *)
14932 gl_cv_func_malloc_0_nonnull=0
14933 ;;
14934 esac
14935
14936
14937cat >>confdefs.h <<_ACEOF
14938#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
14939_ACEOF
14940
14941
14942
c0c3707f
CB
14943
14944
6ec2e0f5
SDJ
14945
14946
14947
14948
14949
14950
c0c3707f
CB
14951 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
14952$as_echo_n "checking for a traditional japanese locale... " >&6; }
14953if ${gt_cv_locale_ja+:} false; then :
14954 $as_echo_n "(cached) " >&6
14955else
14956
14957 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14958/* end confdefs.h. */
6ec2e0f5 14959
c0c3707f
CB
14960#include <locale.h>
14961#include <time.h>
14962#if HAVE_LANGINFO_CODESET
14963# include <langinfo.h>
14964#endif
14965#include <stdlib.h>
14966#include <string.h>
14967struct tm t;
14968char buf[16];
14969int main ()
14970{
14971 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
14972 imitates locale dependent behaviour by looking at the environment
14973 variables, and all locales use the UTF-8 encoding. */
14974#if defined __BEOS__ || defined __HAIKU__
14975 return 1;
14976#else
14977 /* Check whether the given locale name is recognized by the system. */
14978# if defined _WIN32 && !defined __CYGWIN__
14979 /* On native Windows, setlocale(category, "") looks at the system settings,
14980 not at the environment variables. Also, when an encoding suffix such
14981 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
14982 category of the locale to "C". */
14983 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
14984 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
14985 return 1;
14986# else
14987 if (setlocale (LC_ALL, "") == NULL) return 1;
14988# endif
14989 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
14990 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
14991 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
14992 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
14993 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
14994 some unit tests fail.
14995 On MirBSD 10, when an unsupported locale is specified, setlocale()
14996 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
14997# if HAVE_LANGINFO_CODESET
14998 {
14999 const char *cs = nl_langinfo (CODESET);
15000 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15001 || strcmp (cs, "UTF-8") == 0)
15002 return 1;
15003 }
15004# endif
15005# ifdef __CYGWIN__
15006 /* On Cygwin, avoid locale names without encoding suffix, because the
15007 locale_charset() function relies on the encoding suffix. Note that
15008 LC_ALL is set on the command line. */
15009 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15010# endif
15011 /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
15012 on Cygwin 1.5.x. */
15013 if (MB_CUR_MAX == 1)
15014 return 1;
15015 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
15016 This excludes the UTF-8 encoding (except on MirBSD). */
15017 {
15018 const char *p;
15019 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15020 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
15021 for (p = buf; *p != '\0'; p++)
15022 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
15023 return 1;
15024 }
15025 return 0;
15026#endif
15027}
6ec2e0f5 15028
c0c3707f
CB
15029_ACEOF
15030 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15031 (eval $ac_link) 2>&5
15032 ac_status=$?
15033 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15034 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15035 case "$host_os" in
15036 # Handle native Windows specially, because there setlocale() interprets
15037 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15038 # "fr" or "fra" as "French" or "French_France.1252",
15039 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15040 # "ja" as "Japanese" or "Japanese_Japan.932",
15041 # and similar.
15042 mingw*)
15043 # Note that on native Windows, the Japanese locale is
15044 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
15045 # cannot use it here.
15046 gt_cv_locale_ja=none
15047 ;;
15048 *)
15049 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15050 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15051 # configure script would override the LC_ALL setting. Likewise for
15052 # LC_CTYPE, which is also set at the beginning of the configure script.
15053 # Test for the AIX locale name.
15054 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15055 gt_cv_locale_ja=ja_JP
15056 else
15057 # Test for the locale name with explicit encoding suffix.
15058 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15059 gt_cv_locale_ja=ja_JP.EUC-JP
15060 else
15061 # Test for the HP-UX, OSF/1, NetBSD locale name.
15062 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15063 gt_cv_locale_ja=ja_JP.eucJP
15064 else
15065 # Test for the IRIX, FreeBSD locale name.
15066 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15067 gt_cv_locale_ja=ja_JP.EUC
15068 else
15069 # Test for the Solaris 7 locale name.
15070 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15071 gt_cv_locale_ja=ja
15072 else
15073 # Special test for NetBSD 1.6.
15074 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
15075 gt_cv_locale_ja=ja_JP.eucJP
15076 else
15077 # None found.
15078 gt_cv_locale_ja=none
15079 fi
15080 fi
15081 fi
15082 fi
15083 fi
15084 fi
15085 ;;
15086 esac
15087 fi
15088 rm -fr conftest*
5abebf3c
CB
15089
15090fi
c0c3707f
CB
15091{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
15092$as_echo "$gt_cv_locale_ja" >&6; }
15093 LOCALE_JA=$gt_cv_locale_ja
5abebf3c 15094
5abebf3c 15095
5abebf3c 15096
5abebf3c 15097
c0c3707f
CB
15098 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
15099$as_echo_n "checking for a french Unicode locale... " >&6; }
15100if ${gt_cv_locale_fr_utf8+:} false; then :
5abebf3c
CB
15101 $as_echo_n "(cached) " >&6
15102else
5abebf3c 15103
c0c3707f 15104 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 15105/* end confdefs.h. */
5abebf3c 15106
c0c3707f
CB
15107#include <locale.h>
15108#include <time.h>
15109#if HAVE_LANGINFO_CODESET
15110# include <langinfo.h>
15111#endif
15112#include <stdlib.h>
15113#include <string.h>
15114struct tm t;
15115char buf[16];
15116int main () {
15117 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15118 imitates locale dependent behaviour by looking at the environment
15119 variables, and all locales use the UTF-8 encoding. */
15120#if !(defined __BEOS__ || defined __HAIKU__)
15121 /* Check whether the given locale name is recognized by the system. */
15122# if defined _WIN32 && !defined __CYGWIN__
15123 /* On native Windows, setlocale(category, "") looks at the system settings,
15124 not at the environment variables. Also, when an encoding suffix such
15125 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15126 category of the locale to "C". */
15127 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15128 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15129 return 1;
15130# else
15131 if (setlocale (LC_ALL, "") == NULL) return 1;
15132# endif
15133 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15134 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15135 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15136 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15137 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15138 some unit tests fail. */
15139# if HAVE_LANGINFO_CODESET
15140 {
15141 const char *cs = nl_langinfo (CODESET);
15142 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
15143 return 1;
15144 }
15145# endif
15146# ifdef __CYGWIN__
15147 /* On Cygwin, avoid locale names without encoding suffix, because the
15148 locale_charset() function relies on the encoding suffix. Note that
15149 LC_ALL is set on the command line. */
15150 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15151# endif
15152 /* Check whether in the abbreviation of the second month, the second
15153 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
15154 two bytes long, with UTF-8 encoding. */
15155 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15156 if (strftime (buf, sizeof (buf), "%b", &t) < 4
15157 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
15158 return 1;
15159#endif
15160#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
15161 /* Check whether the decimal separator is a comma.
15162 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
15163 are nl_langinfo(RADIXCHAR) are both ".". */
15164 if (localeconv () ->decimal_point[0] != ',') return 1;
15165#endif
5abebf3c
CB
15166 return 0;
15167}
5abebf3c 15168
c0c3707f
CB
15169_ACEOF
15170 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15171 (eval $ac_link) 2>&5
15172 ac_status=$?
15173 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15174 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15175 case "$host_os" in
15176 # Handle native Windows specially, because there setlocale() interprets
15177 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15178 # "fr" or "fra" as "French" or "French_France.1252",
15179 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15180 # "ja" as "Japanese" or "Japanese_Japan.932",
15181 # and similar.
15182 mingw*)
15183 # Test for the hypothetical native Windows locale name.
15184 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15185 gt_cv_locale_fr_utf8=French_France.65001
15186 else
15187 # None found.
15188 gt_cv_locale_fr_utf8=none
15189 fi
15190 ;;
15191 *)
15192 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15193 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15194 # configure script would override the LC_ALL setting. Likewise for
15195 # LC_CTYPE, which is also set at the beginning of the configure script.
15196 # Test for the usual locale name.
15197 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15198 gt_cv_locale_fr_utf8=fr_FR
15199 else
15200 # Test for the locale name with explicit encoding suffix.
15201 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15202 gt_cv_locale_fr_utf8=fr_FR.UTF-8
15203 else
15204 # Test for the Solaris 7 locale name.
15205 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15206 gt_cv_locale_fr_utf8=fr.UTF-8
15207 else
15208 # None found.
15209 gt_cv_locale_fr_utf8=none
15210 fi
15211 fi
15212 fi
15213 ;;
15214 esac
15215 fi
15216 rm -fr conftest*
5abebf3c
CB
15217
15218fi
c0c3707f
CB
15219{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
15220$as_echo "$gt_cv_locale_fr_utf8" >&6; }
15221 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
5abebf3c
CB
15222
15223
15224
15225
15226
c0c3707f
CB
15227 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
15228$as_echo_n "checking for a transitional chinese locale... " >&6; }
15229if ${gt_cv_locale_zh_CN+:} false; then :
5abebf3c
CB
15230 $as_echo_n "(cached) " >&6
15231else
5abebf3c 15232
c0c3707f 15233 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 15234/* end confdefs.h. */
5abebf3c 15235
c0c3707f
CB
15236#include <locale.h>
15237#include <stdlib.h>
15238#include <time.h>
15239#if HAVE_LANGINFO_CODESET
15240# include <langinfo.h>
15241#endif
15242#include <stdlib.h>
15243#include <string.h>
15244struct tm t;
15245char buf[16];
15246int main ()
5abebf3c 15247{
c0c3707f
CB
15248 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
15249 imitates locale dependent behaviour by looking at the environment
15250 variables, and all locales use the UTF-8 encoding. */
15251#if defined __BEOS__ || defined __HAIKU__
15252 return 1;
15253#else
15254 /* Check whether the given locale name is recognized by the system. */
15255# if defined _WIN32 && !defined __CYGWIN__
15256 /* On native Windows, setlocale(category, "") looks at the system settings,
15257 not at the environment variables. Also, when an encoding suffix such
15258 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
15259 category of the locale to "C". */
15260 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
15261 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
15262 return 1;
15263# else
15264 if (setlocale (LC_ALL, "") == NULL) return 1;
15265# endif
15266 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
15267 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
15268 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
15269 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
15270 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
15271 some unit tests fail.
15272 On MirBSD 10, when an unsupported locale is specified, setlocale()
15273 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
15274# if HAVE_LANGINFO_CODESET
15275 {
15276 const char *cs = nl_langinfo (CODESET);
15277 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
15278 || strcmp (cs, "UTF-8") == 0)
15279 return 1;
15280 }
15281# endif
15282# ifdef __CYGWIN__
15283 /* On Cygwin, avoid locale names without encoding suffix, because the
15284 locale_charset() function relies on the encoding suffix. Note that
15285 LC_ALL is set on the command line. */
15286 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
15287# endif
15288 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
15289 This excludes the UTF-8 encoding (except on MirBSD). */
15290 {
15291 const char *p;
15292 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
15293 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
15294 for (p = buf; *p != '\0'; p++)
15295 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
15296 return 1;
15297 }
15298 /* Check whether a typical GB18030 multibyte sequence is recognized as a
15299 single wide character. This excludes the GB2312 and GBK encodings. */
15300 if (mblen ("\203\062\332\066", 5) != 4)
15301 return 1;
5abebf3c 15302 return 0;
c0c3707f 15303#endif
5abebf3c 15304}
c0c3707f 15305
5abebf3c 15306_ACEOF
c0c3707f
CB
15307 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
15308 (eval $ac_link) 2>&5
15309 ac_status=$?
15310 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15311 test $ac_status = 0; } && test -s conftest$ac_exeext; then
15312 case "$host_os" in
15313 # Handle native Windows specially, because there setlocale() interprets
15314 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
15315 # "fr" or "fra" as "French" or "French_France.1252",
15316 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
15317 # "ja" as "Japanese" or "Japanese_Japan.932",
15318 # and similar.
15319 mingw*)
15320 # Test for the hypothetical native Windows locale name.
15321 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15322 gt_cv_locale_zh_CN=Chinese_China.54936
15323 else
15324 # None found.
15325 gt_cv_locale_zh_CN=none
15326 fi
15327 ;;
15328 solaris2.8)
15329 # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
15330 # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
15331 # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
15332 gt_cv_locale_zh_CN=none
15333 ;;
15334 *)
15335 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
15336 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
15337 # configure script would override the LC_ALL setting. Likewise for
15338 # LC_CTYPE, which is also set at the beginning of the configure script.
15339 # Test for the locale name without encoding suffix.
15340 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15341 gt_cv_locale_zh_CN=zh_CN
15342 else
15343 # Test for the locale name with explicit encoding suffix.
15344 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
15345 gt_cv_locale_zh_CN=zh_CN.GB18030
15346 else
15347 # None found.
15348 gt_cv_locale_zh_CN=none
15349 fi
15350 fi
15351 ;;
15352 esac
15353 else
15354 # If there was a link error, due to mblen(), the system is so old that
15355 # it certainly doesn't have a chinese locale.
15356 gt_cv_locale_zh_CN=none
15357 fi
15358 rm -fr conftest*
15359
5abebf3c 15360fi
c0c3707f
CB
15361{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
15362$as_echo "$gt_cv_locale_zh_CN" >&6; }
15363 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
15364
15365
15366{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
15367$as_echo_n "checking for inline... " >&6; }
15368if ${ac_cv_c_inline+:} false; then :
15369 $as_echo_n "(cached) " >&6
15370else
15371 ac_cv_c_inline=no
15372for ac_kw in inline __inline__ __inline; do
15373 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15374/* end confdefs.h. */
15375#ifndef __cplusplus
15376typedef int foo_t;
15377static $ac_kw foo_t static_foo () {return 0; }
15378$ac_kw foo_t foo () {return 0; }
15379#endif
5abebf3c 15380
c0c3707f
CB
15381_ACEOF
15382if ac_fn_c_try_compile "$LINENO"; then :
15383 ac_cv_c_inline=$ac_kw
15384fi
15385rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15386 test "$ac_cv_c_inline" != no && break
15387done
5abebf3c
CB
15388
15389fi
c0c3707f
CB
15390{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
15391$as_echo "$ac_cv_c_inline" >&6; }
5abebf3c 15392
c0c3707f
CB
15393case $ac_cv_c_inline in
15394 inline | yes) ;;
15395 *)
15396 case $ac_cv_c_inline in
15397 no) ac_val=;;
15398 *) ac_val=$ac_cv_c_inline;;
15399 esac
15400 cat >>confdefs.h <<_ACEOF
15401#ifndef __cplusplus
15402#define inline $ac_val
15403#endif
15404_ACEOF
15405 ;;
15406esac
5abebf3c
CB
15407
15408
15409
15410
5abebf3c
CB
15411
15412
c0c3707f
CB
15413 GNULIB_EXPLICIT_BZERO=0;
15414 GNULIB_FFSL=0;
15415 GNULIB_FFSLL=0;
15416 GNULIB_MEMCHR=0;
15417 GNULIB_MEMMEM=0;
15418 GNULIB_MEMPCPY=0;
15419 GNULIB_MEMRCHR=0;
15420 GNULIB_RAWMEMCHR=0;
15421 GNULIB_STPCPY=0;
15422 GNULIB_STPNCPY=0;
15423 GNULIB_STRCHRNUL=0;
15424 GNULIB_STRDUP=0;
15425 GNULIB_STRNCAT=0;
15426 GNULIB_STRNDUP=0;
15427 GNULIB_STRNLEN=0;
15428 GNULIB_STRPBRK=0;
15429 GNULIB_STRSEP=0;
15430 GNULIB_STRSTR=0;
15431 GNULIB_STRCASESTR=0;
15432 GNULIB_STRTOK_R=0;
15433 GNULIB_MBSLEN=0;
15434 GNULIB_MBSNLEN=0;
15435 GNULIB_MBSCHR=0;
15436 GNULIB_MBSRCHR=0;
15437 GNULIB_MBSSTR=0;
15438 GNULIB_MBSCASECMP=0;
15439 GNULIB_MBSNCASECMP=0;
15440 GNULIB_MBSPCASECMP=0;
15441 GNULIB_MBSCASESTR=0;
15442 GNULIB_MBSCSPN=0;
15443 GNULIB_MBSPBRK=0;
15444 GNULIB_MBSSPN=0;
15445 GNULIB_MBSSEP=0;
15446 GNULIB_MBSTOK_R=0;
15447 GNULIB_STRERROR=0;
15448 GNULIB_STRERROR_R=0;
9c9d63b1
PM
15449 GNULIB_STRERRORNAME_NP=0;
15450 GNULIB_SIGABBREV_NP=0;
15451 GNULIB_SIGDESCR_NP=0;
c0c3707f
CB
15452 GNULIB_STRSIGNAL=0;
15453 GNULIB_STRVERSCMP=0;
15454 HAVE_MBSLEN=0;
9c9d63b1
PM
15455 GNULIB_MDA_MEMCCPY=1;
15456 GNULIB_MDA_STRDUP=1;
c0c3707f
CB
15457 HAVE_EXPLICIT_BZERO=1;
15458 HAVE_FFSL=1;
15459 HAVE_FFSLL=1;
c0c3707f
CB
15460 HAVE_DECL_MEMMEM=1;
15461 HAVE_MEMPCPY=1;
15462 HAVE_DECL_MEMRCHR=1;
15463 HAVE_RAWMEMCHR=1;
15464 HAVE_STPCPY=1;
15465 HAVE_STPNCPY=1;
15466 HAVE_STRCHRNUL=1;
15467 HAVE_DECL_STRDUP=1;
15468 HAVE_DECL_STRNDUP=1;
15469 HAVE_DECL_STRNLEN=1;
15470 HAVE_STRPBRK=1;
15471 HAVE_STRSEP=1;
15472 HAVE_STRCASESTR=1;
15473 HAVE_DECL_STRTOK_R=1;
15474 HAVE_DECL_STRERROR_R=1;
9c9d63b1
PM
15475 HAVE_STRERRORNAME_NP=1;
15476 HAVE_SIGABBREV_NP=1;
15477 HAVE_SIGDESCR_NP=1;
c0c3707f
CB
15478 HAVE_DECL_STRSIGNAL=1;
15479 HAVE_STRVERSCMP=1;
9c9d63b1 15480 REPLACE_FFSLL=0;
c0c3707f
CB
15481 REPLACE_MEMCHR=0;
15482 REPLACE_MEMMEM=0;
15483 REPLACE_STPNCPY=0;
15484 REPLACE_STRCHRNUL=0;
15485 REPLACE_STRDUP=0;
15486 REPLACE_STRNCAT=0;
15487 REPLACE_STRNDUP=0;
15488 REPLACE_STRNLEN=0;
15489 REPLACE_STRSTR=0;
15490 REPLACE_STRCASESTR=0;
15491 REPLACE_STRTOK_R=0;
15492 REPLACE_STRERROR=0;
15493 REPLACE_STRERROR_R=0;
9c9d63b1 15494 REPLACE_STRERRORNAME_NP=0;
c0c3707f
CB
15495 REPLACE_STRSIGNAL=0;
15496 UNDEFINE_STRTOK_R=0;
5abebf3c
CB
15497
15498
15499
15500
6ec2e0f5
SDJ
15501
15502
c0c3707f
CB
15503 # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
15504 # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
15505 # irrelevant for anonymous mappings.
15506 ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
15507if test "x$ac_cv_func_mmap" = xyes; then :
15508 gl_have_mmap=yes
6ec2e0f5 15509else
c0c3707f
CB
15510 gl_have_mmap=no
15511fi
6ec2e0f5
SDJ
15512
15513
c0c3707f
CB
15514 # Try to allow MAP_ANONYMOUS.
15515 gl_have_mmap_anonymous=no
15516 if test $gl_have_mmap = yes; then
15517 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
15518$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
15519 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15520/* end confdefs.h. */
6ec2e0f5 15521
c0c3707f
CB
15522#include <sys/mman.h>
15523#ifdef MAP_ANONYMOUS
15524 I cannot identify this map
15525#endif
6ec2e0f5 15526
c0c3707f
CB
15527_ACEOF
15528if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15529 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
15530 gl_have_mmap_anonymous=yes
6ec2e0f5 15531fi
c0c3707f 15532rm -f conftest*
6ec2e0f5 15533
c0c3707f
CB
15534 if test $gl_have_mmap_anonymous != yes; then
15535 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15536/* end confdefs.h. */
6ec2e0f5 15537
c0c3707f
CB
15538#include <sys/mman.h>
15539#ifdef MAP_ANON
15540 I cannot identify this map
15541#endif
6ec2e0f5 15542
c0c3707f
CB
15543_ACEOF
15544if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15545 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
6ec2e0f5 15546
c0c3707f 15547$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
5e8754f9 15548
c0c3707f 15549 gl_have_mmap_anonymous=yes
5e8754f9 15550fi
c0c3707f
CB
15551rm -f conftest*
15552
15553 fi
15554 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
15555$as_echo "$gl_have_mmap_anonymous" >&6; }
15556 if test $gl_have_mmap_anonymous = yes; then
6ec2e0f5 15557
c0c3707f 15558$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
6ec2e0f5 15559
c0c3707f
CB
15560 fi
15561 fi
6ec2e0f5
SDJ
15562
15563
15564
15565
6ec2e0f5 15566
9c9d63b1
PM
15567 # Detect platform-specific bugs in some versions of glibc:
15568 # memchr should not dereference anything with length 0
15569 # https://bugzilla.redhat.com/show_bug.cgi?id=499689
15570 # memchr should not dereference overestimated length after a match
15571 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
15572 # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
15573 # memchr should cast the second argument to 'unsigned char'.
15574 # This bug exists in Android 4.3.
15575 # Assume that memchr works on platforms that lack mprotect.
15576 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
c0c3707f
CB
15577$as_echo_n "checking whether memchr works... " >&6; }
15578if ${gl_cv_func_memchr_works+:} false; then :
15579 $as_echo_n "(cached) " >&6
6ec2e0f5 15580else
c0c3707f
CB
15581 if test "$cross_compiling" = yes; then :
15582 case "$host_os" in
9c9d63b1
PM
15583 # Guess no on Android.
15584 linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
15585 # Guess yes on native Windows.
15586 mingw*) gl_cv_func_memchr_works="guessing yes" ;;
15587 # If we don't know, obey --enable-cross-guesses.
15588 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
15589 esac
6ec2e0f5
SDJ
15590
15591else
15592 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15593/* end confdefs.h. */
15594
c0c3707f
CB
15595#include <string.h>
15596#if HAVE_SYS_MMAN_H
15597# include <fcntl.h>
15598# include <unistd.h>
15599# include <sys/types.h>
15600# include <sys/mman.h>
15601# ifndef MAP_FILE
15602# define MAP_FILE 0
15603# endif
15604#endif
6ec2e0f5
SDJ
15605
15606int
15607main ()
15608{
c0c3707f
CB
15609
15610 int result = 0;
15611 char *fence = NULL;
15612#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
15613# if HAVE_MAP_ANONYMOUS
15614 const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
15615 const int fd = -1;
15616# else /* !HAVE_MAP_ANONYMOUS */
15617 const int flags = MAP_FILE | MAP_PRIVATE;
15618 int fd = open ("/dev/zero", O_RDONLY, 0666);
15619 if (fd >= 0)
15620# endif
15621 {
15622 int pagesize = getpagesize ();
15623 char *two_pages =
15624 (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
15625 flags, fd, 0);
15626 if (two_pages != (char *)(-1)
15627 && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
15628 fence = two_pages + pagesize;
15629 }
15630#endif
15631 if (fence)
15632 {
9c9d63b1 15633 /* Test against bugs on glibc systems. */
c0c3707f
CB
15634 if (memchr (fence, 0, 0))
15635 result |= 1;
15636 strcpy (fence - 9, "12345678");
15637 if (memchr (fence - 9, 0, 79) != fence - 1)
15638 result |= 2;
15639 if (memchr (fence - 1, 0, 3) != fence - 1)
15640 result |= 4;
9c9d63b1
PM
15641 /* Test against bug on AIX 7.2. */
15642 if (memchr (fence - 4, '6', 16) != fence - 4)
15643 result |= 8;
c0c3707f
CB
15644 }
15645 /* Test against bug on Android 4.3. */
15646 {
15647 char input[3];
15648 input[0] = 'a';
15649 input[1] = 'b';
15650 input[2] = 'c';
15651 if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
9c9d63b1 15652 result |= 16;
c0c3707f
CB
15653 }
15654 return result;
6ec2e0f5
SDJ
15655
15656 ;
15657 return 0;
15658}
15659_ACEOF
15660if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 15661 gl_cv_func_memchr_works=yes
6ec2e0f5 15662else
c0c3707f 15663 gl_cv_func_memchr_works=no
6ec2e0f5
SDJ
15664fi
15665rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15666 conftest.$ac_objext conftest.beam conftest.$ac_ext
15667fi
15668
15669
15670fi
c0c3707f
CB
15671{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
15672$as_echo "$gl_cv_func_memchr_works" >&6; }
9c9d63b1
PM
15673 case "$gl_cv_func_memchr_works" in
15674 *yes) ;;
15675 *) REPLACE_MEMCHR=1 ;;
15676 esac
6ec2e0f5 15677
c0c3707f
CB
15678ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default"
15679if test "x$ac_cv_have_decl_memmem" = xyes; then :
6ec2e0f5
SDJ
15680 ac_have_decl=1
15681else
15682 ac_have_decl=0
15683fi
15684
15685cat >>confdefs.h <<_ACEOF
c0c3707f 15686#define HAVE_DECL_MEMMEM $ac_have_decl
6ec2e0f5
SDJ
15687_ACEOF
15688
472fa5ee 15689
6ec2e0f5
SDJ
15690
15691
15692
c0c3707f
CB
15693 for ac_func in memmem
15694do :
15695 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
15696if test "x$ac_cv_func_memmem" = xyes; then :
15697 cat >>confdefs.h <<_ACEOF
15698#define HAVE_MEMMEM 1
15699_ACEOF
6ec2e0f5 15700
c0c3707f
CB
15701fi
15702done
6ec2e0f5 15703
c0c3707f
CB
15704 if test $ac_cv_func_memmem = yes; then
15705 HAVE_MEMMEM=1
15706 else
15707 HAVE_MEMMEM=0
15708 fi
6ec2e0f5 15709
c0c3707f
CB
15710 if test $ac_cv_have_decl_memmem = no; then
15711 HAVE_DECL_MEMMEM=0
15712 else
15713 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
15714$as_echo_n "checking whether memmem works... " >&6; }
15715if ${gl_cv_func_memmem_works_always+:} false; then :
6ec2e0f5
SDJ
15716 $as_echo_n "(cached) " >&6
15717else
c0c3707f
CB
15718 if test "$cross_compiling" = yes; then :
15719 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 15720/* end confdefs.h. */
472fa5ee 15721
c0c3707f
CB
15722#ifdef __GNU_LIBRARY__
15723 #include <features.h>
15724 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
15725 || __GLIBC_MINOR__ > 12)) \
15726 || (__GLIBC__ > 2)) \
15727 || defined __UCLIBC__
15728 Lucky user
15729 #endif
15730#elif defined __CYGWIN__
15731 #include <cygwin/version.h>
15732 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
15733 Lucky user
15734 #endif
15735#else
15736 Lucky user
15737#endif
472fa5ee 15738
c0c3707f
CB
15739_ACEOF
15740if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15741 $EGREP "Lucky user" >/dev/null 2>&1; then :
15742 gl_cv_func_memmem_works_always="guessing yes"
15743else
15744 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
15745fi
15746rm -f conftest*
472fa5ee
SM
15747
15748
6ec2e0f5
SDJ
15749else
15750 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15751/* end confdefs.h. */
c0c3707f
CB
15752
15753#include <string.h> /* for memmem */
15754#define P "_EF_BF_BD"
15755#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
15756#define NEEDLE P P P P P
6ec2e0f5
SDJ
15757
15758int
15759main ()
15760{
c0c3707f 15761
698be2d8
CB
15762 int result = 0;
15763 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
15764 result |= 1;
15765 /* Check for empty needle behavior. */
15766 {
15767 const char *haystack = "AAA";
15768 if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
15769 result |= 2;
15770 }
15771 return result;
15772
15773 ;
15774 return 0;
15775}
15776_ACEOF
15777if ac_fn_c_try_run "$LINENO"; then :
15778 gl_cv_func_memmem_works_always=yes
15779else
15780 gl_cv_func_memmem_works_always=no
15781fi
15782rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15783 conftest.$ac_objext conftest.beam conftest.$ac_ext
15784fi
15785
15786
15787fi
15788{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
15789$as_echo "$gl_cv_func_memmem_works_always" >&6; }
15790 case "$gl_cv_func_memmem_works_always" in
15791 *yes) ;;
15792 *)
15793 REPLACE_MEMMEM=1
15794 ;;
15795 esac
15796 fi
15797 :
15798
15799ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
15800if test "x$ac_cv_have_decl_memrchr" = xyes; then :
15801 ac_have_decl=1
15802else
15803 ac_have_decl=0
15804fi
15805
15806cat >>confdefs.h <<_ACEOF
15807#define HAVE_DECL_MEMRCHR $ac_have_decl
15808_ACEOF
15809
15810
15811
15812
15813
15814 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5
15815$as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; }
15816if ${gl_cv_minmax_in_limits_h+:} false; then :
15817 $as_echo_n "(cached) " >&6
15818else
15819 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15820/* end confdefs.h. */
15821#include <limits.h>
15822 int x = MIN (42, 17);
15823int
15824main ()
15825{
15826
15827 ;
15828 return 0;
15829}
15830_ACEOF
15831if ac_fn_c_try_compile "$LINENO"; then :
15832 gl_cv_minmax_in_limits_h=yes
15833else
15834 gl_cv_minmax_in_limits_h=no
15835fi
15836rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15837fi
15838{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5
15839$as_echo "$gl_cv_minmax_in_limits_h" >&6; }
15840 if test $gl_cv_minmax_in_limits_h = yes; then
15841
15842$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h
15843
15844 fi
15845
15846
15847
15848
15849
15850
15851 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5
15852$as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; }
15853if ${gl_cv_minmax_in_sys_param_h+:} false; then :
15854 $as_echo_n "(cached) " >&6
15855else
15856 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15857/* end confdefs.h. */
15858#include <sys/param.h>
15859 int x = MIN (42, 17);
15860int
15861main ()
15862{
15863
6ec2e0f5
SDJ
15864 ;
15865 return 0;
15866}
15867_ACEOF
698be2d8
CB
15868if ac_fn_c_try_compile "$LINENO"; then :
15869 gl_cv_minmax_in_sys_param_h=yes
6ec2e0f5 15870else
698be2d8 15871 gl_cv_minmax_in_sys_param_h=no
6ec2e0f5 15872fi
698be2d8 15873rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 15874fi
698be2d8
CB
15875{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5
15876$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; }
15877 if test $gl_cv_minmax_in_sys_param_h = yes; then
6ec2e0f5 15878
698be2d8 15879$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
c0c3707f 15880
c0c3707f 15881 fi
c0c3707f 15882
c0c3707f 15883
698be2d8 15884
c0c3707f
CB
15885
15886
15887
15888
15889
15890
15891
15892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
15893$as_echo_n "checking for O_CLOEXEC... " >&6; }
15894if ${gl_cv_macro_O_CLOEXEC+:} false; then :
6ec2e0f5
SDJ
15895 $as_echo_n "(cached) " >&6
15896else
15897 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15898/* end confdefs.h. */
c0c3707f
CB
15899#include <fcntl.h>
15900 #ifndef O_CLOEXEC
15901 choke me;
15902 #endif
6ec2e0f5
SDJ
15903
15904int
15905main ()
15906{
c0c3707f 15907return O_CLOEXEC;
6ec2e0f5
SDJ
15908 ;
15909 return 0;
15910}
15911_ACEOF
15912if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 15913 gl_cv_macro_O_CLOEXEC=yes
6ec2e0f5 15914else
c0c3707f 15915 gl_cv_macro_O_CLOEXEC=no
6ec2e0f5
SDJ
15916fi
15917rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15918fi
c0c3707f
CB
15919{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
15920$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
15921
15922
15923
15924 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
15925$as_echo_n "checking for promoted mode_t type... " >&6; }
15926if ${gl_cv_promoted_mode_t+:} false; then :
6ec2e0f5
SDJ
15927 $as_echo_n "(cached) " >&6
15928else
6ec2e0f5 15929
c0c3707f
CB
15930 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15931/* end confdefs.h. */
15932#include <sys/types.h>
6ec2e0f5
SDJ
15933int
15934main ()
15935{
c0c3707f 15936typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
6ec2e0f5
SDJ
15937 ;
15938 return 0;
15939}
15940_ACEOF
15941if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 15942 gl_cv_promoted_mode_t='int'
6ec2e0f5 15943else
c0c3707f 15944 gl_cv_promoted_mode_t='mode_t'
6ec2e0f5
SDJ
15945fi
15946rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 15947
6ec2e0f5 15948fi
c0c3707f
CB
15949{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
15950$as_echo "$gl_cv_promoted_mode_t" >&6; }
6ec2e0f5 15951
c0c3707f
CB
15952cat >>confdefs.h <<_ACEOF
15953#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
6ec2e0f5 15954_ACEOF
c0c3707f
CB
15955
15956
15957
15958
15959
9c9d63b1
PM
15960
15961
15962
15963
c0c3707f
CB
15964 GNULIB_DPRINTF=0;
15965 GNULIB_FCLOSE=0;
15966 GNULIB_FDOPEN=0;
15967 GNULIB_FFLUSH=0;
15968 GNULIB_FGETC=0;
15969 GNULIB_FGETS=0;
15970 GNULIB_FOPEN=0;
15971 GNULIB_FPRINTF=0;
15972 GNULIB_FPRINTF_POSIX=0;
15973 GNULIB_FPURGE=0;
15974 GNULIB_FPUTC=0;
15975 GNULIB_FPUTS=0;
15976 GNULIB_FREAD=0;
15977 GNULIB_FREOPEN=0;
15978 GNULIB_FSCANF=0;
15979 GNULIB_FSEEK=0;
15980 GNULIB_FSEEKO=0;
15981 GNULIB_FTELL=0;
15982 GNULIB_FTELLO=0;
15983 GNULIB_FWRITE=0;
15984 GNULIB_GETC=0;
15985 GNULIB_GETCHAR=0;
15986 GNULIB_GETDELIM=0;
15987 GNULIB_GETLINE=0;
15988 GNULIB_OBSTACK_PRINTF=0;
15989 GNULIB_OBSTACK_PRINTF_POSIX=0;
15990 GNULIB_PCLOSE=0;
15991 GNULIB_PERROR=0;
15992 GNULIB_POPEN=0;
15993 GNULIB_PRINTF=0;
15994 GNULIB_PRINTF_POSIX=0;
15995 GNULIB_PUTC=0;
15996 GNULIB_PUTCHAR=0;
15997 GNULIB_PUTS=0;
15998 GNULIB_REMOVE=0;
15999 GNULIB_RENAME=0;
16000 GNULIB_RENAMEAT=0;
16001 GNULIB_SCANF=0;
16002 GNULIB_SNPRINTF=0;
16003 GNULIB_SPRINTF_POSIX=0;
16004 GNULIB_STDIO_H_NONBLOCKING=0;
16005 GNULIB_STDIO_H_SIGPIPE=0;
16006 GNULIB_TMPFILE=0;
16007 GNULIB_VASPRINTF=0;
16008 GNULIB_VFSCANF=0;
16009 GNULIB_VSCANF=0;
16010 GNULIB_VDPRINTF=0;
16011 GNULIB_VFPRINTF=0;
16012 GNULIB_VFPRINTF_POSIX=0;
16013 GNULIB_VPRINTF=0;
16014 GNULIB_VPRINTF_POSIX=0;
16015 GNULIB_VSNPRINTF=0;
16016 GNULIB_VSPRINTF_POSIX=0;
9c9d63b1
PM
16017 GNULIB_MDA_FCLOSEALL=1;
16018 GNULIB_MDA_FDOPEN=1;
16019 GNULIB_MDA_FILENO=1;
16020 GNULIB_MDA_GETW=1;
16021 GNULIB_MDA_PUTW=1;
16022 GNULIB_MDA_TEMPNAM=1;
16023 HAVE_DECL_FCLOSEALL=1;
16024 HAVE_DECL_FPURGE=1;
c0c3707f
CB
16025 HAVE_DECL_FSEEKO=1;
16026 HAVE_DECL_FTELLO=1;
16027 HAVE_DECL_GETDELIM=1;
16028 HAVE_DECL_GETLINE=1;
16029 HAVE_DECL_OBSTACK_PRINTF=1;
16030 HAVE_DECL_SNPRINTF=1;
16031 HAVE_DECL_VSNPRINTF=1;
16032 HAVE_DPRINTF=1;
16033 HAVE_FSEEKO=1;
16034 HAVE_FTELLO=1;
16035 HAVE_PCLOSE=1;
16036 HAVE_POPEN=1;
16037 HAVE_RENAMEAT=1;
16038 HAVE_VASPRINTF=1;
16039 HAVE_VDPRINTF=1;
16040 REPLACE_DPRINTF=0;
16041 REPLACE_FCLOSE=0;
16042 REPLACE_FDOPEN=0;
16043 REPLACE_FFLUSH=0;
16044 REPLACE_FOPEN=0;
16045 REPLACE_FPRINTF=0;
16046 REPLACE_FPURGE=0;
16047 REPLACE_FREOPEN=0;
16048 REPLACE_FSEEK=0;
16049 REPLACE_FSEEKO=0;
16050 REPLACE_FTELL=0;
16051 REPLACE_FTELLO=0;
16052 REPLACE_GETDELIM=0;
16053 REPLACE_GETLINE=0;
16054 REPLACE_OBSTACK_PRINTF=0;
16055 REPLACE_PERROR=0;
16056 REPLACE_POPEN=0;
16057 REPLACE_PRINTF=0;
16058 REPLACE_REMOVE=0;
16059 REPLACE_RENAME=0;
16060 REPLACE_RENAMEAT=0;
16061 REPLACE_SNPRINTF=0;
16062 REPLACE_SPRINTF=0;
16063 REPLACE_STDIO_READ_FUNCS=0;
16064 REPLACE_STDIO_WRITE_FUNCS=0;
16065 REPLACE_TMPFILE=0;
16066 REPLACE_VASPRINTF=0;
16067 REPLACE_VDPRINTF=0;
16068 REPLACE_VFPRINTF=0;
16069 REPLACE_VPRINTF=0;
16070 REPLACE_VSNPRINTF=0;
16071 REPLACE_VSPRINTF=0;
16072
16073
16074
16075ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
16076if test "x$ac_cv_have_decl_setenv" = xyes; then :
16077 ac_have_decl=1
6ec2e0f5 16078else
c0c3707f 16079 ac_have_decl=0
6ec2e0f5 16080fi
c0c3707f
CB
16081
16082cat >>confdefs.h <<_ACEOF
16083#define HAVE_DECL_SETENV $ac_have_decl
16084_ACEOF
16085
16086
16087
16088
16089
16090
16091 if test $ac_cv_have_decl_setenv = no; then
16092 HAVE_DECL_SETENV=0
6ec2e0f5
SDJ
16093 fi
16094
16095
16096
16097
16098
c0c3707f
CB
16099 for ac_header in search.h
16100do :
16101 ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
16102if test "x$ac_cv_header_search_h" = xyes; then :
16103 cat >>confdefs.h <<_ACEOF
16104#define HAVE_SEARCH_H 1
16105_ACEOF
6ec2e0f5 16106
c0c3707f 16107fi
6ec2e0f5 16108
c0c3707f 16109done
6ec2e0f5 16110
c0c3707f
CB
16111 for ac_func in tsearch
16112do :
16113 ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
16114if test "x$ac_cv_func_tsearch" = xyes; then :
16115 cat >>confdefs.h <<_ACEOF
16116#define HAVE_TSEARCH 1
16117_ACEOF
6ec2e0f5 16118
c0c3707f
CB
16119fi
16120done
6ec2e0f5
SDJ
16121
16122
16123
16124
c0c3707f
CB
16125 GNULIB_PTHREAD_SIGMASK=0;
16126 GNULIB_RAISE=0;
16127 GNULIB_SIGNAL_H_SIGPIPE=0;
16128 GNULIB_SIGPROCMASK=0;
16129 GNULIB_SIGACTION=0;
16130 HAVE_POSIX_SIGNALBLOCKING=1;
16131 HAVE_PTHREAD_SIGMASK=1;
16132 HAVE_RAISE=1;
16133 HAVE_SIGSET_T=1;
16134 HAVE_SIGINFO_T=1;
16135 HAVE_SIGACTION=1;
16136 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
6ec2e0f5 16137
c0c3707f 16138 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
6ec2e0f5 16139
c0c3707f
CB
16140 HAVE_SIGHANDLER_T=1;
16141 REPLACE_PTHREAD_SIGMASK=0;
16142 REPLACE_RAISE=0;
6ec2e0f5 16143
6ec2e0f5 16144
c0c3707f
CB
16145 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
16146 #include <signal.h>
16147 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
16148 #include <sys/types.h>
16149
16150"
16151if test "x$ac_cv_type_sigset_t" = xyes; then :
16152
16153cat >>confdefs.h <<_ACEOF
16154#define HAVE_SIGSET_T 1
16155_ACEOF
16156
16157gl_cv_type_sigset_t=yes
16158else
16159 gl_cv_type_sigset_t=no
16160fi
6ec2e0f5 16161
c0c3707f
CB
16162 if test $gl_cv_type_sigset_t != yes; then
16163 HAVE_SIGSET_T=0
16164 fi
6ec2e0f5 16165
c0c3707f
CB
16166{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
16167$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
16168if ${ac_cv_type_uid_t+:} false; then :
16169 $as_echo_n "(cached) " >&6
16170else
6ec2e0f5
SDJ
16171 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16172/* end confdefs.h. */
c0c3707f
CB
16173#include <sys/types.h>
16174
6ec2e0f5 16175_ACEOF
c0c3707f
CB
16176if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16177 $EGREP "uid_t" >/dev/null 2>&1; then :
16178 ac_cv_type_uid_t=yes
16179else
16180 ac_cv_type_uid_t=no
16181fi
16182rm -f conftest*
6ec2e0f5 16183
c0c3707f
CB
16184fi
16185{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
16186$as_echo "$ac_cv_type_uid_t" >&6; }
16187if test $ac_cv_type_uid_t = no; then
6ec2e0f5 16188
c0c3707f 16189$as_echo "#define uid_t int" >>confdefs.h
6ec2e0f5 16190
6ec2e0f5 16191
c0c3707f 16192$as_echo "#define gid_t int" >>confdefs.h
6ec2e0f5
SDJ
16193
16194fi
6ec2e0f5 16195
c0c3707f
CB
16196{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
16197$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
16198if ${ac_cv_header_stdbool_h+:} false; then :
16199 $as_echo_n "(cached) " >&6
16200else
16201 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16202/* end confdefs.h. */
16203
16204 #include <stdbool.h>
16205
16206 #ifdef __cplusplus
16207 typedef bool Bool;
16208 #else
16209 typedef _Bool Bool;
16210 #ifndef bool
16211 "error: bool is not defined"
16212 #endif
16213 #ifndef false
16214 "error: false is not defined"
16215 #endif
16216 #if false
16217 "error: false is not 0"
16218 #endif
16219 #ifndef true
16220 "error: true is not defined"
16221 #endif
16222 #if true != 1
16223 "error: true is not 1"
16224 #endif
16225 #endif
16226
16227 #ifndef __bool_true_false_are_defined
16228 "error: __bool_true_false_are_defined is not defined"
16229 #endif
16230
16231 struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
16232
16233 char a[true == 1 ? 1 : -1];
16234 char b[false == 0 ? 1 : -1];
16235 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
16236 char d[(bool) 0.5 == true ? 1 : -1];
16237 /* See body of main program for 'e'. */
16238 char f[(Bool) 0.0 == false ? 1 : -1];
16239 char g[true];
16240 char h[sizeof (Bool)];
16241 char i[sizeof s.t];
16242 enum { j = false, k = true, l = false * true, m = true * 256 };
16243 /* The following fails for
16244 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
16245 Bool n[m];
16246 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
16247 char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
16248 /* Catch a bug in an HP-UX C compiler. See
16249 https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
16250 https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
16251 */
16252 Bool q = true;
16253 Bool *pq = &q;
16254 bool *qq = &q;
6ec2e0f5 16255
c0c3707f
CB
16256int
16257main ()
16258{
6ec2e0f5 16259
c0c3707f
CB
16260 bool e = &s;
16261 *pq |= q; *pq |= ! q;
16262 *qq |= q; *qq |= ! q;
16263 /* Refer to every declared value, to avoid compiler optimizations. */
16264 return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
16265 + !m + !n + !o + !p + !q + !pq + !qq);
6ec2e0f5 16266
c0c3707f
CB
16267 ;
16268 return 0;
16269}
16270_ACEOF
16271if ac_fn_c_try_compile "$LINENO"; then :
16272 ac_cv_header_stdbool_h=yes
16273else
16274 ac_cv_header_stdbool_h=no
16275fi
16276rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16277fi
16278{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
16279$as_echo "$ac_cv_header_stdbool_h" >&6; }
16280 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
16281if test "x$ac_cv_type__Bool" = xyes; then :
6ec2e0f5 16282
c0c3707f
CB
16283cat >>confdefs.h <<_ACEOF
16284#define HAVE__BOOL 1
16285_ACEOF
6ec2e0f5
SDJ
16286
16287
c0c3707f 16288fi
6ec2e0f5
SDJ
16289
16290
9c9d63b1
PM
16291ac_fn_c_check_decl "$LINENO" "fcloseall" "ac_cv_have_decl_fcloseall" "$ac_includes_default"
16292if test "x$ac_cv_have_decl_fcloseall" = xyes; then :
16293 ac_have_decl=1
16294else
16295 ac_have_decl=0
16296fi
16297
16298cat >>confdefs.h <<_ACEOF
16299#define HAVE_DECL_FCLOSEALL $ac_have_decl
16300_ACEOF
16301
16302ac_fn_c_check_decl "$LINENO" "ecvt" "ac_cv_have_decl_ecvt" "$ac_includes_default"
16303if test "x$ac_cv_have_decl_ecvt" = xyes; then :
16304 ac_have_decl=1
16305else
16306 ac_have_decl=0
16307fi
16308
16309cat >>confdefs.h <<_ACEOF
16310#define HAVE_DECL_ECVT $ac_have_decl
16311_ACEOF
16312
16313ac_fn_c_check_decl "$LINENO" "fcvt" "ac_cv_have_decl_fcvt" "$ac_includes_default"
16314if test "x$ac_cv_have_decl_fcvt" = xyes; then :
16315 ac_have_decl=1
16316else
16317 ac_have_decl=0
16318fi
16319
16320cat >>confdefs.h <<_ACEOF
16321#define HAVE_DECL_FCVT $ac_have_decl
16322_ACEOF
16323
16324ac_fn_c_check_decl "$LINENO" "gcvt" "ac_cv_have_decl_gcvt" "$ac_includes_default"
16325if test "x$ac_cv_have_decl_gcvt" = xyes; then :
16326 ac_have_decl=1
16327else
16328 ac_have_decl=0
16329fi
472fa5ee 16330
9c9d63b1
PM
16331cat >>confdefs.h <<_ACEOF
16332#define HAVE_DECL_GCVT $ac_have_decl
16333_ACEOF
f8e27d88 16334
c0c3707f
CB
16335ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
16336if test "x$ac_cv_have_decl_strdup" = xyes; then :
6ec2e0f5
SDJ
16337 ac_have_decl=1
16338else
16339 ac_have_decl=0
16340fi
16341
16342cat >>confdefs.h <<_ACEOF
c0c3707f 16343#define HAVE_DECL_STRDUP $ac_have_decl
6ec2e0f5
SDJ
16344_ACEOF
16345
16346
c0c3707f
CB
16347 REPLACE_STRERROR_0=0
16348 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
16349$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
16350if ${gl_cv_func_strerror_0_works+:} false; then :
6ec2e0f5
SDJ
16351 $as_echo_n "(cached) " >&6
16352else
c0c3707f
CB
16353 if test "$cross_compiling" = yes; then :
16354 case "$host_os" in
16355 # Guess yes on glibc systems.
16356 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
16357 # Guess yes on musl systems.
16358 *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
16359 # Guess yes on native Windows.
16360 mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
16361 # If we don't know, obey --enable-cross-guesses.
16362 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
16363 esac
6ec2e0f5 16364
5e8754f9
SDJ
16365else
16366 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16367/* end confdefs.h. */
c0c3707f
CB
16368#include <string.h>
16369 #include <errno.h>
6ec2e0f5 16370
5e8754f9
SDJ
16371int
16372main ()
16373{
c0c3707f
CB
16374int result = 0;
16375 char *str;
16376 errno = 0;
16377 str = strerror (0);
16378 if (!*str) result |= 1;
16379 if (errno) result |= 2;
16380 if (strstr (str, "nknown") || strstr (str, "ndefined"))
16381 result |= 4;
16382 return result;
5e8754f9
SDJ
16383 ;
16384 return 0;
16385}
16386_ACEOF
c0c3707f
CB
16387if ac_fn_c_try_run "$LINENO"; then :
16388 gl_cv_func_strerror_0_works=yes
5e8754f9 16389else
c0c3707f 16390 gl_cv_func_strerror_0_works=no
5e8754f9 16391fi
c0c3707f
CB
16392rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16393 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 16394fi
6ec2e0f5 16395
6ec2e0f5 16396
c0c3707f
CB
16397fi
16398{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
16399$as_echo "$gl_cv_func_strerror_0_works" >&6; }
16400 case "$gl_cv_func_strerror_0_works" in
16401 *yes) ;;
16402 *)
16403 REPLACE_STRERROR_0=1
6ec2e0f5 16404
c0c3707f 16405$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
6ec2e0f5 16406
c0c3707f
CB
16407 ;;
16408 esac
6ec2e0f5
SDJ
16409
16410
16411
16412
472fa5ee
SM
16413
16414
16415
725e2999 16416
725e2999
JB
16417
16418
c0c3707f
CB
16419 if test $ac_cv_func_strerror_r = yes; then
16420 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
16421 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
16422$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
16423if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
16424 $as_echo_n "(cached) " >&6
16425else
16426 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16427/* end confdefs.h. */
16428#include <string.h>
16429 int strerror_r (int, char *, size_t);
725e2999 16430
c0c3707f
CB
16431int
16432main ()
16433{
725e2999 16434
c0c3707f
CB
16435 ;
16436 return 0;
16437}
16438_ACEOF
16439if ac_fn_c_try_compile "$LINENO"; then :
16440 gl_cv_func_strerror_r_posix_signature=yes
16441else
16442 gl_cv_func_strerror_r_posix_signature=no
16443fi
16444rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
725e2999 16445
c0c3707f
CB
16446fi
16447{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
16448$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
16449 if test $gl_cv_func_strerror_r_posix_signature = yes; then
16450 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
16451$as_echo_n "checking whether strerror_r works... " >&6; }
16452if ${gl_cv_func_strerror_r_works+:} false; then :
16453 $as_echo_n "(cached) " >&6
16454else
16455 if test "$cross_compiling" = yes; then :
725e2999 16456
c0c3707f
CB
16457 case "$host_os" in
16458 # Guess no on AIX.
16459 aix*) gl_cv_func_strerror_r_works="guessing no";;
16460 # Guess no on HP-UX.
16461 hpux*) gl_cv_func_strerror_r_works="guessing no";;
16462 # Guess no on BSD variants.
16463 *bsd*) gl_cv_func_strerror_r_works="guessing no";;
16464 # Guess yes otherwise.
16465 *) gl_cv_func_strerror_r_works="guessing yes";;
16466 esac
725e2999 16467
c0c3707f
CB
16468else
16469 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16470/* end confdefs.h. */
16471#include <errno.h>
16472 #include <string.h>
725e2999 16473
c0c3707f
CB
16474int
16475main ()
16476{
16477int result = 0;
16478 char buf[79];
16479 if (strerror_r (EACCES, buf, 0) < 0)
16480 result |= 1;
16481 errno = 0;
16482 if (strerror_r (EACCES, buf, sizeof buf) != 0)
16483 result |= 2;
16484 strcpy (buf, "Unknown");
16485 if (strerror_r (0, buf, sizeof buf) != 0)
16486 result |= 4;
16487 if (errno)
16488 result |= 8;
16489 if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
16490 result |= 0x10;
16491 errno = 0;
16492 *buf = 0;
16493 if (strerror_r (-3, buf, sizeof buf) < 0)
16494 result |= 0x20;
16495 if (errno)
16496 result |= 0x40;
16497 if (!*buf)
16498 result |= 0x80;
16499 return result;
725e2999 16500
c0c3707f
CB
16501 ;
16502 return 0;
16503}
16504_ACEOF
16505if ac_fn_c_try_run "$LINENO"; then :
16506 gl_cv_func_strerror_r_works=yes
16507else
16508 gl_cv_func_strerror_r_works=no
16509fi
16510rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16511 conftest.$ac_objext conftest.beam conftest.$ac_ext
16512fi
725e2999
JB
16513
16514
c0c3707f
CB
16515fi
16516{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16517$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16518 else
725e2999 16519
c0c3707f
CB
16520 if test $ac_cv_func___xpg_strerror_r = yes; then
16521 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
16522$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
16523if ${gl_cv_func_strerror_r_works+:} false; then :
725e2999
JB
16524 $as_echo_n "(cached) " >&6
16525else
c0c3707f
CB
16526 if test "$cross_compiling" = yes; then :
16527 gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
725e2999 16528
c0c3707f
CB
16529else
16530 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
725e2999 16531/* end confdefs.h. */
c0c3707f
CB
16532#include <errno.h>
16533 #include <string.h>
16534 extern
16535 #ifdef __cplusplus
16536 "C"
16537 #endif
16538 int __xpg_strerror_r(int, char *, size_t);
725e2999 16539
c0c3707f
CB
16540int
16541main ()
16542{
16543int result = 0;
16544 char buf[256] = "^";
16545 char copy[256];
16546 char *str = strerror (-1);
16547 strcpy (copy, str);
16548 if (__xpg_strerror_r (-2, buf, 1) == 0)
16549 result |= 1;
16550 if (*buf)
16551 result |= 2;
16552 __xpg_strerror_r (-2, buf, 256);
16553 if (strcmp (str, copy))
16554 result |= 4;
16555 return result;
725e2999 16556
c0c3707f
CB
16557 ;
16558 return 0;
16559}
725e2999 16560_ACEOF
c0c3707f
CB
16561if ac_fn_c_try_run "$LINENO"; then :
16562 gl_cv_func_strerror_r_works=yes
725e2999 16563else
c0c3707f 16564 gl_cv_func_strerror_r_works=no
725e2999 16565fi
c0c3707f
CB
16566rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16567 conftest.$ac_objext conftest.beam conftest.$ac_ext
725e2999 16568fi
725e2999 16569
725e2999 16570
c0c3707f
CB
16571fi
16572{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
16573$as_echo "$gl_cv_func_strerror_r_works" >&6; }
16574 fi
16575 fi
725e2999 16576 fi
725e2999
JB
16577 fi
16578
c0c3707f
CB
16579ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
16580if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
16581 ac_have_decl=1
725e2999 16582else
c0c3707f 16583 ac_have_decl=0
725e2999
JB
16584fi
16585
c0c3707f
CB
16586cat >>confdefs.h <<_ACEOF
16587#define HAVE_DECL_STRERROR_R $ac_have_decl
16588_ACEOF
725e2999
JB
16589
16590
16591
16592
16593
725e2999
JB
16594
16595
16596
725e2999
JB
16597
16598
16599
16600
16601
16602
16603
725e2999 16604 if test $gl_cv_have_include_next = yes; then
c0c3707f 16605 gl_cv_next_string_h='<'string.h'>'
725e2999 16606 else
c0c3707f
CB
16607 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
16608$as_echo_n "checking absolute name of <string.h>... " >&6; }
16609if ${gl_cv_next_string_h+:} false; then :
725e2999
JB
16610 $as_echo_n "(cached) " >&6
16611else
16612
725e2999
JB
16613
16614
16615 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16616/* end confdefs.h. */
c0c3707f 16617#include <string.h>
725e2999
JB
16618_ACEOF
16619 case "$host_os" in
16620 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16621 *) gl_absname_cpp="$ac_cpp" ;;
16622 esac
16623
16624 case "$host_os" in
16625 mingw*)
16626 gl_dirsep_regex='[/\\]'
16627 ;;
16628 *)
16629 gl_dirsep_regex='\/'
16630 ;;
16631 esac
16632 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 16633 gl_header_literal_regex=`echo 'string.h' \
725e2999
JB
16634 | sed -e "$gl_make_literal_regex_sed"`
16635 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16636 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16637 s|^/[^/]|//&|
16638 p
16639 q
16640 }'
6ec2e0f5 16641
c0c3707f 16642 gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
725e2999 16643 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16644
c0c3707f
CB
16645 gl_header=$gl_cv_absolute_string_h
16646 gl_cv_next_string_h='"'$gl_header'"'
6ec2e0f5
SDJ
16647
16648
725e2999 16649fi
c0c3707f
CB
16650{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
16651$as_echo "$gl_cv_next_string_h" >&6; }
725e2999 16652 fi
c0c3707f 16653 NEXT_STRING_H=$gl_cv_next_string_h
6ec2e0f5 16654
725e2999
JB
16655 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16656 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 16657 gl_next_as_first_directive='<'string.h'>'
725e2999
JB
16658 else
16659 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 16660 gl_next_as_first_directive=$gl_cv_next_string_h
725e2999 16661 fi
c0c3707f
CB
16662 NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
16663
16664
16665
6ec2e0f5
SDJ
16666
16667
16668
16669
16670
6ec2e0f5
SDJ
16671
16672
6ec2e0f5 16673
698be2d8
CB
16674ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
16675if test "x$ac_cv_have_decl_strnlen" = xyes; then :
16676 ac_have_decl=1
16677else
16678 ac_have_decl=0
16679fi
16680
16681cat >>confdefs.h <<_ACEOF
16682#define HAVE_DECL_STRNLEN $ac_have_decl
16683_ACEOF
16684
16685
16686
c0c3707f 16687
9c9d63b1 16688 if test $REPLACE_MEMCHR = 1; then
c0c3707f
CB
16689 REPLACE_STRSTR=1
16690 else
16691 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
16692$as_echo_n "checking whether strstr works... " >&6; }
16693if ${gl_cv_func_strstr_works_always+:} false; then :
6ec2e0f5
SDJ
16694 $as_echo_n "(cached) " >&6
16695else
c0c3707f
CB
16696 if test "$cross_compiling" = yes; then :
16697 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
16698/* end confdefs.h. */
16699
c0c3707f
CB
16700#ifdef __GNU_LIBRARY__
16701 #include <features.h>
16702 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
16703 || defined __UCLIBC__
16704 Lucky user
16705 #endif
16706#elif defined __CYGWIN__
16707 #include <cygwin/version.h>
16708 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
16709 Lucky user
16710 #endif
16711#else
16712 Lucky user
6ec2e0f5 16713#endif
c0c3707f
CB
16714
16715_ACEOF
16716if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16717 $EGREP "Lucky user" >/dev/null 2>&1; then :
16718 gl_cv_func_strstr_works_always="guessing yes"
16719else
16720 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
16721fi
16722rm -f conftest*
16723
16724
16725else
16726 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16727/* end confdefs.h. */
16728
16729#include <string.h> /* for strstr */
16730#ifdef __GNU_LIBRARY__
16731 #include <features.h>
16732 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
16733 Unlucky user
16734 #endif
725e2999 16735#endif
c0c3707f
CB
16736#define P "_EF_BF_BD"
16737#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
16738#define NEEDLE P P P P P
6ec2e0f5 16739
725e2999
JB
16740int
16741main ()
16742{
c0c3707f
CB
16743return !!strstr (HAYSTACK, NEEDLE);
16744
725e2999
JB
16745 ;
16746 return 0;
16747}
6ec2e0f5 16748_ACEOF
c0c3707f
CB
16749if ac_fn_c_try_run "$LINENO"; then :
16750 gl_cv_func_strstr_works_always=yes
6ec2e0f5 16751else
c0c3707f 16752 gl_cv_func_strstr_works_always=no
6ec2e0f5 16753fi
c0c3707f
CB
16754rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16755 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 16756fi
6ec2e0f5
SDJ
16757
16758
c0c3707f
CB
16759fi
16760{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
16761$as_echo "$gl_cv_func_strstr_works_always" >&6; }
16762 case "$gl_cv_func_strstr_works_always" in
16763 *yes) ;;
16764 *)
16765 REPLACE_STRSTR=1
16766 ;;
16767 esac
16768 fi
6ec2e0f5 16769
c0c3707f
CB
16770ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default"
16771if test "x$ac_cv_have_decl_strtok_r" = xyes; then :
16772 ac_have_decl=1
16773else
16774 ac_have_decl=0
16775fi
6ec2e0f5 16776
c0c3707f
CB
16777cat >>confdefs.h <<_ACEOF
16778#define HAVE_DECL_STRTOK_R $ac_have_decl
16779_ACEOF
6ec2e0f5
SDJ
16780
16781
16782
16783
6ec2e0f5
SDJ
16784
16785
16786
16787
16788
16789
16790
698be2d8
CB
16791
16792
c0c3707f 16793$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
6ec2e0f5 16794
6ec2e0f5
SDJ
16795
16796
16797
16798
16799
6ec2e0f5
SDJ
16800
16801
16802
16803
16804
c0c3707f
CB
16805 if test $gl_cv_have_include_next = yes; then
16806 gl_cv_next_sys_types_h='<'sys/types.h'>'
16807 else
16808 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
16809$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
16810if ${gl_cv_next_sys_types_h+:} false; then :
6ec2e0f5
SDJ
16811 $as_echo_n "(cached) " >&6
16812else
6ec2e0f5 16813
6ec2e0f5 16814
c0c3707f
CB
16815
16816 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16817/* end confdefs.h. */
16818#include <sys/types.h>
6ec2e0f5 16819_ACEOF
c0c3707f
CB
16820 case "$host_os" in
16821 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16822 *) gl_absname_cpp="$ac_cpp" ;;
16823 esac
6ec2e0f5 16824
c0c3707f
CB
16825 case "$host_os" in
16826 mingw*)
16827 gl_dirsep_regex='[/\\]'
16828 ;;
16829 *)
16830 gl_dirsep_regex='\/'
16831 ;;
16832 esac
16833 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16834 gl_header_literal_regex=`echo 'sys/types.h' \
16835 | sed -e "$gl_make_literal_regex_sed"`
16836 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16837 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16838 s|^/[^/]|//&|
16839 p
16840 q
16841 }'
6ec2e0f5 16842
c0c3707f
CB
16843 gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16844 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16845
c0c3707f
CB
16846 gl_header=$gl_cv_absolute_sys_types_h
16847 gl_cv_next_sys_types_h='"'$gl_header'"'
6ec2e0f5
SDJ
16848
16849
c0c3707f
CB
16850fi
16851{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
16852$as_echo "$gl_cv_next_sys_types_h" >&6; }
16853 fi
16854 NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
6ec2e0f5 16855
c0c3707f
CB
16856 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16857 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16858 gl_next_as_first_directive='<'sys/types.h'>'
16859 else
16860 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16861 gl_next_as_first_directive=$gl_cv_next_sys_types_h
16862 fi
16863 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
16864
16865
16866
16867
6ec2e0f5 16868
6ec2e0f5
SDJ
16869
16870
6ec2e0f5
SDJ
16871
16872
16873
16874
16875
c0c3707f 16876 WINDOWS_STAT_INODES=0
6ec2e0f5
SDJ
16877
16878
16879
16880
16881
472fa5ee
SM
16882
16883
16884
9c9d63b1
PM
16885 GNULIB_CTIME=0;
16886 GNULIB_MKTIME=0;
16887 GNULIB_LOCALTIME=0;
16888 GNULIB_NANOSLEEP=0;
16889 GNULIB_STRFTIME=0;
16890 GNULIB_STRPTIME=0;
16891 GNULIB_TIMEGM=0;
16892 GNULIB_TIMESPEC_GET=0;
16893 GNULIB_TIME_R=0;
16894 GNULIB_TIME_RZ=0;
16895 GNULIB_TZSET=0;
16896 GNULIB_MDA_TZSET=1;
16897 HAVE_DECL_LOCALTIME_R=1;
16898 HAVE_NANOSLEEP=1;
16899 HAVE_STRPTIME=1;
16900 HAVE_TIMEGM=1;
16901 HAVE_TIMESPEC_GET=1;
16902 HAVE_TIMEZONE_T=0;
16903 REPLACE_CTIME=GNULIB_PORTCHECK;
16904 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
16905 REPLACE_MKTIME=GNULIB_PORTCHECK;
16906 REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
16907 REPLACE_STRFTIME=GNULIB_PORTCHECK;
16908 REPLACE_TIMEGM=GNULIB_PORTCHECK;
16909 REPLACE_TZSET=GNULIB_PORTCHECK;
16910
16911 : ${GNULIB_GETTIMEOFDAY=0};
16912 REPLACE_GMTIME=0;
16913 REPLACE_LOCALTIME=0;
16914
16915
472fa5ee 16916
c0c3707f
CB
16917 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
16918$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
16919if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
16920 $as_echo_n "(cached) " >&6
16921else
16922 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16923/* end confdefs.h. */
16924#include <time.h>
472fa5ee 16925
c0c3707f
CB
16926int
16927main ()
16928{
16929static struct timespec x; x.tv_sec = x.tv_nsec;
16930 ;
16931 return 0;
16932}
6ec2e0f5 16933_ACEOF
c0c3707f
CB
16934if ac_fn_c_try_compile "$LINENO"; then :
16935 gl_cv_sys_struct_timespec_in_time_h=yes
16936else
16937 gl_cv_sys_struct_timespec_in_time_h=no
6ec2e0f5 16938fi
c0c3707f
CB
16939rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16940fi
16941{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
16942$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
6ec2e0f5 16943
c0c3707f
CB
16944 TIME_H_DEFINES_STRUCT_TIMESPEC=0
16945 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
16946 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
16947 UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
16948 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
16949 TIME_H_DEFINES_STRUCT_TIMESPEC=1
6ec2e0f5 16950 else
c0c3707f
CB
16951 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
16952$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
16953if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
16954 $as_echo_n "(cached) " >&6
16955else
16956 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16957/* end confdefs.h. */
16958#include <sys/time.h>
472fa5ee 16959
c0c3707f
CB
16960int
16961main ()
16962{
16963static struct timespec x; x.tv_sec = x.tv_nsec;
16964 ;
16965 return 0;
16966}
16967_ACEOF
16968if ac_fn_c_try_compile "$LINENO"; then :
16969 gl_cv_sys_struct_timespec_in_sys_time_h=yes
16970else
16971 gl_cv_sys_struct_timespec_in_sys_time_h=no
16972fi
16973rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16974fi
16975{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
16976$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
16977 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
16978 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
16979 else
16980 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
16981$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
16982if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
16983 $as_echo_n "(cached) " >&6
16984else
16985 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16986/* end confdefs.h. */
16987#include <pthread.h>
472fa5ee 16988
c0c3707f
CB
16989int
16990main ()
16991{
16992static struct timespec x; x.tv_sec = x.tv_nsec;
16993 ;
16994 return 0;
16995}
16996_ACEOF
16997if ac_fn_c_try_compile "$LINENO"; then :
16998 gl_cv_sys_struct_timespec_in_pthread_h=yes
16999else
17000 gl_cv_sys_struct_timespec_in_pthread_h=no
17001fi
17002rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17003fi
17004{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
17005$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
17006 if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
17007 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
17008 else
17009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
17010$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
17011if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
17012 $as_echo_n "(cached) " >&6
17013else
17014 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17015/* end confdefs.h. */
17016#include <unistd.h>
6ec2e0f5 17017
c0c3707f
CB
17018int
17019main ()
17020{
17021static struct timespec x; x.tv_sec = x.tv_nsec;
17022 ;
17023 return 0;
17024}
17025_ACEOF
17026if ac_fn_c_try_compile "$LINENO"; then :
17027 gl_cv_sys_struct_timespec_in_unistd_h=yes
17028else
17029 gl_cv_sys_struct_timespec_in_unistd_h=no
17030fi
17031rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17032fi
17033{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
17034$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
17035 if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
17036 UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
17037 fi
6ec2e0f5
SDJ
17038 fi
17039 fi
c0c3707f 17040 fi
6ec2e0f5
SDJ
17041
17042
17043
17044
17045
17046
6ec2e0f5 17047
6ec2e0f5
SDJ
17048
17049
17050
17051
17052
6ec2e0f5
SDJ
17053
17054
17055
17056
c0c3707f
CB
17057 if test $gl_cv_have_include_next = yes; then
17058 gl_cv_next_time_h='<'time.h'>'
17059 else
17060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
17061$as_echo_n "checking absolute name of <time.h>... " >&6; }
17062if ${gl_cv_next_time_h+:} false; then :
17063 $as_echo_n "(cached) " >&6
17064else
6ec2e0f5 17065
6ec2e0f5
SDJ
17066
17067
c0c3707f
CB
17068 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17069/* end confdefs.h. */
17070#include <time.h>
17071_ACEOF
17072 case "$host_os" in
17073 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17074 *) gl_absname_cpp="$ac_cpp" ;;
17075 esac
6ec2e0f5 17076
c0c3707f
CB
17077 case "$host_os" in
17078 mingw*)
17079 gl_dirsep_regex='[/\\]'
17080 ;;
17081 *)
17082 gl_dirsep_regex='\/'
17083 ;;
17084 esac
17085 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17086 gl_header_literal_regex=`echo 'time.h' \
17087 | sed -e "$gl_make_literal_regex_sed"`
17088 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17089 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17090 s|^/[^/]|//&|
17091 p
17092 q
17093 }'
6ec2e0f5 17094
c0c3707f
CB
17095 gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17096 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 17097
c0c3707f
CB
17098 gl_header=$gl_cv_absolute_time_h
17099 gl_cv_next_time_h='"'$gl_header'"'
6ec2e0f5 17100
6ec2e0f5
SDJ
17101
17102fi
c0c3707f
CB
17103{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
17104$as_echo "$gl_cv_next_time_h" >&6; }
17105 fi
17106 NEXT_TIME_H=$gl_cv_next_time_h
6ec2e0f5 17107
c0c3707f
CB
17108 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17109 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17110 gl_next_as_first_directive='<'time.h'>'
17111 else
17112 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17113 gl_next_as_first_directive=$gl_cv_next_time_h
17114 fi
17115 NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
6ec2e0f5 17116
472fa5ee
SM
17117
17118
17119
17120
17121
6ec2e0f5 17122
6ec2e0f5 17123
9c9d63b1
PM
17124 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME_UTC in <time.h>" >&5
17125$as_echo_n "checking for TIME_UTC in <time.h>... " >&6; }
17126if ${gl_cv_time_h_has_TIME_UTC+:} false; then :
17127 $as_echo_n "(cached) " >&6
17128else
17129 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17130/* end confdefs.h. */
17131#include <time.h>
17132
17133int
17134main ()
17135{
17136static int x = TIME_UTC; x++;
17137 ;
17138 return 0;
17139}
17140_ACEOF
17141if ac_fn_c_try_compile "$LINENO"; then :
17142 gl_cv_time_h_has_TIME_UTC=yes
17143else
17144 gl_cv_time_h_has_TIME_UTC=no
17145fi
17146rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17147fi
17148{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_h_has_TIME_UTC" >&5
17149$as_echo "$gl_cv_time_h_has_TIME_UTC" >&6; }
17150 if test $gl_cv_time_h_has_TIME_UTC = yes; then
17151 TIME_H_DEFINES_TIME_UTC=1
17152 else
17153 TIME_H_DEFINES_TIME_UTC=0
17154 fi
17155
17156
6ec2e0f5 17157
6ec2e0f5 17158
9c9d63b1
PM
17159ac_fn_c_check_decl "$LINENO" "execvpe" "ac_cv_have_decl_execvpe" "$ac_includes_default"
17160if test "x$ac_cv_have_decl_execvpe" = xyes; then :
17161 ac_have_decl=1
17162else
17163 ac_have_decl=0
17164fi
698be2d8 17165
9c9d63b1
PM
17166cat >>confdefs.h <<_ACEOF
17167#define HAVE_DECL_EXECVPE $ac_have_decl
17168_ACEOF
698be2d8 17169
c0c3707f
CB
17170ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
17171if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
17172 ac_have_decl=1
17173else
17174 ac_have_decl=0
17175fi
6ec2e0f5 17176
c0c3707f
CB
17177cat >>confdefs.h <<_ACEOF
17178#define HAVE_DECL_UNSETENV $ac_have_decl
17179_ACEOF
6ec2e0f5
SDJ
17180
17181
6ec2e0f5
SDJ
17182
17183
17184
c0c3707f
CB
17185 if test $ac_cv_header_crtdefs_h = yes; then
17186 HAVE_CRTDEFS_H=1
17187 else
17188 HAVE_CRTDEFS_H=0
5e8754f9 17189 fi
5e8754f9 17190
5e8754f9 17191
5e8754f9 17192
c0c3707f 17193 GNULIB_ISWBLANK=0;
5df4cba6
SM
17194 GNULIB_ISWDIGIT=0;
17195 GNULIB_ISWXDIGIT=0;
c0c3707f
CB
17196 GNULIB_WCTYPE=0;
17197 GNULIB_ISWCTYPE=0;
17198 GNULIB_WCTRANS=0;
17199 GNULIB_TOWCTRANS=0;
17200 HAVE_ISWBLANK=1;
17201 HAVE_WCTYPE_T=1;
17202 HAVE_WCTRANS_T=1;
17203 REPLACE_ISWBLANK=0;
5df4cba6
SM
17204 REPLACE_ISWDIGIT=0;
17205 REPLACE_ISWXDIGIT=0;
5e8754f9 17206
5e8754f9 17207
5e8754f9 17208
5e8754f9 17209
698be2d8
CB
17210
17211
17212
17213
c0c3707f
CB
17214 if false; then
17215 GL_COND_LIBTOOL_TRUE=
17216 GL_COND_LIBTOOL_FALSE='#'
17217else
17218 GL_COND_LIBTOOL_TRUE='#'
17219 GL_COND_LIBTOOL_FALSE=
17220fi
5e8754f9 17221
c0c3707f
CB
17222 gl_cond_libtool=false
17223 gl_libdeps=
17224 gl_ltlibdeps=
17225 gl_m4_base='import/m4'
5e8754f9 17226
5e8754f9
SDJ
17227
17228
6ec2e0f5 17229
6ec2e0f5 17230
6ec2e0f5 17231
6ec2e0f5 17232
6ec2e0f5 17233
6ec2e0f5 17234
5df4cba6 17235
c0c3707f
CB
17236 gl_source_base='import'
17237
6ec2e0f5 17238
c0c3707f
CB
17239 if test $ac_cv_func_alloca_works = no; then
17240 :
17241 fi
6ec2e0f5 17242
c0c3707f
CB
17243 # Define an additional variable used in the Makefile substitution.
17244 if test $ac_cv_working_alloca_h = yes; then
17245 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
17246$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
17247if ${gl_cv_rpl_alloca+:} false; then :
6ec2e0f5
SDJ
17248 $as_echo_n "(cached) " >&6
17249else
c0c3707f
CB
17250
17251 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
17252/* end confdefs.h. */
17253
c0c3707f
CB
17254#if defined __GNUC__ || defined _AIX || defined _MSC_VER
17255 Need own alloca
17256#endif
6ec2e0f5 17257
6ec2e0f5 17258_ACEOF
c0c3707f
CB
17259if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17260 $EGREP "Need own alloca" >/dev/null 2>&1; then :
17261 gl_cv_rpl_alloca=yes
6ec2e0f5 17262else
c0c3707f 17263 gl_cv_rpl_alloca=no
6ec2e0f5 17264fi
c0c3707f 17265rm -f conftest*
6ec2e0f5
SDJ
17266
17267
17268fi
c0c3707f
CB
17269{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
17270$as_echo "$gl_cv_rpl_alloca" >&6; }
17271 if test $gl_cv_rpl_alloca = yes; then
6ec2e0f5 17272
c0c3707f 17273$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
6ec2e0f5 17274
c0c3707f
CB
17275 ALLOCA_H=alloca.h
17276 else
17277 ALLOCA_H=
17278 fi
17279 else
17280 ALLOCA_H=alloca.h
17281 fi
6ec2e0f5 17282
c0c3707f
CB
17283 if test -n "$ALLOCA_H"; then
17284 GL_GENERATE_ALLOCA_H_TRUE=
17285 GL_GENERATE_ALLOCA_H_FALSE='#'
17286else
17287 GL_GENERATE_ALLOCA_H_TRUE='#'
17288 GL_GENERATE_ALLOCA_H_FALSE=
17289fi
6ec2e0f5
SDJ
17290
17291
c0c3707f
CB
17292 if test $ac_cv_working_alloca_h = yes; then
17293 HAVE_ALLOCA_H=1
17294 else
17295 HAVE_ALLOCA_H=0
17296 fi
6ec2e0f5
SDJ
17297
17298
17299
17300
17301
17302
c0c3707f
CB
17303 if test $ac_cv_header_arpa_inet_h = yes; then
17304 HAVE_ARPA_INET_H=1
17305 else
17306 HAVE_ARPA_INET_H=0
17307 fi
6ec2e0f5
SDJ
17308
17309
472fa5ee
SM
17310
17311
17312
17313
17314
6ec2e0f5
SDJ
17315
17316
17317
17318 if test $gl_cv_have_include_next = yes; then
c0c3707f 17319 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5 17320 else
c0c3707f
CB
17321 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
17322$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
17323if ${gl_cv_next_arpa_inet_h+:} false; then :
6ec2e0f5
SDJ
17324 $as_echo_n "(cached) " >&6
17325else
17326
c0c3707f 17327 if test $ac_cv_header_arpa_inet_h = yes; then
6ec2e0f5
SDJ
17328
17329
17330
17331
17332 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17333/* end confdefs.h. */
c0c3707f 17334#include <arpa/inet.h>
6ec2e0f5
SDJ
17335_ACEOF
17336 case "$host_os" in
17337 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17338 *) gl_absname_cpp="$ac_cpp" ;;
17339 esac
17340
17341 case "$host_os" in
17342 mingw*)
17343 gl_dirsep_regex='[/\\]'
17344 ;;
17345 *)
17346 gl_dirsep_regex='\/'
17347 ;;
17348 esac
17349 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 17350 gl_header_literal_regex=`echo 'arpa/inet.h' \
6ec2e0f5
SDJ
17351 | sed -e "$gl_make_literal_regex_sed"`
17352 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17353 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17354 s|^/[^/]|//&|
17355 p
17356 q
17357 }'
17358
c0c3707f 17359 gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5
SDJ
17360 sed -n "$gl_absolute_header_sed"`
17361
c0c3707f
CB
17362 gl_header=$gl_cv_absolute_arpa_inet_h
17363 gl_cv_next_arpa_inet_h='"'$gl_header'"'
6ec2e0f5 17364 else
c0c3707f 17365 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5
SDJ
17366 fi
17367
c0c3707f 17368
6ec2e0f5 17369fi
c0c3707f
CB
17370{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
17371$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
17372 fi
17373 NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
6ec2e0f5 17374
c0c3707f
CB
17375 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17376 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17377 gl_next_as_first_directive='<'arpa/inet.h'>'
17378 else
17379 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17380 gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
17381 fi
17382 NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
17383
17384
6ec2e0f5 17385
6ec2e0f5 17386
6ec2e0f5
SDJ
17387
17388
6ec2e0f5
SDJ
17389
17390
17391
c0c3707f
CB
17392 if test $ac_cv_header_sys_socket_h = yes; then
17393 HAVE_WS2TCPIP_H=0
17394 else
17395 if test $ac_cv_header_ws2tcpip_h = yes; then
17396 HAVE_WS2TCPIP_H=1
17397 else
17398 HAVE_WS2TCPIP_H=0
17399 fi
17400 fi
17401
17402
6ec2e0f5
SDJ
17403
17404
6ec2e0f5
SDJ
17405
17406
17407
17408
17409
698be2d8
CB
17410
17411
17412
17413
17414
17415
17416 if test $ac_cv_func_btowc = no; then
17417 HAVE_BTOWC=0
17418 else
17419
17420
17421
17422
17423 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
17424$as_echo_n "checking whether btowc(0) is correct... " >&6; }
17425if ${gl_cv_func_btowc_nul+:} false; then :
17426 $as_echo_n "(cached) " >&6
17427else
17428
17429 if test "$cross_compiling" = yes; then :
17430
17431 case "$host_os" in
17432 # Guess no on Cygwin.
17433 cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
17434 # Guess yes on native Windows.
17435 mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
17436 # Guess yes otherwise.
17437 *) gl_cv_func_btowc_nul="guessing yes" ;;
17438 esac
17439
17440else
17441 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17442/* end confdefs.h. */
17443
698be2d8
CB
17444#include <wchar.h>
17445int main ()
17446{
17447 if (btowc ('\0') != 0)
17448 return 1;
17449 return 0;
17450}
17451_ACEOF
17452if ac_fn_c_try_run "$LINENO"; then :
17453 gl_cv_func_btowc_nul=yes
17454else
17455 gl_cv_func_btowc_nul=no
17456fi
17457rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17458 conftest.$ac_objext conftest.beam conftest.$ac_ext
17459fi
17460
17461
17462fi
17463{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
17464$as_echo "$gl_cv_func_btowc_nul" >&6; }
17465
17466 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
17467$as_echo_n "checking whether btowc(EOF) is correct... " >&6; }
17468if ${gl_cv_func_btowc_eof+:} false; then :
17469 $as_echo_n "(cached) " >&6
17470else
17471
17472 case "$host_os" in
17473 # Guess no on IRIX.
17474 irix*) gl_cv_func_btowc_eof="guessing no" ;;
17475 # Guess yes on native Windows.
17476 mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
17477 # Guess yes otherwise.
17478 *) gl_cv_func_btowc_eof="guessing yes" ;;
17479 esac
17480 if test $LOCALE_FR != none; then
17481 if test "$cross_compiling" = yes; then :
17482 :
17483else
17484 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17485/* end confdefs.h. */
17486
17487#include <locale.h>
698be2d8 17488#include <stdio.h>
698be2d8
CB
17489#include <wchar.h>
17490int main ()
17491{
17492 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
17493 {
17494 if (btowc (EOF) != WEOF)
17495 return 1;
17496 }
17497 return 0;
17498}
17499_ACEOF
17500if ac_fn_c_try_run "$LINENO"; then :
17501 gl_cv_func_btowc_eof=yes
17502else
17503 gl_cv_func_btowc_eof=no
17504fi
17505rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17506 conftest.$ac_objext conftest.beam conftest.$ac_ext
17507fi
17508
17509 fi
17510
17511fi
17512{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
17513$as_echo "$gl_cv_func_btowc_eof" >&6; }
17514
17515 case "$gl_cv_func_btowc_nul" in
17516 *yes) ;;
17517 *) REPLACE_BTOWC=1 ;;
17518 esac
17519 case "$gl_cv_func_btowc_eof" in
17520 *yes) ;;
17521 *) REPLACE_BTOWC=1 ;;
17522 esac
17523 fi
17524
17525 if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
17526
17527
17528
17529
17530
17531
17532
17533
17534 gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext"
17535
17536
17537 :
17538
17539 fi
17540
17541
17542
17543
17544
17545 GNULIB_BTOWC=1
17546
17547
17548
17549
17550
17551$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
17552
17553
17554
17555
c0c3707f
CB
17556 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
17557$as_echo_n "checking for __builtin_expect... " >&6; }
17558if ${gl_cv___builtin_expect+:} false; then :
6ec2e0f5
SDJ
17559 $as_echo_n "(cached) " >&6
17560else
c0c3707f
CB
17561 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17562/* end confdefs.h. */
17563
17564 int
17565 main (int argc, char **argv)
17566 {
17567 argc = __builtin_expect (argc, 100);
17568 return argv[argc != 100][0];
17569 }
17570_ACEOF
17571if ac_fn_c_try_link "$LINENO"; then :
17572 gl_cv___builtin_expect=yes
17573else
17574 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17575/* end confdefs.h. */
17576
17577 #include <builtins.h>
17578 int
17579 main (int argc, char **argv)
17580 {
17581 argc = __builtin_expect (argc, 100);
17582 return argv[argc != 100][0];
17583 }
17584_ACEOF
17585if ac_fn_c_try_link "$LINENO"; then :
17586 gl_cv___builtin_expect="in <builtins.h>"
17587else
17588 gl_cv___builtin_expect=no
6ec2e0f5 17589fi
c0c3707f
CB
17590rm -f core conftest.err conftest.$ac_objext \
17591 conftest$ac_exeext conftest.$ac_ext
17592fi
17593rm -f core conftest.err conftest.$ac_objext \
17594 conftest$ac_exeext conftest.$ac_ext
17595fi
17596{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
17597$as_echo "$gl_cv___builtin_expect" >&6; }
17598 if test "$gl_cv___builtin_expect" = yes; then
17599 $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
8690e634 17600
c0c3707f
CB
17601 elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
17602 $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
8690e634 17603
6ec2e0f5 17604 fi
8690e634
JK
17605
17606
17607
17608
c0c3707f
CB
17609
17610 if test $ac_cv_func_canonicalize_file_name = no; then
17611 HAVE_CANONICALIZE_FILE_NAME=0
17612 if test $ac_cv_func_realpath = no; then
17613 HAVE_REALPATH=0
17614 else
17615 case "$gl_cv_func_realpath_works" in
17616 *yes) ;;
17617 *) REPLACE_REALPATH=1 ;;
17618 esac
17619 fi
17620 else
17621 case "$gl_cv_func_realpath_works" in
17622 *yes)
17623 ;;
17624 *)
17625 REPLACE_CANONICALIZE_FILE_NAME=1
17626 REPLACE_REALPATH=1
17627 ;;
17628 esac
5e8754f9 17629 fi
8690e634 17630
c0c3707f 17631 if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
8690e634
JK
17632
17633
17634
472fa5ee
SM
17635
17636
17637
17638
17639
c0c3707f
CB
17640 gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
17641
6ec2e0f5 17642 fi
8690e634
JK
17643
17644
c0c3707f
CB
17645cat >>confdefs.h <<_ACEOF
17646#define GNULIB_CANONICALIZE_LGPL 1
17647_ACEOF
8690e634 17648
8690e634 17649
8690e634 17650
8690e634 17651
8690e634 17652
8690e634 17653
8690e634 17654
c0c3707f 17655 GNULIB_CANONICALIZE_FILE_NAME=1
8690e634 17656
8690e634 17657
8690e634 17658
6ec2e0f5
SDJ
17659
17660
c0c3707f 17661$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
6ec2e0f5 17662
6ec2e0f5 17663
8690e634
JK
17664
17665
8690e634
JK
17666
17667
17668
17669
c0c3707f 17670 GNULIB_REALPATH=1
6ec2e0f5
SDJ
17671
17672
17673
17674
6ec2e0f5 17675
c0c3707f 17676$as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
6ec2e0f5
SDJ
17677
17678
17679
17680
17681
17682
17683
6ec2e0f5 17684
c0c3707f 17685 GNULIB_CHDIR=1
6ec2e0f5 17686
8690e634 17687
8690e634 17688
6ec2e0f5 17689
6ec2e0f5 17690
c0c3707f
CB
17691$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
17692
17693
17694
17695
17696
9c9d63b1
PM
17697 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system supports file names of any length" >&5
17698$as_echo_n "checking whether this system supports file names of any length... " >&6; }
17699if ${gl_cv_have_unlimited_file_name_length+:} false; then :
c0c3707f 17700 $as_echo_n "(cached) " >&6
8690e634 17701else
c0c3707f
CB
17702 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17703/* end confdefs.h. */
8690e634 17704
c0c3707f
CB
17705/* Arrange to define PATH_MAX, like "pathmax.h" does. */
17706#if HAVE_UNISTD_H
17707# include <unistd.h>
17708#endif
17709#include <limits.h>
17710#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
17711# include <sys/param.h>
17712#endif
17713#if !defined PATH_MAX && defined MAXPATHLEN
17714# define PATH_MAX MAXPATHLEN
17715#endif
17716#ifdef __hpux
17717# undef PATH_MAX
17718# define PATH_MAX 1024
17719#endif
17720#if defined _WIN32 && ! defined __CYGWIN__
17721# undef PATH_MAX
17722# define PATH_MAX 260
17723#endif
6ec2e0f5 17724
c0c3707f
CB
17725#ifdef PATH_MAX
17726have_arbitrary_file_name_length_limit
17727#endif
6ec2e0f5 17728_ACEOF
c0c3707f
CB
17729if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17730 $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then :
9c9d63b1
PM
17731 gl_cv_have_unlimited_file_name_length=no
17732else
17733 gl_cv_have_unlimited_file_name_length=yes
17734fi
17735rm -f conftest*
17736
17737fi
17738{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_unlimited_file_name_length" >&5
17739$as_echo "$gl_cv_have_unlimited_file_name_length" >&6; }
17740
17741 if test $gl_cv_have_unlimited_file_name_length = no; then
17742
17743
17744
17745
17746
17747
17748
17749
17750 gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext"
17751
17752 :
17753 fi
17754
17755
17756
17757 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
17758 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
17759
17760 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
17761 # programs in the package would end up linked with that potentially-shared
17762 # library, inducing unnecessary run-time overhead.
17763 LIB_CLOCK_GETTIME=
17764
17765 gl_saved_libs=$LIBS
17766 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
17767$as_echo_n "checking for library containing clock_gettime... " >&6; }
17768if ${ac_cv_search_clock_gettime+:} false; then :
17769 $as_echo_n "(cached) " >&6
c0c3707f 17770else
9c9d63b1
PM
17771 ac_func_search_save_LIBS=$LIBS
17772cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17773/* end confdefs.h. */
17774
17775/* Override any GCC internal prototype to avoid an error.
17776 Use char because int might match the return type of a GCC
17777 builtin and then its argument prototype would still apply. */
17778#ifdef __cplusplus
17779extern "C"
17780#endif
17781char clock_gettime ();
17782int
17783main ()
17784{
17785return clock_gettime ();
17786 ;
17787 return 0;
17788}
17789_ACEOF
17790for ac_lib in '' rt posix4; do
17791 if test -z "$ac_lib"; then
17792 ac_res="none required"
17793 else
17794 ac_res=-l$ac_lib
17795 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
17796 fi
17797 if ac_fn_c_try_link "$LINENO"; then :
17798 ac_cv_search_clock_gettime=$ac_res
17799fi
17800rm -f core conftest.err conftest.$ac_objext \
17801 conftest$ac_exeext
17802 if ${ac_cv_search_clock_gettime+:} false; then :
17803 break
c0c3707f 17804fi
9c9d63b1
PM
17805done
17806if ${ac_cv_search_clock_gettime+:} false; then :
6ec2e0f5 17807
9c9d63b1
PM
17808else
17809 ac_cv_search_clock_gettime=no
17810fi
17811rm conftest.$ac_ext
17812LIBS=$ac_func_search_save_LIBS
17813fi
17814{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
17815$as_echo "$ac_cv_search_clock_gettime" >&6; }
17816ac_res=$ac_cv_search_clock_gettime
17817if test "$ac_res" != no; then :
17818 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
17819 test "$ac_cv_search_clock_gettime" = "none required" ||
17820 LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
6ec2e0f5 17821fi
472fa5ee 17822
9c9d63b1
PM
17823 for ac_func in clock_gettime clock_settime
17824do :
17825 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
17826ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
17827if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
17828 cat >>confdefs.h <<_ACEOF
17829#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
17830_ACEOF
472fa5ee 17831
9c9d63b1
PM
17832fi
17833done
472fa5ee 17834
9c9d63b1 17835 LIBS=$gl_saved_libs
472fa5ee 17836
8690e634 17837
8690e634 17838
c0c3707f 17839$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
8690e634
JK
17840
17841
17842
17843
17844
8690e634 17845
c0c3707f
CB
17846 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
17847 REPLACE_CLOSE=1
17848 fi
8690e634 17849
6ec2e0f5
SDJ
17850
17851
6ec2e0f5
SDJ
17852
17853
8690e634 17854
c0c3707f
CB
17855 if test $ac_cv_header_sys_socket_h != yes; then
17856 for ac_header in winsock2.h
17857do :
17858 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
17859if test "x$ac_cv_header_winsock2_h" = xyes; then :
17860 cat >>confdefs.h <<_ACEOF
17861#define HAVE_WINSOCK2_H 1
17862_ACEOF
8690e634 17863
c0c3707f 17864fi
8690e634 17865
c0c3707f 17866done
8690e634 17867
c0c3707f
CB
17868 fi
17869 if test "$ac_cv_header_winsock2_h" = yes; then
17870 HAVE_WINSOCK2_H=1
17871 UNISTD_H_HAVE_WINSOCK2_H=1
17872 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
17873 else
17874 HAVE_WINSOCK2_H=0
17875 fi
8690e634 17876
6ec2e0f5 17877
c0c3707f
CB
17878 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
17879 REPLACE_CLOSE=1
17880 fi
6ec2e0f5
SDJ
17881
17882
c0c3707f 17883 if test $REPLACE_CLOSE = 0; then
6ec2e0f5
SDJ
17884
17885
6ec2e0f5 17886
c0c3707f
CB
17887 if test $ac_cv_func_fchdir = no; then
17888 HAVE_FCHDIR=0
17889 fi
6ec2e0f5 17890
c0c3707f
CB
17891 if test $HAVE_FCHDIR = 0; then
17892 REPLACE_CLOSE=1
17893 fi
17894 fi
6ec2e0f5
SDJ
17895
17896
c0c3707f 17897 if test $REPLACE_CLOSE = 1; then
6ec2e0f5
SDJ
17898
17899
17900
17901
17902
6ec2e0f5
SDJ
17903
17904
17905
c0c3707f 17906 gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
6ec2e0f5 17907
c0c3707f 17908 fi
6ec2e0f5 17909
6ec2e0f5
SDJ
17910
17911
17912
17913
c0c3707f 17914 GNULIB_CLOSE=1
6ec2e0f5 17915
6ec2e0f5 17916
6ec2e0f5
SDJ
17917
17918
17919
c0c3707f 17920$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
6ec2e0f5
SDJ
17921
17922
17923
17924
17925
c0c3707f
CB
17926
17927 for ac_func in closedir
17928do :
17929 ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
17930if test "x$ac_cv_func_closedir" = xyes; then :
17931 cat >>confdefs.h <<_ACEOF
17932#define HAVE_CLOSEDIR 1
17933_ACEOF
17934
17935fi
17936done
17937
17938 if test $ac_cv_func_closedir = no; then
17939 HAVE_CLOSEDIR=0
17940 fi
6ec2e0f5 17941
8690e634
JK
17942
17943
8690e634 17944
c0c3707f
CB
17945 if test $ac_cv_func_fchdir = no; then
17946 HAVE_FCHDIR=0
6ec2e0f5 17947 fi
6a29c58e 17948
c0c3707f
CB
17949 if test $HAVE_FCHDIR = 0; then
17950 if test $HAVE_CLOSEDIR = 1; then
17951 REPLACE_CLOSEDIR=1
17952 fi
17953 fi
6a29c58e 17954
c0c3707f
CB
17955 case $host_os,$HAVE_CLOSEDIR in
17956 os2*,1)
17957 REPLACE_CLOSEDIR=1;;
17958 esac
d0ac1c44 17959
c0c3707f 17960 if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
d0ac1c44
SM
17961
17962
d0ac1c44
SM
17963
17964
6a29c58e
YQ
17965
17966
3d99e817 17967
6ec2e0f5 17968
c0c3707f 17969 gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
6ec2e0f5 17970
6ec2e0f5
SDJ
17971 fi
17972
17973
6ec2e0f5
SDJ
17974
17975
3d99e817 17976
c0c3707f 17977 GNULIB_CLOSEDIR=1
3d99e817
AK
17978
17979
17980
17981
17982
c0c3707f 17983$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
3d99e817
AK
17984
17985
17986
698be2d8
CB
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998 if test $gl_cv_have_include_next = yes; then
17999 gl_cv_next_ctype_h='<'ctype.h'>'
18000 else
18001 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5
18002$as_echo_n "checking absolute name of <ctype.h>... " >&6; }
18003if ${gl_cv_next_ctype_h+:} false; then :
18004 $as_echo_n "(cached) " >&6
18005else
18006
18007
18008
18009 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18010/* end confdefs.h. */
18011#include <ctype.h>
18012_ACEOF
18013 case "$host_os" in
18014 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18015 *) gl_absname_cpp="$ac_cpp" ;;
18016 esac
18017
18018 case "$host_os" in
18019 mingw*)
18020 gl_dirsep_regex='[/\\]'
18021 ;;
18022 *)
18023 gl_dirsep_regex='\/'
18024 ;;
18025 esac
18026 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18027 gl_header_literal_regex=`echo 'ctype.h' \
18028 | sed -e "$gl_make_literal_regex_sed"`
18029 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18030 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18031 s|^/[^/]|//&|
18032 p
18033 q
18034 }'
18035
18036 gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18037 sed -n "$gl_absolute_header_sed"`
18038
18039 gl_header=$gl_cv_absolute_ctype_h
18040 gl_cv_next_ctype_h='"'$gl_header'"'
18041
18042
18043fi
18044{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5
18045$as_echo "$gl_cv_next_ctype_h" >&6; }
18046 fi
18047 NEXT_CTYPE_H=$gl_cv_next_ctype_h
18048
18049 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18050 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18051 gl_next_as_first_directive='<'ctype.h'>'
18052 else
18053 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18054 gl_next_as_first_directive=$gl_cv_next_ctype_h
18055 fi
18056 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive
18057
18058
18059
18060
18061
18062
18063
18064
18065
c0c3707f
CB
18066 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
18067$as_echo_n "checking for d_ino member in directory struct... " >&6; }
18068if ${gl_cv_struct_dirent_d_ino+:} false; then :
6ec2e0f5
SDJ
18069 $as_echo_n "(cached) " >&6
18070else
18071 if test "$cross_compiling" = yes; then :
18072 case "$host_os" in
c0c3707f
CB
18073 # Guess yes on glibc systems with Linux kernel.
18074 linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
18075 # Guess yes on musl systems with Linux kernel.
18076 linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
18077 # Guess no on native Windows.
18078 mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
18079 # If we don't know, obey --enable-cross-guesses.
18080 *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
18081 esac
3d99e817 18082
6ec2e0f5
SDJ
18083else
18084 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18085/* end confdefs.h. */
c0c3707f
CB
18086#include <sys/types.h>
18087 #include <sys/stat.h>
18088 #include <dirent.h>
3d99e817 18089
6ec2e0f5
SDJ
18090int
18091main ()
18092{
c0c3707f
CB
18093DIR *dp = opendir (".");
18094 struct dirent *e;
18095 struct stat st;
18096 if (! dp)
18097 return 1;
18098 e = readdir (dp);
18099 if (! e)
18100 { closedir (dp); return 2; }
18101 if (lstat (e->d_name, &st) != 0)
18102 { closedir (dp); return 3; }
18103 if (e->d_ino != st.st_ino)
18104 { closedir (dp); return 4; }
18105 closedir (dp);
18106 return 0;
18107
6ec2e0f5
SDJ
18108 ;
18109 return 0;
18110}
3d99e817 18111_ACEOF
6ec2e0f5 18112if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
18113 gl_cv_struct_dirent_d_ino=yes
18114else
18115 gl_cv_struct_dirent_d_ino=no
18116fi
18117rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18118 conftest.$ac_objext conftest.beam conftest.$ac_ext
18119fi
18120
18121fi
18122{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
18123$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
18124 case "$gl_cv_struct_dirent_d_ino" in
18125 *yes)
18126
18127$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
18128
18129 ;;
18130 esac
18131
18132
18133 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5
18134$as_echo_n "checking for d_type member in directory struct... " >&6; }
18135if ${gl_cv_struct_dirent_d_type+:} false; then :
18136 $as_echo_n "(cached) " >&6
18137else
18138 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18139/* end confdefs.h. */
18140
18141#include <sys/types.h>
18142#include <dirent.h>
18143
18144int
18145main ()
18146{
18147struct dirent dp; dp.d_type = 0;
18148 ;
18149 return 0;
18150}
18151_ACEOF
18152if ac_fn_c_try_link "$LINENO"; then :
18153 gl_cv_struct_dirent_d_type=yes
6ec2e0f5 18154else
c0c3707f 18155 gl_cv_struct_dirent_d_type=no
3d99e817 18156fi
c0c3707f
CB
18157rm -f core conftest.err conftest.$ac_objext \
18158 conftest$ac_exeext conftest.$ac_ext
3d99e817 18159
3d99e817 18160
c0c3707f
CB
18161fi
18162{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5
18163$as_echo "$gl_cv_struct_dirent_d_type" >&6; }
18164 if test $gl_cv_struct_dirent_d_type = yes; then
3d99e817 18165
c0c3707f 18166$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
3d99e817 18167
c0c3707f 18168 fi
3d99e817 18169
0750520d 18170
0750520d 18171
0750520d 18172
0750520d
PA
18173
18174
0750520d 18175
0750520d 18176
0750520d 18177
0750520d 18178
0750520d 18179
0750520d 18180
0750520d 18181
0750520d 18182
c0c3707f
CB
18183 if test $gl_cv_have_include_next = yes; then
18184 gl_cv_next_dirent_h='<'dirent.h'>'
18185 else
18186 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
18187$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
18188if ${gl_cv_next_dirent_h+:} false; then :
18189 $as_echo_n "(cached) " >&6
18190else
0750520d 18191
c0c3707f 18192 if test $ac_cv_header_dirent_h = yes; then
6ec2e0f5 18193
472fa5ee
SM
18194
18195
18196
c0c3707f
CB
18197 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18198/* end confdefs.h. */
18199#include <dirent.h>
18200_ACEOF
18201 case "$host_os" in
18202 aix*) gl_absname_cpp="$ac_cpp -C" ;;
18203 *) gl_absname_cpp="$ac_cpp" ;;
18204 esac
472fa5ee 18205
c0c3707f
CB
18206 case "$host_os" in
18207 mingw*)
18208 gl_dirsep_regex='[/\\]'
18209 ;;
18210 *)
18211 gl_dirsep_regex='\/'
18212 ;;
18213 esac
18214 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18215 gl_header_literal_regex=`echo 'dirent.h' \
18216 | sed -e "$gl_make_literal_regex_sed"`
18217 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18218 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18219 s|^/[^/]|//&|
18220 p
18221 q
18222 }'
472fa5ee 18223
c0c3707f
CB
18224 gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18225 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 18226
c0c3707f
CB
18227 gl_header=$gl_cv_absolute_dirent_h
18228 gl_cv_next_dirent_h='"'$gl_header'"'
18229 else
18230 gl_cv_next_dirent_h='<'dirent.h'>'
18231 fi
6ec2e0f5
SDJ
18232
18233
c0c3707f
CB
18234fi
18235{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
18236$as_echo "$gl_cv_next_dirent_h" >&6; }
18237 fi
18238 NEXT_DIRENT_H=$gl_cv_next_dirent_h
472fa5ee 18239
c0c3707f
CB
18240 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18241 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18242 gl_next_as_first_directive='<'dirent.h'>'
18243 else
18244 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18245 gl_next_as_first_directive=$gl_cv_next_dirent_h
18246 fi
18247 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
472fa5ee
SM
18248
18249
18250
18251
c0c3707f
CB
18252 if test $ac_cv_header_dirent_h = yes; then
18253 HAVE_DIRENT_H=1
6ec2e0f5 18254 else
c0c3707f 18255 HAVE_DIRENT_H=0
6ec2e0f5
SDJ
18256 fi
18257
6ec2e0f5 18258
0750520d 18259
0750520d 18260
0750520d 18261
472fa5ee
SM
18262
18263
18264
18265
18266
0750520d 18267
c0c3707f
CB
18268 for ac_func in dirfd
18269do :
18270 ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
18271if test "x$ac_cv_func_dirfd" = xyes; then :
18272 cat >>confdefs.h <<_ACEOF
18273#define HAVE_DIRFD 1
18274_ACEOF
0750520d 18275
c0c3707f
CB
18276fi
18277done
0750520d 18278
c0c3707f
CB
18279 ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
18280 #include <dirent.h>
18281"
18282if test "x$ac_cv_have_decl_dirfd" = xyes; then :
18283 ac_have_decl=1
8690e634 18284else
c0c3707f
CB
18285 ac_have_decl=0
18286fi
8690e634 18287
c0c3707f
CB
18288cat >>confdefs.h <<_ACEOF
18289#define HAVE_DECL_DIRFD $ac_have_decl
18290_ACEOF
49e4877c 18291
c0c3707f
CB
18292 if test $ac_cv_have_decl_dirfd = no; then
18293 HAVE_DECL_DIRFD=0
18294 fi
8690e634 18295
c0c3707f
CB
18296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
18297$as_echo_n "checking whether dirfd is a macro... " >&6; }
18298if ${gl_cv_func_dirfd_macro+:} false; then :
18299 $as_echo_n "(cached) " >&6
18300else
6ec2e0f5
SDJ
18301 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18302/* end confdefs.h. */
8690e634 18303
c0c3707f
CB
18304#include <sys/types.h>
18305#include <dirent.h>
18306#ifdef dirfd
18307 dirent_header_defines_dirfd
6ec2e0f5 18308#endif
8690e634 18309_ACEOF
c0c3707f
CB
18310if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18311 $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
18312 gl_cv_func_dirfd_macro=yes
6ec2e0f5 18313else
c0c3707f 18314 gl_cv_func_dirfd_macro=no
6ec2e0f5 18315fi
c0c3707f 18316rm -f conftest*
472fa5ee 18317
c0c3707f
CB
18318fi
18319{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
18320$as_echo "$gl_cv_func_dirfd_macro" >&6; }
472fa5ee 18321
c0c3707f
CB
18322 # Use the replacement if we have no function or macro with that name,
18323 # or if OS/2 kLIBC whose dirfd() does not work.
18324 # Replace only if the system declares dirfd already.
18325 case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
18326 no,no,*,yes | *,*,os2*,yes)
18327 REPLACE_DIRFD=1
472fa5ee 18328
c0c3707f
CB
18329$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
18330;;
18331 esac
472fa5ee 18332
c0c3707f
CB
18333 if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
18334 || test $REPLACE_DIRFD = 1; then
6ec2e0f5 18335
6ec2e0f5
SDJ
18336
18337
18338
18339
472fa5ee
SM
18340
18341
18342
c0c3707f 18343 gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
472fa5ee
SM
18344
18345
c0c3707f
CB
18346 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
18347$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
18348if ${gl_cv_sys_dir_fd_member_name+:} false; then :
18349 $as_echo_n "(cached) " >&6
18350else
6ec2e0f5 18351
c0c3707f
CB
18352 dirfd_save_CFLAGS=$CFLAGS
18353 for ac_expr in d_fd dd_fd; do
6ec2e0f5 18354
c0c3707f
CB
18355 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
18356 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18357/* end confdefs.h. */
6ec2e0f5 18358
c0c3707f
CB
18359 #include <sys/types.h>
18360 #include <dirent.h>
18361int
18362main ()
18363{
18364DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
18365 ;
18366 return 0;
18367}
18368_ACEOF
18369if ac_fn_c_try_compile "$LINENO"; then :
18370 dir_fd_found=yes
6ec2e0f5 18371
c0c3707f
CB
18372fi
18373rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18374 CFLAGS=$dirfd_save_CFLAGS
18375 test "$dir_fd_found" = yes && break
18376 done
18377 test "$dir_fd_found" = yes || ac_expr=no_such_member
472fa5ee 18378
c0c3707f 18379 gl_cv_sys_dir_fd_member_name=$ac_expr
472fa5ee
SM
18380
18381
c0c3707f
CB
18382fi
18383{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
18384$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
18385 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
472fa5ee 18386
c0c3707f
CB
18387cat >>confdefs.h <<_ACEOF
18388#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
18389_ACEOF
472fa5ee 18390
6ec2e0f5
SDJ
18391 fi
18392
6ec2e0f5 18393
c0c3707f 18394 fi
6ec2e0f5
SDJ
18395
18396
18397
18398
18399
c0c3707f 18400 GNULIB_DIRFD=1
6ec2e0f5
SDJ
18401
18402
18403
6ec2e0f5 18404
8690e634 18405
c0c3707f 18406$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
8690e634
JK
18407
18408
8690e634
JK
18409
18410
18411
c0c3707f
CB
18412 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
18413$as_echo_n "checking whether // is distinct from /... " >&6; }
18414if ${gl_cv_double_slash_root+:} false; then :
18415 $as_echo_n "(cached) " >&6
18416else
18417 if test x"$cross_compiling" = xyes ; then
18418 # When cross-compiling, there is no way to tell whether // is special
18419 # short of a list of hosts. However, the only known hosts to date
18420 # that have a distinct // are Apollo DomainOS (too old to port to),
18421 # Cygwin, and z/OS. If anyone knows of another system for which // has
18422 # special semantics and is distinct from /, please report it to
18423 # <bug-gnulib@gnu.org>.
18424 case $host in
18425 *-cygwin | i370-ibm-openedition)
18426 gl_cv_double_slash_root=yes ;;
18427 *)
18428 # Be optimistic and assume that / and // are the same when we
18429 # don't know.
18430 gl_cv_double_slash_root='unknown, assuming no' ;;
18431 esac
18432 else
18433 set x `ls -di / // 2>/dev/null`
18434 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
18435 gl_cv_double_slash_root=no
18436 else
18437 gl_cv_double_slash_root=yes
18438 fi
18439 fi
18440fi
18441{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
18442$as_echo "$gl_cv_double_slash_root" >&6; }
18443 if test "$gl_cv_double_slash_root" = yes; then
6ec2e0f5 18444
c0c3707f 18445$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
8690e634 18446
c0c3707f 18447 fi
8690e634 18448
63ce7108
TT
18449
18450
18451
18452
c0c3707f
CB
18453 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
18454 REPLACE_DUP=1
18455 fi
8690e634
JK
18456
18457
18458
18459
18460
c0c3707f
CB
18461 if test $ac_cv_func_fchdir = no; then
18462 HAVE_FCHDIR=0
18463 fi
8690e634 18464
c0c3707f
CB
18465 if test $HAVE_FCHDIR = 0; then
18466 REPLACE_DUP=1
18467 fi
8690e634 18468
c0c3707f
CB
18469 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
18470$as_echo_n "checking whether dup works... " >&6; }
18471if ${gl_cv_func_dup_works+:} false; then :
8690e634
JK
18472 $as_echo_n "(cached) " >&6
18473else
c0c3707f
CB
18474 if test "$cross_compiling" = yes; then :
18475 case "$host_os" in
18476 # Guess no on native Windows.
18477 mingw*) gl_cv_func_dup_works="guessing no" ;;
18478 *) gl_cv_func_dup_works="guessing yes" ;;
18479 esac
8690e634 18480
c0c3707f 18481else
4a626d0a 18482 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 18483/* end confdefs.h. */
c0c3707f
CB
18484#include <unistd.h>
18485 #include <fcntl.h>
18486 #include <errno.h>
9c9d63b1
PM
18487
18488
18489$gl_mda_defines
18490
c0c3707f
CB
18491int
18492main ()
18493{
18494/* On OS/2 kLIBC, dup does not work on a directory fd. */
18495 int fd = open (".", O_RDONLY);
18496 return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
8690e634 18497
c0c3707f
CB
18498 ;
18499 return 0;
18500}
8690e634 18501
c0c3707f
CB
18502_ACEOF
18503if ac_fn_c_try_run "$LINENO"; then :
18504 gl_cv_func_dup_works=yes
18505else
18506 gl_cv_func_dup_works=no
18507fi
18508rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18509 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 18510fi
8690e634 18511
8690e634 18512
c0c3707f
CB
18513fi
18514{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
18515$as_echo "$gl_cv_func_dup_works" >&6; }
18516 case "$gl_cv_func_dup_works" in
18517 *yes) ;;
18518 *)
18519 REPLACE_DUP=1
18520 ;;
18521 esac
8690e634 18522
c0c3707f 18523 if test $REPLACE_DUP = 1; then
8690e634
JK
18524
18525
18526
18527
6ec2e0f5
SDJ
18528
18529
18530
18531
c0c3707f 18532 gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
8690e634 18533
c0c3707f
CB
18534 :
18535 fi
8690e634 18536
5e8754f9 18537
8690e634
JK
18538
18539
8839a007 18540
c0c3707f 18541 GNULIB_DUP=1
63ce7108 18542
63ce7108 18543
63ce7108 18544
6ec2e0f5 18545
6ec2e0f5 18546
c0c3707f 18547$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
6ec2e0f5 18548
63ce7108
TT
18549
18550
472fa5ee
SM
18551
18552
18553
9c9d63b1 18554 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
c0c3707f
CB
18555$as_echo_n "checking whether dup2 works... " >&6; }
18556if ${gl_cv_func_dup2_works+:} false; then :
6ec2e0f5
SDJ
18557 $as_echo_n "(cached) " >&6
18558else
18559 if test "$cross_compiling" = yes; then :
18560 case "$host_os" in
9c9d63b1
PM
18561 mingw*) # on this platform, dup2 always returns 0 for success
18562 gl_cv_func_dup2_works="guessing no" ;;
18563 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
18564 gl_cv_func_dup2_works="guessing no" ;;
18565 aix* | freebsd*)
18566 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
18567 # not EBADF.
18568 gl_cv_func_dup2_works="guessing no" ;;
18569 haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
18570 gl_cv_func_dup2_works="guessing no" ;;
18571 *-android*) # implemented using dup3(), which fails if oldfd == newfd
18572 gl_cv_func_dup2_works="guessing no" ;;
18573 os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
18574 gl_cv_func_dup2_works="guessing no" ;;
18575 *) gl_cv_func_dup2_works="guessing yes" ;;
18576 esac
63ce7108
TT
18577else
18578 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18579/* end confdefs.h. */
18580
9c9d63b1
PM
18581 #include <errno.h>
18582 #include <fcntl.h>
18583 #include <limits.h>
18584 #include <sys/resource.h>
18585 #include <unistd.h>
18586
18587
18588$gl_mda_defines
18589
18590 #ifndef RLIM_SAVED_CUR
18591 # define RLIM_SAVED_CUR RLIM_INFINITY
18592 #endif
18593 #ifndef RLIM_SAVED_MAX
18594 # define RLIM_SAVED_MAX RLIM_INFINITY
18595 #endif
63ce7108
TT
18596
18597int
18598main ()
18599{
6ec2e0f5 18600int result = 0;
9c9d63b1
PM
18601 int bad_fd = INT_MAX;
18602 struct rlimit rlim;
18603 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18604 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18605 && rlim.rlim_cur != RLIM_INFINITY
18606 && rlim.rlim_cur != RLIM_SAVED_MAX
18607 && rlim.rlim_cur != RLIM_SAVED_CUR)
18608 bad_fd = rlim.rlim_cur;
18609 #ifdef FD_CLOEXEC
18610 if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
18611 result |= 1;
18612 #endif
18613 if (dup2 (1, 1) != 1)
18614 result |= 2;
18615 #ifdef FD_CLOEXEC
18616 if (fcntl (1, F_GETFD) != FD_CLOEXEC)
18617 result |= 4;
18618 #endif
18619 close (0);
18620 if (dup2 (0, 0) != -1)
18621 result |= 8;
18622 /* Many gnulib modules require POSIX conformance of EBADF. */
18623 if (dup2 (2, bad_fd) == -1 && errno != EBADF)
18624 result |= 16;
18625 /* Flush out some cygwin core dumps. */
18626 if (dup2 (2, -1) != -1 || errno != EBADF)
18627 result |= 32;
18628 dup2 (2, 255);
18629 dup2 (2, 256);
18630 /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
18631 {
18632 int fd = open (".", O_RDONLY);
18633 if (fd == -1)
18634 result |= 64;
18635 else if (dup2 (fd, fd + 1) == -1)
18636 result |= 128;
18637 close (fd);
18638 }
18639 return result;
63ce7108
TT
18640 ;
18641 return 0;
18642}
c0c3707f 18643
63ce7108
TT
18644_ACEOF
18645if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 18646 gl_cv_func_dup2_works=yes
63ce7108 18647else
c0c3707f 18648 gl_cv_func_dup2_works=no
63ce7108
TT
18649fi
18650rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18651 conftest.$ac_objext conftest.beam conftest.$ac_ext
18652fi
18653
c0c3707f 18654
63ce7108 18655fi
c0c3707f
CB
18656{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
18657$as_echo "$gl_cv_func_dup2_works" >&6; }
9c9d63b1
PM
18658 case "$gl_cv_func_dup2_works" in
18659 *yes) ;;
18660 *)
18661 REPLACE_DUP2=1
18662 for ac_func in setdtablesize
c0c3707f
CB
18663do :
18664 ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
18665if test "x$ac_cv_func_setdtablesize" = xyes; then :
18666 cat >>confdefs.h <<_ACEOF
18667#define HAVE_SETDTABLESIZE 1
18668_ACEOF
18669
18670fi
18671done
18672
9c9d63b1
PM
18673 ;;
18674 esac
63ce7108 18675
09607c9e
TT
18676
18677
18678
c0c3707f
CB
18679 if test $ac_cv_func_fchdir = no; then
18680 HAVE_FCHDIR=0
18681 fi
4a626d0a 18682
c0c3707f 18683 if test $HAVE_FCHDIR = 0; then
9c9d63b1 18684 REPLACE_DUP2=1
c0c3707f 18685 fi
4a626d0a
PA
18686
18687
9c9d63b1 18688 if test $REPLACE_DUP2 = 1; then
4a626d0a
PA
18689
18690
18691
18692
18693
18694
4a626d0a 18695
4a626d0a 18696
c0c3707f 18697 gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
4a626d0a
PA
18698
18699
c0c3707f 18700 fi
4a626d0a
PA
18701
18702
18703
18704
18705
c0c3707f 18706 GNULIB_DUP2=1
4a626d0a
PA
18707
18708
18709
18710
09607c9e 18711
c0c3707f 18712$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
09607c9e
TT
18713
18714
472fa5ee
SM
18715
18716
18717
18718
18719
09607c9e 18720
6ec2e0f5 18721
c0c3707f 18722 GNULIB_ENVIRON=1
6ec2e0f5 18723
09607c9e 18724
09607c9e 18725
6ec2e0f5
SDJ
18726
18727
c0c3707f 18728$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
6ec2e0f5
SDJ
18729
18730
6ec2e0f5 18731
5e8754f9 18732
6ec2e0f5 18733
c0c3707f
CB
18734 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
18735$as_echo_n "checking for error_at_line... " >&6; }
18736if ${ac_cv_lib_error_at_line+:} false; then :
09607c9e 18737 $as_echo_n "(cached) " >&6
4a626d0a
PA
18738else
18739 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18740/* end confdefs.h. */
c0c3707f
CB
18741#include <error.h>
18742int
18743main ()
18744{
18745error_at_line (0, 0, "", 0, "an error occurred");
18746 ;
4a626d0a
PA
18747 return 0;
18748}
18749_ACEOF
c0c3707f
CB
18750if ac_fn_c_try_link "$LINENO"; then :
18751 ac_cv_lib_error_at_line=yes
4a626d0a 18752else
c0c3707f 18753 ac_cv_lib_error_at_line=no
6ec2e0f5 18754fi
c0c3707f
CB
18755rm -f core conftest.err conftest.$ac_objext \
18756 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5 18757fi
c0c3707f
CB
18758{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
18759$as_echo "$ac_cv_lib_error_at_line" >&6; }
09607c9e 18760
c0c3707f 18761 if test $ac_cv_lib_error_at_line = no; then
09607c9e
TT
18762
18763
18764
18765
18766
18767
18768
18769
c0c3707f 18770 gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
09607c9e 18771
4a626d0a 18772
09607c9e 18773
c0c3707f 18774 :
4a626d0a 18775
c0c3707f 18776 fi
4a626d0a 18777
4a626d0a 18778
09607c9e 18779
09607c9e 18780
09607c9e
TT
18781
18782
09607c9e 18783
c0c3707f
CB
18784 if test $ac_cv_have_decl_fchdir = no; then
18785 HAVE_DECL_FCHDIR=0
18786 fi
09607c9e
TT
18787
18788
c0c3707f 18789 if test $HAVE_FCHDIR = 0; then
09607c9e
TT
18790
18791
18792
c0c3707f
CB
18793
18794
18795
18796
18797
18798 gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
18799
18800 :
18801
18802$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
18803
18804 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
18805$as_echo_n "checking whether open can visit directories... " >&6; }
18806if ${gl_cv_func_open_directory_works+:} false; then :
18807 $as_echo_n "(cached) " >&6
3d99e817 18808else
c0c3707f
CB
18809 if test "$cross_compiling" = yes; then :
18810 case "$host_os" in
9c9d63b1
PM
18811 # Guess yes on Linux systems.
18812 linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
18813 # Guess yes on glibc systems.
18814 *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
18815 # Guess no on native Windows.
18816 mingw*) gl_cv_func_open_directory_works="guessing no" ;;
18817 # If we don't know, obey --enable-cross-guesses.
18818 *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
18819 esac
c0c3707f
CB
18820
18821else
18822 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18823/* end confdefs.h. */
18824#include <fcntl.h>
18825
9c9d63b1
PM
18826
18827$gl_mda_defines
18828
c0c3707f
CB
18829int
18830main ()
18831{
18832return open(".", O_RDONLY) < 0;
18833 ;
18834 return 0;
18835}
18836_ACEOF
18837if ac_fn_c_try_run "$LINENO"; then :
18838 gl_cv_func_open_directory_works=yes
18839else
18840 gl_cv_func_open_directory_works=no
18841fi
18842rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18843 conftest.$ac_objext conftest.beam conftest.$ac_ext
3d99e817
AK
18844fi
18845
c0c3707f
CB
18846fi
18847{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
18848$as_echo "$gl_cv_func_open_directory_works" >&6; }
18849 case "$gl_cv_func_open_directory_works" in
18850 *yes) ;;
18851 *)
3d99e817 18852
c0c3707f 18853$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
09607c9e 18854
c0c3707f
CB
18855 ;;
18856 esac
18857 fi
8690e634 18858
8690e634 18859
8690e634 18860
8690e634 18861
8690e634 18862
6ec2e0f5 18863
c0c3707f 18864 GNULIB_FCHDIR=1
6ec2e0f5
SDJ
18865
18866
6ec2e0f5 18867
8690e634
JK
18868
18869
c0c3707f 18870$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
8690e634
JK
18871
18872
18873
6ec2e0f5
SDJ
18874
18875
18876
6ec2e0f5 18877
8690e634 18878
c0c3707f 18879 if test $ac_cv_func_fcntl = no; then
8690e634
JK
18880
18881
6ec2e0f5 18882
c0c3707f
CB
18883 if test $ac_cv_func_fcntl = no; then
18884 HAVE_FCNTL=0
18885 else
18886 REPLACE_FCNTL=1
18887 fi
5e8754f9 18888
c0c3707f
CB
18889 else
18890 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
18891$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
18892if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
8690e634 18893 $as_echo_n "(cached) " >&6
6ec2e0f5 18894else
c0c3707f
CB
18895 if test "$cross_compiling" = yes; then :
18896 case $host_os in
18897 aix* | cygwin* | haiku*)
18898 gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
18899 *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
18900 esac
18901else
18902 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18903/* end confdefs.h. */
18904#include <errno.h>
18905 #include <fcntl.h>
18906 #include <limits.h>
18907 #include <sys/resource.h>
18908 #include <unistd.h>
9c9d63b1
PM
18909
18910
18911$gl_mda_defines
18912
c0c3707f
CB
18913 #ifndef RLIM_SAVED_CUR
18914 # define RLIM_SAVED_CUR RLIM_INFINITY
18915 #endif
18916 #ifndef RLIM_SAVED_MAX
18917 # define RLIM_SAVED_MAX RLIM_INFINITY
18918 #endif
18919
18920int
18921main ()
18922{
18923int result = 0;
18924 int bad_fd = INT_MAX;
18925 struct rlimit rlim;
18926 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
18927 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
18928 && rlim.rlim_cur != RLIM_INFINITY
18929 && rlim.rlim_cur != RLIM_SAVED_MAX
18930 && rlim.rlim_cur != RLIM_SAVED_CUR)
18931 bad_fd = rlim.rlim_cur;
18932 if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
18933 if (errno != EINVAL) result |= 2;
18934 if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
18935 if (errno != EINVAL) result |= 8;
18936 /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
18937 {
18938 int fd;
18939 fd = open (".", O_RDONLY);
18940 if (fd == -1)
18941 result |= 16;
18942 else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
18943 result |= 32;
18944
18945 close (fd);
18946 }
18947 return result;
18948 ;
18949 return 0;
18950}
18951_ACEOF
18952if ac_fn_c_try_run "$LINENO"; then :
18953 gl_cv_func_fcntl_f_dupfd_works=yes
18954else
18955 gl_cv_func_fcntl_f_dupfd_works=no
18956fi
18957rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18958 conftest.$ac_objext conftest.beam conftest.$ac_ext
18959fi
18960
18961fi
18962{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
18963$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
18964 case $gl_cv_func_fcntl_f_dupfd_works in
18965 *yes) ;;
18966 *)
18967
18968
18969 if test $ac_cv_func_fcntl = no; then
18970 HAVE_FCNTL=0
18971 else
18972 REPLACE_FCNTL=1
18973 fi
18974
18975
18976$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
18977 ;;
18978 esac
18979
9c9d63b1 18980 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
c0c3707f
CB
18981$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
18982if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
18983 $as_echo_n "(cached) " >&6
9c9d63b1
PM
18984else
18985 if test "$cross_compiling" = yes; then :
18986 case "$host_os" in
18987 # Guess no on NetBSD.
18988 netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
18989 *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
18990 esac
18991
8690e634
JK
18992else
18993 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18994/* end confdefs.h. */
c0c3707f 18995#include <fcntl.h>
9c9d63b1
PM
18996 #include <unistd.h>
18997 int main (int argc, char *argv[])
18998 {
18999 if (argc == 1)
19000 /* parent process */
19001 {
19002 if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
19003 return 1;
19004 return execl ("./conftest", "./conftest", "child", NULL);
19005 }
19006 else
19007 /* child process */
19008 return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
19009 }
c0c3707f 19010
c0c3707f 19011
c0c3707f 19012_ACEOF
9c9d63b1 19013if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
19014 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19015/* end confdefs.h. */
19016
19017#ifdef __linux__
19018/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
19019 it to support the semantics on older kernels that failed with EINVAL. */
19020choke me
19021#endif
8690e634 19022
8690e634
JK
19023int
19024main ()
19025{
19026
19027 ;
19028 return 0;
19029}
19030_ACEOF
c0c3707f
CB
19031if ac_fn_c_try_compile "$LINENO"; then :
19032 gl_cv_func_fcntl_f_dupfd_cloexec=yes
8690e634 19033else
c0c3707f 19034 gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
8690e634 19035fi
c0c3707f 19036rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9c9d63b1 19037
c0c3707f
CB
19038else
19039 gl_cv_func_fcntl_f_dupfd_cloexec=no
19040fi
9c9d63b1
PM
19041rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19042 conftest.$ac_objext conftest.beam conftest.$ac_ext
19043fi
19044
19045
8690e634 19046fi
c0c3707f
CB
19047{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
19048$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
9c9d63b1
PM
19049 case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
19050 *yes) ;;
19051 *)
8690e634 19052
c0c3707f
CB
19053
19054 if test $ac_cv_func_fcntl = no; then
19055 HAVE_FCNTL=0
5e8754f9 19056 else
c0c3707f
CB
19057 REPLACE_FCNTL=1
19058 fi
19059
9c9d63b1
PM
19060 ;;
19061 esac
8690e634
JK
19062 fi
19063
19064
8690e634 19065
8690e634 19066
c0c3707f
CB
19067 if test $ac_cv_func_fchdir = no; then
19068 HAVE_FCHDIR=0
19069 fi
6ec2e0f5 19070
c0c3707f 19071 if test $HAVE_FCHDIR = 0; then
6ec2e0f5
SDJ
19072
19073
19074
c0c3707f
CB
19075 if test $ac_cv_func_fcntl = no; then
19076 HAVE_FCNTL=0
19077 else
19078 REPLACE_FCNTL=1
19079 fi
6ec2e0f5 19080
c0c3707f 19081 fi
6ec2e0f5
SDJ
19082
19083
c0c3707f 19084 if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
6ec2e0f5 19085
6ec2e0f5
SDJ
19086
19087
5e8754f9
SDJ
19088
19089
8690e634 19090
8690e634
JK
19091
19092
c0c3707f 19093 gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
472fa5ee 19094
c0c3707f 19095 fi
472fa5ee
SM
19096
19097
19098
19099
19100
c0c3707f 19101 GNULIB_FCNTL=1
472fa5ee
SM
19102
19103
19104
19105
19106
c0c3707f 19107$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
472fa5ee
SM
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
c0c3707f
CB
19122 if test $gl_cv_have_include_next = yes; then
19123 gl_cv_next_fcntl_h='<'fcntl.h'>'
19124 else
19125 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
19126$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
19127if ${gl_cv_next_fcntl_h+:} false; then :
19128 $as_echo_n "(cached) " >&6
19129else
472fa5ee
SM
19130
19131
472fa5ee 19132
c0c3707f
CB
19133 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19134/* end confdefs.h. */
19135#include <fcntl.h>
19136_ACEOF
19137 case "$host_os" in
19138 aix*) gl_absname_cpp="$ac_cpp -C" ;;
19139 *) gl_absname_cpp="$ac_cpp" ;;
19140 esac
472fa5ee 19141
c0c3707f
CB
19142 case "$host_os" in
19143 mingw*)
19144 gl_dirsep_regex='[/\\]'
19145 ;;
19146 *)
19147 gl_dirsep_regex='\/'
19148 ;;
19149 esac
19150 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
19151 gl_header_literal_regex=`echo 'fcntl.h' \
19152 | sed -e "$gl_make_literal_regex_sed"`
19153 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
19154 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
19155 s|^/[^/]|//&|
19156 p
19157 q
19158 }'
472fa5ee 19159
c0c3707f
CB
19160 gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
19161 sed -n "$gl_absolute_header_sed"`
472fa5ee 19162
c0c3707f
CB
19163 gl_header=$gl_cv_absolute_fcntl_h
19164 gl_cv_next_fcntl_h='"'$gl_header'"'
8690e634
JK
19165
19166
c0c3707f
CB
19167fi
19168{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
19169$as_echo "$gl_cv_next_fcntl_h" >&6; }
19170 fi
19171 NEXT_FCNTL_H=$gl_cv_next_fcntl_h
8690e634 19172
c0c3707f
CB
19173 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
19174 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
19175 gl_next_as_first_directive='<'fcntl.h'>'
19176 else
19177 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
19178 gl_next_as_first_directive=$gl_cv_next_fcntl_h
19179 fi
19180 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
8690e634
JK
19181
19182
19183
19184
5e8754f9
SDJ
19185
19186
19187
19188
472fa5ee
SM
19189
19190
19191
19192
19193
19194
19195
5e8754f9 19196cat >>confdefs.h <<_ACEOF
c0c3707f 19197#define GNULIB_FD_SAFER_FLAG 1
5e8754f9 19198_ACEOF
472fa5ee
SM
19199
19200
c0c3707f
CB
19201
19202
19203
19204
19205
19206 ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
19207#include <dirent.h>
19208
5e8754f9 19209"
c0c3707f 19210if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
5e8754f9
SDJ
19211 ac_have_decl=1
19212else
19213 ac_have_decl=0
19214fi
472fa5ee 19215
5e8754f9 19216cat >>confdefs.h <<_ACEOF
c0c3707f 19217#define HAVE_DECL_FDOPENDIR $ac_have_decl
5e8754f9 19218_ACEOF
c0c3707f 19219if test $ac_have_decl = 1; then :
472fa5ee 19220
c0c3707f
CB
19221else
19222 HAVE_DECL_FDOPENDIR=0
19223fi
472fa5ee
SM
19224
19225
c0c3707f
CB
19226 if test $ac_cv_func_fdopendir = no; then
19227 HAVE_FDOPENDIR=0
19228 else
19229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
19230$as_echo_n "checking whether fdopendir works... " >&6; }
19231if ${gl_cv_func_fdopendir_works+:} false; then :
19232 $as_echo_n "(cached) " >&6
19233else
19234 if test "$cross_compiling" = yes; then :
19235 case "$host_os" in
19236 # Guess yes on glibc systems.
19237 *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
19238 # Guess yes on musl systems.
19239 *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
19240 # If we don't know, obey --enable-cross-guesses.
19241 *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
19242 esac
472fa5ee 19243
c0c3707f
CB
19244else
19245 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19246/* end confdefs.h. */
472fa5ee 19247
c0c3707f
CB
19248#include <dirent.h>
19249#include <fcntl.h>
19250#include <unistd.h>
9c9d63b1
PM
19251
19252
19253$gl_mda_defines
19254
c0c3707f
CB
19255#if !HAVE_DECL_FDOPENDIR
19256extern
19257# ifdef __cplusplus
19258"C"
19259# endif
19260DIR *fdopendir (int);
19261#endif
472fa5ee 19262
c0c3707f
CB
19263int
19264main ()
19265{
19266int result = 0;
9c9d63b1
PM
19267 int fd = open ("conftest.c", O_RDONLY);
19268 if (fd < 0) result |= 1;
19269 if (fdopendir (fd)) result |= 2;
19270 if (close (fd)) result |= 4;
19271 return result;
19272
c0c3707f
CB
19273 ;
19274 return 0;
19275}
19276_ACEOF
19277if ac_fn_c_try_run "$LINENO"; then :
19278 gl_cv_func_fdopendir_works=yes
19279else
19280 gl_cv_func_fdopendir_works=no
19281fi
19282rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19283 conftest.$ac_objext conftest.beam conftest.$ac_ext
19284fi
472fa5ee 19285
c0c3707f
CB
19286fi
19287{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
19288$as_echo "$gl_cv_func_fdopendir_works" >&6; }
19289 case "$gl_cv_func_fdopendir_works" in
19290 *yes) ;;
19291 *)
19292 REPLACE_FDOPENDIR=1
19293 ;;
19294 esac
19295 fi
472fa5ee 19296
c0c3707f 19297 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
472fa5ee
SM
19298
19299
19300
19301
19302
98399780 19303
5e8754f9
SDJ
19304
19305
c0c3707f 19306 gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
5e8754f9 19307
c0c3707f 19308 fi
5e8754f9
SDJ
19309
19310
19311
19312
19313
c0c3707f 19314 GNULIB_FDOPENDIR=1
5e8754f9
SDJ
19315
19316
19317
19318
19319
c0c3707f 19320$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
5e8754f9
SDJ
19321
19322
5e8754f9
SDJ
19323
19324
19325
c0c3707f
CB
19326cat >>confdefs.h <<_ACEOF
19327#define GNULIB_FDOPENDIR 1
19328_ACEOF
5e8754f9
SDJ
19329
19330
19331
5e8754f9
SDJ
19332
19333
19334
c0c3707f
CB
19335 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
19336$as_echo_n "checking for flexible array member... " >&6; }
19337if ${ac_cv_c_flexmember+:} false; then :
5e8754f9 19338 $as_echo_n "(cached) " >&6
6ec2e0f5 19339else
c0c3707f 19340 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 19341/* end confdefs.h. */
c0c3707f
CB
19342#include <stdlib.h>
19343 #include <stdio.h>
19344 #include <stddef.h>
19345 struct m { struct m *next, **list; char name[]; };
19346 struct s { struct s *p; struct m *m; int n; double d[]; };
5e8754f9
SDJ
19347int
19348main ()
19349{
c0c3707f
CB
19350int m = getchar ();
19351 size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
19352 nbytes += sizeof (struct s) - 1;
19353 nbytes -= nbytes % sizeof (struct s);
19354 struct s *p = malloc (nbytes);
19355 p->p = p;
19356 p->m = NULL;
19357 p->d[0] = 0.0;
19358 return p->d != (double *) NULL;
5e8754f9
SDJ
19359 ;
19360 return 0;
19361}
7a6dbc2f 19362_ACEOF
c0c3707f
CB
19363if ac_fn_c_try_compile "$LINENO"; then :
19364 ac_cv_c_flexmember=yes
5e8754f9 19365else
c0c3707f 19366 ac_cv_c_flexmember=no
5e8754f9 19367fi
c0c3707f 19368rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5e8754f9 19369fi
c0c3707f
CB
19370{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
19371$as_echo "$ac_cv_c_flexmember" >&6; }
19372 if test $ac_cv_c_flexmember = yes; then
19373
19374$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
5e8754f9 19375
c0c3707f
CB
19376 else
19377 $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
98399780 19378
c0c3707f 19379 fi
98399780 19380
472fa5ee
SM
19381
19382
19383
c0c3707f
CB
19384 FLOAT_H=
19385 REPLACE_FLOAT_LDBL=0
19386 case "$host_os" in
19387 aix* | beos* | openbsd* | mirbsd* | irix*)
19388 FLOAT_H=float.h
19389 ;;
19390 freebsd* | dragonfly*)
19391 case "$host_cpu" in
19392 i[34567]86 )
19393 FLOAT_H=float.h
19394 ;;
19395 x86_64 )
19396 # On x86_64 systems, the C compiler may still be generating
19397 # 32-bit code.
19398 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19399/* end confdefs.h. */
19400#if defined __LP64__ || defined __x86_64__ || defined __amd64__
19401 int ok;
19402 #else
19403 error fail
19404 #endif
472fa5ee 19405
c0c3707f
CB
19406_ACEOF
19407if ac_fn_c_try_compile "$LINENO"; then :
472fa5ee 19408
c0c3707f
CB
19409else
19410 FLOAT_H=float.h
19411fi
19412rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19413 ;;
19414 esac
19415 ;;
19416 linux*)
19417 case "$host_cpu" in
19418 powerpc*)
19419 FLOAT_H=float.h
19420 ;;
19421 esac
19422 ;;
19423 esac
19424 case "$host_os" in
19425 aix* | freebsd* | dragonfly* | linux*)
19426 if test -n "$FLOAT_H"; then
19427 REPLACE_FLOAT_LDBL=1
19428 fi
19429 ;;
19430 esac
19431
19432 REPLACE_ITOLD=0
19433 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
19434$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
19435if ${gl_cv_func_itold_works+:} false; then :
5e8754f9
SDJ
19436 $as_echo_n "(cached) " >&6
19437else
19438
19439 if test "$cross_compiling" = yes; then :
c0c3707f
CB
19440 case "$host" in
19441 sparc*-*-linux*)
19442 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19443/* end confdefs.h. */
19444#if defined __LP64__ || defined __arch64__
19445 int ok;
19446 #else
19447 error fail
19448 #endif
19449
19450_ACEOF
19451if ac_fn_c_try_compile "$LINENO"; then :
19452 gl_cv_func_itold_works="guessing no"
19453else
19454 gl_cv_func_itold_works="guessing yes"
19455fi
19456rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19457 ;;
19458 # Guess yes on native Windows.
19459 mingw*) gl_cv_func_itold_works="guessing yes" ;;
19460 *) gl_cv_func_itold_works="guessing yes" ;;
5e8754f9
SDJ
19461 esac
19462
19463else
19464 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19465/* end confdefs.h. */
19466
c0c3707f
CB
19467int i = -1;
19468volatile long double ld;
19469int main ()
5e8754f9 19470{
c0c3707f
CB
19471 ld += i * 1.0L;
19472 if (ld > 0)
19473 return 1;
19474 return 0;
5e8754f9
SDJ
19475}
19476_ACEOF
19477if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 19478 gl_cv_func_itold_works=yes
5e8754f9 19479else
c0c3707f 19480 gl_cv_func_itold_works=no
5e8754f9
SDJ
19481fi
19482rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19483 conftest.$ac_objext conftest.beam conftest.$ac_ext
19484fi
19485
98399780 19486
5e8754f9 19487fi
c0c3707f
CB
19488{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
19489$as_echo "$gl_cv_func_itold_works" >&6; }
19490 case "$gl_cv_func_itold_works" in
19491 *no)
19492 REPLACE_ITOLD=1
19493 FLOAT_H=float.h
19494 ;;
19495 esac
98399780 19496
c0c3707f 19497 if test -n "$FLOAT_H"; then
98399780
YQ
19498
19499
19500
19501
6a29c58e
YQ
19502
19503
19504
19505
c0c3707f
CB
19506 if test $gl_cv_have_include_next = yes; then
19507 gl_cv_next_float_h='<'float.h'>'
19508 else
19509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
19510$as_echo_n "checking absolute name of <float.h>... " >&6; }
19511if ${gl_cv_next_float_h+:} false; then :
19512 $as_echo_n "(cached) " >&6
19513else
19514
19515
19516
19517 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19518/* end confdefs.h. */
19519#include <float.h>
19520_ACEOF
19521 case "$host_os" in
19522 aix*) gl_absname_cpp="$ac_cpp -C" ;;
19523 *) gl_absname_cpp="$ac_cpp" ;;
19524 esac
19525
19526 case "$host_os" in
19527 mingw*)
19528 gl_dirsep_regex='[/\\]'
19529 ;;
19530 *)
19531 gl_dirsep_regex='\/'
19532 ;;
19533 esac
19534 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
19535 gl_header_literal_regex=`echo 'float.h' \
19536 | sed -e "$gl_make_literal_regex_sed"`
19537 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
19538 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
19539 s|^/[^/]|//&|
19540 p
19541 q
19542 }'
19543
19544 gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
19545 sed -n "$gl_absolute_header_sed"`
19546
19547 gl_header=$gl_cv_absolute_float_h
19548 gl_cv_next_float_h='"'$gl_header'"'
19549
19550
19551fi
19552{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
19553$as_echo "$gl_cv_next_float_h" >&6; }
19554 fi
19555 NEXT_FLOAT_H=$gl_cv_next_float_h
19556
19557 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
19558 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
19559 gl_next_as_first_directive='<'float.h'>'
19560 else
19561 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
19562 gl_next_as_first_directive=$gl_cv_next_float_h
19563 fi
19564 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
19565
19566
19567
6a29c58e 19568
c0c3707f 19569 fi
6a29c58e 19570
c0c3707f
CB
19571 if test -n "$FLOAT_H"; then
19572 GL_GENERATE_FLOAT_H_TRUE=
19573 GL_GENERATE_FLOAT_H_FALSE='#'
19574else
19575 GL_GENERATE_FLOAT_H_TRUE='#'
19576 GL_GENERATE_FLOAT_H_FALSE=
19577fi
6a29c58e
YQ
19578
19579
8690e634 19580
c0c3707f 19581 if test $REPLACE_FLOAT_LDBL = 1; then
8690e634 19582
8690e634 19583
8690e634 19584
8690e634 19585
8690e634 19586
8690e634 19587
8690e634 19588
4a626d0a 19589
c0c3707f 19590 gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
8690e634 19591
c0c3707f
CB
19592 fi
19593 if test $REPLACE_ITOLD = 1; then
8690e634
JK
19594
19595
19596
19597
19598
19599
63ce7108 19600
e26b6bb0 19601
c0c3707f 19602 gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
e26b6bb0 19603
c0c3707f 19604 fi
e26b6bb0
TT
19605
19606
19607
19608
c0c3707f
CB
19609 gl_fnmatch_required_lowercase=`
19610 echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
19611 `
e26b6bb0 19612
c0c3707f
CB
19613 if test $ac_cv_func_fnmatch = no; then
19614 HAVE_FNMATCH=0
19615 else
19616 gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
19617 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
19618$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; }
19619if eval \${$gl_fnmatch_cache_var+:} false; then :
5e8754f9
SDJ
19620 $as_echo_n "(cached) " >&6
19621else
c0c3707f
CB
19622 if test $gl_fnmatch_required = GNU; then
19623 gl_fnmatch_gnu_start=
19624 gl_fnmatch_gnu_end=
19625 else
19626 gl_fnmatch_gnu_start='#if 0'
19627 gl_fnmatch_gnu_end='#endif'
19628 fi
19629 if test "$cross_compiling" = yes; then :
19630 case "$host_os" in
19631 # Guess yes on musl systems.
19632 *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
19633 # Guess no otherwise, even on glibc systems.
19634 *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
19635 esac
e26b6bb0 19636
c0c3707f
CB
19637else
19638 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 19639/* end confdefs.h. */
c0c3707f
CB
19640#include <fnmatch.h>
19641 static int
19642 y (char const *pattern, char const *string, int flags)
19643 {
19644 return fnmatch (pattern, string, flags) == 0;
19645 }
19646 static int
19647 n (char const *pattern, char const *string, int flags)
19648 {
19649 return fnmatch (pattern, string, flags) == FNM_NOMATCH;
19650 }
19651
5e8754f9
SDJ
19652int
19653main ()
19654{
c0c3707f
CB
19655char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
19656 char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
19657 static char const A_1[] = { 'A' - 1, 0 };
19658 static char const A01[] = { 'A' + 1, 0 };
19659 static char const a_1[] = { 'a' - 1, 0 };
19660 static char const a01[] = { 'a' + 1, 0 };
19661 static char const bs_1[] = { '\\\\' - 1, 0 };
19662 static char const bs01[] = { '\\\\' + 1, 0 };
19663 int result = 0;
19664 if (!n ("a*", "", 0))
19665 return 1;
19666 if (!y ("a*", "abc", 0))
19667 return 1;
19668 if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
19669 return 1;
19670 if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
19671 return 2;
19672 if (!y ("a\\\\bc", "abc", 0))
19673 return 3;
19674 if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
19675 return 3;
19676 if (!y ("*x", ".x", 0))
19677 return 4;
19678 if (!n ("*x", ".x", FNM_PERIOD))
19679 return 4;
19680 if (!y (Apat, "\\\\", 0))
19681 return 5;
19682 if (!y (Apat, "A", 0))
19683 return 5;
19684 if (!y (apat, "\\\\", 0))
19685 return 5;
19686 if (!y (apat, "a", 0))
19687 return 5;
19688 if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
19689 return 5;
19690 if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
19691 return 5;
19692 if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
19693 return 5;
19694 if (!(y (apat, a01, 0) == ('a' < '\\\\')))
19695 return 5;
19696 if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
19697 return 5;
19698 if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
19699 return 5;
19700 if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
19701 return 5;
19702 if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
19703 return 5;
19704 $gl_fnmatch_gnu_start
19705 if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
19706 result |= 8;
19707 if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
19708 result |= 16;
19709 if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
19710 result |= 32;
19711 if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
19712 result |= 64;
19713 if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
19714 result |= 64;
19715 if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
19716 result |= 64;
19717 $gl_fnmatch_gnu_end
19718 return result;
19719
5e8754f9
SDJ
19720 ;
19721 return 0;
19722}
19723_ACEOF
c0c3707f
CB
19724if ac_fn_c_try_run "$LINENO"; then :
19725 eval "$gl_fnmatch_cache_var=yes"
5e8754f9 19726else
c0c3707f
CB
19727 eval "$gl_fnmatch_cache_var=no"
19728fi
19729rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19730 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 19731fi
c0c3707f 19732
e26b6bb0 19733
5e8754f9 19734fi
c0c3707f
CB
19735eval ac_res=\$$gl_fnmatch_cache_var
19736 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
19737$as_echo "$ac_res" >&6; }
19738 eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
19739 case "$gl_fnmatch_result" in
19740 *yes) ;;
19741 *) REPLACE_FNMATCH=1 ;;
19742 esac
19743 fi
19744 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
e26b6bb0 19745
e26b6bb0 19746
c0c3707f
CB
19747 FNMATCH_H='fnmatch.h'
19748 if test -n "$FNMATCH_H"; then
19749 GL_GENERATE_FNMATCH_H_TRUE=
19750 GL_GENERATE_FNMATCH_H_FALSE='#'
5e8754f9 19751else
c0c3707f
CB
19752 GL_GENERATE_FNMATCH_H_TRUE='#'
19753 GL_GENERATE_FNMATCH_H_FALSE=
5e8754f9 19754fi
e26b6bb0 19755
18848e28 19756
c0c3707f 19757 fi
18848e28 19758
c0c3707f 19759 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18848e28 19760
18848e28 19761
18848e28 19762
c0c3707f
CB
19763
19764
19765
19766
19767
19768 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19769
19770
19771
c0c3707f
CB
19772
19773
19774 fi
19775
19776
19777
19778
19779
19780 GNULIB_FNMATCH=1
19781
19782
19783
19784
19785
19786$as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h
19787
19788
19789
19790
19791
19792
19793
19794
19795 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
19796
19797
19798
19799
19800
19801
19802
19803
19804 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
19805
19806
19807
18848e28 19808
18848e28 19809
5e8754f9 19810 fi
18848e28 19811
18848e28 19812
c0c3707f
CB
19813cat >>confdefs.h <<_ACEOF
19814#define GNULIB_FNMATCH_GNU 1
19815_ACEOF
18848e28 19816
18848e28 19817
18848e28 19818
18848e28 19819
9c9d63b1
PM
19820
19821
19822 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether free is known to preserve errno" >&5
19823$as_echo_n "checking whether free is known to preserve errno... " >&6; }
19824if ${gl_cv_func_free_preserves_errno+:} false; then :
19825 $as_echo_n "(cached) " >&6
19826else
19827 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19828/* end confdefs.h. */
19829#include <stdlib.h>
19830
19831int
19832main ()
19833{
19834#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
19835 #elif defined __OpenBSD__
19836 #elif defined __sun
19837 #else
19838 #error "'free' is not known to preserve errno"
19839 #endif
19840
19841 ;
19842 return 0;
19843}
19844_ACEOF
19845if ac_fn_c_try_compile "$LINENO"; then :
19846 gl_cv_func_free_preserves_errno=yes
19847else
19848 gl_cv_func_free_preserves_errno=no
19849fi
19850rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19851
19852fi
19853{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_free_preserves_errno" >&5
19854$as_echo "$gl_cv_func_free_preserves_errno" >&6; }
19855
19856 case $gl_cv_func_free_preserves_errno in
19857 *yes) ;;
19858 *) REPLACE_FREE=1 ;;
19859 esac
19860
19861 if test $REPLACE_FREE = 1; then
19862
19863
19864
19865
19866
19867
19868
19869
19870 gl_LIBOBJS="$gl_LIBOBJS free.$ac_objext"
19871
19872 :
19873 fi
19874
19875
19876
19877
19878
19879 GNULIB_FREE_POSIX=1
19880
19881
19882
19883
19884
19885$as_echo "#define GNULIB_TEST_FREE_POSIX 1" >>confdefs.h
19886
19887
19888
19889
c0c3707f
CB
19890 if test $gl_func_frexp != yes; then
19891
19892
18848e28
GF
19893
19894
18848e28 19895
18848e28 19896
18848e28 19897
c0c3707f
CB
19898
19899 gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
18848e28
GF
19900
19901 fi
19902
19903
19904
19905
19906
c0c3707f 19907 GNULIB_FREXP=1
18848e28
GF
19908
19909
19910
19911
19912
c0c3707f 19913$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
18848e28
GF
19914
19915
19916
19917
c0c3707f
CB
19918 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
19919
19920
19921
18848e28
GF
19922
19923
19924
5e8754f9
SDJ
19925
19926
c0c3707f
CB
19927 gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
19928
5e8754f9 19929 fi
18848e28 19930
6a29c58e 19931
6a29c58e 19932
6a29c58e 19933
6ec2e0f5 19934
c0c3707f
CB
19935 GNULIB_FREXPL=1
19936
19937
19938
19939
19940
19941$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
19942
19943
19944
19945
19946
19947
19948
19949 case "$host_os" in
19950 mingw* | solaris*)
19951 REPLACE_FSTAT=1
19952 ;;
19953 esac
472fa5ee
SM
19954
19955
19956
19957
19958
6ec2e0f5
SDJ
19959 if test $ac_cv_func_fchdir = no; then
19960 HAVE_FCHDIR=0
6a29c58e
YQ
19961 fi
19962
6ec2e0f5
SDJ
19963 if test $HAVE_FCHDIR = 0; then
19964 case "$gl_cv_func_open_directory_works" in
19965 *yes) ;;
19966 *)
19967 REPLACE_FSTAT=1
19968 ;;
19969 esac
19970 fi
6a29c58e
YQ
19971
19972
6ec2e0f5 19973 if test $REPLACE_FSTAT = 1; then
6a29c58e 19974
3d99e817
AK
19975
19976
19977
3d99e817
AK
19978
19979
19980
19981
6ec2e0f5 19982 gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
3d99e817 19983
c0c3707f
CB
19984 case "$host_os" in
19985 mingw*)
3d99e817
AK
19986
19987
19988
19989
19990
19991
49e4877c 19992
49e4877c 19993
c0c3707f 19994 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
49e4877c 19995
c0c3707f
CB
19996 ;;
19997 esac
49e4877c
PA
19998
19999
9c9d63b1 20000
c0c3707f
CB
20001 :
20002
20003 fi
6a29c58e
YQ
20004
20005
88b48903 20006
8690e634 20007
a512b375 20008
c0c3707f
CB
20009 GNULIB_FSTAT=1
20010
20011
20012
20013
20014
20015$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
20016
20017
88b48903 20018
88b48903 20019
472fa5ee
SM
20020
20021
20022
20023
20024
6ec2e0f5
SDJ
20025
20026 if test $ac_cv_func_fstatat = no; then
20027 HAVE_FSTATAT=0
20028 else
20029 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
20030$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
d0ac1c44 20031if ${gl_cv_func_fstatat_zero_flag+:} false; then :
6ec2e0f5
SDJ
20032 $as_echo_n "(cached) " >&6
20033else
20034 if test "$cross_compiling" = yes; then :
20035 case "$host_os" in
20036 aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
20037 *) gl_cv_func_fstatat_zero_flag="guessing yes";;
20038 esac
88b48903 20039
8690e634
JK
20040else
20041 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20042/* end confdefs.h. */
8690e634 20043
6ec2e0f5
SDJ
20044 #include <fcntl.h>
20045 #include <sys/stat.h>
20046 int
20047 main (void)
20048 {
20049 struct stat a;
20050 return fstatat (AT_FDCWD, ".", &a, 0) != 0;
20051 }
20052
88b48903
WN
20053_ACEOF
20054if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20055 gl_cv_func_fstatat_zero_flag=yes
88b48903 20056else
6ec2e0f5 20057 gl_cv_func_fstatat_zero_flag=no
88b48903
WN
20058fi
20059rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20060 conftest.$ac_objext conftest.beam conftest.$ac_ext
20061fi
20062
20063
20064fi
6ec2e0f5
SDJ
20065{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
20066$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
88b48903 20067
6ec2e0f5
SDJ
20068 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
20069 *yes+*yes) ;;
c0c3707f
CB
20070 *) REPLACE_FSTATAT=1 ;;
20071 esac
20072
20073 case $host_os in
20074 solaris*)
20075 REPLACE_FSTATAT=1 ;;
20076 esac
20077
20078 case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
20079 1,*yes)
88b48903 20080
6ec2e0f5 20081$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
88b48903 20082
7a6dbc2f 20083 ;;
6ec2e0f5
SDJ
20084 esac
20085 fi
88b48903 20086
6ec2e0f5 20087 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
88b48903
WN
20088
20089
20090
20091
20092
88b48903 20093
4a626d0a
PA
20094
20095
6ec2e0f5
SDJ
20096 gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
20097
20098 fi
20099
20100
20101
4a626d0a 20102
6ec2e0f5
SDJ
20103
20104 GNULIB_FSTATAT=1
20105
20106
20107
20108
20109
20110$as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
20111
20112
20113
20114
20115
20116
20117
20118
20119 gl_abort_bug=no
4a626d0a
PA
20120 case "$host_os" in
20121 mingw*)
6ec2e0f5 20122 gl_cv_func_getcwd_path_max=yes
4a626d0a
PA
20123 ;;
20124 *)
88b48903 20125
88b48903 20126
88b48903
WN
20127
20128
88b48903 20129
6ec2e0f5
SDJ
20130 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
20131$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
d0ac1c44 20132if ${gl_cv_func_getcwd_path_max+:} false; then :
6ec2e0f5
SDJ
20133 $as_echo_n "(cached) " >&6
20134else
20135 # Arrange for deletion of the temporary directory this test creates.
20136 ac_clean_files="$ac_clean_files confdir3"
20137 if test "$cross_compiling" = yes; then :
b567ca63 20138 # Cross-compilation guesses:
c0c3707f
CB
20139 case "$host_os" in
20140 aix*) # On AIX, it has the AIX bug.
20141 gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
20142 gnu*) # On Hurd, it is 'yes'.
20143 gl_cv_func_getcwd_path_max='guessing yes' ;;
20144 linux* | kfreebsd*)
20145 # On older Linux+glibc it's 'no, but it is partly working',
20146 # on newer Linux+glibc it's 'yes'.
20147 # On Linux+musl libc, it's 'no, but it is partly working'.
20148 # On kFreeBSD+glibc, it's 'no, but it is partly working'.
20149 gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
20150 *) # If we don't know, obey --enable-cross-guesses.
20151 gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
20152 esac
b567ca63 20153
6ec2e0f5
SDJ
20154else
20155 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20156/* end confdefs.h. */
88b48903 20157
6ec2e0f5
SDJ
20158#include <errno.h>
20159#include <stdlib.h>
20160#if HAVE_UNISTD_H
20161# include <unistd.h>
20162#else
20163# include <direct.h>
20164#endif
20165#include <string.h>
20166#include <limits.h>
20167#include <sys/stat.h>
20168#include <sys/types.h>
20169#include <fcntl.h>
88b48903
WN
20170
20171
6ec2e0f5
SDJ
20172/* Arrange to define PATH_MAX, like "pathmax.h" does. */
20173#if HAVE_UNISTD_H
20174# include <unistd.h>
20175#endif
20176#include <limits.h>
20177#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
20178# include <sys/param.h>
20179#endif
20180#if !defined PATH_MAX && defined MAXPATHLEN
20181# define PATH_MAX MAXPATHLEN
20182#endif
20183#ifdef __hpux
20184# undef PATH_MAX
20185# define PATH_MAX 1024
20186#endif
c0c3707f 20187#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
20188# undef PATH_MAX
20189# define PATH_MAX 260
20190#endif
88b48903 20191
88b48903 20192
6ec2e0f5
SDJ
20193#ifndef AT_FDCWD
20194# define AT_FDCWD 0
20195#endif
20196#ifdef ENAMETOOLONG
20197# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
20198#else
20199# define is_ENAMETOOLONG(x) 0
20200#endif
88b48903 20201
6ec2e0f5
SDJ
20202/* Use the getcwd function, not any macro. */
20203#undef getcwd
88b48903 20204
9c9d63b1
PM
20205
20206
20207$gl_mda_defines
20208
88b48903 20209
6ec2e0f5
SDJ
20210#ifndef S_IRWXU
20211# define S_IRWXU 0700
20212#endif
88b48903 20213
6ec2e0f5
SDJ
20214/* The length of this name must be 8. */
20215#define DIR_NAME "confdir3"
20216#define DIR_NAME_LEN 8
20217#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
88b48903 20218
6ec2e0f5
SDJ
20219/* The length of "../". */
20220#define DOTDOTSLASH_LEN 3
88b48903 20221
6ec2e0f5
SDJ
20222/* Leftover bytes in the buffer, to work around library or OS bugs. */
20223#define BUF_SLOP 20
88b48903 20224
6ec2e0f5
SDJ
20225int
20226main ()
20227{
20228#ifndef PATH_MAX
20229 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
20230 at least not on a local file system. And if we were to start worrying
20231 about remote file systems, we'd have to enable the wrapper function
20232 all of the time, just to be safe. That's not worth the cost. */
20233 exit (0);
20234#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
20235 - DIR_NAME_SIZE - BUF_SLOP) \
20236 <= PATH_MAX)
20237 /* FIXME: Assuming there's a system for which this is true,
20238 this should be done in a compile test. */
20239 exit (0);
20240#else
20241 char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
20242 + DIR_NAME_SIZE + BUF_SLOP];
20243 char *cwd = getcwd (buf, PATH_MAX);
20244 size_t initial_cwd_len;
20245 size_t cwd_len;
20246 int fail = 0;
20247 size_t n_chdirs = 0;
88b48903 20248
6ec2e0f5
SDJ
20249 if (cwd == NULL)
20250 exit (10);
88b48903 20251
6ec2e0f5 20252 cwd_len = initial_cwd_len = strlen (cwd);
88b48903 20253
6ec2e0f5
SDJ
20254 while (1)
20255 {
20256 size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
20257 char *c = NULL;
20258
20259 cwd_len += DIR_NAME_SIZE;
20260 /* If mkdir or chdir fails, it could be that this system cannot create
20261 any file with an absolute name longer than PATH_MAX, such as cygwin.
20262 If so, leave fail as 0, because the current working directory can't
c0c3707f
CB
20263 be too long for getcwd if it can't even be created. On Linux with
20264 the 9p file system, mkdir fails with error EINVAL when cwd_len gets
20265 too long; ignore this failure because the getcwd() system call
20266 produces good results whereas the gnulib substitute calls getdents64
20267 which fails with error EPROTO.
20268 For other errors, be pessimistic and consider that as a failure,
20269 too. */
6ec2e0f5
SDJ
20270 if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
20271 {
20272 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
c0c3707f
CB
20273 #ifdef __linux__
20274 if (! (errno == EINVAL))
20275 #endif
20276 fail = 20;
6ec2e0f5
SDJ
20277 break;
20278 }
88b48903 20279
6ec2e0f5
SDJ
20280 if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
20281 {
20282 struct stat sb;
88b48903 20283
6ec2e0f5
SDJ
20284 c = getcwd (buf, PATH_MAX);
20285 if (!c && errno == ENOENT)
20286 {
20287 fail = 11;
20288 break;
20289 }
20290 if (c)
20291 {
20292 fail = 31;
20293 break;
20294 }
20295 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
20296 {
20297 fail = 21;
20298 break;
20299 }
88b48903 20300
6ec2e0f5
SDJ
20301 /* Our replacement needs to be able to stat() long ../../paths,
20302 so generate a path larger than PATH_MAX to check,
20303 avoiding the replacement if we can't stat(). */
20304 c = getcwd (buf, cwd_len + 1);
20305 if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
20306 {
20307 fail = 32;
20308 break;
20309 }
20310 }
88b48903 20311
6ec2e0f5
SDJ
20312 if (dotdot_max <= cwd_len - initial_cwd_len)
20313 {
20314 if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
20315 break;
20316 c = getcwd (buf, cwd_len + 1);
20317 if (!c)
20318 {
20319 if (! (errno == ERANGE || errno == ENOENT
20320 || is_ENAMETOOLONG (errno)))
20321 {
20322 fail = 22;
20323 break;
20324 }
20325 if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
20326 {
20327 fail = 12;
20328 break;
20329 }
20330 }
20331 }
88b48903 20332
6ec2e0f5
SDJ
20333 if (c && strlen (c) != cwd_len)
20334 {
20335 fail = 23;
20336 break;
20337 }
20338 ++n_chdirs;
20339 }
88b48903 20340
6ec2e0f5
SDJ
20341 /* Leaving behind such a deep directory is not polite.
20342 So clean up here, right away, even though the driving
20343 shell script would also clean up. */
20344 {
20345 size_t i;
88b48903 20346
6ec2e0f5
SDJ
20347 /* Try rmdir first, in case the chdir failed. */
20348 rmdir (DIR_NAME);
20349 for (i = 0; i <= n_chdirs; i++)
20350 {
20351 if (chdir ("..") < 0)
20352 break;
20353 if (rmdir (DIR_NAME) != 0)
20354 break;
20355 }
20356 }
88b48903 20357
6ec2e0f5
SDJ
20358 exit (fail);
20359#endif
20360}
88b48903 20361
6ec2e0f5
SDJ
20362_ACEOF
20363if ac_fn_c_try_run "$LINENO"; then :
20364 gl_cv_func_getcwd_path_max=yes
20365else
20366 case $? in
c0c3707f
CB
20367 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
20368 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
20369 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
20370 *) gl_cv_func_getcwd_path_max=no;;
20371 esac
6ec2e0f5
SDJ
20372fi
20373rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20374 conftest.$ac_objext conftest.beam conftest.$ac_ext
20375fi
88b48903 20376
88b48903 20377
6ec2e0f5
SDJ
20378fi
20379{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
20380$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
88b48903 20381
6ec2e0f5
SDJ
20382 case "$gl_cv_func_getcwd_null" in
20383 *yes)
88b48903
WN
20384
20385
472fa5ee
SM
20386
20387
20388
472fa5ee 20389
c0c3707f
CB
20390 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
20391$as_echo_n "checking for getpagesize... " >&6; }
20392if ${gl_cv_func_getpagesize+:} false; then :
20393 $as_echo_n "(cached) " >&6
20394else
20395 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20396/* end confdefs.h. */
20397#include <unistd.h>
20398int
20399main ()
20400{
20401return getpagesize();
20402 ;
20403 return 0;
20404}
472fa5ee 20405
c0c3707f
CB
20406_ACEOF
20407if ac_fn_c_try_link "$LINENO"; then :
20408 gl_cv_func_getpagesize=yes
20409else
20410 gl_cv_func_getpagesize=no
20411fi
20412rm -f core conftest.err conftest.$ac_objext \
20413 conftest$ac_exeext conftest.$ac_ext
472fa5ee 20414
c0c3707f
CB
20415fi
20416{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
20417$as_echo "$gl_cv_func_getpagesize" >&6; }
88b48903 20418
c0c3707f 20419 if test $gl_cv_func_getpagesize = yes; then
88b48903 20420
c0c3707f 20421cat >>confdefs.h <<_ACEOF
7a6dbc2f
SDJ
20422#define HAVE_GETPAGESIZE 1
20423_ACEOF
20424
c0c3707f 20425 fi
6ec2e0f5 20426
9c9d63b1
PM
20427 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd succeeds when 4k < cwd_length < 16k" >&5
20428$as_echo_n "checking whether getcwd succeeds when 4k < cwd_length < 16k... " >&6; }
20429if ${gl_cv_func_getcwd_succeeds_beyond_4k+:} false; then :
88b48903
WN
20430 $as_echo_n "(cached) " >&6
20431else
6ec2e0f5
SDJ
20432 # Remove any remnants of a previous test.
20433 rm -rf confdir-14B---
20434 # Arrange for deletion of the temporary directory this test creates.
20435 ac_clean_files="$ac_clean_files confdir-14B---"
20436 if test "$cross_compiling" = yes; then :
c0c3707f 20437 case "$host_os" in
9c9d63b1
PM
20438 # Guess yes on musl systems.
20439 *-musl*) gl_cv_func_getcwd_succeeds_beyond_4k="guessing yes" ;;
20440 # Guess no otherwise, even on glibc systems.
20441 *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no"
c0c3707f
CB
20442 esac
20443
88b48903
WN
20444else
20445 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20446/* end confdefs.h. */
6ec2e0f5
SDJ
20447
20448#include <errno.h>
20449#include <stdlib.h>
20450#if HAVE_UNISTD_H
20451# include <unistd.h>
20452#else /* on Windows with MSVC */
20453# include <direct.h>
20454#endif
20455#include <string.h>
20456#include <sys/stat.h>
20457
20458
20459/* Arrange to define PATH_MAX, like "pathmax.h" does. */
20460#if HAVE_UNISTD_H
20461# include <unistd.h>
20462#endif
20463#include <limits.h>
20464#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
20465# include <sys/param.h>
20466#endif
20467#if !defined PATH_MAX && defined MAXPATHLEN
20468# define PATH_MAX MAXPATHLEN
20469#endif
20470#ifdef __hpux
20471# undef PATH_MAX
20472# define PATH_MAX 1024
20473#endif
c0c3707f 20474#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
20475# undef PATH_MAX
20476# define PATH_MAX 260
20477#endif
20478
20479
9c9d63b1
PM
20480
20481$gl_mda_defines
20482
6ec2e0f5
SDJ
20483
20484#ifndef S_IRWXU
20485# define S_IRWXU 0700
20486#endif
20487
20488/* FIXME: skip the run-test altogether on systems without getpagesize. */
20489#if ! HAVE_GETPAGESIZE
20490# define getpagesize() 0
20491#endif
20492
20493/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
20494 the 16kB pagesize on ia64 linux. Those conditions make the code below
20495 trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
20496#define TARGET_LEN (5 * 1024)
88b48903
WN
20497
20498int
20499main ()
20500{
6ec2e0f5
SDJ
20501 char *cwd;
20502 size_t initial_cwd_len;
20503 int fail = 0;
20504
20505 /* The bug is triggered when PATH_MAX < getpagesize (), so skip
20506 this relatively expensive and invasive test if that's not true. */
20507#ifdef PATH_MAX
20508 int bug_possible = PATH_MAX < getpagesize ();
20509#else
20510 int bug_possible = 0;
20511#endif
20512 if (! bug_possible)
20513 return 0;
8690e634 20514
6ec2e0f5
SDJ
20515 cwd = getcwd (NULL, 0);
20516 if (cwd == NULL)
20517 return 2;
20518
20519 initial_cwd_len = strlen (cwd);
20520 free (cwd);
20521
20522 if (1)
20523 {
20524 static char const dir_name[] = "confdir-14B---";
20525 size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
20526 / sizeof dir_name);
20527 size_t d;
20528 for (d = 0; d < desired_depth; d++)
20529 {
20530 if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
20531 {
20532 if (! (errno == ERANGE || errno == ENAMETOOLONG
20533 || errno == ENOENT))
20534 fail = 3; /* Unable to construct deep hierarchy. */
20535 break;
20536 }
20537 }
20538
20539 /* If libc has the bug in question, this invocation of getcwd
20540 results in a failed assertion. */
20541 cwd = getcwd (NULL, 0);
20542 if (cwd == NULL)
20543 fail = 4; /* getcwd didn't assert, but it failed for a long name
20544 where the answer could have been learned. */
20545 free (cwd);
20546
20547 /* Call rmdir first, in case the above chdir failed. */
20548 rmdir (dir_name);
20549 while (0 < d--)
20550 {
20551 if (chdir ("..") < 0)
20552 {
20553 fail = 5;
20554 break;
20555 }
20556 rmdir (dir_name);
20557 }
20558 }
20559
20560 return fail;
8690e634 20561}
6ec2e0f5 20562
8690e634
JK
20563_ACEOF
20564if ac_fn_c_try_run "$LINENO"; then :
9c9d63b1 20565 gl_cv_func_getcwd_succeeds_beyond_4k=yes
8690e634 20566else
c0c3707f
CB
20567 ret=$?
20568 if test $ret -ge 128 || test $ret = 4; then
9c9d63b1 20569 gl_cv_func_getcwd_succeeds_beyond_4k=no
c0c3707f 20570 else
9c9d63b1 20571 gl_cv_func_getcwd_succeeds_beyond_4k=yes
c0c3707f
CB
20572 fi
20573
8690e634
JK
20574fi
20575rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20576 conftest.$ac_objext conftest.beam conftest.$ac_ext
20577fi
20578
20579
20580fi
9c9d63b1
PM
20581{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_succeeds_beyond_4k" >&5
20582$as_echo "$gl_cv_func_getcwd_succeeds_beyond_4k" >&6; }
20583 case "$gl_cv_func_getcwd_succeeds_beyond_4k" in
20584 *no)
c0c3707f
CB
20585 gl_abort_bug=yes
20586 ;;
20587 *)
20588
20589 ;;
20590 esac
6ec2e0f5
SDJ
20591
20592 ;;
20593 esac
20594 ;;
20595 esac
20596 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 20597 *"no" | *"no, it has the AIX bug") ;;
6ec2e0f5
SDJ
20598 *)
20599
20600$as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
20601
20602 ;;
20603 esac
20604 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 20605 *"no, but it is partly working")
6ec2e0f5
SDJ
20606
20607$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
20608
20609 ;;
c0c3707f 20610 *"yes, but with shorter paths")
6ec2e0f5
SDJ
20611
20612$as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
20613
20614 ;;
20615 esac
20616
20617 if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
20618 || test $gl_cv_func_getcwd_posix_signature != yes \
20619 || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
20620 || test $gl_abort_bug = yes; then
20621 REPLACE_GETCWD=1
8690e634
JK
20622 fi
20623
6ec2e0f5 20624 if test $REPLACE_GETCWD = 1; then
8690e634
JK
20625
20626
8690e634
JK
20627
20628
20629
20630
20631
20632
6ec2e0f5 20633 gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
8690e634
JK
20634
20635
8690e634
JK
20636
20637
6ec2e0f5
SDJ
20638 :
20639
20640 fi
20641
8690e634
JK
20642
20643cat >>confdefs.h <<_ACEOF
6ec2e0f5 20644#define GNULIB_GETCWD 1
8690e634
JK
20645_ACEOF
20646
20647
8690e634 20648
8690e634
JK
20649
20650
c971b7fa 20651
c971b7fa 20652
6ec2e0f5
SDJ
20653 GNULIB_GETCWD=1
20654
20655
20656
20657
20658
20659$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
20660
c971b7fa 20661
c971b7fa 20662
c971b7fa 20663
c971b7fa 20664
c971b7fa 20665
c971b7fa 20666
c971b7fa 20667
6ec2e0f5
SDJ
20668 case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
20669 *yes,yes) ;;
20670 *)
20671 REPLACE_GETCWD=1
20672 ;;
20673 esac
c971b7fa 20674
6ec2e0f5 20675 if test $REPLACE_GETCWD = 1; then
c971b7fa 20676
c971b7fa
PA
20677
20678
c971b7fa
PA
20679
20680
c971b7fa 20681
c971b7fa 20682
c971b7fa 20683
6ec2e0f5 20684 gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
c971b7fa 20685
6ec2e0f5 20686 fi
c971b7fa 20687
c971b7fa 20688
c971b7fa 20689
c971b7fa 20690
8690e634 20691
6ec2e0f5 20692 GNULIB_GETCWD=1
c971b7fa 20693
88b48903
WN
20694
20695
20696
88b48903 20697
6ec2e0f5 20698$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
88b48903 20699
88b48903
WN
20700
20701
20702
6ec2e0f5
SDJ
20703
20704
20705
20706
20707 if test $ac_cv_func_getdtablesize = yes &&
20708 test $ac_cv_have_decl_getdtablesize = yes; then
6ec2e0f5
SDJ
20709 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
20710$as_echo_n "checking whether getdtablesize works... " >&6; }
d0ac1c44 20711if ${gl_cv_func_getdtablesize_works+:} false; then :
88b48903
WN
20712 $as_echo_n "(cached) " >&6
20713else
c0c3707f
CB
20714 case "$host_os" in
20715 vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
20716 *)
20717 if test "$cross_compiling" = yes; then :
88b48903 20718 case "$host_os" in
c0c3707f
CB
20719 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
20720 gl_cv_func_getdtablesize_works="guessing no" ;;
20721 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
20722 esac
20723
88b48903
WN
20724else
20725 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20726/* end confdefs.h. */
20727
c0c3707f 20728 #include <unistd.h>
9c9d63b1
PM
20729
20730
20731$gl_mda_defines
20732
20733
6ec2e0f5
SDJ
20734int
20735main ()
88b48903 20736{
6ec2e0f5 20737int size = getdtablesize();
9c9d63b1
PM
20738 if (dup2 (0, getdtablesize()) != -1)
20739 return 1;
20740 if (size != getdtablesize())
20741 return 2;
6ec2e0f5
SDJ
20742
20743 ;
20744 return 0;
88b48903
WN
20745}
20746_ACEOF
20747if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20748 gl_cv_func_getdtablesize_works=yes
88b48903 20749else
6ec2e0f5 20750 gl_cv_func_getdtablesize_works=no
88b48903
WN
20751fi
20752rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20753 conftest.$ac_objext conftest.beam conftest.$ac_ext
20754fi
20755
c0c3707f
CB
20756 ;;
20757 esac
88b48903
WN
20758
20759fi
6ec2e0f5
SDJ
20760{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
20761$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
20762 case "$gl_cv_func_getdtablesize_works" in
c0c3707f 20763 *yes | "no (limitation)") ;;
6ec2e0f5 20764 *) REPLACE_GETDTABLESIZE=1 ;;
88b48903
WN
20765 esac
20766 else
6ec2e0f5 20767 HAVE_GETDTABLESIZE=0
88b48903
WN
20768 fi
20769
6ec2e0f5 20770 if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
88b48903
WN
20771
20772
20773
20774
20775
20776
20777
20778
6ec2e0f5 20779 gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
88b48903 20780
6ec2e0f5 20781 :
88b48903
WN
20782 fi
20783
20784
20785
20786
20787
6ec2e0f5 20788 GNULIB_GETDTABLESIZE=1
88b48903
WN
20789
20790
20791
88b48903 20792
88b48903 20793
6ec2e0f5 20794$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
88b48903 20795
88b48903 20796
88b48903 20797
88b48903 20798
88b48903 20799
88b48903 20800
88b48903 20801
88b48903
WN
20802
20803
6ec2e0f5
SDJ
20804 if test $ac_cv_have_decl_getlogin_r = no; then
20805 HAVE_DECL_GETLOGIN_R=0
20806 fi
88b48903 20807
88b48903 20808
6ec2e0f5
SDJ
20809 if test $ac_cv_func_getlogin_r = no; then
20810 HAVE_GETLOGIN_R=0
20811 else
20812 HAVE_GETLOGIN_R=1
20813
20814 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5
20815$as_echo_n "checking whether getlogin_r works with small buffers... " >&6; }
d0ac1c44 20816if ${gl_cv_func_getlogin_r_works+:} false; then :
6ec2e0f5
SDJ
20817 $as_echo_n "(cached) " >&6
20818else
88b48903 20819
6ec2e0f5 20820 case "$host_os" in
c0c3707f
CB
20821 # Guess no on Mac OS X, OSF/1.
20822 darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;;
20823 # Guess yes otherwise.
20824 *) gl_cv_func_getlogin_r_works="guessing yes" ;;
6ec2e0f5
SDJ
20825 esac
20826 if test "$cross_compiling" = yes; then :
20827 :
88b48903
WN
20828else
20829 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20830/* end confdefs.h. */
20831
6ec2e0f5 20832#include <stddef.h>
c0c3707f 20833#include <string.h>
6ec2e0f5
SDJ
20834#include <unistd.h>
20835#if !HAVE_DECL_GETLOGIN_R
88b48903 20836extern
6ec2e0f5 20837# ifdef __cplusplus
88b48903 20838"C"
6ec2e0f5
SDJ
20839# endif
20840int getlogin_r (char *, size_t);
88b48903 20841#endif
6ec2e0f5
SDJ
20842int
20843main (void)
88b48903
WN
20844{
20845 int result = 0;
6ec2e0f5
SDJ
20846 char buf[100];
20847
20848 if (getlogin_r (buf, 0) == 0)
c0c3707f 20849 result |= 1;
6ec2e0f5 20850 if (getlogin_r (buf, 1) == 0)
c0c3707f
CB
20851 result |= 2;
20852 if (getlogin_r (buf, 100) == 0)
20853 {
20854 size_t n = strlen (buf);
20855 if (getlogin_r (buf, n) == 0)
20856 result |= 4;
20857 }
88b48903
WN
20858 return result;
20859}
20860_ACEOF
20861if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 20862 gl_cv_func_getlogin_r_works=yes
88b48903 20863else
c0c3707f 20864 gl_cv_func_getlogin_r_works=no
88b48903
WN
20865fi
20866rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20867 conftest.$ac_objext conftest.beam conftest.$ac_ext
20868fi
20869
20870
4a626d0a 20871fi
6ec2e0f5
SDJ
20872{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5
20873$as_echo "$gl_cv_func_getlogin_r_works" >&6; }
20874 case "$gl_cv_func_getlogin_r_works" in
20875 *yes) ;;
20876 *) REPLACE_GETLOGIN_R=1 ;;
20877 esac
20878 fi
20879
20880 if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then
20881
20882
20883
20884
20885
20886
20887
20888
20889 gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext"
4a626d0a 20890
4a626d0a 20891
4a626d0a 20892
4a626d0a 20893
4a626d0a
PA
20894 fi
20895
20896
4a626d0a
PA
20897
20898
20899
6ec2e0f5 20900 GNULIB_GETLOGIN_R=1
4a626d0a
PA
20901
20902
20903
20904
20905
6ec2e0f5 20906$as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h
4a626d0a 20907
4a626d0a
PA
20908
20909
20910
20911
472fa5ee 20912
4a626d0a 20913
6ec2e0f5
SDJ
20914 ac_found=0
20915 ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
20916"
d0ac1c44 20917if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
6ec2e0f5
SDJ
20918 ac_have_decl=1
20919else
20920 ac_have_decl=0
20921fi
20922
20923cat >>confdefs.h <<_ACEOF
20924#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
20925_ACEOF
20926if test $ac_have_decl = 1; then :
20927 ac_found=1
20928fi
20929
20930 ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
20931"
d0ac1c44 20932if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
6ec2e0f5
SDJ
20933 ac_have_decl=1
20934else
20935 ac_have_decl=0
20936fi
20937
20938cat >>confdefs.h <<_ACEOF
20939#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
20940_ACEOF
20941if test $ac_have_decl = 1; then :
20942 ac_found=1
20943fi
4a626d0a 20944
6ec2e0f5
SDJ
20945 ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
20946"
d0ac1c44 20947if test "x$ac_cv_have_decl___argv" = xyes; then :
6ec2e0f5
SDJ
20948 ac_have_decl=1
20949else
20950 ac_have_decl=0
20951fi
4a626d0a 20952
6ec2e0f5
SDJ
20953cat >>confdefs.h <<_ACEOF
20954#define HAVE_DECL___ARGV $ac_have_decl
20955_ACEOF
20956if test $ac_have_decl = 1; then :
20957 ac_found=1
20958fi
4a626d0a
PA
20959
20960
6ec2e0f5
SDJ
20961 # Incur the cost of this test only if none of the above worked.
20962 if test $ac_found = 0; then
20963 # On OpenBSD 5.1, using the global __progname variable appears to be
20964 # the only way to implement getprogname.
20965 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
20966$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
d0ac1c44 20967if ${gl_cv_var___progname+:} false; then :
6ec2e0f5
SDJ
20968 $as_echo_n "(cached) " >&6
20969else
4a626d0a 20970
6ec2e0f5
SDJ
20971 gl_cv_var___progname=
20972 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20973/* end confdefs.h. */
20974extern char *__progname;
20975int
20976main ()
20977{
20978return *__progname;
20979
20980 ;
20981 return 0;
20982}
20983_ACEOF
20984if ac_fn_c_try_link "$LINENO"; then :
20985 gl_cv_var___progname=yes
20986
20987fi
20988rm -f core conftest.err conftest.$ac_objext \
20989 conftest$ac_exeext conftest.$ac_ext
20990
20991
20992fi
20993{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
20994$as_echo "$gl_cv_var___progname" >&6; }
20995 if test "$gl_cv_var___progname" = yes; then
20996
20997$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
20998
20999 fi
21000 fi
4a626d0a
PA
21001
21002
21003
21004
21005
698be2d8
CB
21006 if test "$ac_cv_func_getrandom" != yes; then
21007 HAVE_GETRANDOM=0
21008 else
21009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getrandom is compatible with its GNU+BSD signature" >&5
21010$as_echo_n "checking whether getrandom is compatible with its GNU+BSD signature... " >&6; }
21011if ${gl_cv_func_getrandom_ok+:} false; then :
21012 $as_echo_n "(cached) " >&6
21013else
21014 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21015/* end confdefs.h. */
9c9d63b1
PM
21016/* Additional includes are needed before <sys/random.h> on uClibc
21017 and Mac OS X. */
698be2d8
CB
21018 #include <sys/types.h>
21019 #include <stdlib.h>
21020 #include <sys/random.h>
21021 ssize_t getrandom (void *, size_t, unsigned int);
21022
21023int
21024main ()
21025{
21026
21027 ;
21028 return 0;
21029}
21030
21031_ACEOF
21032if ac_fn_c_try_compile "$LINENO"; then :
21033 gl_cv_func_getrandom_ok=yes
21034else
21035 gl_cv_func_getrandom_ok=no
21036fi
21037rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21038
21039fi
21040{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getrandom_ok" >&5
21041$as_echo "$gl_cv_func_getrandom_ok" >&6; }
21042 if test $gl_cv_func_getrandom_ok = no; then
21043 REPLACE_GETRANDOM=1
21044 fi
21045 fi
21046
21047 case "$host_os" in
21048 mingw*)
21049 for ac_header in bcrypt.h
21050do :
9c9d63b1
PM
21051 ac_fn_c_check_header_compile "$LINENO" "bcrypt.h" "ac_cv_header_bcrypt_h" "#include <windows.h>
21052
21053"
698be2d8
CB
21054if test "x$ac_cv_header_bcrypt_h" = xyes; then :
21055 cat >>confdefs.h <<_ACEOF
21056#define HAVE_BCRYPT_H 1
21057_ACEOF
21058
21059fi
21060
21061done
21062
21063 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the bcrypt library is guaranteed to be present" >&5
21064$as_echo_n "checking whether the bcrypt library is guaranteed to be present... " >&6; }
21065if ${gl_cv_lib_assume_bcrypt+:} false; then :
21066 $as_echo_n "(cached) " >&6
21067else
21068 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21069/* end confdefs.h. */
21070#include <windows.h>
21071int
21072main ()
21073{
21074#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
21075 cannot assume it
21076 #endif
21077
21078 ;
21079 return 0;
21080}
21081
21082_ACEOF
21083if ac_fn_c_try_compile "$LINENO"; then :
21084 gl_cv_lib_assume_bcrypt=yes
21085else
21086 gl_cv_lib_assume_bcrypt=no
21087fi
21088rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21089
21090fi
21091{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_assume_bcrypt" >&5
21092$as_echo "$gl_cv_lib_assume_bcrypt" >&6; }
21093 if test $gl_cv_lib_assume_bcrypt = yes; then
21094
21095$as_echo "#define HAVE_LIB_BCRYPT 1" >>confdefs.h
21096
21097 LIB_GETRANDOM='-lbcrypt'
21098 else
21099 LIB_GETRANDOM='-ladvapi32'
21100 fi
21101 ;;
21102 *)
21103 LIB_GETRANDOM= ;;
21104 esac
21105
21106
21107 if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
21108
21109
21110
21111
21112
21113
21114
21115
21116 gl_LIBOBJS="$gl_LIBOBJS getrandom.$ac_objext"
21117
21118 fi
21119
21120
21121
21122
21123
21124 GNULIB_GETRANDOM=1
21125
21126
21127
21128
21129
21130$as_echo "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.h
21131
21132
21133
21134
21135
21136
21137
4a626d0a
PA
21138
21139
21140
472fa5ee 21141
4a626d0a
PA
21142
21143 gl_gettimeofday_timezone=void
21144 if test $ac_cv_func_gettimeofday != yes; then
21145 HAVE_GETTIMEOFDAY=0
21146 else
4a626d0a
PA
21147 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
21148$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
d0ac1c44 21149if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
4a626d0a
PA
21150 $as_echo_n "(cached) " >&6
21151else
21152 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21153/* end confdefs.h. */
21154#include <sys/time.h>
21155 struct timeval c;
21156 int gettimeofday (struct timeval *restrict, void *restrict);
21157
21158int
21159main ()
21160{
21161/* glibc uses struct timezone * rather than the POSIX void *
21162 if _GNU_SOURCE is defined. However, since the only portable
21163 use of gettimeofday uses NULL as the second parameter, and
21164 since the glibc definition is actually more typesafe, it is
21165 not worth wrapping this to get a compliant signature. */
21166 int (*f) (struct timeval *restrict, void *restrict)
21167 = gettimeofday;
21168 int x = f (&c, 0);
21169 return !(x | c.tv_sec | c.tv_usec);
21170
21171 ;
21172 return 0;
21173}
21174_ACEOF
21175if ac_fn_c_try_compile "$LINENO"; then :
21176 gl_cv_func_gettimeofday_posix_signature=yes
21177else
21178 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21179/* end confdefs.h. */
21180#include <sys/time.h>
21181int gettimeofday (struct timeval *restrict, struct timezone *restrict);
21182
21183int
21184main ()
21185{
21186
21187 ;
21188 return 0;
21189}
21190_ACEOF
21191if ac_fn_c_try_compile "$LINENO"; then :
21192 gl_cv_func_gettimeofday_posix_signature=almost
21193else
21194 gl_cv_func_gettimeofday_posix_signature=no
21195fi
21196rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21197fi
21198rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21199fi
21200{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
21201$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
21202 if test $gl_cv_func_gettimeofday_posix_signature = almost; then
21203 gl_gettimeofday_timezone='struct timezone'
21204 elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
21205 REPLACE_GETTIMEOFDAY=1
21206 fi
21207 if test $REPLACE_STRUCT_TIMEVAL = 1; then
21208 REPLACE_GETTIMEOFDAY=1
21209 fi
c0c3707f
CB
21210 case "$host_os" in
21211 mingw*) REPLACE_GETTIMEOFDAY=1 ;;
21212 esac
4a626d0a
PA
21213 fi
21214
21215cat >>confdefs.h <<_ACEOF
c0c3707f
CB
21216#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
21217_ACEOF
88b48903
WN
21218
21219
c0c3707f 21220 if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
88b48903 21221
6ec2e0f5 21222
6ec2e0f5 21223
6ec2e0f5 21224
6ec2e0f5 21225
6ec2e0f5
SDJ
21226
21227
6ec2e0f5 21228
c0c3707f 21229 gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
6ec2e0f5 21230
c0c3707f 21231 :
5e8754f9 21232 fi
6ec2e0f5
SDJ
21233
21234
21235
6ec2e0f5
SDJ
21236
21237
5e8754f9 21238 GNULIB_GETTIMEOFDAY=1
6ec2e0f5
SDJ
21239
21240
21241
7a6dbc2f
SDJ
21242
21243
5e8754f9 21244$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
6ec2e0f5
SDJ
21245
21246
21247
6ec2e0f5 21248
6ec2e0f5 21249
6ec2e0f5
SDJ
21250
21251
c0c3707f
CB
21252 if test $ac_cv_func_glob = no; then
21253 HAVE_GLOB=0
21254 else
21255
21256 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5
21257$as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; }
21258if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then :
6ec2e0f5
SDJ
21259 $as_echo_n "(cached) " >&6
21260else
21261 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21262/* end confdefs.h. */
21263#include <gnu-versions.h>
c0c3707f 21264char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];
6ec2e0f5
SDJ
21265_ACEOF
21266if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 21267 gl_cv_gnu_glob_interface_version_1_2=yes
6ec2e0f5 21268else
c0c3707f 21269 gl_cv_gnu_glob_interface_version_1_2=no
6ec2e0f5
SDJ
21270fi
21271rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21272fi
c0c3707f
CB
21273{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5
21274$as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; }
21275 if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then
21276 REPLACE_GLOB=1
6ec2e0f5 21277 fi
6ec2e0f5 21278
c0c3707f
CB
21279 if test $REPLACE_GLOB = 0; then
21280 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5
6ec2e0f5 21281$as_echo_n "checking whether glob lists broken symlinks... " >&6; }
d0ac1c44 21282if ${gl_cv_glob_lists_symlinks+:} false; then :
6ec2e0f5
SDJ
21283 $as_echo_n "(cached) " >&6
21284else
c0c3707f
CB
21285 if test $cross_compiling != yes; then
21286 if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
21287 gl_cv_glob_lists_symlinks=maybe
21288 else
21289 # If we can't make a symlink, then we cannot test this issue. Be
21290 # pessimistic about this.
21291 gl_cv_glob_lists_symlinks=no
21292 fi
21293 if test $gl_cv_glob_lists_symlinks = maybe; then
21294 if test "$cross_compiling" = yes; then :
21295 :
5e8754f9 21296
6ec2e0f5
SDJ
21297else
21298 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21299/* end confdefs.h. */
6ec2e0f5 21300#include <stddef.h>
c0c3707f 21301 #include <glob.h>
6ec2e0f5
SDJ
21302int
21303main ()
21304{
21305glob_t found;
c0c3707f
CB
21306 if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
21307 return 1;
698be2d8 21308 globfree (&found);
c0c3707f 21309
6ec2e0f5
SDJ
21310 ;
21311 return 0;
21312}
4a626d0a 21313_ACEOF
6ec2e0f5
SDJ
21314if ac_fn_c_try_run "$LINENO"; then :
21315 gl_cv_glob_lists_symlinks=yes
21316else
21317 gl_cv_glob_lists_symlinks=no
21318fi
21319rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21320 conftest.$ac_objext conftest.beam conftest.$ac_ext
21321fi
88b48903 21322
c0c3707f
CB
21323 fi
21324 rm -f conf$$-globtest
21325 else
21326 gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
21327 fi
21328
4a626d0a 21329fi
6ec2e0f5
SDJ
21330{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5
21331$as_echo "$gl_cv_glob_lists_symlinks" >&6; }
c0c3707f
CB
21332 case "$gl_cv_glob_lists_symlinks" in
21333 *yes) ;;
21334 *) REPLACE_GLOB=1 ;;
21335 esac
21336 fi
21337
21338 fi
88b48903 21339
c0c3707f
CB
21340 if test $ac_cv_func_glob_pattern_p = no; then
21341 HAVE_GLOB_PATTERN_P=0
21342 else
21343 if test $REPLACE_GLOB = 1; then
21344 REPLACE_GLOB_PATTERN_P=1
6ec2e0f5
SDJ
21345 fi
21346 fi
4a626d0a 21347
c0c3707f 21348 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
4a626d0a 21349
88b48903 21350
c0c3707f 21351 GLOB_H='glob.h'
6ec2e0f5
SDJ
21352 if test -n "$GLOB_H"; then
21353 GL_GENERATE_GLOB_H_TRUE=
21354 GL_GENERATE_GLOB_H_FALSE='#'
21355else
21356 GL_GENERATE_GLOB_H_TRUE='#'
21357 GL_GENERATE_GLOB_H_FALSE=
21358fi
88b48903 21359
88b48903 21360
c0c3707f
CB
21361 fi
21362
21363 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
472fa5ee
SM
21364
21365
21366
21367
21368
21369
21370
21371
21372 gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext"
21373
21374
21375
7a6dbc2f
SDJ
21376
21377
21378
472fa5ee 21379
472fa5ee 21380
88b48903 21381
c0c3707f 21382 gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext"
88b48903
WN
21383
21384
21385
725e2999
JB
21386
21387
21388
c0c3707f
CB
21389 fi
21390 if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then
21391
725e2999
JB
21392
21393
21394
21395
21396
21397
21398
c0c3707f 21399 gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext"
725e2999
JB
21400
21401 fi
21402
725e2999
JB
21403
21404
21405
21406
c0c3707f
CB
21407 GNULIB_GLOB=1
21408
21409
21410
21411
21412
21413$as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h
21414
21415
725e2999
JB
21416
21417
21418
5df4cba6
SM
21419 LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
21420
21421
725e2999 21422
725e2999
JB
21423
21424
21425
21426
725e2999 21427
c0c3707f
CB
21428 HAVE_INET_NTOP=1
21429 INET_NTOP_LIB=
725e2999
JB
21430
21431
21432
21433
21434 if test $ac_cv_header_sys_socket_h != yes; then
21435 for ac_header in winsock2.h
21436do :
21437 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
21438if test "x$ac_cv_header_winsock2_h" = xyes; then :
21439 cat >>confdefs.h <<_ACEOF
21440#define HAVE_WINSOCK2_H 1
21441_ACEOF
21442
21443fi
21444
21445done
21446
21447 fi
21448 if test "$ac_cv_header_winsock2_h" = yes; then
21449 HAVE_WINSOCK2_H=1
21450 UNISTD_H_HAVE_WINSOCK2_H=1
21451 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
21452 else
21453 HAVE_WINSOCK2_H=0
21454 fi
21455
21456
21457 if test $HAVE_WINSOCK2_H = 1; then
c0c3707f 21458 REPLACE_INET_NTOP=1
725e2999
JB
21459 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
21460"
21461if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
21462 ac_have_decl=1
21463else
21464 ac_have_decl=0
21465fi
21466
21467cat >>confdefs.h <<_ACEOF
21468#define HAVE_DECL_INET_NTOP $ac_have_decl
21469_ACEOF
21470
21471 if test $ac_cv_have_decl_inet_ntop = yes; then
725e2999
JB
21472 INET_NTOP_LIB="-lws2_32"
21473 else
21474 HAVE_DECL_INET_NTOP=0
725e2999
JB
21475 fi
21476 else
21477 gl_save_LIBS=$LIBS
21478 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
21479$as_echo_n "checking for library containing inet_ntop... " >&6; }
21480if ${ac_cv_search_inet_ntop+:} false; then :
21481 $as_echo_n "(cached) " >&6
21482else
21483 ac_func_search_save_LIBS=$LIBS
21484cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21485/* end confdefs.h. */
21486
21487/* Override any GCC internal prototype to avoid an error.
21488 Use char because int might match the return type of a GCC
21489 builtin and then its argument prototype would still apply. */
21490#ifdef __cplusplus
21491extern "C"
21492#endif
21493char inet_ntop ();
21494int
21495main ()
21496{
21497return inet_ntop ();
21498 ;
21499 return 0;
21500}
21501_ACEOF
c0c3707f 21502for ac_lib in '' nsl resolv network; do
725e2999
JB
21503 if test -z "$ac_lib"; then
21504 ac_res="none required"
21505 else
21506 ac_res=-l$ac_lib
21507 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
21508 fi
21509 if ac_fn_c_try_link "$LINENO"; then :
21510 ac_cv_search_inet_ntop=$ac_res
21511fi
21512rm -f core conftest.err conftest.$ac_objext \
21513 conftest$ac_exeext
21514 if ${ac_cv_search_inet_ntop+:} false; then :
21515 break
21516fi
21517done
21518if ${ac_cv_search_inet_ntop+:} false; then :
21519
21520else
21521 ac_cv_search_inet_ntop=no
21522fi
21523rm conftest.$ac_ext
21524LIBS=$ac_func_search_save_LIBS
21525fi
21526{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
21527$as_echo "$ac_cv_search_inet_ntop" >&6; }
21528ac_res=$ac_cv_search_inet_ntop
21529if test "$ac_res" != no; then :
21530 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
21531
21532else
21533 for ac_func in inet_ntop
21534do :
21535 ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
21536if test "x$ac_cv_func_inet_ntop" = xyes; then :
21537 cat >>confdefs.h <<_ACEOF
21538#define HAVE_INET_NTOP 1
21539_ACEOF
21540
21541fi
21542done
21543
21544 if test $ac_cv_func_inet_ntop = no; then
21545 HAVE_INET_NTOP=0
21546 fi
21547
21548fi
21549
21550 LIBS=$gl_save_LIBS
21551
21552 if test "$ac_cv_search_inet_ntop" != "no" \
21553 && test "$ac_cv_search_inet_ntop" != "none required"; then
21554 INET_NTOP_LIB="$ac_cv_search_inet_ntop"
21555 fi
21556
21557
725e2999
JB
21558 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
21559 #if HAVE_NETDB_H
21560 # include <netdb.h>
21561 #endif
21562
21563"
21564if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
21565 ac_have_decl=1
21566else
21567 ac_have_decl=0
21568fi
21569
21570cat >>confdefs.h <<_ACEOF
21571#define HAVE_DECL_INET_NTOP $ac_have_decl
21572_ACEOF
21573
21574 if test $ac_cv_have_decl_inet_ntop = no; then
21575 HAVE_DECL_INET_NTOP=0
21576 fi
21577 fi
21578
21579
21580 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
21581
21582
21583
21584
21585
21586
21587
7a6dbc2f 21588
725e2999 21589 gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext"
7a6dbc2f
SDJ
21590
21591
21592
7a6dbc2f 21593
725e2999 21594 fi
7a6dbc2f
SDJ
21595
21596
21597
21598
7a6dbc2f 21599
725e2999
JB
21600 GNULIB_INET_NTOP=1
21601
7a6dbc2f
SDJ
21602
21603
49e4877c
PA
21604
21605
88b48903
WN
21606
21607
88b48903
WN
21608 PRIPTR_PREFIX=
21609 if test -n "$STDINT_H"; then
9c9d63b1
PM
21610 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21611/* end confdefs.h. */
21612
21613 #ifdef _WIN64
21614 LLP64
21615 #endif
21616
21617int
21618main ()
21619{
21620
21621 ;
21622 return 0;
21623}
21624
21625_ACEOF
21626if ac_fn_c_try_compile "$LINENO"; then :
21627 PRIPTR_PREFIX='"l"'
21628else
21629 PRIPTR_PREFIX='"ll"'
21630fi
21631rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903
WN
21632 else
21633 for glpfx in '' l ll I64; do
21634 case $glpfx in
21635 '') gltype1='int';;
21636 l) gltype1='long int';;
21637 ll) gltype1='long long int';;
21638 I64) gltype1='__int64';;
21639 esac
21640 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21641/* end confdefs.h. */
21642#include <stdint.h>
21643 extern intptr_t foo;
21644 extern $gltype1 foo;
21645int
21646main ()
21647{
21648
21649 ;
21650 return 0;
21651}
21652_ACEOF
21653if ac_fn_c_try_compile "$LINENO"; then :
21654 PRIPTR_PREFIX='"'$glpfx'"'
21655fi
21656rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21657 test -n "$PRIPTR_PREFIX" && break
21658 done
21659 fi
21660
21661
21662
21663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
21664$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
d0ac1c44 21665if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
88b48903
WN
21666 $as_echo_n "(cached) " >&6
21667else
21668 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21669/* end confdefs.h. */
21670/* Work also in C++ mode. */
21671 #define __STDC_LIMIT_MACROS 1
21672
21673 /* Work if build is not clean. */
21674 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21675
21676 #include <limits.h>
21677 #if HAVE_STDINT_H
21678 #include <stdint.h>
21679 #endif
21680
21681 #if defined INT32_MAX && defined INTMAX_MAX
21682 #define CONDITION (INT32_MAX < INTMAX_MAX)
88b48903 21683 #else
5df4cba6 21684 #define CONDITION (sizeof (int) < sizeof (long long int))
88b48903
WN
21685 #endif
21686 int test[CONDITION ? 1 : -1];
21687int
21688main ()
21689{
21690
21691 ;
21692 return 0;
21693}
21694_ACEOF
21695if ac_fn_c_try_compile "$LINENO"; then :
21696 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
21697else
21698 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
21699fi
21700rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21701fi
21702{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
21703$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
21704 if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
21705 INT32_MAX_LT_INTMAX_MAX=1;
21706 else
21707 INT32_MAX_LT_INTMAX_MAX=0;
21708 fi
21709
21710
21711 if test $APPLE_UNIVERSAL_BUILD = 0; then
21712
21713 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
21714$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
d0ac1c44 21715if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
88b48903
WN
21716 $as_echo_n "(cached) " >&6
21717else
21718 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21719/* end confdefs.h. */
21720/* Work also in C++ mode. */
21721 #define __STDC_LIMIT_MACROS 1
21722
21723 /* Work if build is not clean. */
21724 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21725
21726 #include <limits.h>
21727 #if HAVE_STDINT_H
21728 #include <stdint.h>
21729 #endif
21730
21731 #if defined INT64_MAX
21732 #define CONDITION (INT64_MAX == LONG_MAX)
88b48903 21733 #else
5df4cba6 21734 #define CONDITION (sizeof (long long int) == sizeof (long int))
88b48903
WN
21735 #endif
21736 int test[CONDITION ? 1 : -1];
21737int
21738main ()
21739{
21740
21741 ;
21742 return 0;
21743}
21744_ACEOF
21745if ac_fn_c_try_compile "$LINENO"; then :
21746 gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
21747else
21748 gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
21749fi
21750rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21751fi
21752{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
21753$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
21754 if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
21755 INT64_MAX_EQ_LONG_MAX=1;
21756 else
21757 INT64_MAX_EQ_LONG_MAX=0;
21758 fi
21759
21760
21761 else
21762 INT64_MAX_EQ_LONG_MAX=-1
21763 fi
21764
21765 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
21766$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
d0ac1c44 21767if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
88b48903
WN
21768 $as_echo_n "(cached) " >&6
21769else
21770 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21771/* end confdefs.h. */
21772/* Work also in C++ mode. */
21773 #define __STDC_LIMIT_MACROS 1
21774
21775 /* Work if build is not clean. */
21776 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21777
21778 #include <limits.h>
21779 #if HAVE_STDINT_H
21780 #include <stdint.h>
21781 #endif
21782
21783 #if defined UINT32_MAX && defined UINTMAX_MAX
21784 #define CONDITION (UINT32_MAX < UINTMAX_MAX)
88b48903 21785 #else
5df4cba6 21786 #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
88b48903
WN
21787 #endif
21788 int test[CONDITION ? 1 : -1];
21789int
21790main ()
21791{
21792
21793 ;
21794 return 0;
21795}
21796_ACEOF
21797if ac_fn_c_try_compile "$LINENO"; then :
21798 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
21799else
21800 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
21801fi
21802rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21803fi
21804{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
21805$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
21806 if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
21807 UINT32_MAX_LT_UINTMAX_MAX=1;
21808 else
21809 UINT32_MAX_LT_UINTMAX_MAX=0;
21810 fi
21811
21812
21813 if test $APPLE_UNIVERSAL_BUILD = 0; then
21814
21815 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
21816$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
d0ac1c44 21817if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
88b48903
WN
21818 $as_echo_n "(cached) " >&6
21819else
21820 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21821/* end confdefs.h. */
21822/* Work also in C++ mode. */
21823 #define __STDC_LIMIT_MACROS 1
21824
21825 /* Work if build is not clean. */
21826 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
21827
21828 #include <limits.h>
21829 #if HAVE_STDINT_H
21830 #include <stdint.h>
21831 #endif
21832
21833 #if defined UINT64_MAX
21834 #define CONDITION (UINT64_MAX == ULONG_MAX)
88b48903 21835 #else
5df4cba6 21836 #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
88b48903
WN
21837 #endif
21838 int test[CONDITION ? 1 : -1];
21839int
21840main ()
21841{
21842
21843 ;
21844 return 0;
21845}
21846_ACEOF
21847if ac_fn_c_try_compile "$LINENO"; then :
21848 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
21849else
21850 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
21851fi
21852rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21853fi
21854{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
21855$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
21856 if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
21857 UINT64_MAX_EQ_ULONG_MAX=1;
21858 else
21859 UINT64_MAX_EQ_ULONG_MAX=0;
21860 fi
21861
21862
21863 else
21864 UINT64_MAX_EQ_ULONG_MAX=-1
21865 fi
21866
21867
21868
21869
21870
698be2d8
CB
21871
21872
21873
21874 if test $ac_cv_func_isblank = no; then
21875 HAVE_ISBLANK=0
21876 fi
21877
21878 if test $HAVE_ISBLANK = 0; then
21879
21880
21881
21882
21883
21884
21885
21886
21887 gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext"
21888
21889 fi
21890
21891
21892cat >>confdefs.h <<_ACEOF
21893#define GNULIB_ISBLANK 1
21894_ACEOF
21895
21896
21897
21898
21899
21900
21901
21902 GNULIB_ISBLANK=1
21903
21904
21905
21906
21907
21908
88b48903
WN
21909 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
21910$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
d0ac1c44 21911if ${gl_cv_func_isnand_no_libm+:} false; then :
88b48903
WN
21912 $as_echo_n "(cached) " >&6
21913else
21914
21915 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21916/* end confdefs.h. */
21917#include <math.h>
9c9d63b1 21918 #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903
WN
21919 # undef isnand
21920 # define isnand(x) __builtin_isnan ((double)(x))
21921 #else
21922 # undef isnand
21923 # define isnand(x) isnan ((double)(x))
21924 #endif
21925 double x;
21926int
21927main ()
21928{
21929return isnand (x);
21930 ;
21931 return 0;
21932}
21933_ACEOF
21934if ac_fn_c_try_link "$LINENO"; then :
21935 gl_cv_func_isnand_no_libm=yes
21936else
21937 gl_cv_func_isnand_no_libm=no
21938fi
21939rm -f core conftest.err conftest.$ac_objext \
21940 conftest$ac_exeext conftest.$ac_ext
21941
21942fi
21943{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
21944$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
21945
21946 gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
21947 if test $gl_cv_func_isnand_no_libm = yes; then
21948
21949$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
21950
21951 fi
21952
21953 if test $gl_func_isnand_no_libm != yes; then
21954
21955
21956
21957
21958
21959
21960
21961
21962 gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
21963
21964
21965
21966
21967 fi
21968
21969
21970 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
21971$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
d0ac1c44 21972if ${gl_cv_func_isnanl_no_libm+:} false; then :
88b48903
WN
21973 $as_echo_n "(cached) " >&6
21974else
21975
21976 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21977/* end confdefs.h. */
21978#include <math.h>
9c9d63b1 21979 #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903 21980 # undef isnanl
9c9d63b1 21981 # define isnanl(x) __builtin_isnan ((long double)(x))
88b48903
WN
21982 #elif defined isnan
21983 # undef isnanl
21984 # define isnanl(x) isnan ((long double)(x))
21985 #endif
21986 long double x;
21987int
21988main ()
21989{
21990return isnanl (x);
21991 ;
21992 return 0;
21993}
21994_ACEOF
21995if ac_fn_c_try_link "$LINENO"; then :
21996 gl_cv_func_isnanl_no_libm=yes
21997else
21998 gl_cv_func_isnanl_no_libm=no
21999fi
22000rm -f core conftest.err conftest.$ac_objext \
22001 conftest$ac_exeext conftest.$ac_ext
22002
22003fi
22004{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
22005$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
22006
22007 gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
22008 if test $gl_func_isnanl_no_libm = yes; then
22009
22010
22011
22012
22013 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
22014$as_echo_n "checking whether isnanl works... " >&6; }
d0ac1c44 22015if ${gl_cv_func_isnanl_works+:} false; then :
88b48903
WN
22016 $as_echo_n "(cached) " >&6
22017else
22018
22019 if test "$cross_compiling" = yes; then :
c0c3707f
CB
22020 case "$host_os" in
22021 mingw*) # Guess yes on mingw, no on MSVC.
22022 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22023/* end confdefs.h. */
22024
22025#ifdef __MINGW32__
22026 Known
22027#endif
22028
22029_ACEOF
22030if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22031 $EGREP "Known" >/dev/null 2>&1; then :
4a626d0a 22032 gl_cv_func_isnanl_works="guessing yes"
c0c3707f
CB
22033else
22034 gl_cv_func_isnanl_works="guessing no"
22035fi
22036rm -f conftest*
22037
22038 ;;
22039 *) gl_cv_func_isnanl_works="guessing yes" ;;
22040 esac
22041
88b48903
WN
22042else
22043 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22044/* end confdefs.h. */
22045
22046#include <float.h>
22047#include <limits.h>
22048#include <math.h>
9c9d63b1 22049#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
88b48903 22050# undef isnanl
9c9d63b1 22051# define isnanl(x) __builtin_isnan ((long double)(x))
88b48903
WN
22052#elif defined isnan
22053# undef isnanl
22054# define isnanl(x) isnan ((long double)(x))
22055#endif
22056#define NWORDS \
22057 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
22058typedef union { unsigned int word[NWORDS]; long double value; }
22059 memory_long_double;
22060/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
22061 runtime type conversion. */
22062#ifdef __sgi
22063static long double NaNl ()
22064{
22065 double zero = 0.0;
22066 return zero / zero;
22067}
22068#else
22069# define NaNl() (0.0L / 0.0L)
22070#endif
22071int main ()
22072{
22073 int result = 0;
22074
22075 if (!isnanl (NaNl ()))
22076 result |= 1;
22077
22078 {
22079 memory_long_double m;
22080 unsigned int i;
22081
22082 /* The isnanl function should be immune against changes in the sign bit and
22083 in the mantissa bits. The xor operation twiddles a bit that can only be
22084 a sign bit or a mantissa bit (since the exponent never extends to
22085 bit 31). */
22086 m.value = NaNl ();
22087 m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
22088 for (i = 0; i < NWORDS; i++)
22089 m.word[i] |= 1;
22090 if (!isnanl (m.value))
22091 result |= 1;
22092 }
22093
22094#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
22095/* Representation of an 80-bit 'long double' as an initializer for a sequence
22096 of 'unsigned int' words. */
22097# ifdef WORDS_BIGENDIAN
22098# define LDBL80_WORDS(exponent,manthi,mantlo) \
22099 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
4a626d0a 22100 ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
88b48903
WN
22101 (unsigned int) (mantlo) << 16 \
22102 }
22103# else
22104# define LDBL80_WORDS(exponent,manthi,mantlo) \
22105 { mantlo, manthi, exponent }
22106# endif
22107 { /* Quiet NaN. */
22108 static memory_long_double x =
22109 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
22110 if (!isnanl (x.value))
22111 result |= 2;
22112 }
22113 {
22114 /* Signalling NaN. */
22115 static memory_long_double x =
22116 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
22117 if (!isnanl (x.value))
22118 result |= 2;
22119 }
4a626d0a 22120 /* isnanl should return something even for noncanonical values. */
88b48903
WN
22121 { /* Pseudo-NaN. */
22122 static memory_long_double x =
22123 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
4a626d0a 22124 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22125 result |= 4;
22126 }
22127 { /* Pseudo-Infinity. */
22128 static memory_long_double x =
22129 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
4a626d0a 22130 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22131 result |= 8;
22132 }
22133 { /* Pseudo-Zero. */
22134 static memory_long_double x =
22135 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
4a626d0a 22136 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22137 result |= 16;
22138 }
22139 { /* Unnormalized number. */
22140 static memory_long_double x =
22141 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
4a626d0a 22142 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22143 result |= 32;
22144 }
22145 { /* Pseudo-Denormal. */
22146 static memory_long_double x =
22147 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
4a626d0a 22148 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
22149 result |= 64;
22150 }
22151#endif
22152
22153 return result;
22154}
22155_ACEOF
22156if ac_fn_c_try_run "$LINENO"; then :
22157 gl_cv_func_isnanl_works=yes
22158else
22159 gl_cv_func_isnanl_works=no
22160fi
22161rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22162 conftest.$ac_objext conftest.beam conftest.$ac_ext
22163fi
22164
22165
22166fi
22167{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
22168$as_echo "$gl_cv_func_isnanl_works" >&6; }
22169
22170 case "$gl_cv_func_isnanl_works" in
22171 *yes) ;;
22172 *) gl_func_isnanl_no_libm=no ;;
22173 esac
22174 fi
22175 if test $gl_func_isnanl_no_libm = yes; then
22176
22177$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
22178
22179 fi
22180
22181 if test $gl_func_isnanl_no_libm != yes; then
22182
22183
22184
22185
22186
22187
22188
22189
22190 gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext"
22191
22192
22193
22194
c0c3707f 22195 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
88b48903 22196$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
d0ac1c44 22197if ${gl_cv_cc_long_double_expbit0+:} false; then :
88b48903
WN
22198 $as_echo_n "(cached) " >&6
22199else
22200
22201 if test "$cross_compiling" = yes; then :
22202
22203 gl_cv_cc_long_double_expbit0="unknown"
c0c3707f
CB
22204 case "$host_os" in
22205 mingw*) # On native Windows (little-endian), we know the result
22206 # in two cases: mingw, MSVC.
22207 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22208/* end confdefs.h. */
22209
22210#ifdef __MINGW32__
22211 Known
22212#endif
22213
22214_ACEOF
22215if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22216 $EGREP "Known" >/dev/null 2>&1; then :
22217 gl_cv_cc_long_double_expbit0="word 2 bit 0"
22218fi
22219rm -f conftest*
22220
22221 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22222/* end confdefs.h. */
22223
22224#ifdef _MSC_VER
22225 Known
22226#endif
22227
22228_ACEOF
22229if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22230 $EGREP "Known" >/dev/null 2>&1; then :
22231 gl_cv_cc_long_double_expbit0="word 1 bit 20"
22232fi
22233rm -f conftest*
22234
22235 ;;
22236 esac
88b48903
WN
22237
22238else
22239 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22240/* end confdefs.h. */
22241
22242#include <float.h>
22243#include <stddef.h>
22244#include <stdio.h>
22245#include <string.h>
22246#define NWORDS \
22247 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
22248typedef union { long double value; unsigned int word[NWORDS]; }
22249 memory_long_double;
22250static unsigned int ored_words[NWORDS];
22251static unsigned int anded_words[NWORDS];
698be2d8 22252static void add_to_ored_words (long double *x)
88b48903
WN
22253{
22254 memory_long_double m;
22255 size_t i;
22256 /* Clear it first, in case
22257 sizeof (long double) < sizeof (memory_long_double). */
22258 memset (&m, 0, sizeof (memory_long_double));
698be2d8 22259 m.value = *x;
88b48903
WN
22260 for (i = 0; i < NWORDS; i++)
22261 {
22262 ored_words[i] |= m.word[i];
22263 anded_words[i] &= m.word[i];
22264 }
22265}
22266int main ()
22267{
698be2d8 22268 static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
88b48903
WN
22269 size_t j;
22270 FILE *fp = fopen ("conftest.out", "w");
22271 if (fp == NULL)
22272 return 1;
22273 for (j = 0; j < NWORDS; j++)
22274 anded_words[j] = ~ (unsigned int) 0;
698be2d8
CB
22275 for (j = 0; j < 5; j++)
22276 add_to_ored_words (&samples[j]);
88b48903
WN
22277 /* Remove bits that are common (e.g. if representation of the first mantissa
22278 bit is explicit). */
22279 for (j = 0; j < NWORDS; j++)
22280 ored_words[j] &= ~anded_words[j];
22281 /* Now find the nonzero word. */
22282 for (j = 0; j < NWORDS; j++)
22283 if (ored_words[j] != 0)
22284 break;
22285 if (j < NWORDS)
22286 {
22287 size_t i;
22288 for (i = j + 1; i < NWORDS; i++)
22289 if (ored_words[i] != 0)
22290 {
22291 fprintf (fp, "unknown");
22292 return (fclose (fp) != 0);
22293 }
22294 for (i = 0; ; i++)
22295 if ((ored_words[j] >> i) & 1)
22296 {
22297 fprintf (fp, "word %d bit %d", (int) j, (int) i);
22298 return (fclose (fp) != 0);
22299 }
22300 }
22301 fprintf (fp, "unknown");
22302 return (fclose (fp) != 0);
22303}
22304
22305_ACEOF
22306if ac_fn_c_try_run "$LINENO"; then :
22307 gl_cv_cc_long_double_expbit0=`cat conftest.out`
22308else
22309 gl_cv_cc_long_double_expbit0="unknown"
22310fi
22311rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22312 conftest.$ac_objext conftest.beam conftest.$ac_ext
22313fi
22314
22315 rm -f conftest.out
22316
22317fi
22318{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
22319$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
22320 case "$gl_cv_cc_long_double_expbit0" in
22321 word*bit*)
22322 word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
22323 bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
22324
22325cat >>confdefs.h <<_ACEOF
22326#define LDBL_EXPBIT0_WORD $word
22327_ACEOF
22328
22329
22330cat >>confdefs.h <<_ACEOF
22331#define LDBL_EXPBIT0_BIT $bit
22332_ACEOF
22333
22334 ;;
22335 esac
22336
22337
22338
22339 fi
22340
22341
5df4cba6
SM
22342 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
22343$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; }
22344if ${gl_cv_c___inline+:} false; then :
22345 $as_echo_n "(cached) " >&6
22346else
22347 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22348/* end confdefs.h. */
22349typedef int foo_t;
22350 static __inline foo_t foo (void) { return 0; }
22351int
22352main ()
22353{
22354return foo ();
22355 ;
22356 return 0;
22357}
22358_ACEOF
22359if ac_fn_c_try_compile "$LINENO"; then :
22360 gl_cv_c___inline=yes
22361else
22362 gl_cv_c___inline=no
22363fi
22364rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22365fi
22366{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
22367$as_echo "$gl_cv_c___inline" >&6; }
22368 if test $gl_cv_c___inline = yes; then
22369
22370$as_echo "#define HAVE___INLINE 1" >>confdefs.h
22371
22372 fi
22373
22374
22375
22376
22377
22378 LOCALCHARSET_TESTS_ENVIRONMENT=
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390 case "$host_os" in
22391 solaris*)
22392
22393$as_echo "#define _LCONV_C99 1" >>confdefs.h
22394
22395 ;;
22396 esac
22397
22398 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
22399$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; }
22400if ${gl_cv_header_locale_h_posix2001+:} false; then :
22401 $as_echo_n "(cached) " >&6
22402else
22403 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22404/* end confdefs.h. */
22405#include <locale.h>
22406 int x = LC_MESSAGES;
22407 int y = sizeof (((struct lconv *) 0)->decimal_point);
22408int
22409main ()
22410{
22411
22412 ;
22413 return 0;
22414}
22415_ACEOF
22416if ac_fn_c_try_compile "$LINENO"; then :
22417 gl_cv_header_locale_h_posix2001=yes
22418else
22419 gl_cv_header_locale_h_posix2001=no
22420fi
22421rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22422fi
22423{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
22424$as_echo "$gl_cv_header_locale_h_posix2001" >&6; }
22425
22426 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
22427$as_echo_n "checking whether struct lconv is properly defined... " >&6; }
22428if ${gl_cv_sys_struct_lconv_ok+:} false; then :
c0c3707f
CB
22429 $as_echo_n "(cached) " >&6
22430else
22431 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22432/* end confdefs.h. */
5df4cba6
SM
22433#include <locale.h>
22434 struct lconv l;
22435 int x = sizeof (l.decimal_point);
22436 int y = sizeof (l.int_p_cs_precedes);
c0c3707f
CB
22437int
22438main ()
22439{
5df4cba6 22440
c0c3707f
CB
22441 ;
22442 return 0;
22443}
22444_ACEOF
22445if ac_fn_c_try_compile "$LINENO"; then :
5df4cba6 22446 gl_cv_sys_struct_lconv_ok=yes
c0c3707f 22447else
5df4cba6 22448 gl_cv_sys_struct_lconv_ok=no
c0c3707f
CB
22449fi
22450rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5df4cba6 22451
c0c3707f 22452fi
5df4cba6
SM
22453{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
22454$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
22455 if test $gl_cv_sys_struct_lconv_ok = no; then
22456 case "$host_os" in
22457 mingw*)
22458 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22459/* end confdefs.h. */
c0c3707f 22460
5df4cba6
SM
22461#ifdef _MSC_VER
22462 Special
22463#endif
22464
22465_ACEOF
22466if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22467 $EGREP "Special" >/dev/null 2>&1; then :
22468
22469else
22470 REPLACE_STRUCT_LCONV=1
22471fi
22472rm -f conftest*
c0c3707f 22473
5df4cba6
SM
22474 ;;
22475 *) REPLACE_STRUCT_LCONV=1 ;;
22476 esac
c0c3707f 22477 fi
88b48903
WN
22478
22479
88b48903
WN
22480
22481
472fa5ee 22482
5df4cba6
SM
22483
22484
22485
22486
22487 if test $gl_cv_have_include_next = yes; then
22488 gl_cv_next_locale_h='<'locale.h'>'
22489 else
22490 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
22491$as_echo_n "checking absolute name of <locale.h>... " >&6; }
22492if ${gl_cv_next_locale_h+:} false; then :
22493 $as_echo_n "(cached) " >&6
22494else
22495
22496
22497
22498 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22499/* end confdefs.h. */
22500#include <locale.h>
22501_ACEOF
22502 case "$host_os" in
22503 aix*) gl_absname_cpp="$ac_cpp -C" ;;
22504 *) gl_absname_cpp="$ac_cpp" ;;
22505 esac
22506
22507 case "$host_os" in
22508 mingw*)
22509 gl_dirsep_regex='[/\\]'
22510 ;;
22511 *)
22512 gl_dirsep_regex='\/'
22513 ;;
22514 esac
22515 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
22516 gl_header_literal_regex=`echo 'locale.h' \
22517 | sed -e "$gl_make_literal_regex_sed"`
22518 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
22519 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
22520 s|^/[^/]|//&|
22521 p
22522 q
22523 }'
22524
22525 gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
22526 sed -n "$gl_absolute_header_sed"`
22527
22528 gl_header=$gl_cv_absolute_locale_h
22529 gl_cv_next_locale_h='"'$gl_header'"'
22530
22531
22532fi
22533{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
22534$as_echo "$gl_cv_next_locale_h" >&6; }
22535 fi
22536 NEXT_LOCALE_H=$gl_cv_next_locale_h
22537
22538 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
22539 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
22540 gl_next_as_first_directive='<'locale.h'>'
22541 else
22542 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
22543 gl_next_as_first_directive=$gl_cv_next_locale_h
22544 fi
22545 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
22546
22547
22548
22549
22550
22551
22552
22553
472fa5ee
SM
22554
22555
22556
5abebf3c
CB
22557 if test "$gl_threads_api" = posix; then
22558 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
22559 # pthread_rwlock_* functions.
c0c3707f 22560 has_rwlock=false
5abebf3c
CB
22561 ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
22562"
22563if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
c0c3707f 22564 has_rwlock=true
5abebf3c
CB
22565
22566$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
22567
22568fi
22569
c0c3707f
CB
22570 if $has_rwlock; then
22571
22572
22573 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
22574$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
22575if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
22576 $as_echo_n "(cached) " >&6
22577else
22578 save_LIBS="$LIBS"
22579 LIBS="$LIBS $LIBMULTITHREAD"
22580 if test "$cross_compiling" = yes; then :
22581 case "$host_os" in
22582 # Guess no on glibc systems.
22583 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22584 # Guess no on musl systems.
22585 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22586 # Guess no on bionic systems.
22587 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
22588 # Guess yes on native Windows with the mingw-w64 winpthreads library.
22589 # Guess no on native Windows with the gnulib windows-rwlock module.
22590 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
22591 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
22592 else
22593 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
22594 fi
22595 ;;
22596 # If we don't know, obey --enable-cross-guesses.
22597 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
22598 esac
22599
22600else
22601 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22602/* end confdefs.h. */
22603
22604#include <errno.h>
22605#include <pthread.h>
22606#include <stdlib.h>
22607#include <unistd.h>
22608
22609#define SUCCEED() exit (0)
22610#define FAILURE() exit (1)
22611#define UNEXPECTED(n) (exit (10 + (n)))
22612
22613/* The main thread creates the waiting writer and the requesting reader threads
22614 in the default way; this guarantees that they have the same priority.
22615 We can reuse the main thread as first reader thread. */
22616
22617static pthread_rwlock_t lock;
22618static pthread_t reader1;
22619static pthread_t writer;
22620static pthread_t reader2;
22621static pthread_t timer;
22622/* Used to pass control from writer to reader2 and from reader2 to timer,
22623 as in a relay race.
22624 Passing control from one running thread to another running thread
22625 is most likely faster than to create the second thread. */
22626static pthread_mutex_t baton;
22627
22628static void *
22629timer_func (void *ignored)
22630{
22631 /* Step 13 (can be before or after step 12):
22632 The timer thread takes the baton, then waits a moment to make sure
22633 it can tell whether the second reader thread is blocked at step 12. */
22634 if (pthread_mutex_lock (&baton))
22635 UNEXPECTED (13);
22636 usleep (100000);
22637 /* By the time we get here, it's clear that the second reader thread is
22638 blocked at step 12. This is the desired behaviour. */
22639 SUCCEED ();
22640}
22641
22642static void *
22643reader2_func (void *ignored)
22644{
22645 int err;
22646
22647 /* Step 8 (can be before or after step 7):
22648 The second reader thread takes the baton, then waits a moment to make sure
22649 the writer thread has reached step 7. */
22650 if (pthread_mutex_lock (&baton))
22651 UNEXPECTED (8);
22652 usleep (100000);
22653 /* Step 9: The second reader thread requests the lock. */
22654 err = pthread_rwlock_tryrdlock (&lock);
22655 if (err == 0)
22656 FAILURE ();
22657 else if (err != EBUSY)
22658 UNEXPECTED (9);
22659 /* Step 10: Launch a timer, to test whether the next call blocks. */
22660 if (pthread_create (&timer, NULL, timer_func, NULL))
22661 UNEXPECTED (10);
22662 /* Step 11: Release the baton. */
22663 if (pthread_mutex_unlock (&baton))
22664 UNEXPECTED (11);
22665 /* Step 12: The second reader thread requests the lock. */
22666 err = pthread_rwlock_rdlock (&lock);
22667 if (err == 0)
22668 FAILURE ();
22669 else
22670 UNEXPECTED (12);
22671}
22672
22673static void *
22674writer_func (void *ignored)
22675{
22676 /* Step 4: Take the baton, so that the second reader thread does not go ahead
22677 too early. */
22678 if (pthread_mutex_lock (&baton))
22679 UNEXPECTED (4);
22680 /* Step 5: Create the second reader thread. */
22681 if (pthread_create (&reader2, NULL, reader2_func, NULL))
22682 UNEXPECTED (5);
22683 /* Step 6: Release the baton. */
22684 if (pthread_mutex_unlock (&baton))
22685 UNEXPECTED (6);
22686 /* Step 7: The writer thread requests the lock. */
22687 if (pthread_rwlock_wrlock (&lock))
22688 UNEXPECTED (7);
22689 return NULL;
22690}
22691
22692int
22693main ()
22694{
22695 reader1 = pthread_self ();
22696
22697 /* Step 1: The main thread initializes the lock and the baton. */
22698 if (pthread_rwlock_init (&lock, NULL))
22699 UNEXPECTED (1);
22700 if (pthread_mutex_init (&baton, NULL))
22701 UNEXPECTED (1);
22702 /* Step 2: The main thread acquires the lock as a reader. */
22703 if (pthread_rwlock_rdlock (&lock))
22704 UNEXPECTED (2);
22705 /* Step 3: Create the writer thread. */
22706 if (pthread_create (&writer, NULL, writer_func, NULL))
22707 UNEXPECTED (3);
22708 /* Job done. Go to sleep. */
22709 for (;;)
22710 {
22711 sleep (1);
22712 }
22713}
22714
22715_ACEOF
22716if ac_fn_c_try_run "$LINENO"; then :
22717 gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
22718else
22719 gl_cv_pthread_rwlock_rdlock_prefer_writer=no
22720fi
22721rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22722 conftest.$ac_objext conftest.beam conftest.$ac_ext
22723fi
22724
22725 LIBS="$save_LIBS"
22726
22727fi
22728{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
22729$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
22730 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
22731 *yes)
22732
22733$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
22734
22735 ;;
22736 esac
22737
22738 fi
5abebf3c
CB
22739 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
22740 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22741/* end confdefs.h. */
22742
22743 #include <pthread.h>
22744int
22745main ()
22746{
22747
22748#if __FreeBSD__ == 4
22749error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
22750#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
22751 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
22752error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
22753#else
22754int x = (int)PTHREAD_MUTEX_RECURSIVE;
22755return !x;
22756#endif
22757
22758 ;
22759 return 0;
22760}
22761_ACEOF
22762if ac_fn_c_try_compile "$LINENO"; then :
22763
22764$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
22765
22766fi
22767rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22768 fi
22769 :
22770
22771
22772
22773cat >>confdefs.h <<_ACEOF
22774#define GNULIB_LOCK 1
22775_ACEOF
22776
22777
22778
22779
88b48903 22780
472fa5ee 22781
f45c62c4
YQ
22782 if test $ac_cv_func_lstat = yes; then
22783
c0c3707f
CB
22784 case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
22785 solaris* | *no)
f45c62c4
YQ
22786 REPLACE_LSTAT=1
22787 ;;
22788 esac
22789 else
22790 HAVE_LSTAT=0
22791 fi
22792
22793 if test $REPLACE_LSTAT = 1; then
22794
22795
22796
22797
22798
22799
22800
22801
22802 gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
22803
22804 :
22805 fi
22806
22807
22808
22809
22810
22811 GNULIB_LSTAT=1
22812
22813
22814
22815
22816
22817$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
22818
22819
22820
22821
22822
22823
6a29c58e
YQ
22824 if test $gl_cv_func_malloc_posix = yes; then
22825
22826$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
22827
22828 else
22829 REPLACE_MALLOC=1
22830 fi
22831
22832 if test $REPLACE_MALLOC = 1; then
22833
22834
22835
22836
22837
22838
22839
22840
22841 gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
22842
22843 fi
22844
22845
22846
22847
22848
22849 GNULIB_MALLOC_POSIX=1
22850
22851
22852
22853
22854
22855$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
22856
22857
22858
22859
22860
22861
88b48903
WN
22862
22863
22864
22865
22866
88b48903 22867
c971b7fa 22868
c971b7fa 22869
98399780
YQ
22870
22871
22872
88b48903
WN
22873 if test $gl_cv_have_include_next = yes; then
22874 gl_cv_next_math_h='<'math.h'>'
22875 else
22876 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
22877$as_echo_n "checking absolute name of <math.h>... " >&6; }
d0ac1c44 22878if ${gl_cv_next_math_h+:} false; then :
88b48903
WN
22879 $as_echo_n "(cached) " >&6
22880else
c971b7fa 22881
88b48903 22882 if test $ac_cv_header_math_h = yes; then
c971b7fa
PA
22883
22884
4a626d0a
PA
22885
22886
22887 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 22888/* end confdefs.h. */
88b48903 22889#include <math.h>
8690e634 22890_ACEOF
4a626d0a
PA
22891 case "$host_os" in
22892 aix*) gl_absname_cpp="$ac_cpp -C" ;;
22893 *) gl_absname_cpp="$ac_cpp" ;;
22894 esac
22895
22896 case "$host_os" in
22897 mingw*)
22898 gl_dirsep_regex='[/\\]'
22899 ;;
22900 *)
22901 gl_dirsep_regex='\/'
22902 ;;
22903 esac
22904 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
22905 gl_header_literal_regex=`echo 'math.h' \
22906 | sed -e "$gl_make_literal_regex_sed"`
22907 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
22908 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
22909 s|^/[^/]|//&|
22910 p
22911 q
22912 }'
22913
22914 gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
22915 sed -n "$gl_absolute_header_sed"`
22916
22917 gl_header=$gl_cv_absolute_math_h
22918 gl_cv_next_math_h='"'$gl_header'"'
88b48903
WN
22919 else
22920 gl_cv_next_math_h='<'math.h'>'
22921 fi
8690e634 22922
c971b7fa 22923
88b48903
WN
22924fi
22925{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
22926$as_echo "$gl_cv_next_math_h" >&6; }
22927 fi
22928 NEXT_MATH_H=$gl_cv_next_math_h
c971b7fa 22929
88b48903
WN
22930 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
22931 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
22932 gl_next_as_first_directive='<'math.h'>'
22933 else
22934 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
22935 gl_next_as_first_directive=$gl_cv_next_math_h
22936 fi
22937 NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
8690e634 22938
c971b7fa 22939
c971b7fa
PA
22940
22941
c971b7fa 22942
88b48903
WN
22943 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
22944$as_echo_n "checking whether NAN macro works... " >&6; }
d0ac1c44 22945if ${gl_cv_header_math_nan_works+:} false; then :
c971b7fa
PA
22946 $as_echo_n "(cached) " >&6
22947else
8690e634
JK
22948 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22949/* end confdefs.h. */
88b48903 22950#include <math.h>
c971b7fa
PA
22951int
22952main ()
22953{
88b48903
WN
22954/* Solaris 10 has a broken definition of NAN. Other platforms
22955 fail to provide NAN, or provide it only in C99 mode; this
22956 test only needs to fail when NAN is provided but wrong. */
22957 float f = 1.0f;
22958#ifdef NAN
22959 f = NAN;
22960#endif
22961 return f == 0;
c971b7fa
PA
22962 ;
22963 return 0;
22964}
22965_ACEOF
22966if ac_fn_c_try_compile "$LINENO"; then :
88b48903 22967 gl_cv_header_math_nan_works=yes
8690e634 22968else
88b48903 22969 gl_cv_header_math_nan_works=no
c971b7fa
PA
22970fi
22971rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 22972fi
88b48903
WN
22973{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
22974$as_echo "$gl_cv_header_math_nan_works" >&6; }
22975 if test $gl_cv_header_math_nan_works = no; then
22976 REPLACE_NAN=1
c971b7fa 22977 fi
88b48903
WN
22978 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
22979$as_echo_n "checking whether HUGE_VAL works... " >&6; }
d0ac1c44 22980if ${gl_cv_header_math_huge_val_works+:} false; then :
c971b7fa
PA
22981 $as_echo_n "(cached) " >&6
22982else
8690e634 22983 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 22984/* end confdefs.h. */
88b48903 22985#include <math.h>
c971b7fa
PA
22986int
22987main ()
22988{
88b48903
WN
22989/* Solaris 10 has a broken definition of HUGE_VAL. */
22990 double d = HUGE_VAL;
22991 return d == 0;
c971b7fa
PA
22992 ;
22993 return 0;
22994}
22995_ACEOF
22996if ac_fn_c_try_compile "$LINENO"; then :
88b48903 22997 gl_cv_header_math_huge_val_works=yes
8690e634 22998else
88b48903 22999 gl_cv_header_math_huge_val_works=no
c971b7fa
PA
23000fi
23001rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 23002fi
88b48903
WN
23003{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
23004$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
23005 if test $gl_cv_header_math_huge_val_works = no; then
23006 REPLACE_HUGE_VAL=1
8690e634 23007 fi
c971b7fa 23008
c971b7fa 23009
c971b7fa
PA
23010
23011
23012
23013
23014
23015
c971b7fa 23016
c971b7fa 23017
c971b7fa 23018
c971b7fa
PA
23019
23020
c971b7fa 23021
472fa5ee 23022
5df4cba6
SM
23023
23024
23025
23026 if case "$host_os" in
23027 mingw*) true ;;
23028 *) test $ac_cv_func_mbsinit = yes ;;
23029 esac \
23030 && test $ac_cv_func_mbrtowc = yes; then
472fa5ee
SM
23031
23032
23033
23034
c0c3707f
CB
23035 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
23036$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
23037if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
23038 $as_echo_n "(cached) " >&6
23039else
472fa5ee 23040
c0c3707f
CB
23041 case "$host_os" in
23042 # Guess no on AIX and OSF/1.
23043 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
23044 # Guess yes otherwise.
23045 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
23046 esac
23047 if test $LOCALE_JA != none; then
23048 if test "$cross_compiling" = yes; then :
472fa5ee 23049 :
c0c3707f
CB
23050else
23051 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23052/* end confdefs.h. */
472fa5ee 23053
c0c3707f
CB
23054#include <locale.h>
23055#include <string.h>
c0c3707f
CB
23056#include <wchar.h>
23057int main ()
23058{
23059 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23060 {
23061 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23062 mbstate_t state;
23063 wchar_t wc;
472fa5ee 23064
c0c3707f
CB
23065 memset (&state, '\0', sizeof (mbstate_t));
23066 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23067 if (mbsinit (&state))
23068 return 2;
23069 }
23070 return 0;
23071}
23072_ACEOF
23073if ac_fn_c_try_run "$LINENO"; then :
23074 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 23075else
c0c3707f
CB
23076 gl_cv_func_mbrtowc_incomplete_state=no
23077fi
23078rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23079 conftest.$ac_objext conftest.beam conftest.$ac_ext
23080fi
8690e634 23081
c0c3707f
CB
23082 else
23083 if test $LOCALE_FR_UTF8 != none; then
23084 if test "$cross_compiling" = yes; then :
8690e634
JK
23085 :
23086else
c971b7fa
PA
23087 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23088/* end confdefs.h. */
c971b7fa 23089
8690e634
JK
23090#include <locale.h>
23091#include <string.h>
8690e634
JK
23092#include <wchar.h>
23093int main ()
c971b7fa 23094{
c0c3707f 23095 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
8690e634 23096 {
c0c3707f 23097 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
8690e634
JK
23098 mbstate_t state;
23099 wchar_t wc;
23100
23101 memset (&state, '\0', sizeof (mbstate_t));
23102 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23103 if (mbsinit (&state))
c0c3707f 23104 return 2;
8690e634 23105 }
c971b7fa
PA
23106 return 0;
23107}
23108_ACEOF
8690e634
JK
23109if ac_fn_c_try_run "$LINENO"; then :
23110 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 23111else
8690e634 23112 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa 23113fi
8690e634
JK
23114rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23115 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 23116fi
c971b7fa 23117
c0c3707f 23118 fi
8690e634 23119 fi
c971b7fa 23120
8690e634
JK
23121fi
23122{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
23123$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa 23124
c971b7fa 23125
c971b7fa 23126
c971b7fa 23127
8690e634
JK
23128 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
23129$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 23130if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
23131 $as_echo_n "(cached) " >&6
23132else
23133
8690e634
JK
23134 case "$host_os" in
23135 # Guess no on Solaris 8.
23136 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
23137 # Guess yes otherwise.
23138 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
23139 esac
23140 if test $LOCALE_ZH_CN != none; then
23141 if test "$cross_compiling" = yes; then :
23142 :
23143else
23144 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
23145/* end confdefs.h. */
23146
8690e634
JK
23147#include <locale.h>
23148#include <stdlib.h>
23149#include <string.h>
8690e634
JK
23150#include <wchar.h>
23151int main ()
c971b7fa 23152{
8690e634
JK
23153 /* This fails on Solaris 8:
23154 mbrtowc returns 2, and sets wc to 0x00F0.
23155 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
23156 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23157 {
23158 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
23159 mbstate_t state;
23160 wchar_t wc;
23161
23162 memset (&state, '\0', sizeof (mbstate_t));
23163 if (mbrtowc (&wc, input + 3, 6, &state) != 4
23164 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 23165 return 2;
8690e634 23166 }
c971b7fa
PA
23167 return 0;
23168}
23169_ACEOF
8690e634
JK
23170if ac_fn_c_try_run "$LINENO"; then :
23171 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 23172else
8690e634 23173 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 23174fi
8690e634
JK
23175rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23176 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 23177fi
c971b7fa 23178
8690e634 23179 fi
c971b7fa 23180
8690e634
JK
23181fi
23182{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
23183$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
23184
23185 REPLACE_MBSTATE_T=0
23186 case "$gl_cv_func_mbrtowc_incomplete_state" in
23187 *yes) ;;
23188 *) REPLACE_MBSTATE_T=1 ;;
23189 esac
23190 case "$gl_cv_func_mbrtowc_sanitycheck" in
23191 *yes) ;;
23192 *) REPLACE_MBSTATE_T=1 ;;
23193 esac
c971b7fa 23194 else
8690e634 23195 REPLACE_MBSTATE_T=1
c971b7fa
PA
23196 fi
23197
23198
23199
8690e634
JK
23200 if test $ac_cv_func_mbrtowc = no; then
23201 HAVE_MBRTOWC=0
23202 ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
9c9d63b1 23203 #include <wchar.h>
c971b7fa 23204
8690e634 23205"
d0ac1c44 23206if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
8690e634
JK
23207 ac_have_decl=1
23208else
23209 ac_have_decl=0
c971b7fa 23210fi
c971b7fa 23211
8690e634
JK
23212cat >>confdefs.h <<_ACEOF
23213#define HAVE_DECL_MBRTOWC $ac_have_decl
23214_ACEOF
c971b7fa 23215
8690e634
JK
23216 if test $ac_cv_have_decl_mbrtowc = yes; then
23217 REPLACE_MBRTOWC=1
23218 fi
23219 else
23220 if test $REPLACE_MBSTATE_T = 1; then
23221 REPLACE_MBRTOWC=1
23222 else
c971b7fa
PA
23223
23224
23225
8690e634
JK
23226 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
23227$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
d0ac1c44 23228if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
8690e634 23229 $as_echo_n "(cached) " >&6
c971b7fa 23230else
c971b7fa 23231
8690e634
JK
23232 case "$host_os" in
23233 # Guess no on Solaris.
23234 solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
23235 # Guess yes otherwise.
23236 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
23237 esac
23238 if test $LOCALE_FR_UTF8 != none; then
23239 if test "$cross_compiling" = yes; then :
23240 :
23241else
23242 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
23243/* end confdefs.h. */
23244
8690e634
JK
23245#include <locale.h>
23246#include <stdlib.h>
23247#include <string.h>
8690e634
JK
23248#include <wchar.h>
23249int main ()
23250{
23251 int result = 0;
23252
23253 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23254 {
23255 char input[] = "\303\237er";
23256 mbstate_t state;
23257 wchar_t wc;
23258 size_t ret;
23259
23260 memset (&state, '\0', sizeof (mbstate_t));
23261 wc = (wchar_t) 0xBADFACE;
23262 ret = mbrtowc (&wc, input, 5, &state);
23263 if (ret != 2)
23264 result |= 1;
23265 if (!mbsinit (&state))
23266 result |= 2;
c971b7fa 23267
8690e634
JK
23268 memset (&state, '\0', sizeof (mbstate_t));
23269 ret = mbrtowc (NULL, input, 5, &state);
23270 if (ret != 2) /* Solaris 7 fails here: ret is -1. */
23271 result |= 4;
23272 if (!mbsinit (&state))
23273 result |= 8;
23274 }
23275 return result;
23276}
c971b7fa 23277_ACEOF
8690e634
JK
23278if ac_fn_c_try_run "$LINENO"; then :
23279 gl_cv_func_mbrtowc_null_arg1=yes
23280else
23281 gl_cv_func_mbrtowc_null_arg1=no
23282fi
23283rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23284 conftest.$ac_objext conftest.beam conftest.$ac_ext
23285fi
c971b7fa 23286
8690e634 23287 fi
c971b7fa 23288
c971b7fa 23289fi
8690e634
JK
23290{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
23291$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
c971b7fa 23292
c971b7fa 23293
c971b7fa 23294
c971b7fa 23295
8690e634
JK
23296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
23297$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
d0ac1c44 23298if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
8690e634
JK
23299 $as_echo_n "(cached) " >&6
23300else
c971b7fa 23301
8690e634
JK
23302 case "$host_os" in
23303 # Guess no on OSF/1.
23304 osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
23305 # Guess yes otherwise.
23306 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
23307 esac
23308 if test $LOCALE_FR_UTF8 != none; then
23309 if test "$cross_compiling" = yes; then :
c971b7fa 23310 :
8690e634
JK
23311else
23312 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23313/* end confdefs.h. */
23314
23315#include <locale.h>
23316#include <string.h>
8690e634
JK
23317#include <wchar.h>
23318int main ()
23319{
23320 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23321 {
23322 mbstate_t state;
23323 wchar_t wc;
23324 int ret;
23325
23326 memset (&state, '\0', sizeof (mbstate_t));
23327 wc = (wchar_t) 0xBADFACE;
23328 mbrtowc (&wc, NULL, 5, &state);
23329 /* Check that wc was not modified. */
23330 if (wc != (wchar_t) 0xBADFACE)
c0c3707f 23331 return 2;
8690e634
JK
23332 }
23333 return 0;
23334}
23335_ACEOF
23336if ac_fn_c_try_run "$LINENO"; then :
23337 gl_cv_func_mbrtowc_null_arg2=yes
23338else
23339 gl_cv_func_mbrtowc_null_arg2=no
23340fi
23341rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23342 conftest.$ac_objext conftest.beam conftest.$ac_ext
23343fi
23344
23345 fi
23346
23347fi
23348{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
23349$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
c971b7fa
PA
23350
23351
23352
23353
23354
23355
8690e634
JK
23356 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
23357$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
d0ac1c44 23358if ${gl_cv_func_mbrtowc_retval+:} false; then :
8690e634
JK
23359 $as_echo_n "(cached) " >&6
23360else
23361
23362 case "$host_os" in
23363 # Guess no on HP-UX, Solaris, native Windows.
23364 hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
23365 # Guess yes otherwise.
23366 *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
23367 esac
23368 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
23369 || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
23370 if test "$cross_compiling" = yes; then :
c971b7fa 23371 :
8690e634
JK
23372else
23373 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23374/* end confdefs.h. */
c971b7fa 23375
8690e634
JK
23376#include <locale.h>
23377#include <string.h>
8690e634
JK
23378#include <wchar.h>
23379int main ()
23380{
23381 int result = 0;
23382 int found_some_locale = 0;
23383 /* This fails on Solaris. */
23384 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
23385 {
23386 char input[] = "B\303\274\303\237er"; /* "Büßer" */
23387 mbstate_t state;
23388 wchar_t wc;
23389
23390 memset (&state, '\0', sizeof (mbstate_t));
23391 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23392 {
23393 input[1] = '\0';
23394 if (mbrtowc (&wc, input + 2, 5, &state) != 1)
23395 result |= 1;
23396 }
23397 found_some_locale = 1;
23398 }
23399 /* This fails on HP-UX 11.11. */
23400 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
23401 {
23402 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
23403 mbstate_t state;
23404 wchar_t wc;
23405
23406 memset (&state, '\0', sizeof (mbstate_t));
23407 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
23408 {
23409 input[1] = '\0';
23410 if (mbrtowc (&wc, input + 2, 5, &state) != 2)
23411 result |= 2;
23412 }
23413 found_some_locale = 1;
23414 }
5df4cba6
SM
23415 /* This fails on native Windows. */
23416 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
23417 {
23418 char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
23419 mbstate_t state;
23420 wchar_t wc;
23421
23422 memset (&state, '\0', sizeof (mbstate_t));
23423 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23424 {
23425 input[3] = '\0';
23426 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23427 result |= 4;
23428 }
23429 found_some_locale = 1;
23430 }
23431 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
23432 {
23433 char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
23434 mbstate_t state;
23435 wchar_t wc;
23436
23437 memset (&state, '\0', sizeof (mbstate_t));
23438 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23439 {
23440 input[3] = '\0';
23441 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23442 result |= 8;
23443 }
23444 found_some_locale = 1;
23445 }
23446 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
23447 {
23448 char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
23449 mbstate_t state;
23450 wchar_t wc;
23451
23452 memset (&state, '\0', sizeof (mbstate_t));
23453 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
23454 {
23455 input[3] = '\0';
23456 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
23457 result |= 16;
23458 }
23459 found_some_locale = 1;
23460 }
23461 return (found_some_locale ? result : 77);
23462}
23463_ACEOF
23464if ac_fn_c_try_run "$LINENO"; then :
23465 gl_cv_func_mbrtowc_retval=yes
23466else
23467 if test $? != 77; then
23468 gl_cv_func_mbrtowc_retval=no
23469 fi
23470
23471fi
23472rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23473 conftest.$ac_objext conftest.beam conftest.$ac_ext
23474fi
23475
23476 fi
23477
23478fi
23479{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
23480$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
23481
23482
23483
23484
23485 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
23486$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
23487if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
23488 $as_echo_n "(cached) " >&6
23489else
23490
23491 case "$host_os" in
23492 # Guess no on Solaris 8 and 9.
23493 solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
23494 # Guess yes otherwise.
23495 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
23496 esac
23497 if test $LOCALE_ZH_CN != none; then
23498 if test "$cross_compiling" = yes; then :
23499 :
23500else
23501 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23502/* end confdefs.h. */
23503
23504#include <locale.h>
23505#include <string.h>
5df4cba6
SM
23506#include <wchar.h>
23507int main ()
23508{
23509 /* This fails on Solaris 8 and 9. */
23510 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
23511 {
23512 mbstate_t state;
23513 wchar_t wc;
23514
23515 memset (&state, '\0', sizeof (mbstate_t));
23516 if (mbrtowc (&wc, "", 1, &state) != 0)
23517 return 2;
23518 }
23519 return 0;
23520}
23521_ACEOF
23522if ac_fn_c_try_run "$LINENO"; then :
23523 gl_cv_func_mbrtowc_nul_retval=yes
23524else
23525 gl_cv_func_mbrtowc_nul_retval=no
23526fi
23527rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23528 conftest.$ac_objext conftest.beam conftest.$ac_ext
23529fi
23530
23531 fi
23532
23533fi
23534{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
23535$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
23536
23537
23538
23539 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5
23540$as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; }
23541if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then :
23542 $as_echo_n "(cached) " >&6
23543else
23544
23545 case "$host_os" in
23546 # Guess yes on native Windows.
23547 mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
23548 *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
23549 esac
23550 case "$host_os" in
23551 mingw*)
23552 if test "$cross_compiling" = yes; then :
23553 :
23554else
23555 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23556/* end confdefs.h. */
23557
23558#include <locale.h>
23559#include <string.h>
5df4cba6
SM
23560#include <wchar.h>
23561int main ()
23562{
23563 int result = 0;
23564 if (setlocale (LC_ALL, "French_France.65001") != NULL)
23565 {
23566 wchar_t wc = (wchar_t) 0xBADFACE;
23567 mbstate_t state;
23568
23569 memset (&state, '\0', sizeof (mbstate_t));
23570 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
23571 && wc != (wchar_t) 0xBADFACE)
23572 result |= 1;
23573 }
8690e634
JK
23574 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
23575 {
5df4cba6 23576 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23577 mbstate_t state;
8690e634
JK
23578
23579 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23580 if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
23581 && wc != (wchar_t) 0xBADFACE)
23582 result |= 2;
8690e634
JK
23583 }
23584 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
23585 {
5df4cba6 23586 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23587 mbstate_t state;
8690e634
JK
23588
23589 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23590 if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
23591 && wc != (wchar_t) 0xBADFACE)
23592 result |= 4;
8690e634
JK
23593 }
23594 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
23595 {
5df4cba6 23596 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23597 mbstate_t state;
8690e634
JK
23598
23599 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23600 if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
23601 && wc != (wchar_t) 0xBADFACE)
23602 result |= 8;
8690e634 23603 }
5df4cba6 23604 return result;
8690e634
JK
23605}
23606_ACEOF
23607if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23608 gl_cv_func_mbrtowc_stores_incomplete=no
8690e634 23609else
5df4cba6 23610 gl_cv_func_mbrtowc_stores_incomplete=yes
8690e634
JK
23611fi
23612rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23613 conftest.$ac_objext conftest.beam conftest.$ac_ext
23614fi
c971b7fa 23615
5df4cba6
SM
23616 ;;
23617 *)
8690e634 23618
5df4cba6
SM
23619 if test $LOCALE_FR_UTF8 != none; then
23620 if test "$cross_compiling" = yes; then :
8690e634 23621 :
c971b7fa
PA
23622else
23623 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23624/* end confdefs.h. */
23625
8690e634 23626#include <locale.h>
c971b7fa 23627#include <string.h>
8690e634
JK
23628#include <wchar.h>
23629int main ()
c971b7fa 23630{
5df4cba6 23631 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
c971b7fa 23632 {
5df4cba6 23633 wchar_t wc = (wchar_t) 0xBADFACE;
8690e634 23634 mbstate_t state;
c971b7fa 23635
8690e634 23636 memset (&state, '\0', sizeof (mbstate_t));
5df4cba6
SM
23637 if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
23638 && wc != (wchar_t) 0xBADFACE)
23639 return 1;
8690e634 23640 }
c971b7fa
PA
23641 return 0;
23642}
23643_ACEOF
23644if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23645 gl_cv_func_mbrtowc_stores_incomplete=no
c971b7fa 23646else
5df4cba6 23647 gl_cv_func_mbrtowc_stores_incomplete=yes
c971b7fa
PA
23648fi
23649rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23650 conftest.$ac_objext conftest.beam conftest.$ac_ext
23651fi
23652
5df4cba6
SM
23653 fi
23654 ;;
23655 esac
8690e634 23656
c971b7fa 23657fi
5df4cba6
SM
23658{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5
23659$as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; }
8690e634 23660
4a626d0a
PA
23661
23662
23663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
23664$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
d0ac1c44 23665if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
4a626d0a
PA
23666 $as_echo_n "(cached) " >&6
23667else
23668
23669 case "$host_os" in
c0c3707f
CB
23670 # Guess no on AIX and glibc systems.
23671 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
23672 # Guess yes on native Windows.
23673 mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
23674 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
4a626d0a
PA
23675 esac
23676 if test "$cross_compiling" = yes; then :
23677 :
23678else
23679 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23680/* end confdefs.h. */
23681
23682 #include <wchar.h>
23683 static wchar_t wc;
23684 static mbstate_t mbs;
23685 int
23686 main (void)
23687 {
49e4877c 23688 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
4a626d0a
PA
23689 }
23690_ACEOF
23691if ac_fn_c_try_run "$LINENO"; then :
4a626d0a 23692 gl_cv_func_mbrtowc_empty_input=yes
49e4877c
PA
23693else
23694 gl_cv_func_mbrtowc_empty_input=no
4a626d0a
PA
23695fi
23696rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23697 conftest.$ac_objext conftest.beam conftest.$ac_ext
23698fi
23699
23700
23701fi
23702{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
23703$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
23704
49e4877c 23705
c0c3707f 23706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
49e4877c 23707$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
5df4cba6 23708if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then :
49e4877c
PA
23709 $as_echo_n "(cached) " >&6
23710else
23711
5df4cba6 23712 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
49e4877c
PA
23713
23714 if test "$cross_compiling" = yes; then :
c0c3707f
CB
23715 case "$host_os" in
23716 # Guess yes on native Windows.
5df4cba6 23717 mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
c0c3707f
CB
23718 esac
23719
49e4877c
PA
23720else
23721 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23722/* end confdefs.h. */
23723#include <limits.h>
23724 #include <locale.h>
23725 #include <wchar.h>
23726
23727int
23728main ()
23729{
23730
23731 int i;
23732 char *locale = setlocale (LC_ALL, "C");
23733 if (! locale)
c0c3707f 23734 return 2;
49e4877c
PA
23735 for (i = CHAR_MIN; i <= CHAR_MAX; i++)
23736 {
23737 char c = i;
23738 wchar_t wc;
23739 mbstate_t mbs = { 0, };
23740 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
23741 if (1 < ss)
c0c3707f 23742 return 3;
49e4877c
PA
23743 }
23744 return 0;
23745
6ec2e0f5
SDJ
23746 ;
23747 return 0;
23748}
23749_ACEOF
23750if ac_fn_c_try_run "$LINENO"; then :
5df4cba6 23751 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes
6ec2e0f5 23752else
5df4cba6 23753 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no
6ec2e0f5
SDJ
23754fi
23755rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23756 conftest.$ac_objext conftest.beam conftest.$ac_ext
23757fi
23758
c0c3707f 23759
6ec2e0f5 23760fi
5df4cba6
SM
23761{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5
23762$as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; }
6ec2e0f5
SDJ
23763
23764 case "$gl_cv_func_mbrtowc_null_arg1" in
23765 *yes) ;;
23766 *)
23767$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
23768
23769 REPLACE_MBRTOWC=1
23770 ;;
23771 esac
23772 case "$gl_cv_func_mbrtowc_null_arg2" in
23773 *yes) ;;
23774 *)
23775$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
23776
23777 REPLACE_MBRTOWC=1
23778 ;;
23779 esac
23780 case "$gl_cv_func_mbrtowc_retval" in
23781 *yes) ;;
23782 *)
23783$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
23784
23785 REPLACE_MBRTOWC=1
23786 ;;
23787 esac
23788 case "$gl_cv_func_mbrtowc_nul_retval" in
23789 *yes) ;;
23790 *)
23791$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
23792
5df4cba6
SM
23793 REPLACE_MBRTOWC=1
23794 ;;
23795 esac
23796 case "$gl_cv_func_mbrtowc_stores_incomplete" in
23797 *no) ;;
23798 *)
23799$as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h
23800
23801 REPLACE_MBRTOWC=1
23802 ;;
23803 esac
23804 case "$gl_cv_func_mbrtowc_empty_input" in
23805 *yes) ;;
23806 *)
23807$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
23808
23809 REPLACE_MBRTOWC=1
23810 ;;
23811 esac
23812 case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
23813 *yes) ;;
23814 *)
23815$as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
23816
23817 REPLACE_MBRTOWC=1
23818 ;;
23819 esac
23820 fi
23821 fi
23822 if test $REPLACE_MBSTATE_T = 1; then
23823 case "$host_os" in
23824 mingw*) LIB_MBRTOWC= ;;
23825 *)
23826
23827
23828 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
23829$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
23830if ${gl_cv_have_weak+:} false; then :
23831 $as_echo_n "(cached) " >&6
23832else
23833 gl_cv_have_weak=no
23834 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23835/* end confdefs.h. */
23836extern void xyzzy ();
23837#pragma weak xyzzy
23838int
23839main ()
23840{
23841xyzzy();
23842 ;
23843 return 0;
23844}
23845_ACEOF
23846if ac_fn_c_try_link "$LINENO"; then :
23847 gl_cv_have_weak=maybe
23848fi
23849rm -f core conftest.err conftest.$ac_objext \
23850 conftest$ac_exeext conftest.$ac_ext
23851 if test $gl_cv_have_weak = maybe; then
23852 if test "$cross_compiling" = yes; then :
23853 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23854/* end confdefs.h. */
23855#ifdef __ELF__
23856 Extensible Linking Format
23857 #endif
23858
23859_ACEOF
23860if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
23861 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
23862 gl_cv_have_weak="guessing yes"
23863else
23864 gl_cv_have_weak="guessing no"
23865fi
23866rm -f conftest*
23867
23868
23869else
23870 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23871/* end confdefs.h. */
23872
23873#include <stdio.h>
23874#pragma weak fputs
23875int main ()
23876{
23877 return (fputs == NULL);
23878}
23879_ACEOF
23880if ac_fn_c_try_run "$LINENO"; then :
23881 gl_cv_have_weak=yes
23882else
23883 gl_cv_have_weak=no
23884fi
23885rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23886 conftest.$ac_objext conftest.beam conftest.$ac_ext
23887fi
23888
23889 fi
23890 case " $LDFLAGS " in
23891 *" -static "*) gl_cv_have_weak=no ;;
23892 esac
23893 case "$gl_cv_have_weak" in
23894 *yes)
23895 case "$host_os" in
23896 freebsd* | dragonfly*)
23897 : > conftest1.c
23898 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
23899 cat <<EOF > conftest2.c
23900#include <pthread.h>
23901#pragma weak pthread_mutexattr_gettype
23902int main ()
23903{
23904 return (pthread_mutexattr_gettype != NULL);
23905}
23906EOF
23907 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
23908 || gl_cv_have_weak=no
23909 rm -f conftest1.c libempty.so conftest2.c conftest
23910 ;;
23911 esac
23912 ;;
23913 esac
23914
23915fi
23916{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
23917$as_echo "$gl_cv_have_weak" >&6; }
23918 case "$gl_cv_have_weak" in
23919 *yes)
23920
23921$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
23922
23923 ;;
23924 esac
23925
23926 case "$gl_cv_have_weak" in
23927 *yes) LIB_MBRTOWC= ;;
23928 *) LIB_MBRTOWC="$LIBPTHREAD" ;;
23929 esac
23930 ;;
23931 esac
23932 else
23933 LIB_MBRTOWC=
23934 fi
23935
23936
23937 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
23938
23939
23940
23941
23942
23943
23944
23945
23946 gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
23947
23948 if test $REPLACE_MBSTATE_T = 1; then
23949
23950
23951
23952
23953
23954
23955
23956
23957 gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext"
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967 gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext"
23968
23969
23970
23971
23972 CFLAG_VISIBILITY=
23973 HAVE_VISIBILITY=0
23974 if test -n "$GCC"; then
23975 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
23976$as_echo_n "checking whether the -Werror option is usable... " >&6; }
23977if ${gl_cv_cc_vis_werror+:} false; then :
23978 $as_echo_n "(cached) " >&6
23979else
23980 gl_save_CFLAGS="$CFLAGS"
23981 CFLAGS="$CFLAGS -Werror"
23982 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23983/* end confdefs.h. */
23984
23985int
23986main ()
23987{
23988
23989 ;
23990 return 0;
23991}
23992_ACEOF
23993if ac_fn_c_try_compile "$LINENO"; then :
23994 gl_cv_cc_vis_werror=yes
23995else
23996 gl_cv_cc_vis_werror=no
23997fi
23998rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23999 CFLAGS="$gl_save_CFLAGS"
24000
24001fi
24002{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
24003$as_echo "$gl_cv_cc_vis_werror" >&6; }
24004 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
24005$as_echo_n "checking for simple visibility declarations... " >&6; }
24006if ${gl_cv_cc_visibility+:} false; then :
24007 $as_echo_n "(cached) " >&6
24008else
24009 gl_save_CFLAGS="$CFLAGS"
24010 CFLAGS="$CFLAGS -fvisibility=hidden"
24011 if test $gl_cv_cc_vis_werror = yes; then
24012 CFLAGS="$CFLAGS -Werror"
24013 fi
24014 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24015/* end confdefs.h. */
24016extern __attribute__((__visibility__("hidden"))) int hiddenvar;
24017 extern __attribute__((__visibility__("default"))) int exportedvar;
24018 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
24019 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
24020 void dummyfunc (void) {}
24021
24022int
24023main ()
24024{
6ec2e0f5 24025
5df4cba6
SM
24026 ;
24027 return 0;
24028}
24029_ACEOF
24030if ac_fn_c_try_compile "$LINENO"; then :
24031 gl_cv_cc_visibility=yes
24032else
24033 gl_cv_cc_visibility=no
24034fi
24035rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24036 CFLAGS="$gl_save_CFLAGS"
6ec2e0f5 24037
5df4cba6
SM
24038fi
24039{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
24040$as_echo "$gl_cv_cc_visibility" >&6; }
24041 if test $gl_cv_cc_visibility = yes; then
24042 CFLAG_VISIBILITY="-fvisibility=hidden"
24043 HAVE_VISIBILITY=1
6ec2e0f5
SDJ
24044 fi
24045 fi
24046
6ec2e0f5
SDJ
24047
24048
5df4cba6
SM
24049cat >>confdefs.h <<_ACEOF
24050#define HAVE_VISIBILITY $HAVE_VISIBILITY
24051_ACEOF
6ec2e0f5
SDJ
24052
24053
6ec2e0f5 24054
5df4cba6 24055 fi
6ec2e0f5 24056
c0c3707f 24057
6ec2e0f5
SDJ
24058 :
24059
24060 fi
24061
24062
24063
24064
24065
24066 GNULIB_MBRTOWC=1
24067
24068
24069
24070
24071
24072$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
5df4cba6
SM
24087
24088 if case "$host_os" in
24089 mingw*) true ;;
24090 *) test $ac_cv_func_mbsinit = yes ;;
24091 esac \
24092 && test $ac_cv_func_mbrtowc = yes; then
6ec2e0f5
SDJ
24093
24094
24095
c0c3707f 24096
6ec2e0f5
SDJ
24097 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
24098$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 24099if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
6ec2e0f5
SDJ
24100 $as_echo_n "(cached) " >&6
24101else
24102
24103 case "$host_os" in
24104 # Guess no on AIX and OSF/1.
24105 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
24106 # Guess yes otherwise.
24107 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
24108 esac
24109 if test $LOCALE_JA != none; then
24110 if test "$cross_compiling" = yes; then :
24111 :
24112else
24113 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24114/* end confdefs.h. */
24115
24116#include <locale.h>
24117#include <string.h>
6ec2e0f5
SDJ
24118#include <wchar.h>
24119int main ()
24120{
24121 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
24122 {
24123 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
24124 mbstate_t state;
24125 wchar_t wc;
24126
24127 memset (&state, '\0', sizeof (mbstate_t));
24128 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24129 if (mbsinit (&state))
c0c3707f
CB
24130 return 2;
24131 }
24132 return 0;
24133}
24134_ACEOF
24135if ac_fn_c_try_run "$LINENO"; then :
24136 gl_cv_func_mbrtowc_incomplete_state=yes
24137else
24138 gl_cv_func_mbrtowc_incomplete_state=no
24139fi
24140rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24141 conftest.$ac_objext conftest.beam conftest.$ac_ext
24142fi
24143
24144 else
24145 if test $LOCALE_FR_UTF8 != none; then
24146 if test "$cross_compiling" = yes; then :
24147 :
24148else
24149 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24150/* end confdefs.h. */
24151
24152#include <locale.h>
24153#include <string.h>
c0c3707f
CB
24154#include <wchar.h>
24155int main ()
24156{
24157 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24158 {
24159 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
24160 mbstate_t state;
24161 wchar_t wc;
24162
24163 memset (&state, '\0', sizeof (mbstate_t));
24164 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24165 if (mbsinit (&state))
24166 return 2;
6ec2e0f5
SDJ
24167 }
24168 return 0;
24169}
24170_ACEOF
24171if ac_fn_c_try_run "$LINENO"; then :
24172 gl_cv_func_mbrtowc_incomplete_state=yes
24173else
24174 gl_cv_func_mbrtowc_incomplete_state=no
24175fi
24176rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24177 conftest.$ac_objext conftest.beam conftest.$ac_ext
24178fi
24179
c0c3707f 24180 fi
6ec2e0f5
SDJ
24181 fi
24182
24183fi
24184{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
24185$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
24186
24187
24188
24189
24190 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
24191$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 24192if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
6ec2e0f5
SDJ
24193 $as_echo_n "(cached) " >&6
24194else
24195
24196 case "$host_os" in
24197 # Guess no on Solaris 8.
24198 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
24199 # Guess yes otherwise.
24200 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
24201 esac
24202 if test $LOCALE_ZH_CN != none; then
24203 if test "$cross_compiling" = yes; then :
24204 :
24205else
24206 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24207/* end confdefs.h. */
24208
24209#include <locale.h>
24210#include <stdlib.h>
24211#include <string.h>
6ec2e0f5
SDJ
24212#include <wchar.h>
24213int main ()
24214{
24215 /* This fails on Solaris 8:
24216 mbrtowc returns 2, and sets wc to 0x00F0.
24217 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
24218 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24219 {
24220 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
24221 mbstate_t state;
24222 wchar_t wc;
24223
24224 memset (&state, '\0', sizeof (mbstate_t));
24225 if (mbrtowc (&wc, input + 3, 6, &state) != 4
24226 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 24227 return 2;
6ec2e0f5 24228 }
49e4877c
PA
24229 return 0;
24230}
24231_ACEOF
24232if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24233 gl_cv_func_mbrtowc_sanitycheck=yes
49e4877c 24234else
6ec2e0f5 24235 gl_cv_func_mbrtowc_sanitycheck=no
49e4877c
PA
24236fi
24237rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24238 conftest.$ac_objext conftest.beam conftest.$ac_ext
24239fi
24240
6ec2e0f5
SDJ
24241 fi
24242
49e4877c 24243fi
6ec2e0f5
SDJ
24244{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
24245$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
49e4877c 24246
6ec2e0f5
SDJ
24247 REPLACE_MBSTATE_T=0
24248 case "$gl_cv_func_mbrtowc_incomplete_state" in
24249 *yes) ;;
24250 *) REPLACE_MBSTATE_T=1 ;;
24251 esac
24252 case "$gl_cv_func_mbrtowc_sanitycheck" in
24253 *yes) ;;
24254 *) REPLACE_MBSTATE_T=1 ;;
24255 esac
24256 else
24257 REPLACE_MBSTATE_T=1
24258 fi
8690e634 24259
8690e634 24260
8690e634 24261
6ec2e0f5
SDJ
24262 if test $ac_cv_func_mbsinit = no; then
24263 HAVE_MBSINIT=0
24264 ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
9c9d63b1 24265 #include <wchar.h>
8690e634 24266
6ec2e0f5 24267"
d0ac1c44 24268if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
6ec2e0f5
SDJ
24269 ac_have_decl=1
24270else
24271 ac_have_decl=0
24272fi
4a626d0a 24273
6ec2e0f5
SDJ
24274cat >>confdefs.h <<_ACEOF
24275#define HAVE_DECL_MBSINIT $ac_have_decl
24276_ACEOF
49e4877c 24277
6ec2e0f5
SDJ
24278 if test $ac_cv_have_decl_mbsinit = yes; then
24279 REPLACE_MBSINIT=1
24280 fi
24281 else
24282 if test $REPLACE_MBSTATE_T = 1; then
24283 REPLACE_MBSINIT=1
24284 else
24285 case "$host_os" in
24286 mingw*) REPLACE_MBSINIT=1 ;;
8690e634 24287 esac
c971b7fa
PA
24288 fi
24289 fi
24290
6ec2e0f5 24291 if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
c971b7fa 24292
c971b7fa 24293
c971b7fa
PA
24294
24295
24296
24297
24298
24299
6ec2e0f5 24300 gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
8690e634
JK
24301
24302
24303 :
c971b7fa 24304
a512b375 24305 fi
c971b7fa 24306
8690e634
JK
24307
24308
24309
24310
6ec2e0f5 24311 GNULIB_MBSINIT=1
8690e634
JK
24312
24313
24314
24315
8690e634 24316
6ec2e0f5 24317$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
8690e634
JK
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
c971b7fa 24329
c971b7fa 24330
5df4cba6
SM
24331
24332 if case "$host_os" in
24333 mingw*) true ;;
24334 *) test $ac_cv_func_mbsinit = yes ;;
24335 esac \
24336 && test $ac_cv_func_mbrtowc = yes; then
c971b7fa 24337
8690e634
JK
24338
24339
c0c3707f 24340
8690e634
JK
24341 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
24342$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 24343if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
8690e634
JK
24344 $as_echo_n "(cached) " >&6
24345else
24346
24347 case "$host_os" in
24348 # Guess no on AIX and OSF/1.
24349 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
24350 # Guess yes otherwise.
24351 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
24352 esac
24353 if test $LOCALE_JA != none; then
24354 if test "$cross_compiling" = yes; then :
24355 :
c971b7fa
PA
24356else
24357 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24358/* end confdefs.h. */
24359
8690e634
JK
24360#include <locale.h>
24361#include <string.h>
8690e634
JK
24362#include <wchar.h>
24363int main ()
c971b7fa 24364{
8690e634 24365 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
c971b7fa 24366 {
8690e634
JK
24367 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
24368 mbstate_t state;
24369 wchar_t wc;
24370
24371 memset (&state, '\0', sizeof (mbstate_t));
24372 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24373 if (mbsinit (&state))
c0c3707f
CB
24374 return 2;
24375 }
24376 return 0;
24377}
24378_ACEOF
24379if ac_fn_c_try_run "$LINENO"; then :
24380 gl_cv_func_mbrtowc_incomplete_state=yes
24381else
24382 gl_cv_func_mbrtowc_incomplete_state=no
24383fi
24384rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24385 conftest.$ac_objext conftest.beam conftest.$ac_ext
24386fi
24387
24388 else
24389 if test $LOCALE_FR_UTF8 != none; then
24390 if test "$cross_compiling" = yes; then :
24391 :
24392else
24393 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24394/* end confdefs.h. */
24395
24396#include <locale.h>
24397#include <string.h>
c0c3707f
CB
24398#include <wchar.h>
24399int main ()
24400{
24401 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24402 {
24403 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
24404 mbstate_t state;
24405 wchar_t wc;
24406
24407 memset (&state, '\0', sizeof (mbstate_t));
24408 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
24409 if (mbsinit (&state))
24410 return 2;
c971b7fa 24411 }
c971b7fa
PA
24412 return 0;
24413}
24414_ACEOF
24415if ac_fn_c_try_run "$LINENO"; then :
8690e634 24416 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 24417else
8690e634 24418 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa
PA
24419fi
24420rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24421 conftest.$ac_objext conftest.beam conftest.$ac_ext
24422fi
24423
c0c3707f 24424 fi
8690e634 24425 fi
c971b7fa
PA
24426
24427fi
8690e634
JK
24428{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
24429$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa
PA
24430
24431
c971b7fa
PA
24432
24433
8690e634
JK
24434 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
24435$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 24436if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
24437 $as_echo_n "(cached) " >&6
24438else
8690e634
JK
24439
24440 case "$host_os" in
24441 # Guess no on Solaris 8.
24442 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
24443 # Guess yes otherwise.
24444 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
24445 esac
24446 if test $LOCALE_ZH_CN != none; then
24447 if test "$cross_compiling" = yes; then :
24448 :
24449else
c971b7fa
PA
24450 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24451/* end confdefs.h. */
8690e634
JK
24452
24453#include <locale.h>
24454#include <stdlib.h>
24455#include <string.h>
8690e634
JK
24456#include <wchar.h>
24457int main ()
c971b7fa 24458{
8690e634
JK
24459 /* This fails on Solaris 8:
24460 mbrtowc returns 2, and sets wc to 0x00F0.
24461 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
24462 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24463 {
24464 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
24465 mbstate_t state;
24466 wchar_t wc;
24467
24468 memset (&state, '\0', sizeof (mbstate_t));
24469 if (mbrtowc (&wc, input + 3, 6, &state) != 4
24470 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 24471 return 2;
8690e634 24472 }
c971b7fa
PA
24473 return 0;
24474}
24475_ACEOF
8690e634
JK
24476if ac_fn_c_try_run "$LINENO"; then :
24477 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 24478else
8690e634 24479 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 24480fi
8690e634
JK
24481rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24482 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24483fi
c971b7fa 24484
8690e634
JK
24485 fi
24486
24487fi
24488{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
24489$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
c971b7fa 24490
8690e634
JK
24491 REPLACE_MBSTATE_T=0
24492 case "$gl_cv_func_mbrtowc_incomplete_state" in
24493 *yes) ;;
24494 *) REPLACE_MBSTATE_T=1 ;;
24495 esac
24496 case "$gl_cv_func_mbrtowc_sanitycheck" in
24497 *yes) ;;
24498 *) REPLACE_MBSTATE_T=1 ;;
24499 esac
24500 else
24501 REPLACE_MBSTATE_T=1
c971b7fa
PA
24502 fi
24503
c971b7fa 24504
8690e634 24505
6ec2e0f5
SDJ
24506 if test $ac_cv_func_mbsrtowcs = no; then
24507 HAVE_MBSRTOWCS=0
24508 ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
9c9d63b1 24509 #include <wchar.h>
8690e634
JK
24510
24511"
d0ac1c44 24512if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then :
8690e634
JK
24513 ac_have_decl=1
24514else
24515 ac_have_decl=0
c971b7fa 24516fi
c971b7fa 24517
8690e634 24518cat >>confdefs.h <<_ACEOF
6ec2e0f5 24519#define HAVE_DECL_MBSRTOWCS $ac_have_decl
c971b7fa 24520_ACEOF
c971b7fa 24521
6ec2e0f5
SDJ
24522 if test $ac_cv_have_decl_mbsrtowcs = yes; then
24523 REPLACE_MBSRTOWCS=1
8690e634
JK
24524 fi
24525 else
24526 if test $REPLACE_MBSTATE_T = 1; then
6ec2e0f5 24527 REPLACE_MBSRTOWCS=1
8690e634 24528 else
6ec2e0f5
SDJ
24529
24530
24531
24532
24533
24534
24535 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
24536$as_echo_n "checking whether mbsrtowcs works... " >&6; }
d0ac1c44 24537if ${gl_cv_func_mbsrtowcs_works+:} false; then :
6ec2e0f5
SDJ
24538 $as_echo_n "(cached) " >&6
24539else
24540
24541 case "$host_os" in
24542 # Guess no on HP-UX, Solaris, mingw.
24543 hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
24544 # Guess yes otherwise.
24545 *) gl_cv_func_mbsrtowcs_works="guessing yes" ;;
24546 esac
24547 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
24548 if test "$cross_compiling" = yes; then :
24549 :
24550else
24551 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24552/* end confdefs.h. */
24553
24554#include <locale.h>
24555#include <string.h>
6ec2e0f5
SDJ
24556#include <wchar.h>
24557int main ()
24558{
24559 int result = 0;
24560 /* Test whether the function supports a NULL destination argument.
24561 This fails on native Windows. */
24562 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
24563 {
24564 const char input[] = "\337er";
24565 const char *src = input;
24566 mbstate_t state;
24567
24568 memset (&state, '\0', sizeof (mbstate_t));
24569 if (mbsrtowcs (NULL, &src, 1, &state) != 3
24570 || src != input)
24571 result |= 1;
24572 }
24573 /* Test whether the function works when started with a conversion state
24574 in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
24575 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
24576 {
24577 const char input[] = "B\303\274\303\237er";
24578 mbstate_t state;
24579
24580 memset (&state, '\0', sizeof (mbstate_t));
24581 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24582 if (!mbsinit (&state))
24583 {
24584 const char *src = input + 2;
24585 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24586 result |= 2;
24587 }
24588 }
24589 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
24590 {
24591 const char input[] = "<\306\374\313\334\270\354>";
24592 mbstate_t state;
24593
24594 memset (&state, '\0', sizeof (mbstate_t));
24595 if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
24596 if (!mbsinit (&state))
24597 {
24598 const char *src = input + 4;
24599 if (mbsrtowcs (NULL, &src, 10, &state) != 3)
24600 result |= 4;
24601 }
24602 }
24603 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
24604 {
24605 const char input[] = "B\250\271\201\060\211\070er";
24606 mbstate_t state;
24607
24608 memset (&state, '\0', sizeof (mbstate_t));
24609 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
24610 if (!mbsinit (&state))
24611 {
24612 const char *src = input + 2;
24613 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
24614 result |= 8;
24615 }
24616 }
24617 return result;
24618}
24619_ACEOF
24620if ac_fn_c_try_run "$LINENO"; then :
24621 gl_cv_func_mbsrtowcs_works=yes
24622else
24623 gl_cv_func_mbsrtowcs_works=no
24624fi
24625rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24626 conftest.$ac_objext conftest.beam conftest.$ac_ext
24627fi
24628
24629 fi
24630
24631fi
24632{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
24633$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
24634
24635 case "$gl_cv_func_mbsrtowcs_works" in
24636 *yes) ;;
24637 *) REPLACE_MBSRTOWCS=1 ;;
8690e634
JK
24638 esac
24639 fi
24640 fi
c971b7fa 24641
6ec2e0f5 24642 if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
c971b7fa
PA
24643
24644
24645
24646
24647
24648
24649
24650
698be2d8
CB
24651 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
24662
24663
24664 :
24665
24666 fi
24667
24668
24669
24670
24671
24672 GNULIB_MBSRTOWCS=1
24673
24674
24675
24676
24677
24678$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
24679
24680
24681
24682
24683
24684
24685 for ac_func in mbtowc
24686do :
24687 ac_fn_c_check_func "$LINENO" "mbtowc" "ac_cv_func_mbtowc"
24688if test "x$ac_cv_func_mbtowc" = xyes; then :
24689 cat >>confdefs.h <<_ACEOF
24690#define HAVE_MBTOWC 1
24691_ACEOF
24692
24693fi
24694done
24695
24696 if test $ac_cv_func_mbtowc = no; then
24697 HAVE_MBTOWC=0
24698 else
24699 if false; then
24700 REPLACE_MBTOWC=1
24701 fi
24702 fi
6ec2e0f5 24703
698be2d8 24704 if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
6ec2e0f5
SDJ
24705
24706
24707
24708
24709
24710
24711
24712
698be2d8 24713 gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext"
c971b7fa
PA
24714
24715
8690e634 24716 :
c971b7fa 24717
a512b375 24718 fi
c971b7fa 24719
c971b7fa 24720
c971b7fa 24721
c971b7fa
PA
24722
24723
698be2d8 24724 GNULIB_MBTOWC=1
c971b7fa 24725
c971b7fa
PA
24726
24727
24728
24729
698be2d8 24730$as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
c971b7fa
PA
24731
24732
c971b7fa 24733
c971b7fa 24734
9c9d63b1 24735 if test $REPLACE_MEMCHR = 1; then
c971b7fa
PA
24736
24737
24738
c971b7fa 24739
c971b7fa
PA
24740
24741
24742
24743
6ec2e0f5 24744 gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
8690e634 24745
c971b7fa 24746
6ec2e0f5
SDJ
24747 for ac_header in bp-sym.h
24748do :
24749 ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
d0ac1c44 24750if test "x$ac_cv_header_bp_sym_h" = xyes; then :
6ec2e0f5
SDJ
24751 cat >>confdefs.h <<_ACEOF
24752#define HAVE_BP_SYM_H 1
24753_ACEOF
c971b7fa 24754
6ec2e0f5 24755fi
c971b7fa 24756
6ec2e0f5
SDJ
24757done
24758
24759
24760 fi
24761
24762
24763
24764
24765
24766 GNULIB_MEMCHR=1
24767
24768
24769
24770
24771
24772$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
24773
24774
24775
24776
24777
24778 if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
24779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5
24780$as_echo_n "checking whether memmem works in linear time... " >&6; }
d0ac1c44 24781if ${gl_cv_func_memmem_works_fast+:} false; then :
8690e634
JK
24782 $as_echo_n "(cached) " >&6
24783else
6ec2e0f5
SDJ
24784 if test "$cross_compiling" = yes; then :
24785 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24786/* end confdefs.h. */
24787
24788#include <features.h>
24789#ifdef __GNU_LIBRARY__
24790 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
24791 && !defined __UCLIBC__
24792 Lucky user
24793 #endif
24794#endif
24795#ifdef __CYGWIN__
24796 #include <cygwin/version.h>
24797 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
24798 Lucky user
24799 #endif
24800#endif
24801
24802_ACEOF
24803if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24804 $EGREP "Lucky user" >/dev/null 2>&1; then :
24805 gl_cv_func_memmem_works_fast="guessing yes"
24806else
c0c3707f 24807 gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"
6ec2e0f5
SDJ
24808fi
24809rm -f conftest*
24810
c971b7fa 24811
8690e634
JK
24812else
24813 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 24814/* end confdefs.h. */
c971b7fa 24815
6ec2e0f5
SDJ
24816#include <signal.h> /* for signal */
24817#include <string.h> /* for memmem */
24818#include <stdlib.h> /* for malloc */
24819#include <unistd.h> /* for alarm */
24820static void quit (int sig) { _exit (sig + 128); }
24821
24822int
24823main ()
8690e634 24824{
8690e634 24825
6ec2e0f5
SDJ
24826 int result = 0;
24827 size_t m = 1000000;
24828 char *haystack = (char *) malloc (2 * m + 1);
24829 char *needle = (char *) malloc (m + 1);
24830 /* Failure to compile this test due to missing alarm is okay,
24831 since all such platforms (mingw) also lack memmem. */
24832 signal (SIGALRM, quit);
24833 alarm (5);
24834 /* Check for quadratic performance. */
24835 if (haystack && needle)
24836 {
24837 memset (haystack, 'A', 2 * m);
24838 haystack[2 * m] = 'B';
24839 memset (needle, 'A', m);
24840 needle[m] = 'B';
24841 if (!memmem (haystack, 2 * m + 1, needle, m + 1))
24842 result |= 1;
24843 }
c0c3707f
CB
24844 /* Free allocated memory, in case some sanitizer is watching. */
24845 free (haystack);
24846 free (needle);
6ec2e0f5
SDJ
24847 return result;
24848
24849 ;
c971b7fa
PA
24850 return 0;
24851}
24852_ACEOF
8690e634 24853if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24854 gl_cv_func_memmem_works_fast=yes
8690e634 24855else
6ec2e0f5 24856 gl_cv_func_memmem_works_fast=no
8690e634
JK
24857fi
24858rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24859 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24860fi
c971b7fa
PA
24861
24862
8690e634 24863fi
6ec2e0f5
SDJ
24864{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5
24865$as_echo "$gl_cv_func_memmem_works_fast" >&6; }
24866 case "$gl_cv_func_memmem_works_fast" in
24867 *yes) ;;
24868 *)
24869 REPLACE_MEMMEM=1
24870 ;;
24871 esac
24872 fi
c971b7fa 24873
6ec2e0f5 24874 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
8690e634
JK
24875
24876
24877
6ec2e0f5
SDJ
24878
24879
24880
24881
24882
24883 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
24884
24885 fi
24886
24887
24888
24889
24890 for ac_func in memmem
24891do :
24892 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
d0ac1c44 24893if test "x$ac_cv_func_memmem" = xyes; then :
6ec2e0f5
SDJ
24894 cat >>confdefs.h <<_ACEOF
24895#define HAVE_MEMMEM 1
24896_ACEOF
24897
24898fi
24899done
24900
24901 if test $ac_cv_func_memmem = yes; then
24902 HAVE_MEMMEM=1
24903 else
24904 HAVE_MEMMEM=0
24905 fi
24906
24907 if test $ac_cv_have_decl_memmem = no; then
24908 HAVE_DECL_MEMMEM=0
24909 else
24910 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
24911$as_echo_n "checking whether memmem works... " >&6; }
d0ac1c44 24912if ${gl_cv_func_memmem_works_always+:} false; then :
c971b7fa
PA
24913 $as_echo_n "(cached) " >&6
24914else
6ec2e0f5
SDJ
24915 if test "$cross_compiling" = yes; then :
24916 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24917/* end confdefs.h. */
24918
24919#ifdef __GNU_LIBRARY__
24920 #include <features.h>
24921 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
24922 || __GLIBC_MINOR__ > 12)) \
24923 || (__GLIBC__ > 2)) \
24924 || defined __UCLIBC__
24925 Lucky user
24926 #endif
24927#elif defined __CYGWIN__
24928 #include <cygwin/version.h>
24929 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
24930 Lucky user
24931 #endif
24932#else
24933 Lucky user
24934#endif
24935
24936_ACEOF
24937if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24938 $EGREP "Lucky user" >/dev/null 2>&1; then :
24939 gl_cv_func_memmem_works_always="guessing yes"
24940else
c0c3707f 24941 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
6ec2e0f5
SDJ
24942fi
24943rm -f conftest*
24944
8690e634 24945
8690e634 24946else
c971b7fa
PA
24947 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24948/* end confdefs.h. */
c971b7fa 24949
6ec2e0f5
SDJ
24950#include <string.h> /* for memmem */
24951#define P "_EF_BF_BD"
24952#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
24953#define NEEDLE P P P P P
24954
24955int
24956main ()
c971b7fa 24957{
8690e634 24958
6ec2e0f5
SDJ
24959 int result = 0;
24960 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
24961 result |= 1;
24962 /* Check for empty needle behavior. */
24963 {
24964 const char *haystack = "AAA";
698be2d8 24965 if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
6ec2e0f5 24966 result |= 2;
8690e634 24967 }
6ec2e0f5
SDJ
24968 return result;
24969
24970 ;
c971b7fa
PA
24971 return 0;
24972}
24973_ACEOF
8690e634 24974if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 24975 gl_cv_func_memmem_works_always=yes
c971b7fa 24976else
6ec2e0f5 24977 gl_cv_func_memmem_works_always=no
c971b7fa 24978fi
8690e634
JK
24979rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24980 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 24981fi
8690e634 24982
8690e634
JK
24983
24984fi
6ec2e0f5
SDJ
24985{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
24986$as_echo "$gl_cv_func_memmem_works_always" >&6; }
24987 case "$gl_cv_func_memmem_works_always" in
8690e634 24988 *yes) ;;
6ec2e0f5
SDJ
24989 *)
24990 REPLACE_MEMMEM=1
24991 ;;
8690e634 24992 esac
c971b7fa 24993 fi
6ec2e0f5 24994 :
c971b7fa 24995
6ec2e0f5 24996 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
c971b7fa 24997
c971b7fa 24998
8690e634 24999
c971b7fa 25000
6ec2e0f5
SDJ
25001
25002
25003
25004
25005 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
25006
25007 fi
25008
25009
25010
25011
25012
25013 GNULIB_MEMMEM=1
25014
25015
25016
25017
25018
25019$as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029 for ac_func in mempcpy
25030do :
25031 ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
d0ac1c44 25032if test "x$ac_cv_func_mempcpy" = xyes; then :
6ec2e0f5
SDJ
25033 cat >>confdefs.h <<_ACEOF
25034#define HAVE_MEMPCPY 1
8690e634 25035_ACEOF
c971b7fa 25036
6ec2e0f5
SDJ
25037fi
25038done
c971b7fa 25039
6ec2e0f5
SDJ
25040 if test $ac_cv_func_mempcpy = no; then
25041 HAVE_MEMPCPY=0
25042 fi
8690e634 25043
6ec2e0f5 25044 if test $HAVE_MEMPCPY = 0; then
8690e634
JK
25045
25046
25047
25048
8690e634 25049
6ec2e0f5
SDJ
25050
25051
25052
25053 gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
25054
25055
8690e634 25056 :
c971b7fa 25057
6ec2e0f5 25058 fi
c971b7fa 25059
8690e634 25060
8690e634 25061
8690e634 25062
6ec2e0f5
SDJ
25063
25064 GNULIB_MEMPCPY=1
25065
25066
25067
25068
25069
25070$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
25071
25072
25073
25074
25075
25076
25077
25078
25079 if test $ac_cv_have_decl_memrchr = no; then
25080 HAVE_DECL_MEMRCHR=0
25081 fi
25082
25083 for ac_func in memrchr
25084do :
25085 ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
d0ac1c44 25086if test "x$ac_cv_func_memrchr" = xyes; then :
6ec2e0f5
SDJ
25087 cat >>confdefs.h <<_ACEOF
25088#define HAVE_MEMRCHR 1
c971b7fa 25089_ACEOF
6ec2e0f5 25090
c971b7fa 25091fi
6ec2e0f5 25092done
8690e634 25093
8690e634 25094
6ec2e0f5 25095 if test $ac_cv_func_memrchr = no; then
8690e634 25096
6ec2e0f5
SDJ
25097
25098
25099
25100
25101
25102
25103
25104 gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
25105
25106 :
c971b7fa
PA
25107 fi
25108
25109
c971b7fa 25110
c971b7fa 25111
c971b7fa 25112
6ec2e0f5
SDJ
25113 GNULIB_MEMRCHR=1
25114
25115
25116
25117
25118
25119$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
25120
25121
25122
25123
2d8adcbd 25124
698be2d8
CB
25125
25126
25127
8a99096f
SM
25128 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
25129$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
25130if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then :
25131 $as_echo_n "(cached) " >&6
25132else
25133 rm -rf conftest.dir
9c9d63b1 25134 if test "$cross_compiling" = yes; then :
8a99096f 25135 case "$host_os" in
9c9d63b1
PM
25136 # Guess yes on Linux systems.
25137 linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
25138 # Guess yes on glibc systems.
25139 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
25140 # Guess yes on MSVC, no on mingw.
25141 mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c0c3707f
CB
25142/* end confdefs.h. */
25143
25144#ifdef _MSC_VER
25145 Known
25146#endif
25147
25148_ACEOF
25149if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25150 $EGREP "Known" >/dev/null 2>&1; then :
25151 gl_cv_func_mkdir_trailing_slash_works="guessing yes"
25152else
25153 gl_cv_func_mkdir_trailing_slash_works="guessing no"
25154fi
25155rm -f conftest*
25156
9c9d63b1
PM
25157 ;;
25158 # If we don't know, obey --enable-cross-guesses.
25159 *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
25160 esac
8a99096f
SM
25161
25162else
25163 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25164/* end confdefs.h. */
25165
9c9d63b1
PM
25166 #include <sys/types.h>
25167 #include <sys/stat.h>
25168
25169
25170$gl_mda_defines
8a99096f
SM
25171
25172int
25173main ()
25174{
25175return mkdir ("conftest.dir/", 0700);
25176 ;
25177 return 0;
25178}
25179_ACEOF
25180if ac_fn_c_try_run "$LINENO"; then :
25181 gl_cv_func_mkdir_trailing_slash_works=yes
25182else
25183 gl_cv_func_mkdir_trailing_slash_works=no
25184fi
25185rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25186 conftest.$ac_objext conftest.beam conftest.$ac_ext
25187fi
25188
9c9d63b1 25189 rm -rf conftest.dir
8a99096f
SM
25190
25191fi
25192{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
25193$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
25194 case "$gl_cv_func_mkdir_trailing_slash_works" in
25195 *yes) ;;
25196 *)
25197 REPLACE_MKDIR=1
25198 ;;
25199 esac
25200
25201 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
25202$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
25203if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then :
25204 $as_echo_n "(cached) " >&6
25205else
25206 rm -rf conftest.dir
9c9d63b1 25207 if test "$cross_compiling" = yes; then :
8a99096f 25208 case "$host_os" in
9c9d63b1
PM
25209 # Guess yes on glibc systems.
25210 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
25211 # Guess yes on musl systems.
25212 *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
25213 # Guess no on native Windows.
25214 mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
25215 # If we don't know, obey --enable-cross-guesses.
25216 *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
25217 esac
8a99096f
SM
25218
25219else
25220 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25221/* end confdefs.h. */
25222
9c9d63b1
PM
25223 #include <sys/types.h>
25224 #include <sys/stat.h>
25225
25226
25227$gl_mda_defines
8a99096f
SM
25228
25229int
25230main ()
25231{
25232return !mkdir ("conftest.dir/./", 0700);
25233 ;
25234 return 0;
25235}
25236_ACEOF
25237if ac_fn_c_try_run "$LINENO"; then :
25238 gl_cv_func_mkdir_trailing_dot_works=yes
25239else
25240 gl_cv_func_mkdir_trailing_dot_works=no
25241fi
25242rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25243 conftest.$ac_objext conftest.beam conftest.$ac_ext
25244fi
25245
9c9d63b1 25246 rm -rf conftest.dir
8a99096f
SM
25247
25248
25249fi
25250{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
25251$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
25252 case "$gl_cv_func_mkdir_trailing_dot_works" in
25253 *yes) ;;
25254 *)
25255 REPLACE_MKDIR=1
25256
25257$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
25258
25259 ;;
25260 esac
25261
25262 if test $REPLACE_MKDIR = 1; then
25263
25264
25265
25266
25267
25268
25269
25270
25271 gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
25272
25273 fi
25274
25275
9c9d63b1
PM
25276
25277
25278
25279 GNULIB_MKDIR=1
25280
25281
25282
25283
25284
25285$as_echo "#define GNULIB_TEST_MKDIR 1" >>confdefs.h
25286
25287
25288
25289
25290
e8d8cce6
SM
25291 for ac_func in mkdtemp
25292do :
25293 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
25294if test "x$ac_cv_func_mkdtemp" = xyes; then :
25295 cat >>confdefs.h <<_ACEOF
25296#define HAVE_MKDTEMP 1
25297_ACEOF
25298
25299fi
25300done
25301
25302 if test $ac_cv_func_mkdtemp = no; then
25303 HAVE_MKDTEMP=0
25304 fi
25305
25306 if test $HAVE_MKDTEMP = 0; then
25307
25308
25309
25310
25311
25312
25313
25314
25315 gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext"
25316
25317 :
25318
25319 fi
25320
25321
25322
25323
25324
25325 GNULIB_MKDTEMP=1
25326
25327
25328
25329
25330
25331$as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
25332
25333
25334
25335
25336
2d8adcbd
MM
25337
25338
b3279b60
TT
25339
25340
b3279b60
TT
25341 if test $ac_cv_func_mkostemp != yes; then
25342 HAVE_MKOSTEMP=0
25343 fi
2d8adcbd 25344
b3279b60 25345 if test $HAVE_MKOSTEMP = 0; then
2d8adcbd 25346
2d8adcbd 25347
2d8adcbd 25348
2d8adcbd 25349
2d8adcbd
MM
25350
25351
25352
25353
b3279b60 25354 gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
2d8adcbd
MM
25355
25356
25357
b3279b60 25358 fi
2d8adcbd 25359
2d8adcbd 25360
b3279b60
TT
25361cat >>confdefs.h <<_ACEOF
25362#define GNULIB_MKOSTEMP 1
25363_ACEOF
2d8adcbd
MM
25364
25365
2d8adcbd
MM
25366
25367
25368
25369
25370
b3279b60 25371 GNULIB_MKOSTEMP=1
2d8adcbd
MM
25372
25373
25374
25375
25376
b3279b60 25377$as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h
2d8adcbd
MM
25378
25379
25380
25381
6ec2e0f5
SDJ
25382 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
25383
25384
25385
c971b7fa 25386
c971b7fa 25387
c971b7fa
PA
25388
25389
8690e634 25390
6ec2e0f5 25391 gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
8690e634 25392
6ec2e0f5 25393 fi
8690e634 25394
6ec2e0f5 25395 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
8690e634
JK
25396
25397
25398
25399
25400
25401
8690e634
JK
25402
25403
6ec2e0f5 25404 gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
8690e634 25405
a512b375 25406 fi
8690e634
JK
25407
25408
c0c3707f
CB
25409cat >>confdefs.h <<_ACEOF
25410#define GNULIB_MSVC_NOTHROW 1
25411_ACEOF
25412
25413
25414
25415
725e2999
JB
25416 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
25417$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
25418if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
25419 $as_echo_n "(cached) " >&6
25420else
25421
25422 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25423/* end confdefs.h. */
25424#include <netinet/in.h>
25425int
25426main ()
25427{
25428
25429 ;
25430 return 0;
25431}
25432_ACEOF
25433if ac_fn_c_try_compile "$LINENO"; then :
25434 gl_cv_header_netinet_in_h_selfcontained=yes
25435else
25436 gl_cv_header_netinet_in_h_selfcontained=no
25437fi
25438rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25439
25440fi
25441{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
25442$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
25443 if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
25444 NETINET_IN_H=''
25445 else
25446 NETINET_IN_H='netinet/in.h'
25447 for ac_header in netinet/in.h
25448do :
25449 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
25450if test "x$ac_cv_header_netinet_in_h" = xyes; then :
25451 cat >>confdefs.h <<_ACEOF
25452#define HAVE_NETINET_IN_H 1
25453_ACEOF
25454
25455fi
25456
25457done
25458
25459
25460
25461
25462
25463
25464
725e2999
JB
25465
25466
25467
25468 if test $gl_cv_have_include_next = yes; then
25469 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
25470 else
25471 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
25472$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
25473if ${gl_cv_next_netinet_in_h+:} false; then :
25474 $as_echo_n "(cached) " >&6
25475else
25476
25477 if test $ac_cv_header_netinet_in_h = yes; then
25478
25479
25480
25481
25482 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25483/* end confdefs.h. */
25484#include <netinet/in.h>
25485_ACEOF
25486 case "$host_os" in
25487 aix*) gl_absname_cpp="$ac_cpp -C" ;;
25488 *) gl_absname_cpp="$ac_cpp" ;;
25489 esac
25490
25491 case "$host_os" in
25492 mingw*)
25493 gl_dirsep_regex='[/\\]'
25494 ;;
25495 *)
25496 gl_dirsep_regex='\/'
25497 ;;
25498 esac
25499 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
25500 gl_header_literal_regex=`echo 'netinet/in.h' \
25501 | sed -e "$gl_make_literal_regex_sed"`
25502 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
25503 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
25504 s|^/[^/]|//&|
25505 p
25506 q
25507 }'
25508
25509 gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
25510 sed -n "$gl_absolute_header_sed"`
25511
25512 gl_header=$gl_cv_absolute_netinet_in_h
25513 gl_cv_next_netinet_in_h='"'$gl_header'"'
25514 else
25515 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
25516 fi
25517
25518
25519fi
25520{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
25521$as_echo "$gl_cv_next_netinet_in_h" >&6; }
25522 fi
25523 NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
25524
25525 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
25526 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
25527 gl_next_as_first_directive='<'netinet/in.h'>'
25528 else
25529 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
25530 gl_next_as_first_directive=$gl_cv_next_netinet_in_h
25531 fi
25532 NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
25533
25534
25535
25536
25537 if test $ac_cv_header_netinet_in_h = yes; then
25538 HAVE_NETINET_IN_H=1
25539 else
25540 HAVE_NETINET_IN_H=0
25541 fi
25542
25543 fi
25544
25545 if test -n "$NETINET_IN_H"; then
25546 GL_GENERATE_NETINET_IN_H_TRUE=
25547 GL_GENERATE_NETINET_IN_H_FALSE='#'
25548else
25549 GL_GENERATE_NETINET_IN_H_TRUE='#'
25550 GL_GENERATE_NETINET_IN_H_FALSE=
25551fi
25552
25553
25554
25555
8690e634 25556
c0c3707f 25557
6ec2e0f5
SDJ
25558 case "$host_os" in
25559 mingw* | pw*)
25560 REPLACE_OPEN=1
25561 ;;
25562 *)
25563
c0c3707f
CB
25564 if test "$gl_cv_macro_O_CLOEXEC" != yes; then
25565 REPLACE_OPEN=1
25566 fi
472fa5ee
SM
25567
25568
c0c3707f 25569 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
6ec2e0f5 25570$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
d0ac1c44 25571if ${gl_cv_func_open_slash+:} false; then :
6ec2e0f5
SDJ
25572 $as_echo_n "(cached) " >&6
25573else
25574 # Assume that if we have lstat, we can also check symlinks.
c0c3707f
CB
25575 if test $ac_cv_func_lstat = yes; then
25576 touch conftest.tmp
25577 ln -s conftest.tmp conftest.lnk
25578 fi
25579 if test "$cross_compiling" = yes; then :
8690e634 25580
c0c3707f
CB
25581 case "$host_os" in
25582 freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
25583 gl_cv_func_open_slash="guessing no" ;;
25584 *)
25585 gl_cv_func_open_slash="guessing yes" ;;
25586 esac
8690e634 25587
6ec2e0f5
SDJ
25588else
25589 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25590/* end confdefs.h. */
25591
25592#include <fcntl.h>
25593#if HAVE_UNISTD_H
25594# include <unistd.h>
25595#endif
9c9d63b1
PM
25596
25597
25598$gl_mda_defines
25599
6ec2e0f5
SDJ
25600int main ()
25601{
25602 int result = 0;
25603#if HAVE_LSTAT
25604 if (open ("conftest.lnk/", O_RDONLY) != -1)
25605 result |= 1;
25606#endif
25607 if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
25608 result |= 2;
25609 return result;
25610}
25611_ACEOF
25612if ac_fn_c_try_run "$LINENO"; then :
25613 gl_cv_func_open_slash=yes
25614else
25615 gl_cv_func_open_slash=no
25616fi
25617rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25618 conftest.$ac_objext conftest.beam conftest.$ac_ext
25619fi
8690e634 25620
c0c3707f 25621 rm -f conftest.sl conftest.tmp conftest.lnk
8690e634 25622
6ec2e0f5
SDJ
25623fi
25624{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
25625$as_echo "$gl_cv_func_open_slash" >&6; }
c0c3707f
CB
25626 case "$gl_cv_func_open_slash" in
25627 *no)
8690e634 25628
6ec2e0f5 25629$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
8690e634 25630
6ec2e0f5
SDJ
25631 ;;
25632 esac
8690e634 25633
c0c3707f
CB
25634 case "$gl_cv_func_open_slash" in
25635 *no)
25636 REPLACE_OPEN=1
25637 ;;
25638 esac
25639 ;;
25640 esac
472fa5ee 25641
c0c3707f 25642 if test $REPLACE_OPEN = 0; then
472fa5ee
SM
25643
25644
25645
6ec2e0f5
SDJ
25646 if test $ac_cv_func_fchdir = no; then
25647 HAVE_FCHDIR=0
25648 fi
c971b7fa 25649
6ec2e0f5
SDJ
25650 if test $HAVE_FCHDIR = 0; then
25651 REPLACE_OPEN=1
25652 fi
25653 fi
c971b7fa
PA
25654
25655
25656
6ec2e0f5 25657 if test $REPLACE_OPEN = 1; then
c971b7fa
PA
25658
25659
25660
25661
25662
c971b7fa
PA
25663
25664
c971b7fa 25665
6ec2e0f5 25666 gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
c971b7fa 25667
c971b7fa
PA
25668
25669
6ec2e0f5
SDJ
25670 :
25671
a512b375 25672 fi
c971b7fa
PA
25673
25674
25675
25676
25677
6ec2e0f5 25678 GNULIB_OPEN=1
c971b7fa
PA
25679
25680
25681
25682
25683
6ec2e0f5 25684$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
c971b7fa
PA
25685
25686
25687
25688
25689
c971b7fa 25690
c971b7fa 25691
472fa5ee 25692
63ce7108 25693
c0c3707f
CB
25694 case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
25695 yes+*yes+yes)
6ec2e0f5
SDJ
25696 ;;
25697 yes+*)
c0c3707f 25698 # Solaris 10 lacks O_CLOEXEC.
6ec2e0f5
SDJ
25699 # Solaris 9 has *at functions, but uniformly mishandles trailing
25700 # slash in all of them.
25701 REPLACE_OPENAT=1
25702 ;;
25703 *)
25704 HAVE_OPENAT=0
25705 ;;
25706 esac
63ce7108 25707
6ec2e0f5 25708 if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
63ce7108 25709
63ce7108 25710
63ce7108 25711
63ce7108 25712
63ce7108
TT
25713
25714
63ce7108 25715
63ce7108 25716
6ec2e0f5 25717 gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
63ce7108
TT
25718
25719
25720
6ec2e0f5 25721 :
63ce7108 25722
6ec2e0f5 25723 fi
63ce7108
TT
25724
25725
6ec2e0f5
SDJ
25726cat >>confdefs.h <<_ACEOF
25727#define GNULIB_OPENAT 1
25728_ACEOF
63ce7108 25729
63ce7108 25730
63ce7108
TT
25731
25732
25733
25734
6ec2e0f5 25735 GNULIB_OPENAT=1
63ce7108 25736
63ce7108 25737
63ce7108 25738
63ce7108 25739
63ce7108 25740
6ec2e0f5 25741$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
63ce7108
TT
25742
25743
63ce7108 25744
63ce7108 25745
63ce7108 25746
63ce7108 25747
6ec2e0f5
SDJ
25748 for ac_func in opendir
25749do :
25750 ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
d0ac1c44 25751if test "x$ac_cv_func_opendir" = xyes; then :
6ec2e0f5
SDJ
25752 cat >>confdefs.h <<_ACEOF
25753#define HAVE_OPENDIR 1
63ce7108 25754_ACEOF
6ec2e0f5 25755
63ce7108 25756fi
6ec2e0f5 25757done
63ce7108 25758
6ec2e0f5
SDJ
25759 if test $ac_cv_func_opendir = no; then
25760 HAVE_OPENDIR=0
25761 fi
63ce7108 25762
6ec2e0f5
SDJ
25763
25764
25765
25766 if test $ac_cv_func_fchdir = no; then
25767 HAVE_FCHDIR=0
63ce7108 25768 fi
63ce7108 25769
6ec2e0f5
SDJ
25770 if test $HAVE_FCHDIR = 0; then
25771 if test $HAVE_OPENDIR = 1; then
25772 REPLACE_OPENDIR=1
25773 fi
25774 fi
25775
25776 case $host_os,$HAVE_OPENDIR in
25777 os2*,1)
25778 REPLACE_OPENDIR=1;;
25779 esac
25780
25781 if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
63ce7108
TT
25782
25783
25784
25785
25786
25787
25788
25789
6ec2e0f5 25790 gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
63ce7108
TT
25791
25792 fi
25793
25794
25795
25796
25797
6ec2e0f5 25798 GNULIB_OPENDIR=1
63ce7108
TT
25799
25800
25801
25802
63ce7108 25803
6ec2e0f5 25804$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
63ce7108
TT
25805
25806
25807
25808
25809
25810
25811
2196f55f
YQ
25812
25813
8424cc97 25814
9c9d63b1
PM
25815 if test $ac_cv_func_pipe != yes; then
25816 HAVE_PIPE=0
25817 fi
25818
25819 if test $HAVE_PIPE = 0; then
25820
25821
25822
25823
25824
25825
25826
25827
25828 gl_LIBOBJS="$gl_LIBOBJS pipe.$ac_objext"
25829
25830 fi
25831
25832
25833
25834
25835
25836 GNULIB_PIPE=1
25837
25838
25839
25840
25841
25842$as_echo "#define GNULIB_TEST_PIPE 1" >>confdefs.h
25843
25844
25845
25846
25847
25848
25849
8424cc97
SM
25850 for ac_func in rawmemchr
25851do :
25852 ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
d0ac1c44 25853if test "x$ac_cv_func_rawmemchr" = xyes; then :
8424cc97
SM
25854 cat >>confdefs.h <<_ACEOF
25855#define HAVE_RAWMEMCHR 1
25856_ACEOF
25857
25858fi
25859done
25860
25861 if test $ac_cv_func_rawmemchr = no; then
25862 HAVE_RAWMEMCHR=0
25863 fi
25864
25865 if test $HAVE_RAWMEMCHR = 0; then
25866
25867
25868
25869
25870
25871
25872
25873
25874 gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
25875
25876 :
25877 fi
25878
25879
25880
25881
25882
25883 GNULIB_RAWMEMCHR=1
25884
25885
25886
25887
25888
25889$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
25890
25891
25892
25893
25894
25895
6ec2e0f5
SDJ
25896 for ac_func in readdir
25897do :
25898 ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
d0ac1c44 25899if test "x$ac_cv_func_readdir" = xyes; then :
6ec2e0f5
SDJ
25900 cat >>confdefs.h <<_ACEOF
25901#define HAVE_READDIR 1
25902_ACEOF
25903
25904fi
25905done
25906
25907 if test $ac_cv_func_readdir = no; then
25908 HAVE_READDIR=0
25909 fi
25910
25911 if test $HAVE_READDIR = 0; then
25912
25913
25914
25915
25916
25917
25918
25919
25920 gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
25921
25922 fi
25923
25924
25925
25926
25927
25928 GNULIB_READDIR=1
25929
25930
25931
25932
25933
25934$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
25935
25936
25937
25938
25939
25940
2196f55f
YQ
25941 if test $ac_cv_func_readlink = no; then
25942 HAVE_READLINK=0
25943 else
25944 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
25945$as_echo_n "checking whether readlink signature is correct... " >&6; }
d0ac1c44 25946if ${gl_cv_decl_readlink_works+:} false; then :
2196f55f
YQ
25947 $as_echo_n "(cached) " >&6
25948else
25949 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25950/* end confdefs.h. */
25951#include <unistd.h>
25952 /* Cause compilation failure if original declaration has wrong type. */
25953 ssize_t readlink (const char *, char *, size_t);
25954int
25955main ()
25956{
25957
25958 ;
25959 return 0;
25960}
25961_ACEOF
25962if ac_fn_c_try_compile "$LINENO"; then :
25963 gl_cv_decl_readlink_works=yes
25964else
25965 gl_cv_decl_readlink_works=no
25966fi
25967rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25968fi
25969{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
25970$as_echo "$gl_cv_decl_readlink_works" >&6; }
25971 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
25972$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
9c9d63b1 25973if ${gl_cv_func_readlink_trailing_slash+:} false; then :
2196f55f
YQ
25974 $as_echo_n "(cached) " >&6
25975else
25976 # We have readlink, so assume ln -s works.
25977 ln -s conftest.no-such conftest.link
25978 ln -s conftest.link conftest.lnk2
25979 if test "$cross_compiling" = yes; then :
25980 case "$host_os" in
9c9d63b1
PM
25981 # Guess yes on Linux or glibc systems.
25982 linux-* | linux | *-gnu* | gnu*)
25983 gl_cv_func_readlink_trailing_slash="guessing yes" ;;
25984 # Guess no on AIX or HP-UX.
25985 aix* | hpux*)
25986 gl_cv_func_readlink_trailing_slash="guessing no" ;;
25987 # If we don't know, obey --enable-cross-guesses.
25988 *)
25989 gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;;
2196f55f
YQ
25990 esac
25991
25992else
25993 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25994/* end confdefs.h. */
25995#include <unistd.h>
25996
25997int
25998main ()
25999{
26000char buf[20];
26001 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
26002 ;
26003 return 0;
26004}
26005_ACEOF
26006if ac_fn_c_try_run "$LINENO"; then :
9c9d63b1 26007 gl_cv_func_readlink_trailing_slash=yes
2196f55f 26008else
9c9d63b1 26009 gl_cv_func_readlink_trailing_slash=no
2196f55f
YQ
26010fi
26011rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26012 conftest.$ac_objext conftest.beam conftest.$ac_ext
26013fi
26014
26015 rm -f conftest.link conftest.lnk2
26016fi
9c9d63b1
PM
26017{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_trailing_slash" >&5
26018$as_echo "$gl_cv_func_readlink_trailing_slash" >&6; }
26019 case "$gl_cv_func_readlink_trailing_slash" in
2196f55f
YQ
26020 *yes)
26021 if test "$gl_cv_decl_readlink_works" != yes; then
26022 REPLACE_READLINK=1
26023 fi
26024 ;;
26025 *)
26026
26027$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
26028
26029 REPLACE_READLINK=1
26030 ;;
26031 esac
9c9d63b1
PM
26032
26033 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink truncates results correctly" >&5
26034$as_echo_n "checking whether readlink truncates results correctly... " >&6; }
26035if ${gl_cv_func_readlink_truncate+:} false; then :
26036 $as_echo_n "(cached) " >&6
26037else
26038 # We have readlink, so assume ln -s works.
26039 ln -s ab conftest.link
26040 if test "$cross_compiling" = yes; then :
26041 case "$host_os" in
26042 # Guess yes on Linux or glibc systems.
26043 linux-* | linux | *-gnu* | gnu*)
26044 gl_cv_func_readlink_truncate="guessing yes" ;;
26045 # Guess no on AIX or HP-UX.
26046 aix* | hpux*)
26047 gl_cv_func_readlink_truncate="guessing no" ;;
26048 # If we don't know, obey --enable-cross-guesses.
26049 *)
26050 gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;;
26051 esac
26052
26053else
26054 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26055/* end confdefs.h. */
26056#include <unistd.h>
26057
26058int
26059main ()
26060{
26061char c;
26062 return readlink ("conftest.link", &c, 1) != 1;
26063 ;
26064 return 0;
26065}
26066_ACEOF
26067if ac_fn_c_try_run "$LINENO"; then :
26068 gl_cv_func_readlink_truncate=yes
26069else
26070 gl_cv_func_readlink_truncate=no
26071fi
26072rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26073 conftest.$ac_objext conftest.beam conftest.$ac_ext
26074fi
26075
26076 rm -f conftest.link conftest.lnk2
26077fi
26078{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_truncate" >&5
26079$as_echo "$gl_cv_func_readlink_truncate" >&6; }
26080 case $gl_cv_func_readlink_truncate in
26081 *yes)
26082 if test "$gl_cv_decl_readlink_works" != yes; then
26083 REPLACE_READLINK=1
26084 fi
26085 ;;
26086 *)
26087
26088$as_echo "#define READLINK_TRUNCATE_BUG 1" >>confdefs.h
26089
26090 REPLACE_READLINK=1
26091 ;;
26092 esac
2196f55f
YQ
26093 fi
26094
26095 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
26096
26097
26098
26099
26100
26101
26102
26103
26104 gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
26105
26106
26107 :
26108
26109 fi
26110
26111
26112
26113
26114
26115 GNULIB_READLINK=1
26116
26117
26118
26119
26120
26121$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
26122
26123
26124
26125
6a29c58e
YQ
26126
26127
6ec2e0f5
SDJ
26128 if test $gl_cv_func_malloc_posix = yes; then
26129
26130$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
26131
26132 else
26133 REPLACE_REALLOC=1
26134 fi
26135
26136 if test $REPLACE_REALLOC = 1; then
26137
26138
26139
26140
26141
26142
26143
26144
26145 gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
26146
26147 fi
26148
26149
26150
26151
26152
26153 GNULIB_REALLOC_POSIX=1
26154
26155
26156
26157
26158
26159$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
26160
26161
26162
26163
26164
26165
6a29c58e
YQ
26166
26167
26168 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
26169$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
d0ac1c44 26170if ${gl_cv_func_rename_slash_dst_works+:} false; then :
6a29c58e
YQ
26171 $as_echo_n "(cached) " >&6
26172else
26173 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
26174 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 26175 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26176 # Assume that if we have lstat, we can also check symlinks.
26177 if test $ac_cv_func_lstat = yes; then
26178 ln -s conftest.f conftest.lnk
26179 fi
26180 if test "$cross_compiling" = yes; then :
26181 case "$host_os" in
c0c3707f
CB
26182 # Guess yes on Linux systems.
26183 linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
26184 # Guess yes on glibc systems.
26185 *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
26186 # Guess no on native Windows.
26187 mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
26188 # If we don't know, obey --enable-cross-guesses.
26189 *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26190 esac
26191
26192else
26193 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26194/* end confdefs.h. */
26195
26196# include <stdio.h>
26197# include <stdlib.h>
26198
26199int
26200main ()
26201{
26202int result = 0;
26203 if (rename ("conftest.f1", "conftest.f2/") == 0)
26204 result |= 1;
26205 if (rename ("conftest.d1", "conftest.d2/") != 0)
26206 result |= 2;
26207#if HAVE_LSTAT
26208 if (rename ("conftest.f", "conftest.lnk/") == 0)
26209 result |= 4;
26210#endif
26211 return result;
26212
26213 ;
26214 return 0;
26215}
26216_ACEOF
26217if ac_fn_c_try_run "$LINENO"; then :
26218 gl_cv_func_rename_slash_dst_works=yes
26219else
26220 gl_cv_func_rename_slash_dst_works=no
26221fi
26222rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26223 conftest.$ac_objext conftest.beam conftest.$ac_ext
26224fi
26225
26226 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
26227
26228fi
26229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
26230$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
26231 case "$gl_cv_func_rename_slash_dst_works" in
26232 *yes) ;;
26233 *)
26234 REPLACE_RENAME=1
26235
26236$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
26237
26238 ;;
26239 esac
26240
26241 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
26242$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
d0ac1c44 26243if ${gl_cv_func_rename_slash_src_works+:} false; then :
6a29c58e
YQ
26244 $as_echo_n "(cached) " >&6
26245else
26246 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
26247 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 26248 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26249 # Assume that if we have lstat, we can also check symlinks.
26250 if test $ac_cv_func_lstat = yes; then
26251 ln -s conftest.f conftest.lnk
26252 fi
26253 if test "$cross_compiling" = yes; then :
26254 case "$host_os" in
c0c3707f
CB
26255 # Guess yes on Linux systems.
26256 linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26257 # Guess yes on glibc systems.
26258 *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26259 # Guess yes on native Windows.
26260 mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
26261 # If we don't know, obey --enable-cross-guesses.
26262 *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26263 esac
26264
26265else
26266 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26267/* end confdefs.h. */
26268
26269# include <stdio.h>
26270# include <stdlib.h>
26271
26272int
26273main ()
26274{
26275int result = 0;
26276 if (rename ("conftest.f1/", "conftest.d3") == 0)
26277 result |= 1;
26278 if (rename ("conftest.d1/", "conftest.d2") != 0)
26279 result |= 2;
26280#if HAVE_LSTAT
26281 if (rename ("conftest.lnk/", "conftest.f") == 0)
26282 result |= 4;
26283#endif
26284 return result;
26285
26286 ;
26287 return 0;
26288}
26289_ACEOF
26290if ac_fn_c_try_run "$LINENO"; then :
26291 gl_cv_func_rename_slash_src_works=yes
26292else
26293 gl_cv_func_rename_slash_src_works=no
26294fi
26295rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26296 conftest.$ac_objext conftest.beam conftest.$ac_ext
26297fi
26298
26299 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
26300
26301fi
26302{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
26303$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
26304 case "$gl_cv_func_rename_slash_src_works" in
26305 *yes) ;;
26306 *)
26307 REPLACE_RENAME=1
26308
26309$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
26310
26311 ;;
26312 esac
26313
26314
26315 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
26316$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
d0ac1c44 26317if ${gl_cv_func_rename_link_works+:} false; then :
6a29c58e
YQ
26318 $as_echo_n "(cached) " >&6
26319else
26320 if test $ac_cv_func_link = yes; then
c0c3707f
CB
26321 if test $cross_compiling != yes; then
26322 rm -rf conftest.f conftest.f1 conftest.f2
26323 if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
26324 set x `ls -i conftest.f conftest.f1` && test "" = ""; then
26325 if test "$cross_compiling" = yes; then :
26326 :
6a29c58e
YQ
26327
26328else
26329 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26330/* end confdefs.h. */
26331
c0c3707f
CB
26332# include <errno.h>
26333# include <stdio.h>
26334# include <stdlib.h>
26335# include <unistd.h>
6a29c58e 26336
9c9d63b1
PM
26337
26338$gl_mda_defines
26339
6a29c58e
YQ
26340int
26341main ()
26342{
26343int result = 0;
c0c3707f
CB
26344 if (rename ("conftest.f", "conftest.f1"))
26345 result |= 1;
26346 if (unlink ("conftest.f1"))
26347 result |= 2;
26348
26349 /* Allow either the POSIX-required behavior, where the
26350 previous rename kept conftest.f, or the (better) NetBSD
26351 behavior, where it removed conftest.f. */
26352 if (rename ("conftest.f", "conftest.f") != 0
26353 && errno != ENOENT)
26354 result |= 4;
26355
26356 if (rename ("conftest.f1", "conftest.f1") == 0)
26357 result |= 8;
26358 if (rename ("conftest.f2", "conftest.f2") != 0)
26359 result |= 16;
26360 return result;
6a29c58e
YQ
26361
26362 ;
26363 return 0;
26364}
26365_ACEOF
26366if ac_fn_c_try_run "$LINENO"; then :
26367 gl_cv_func_rename_link_works=yes
26368else
26369 gl_cv_func_rename_link_works=no
26370fi
26371rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26372 conftest.$ac_objext conftest.beam conftest.$ac_ext
26373fi
26374
c0c3707f
CB
26375 else
26376 gl_cv_func_rename_link_works="guessing no"
26377 fi
26378 rm -rf conftest.f conftest.f1 conftest.f2
6a29c58e 26379 else
c0c3707f
CB
26380 case "$host_os" in
26381 # Guess yes on Linux systems.
26382 linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
26383 # Guess yes on glibc systems.
26384 *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
26385 # Guess yes on native Windows.
26386 mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
26387 # If we don't know, obey --enable-cross-guesses.
26388 *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
26389 esac
6a29c58e 26390 fi
6a29c58e
YQ
26391 else
26392 gl_cv_func_rename_link_works=yes
26393 fi
26394
26395fi
26396{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
26397$as_echo "$gl_cv_func_rename_link_works" >&6; }
26398 case "$gl_cv_func_rename_link_works" in
26399 *yes) ;;
26400 *)
26401 REPLACE_RENAME=1
26402
26403$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
26404
26405 ;;
26406 esac
26407
26408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
26409$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
d0ac1c44 26410if ${gl_cv_func_rename_dest_works+:} false; then :
6a29c58e
YQ
26411 $as_echo_n "(cached) " >&6
26412else
26413 rm -rf conftest.f conftest.d1 conftest.d2
26414 touch conftest.f && mkdir conftest.d1 conftest.d2 ||
d0ac1c44 26415 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
26416 if test "$cross_compiling" = yes; then :
26417 case "$host_os" in
c0c3707f
CB
26418 # Guess yes on Linux systems.
26419 linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
26420 # Guess yes on glibc systems.
26421 *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
26422 # Guess no on native Windows.
26423 mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
26424 # If we don't know, obey --enable-cross-guesses.
26425 *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26426 esac
26427
26428else
26429 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26430/* end confdefs.h. */
26431
26432# include <stdio.h>
26433# include <stdlib.h>
26434
26435int
26436main ()
26437{
26438int result = 0;
26439 if (rename ("conftest.d1", "conftest.d2") != 0)
26440 result |= 1;
26441 if (rename ("conftest.d2", "conftest.f") == 0)
26442 result |= 2;
26443 return result;
26444
26445 ;
26446 return 0;
26447}
26448_ACEOF
26449if ac_fn_c_try_run "$LINENO"; then :
26450 gl_cv_func_rename_dest_works=yes
26451else
26452 gl_cv_func_rename_dest_works=no
26453fi
26454rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26455 conftest.$ac_objext conftest.beam conftest.$ac_ext
26456fi
26457
26458 rm -rf conftest.f conftest.d1 conftest.d2
26459
26460fi
26461{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
26462$as_echo "$gl_cv_func_rename_dest_works" >&6; }
26463 case "$gl_cv_func_rename_dest_works" in
26464 *yes) ;;
26465 *)
26466 REPLACE_RENAME=1
26467
26468$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
26469
26470 ;;
26471 esac
26472
26473 if test $REPLACE_RENAME = 1; then
26474
26475
26476
26477
26478
26479
26480
26481
26482 gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext"
26483
26484 fi
26485
26486
26487
26488
26489
26490 GNULIB_RENAME=1
26491
26492
26493
26494
26495
26496$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
26497
26498
26499
26500
26501
26502
6ec2e0f5
SDJ
26503 for ac_func in rewinddir
26504do :
26505 ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
d0ac1c44 26506if test "x$ac_cv_func_rewinddir" = xyes; then :
6ec2e0f5
SDJ
26507 cat >>confdefs.h <<_ACEOF
26508#define HAVE_REWINDDIR 1
26509_ACEOF
26510
26511fi
26512done
26513
26514 if test $ac_cv_func_rewinddir = no; then
26515 HAVE_REWINDDIR=0
26516 fi
26517
26518 if test $HAVE_REWINDDIR = 0; then
26519
26520
26521
26522
26523
26524
26525
26526
26527 gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext"
26528
26529 fi
26530
26531
26532
26533
26534
26535 GNULIB_REWINDDIR=1
26536
26537
26538
26539
26540
26541$as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
26542
26543
26544
26545
26546
26547
6a29c58e
YQ
26548 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
26549$as_echo_n "checking whether rmdir works... " >&6; }
d0ac1c44 26550if ${gl_cv_func_rmdir_works+:} false; then :
6a29c58e
YQ
26551 $as_echo_n "(cached) " >&6
26552else
26553 mkdir conftest.dir
26554 touch conftest.file
26555 if test "$cross_compiling" = yes; then :
26556 case "$host_os" in
c0c3707f
CB
26557 # Guess yes on Linux systems.
26558 linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
26559 # Guess yes on glibc systems.
26560 *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
26561 # Guess no on native Windows.
26562 mingw*) gl_cv_func_rmdir_works="guessing no" ;;
26563 # If we don't know, obey --enable-cross-guesses.
26564 *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
26565 esac
26566
26567else
26568 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26569/* end confdefs.h. */
26570#include <stdio.h>
26571 #include <errno.h>
26572 #if HAVE_UNISTD_H
26573 # include <unistd.h>
26574 #else /* on Windows with MSVC */
26575 # include <direct.h>
26576 #endif
26577
9c9d63b1
PM
26578
26579$gl_mda_defines
26580
6a29c58e
YQ
26581int
26582main ()
26583{
26584int result = 0;
9c9d63b1
PM
26585 if (!rmdir ("conftest.file/"))
26586 result |= 1;
26587 else if (errno != ENOTDIR)
26588 result |= 2;
26589 if (!rmdir ("conftest.dir/./"))
26590 result |= 4;
26591 return result;
6a29c58e
YQ
26592
26593 ;
26594 return 0;
26595}
26596_ACEOF
26597if ac_fn_c_try_run "$LINENO"; then :
26598 gl_cv_func_rmdir_works=yes
26599else
26600 gl_cv_func_rmdir_works=no
26601fi
26602rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26603 conftest.$ac_objext conftest.beam conftest.$ac_ext
26604fi
26605
26606 rm -rf conftest.dir conftest.file
26607fi
26608{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
26609$as_echo "$gl_cv_func_rmdir_works" >&6; }
26610 case "$gl_cv_func_rmdir_works" in
26611 *yes) ;;
26612 *)
26613 REPLACE_RMDIR=1
26614 ;;
26615 esac
26616
26617 if test $REPLACE_RMDIR = 1; then
26618
26619
26620
26621
26622
26623
26624
26625
26626 gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
26627
26628 fi
26629
26630
26631
26632
26633
26634 GNULIB_RMDIR=1
26635
26636
26637
26638
26639
26640$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
26641
26642
26643
26644
0750520d 26645
5e8754f9
SDJ
26646
26647
26648
3d99e817
AK
26649 if test $ac_cv_func_setenv = no; then
26650 HAVE_SETENV=0
26651 else
26652 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
26653$as_echo_n "checking whether setenv validates arguments... " >&6; }
d0ac1c44 26654if ${gl_cv_func_setenv_works+:} false; then :
3d99e817
AK
26655 $as_echo_n "(cached) " >&6
26656else
26657 if test "$cross_compiling" = yes; then :
26658 case "$host_os" in
c0c3707f
CB
26659 # Guess yes on glibc systems.
26660 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
26661 # Guess yes on musl systems.
26662 *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
26663 # If we don't know, obey --enable-cross-guesses.
26664 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
26665 esac
26666
26667else
26668 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26669/* end confdefs.h. */
26670
26671 #include <stdlib.h>
26672 #include <errno.h>
26673 #include <string.h>
26674
26675int
26676main ()
26677{
26678
26679 int result = 0;
26680 {
26681 if (setenv ("", "", 0) != -1)
26682 result |= 1;
26683 else if (errno != EINVAL)
26684 result |= 2;
26685 }
26686 {
26687 if (setenv ("a", "=", 1) != 0)
26688 result |= 4;
26689 else if (strcmp (getenv ("a"), "=") != 0)
26690 result |= 8;
26691 }
26692 return result;
26693
26694 ;
26695 return 0;
26696}
26697_ACEOF
26698if ac_fn_c_try_run "$LINENO"; then :
26699 gl_cv_func_setenv_works=yes
26700else
26701 gl_cv_func_setenv_works=no
26702fi
26703rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26704 conftest.$ac_objext conftest.beam conftest.$ac_ext
26705fi
26706
26707fi
26708{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
26709$as_echo "$gl_cv_func_setenv_works" >&6; }
26710 case "$gl_cv_func_setenv_works" in
26711 *yes) ;;
26712 *)
26713 REPLACE_SETENV=1
26714 ;;
26715 esac
26716 fi
26717
26718 if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
26719
26720
26721
26722
26723
26724
26725
26726
26727 gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
26728
26729 fi
26730
26731
26732
26733
26734
26735 GNULIB_SETENV=1
26736
26737
26738
26739
26740
26741$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
26742
26743
26744
26745
26746
0750520d
PA
26747
26748
26749
5df4cba6
SM
26750 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
26751$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
26752if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
26753 $as_echo_n "(cached) " >&6
26754else
26755 case "$host_os" in
26756 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
26757 *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
26758 gl_cv_func_setlocale_null_all_mtsafe=no ;;
26759 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
26760 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
26761 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
26762 # If we don't know, obey --enable-cross-guesses.
26763 *)
26764 gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
26765 esac
26766
26767fi
26768{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
26769$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
26770 case "$host_os" in
26771 mingw*) ;;
26772 *)
26773 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
26774 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
26775 fi
26776 ;;
26777 esac
26778 case "$gl_cv_func_setlocale_null_all_mtsafe" in
26779 *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
26780 *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
26781 esac
26782
26783cat >>confdefs.h <<_ACEOF
26784#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
26785_ACEOF
26786
26787
26788 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
26789$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
26790if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
26791 $as_echo_n "(cached) " >&6
26792else
26793 case "$host_os" in
26794 # Guess no on OpenBSD, AIX.
26795 openbsd* | aix*)
26796 gl_cv_func_setlocale_null_one_mtsafe=no ;;
26797 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
26798 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
26799 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
26800 # If we don't know, obey --enable-cross-guesses.
26801 *)
26802 gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
26803 esac
26804
26805fi
26806{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
26807$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
26808 case "$host_os" in
26809 mingw*) ;;
26810 *)
26811 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
26812 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
26813 fi
26814 ;;
26815 esac
26816 case "$gl_cv_func_setlocale_null_one_mtsafe" in
26817 *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
26818 *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
26819 esac
26820
26821cat >>confdefs.h <<_ACEOF
26822#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
26823_ACEOF
26824
26825
26826 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
26827 case "$host_os" in
26828 mingw*) LIB_SETLOCALE_NULL= ;;
26829 *)
26830
26831
26832 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
26833$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
26834if ${gl_cv_have_weak+:} false; then :
26835 $as_echo_n "(cached) " >&6
26836else
26837 gl_cv_have_weak=no
26838 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26839/* end confdefs.h. */
26840extern void xyzzy ();
26841#pragma weak xyzzy
26842int
26843main ()
26844{
26845xyzzy();
26846 ;
26847 return 0;
26848}
26849_ACEOF
26850if ac_fn_c_try_link "$LINENO"; then :
26851 gl_cv_have_weak=maybe
26852fi
26853rm -f core conftest.err conftest.$ac_objext \
26854 conftest$ac_exeext conftest.$ac_ext
26855 if test $gl_cv_have_weak = maybe; then
26856 if test "$cross_compiling" = yes; then :
26857 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26858/* end confdefs.h. */
26859#ifdef __ELF__
26860 Extensible Linking Format
26861 #endif
26862
26863_ACEOF
26864if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
26865 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
26866 gl_cv_have_weak="guessing yes"
26867else
26868 gl_cv_have_weak="guessing no"
26869fi
26870rm -f conftest*
26871
26872
26873else
26874 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26875/* end confdefs.h. */
26876
26877#include <stdio.h>
26878#pragma weak fputs
26879int main ()
26880{
26881 return (fputs == NULL);
26882}
26883_ACEOF
26884if ac_fn_c_try_run "$LINENO"; then :
26885 gl_cv_have_weak=yes
26886else
26887 gl_cv_have_weak=no
26888fi
26889rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26890 conftest.$ac_objext conftest.beam conftest.$ac_ext
26891fi
26892
26893 fi
26894 case " $LDFLAGS " in
26895 *" -static "*) gl_cv_have_weak=no ;;
26896 esac
26897 case "$gl_cv_have_weak" in
26898 *yes)
26899 case "$host_os" in
26900 freebsd* | dragonfly*)
26901 : > conftest1.c
26902 $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
26903 cat <<EOF > conftest2.c
26904#include <pthread.h>
26905#pragma weak pthread_mutexattr_gettype
26906int main ()
26907{
26908 return (pthread_mutexattr_gettype != NULL);
26909}
26910EOF
26911 $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
26912 || gl_cv_have_weak=no
26913 rm -f conftest1.c libempty.so conftest2.c conftest
26914 ;;
26915 esac
26916 ;;
26917 esac
26918
26919fi
26920{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
26921$as_echo "$gl_cv_have_weak" >&6; }
26922 case "$gl_cv_have_weak" in
26923 *yes)
26924
26925$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
26926
26927 ;;
26928 esac
26929
26930 case "$gl_cv_have_weak" in
26931 *yes) LIB_SETLOCALE_NULL= ;;
26932 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
26933 esac
26934 ;;
26935 esac
26936 else
26937 LIB_SETLOCALE_NULL=
26938 fi
26939
26940
26941 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
26942
26943
26944
26945
26946
26947
26948
26949
26950 gl_LIBOBJS="$gl_LIBOBJS setlocale-lock.$ac_objext"
26951
26952
26953
26954
26955 CFLAG_VISIBILITY=
26956 HAVE_VISIBILITY=0
26957 if test -n "$GCC"; then
26958 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
26959$as_echo_n "checking whether the -Werror option is usable... " >&6; }
26960if ${gl_cv_cc_vis_werror+:} false; then :
26961 $as_echo_n "(cached) " >&6
26962else
26963 gl_save_CFLAGS="$CFLAGS"
26964 CFLAGS="$CFLAGS -Werror"
26965 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26966/* end confdefs.h. */
26967
26968int
26969main ()
26970{
26971
26972 ;
26973 return 0;
26974}
26975_ACEOF
26976if ac_fn_c_try_compile "$LINENO"; then :
26977 gl_cv_cc_vis_werror=yes
26978else
26979 gl_cv_cc_vis_werror=no
26980fi
26981rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26982 CFLAGS="$gl_save_CFLAGS"
26983
26984fi
26985{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
26986$as_echo "$gl_cv_cc_vis_werror" >&6; }
26987 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
26988$as_echo_n "checking for simple visibility declarations... " >&6; }
26989if ${gl_cv_cc_visibility+:} false; then :
26990 $as_echo_n "(cached) " >&6
26991else
26992 gl_save_CFLAGS="$CFLAGS"
26993 CFLAGS="$CFLAGS -fvisibility=hidden"
26994 if test $gl_cv_cc_vis_werror = yes; then
26995 CFLAGS="$CFLAGS -Werror"
26996 fi
26997 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26998/* end confdefs.h. */
26999extern __attribute__((__visibility__("hidden"))) int hiddenvar;
27000 extern __attribute__((__visibility__("default"))) int exportedvar;
27001 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
27002 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
27003 void dummyfunc (void) {}
27004
27005int
27006main ()
27007{
27008
27009 ;
27010 return 0;
27011}
27012_ACEOF
27013if ac_fn_c_try_compile "$LINENO"; then :
27014 gl_cv_cc_visibility=yes
27015else
27016 gl_cv_cc_visibility=no
27017fi
27018rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27019 CFLAGS="$gl_save_CFLAGS"
27020
27021fi
27022{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
27023$as_echo "$gl_cv_cc_visibility" >&6; }
27024 if test $gl_cv_cc_visibility = yes; then
27025 CFLAG_VISIBILITY="-fvisibility=hidden"
27026 HAVE_VISIBILITY=1
27027 fi
27028 fi
27029
27030
27031
27032cat >>confdefs.h <<_ACEOF
27033#define HAVE_VISIBILITY $HAVE_VISIBILITY
27034_ACEOF
27035
27036
27037
27038 fi
27039
27040
27041
27042
27043
27044 GNULIB_SETLOCALE_NULL=1
27045
27046
27047
27048
27049
27050$as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h
27051
27052
27053
27054
27055
27056
27057
27058
0750520d
PA
27059
27060
27061
27062
27063
27064
27065 if test $gl_cv_have_include_next = yes; then
27066 gl_cv_next_signal_h='<'signal.h'>'
27067 else
27068 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
27069$as_echo_n "checking absolute name of <signal.h>... " >&6; }
d0ac1c44 27070if ${gl_cv_next_signal_h+:} false; then :
0750520d
PA
27071 $as_echo_n "(cached) " >&6
27072else
27073
27074
27075
27076 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27077/* end confdefs.h. */
27078#include <signal.h>
27079_ACEOF
27080 case "$host_os" in
27081 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27082 *) gl_absname_cpp="$ac_cpp" ;;
27083 esac
27084
27085 case "$host_os" in
27086 mingw*)
27087 gl_dirsep_regex='[/\\]'
27088 ;;
27089 *)
27090 gl_dirsep_regex='\/'
27091 ;;
27092 esac
27093 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27094 gl_header_literal_regex=`echo 'signal.h' \
27095 | sed -e "$gl_make_literal_regex_sed"`
27096 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27097 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27098 s|^/[^/]|//&|
27099 p
27100 q
27101 }'
27102
27103 gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27104 sed -n "$gl_absolute_header_sed"`
27105
27106 gl_header=$gl_cv_absolute_signal_h
27107 gl_cv_next_signal_h='"'$gl_header'"'
27108
27109
27110fi
27111{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
27112$as_echo "$gl_cv_next_signal_h" >&6; }
27113 fi
27114 NEXT_SIGNAL_H=$gl_cv_next_signal_h
27115
27116 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27117 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27118 gl_next_as_first_directive='<'signal.h'>'
27119 else
27120 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27121 gl_next_as_first_directive=$gl_cv_next_signal_h
27122 fi
27123 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
27124
27125
27126
27127
27128
27129# AIX declares sig_atomic_t to already include volatile, and C89 compilers
27130# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
27131 ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
27132#include <signal.h>
27133
27134"
d0ac1c44 27135if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
0750520d
PA
27136
27137else
27138 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
27139fi
27140
27141
27142
27143
27144
27145
27146
27147 ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
27148#include <signal.h>
27149
27150"
d0ac1c44 27151if test "x$ac_cv_type_sighandler_t" = xyes; then :
0750520d
PA
27152
27153else
27154 HAVE_SIGHANDLER_T=0
27155fi
27156
27157
27158
0750520d 27159
0750520d
PA
27160
27161
698be2d8
CB
27162
27163
725e2999
JB
27164 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
27165/* <sys/types.h> is not needed according to POSIX, but the
27166 <sys/socket.h> in i386-unknown-freebsd4.10 and
27167 powerpc-apple-darwin5.5 required it. */
27168#include <sys/types.h>
27169#if HAVE_SYS_SOCKET_H
27170# include <sys/socket.h>
27171#elif HAVE_WS2TCPIP_H
27172# include <ws2tcpip.h>
27173#endif
27174
27175"
27176if test "x$ac_cv_type_socklen_t" = xyes; then :
27177
27178else
27179 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
27180$as_echo_n "checking for socklen_t equivalent... " >&6; }
c0c3707f 27181if ${gl_cv_socklen_t_equiv+:} false; then :
725e2999
JB
27182 $as_echo_n "(cached) " >&6
27183else
27184 # Systems have either "struct sockaddr *" or
27185 # "void *" as the second argument to getpeername
27186 gl_cv_socklen_t_equiv=
27187 for arg2 in "struct sockaddr" void; do
27188 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
27189 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27190/* end confdefs.h. */
27191#include <sys/types.h>
27192 #include <sys/socket.h>
27193
27194 int getpeername (int, $arg2 *, $t *);
27195int
27196main ()
27197{
27198$t len;
27199 getpeername (0, 0, &len);
27200 ;
27201 return 0;
27202}
27203_ACEOF
27204if ac_fn_c_try_compile "$LINENO"; then :
27205 gl_cv_socklen_t_equiv="$t"
27206fi
27207rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27208 test "$gl_cv_socklen_t_equiv" != "" && break
27209 done
27210 test "$gl_cv_socklen_t_equiv" != "" && break
27211 done
c0c3707f
CB
27212 if test "$gl_cv_socklen_t_equiv" = ""; then
27213 as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
27214 fi
725e2999
JB
27215
27216fi
c0c3707f 27217{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
725e2999
JB
27218$as_echo "$gl_cv_socklen_t_equiv" >&6; }
27219
27220cat >>confdefs.h <<_ACEOF
27221#define socklen_t $gl_cv_socklen_t_equiv
27222_ACEOF
27223
27224fi
27225
0750520d 27226
63ce7108
TT
27227 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
27228$as_echo_n "checking for ssize_t... " >&6; }
d0ac1c44 27229if ${gt_cv_ssize_t+:} false; then :
63ce7108
TT
27230 $as_echo_n "(cached) " >&6
27231else
27232 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27233/* end confdefs.h. */
27234#include <sys/types.h>
27235int
27236main ()
27237{
27238int x = sizeof (ssize_t *) + sizeof (ssize_t);
27239 return !x;
27240 ;
27241 return 0;
27242}
27243_ACEOF
27244if ac_fn_c_try_compile "$LINENO"; then :
27245 gt_cv_ssize_t=yes
27246else
27247 gt_cv_ssize_t=no
27248fi
27249rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27250fi
27251{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
27252$as_echo "$gt_cv_ssize_t" >&6; }
27253 if test $gt_cv_ssize_t = no; then
27254
27255$as_echo "#define ssize_t int" >>confdefs.h
27256
27257 fi
27258
27259
27260
27261
472fa5ee 27262
c0c3707f
CB
27263 case "$host_os" in
27264 mingw*)
d706b69e 27265 ;;
c0c3707f
CB
27266 *)
27267 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
27268$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
27269if ${gl_cv_func_stat_file_slash+:} false; then :
2196f55f
YQ
27270 $as_echo_n "(cached) " >&6
27271else
c0c3707f
CB
27272 touch conftest.tmp
27273 # Assume that if we have lstat, we can also check symlinks.
27274 if test $ac_cv_func_lstat = yes; then
27275 ln -s conftest.tmp conftest.lnk
27276 fi
27277 if test "$cross_compiling" = yes; then :
27278 case "$host_os" in
27279 # Guess yes on Linux systems.
27280 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
27281 # Guess yes on glibc systems.
27282 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
27283 # If we don't know, obey --enable-cross-guesses.
27284 *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
27285 esac
27286
2196f55f
YQ
27287else
27288 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27289/* end confdefs.h. */
27290#include <sys/stat.h>
27291
27292int
27293main ()
27294{
c0c3707f
CB
27295int result = 0;
27296 struct stat st;
27297 if (!stat ("conftest.tmp/", &st))
27298 result |= 1;
27299#if HAVE_LSTAT
27300 if (!stat ("conftest.lnk/", &st))
27301 result |= 2;
27302#endif
27303 return result;
27304
2196f55f
YQ
27305 ;
27306 return 0;
27307}
27308_ACEOF
27309if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 27310 gl_cv_func_stat_file_slash=yes
2196f55f 27311else
c0c3707f 27312 gl_cv_func_stat_file_slash=no
2196f55f
YQ
27313fi
27314rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27315 conftest.$ac_objext conftest.beam conftest.$ac_ext
27316fi
27317
c0c3707f 27318 rm -f conftest.tmp conftest.lnk
2196f55f 27319fi
c0c3707f
CB
27320{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
27321$as_echo "$gl_cv_func_stat_file_slash" >&6; }
27322 case $gl_cv_func_stat_file_slash in
27323 *no)
27324 REPLACE_STAT=1
27325
27326$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
27327;;
27328 esac
27329 case $host_os in
27330 solaris*)
27331 REPLACE_FSTAT=1 ;;
27332 esac
27333 ;;
27334 esac
27335
27336 if test $REPLACE_STAT = 1; then
27337
27338
27339
27340
27341
27342
27343
27344
27345 gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
27346
27347 case "$host_os" in
27348 mingw*)
27349
27350
27351
27352
27353
27354
27355
27356
27357 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
27358
27359 ;;
27360 esac
27361
27362
9c9d63b1 27363
c0c3707f
CB
27364 :
27365
27366 fi
27367
27368
27369
27370
27371
27372 GNULIB_STAT=1
27373
27374
27375
27376
27377
27378$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
27379
27380
27381
27382
7a6dbc2f 27383
c0c3707f
CB
27384
27385
27386 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>
27387 #include <sys/stat.h>
27388"
27389if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
27390
27391cat >>confdefs.h <<_ACEOF
27392#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
27393_ACEOF
27394
27395{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
27396$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
27397if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
27398 $as_echo_n "(cached) " >&6
2196f55f 27399else
5e8754f9
SDJ
27400 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27401/* end confdefs.h. */
c0c3707f
CB
27402
27403 #include <sys/types.h>
27404 #include <sys/stat.h>
27405 #if HAVE_SYS_TIME_H
27406 # include <sys/time.h>
27407 #endif
27408 #include <time.h>
27409 struct timespec ts;
27410 struct stat st;
7a6dbc2f 27411
5e8754f9
SDJ
27412int
27413main ()
27414{
c0c3707f
CB
27415
27416 st.st_atim = ts;
7a6dbc2f 27417
5e8754f9
SDJ
27418 ;
27419 return 0;
27420}
27421_ACEOF
c0c3707f
CB
27422if ac_fn_c_try_compile "$LINENO"; then :
27423 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
5e8754f9 27424else
c0c3707f 27425 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
2196f55f 27426fi
c0c3707f 27427rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2196f55f 27428fi
c0c3707f
CB
27429{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
27430$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
27431 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
2196f55f 27432
c0c3707f 27433$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
2196f55f 27434
c0c3707f
CB
27435 fi
27436else
27437 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>
27438 #include <sys/stat.h>
27439"
27440if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
2196f55f 27441
c0c3707f
CB
27442cat >>confdefs.h <<_ACEOF
27443#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
27444_ACEOF
2196f55f 27445
c0c3707f
CB
27446
27447else
27448 ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
27449 #include <sys/stat.h>
27450"
27451if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
27452
27453cat >>confdefs.h <<_ACEOF
27454#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
27455_ACEOF
2196f55f
YQ
27456
27457
c0c3707f
CB
27458else
27459 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>
27460 #include <sys/stat.h>
27461"
27462if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
2196f55f 27463
c0c3707f
CB
27464cat >>confdefs.h <<_ACEOF
27465#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
27466_ACEOF
2196f55f
YQ
27467
27468
c0c3707f 27469fi
2196f55f 27470
c0c3707f 27471fi
2196f55f 27472
c0c3707f 27473fi
2196f55f 27474
c0c3707f 27475fi
2196f55f
YQ
27476
27477
27478
27479
27480
c0c3707f
CB
27481 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>
27482 #include <sys/stat.h>
27483"
27484if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
2196f55f 27485
c0c3707f
CB
27486cat >>confdefs.h <<_ACEOF
27487#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
27488_ACEOF
2196f55f
YQ
27489
27490
c0c3707f
CB
27491else
27492 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
27493 #include <sys/stat.h>
27494"
27495if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
2196f55f 27496
c0c3707f
CB
27497cat >>confdefs.h <<_ACEOF
27498#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
27499_ACEOF
2196f55f 27500
2196f55f 27501
c0c3707f
CB
27502else
27503 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>
27504 #include <sys/stat.h>
27505"
27506if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
27507
27508cat >>confdefs.h <<_ACEOF
27509#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
27510_ACEOF
27511
27512
27513fi
27514
27515fi
5e8754f9 27516
c0c3707f 27517fi
2196f55f
YQ
27518
27519
27520
725e2999
JB
27521 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
27522$as_echo_n "checking for working stdalign.h... " >&6; }
27523if ${gl_cv_header_working_stdalign_h+:} false; then :
27524 $as_echo_n "(cached) " >&6
27525else
27526 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27527/* end confdefs.h. */
27528#include <stdalign.h>
27529 #include <stddef.h>
27530
27531 /* Test that alignof yields a result consistent with offsetof.
27532 This catches GCC bug 52023
c0c3707f 27533 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
725e2999
JB
27534 #ifdef __cplusplus
27535 template <class t> struct alignof_helper { char a; t b; };
27536 # define ao(type) offsetof (alignof_helper<type>, b)
27537 #else
27538 # define ao(type) offsetof (struct { char a; type b; }, b)
27539 #endif
27540 char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
27541 char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
27542 char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
27543
27544 /* Test _Alignas only on platforms where gnulib can help. */
27545 #if \
27546 ((defined __cplusplus && 201103 <= __cplusplus) \
27547 || (defined __APPLE__ && defined __MACH__ \
27548 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
27549 : __GNUC__) \
c0c3707f
CB
27550 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
27551 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
725e2999
JB
27552 || 1300 <= _MSC_VER)
27553 struct alignas_test { char c; char alignas (8) alignas_8; };
27554 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
27555 ? 1 : -1];
27556 #endif
27557
27558int
27559main ()
27560{
27561
27562 ;
27563 return 0;
27564}
27565_ACEOF
27566if ac_fn_c_try_compile "$LINENO"; then :
27567 gl_cv_header_working_stdalign_h=yes
27568else
27569 gl_cv_header_working_stdalign_h=no
27570fi
27571rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27572fi
27573{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
27574$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
27575
27576 if test $gl_cv_header_working_stdalign_h = yes; then
27577 STDALIGN_H=''
27578 else
27579 STDALIGN_H='stdalign.h'
27580 fi
27581
27582
27583 if test -n "$STDALIGN_H"; then
27584 GL_GENERATE_STDALIGN_H_TRUE=
27585 GL_GENERATE_STDALIGN_H_FALSE='#'
27586else
27587 GL_GENERATE_STDALIGN_H_TRUE='#'
27588 GL_GENERATE_STDALIGN_H_FALSE=
27589fi
27590
27591
27592
2196f55f
YQ
27593
27594
63ce7108 27595
c0c3707f
CB
27596 if test "$ac_cv_header_stdbool_h" = yes; then
27597 case "$host_os" in
27598 solaris*)
27599 if test -z "$GCC"; then
27600 STDBOOL_H='stdbool.h'
27601 else
27602 STDBOOL_H=''
27603 fi
27604 ;;
27605 *)
27606 STDBOOL_H=''
27607 ;;
27608 esac
63ce7108
TT
27609 else
27610 STDBOOL_H='stdbool.h'
27611 fi
27612
27613 if test -n "$STDBOOL_H"; then
27614 GL_GENERATE_STDBOOL_H_TRUE=
27615 GL_GENERATE_STDBOOL_H_FALSE='#'
27616else
27617 GL_GENERATE_STDBOOL_H_TRUE='#'
27618 GL_GENERATE_STDBOOL_H_FALSE=
27619fi
27620
27621
27622 if test "$ac_cv_type__Bool" = yes; then
27623 HAVE__BOOL=1
27624 else
27625 HAVE__BOOL=0
27626 fi
27627
27628
27629
27630
27631
9c9d63b1
PM
27632
27633
27634
63ce7108 27635 STDDEF_H=
4a626d0a 27636
c0c3707f
CB
27637 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
27638$as_echo_n "checking for good max_align_t... " >&6; }
27639if ${gl_cv_type_max_align_t+:} false; then :
27640 $as_echo_n "(cached) " >&6
27641else
27642 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27643/* end confdefs.h. */
27644#include <stddef.h>
27645 unsigned int s = sizeof (max_align_t);
9c9d63b1 27646 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
c0c3707f
CB
27647 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
27648 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
27649 #endif
9c9d63b1
PM
27650 typedef struct { char a; max_align_t b; } max_helper;
27651 typedef struct { char a; long b; } long_helper;
27652 typedef struct { char a; double b; } double_helper;
27653 typedef struct { char a; long double b; } long_double_helper;
27654 int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
27655 int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
27656 int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
c0c3707f
CB
27657
27658int
27659main ()
27660{
4a626d0a 27661
c0c3707f
CB
27662 ;
27663 return 0;
27664}
27665_ACEOF
27666if ac_fn_c_try_compile "$LINENO"; then :
27667 gl_cv_type_max_align_t=yes
4a626d0a 27668else
c0c3707f 27669 gl_cv_type_max_align_t=no
4a626d0a 27670fi
c0c3707f
CB
27671rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27672
27673fi
27674{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
27675$as_echo "$gl_cv_type_max_align_t" >&6; }
27676 if test $gl_cv_type_max_align_t = no; then
27677 HAVE_MAX_ALIGN_T=0
27678 STDDEF_H=stddef.h
27679 fi
4a626d0a 27680
63ce7108
TT
27681 if test $gt_cv_c_wchar_t = no; then
27682 HAVE_WCHAR_T=0
27683 STDDEF_H=stddef.h
27684 fi
c0c3707f 27685
63ce7108
TT
27686 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
27687$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
d0ac1c44 27688if ${gl_cv_decl_null_works+:} false; then :
63ce7108
TT
27689 $as_echo_n "(cached) " >&6
27690else
27691 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27692/* end confdefs.h. */
27693#include <stddef.h>
27694 int test[2 * (sizeof NULL == sizeof (void *)) -1];
27695
27696int
27697main ()
27698{
27699
27700 ;
27701 return 0;
27702}
27703_ACEOF
27704if ac_fn_c_try_compile "$LINENO"; then :
27705 gl_cv_decl_null_works=yes
27706else
27707 gl_cv_decl_null_works=no
27708fi
27709rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27710fi
27711{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
27712$as_echo "$gl_cv_decl_null_works" >&6; }
27713 if test $gl_cv_decl_null_works = no; then
27714 REPLACE_NULL=1
27715 STDDEF_H=stddef.h
27716 fi
27717
c0c3707f 27718
63ce7108
TT
27719 if test -n "$STDDEF_H"; then
27720 GL_GENERATE_STDDEF_H_TRUE=
27721 GL_GENERATE_STDDEF_H_FALSE='#'
27722else
27723 GL_GENERATE_STDDEF_H_TRUE='#'
27724 GL_GENERATE_STDDEF_H_FALSE=
27725fi
27726
27727 if test -n "$STDDEF_H"; then
27728
27729
27730
27731
27732
27733
27734
27735
27736 if test $gl_cv_have_include_next = yes; then
27737 gl_cv_next_stddef_h='<'stddef.h'>'
27738 else
27739 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
27740$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
d0ac1c44 27741if ${gl_cv_next_stddef_h+:} false; then :
63ce7108
TT
27742 $as_echo_n "(cached) " >&6
27743else
27744
4a626d0a
PA
27745
27746
27747 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63ce7108
TT
27748/* end confdefs.h. */
27749#include <stddef.h>
63ce7108 27750_ACEOF
4a626d0a
PA
27751 case "$host_os" in
27752 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27753 *) gl_absname_cpp="$ac_cpp" ;;
27754 esac
63ce7108 27755
4a626d0a
PA
27756 case "$host_os" in
27757 mingw*)
27758 gl_dirsep_regex='[/\\]'
27759 ;;
27760 *)
27761 gl_dirsep_regex='\/'
27762 ;;
27763 esac
27764 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27765 gl_header_literal_regex=`echo 'stddef.h' \
27766 | sed -e "$gl_make_literal_regex_sed"`
27767 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27768 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27769 s|^/[^/]|//&|
27770 p
27771 q
27772 }'
63ce7108 27773
4a626d0a
PA
27774 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27775 sed -n "$gl_absolute_header_sed"`
27776
27777 gl_header=$gl_cv_absolute_stddef_h
27778 gl_cv_next_stddef_h='"'$gl_header'"'
63ce7108
TT
27779
27780
27781fi
27782{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
27783$as_echo "$gl_cv_next_stddef_h" >&6; }
27784 fi
27785 NEXT_STDDEF_H=$gl_cv_next_stddef_h
27786
27787 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27788 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27789 gl_next_as_first_directive='<'stddef.h'>'
27790 else
27791 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27792 gl_next_as_first_directive=$gl_cv_next_stddef_h
27793 fi
27794 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
27795
27796
27797
27798
27799 fi
27800
27801
27802
27803
49e4877c 27804 $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
63ce7108
TT
27805
27806
27807
98399780
YQ
27808
27809
27810
27811
27812
4a626d0a
PA
27813
27814
6a29c58e
YQ
27815 if test $gl_cv_have_include_next = yes; then
27816 gl_cv_next_stdio_h='<'stdio.h'>'
27817 else
27818 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
27819$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
d0ac1c44 27820if ${gl_cv_next_stdio_h+:} false; then :
6a29c58e
YQ
27821 $as_echo_n "(cached) " >&6
27822else
27823
4a626d0a
PA
27824
27825
27826 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6a29c58e
YQ
27827/* end confdefs.h. */
27828#include <stdio.h>
6a29c58e 27829_ACEOF
4a626d0a
PA
27830 case "$host_os" in
27831 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27832 *) gl_absname_cpp="$ac_cpp" ;;
27833 esac
27834
27835 case "$host_os" in
27836 mingw*)
27837 gl_dirsep_regex='[/\\]'
27838 ;;
27839 *)
27840 gl_dirsep_regex='\/'
27841 ;;
27842 esac
27843 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27844 gl_header_literal_regex=`echo 'stdio.h' \
27845 | sed -e "$gl_make_literal_regex_sed"`
27846 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27847 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27848 s|^/[^/]|//&|
27849 p
27850 q
27851 }'
6a29c58e 27852
4a626d0a
PA
27853 gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27854 sed -n "$gl_absolute_header_sed"`
6a29c58e 27855
4a626d0a
PA
27856 gl_header=$gl_cv_absolute_stdio_h
27857 gl_cv_next_stdio_h='"'$gl_header'"'
6a29c58e
YQ
27858
27859
27860fi
27861{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
27862$as_echo "$gl_cv_next_stdio_h" >&6; }
27863 fi
27864 NEXT_STDIO_H=$gl_cv_next_stdio_h
27865
27866 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27867 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27868 gl_next_as_first_directive='<'stdio.h'>'
27869 else
27870 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27871 gl_next_as_first_directive=$gl_cv_next_stdio_h
27872 fi
27873 NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
27874
27875
27876
27877
27878
4a626d0a
PA
27879 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
27880$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
d0ac1c44 27881if ${gl_cv_func_printf_attribute_flavor+:} false; then :
4a626d0a
PA
27882 $as_echo_n "(cached) " >&6
27883else
27884 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27885/* end confdefs.h. */
27886
27887 #define __STDC_FORMAT_MACROS 1
27888 #include <stdio.h>
27889 #include <inttypes.h>
27890 /* For non-mingw systems, compilation will trivially succeed.
27891 For mingw, compilation will succeed for older mingw (system
27892 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
c0c3707f 27893 #if (defined _WIN32 && ! defined __CYGWIN__) && \
4a626d0a
PA
27894 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
27895 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
27896 #endif
27897
27898int
27899main ()
27900{
27901
27902 ;
27903 return 0;
27904}
27905_ACEOF
27906if ac_fn_c_try_compile "$LINENO"; then :
27907 gl_cv_func_printf_attribute_flavor=system
27908else
27909 gl_cv_func_printf_attribute_flavor=gnu
27910fi
27911rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27912fi
27913{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
27914$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
27915 if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
27916
27917$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
27918
27919 fi
27920
6a29c58e
YQ
27921 GNULIB_FSCANF=1
27922
27923
27924cat >>confdefs.h <<_ACEOF
27925#define GNULIB_FSCANF 1
27926_ACEOF
27927
27928
27929 GNULIB_SCANF=1
27930
27931
27932cat >>confdefs.h <<_ACEOF
27933#define GNULIB_SCANF 1
27934_ACEOF
27935
27936
27937 GNULIB_FGETC=1
27938 GNULIB_GETC=1
27939 GNULIB_GETCHAR=1
27940 GNULIB_FGETS=1
27941 GNULIB_FREAD=1
27942
27943
27944 GNULIB_FPRINTF=1
27945 GNULIB_PRINTF=1
27946 GNULIB_VFPRINTF=1
27947 GNULIB_VPRINTF=1
27948 GNULIB_FPUTC=1
27949 GNULIB_PUTC=1
27950 GNULIB_PUTCHAR=1
27951 GNULIB_FPUTS=1
27952 GNULIB_PUTS=1
27953 GNULIB_FWRITE=1
27954
27955
27956
27957
6a29c58e 27958
6a29c58e
YQ
27959
27960
27961
27962
27963
9c9d63b1
PM
27964 if test $ac_cv_have_decl_fcloseall = no; then
27965 HAVE_DECL_FCLOSEALL=0
27966 fi
27967
27968
6a29c58e
YQ
27969
27970
27971
27972
27973
27974
27975
698be2d8
CB
27976
27977
98399780
YQ
27978 if test $gl_cv_have_include_next = yes; then
27979 gl_cv_next_stdlib_h='<'stdlib.h'>'
27980 else
27981 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
27982$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
d0ac1c44 27983if ${gl_cv_next_stdlib_h+:} false; then :
98399780
YQ
27984 $as_echo_n "(cached) " >&6
27985else
27986
4a626d0a
PA
27987
27988
27989 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98399780
YQ
27990/* end confdefs.h. */
27991#include <stdlib.h>
98399780 27992_ACEOF
4a626d0a
PA
27993 case "$host_os" in
27994 aix*) gl_absname_cpp="$ac_cpp -C" ;;
27995 *) gl_absname_cpp="$ac_cpp" ;;
27996 esac
27997
27998 case "$host_os" in
27999 mingw*)
28000 gl_dirsep_regex='[/\\]'
28001 ;;
28002 *)
28003 gl_dirsep_regex='\/'
28004 ;;
28005 esac
28006 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28007 gl_header_literal_regex=`echo 'stdlib.h' \
28008 | sed -e "$gl_make_literal_regex_sed"`
28009 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28010 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28011 s|^/[^/]|//&|
28012 p
28013 q
28014 }'
98399780 28015
4a626d0a
PA
28016 gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28017 sed -n "$gl_absolute_header_sed"`
98399780 28018
4a626d0a
PA
28019 gl_header=$gl_cv_absolute_stdlib_h
28020 gl_cv_next_stdlib_h='"'$gl_header'"'
98399780
YQ
28021
28022
28023fi
28024{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
28025$as_echo "$gl_cv_next_stdlib_h" >&6; }
28026 fi
28027 NEXT_STDLIB_H=$gl_cv_next_stdlib_h
28028
28029 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28030 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28031 gl_next_as_first_directive='<'stdlib.h'>'
28032 else
28033 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28034 gl_next_as_first_directive=$gl_cv_next_stdlib_h
28035 fi
28036 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
28037
28038
28039
28040
28041
28042
98399780 28043
98399780
YQ
28044
28045
28046
28047
28048
9c9d63b1
PM
28049 if test $ac_cv_have_decl_ecvt = no; then
28050 HAVE_DECL_ECVT=0
28051 fi
28052
28053 if test $ac_cv_have_decl_fcvt = no; then
28054 HAVE_DECL_FCVT=0
28055 fi
28056
28057 if test $ac_cv_have_decl_gcvt = no; then
28058 HAVE_DECL_GCVT=0
28059 fi
28060
28061
98399780 28062
698be2d8
CB
28063
28064
8424cc97
SM
28065 for ac_func in strchrnul
28066do :
28067 ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
d0ac1c44 28068if test "x$ac_cv_func_strchrnul" = xyes; then :
8424cc97
SM
28069 cat >>confdefs.h <<_ACEOF
28070#define HAVE_STRCHRNUL 1
28071_ACEOF
28072
28073fi
28074done
28075
28076 if test $ac_cv_func_strchrnul = no; then
28077 HAVE_STRCHRNUL=0
28078 else
28079 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
28080$as_echo_n "checking whether strchrnul works... " >&6; }
d0ac1c44 28081if ${gl_cv_func_strchrnul_works+:} false; then :
8424cc97
SM
28082 $as_echo_n "(cached) " >&6
28083else
28084 if test "$cross_compiling" = yes; then :
28085 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28086/* end confdefs.h. */
28087
28088#if defined __CYGWIN__
28089 #include <cygwin/version.h>
28090 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
28091 Lucky user
28092 #endif
28093#else
28094 Lucky user
28095#endif
28096
28097_ACEOF
28098if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28099 $EGREP "Lucky user" >/dev/null 2>&1; then :
28100 gl_cv_func_strchrnul_works="guessing yes"
28101else
28102 gl_cv_func_strchrnul_works="guessing no"
28103fi
28104rm -f conftest*
28105
28106
28107else
28108 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28109/* end confdefs.h. */
28110
28111#include <string.h> /* for strchrnul */
28112
28113int
28114main ()
28115{
28116const char *buf = "a";
28117 return strchrnul (buf, 'b') != buf + 1;
28118
28119 ;
28120 return 0;
28121}
28122_ACEOF
28123if ac_fn_c_try_run "$LINENO"; then :
28124 gl_cv_func_strchrnul_works=yes
28125else
28126 gl_cv_func_strchrnul_works=no
28127fi
28128rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28129 conftest.$ac_objext conftest.beam conftest.$ac_ext
28130fi
28131
28132
28133fi
28134{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
28135$as_echo "$gl_cv_func_strchrnul_works" >&6; }
28136 case "$gl_cv_func_strchrnul_works" in
28137 *yes) ;;
28138 *) REPLACE_STRCHRNUL=1 ;;
28139 esac
28140 fi
28141
28142 if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
28143
28144
28145
28146
28147
28148
28149
28150
28151 gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext"
28152
28153 :
28154 fi
28155
28156
28157
28158
28159
28160 GNULIB_STRCHRNUL=1
28161
28162
28163
28164
28165
28166$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
28167
28168
28169
28170
28171
28172
9c9d63b1
PM
28173 if test $gl_cv_func_malloc_posix != yes; then
28174 REPLACE_STRDUP=1
6ec2e0f5
SDJ
28175 fi
28176
28177 if test $ac_cv_have_decl_strdup = no; then
28178 HAVE_DECL_STRDUP=0
28179 fi
28180
9c9d63b1 28181 if test $REPLACE_STRDUP = 1; then
6ec2e0f5
SDJ
28182
28183
28184
28185
28186
28187
28188
28189
28190 gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
28191
28192 :
28193 fi
28194
28195
28196
28197
28198
28199 GNULIB_STRDUP=1
28200
28201
28202
28203
28204
28205$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
28206
28207
28208
28209
28210
28211
28212
28213
5abebf3c
CB
28214
28215
6ec2e0f5
SDJ
28216 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
28217 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
28218$as_echo_n "checking for working strerror function... " >&6; }
d0ac1c44 28219if ${gl_cv_func_working_strerror+:} false; then :
6ec2e0f5
SDJ
28220 $as_echo_n "(cached) " >&6
28221else
28222 if test "$cross_compiling" = yes; then :
28223 case "$host_os" in
c0c3707f
CB
28224 # Guess yes on glibc systems.
28225 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
28226 # Guess yes on musl systems.
28227 *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
28228 # If we don't know, obey --enable-cross-guesses.
28229 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
6ec2e0f5
SDJ
28230 esac
28231
28232else
28233 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28234/* end confdefs.h. */
28235#include <string.h>
28236
28237int
28238main ()
28239{
28240if (!*strerror (-2)) return 1;
28241 ;
28242 return 0;
28243}
28244_ACEOF
28245if ac_fn_c_try_run "$LINENO"; then :
28246 gl_cv_func_working_strerror=yes
28247else
28248 gl_cv_func_working_strerror=no
28249fi
28250rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28251 conftest.$ac_objext conftest.beam conftest.$ac_ext
28252fi
28253
28254
28255fi
28256{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
28257$as_echo "$gl_cv_func_working_strerror" >&6; }
28258 case "$gl_cv_func_working_strerror" in
28259 *yes) ;;
28260 *)
28261 REPLACE_STRERROR=1
28262 ;;
28263 esac
28264
5abebf3c
CB
28265 case "$gl_cv_func_strerror_r_works" in
28266 *no) REPLACE_STRERROR=1 ;;
28267 esac
28268
6ec2e0f5
SDJ
28269 else
28270 REPLACE_STRERROR=1
28271 fi
28272
28273 if test $REPLACE_STRERROR = 1; then
28274
28275
28276
28277
28278
28279
28280
28281
28282 gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
28283
28284 fi
28285
28286
28287cat >>confdefs.h <<_ACEOF
28288#define GNULIB_STRERROR 1
28289_ACEOF
28290
28291
28292
28293
28294
28295
28296
28297 GNULIB_STRERROR=1
28298
28299
28300
28301
28302
28303$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
28304
28305
28306
28307
28308
28309 if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
28310
28311
28312
28313
28314
28315
28316
28317
28318 gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
28319
28320
28321
28322
28323
28324 if test $ac_cv_header_sys_socket_h != yes; then
28325 for ac_header in winsock2.h
28326do :
28327 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
d0ac1c44 28328if test "x$ac_cv_header_winsock2_h" = xyes; then :
6ec2e0f5
SDJ
28329 cat >>confdefs.h <<_ACEOF
28330#define HAVE_WINSOCK2_H 1
28331_ACEOF
28332
28333fi
28334
28335done
28336
28337 fi
28338 if test "$ac_cv_header_winsock2_h" = yes; then
28339 HAVE_WINSOCK2_H=1
28340 UNISTD_H_HAVE_WINSOCK2_H=1
28341 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
28342 else
28343 HAVE_WINSOCK2_H=0
28344 fi
28345
28346
28347 fi
28348
28349
28350
28351
98399780 28352
5abebf3c 28353
5abebf3c 28354
c0c3707f
CB
28355 if test $ac_cv_have_decl_strerror_r = no; then
28356 HAVE_DECL_STRERROR_R=0
28357 fi
5abebf3c
CB
28358
28359 if test $ac_cv_func_strerror_r = yes; then
28360 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
28361 if test $gl_cv_func_strerror_r_posix_signature = yes; then
28362 case "$gl_cv_func_strerror_r_works" in
28363 *no) REPLACE_STRERROR_R=1 ;;
28364 esac
28365 else
28366 REPLACE_STRERROR_R=1
28367 fi
28368 else
28369 REPLACE_STRERROR_R=1
28370 fi
28371 fi
28372
5abebf3c
CB
28373 if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
28374
28375
28376
28377
28378
28379
28380
28381
28382 gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext"
28383
28384
28385
5abebf3c
CB
28386
28387
28388
c0c3707f 28389 fi
5abebf3c
CB
28390
28391
28392
28393
5abebf3c 28394
c0c3707f 28395 GNULIB_STRERROR_R=1
5abebf3c
CB
28396
28397
28398
28399
5abebf3c 28400
c0c3707f 28401$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
5abebf3c
CB
28402
28403
28404
28405
5abebf3c 28406
c0c3707f
CB
28407cat >>confdefs.h <<_ACEOF
28408#define GNULIB_STRERROR_R_POSIX 1
28409_ACEOF
5abebf3c
CB
28410
28411
28412
28413
28414
28415
28416
698be2d8
CB
28417
28418
28419
28420
28421 if test $ac_cv_have_decl_strnlen = no; then
28422 HAVE_DECL_STRNLEN=0
28423 else
28424
28425 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
28426$as_echo_n "checking for working strnlen... " >&6; }
28427if ${ac_cv_func_strnlen_working+:} false; then :
28428 $as_echo_n "(cached) " >&6
28429else
28430 if test "$cross_compiling" = yes; then :
28431 # Guess no on AIX systems, yes otherwise.
28432 case "$host_os" in
28433 aix*) ac_cv_func_strnlen_working=no;;
28434 *) ac_cv_func_strnlen_working=yes;;
28435 esac
28436else
28437 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28438/* end confdefs.h. */
28439$ac_includes_default
28440int
28441main ()
28442{
28443
28444#define S "foobar"
28445#define S_LEN (sizeof S - 1)
28446
28447 /* At least one implementation is buggy: that of AIX 4.3 would
28448 give strnlen (S, 1) == 3. */
28449
28450 int i;
28451 for (i = 0; i < S_LEN + 1; ++i)
28452 {
28453 int expected = i <= S_LEN ? i : S_LEN;
28454 if (strnlen (S, i) != expected)
28455 return 1;
28456 }
28457 return 0;
28458
28459 ;
28460 return 0;
28461}
28462_ACEOF
28463if ac_fn_c_try_run "$LINENO"; then :
28464 ac_cv_func_strnlen_working=yes
28465else
28466 ac_cv_func_strnlen_working=no
28467fi
28468rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28469 conftest.$ac_objext conftest.beam conftest.$ac_ext
28470fi
28471
28472fi
28473{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5
28474$as_echo "$ac_cv_func_strnlen_working" >&6; }
28475test $ac_cv_func_strnlen_working = no && :
28476
28477
28478 if test $ac_cv_func_strnlen_working = no; then
28479 REPLACE_STRNLEN=1
28480 fi
28481 fi
28482
28483 if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
28484
28485
28486
28487
28488
28489
28490
28491
28492 gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
28493
28494 :
28495 fi
28496
28497
28498
28499
28500
28501 GNULIB_STRNLEN=1
28502
28503
28504
28505
28506
28507$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
28508
28509
28510
28511
28512
63ce7108
TT
28513 if test $REPLACE_STRSTR = 0; then
28514 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
28515$as_echo_n "checking whether strstr works in linear time... " >&6; }
d0ac1c44 28516if ${gl_cv_func_strstr_linear+:} false; then :
63ce7108
TT
28517 $as_echo_n "(cached) " >&6
28518else
28519 if test "$cross_compiling" = yes; then :
28520 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28521/* end confdefs.h. */
28522
28523#include <features.h>
28524#ifdef __GNU_LIBRARY__
28525 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
28526 && !(defined __i386__ || defined __x86_64__) \
28527 && !defined __UCLIBC__
28528 Lucky user
28529 #endif
28530#endif
28531#ifdef __CYGWIN__
28532 #include <cygwin/version.h>
28533 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
28534 Lucky user
28535 #endif
28536#endif
28537
28538_ACEOF
28539if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28540 $EGREP "Lucky user" >/dev/null 2>&1; then :
28541 gl_cv_func_strstr_linear="guessing yes"
c971b7fa 28542else
c0c3707f 28543 gl_cv_func_strstr_linear="$gl_cross_guess_normal"
c971b7fa
PA
28544fi
28545rm -f conftest*
28546
28547
28548else
28549 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28550/* end confdefs.h. */
28551
49e4877c
PA
28552#ifdef __MVS__
28553/* z/OS does not deliver signals while strstr() is running (thanks to
28554 restrictions on its LE runtime), which prevents us from limiting the
28555 running time of this test. */
28556# error "This test does not work properly on z/OS"
28557#endif
c971b7fa 28558#include <signal.h> /* for signal */
63ce7108 28559#include <string.h> /* for strstr */
c971b7fa
PA
28560#include <stdlib.h> /* for malloc */
28561#include <unistd.h> /* for alarm */
49e4877c 28562static void quit (int sig) { _exit (sig + 128); }
c971b7fa
PA
28563
28564int
28565main ()
28566{
28567
28568 int result = 0;
28569 size_t m = 1000000;
63ce7108
TT
28570 char *haystack = (char *) malloc (2 * m + 2);
28571 char *needle = (char *) malloc (m + 2);
c971b7fa 28572 /* Failure to compile this test due to missing alarm is okay,
63ce7108 28573 since all such platforms (mingw) also have quadratic strstr. */
c971b7fa
PA
28574 signal (SIGALRM, quit);
28575 alarm (5);
28576 /* Check for quadratic performance. */
28577 if (haystack && needle)
28578 {
28579 memset (haystack, 'A', 2 * m);
28580 haystack[2 * m] = 'B';
63ce7108 28581 haystack[2 * m + 1] = 0;
c971b7fa
PA
28582 memset (needle, 'A', m);
28583 needle[m] = 'B';
63ce7108
TT
28584 needle[m + 1] = 0;
28585 if (!strstr (haystack, needle))
c971b7fa
PA
28586 result |= 1;
28587 }
c0c3707f
CB
28588 /* Free allocated memory, in case some sanitizer is watching. */
28589 free (haystack);
28590 free (needle);
c971b7fa
PA
28591 return result;
28592
28593 ;
28594 return 0;
28595}
28596_ACEOF
28597if ac_fn_c_try_run "$LINENO"; then :
63ce7108 28598 gl_cv_func_strstr_linear=yes
c971b7fa 28599else
63ce7108 28600 gl_cv_func_strstr_linear=no
c971b7fa
PA
28601fi
28602rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28603 conftest.$ac_objext conftest.beam conftest.$ac_ext
28604fi
28605
28606
28607fi
63ce7108
TT
28608{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
28609$as_echo "$gl_cv_func_strstr_linear" >&6; }
28610 case "$gl_cv_func_strstr_linear" in
40a73391
JK
28611 *yes) ;;
28612 *)
63ce7108 28613 REPLACE_STRSTR=1
40a73391
JK
28614 ;;
28615 esac
c971b7fa
PA
28616 fi
28617
63ce7108 28618 if test $REPLACE_STRSTR = 1; then
c971b7fa
PA
28619
28620
28621
28622
28623
28624
28625
28626
63ce7108 28627 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
c971b7fa 28628
a512b375 28629 fi
c971b7fa
PA
28630
28631
28632
9c9d63b1 28633 if test $REPLACE_MEMCHR = 1; then
63ce7108 28634 REPLACE_STRSTR=1
c971b7fa 28635 else
c0c3707f 28636 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
63ce7108 28637$as_echo_n "checking whether strstr works... " >&6; }
d0ac1c44 28638if ${gl_cv_func_strstr_works_always+:} false; then :
c971b7fa
PA
28639 $as_echo_n "(cached) " >&6
28640else
28641 if test "$cross_compiling" = yes; then :
c0c3707f 28642 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
28643/* end confdefs.h. */
28644
28645#ifdef __GNU_LIBRARY__
28646 #include <features.h>
63ce7108 28647 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
c971b7fa
PA
28648 || defined __UCLIBC__
28649 Lucky user
28650 #endif
28651#elif defined __CYGWIN__
28652 #include <cygwin/version.h>
28653 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
28654 Lucky user
28655 #endif
28656#else
28657 Lucky user
28658#endif
28659
28660_ACEOF
28661if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28662 $EGREP "Lucky user" >/dev/null 2>&1; then :
63ce7108 28663 gl_cv_func_strstr_works_always="guessing yes"
c971b7fa 28664else
c0c3707f 28665 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
c971b7fa
PA
28666fi
28667rm -f conftest*
28668
28669
28670else
28671 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28672/* end confdefs.h. */
28673
63ce7108 28674#include <string.h> /* for strstr */
c0c3707f
CB
28675#ifdef __GNU_LIBRARY__
28676 #include <features.h>
28677 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
28678 Unlucky user
28679 #endif
28680#endif
c971b7fa
PA
28681#define P "_EF_BF_BD"
28682#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
28683#define NEEDLE P P P P P
28684
28685int
28686main ()
28687{
63ce7108 28688return !!strstr (HAYSTACK, NEEDLE);
c971b7fa
PA
28689
28690 ;
28691 return 0;
28692}
28693_ACEOF
28694if ac_fn_c_try_run "$LINENO"; then :
63ce7108 28695 gl_cv_func_strstr_works_always=yes
c971b7fa 28696else
63ce7108 28697 gl_cv_func_strstr_works_always=no
c971b7fa
PA
28698fi
28699rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28700 conftest.$ac_objext conftest.beam conftest.$ac_ext
28701fi
28702
28703
28704fi
63ce7108
TT
28705{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
28706$as_echo "$gl_cv_func_strstr_works_always" >&6; }
28707 case "$gl_cv_func_strstr_works_always" in
40a73391
JK
28708 *yes) ;;
28709 *)
63ce7108 28710 REPLACE_STRSTR=1
40a73391
JK
28711 ;;
28712 esac
c971b7fa 28713 fi
8839a007 28714
63ce7108 28715 if test $REPLACE_STRSTR = 1; then
8839a007 28716
8690e634
JK
28717
28718
8690e634
JK
28719
28720
28721
28722
28723
63ce7108 28724 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
8690e634 28725
8690e634
JK
28726 fi
28727
8690e634
JK
28728
28729
8690e634 28730
8690e634 28731
63ce7108 28732 GNULIB_STRSTR=1
8690e634
JK
28733
28734
28735
8690e634
JK
28736
28737
63ce7108 28738$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
8690e634
JK
28739
28740
28741
28742
28743
28744
28745
421693b0
PA
28746 for ac_func in strtok_r
28747do :
28748 ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r"
d0ac1c44 28749if test "x$ac_cv_func_strtok_r" = xyes; then :
421693b0
PA
28750 cat >>confdefs.h <<_ACEOF
28751#define HAVE_STRTOK_R 1
28752_ACEOF
28753
28754fi
28755done
28756
28757 if test $ac_cv_func_strtok_r = yes; then
28758 HAVE_STRTOK_R=1
28759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5
28760$as_echo_n "checking whether strtok_r works... " >&6; }
d0ac1c44 28761if ${gl_cv_func_strtok_r_works+:} false; then :
421693b0
PA
28762 $as_echo_n "(cached) " >&6
28763else
28764 if test "$cross_compiling" = yes; then :
c0c3707f
CB
28765 case "$host_os" in
28766 # Guess no on glibc systems.
28767 *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;;
28768 # Guess yes on native Windows.
28769 mingw*) gl_cv_func_strtok_r_works="guessing yes" ;;
28770 *) gl_cv_func_strtok_r_works="guessing yes" ;;
421693b0
PA
28771 esac
28772
28773else
28774 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28775/* end confdefs.h. */
28776
28777 #ifndef __OPTIMIZE__
28778 # define __OPTIMIZE__ 1
28779 #endif
28780 #undef __OPTIMIZE_SIZE__
28781 #undef __NO_INLINE__
28782 #include <stdlib.h>
28783 #include <string.h>
28784
28785int
28786main ()
28787{
28788static const char dummy[] = "\177\01a";
28789 char delimiters[] = "xxxxxxxx";
28790 char *save_ptr = (char *) dummy;
28791 strtok_r (delimiters, "x", &save_ptr);
28792 strtok_r (NULL, "x", &save_ptr);
28793 return 0;
28794
28795 ;
28796 return 0;
28797}
28798
28799_ACEOF
28800if ac_fn_c_try_run "$LINENO"; then :
28801 gl_cv_func_strtok_r_works=yes
28802else
28803 gl_cv_func_strtok_r_works=no
28804fi
28805rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28806 conftest.$ac_objext conftest.beam conftest.$ac_ext
28807fi
28808
28809
28810fi
28811{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5
28812$as_echo "$gl_cv_func_strtok_r_works" >&6; }
28813 case "$gl_cv_func_strtok_r_works" in
28814 *no)
28815 UNDEFINE_STRTOK_R=1
28816 ;;
28817 esac
28818 else
28819 HAVE_STRTOK_R=0
28820 fi
28821
28822 if test $ac_cv_have_decl_strtok_r = no; then
28823 HAVE_DECL_STRTOK_R=0
28824 fi
28825
28826 if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then
28827
28828
28829
28830
28831
28832
28833
28834
28835 gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext"
28836
28837
28838 :
28839
28840 fi
28841
28842
28843
28844
28845
28846 GNULIB_STRTOK_R=1
28847
28848
28849
28850
28851
28852$as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h
28853
28854
28855
28856
28857
28858
28859
8690e634
JK
28860
28861
28862
28863
28864
8690e634 28865
09607c9e 28866
698be2d8
CB
28867 if test $gl_cv_have_include_next = yes; then
28868 gl_cv_next_sys_random_h='<'sys/random.h'>'
28869 else
28870 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/random.h>" >&5
28871$as_echo_n "checking absolute name of <sys/random.h>... " >&6; }
28872if ${gl_cv_next_sys_random_h+:} false; then :
28873 $as_echo_n "(cached) " >&6
28874else
28875
28876 if test $ac_cv_header_sys_random_h = yes; then
28877
28878
28879
28880
28881 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28882/* end confdefs.h. */
28883#include <sys/random.h>
28884_ACEOF
28885 case "$host_os" in
28886 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28887 *) gl_absname_cpp="$ac_cpp" ;;
28888 esac
28889
28890 case "$host_os" in
28891 mingw*)
28892 gl_dirsep_regex='[/\\]'
28893 ;;
28894 *)
28895 gl_dirsep_regex='\/'
28896 ;;
28897 esac
28898 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28899 gl_header_literal_regex=`echo 'sys/random.h' \
28900 | sed -e "$gl_make_literal_regex_sed"`
28901 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28902 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28903 s|^/[^/]|//&|
28904 p
28905 q
28906 }'
28907
28908 gl_cv_absolute_sys_random_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28909 sed -n "$gl_absolute_header_sed"`
28910
28911 gl_header=$gl_cv_absolute_sys_random_h
28912 gl_cv_next_sys_random_h='"'$gl_header'"'
28913 else
28914 gl_cv_next_sys_random_h='<'sys/random.h'>'
28915 fi
28916
28917
28918fi
28919{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_random_h" >&5
28920$as_echo "$gl_cv_next_sys_random_h" >&6; }
28921 fi
28922 NEXT_SYS_RANDOM_H=$gl_cv_next_sys_random_h
28923
28924 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28925 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28926 gl_next_as_first_directive='<'sys/random.h'>'
28927 else
28928 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28929 gl_next_as_first_directive=$gl_cv_next_sys_random_h
28930 fi
28931 NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H=$gl_next_as_first_directive
28932
28933
28934
28935
28936 if test $ac_cv_header_sys_random_h = yes; then
28937 HAVE_SYS_RANDOM_H=1
28938 else
28939 HAVE_SYS_RANDOM_H=0
28940 fi
28941
28942
28943
28944 if test $ac_cv_header_sys_random_h = yes; then
28945 UNISTD_H_HAVE_SYS_RANDOM_H=1
28946 fi
28947
28948
28949
28950
28951
28952
28953
28954
28955
28956
28957
28958
28959
28960
28961
28962
28963
725e2999
JB
28964
28965
09607c9e
TT
28966
28967
28968
28969 if test $gl_cv_have_include_next = yes; then
28970 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
28971 else
28972 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
28973$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
d0ac1c44 28974if ${gl_cv_next_sys_stat_h+:} false; then :
09607c9e
TT
28975 $as_echo_n "(cached) " >&6
28976else
28977
28978 if test $ac_cv_header_sys_stat_h = yes; then
28979
28980
4a626d0a
PA
28981
28982
28983 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
09607c9e
TT
28984/* end confdefs.h. */
28985#include <sys/stat.h>
09607c9e 28986_ACEOF
4a626d0a
PA
28987 case "$host_os" in
28988 aix*) gl_absname_cpp="$ac_cpp -C" ;;
28989 *) gl_absname_cpp="$ac_cpp" ;;
28990 esac
28991
28992 case "$host_os" in
28993 mingw*)
28994 gl_dirsep_regex='[/\\]'
28995 ;;
28996 *)
28997 gl_dirsep_regex='\/'
28998 ;;
28999 esac
29000 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29001 gl_header_literal_regex=`echo 'sys/stat.h' \
29002 | sed -e "$gl_make_literal_regex_sed"`
29003 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29004 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29005 s|^/[^/]|//&|
29006 p
29007 q
29008 }'
29009
29010 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29011 sed -n "$gl_absolute_header_sed"`
29012
29013 gl_header=$gl_cv_absolute_sys_stat_h
29014 gl_cv_next_sys_stat_h='"'$gl_header'"'
09607c9e
TT
29015 else
29016 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
29017 fi
29018
29019
29020fi
29021{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
29022$as_echo "$gl_cv_next_sys_stat_h" >&6; }
29023 fi
29024 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
29025
29026 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29027 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29028 gl_next_as_first_directive='<'sys/stat.h'>'
29029 else
29030 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29031 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
29032 fi
29033 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
29034
29035
29036
29037
29038
29039
29040
29041
c0c3707f
CB
29042 WINDOWS_STAT_TIMESPEC=0
29043
29044
2196f55f 29045
09607c9e
TT
29046
29047
09607c9e 29048
09607c9e 29049
09607c9e
TT
29050
29051 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
29052 #include <sys/stat.h>
29053"
d0ac1c44 29054if test "x$ac_cv_type_nlink_t" = xyes; then :
09607c9e
TT
29055
29056else
29057
c0c3707f 29058$as_echo "#define nlink_t int" >>confdefs.h
09607c9e 29059
c0c3707f 29060fi
09607c9e
TT
29061
29062
29063
29064
29065
29066
29067
29068
29069
29070
725e2999
JB
29071
29072
29073
29074
29075
29076
725e2999
JB
29077
29078
29079
29080
29081
698be2d8
CB
29082
29083
725e2999
JB
29084
29085
29086
29087 if test $gl_cv_have_include_next = yes; then
29088 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
29089 else
29090 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
29091$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
29092if ${gl_cv_next_sys_uio_h+:} false; then :
29093 $as_echo_n "(cached) " >&6
29094else
29095
29096 if test $ac_cv_header_sys_uio_h = yes; then
29097
29098
29099
29100
29101 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29102/* end confdefs.h. */
29103#include <sys/uio.h>
29104_ACEOF
29105 case "$host_os" in
29106 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29107 *) gl_absname_cpp="$ac_cpp" ;;
29108 esac
29109
29110 case "$host_os" in
29111 mingw*)
29112 gl_dirsep_regex='[/\\]'
29113 ;;
29114 *)
29115 gl_dirsep_regex='\/'
29116 ;;
29117 esac
29118 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29119 gl_header_literal_regex=`echo 'sys/uio.h' \
29120 | sed -e "$gl_make_literal_regex_sed"`
29121 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29122 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29123 s|^/[^/]|//&|
29124 p
29125 q
29126 }'
29127
29128 gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29129 sed -n "$gl_absolute_header_sed"`
29130
29131 gl_header=$gl_cv_absolute_sys_uio_h
29132 gl_cv_next_sys_uio_h='"'$gl_header'"'
29133 else
29134 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
29135 fi
29136
29137
29138fi
29139{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
29140$as_echo "$gl_cv_next_sys_uio_h" >&6; }
29141 fi
29142 NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
29143
29144 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29145 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29146 gl_next_as_first_directive='<'sys/uio.h'>'
29147 else
29148 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29149 gl_next_as_first_directive=$gl_cv_next_sys_uio_h
29150 fi
29151 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
29152
29153
29154
29155
29156 if test $ac_cv_header_sys_uio_h = yes; then
29157 HAVE_SYS_UIO_H=1
29158 else
29159 HAVE_SYS_UIO_H=0
29160 fi
29161
29162
29163
29164
29165
2d8adcbd
MM
29166 :
29167
29168
29169
29170
9c9d63b1
PM
29171cat >>confdefs.h <<_ACEOF
29172#define GNULIB_TEMPNAME 1
29173_ACEOF
29174
29175
29176
29177
09607c9e
TT
29178
29179
29180
8839a007
PA
29181
29182
29183
29184
09607c9e 29185
c0c3707f
CB
29186 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,
29187 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29188 been included before. */
29189 #if defined __MINGW32__
29190 # include <unistd.h>
29191 #endif
29192 #include <time.h>
09607c9e 29193
f8e27d88
CB
29194"
29195if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
29196 ac_have_decl=1
29197else
29198 ac_have_decl=0
29199fi
29200
29201cat >>confdefs.h <<_ACEOF
29202#define HAVE_DECL_LOCALTIME_R $ac_have_decl
29203_ACEOF
29204
29205 if test $ac_cv_have_decl_localtime_r = no; then
29206 HAVE_DECL_LOCALTIME_R=0
29207 fi
29208
29209
f8e27d88
CB
29210 if test $ac_cv_func_localtime_r = yes; then
29211 HAVE_LOCALTIME_R=1
29212 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
29213$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
29214if ${gl_cv_time_r_posix+:} false; then :
29215 $as_echo_n "(cached) " >&6
29216else
29217 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29218/* end confdefs.h. */
c0c3707f
CB
29219/* mingw's <time.h> provides the functions asctime_r, ctime_r,
29220 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29221 been included before. */
29222 #if defined __MINGW32__
29223 # include <unistd.h>
29224 #endif
29225 #include <time.h>
29226
f8e27d88
CB
29227int
29228main ()
29229{
29230/* We don't need to append 'restrict's to the argument types,
29231 even though the POSIX signature has the 'restrict's,
29232 since C99 says they can't affect type compatibility. */
29233 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
29234 if (ptr) return 0;
29235 /* Check the return type is a pointer.
29236 On HP-UX 10 it is 'int'. */
29237 *localtime_r (0, 0);
29238 ;
29239 return 0;
29240}
29241
29242_ACEOF
29243if ac_fn_c_try_compile "$LINENO"; then :
29244 gl_cv_time_r_posix=yes
29245else
29246 gl_cv_time_r_posix=no
29247fi
29248rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29249
29250fi
29251{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
29252$as_echo "$gl_cv_time_r_posix" >&6; }
29253 if test $gl_cv_time_r_posix = yes; then
29254 REPLACE_LOCALTIME_R=0
29255 else
29256 REPLACE_LOCALTIME_R=1
29257 fi
29258 else
29259 HAVE_LOCALTIME_R=0
c0c3707f
CB
29260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5
29261$as_echo_n "checking whether localtime_r exists as an inline function... " >&6; }
29262if ${gl_cv_func_localtime_r_inline+:} false; then :
29263 $as_echo_n "(cached) " >&6
29264else
29265 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29266/* end confdefs.h. */
29267/* mingw's <time.h> provides the functions asctime_r, ctime_r,
29268 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
29269 been included before. */
29270 #if defined __MINGW32__
29271 # include <unistd.h>
29272 #endif
29273 #include <time.h>
29274
29275int
29276main ()
29277{
29278time_t a;
29279 struct tm r;
29280 localtime_r (&a, &r);
29281
29282 ;
29283 return 0;
29284}
29285
29286_ACEOF
29287if ac_fn_c_try_link "$LINENO"; then :
29288 gl_cv_func_localtime_r_inline=yes
29289else
29290 gl_cv_func_localtime_r_inline=no
29291fi
29292rm -f core conftest.err conftest.$ac_objext \
29293 conftest$ac_exeext conftest.$ac_ext
29294
29295fi
29296{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5
29297$as_echo "$gl_cv_func_localtime_r_inline" >&6; }
29298 if test $gl_cv_func_localtime_r_inline = yes; then
29299 REPLACE_LOCALTIME_R=1
29300 fi
f8e27d88
CB
29301 fi
29302
29303 if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
29304
29305
29306
29307
29308
29309
29310
29311
29312 gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
29313
29314
29315 :
29316
29317 fi
29318
29319
29320
29321
29322
29323 GNULIB_TIME_R=1
29324
29325
29326
29327
29328
29329$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
29330
29331
29332
29333
29334
29335
29336
29337
29338
5abebf3c
CB
29339
29340
29341
8839a007
PA
29342
29343
29344
29345 if test $gl_cv_have_include_next = yes; then
29346 gl_cv_next_unistd_h='<'unistd.h'>'
29347 else
29348 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
29349$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
d0ac1c44 29350if ${gl_cv_next_unistd_h+:} false; then :
8839a007
PA
29351 $as_echo_n "(cached) " >&6
29352else
29353
29354 if test $ac_cv_header_unistd_h = yes; then
29355
29356
4a626d0a
PA
29357
29358
29359 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8839a007
PA
29360/* end confdefs.h. */
29361#include <unistd.h>
8839a007 29362_ACEOF
4a626d0a
PA
29363 case "$host_os" in
29364 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29365 *) gl_absname_cpp="$ac_cpp" ;;
29366 esac
29367
29368 case "$host_os" in
29369 mingw*)
29370 gl_dirsep_regex='[/\\]'
29371 ;;
29372 *)
29373 gl_dirsep_regex='\/'
29374 ;;
29375 esac
29376 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29377 gl_header_literal_regex=`echo 'unistd.h' \
29378 | sed -e "$gl_make_literal_regex_sed"`
29379 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29380 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29381 s|^/[^/]|//&|
29382 p
29383 q
29384 }'
29385
29386 gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29387 sed -n "$gl_absolute_header_sed"`
29388
29389 gl_header=$gl_cv_absolute_unistd_h
29390 gl_cv_next_unistd_h='"'$gl_header'"'
8839a007
PA
29391 else
29392 gl_cv_next_unistd_h='<'unistd.h'>'
29393 fi
29394
29395
29396fi
29397{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
29398$as_echo "$gl_cv_next_unistd_h" >&6; }
29399 fi
29400 NEXT_UNISTD_H=$gl_cv_next_unistd_h
29401
29402 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29403 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29404 gl_next_as_first_directive='<'unistd.h'>'
29405 else
29406 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29407 gl_next_as_first_directive=$gl_cv_next_unistd_h
29408 fi
29409 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
29410
29411
29412
29413
29414 if test $ac_cv_header_unistd_h = yes; then
29415 HAVE_UNISTD_H=1
29416 else
29417 HAVE_UNISTD_H=0
29418 fi
29419
29420
29421
29422
29423
29424
29425
472fa5ee
SM
29426
29427
29428
29429
29430
8839a007 29431
9c9d63b1
PM
29432 if test $ac_cv_have_decl_execvpe = no; then
29433 HAVE_DECL_EXECVPE=0
29434 fi
29435
29436
6ec2e0f5
SDJ
29437
29438
29439
698be2d8
CB
29440
29441
3d99e817
AK
29442 if test $ac_cv_have_decl_unsetenv = no; then
29443 HAVE_DECL_UNSETENV=0
29444 fi
29445 for ac_func in unsetenv
29446do :
29447 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
d0ac1c44 29448if test "x$ac_cv_func_unsetenv" = xyes; then :
3d99e817
AK
29449 cat >>confdefs.h <<_ACEOF
29450#define HAVE_UNSETENV 1
29451_ACEOF
29452
29453fi
29454done
29455
29456 if test $ac_cv_func_unsetenv = no; then
29457 HAVE_UNSETENV=0
29458 else
29459 HAVE_UNSETENV=1
29460 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
29461$as_echo_n "checking for unsetenv() return type... " >&6; }
d0ac1c44 29462if ${gt_cv_func_unsetenv_ret+:} false; then :
3d99e817
AK
29463 $as_echo_n "(cached) " >&6
29464else
29465 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29466/* end confdefs.h. */
29467
29468#undef _BSD
29469#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
29470#include <stdlib.h>
29471extern
29472#ifdef __cplusplus
29473"C"
29474#endif
29475int unsetenv (const char *name);
29476
29477int
29478main ()
29479{
29480
29481 ;
29482 return 0;
29483}
29484_ACEOF
29485if ac_fn_c_try_compile "$LINENO"; then :
29486 gt_cv_func_unsetenv_ret='int'
29487else
29488 gt_cv_func_unsetenv_ret='void'
29489fi
29490rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29491fi
29492{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
29493$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
29494 if test $gt_cv_func_unsetenv_ret = 'void'; then
29495
29496$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
29497
29498 REPLACE_UNSETENV=1
29499 fi
29500
29501 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
29502$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
d0ac1c44 29503if ${gl_cv_func_unsetenv_works+:} false; then :
3d99e817
AK
29504 $as_echo_n "(cached) " >&6
29505else
29506 if test "$cross_compiling" = yes; then :
29507 case "$host_os" in
9c9d63b1
PM
29508 # Guess yes on glibc systems.
29509 *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
29510 # If we don't know, obey --enable-cross-guesses.
29511 *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
29512 esac
3d99e817
AK
29513
29514else
29515 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29516/* end confdefs.h. */
29517
9c9d63b1
PM
29518 #include <stdlib.h>
29519 #include <errno.h>
29520 extern char **environ;
29521
29522
29523$gl_mda_defines
3d99e817
AK
29524
29525int
29526main ()
29527{
29528
9c9d63b1
PM
29529 char entry1[] = "a=1";
29530 char entry2[] = "b=2";
29531 char *env[] = { entry1, entry2, NULL };
29532 if (putenv ((char *) "a=1")) return 1;
29533 if (putenv (entry2)) return 2;
29534 entry2[0] = 'a';
29535 unsetenv ("a");
29536 if (getenv ("a")) return 3;
29537 if (!unsetenv ("") || errno != EINVAL) return 4;
29538 entry2[0] = 'b';
29539 environ = env;
29540 if (!getenv ("a")) return 5;
29541 entry2[0] = 'a';
29542 unsetenv ("a");
29543 if (getenv ("a")) return 6;
3d99e817
AK
29544
29545 ;
29546 return 0;
29547}
29548_ACEOF
29549if ac_fn_c_try_run "$LINENO"; then :
29550 gl_cv_func_unsetenv_works=yes
29551else
29552 gl_cv_func_unsetenv_works=no
29553fi
29554rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29555 conftest.$ac_objext conftest.beam conftest.$ac_ext
29556fi
29557
9c9d63b1 29558
3d99e817
AK
29559fi
29560{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
29561$as_echo "$gl_cv_func_unsetenv_works" >&6; }
29562 case "$gl_cv_func_unsetenv_works" in
29563 *yes) ;;
29564 *)
29565 REPLACE_UNSETENV=1
29566 ;;
29567 esac
29568 fi
29569
29570 if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
29571
29572
29573
29574
29575
29576
29577
29578
29579 gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
29580
29581
29582
29583
29584
29585 fi
29586
29587
29588
29589
29590
29591 GNULIB_UNSETENV=1
29592
29593
29594
29595
29596
29597$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
29598
29599
29600
29601
29602
29603
8839a007
PA
29604
29605
29606
29607
29608
29609
29610
8690e634
JK
29611
29612
29613 if test $gl_cv_have_include_next = yes; then
29614 gl_cv_next_wchar_h='<'wchar.h'>'
29615 else
29616 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
29617$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
d0ac1c44 29618if ${gl_cv_next_wchar_h+:} false; then :
8690e634
JK
29619 $as_echo_n "(cached) " >&6
29620else
29621
29622 if test $ac_cv_header_wchar_h = yes; then
29623
29624
4a626d0a
PA
29625
29626
29627 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
29628/* end confdefs.h. */
29629#include <wchar.h>
8690e634 29630_ACEOF
4a626d0a
PA
29631 case "$host_os" in
29632 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29633 *) gl_absname_cpp="$ac_cpp" ;;
29634 esac
29635
29636 case "$host_os" in
29637 mingw*)
29638 gl_dirsep_regex='[/\\]'
29639 ;;
29640 *)
29641 gl_dirsep_regex='\/'
29642 ;;
29643 esac
29644 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29645 gl_header_literal_regex=`echo 'wchar.h' \
29646 | sed -e "$gl_make_literal_regex_sed"`
29647 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29648 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29649 s|^/[^/]|//&|
29650 p
29651 q
29652 }'
29653
29654 gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29655 sed -n "$gl_absolute_header_sed"`
29656
29657 gl_header=$gl_cv_absolute_wchar_h
29658 gl_cv_next_wchar_h='"'$gl_header'"'
8690e634
JK
29659 else
29660 gl_cv_next_wchar_h='<'wchar.h'>'
29661 fi
29662
29663
29664fi
29665{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
29666$as_echo "$gl_cv_next_wchar_h" >&6; }
29667 fi
29668 NEXT_WCHAR_H=$gl_cv_next_wchar_h
29669
29670 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29671 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
29672 gl_next_as_first_directive='<'wchar.h'>'
29673 else
29674 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
29675 gl_next_as_first_directive=$gl_cv_next_wchar_h
29676 fi
29677 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
29678
29679
29680
29681
29682 if test $ac_cv_header_wchar_h = yes; then
29683 HAVE_WCHAR_H=1
29684 else
29685 HAVE_WCHAR_H=0
29686 fi
29687
c971b7fa
PA
29688
29689
29690
29691
8690e634
JK
29692 if test $gt_cv_c_wint_t = yes; then
29693 HAVE_WINT_T=1
29694 else
29695 HAVE_WINT_T=0
29696 fi
c971b7fa
PA
29697
29698
29699
8690e634
JK
29700
29701
29702
29703
29704
472fa5ee
SM
29705
29706
9c9d63b1
PM
29707 ac_fn_c_check_decl "$LINENO" "wcsdup" "ac_cv_have_decl_wcsdup" "
29708 #include <wchar.h>
29709
29710"
29711if test "x$ac_cv_have_decl_wcsdup" = xyes; then :
29712 ac_have_decl=1
29713else
29714 ac_have_decl=0
29715fi
29716
29717cat >>confdefs.h <<_ACEOF
29718#define HAVE_DECL_WCSDUP $ac_have_decl
29719_ACEOF
29720
29721 if test $ac_cv_have_decl_wcsdup = no; then
29722 HAVE_DECL_WCSDUP=0
29723 fi
29724
472fa5ee
SM
29725
29726
29727
698be2d8
CB
29728
29729
8690e634
JK
29730 if test $ac_cv_func_iswcntrl = yes; then
29731 HAVE_ISWCNTRL=1
29732 else
29733 HAVE_ISWCNTRL=0
29734 fi
29735
29736
29737
8690e634
JK
29738 if test $gt_cv_c_wint_t = yes; then
29739 HAVE_WINT_T=1
29740 else
29741 HAVE_WINT_T=0
29742 fi
29743
29744
29745
29746
29747
29748
c971b7fa 29749
8690e634 29750
472fa5ee
SM
29751
29752
c971b7fa
PA
29753
29754
29755
29756 if test $gl_cv_have_include_next = yes; then
8690e634 29757 gl_cv_next_wctype_h='<'wctype.h'>'
c971b7fa 29758 else
8690e634
JK
29759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
29760$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
d0ac1c44 29761if ${gl_cv_next_wctype_h+:} false; then :
c971b7fa
PA
29762 $as_echo_n "(cached) " >&6
29763else
29764
8690e634
JK
29765 if test $ac_cv_header_wctype_h = yes; then
29766
29767
4a626d0a
PA
29768
29769
29770 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 29771/* end confdefs.h. */
8690e634 29772#include <wctype.h>
c971b7fa 29773_ACEOF
4a626d0a
PA
29774 case "$host_os" in
29775 aix*) gl_absname_cpp="$ac_cpp -C" ;;
29776 *) gl_absname_cpp="$ac_cpp" ;;
29777 esac
29778
29779 case "$host_os" in
29780 mingw*)
29781 gl_dirsep_regex='[/\\]'
29782 ;;
29783 *)
29784 gl_dirsep_regex='\/'
29785 ;;
29786 esac
29787 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
29788 gl_header_literal_regex=`echo 'wctype.h' \
29789 | sed -e "$gl_make_literal_regex_sed"`
29790 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
29791 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
29792 s|^/[^/]|//&|
29793 p
29794 q
29795 }'
29796
29797 gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
29798 sed -n "$gl_absolute_header_sed"`
29799
29800 gl_header=$gl_cv_absolute_wctype_h
29801 gl_cv_next_wctype_h='"'$gl_header'"'
8690e634
JK
29802 else
29803 gl_cv_next_wctype_h='<'wctype.h'>'
29804 fi
c971b7fa
PA
29805
29806
29807fi
8690e634
JK
29808{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
29809$as_echo "$gl_cv_next_wctype_h" >&6; }
c971b7fa 29810 fi
8690e634 29811 NEXT_WCTYPE_H=$gl_cv_next_wctype_h
c971b7fa
PA
29812
29813 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
29814 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8690e634 29815 gl_next_as_first_directive='<'wctype.h'>'
c971b7fa
PA
29816 else
29817 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8690e634 29818 gl_next_as_first_directive=$gl_cv_next_wctype_h
c971b7fa 29819 fi
8690e634
JK
29820 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
29821
29822
29823
29824
29825 if test $ac_cv_header_wctype_h = yes; then
29826 if test $ac_cv_func_iswcntrl = yes; then
29827 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
29828$as_echo_n "checking whether iswcntrl works... " >&6; }
d0ac1c44 29829if ${gl_cv_func_iswcntrl_works+:} false; then :
8690e634
JK
29830 $as_echo_n "(cached) " >&6
29831else
29832
29833 if test "$cross_compiling" = yes; then :
c0c3707f 29834 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
29835/* end confdefs.h. */
29836#include <stdlib.h>
29837 #if __GNU_LIBRARY__ == 1
29838 Linux libc5 i18n is broken.
29839 #endif
29840int
29841main ()
29842{
29843
29844 ;
29845 return 0;
29846}
29847_ACEOF
29848if ac_fn_c_try_compile "$LINENO"; then :
29849 gl_cv_func_iswcntrl_works="guessing yes"
29850else
29851 gl_cv_func_iswcntrl_works="guessing no"
29852fi
29853rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29854
29855else
29856 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29857/* end confdefs.h. */
29858
8690e634
JK
29859 #include <wchar.h>
29860 #include <wctype.h>
29861 int main () { return iswprint ('x') == 0; }
29862
29863_ACEOF
29864if ac_fn_c_try_run "$LINENO"; then :
29865 gl_cv_func_iswcntrl_works=yes
29866else
29867 gl_cv_func_iswcntrl_works=no
29868fi
29869rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29870 conftest.$ac_objext conftest.beam conftest.$ac_ext
29871fi
29872
29873
29874fi
29875{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
29876$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
29877 fi
29878 HAVE_WCTYPE_H=1
29879 else
29880 HAVE_WCTYPE_H=0
29881 fi
29882
29883
c0c3707f
CB
29884 if test $GNULIB_OVERRIDES_WINT_T = 1; then
29885 REPLACE_ISWCNTRL=1
29886 else
29887 case "$gl_cv_func_iswcntrl_works" in
29888 *yes) REPLACE_ISWCNTRL=0 ;;
29889 *) REPLACE_ISWCNTRL=1 ;;
29890 esac
29891 fi
8690e634
JK
29892
29893
29894 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
29895 :
29896 fi
29897
29898 if test $REPLACE_ISWCNTRL = 1; then
29899 REPLACE_TOWLOWER=1
29900 else
29901 for ac_func in towlower
29902do :
29903 ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
d0ac1c44 29904if test "x$ac_cv_func_towlower" = xyes; then :
8690e634
JK
29905 cat >>confdefs.h <<_ACEOF
29906#define HAVE_TOWLOWER 1
29907_ACEOF
29908
29909fi
29910done
29911
29912 if test $ac_cv_func_towlower = yes; then
29913 REPLACE_TOWLOWER=0
29914 else
9c9d63b1 29915 ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include <wchar.h>
8690e634
JK
29916 #if HAVE_WCTYPE_H
29917 # include <wctype.h>
29918 #endif
29919
29920"
d0ac1c44 29921if test "x$ac_cv_have_decl_towlower" = xyes; then :
8690e634
JK
29922 ac_have_decl=1
29923else
29924 ac_have_decl=0
29925fi
29926
29927cat >>confdefs.h <<_ACEOF
29928#define HAVE_DECL_TOWLOWER $ac_have_decl
29929_ACEOF
29930
29931 if test $ac_cv_have_decl_towlower = yes; then
29932 REPLACE_TOWLOWER=1
29933 else
29934 REPLACE_TOWLOWER=0
29935 fi
29936 fi
29937 fi
29938
29939
29940 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
29941 :
29942 fi
29943
29944 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
29945$as_echo_n "checking for wctype_t... " >&6; }
d0ac1c44 29946if ${gl_cv_type_wctype_t+:} false; then :
8690e634
JK
29947 $as_echo_n "(cached) " >&6
29948else
29949 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29950/* end confdefs.h. */
9c9d63b1 29951#include <wchar.h>
8690e634
JK
29952 #if HAVE_WCTYPE_H
29953 # include <wctype.h>
29954 #endif
29955 wctype_t a;
29956
29957int
29958main ()
29959{
29960
29961 ;
29962 return 0;
29963}
29964_ACEOF
29965if ac_fn_c_try_compile "$LINENO"; then :
29966 gl_cv_type_wctype_t=yes
29967else
29968 gl_cv_type_wctype_t=no
29969fi
29970rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 29971
8690e634
JK
29972fi
29973{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
29974$as_echo "$gl_cv_type_wctype_t" >&6; }
29975 if test $gl_cv_type_wctype_t = no; then
29976 HAVE_WCTYPE_T=0
29977 fi
29978
29979 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
29980$as_echo_n "checking for wctrans_t... " >&6; }
d0ac1c44 29981if ${gl_cv_type_wctrans_t+:} false; then :
8690e634
JK
29982 $as_echo_n "(cached) " >&6
29983else
29984 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29985/* end confdefs.h. */
9c9d63b1 29986#include <wchar.h>
8690e634
JK
29987 #include <wctype.h>
29988 wctrans_t a;
c971b7fa 29989
8690e634
JK
29990int
29991main ()
29992{
c971b7fa 29993
8690e634
JK
29994 ;
29995 return 0;
29996}
29997_ACEOF
29998if ac_fn_c_try_compile "$LINENO"; then :
29999 gl_cv_type_wctrans_t=yes
30000else
30001 gl_cv_type_wctrans_t=no
30002fi
30003rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 30004
8690e634
JK
30005fi
30006{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
30007$as_echo "$gl_cv_type_wctrans_t" >&6; }
30008 if test $gl_cv_type_wctrans_t = no; then
30009 HAVE_WCTRANS_T=0
c971b7fa
PA
30010 fi
30011
30012
5e8754f9 30013
5e8754f9 30014
c971b7fa 30015
c0c3707f
CB
30016
30017 case "$host_os" in
30018 mingw*)
30019
30020
30021
30022
30023
30024
30025
30026
30027 gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext"
30028
30029 ;;
30030 esac
30031
30032 case "$host_os" in
30033 mingw*)
30034
30035
30036
30037
30038
30039
30040
30041
30042 gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext"
30043
30044 ;;
30045 esac
30046
30047 case "$host_os" in
30048 mingw*)
30049
30050
c971b7fa
PA
30051
30052
c0c3707f
CB
30053
30054
30055
30056
30057 gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext"
30058
30059 ;;
30060 esac
30061
30062 case "$host_os" in
30063 mingw*)
30064
30065
30066
30067
30068
30069
30070
30071
30072 gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext"
30073
30074 ;;
30075 esac
698be2d8
CB
30076
30077
30078 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wmemchr" >&5
30079$as_echo_n "checking for wmemchr... " >&6; }
30080if ${gl_cv_func_wmemchr+:} false; then :
30081 $as_echo_n "(cached) " >&6
30082else
30083 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30084/* end confdefs.h. */
698be2d8
CB
30085#include <wchar.h>
30086
30087int
30088main ()
30089{
30090return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0);
30091 ;
30092 return 0;
30093}
30094
30095_ACEOF
30096if ac_fn_c_try_link "$LINENO"; then :
30097 gl_cv_func_wmemchr=yes
30098else
30099 gl_cv_func_wmemchr=no
30100fi
30101rm -f core conftest.err conftest.$ac_objext \
30102 conftest$ac_exeext conftest.$ac_ext
30103
30104fi
30105{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wmemchr" >&5
30106$as_echo "$gl_cv_func_wmemchr" >&6; }
30107 if test $gl_cv_func_wmemchr = no; then
30108 HAVE_WMEMCHR=0
30109 fi
30110
30111 if test $HAVE_WMEMCHR = 0; then
30112
30113
30114
30115
30116
30117
30118
30119
30120 gl_LIBOBJS="$gl_LIBOBJS wmemchr.$ac_objext"
30121
30122 fi
30123
30124
30125
30126
30127
30128 GNULIB_WMEMCHR=1
30129
30130
30131
30132
30133
30134$as_echo "#define GNULIB_TEST_WMEMCHR 1" >>confdefs.h
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146 if test $ac_cv_func_wmempcpy = no; then
30147 HAVE_WMEMPCPY=0
30148 fi
30149
30150 if test $HAVE_WMEMPCPY = 0; then
30151
30152
30153
30154
30155
30156
30157
30158
30159 gl_LIBOBJS="$gl_LIBOBJS wmempcpy.$ac_objext"
30160
30161 fi
30162
30163
30164
30165
30166
30167 GNULIB_WMEMPCPY=1
30168
30169
30170
30171
30172
30173$as_echo "#define GNULIB_TEST_WMEMPCPY 1" >>confdefs.h
30174
30175
30176
c971b7fa
PA
30177 # End of code from modules
30178
30179
30180
30181
30182
30183
30184
30185
30186
30187 gltests_libdeps=
30188 gltests_ltlibdeps=
30189
30190
30191
30192
30193
30194
30195
30196
30197
5df4cba6 30198
c971b7fa
PA
30199 gl_source_base='tests'
30200 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
30201
30202 gl_module_indicator_condition=$gltests_WITNESS
30203
30204
30205
30206
30207
30208
30209
30210
30211
30212 LIBGNU_LIBDEPS="$gl_libdeps"
30213
30214 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
30215
30216
30217
d0ac1c44 30218am__api_version='1.15'
c971b7fa
PA
30219
30220# Find a good install program. We prefer a C program (faster),
30221# so one script is as good as another. But avoid the broken or
30222# incompatible versions:
30223# SysV /etc/install, /usr/sbin/install
30224# SunOS /usr/etc/install
30225# IRIX /sbin/install
30226# AIX /bin/install
30227# AmigaOS /C/install, which installs bootblocks on floppy discs
30228# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
30229# AFS /usr/afsws/bin/install, which mishandles nonexistent args
30230# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
30231# OS/2's system install, which has a completely different semantic
30232# ./install, which can be erroneously created by make from ./install.sh.
30233# Reject install programs that cannot install multiple files.
30234{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
30235$as_echo_n "checking for a BSD-compatible install... " >&6; }
30236if test -z "$INSTALL"; then
d0ac1c44 30237if ${ac_cv_path_install+:} false; then :
c971b7fa
PA
30238 $as_echo_n "(cached) " >&6
30239else
30240 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30241for as_dir in $PATH
30242do
30243 IFS=$as_save_IFS
30244 test -z "$as_dir" && as_dir=.
30245 # Account for people who put trailing slashes in PATH elements.
30246case $as_dir/ in #((
30247 ./ | .// | /[cC]/* | \
30248 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
30249 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
30250 /usr/ucb/* ) ;;
30251 *)
30252 # OSF1 and SCO ODT 3.0 have their own names for install.
30253 # Don't use installbsd from OSF since it installs stuff as root
30254 # by default.
30255 for ac_prog in ginstall scoinst install; do
30256 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30257 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
c971b7fa
PA
30258 if test $ac_prog = install &&
30259 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
30260 # AIX install. It has an incompatible calling convention.
30261 :
30262 elif test $ac_prog = install &&
30263 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
30264 # program-specific install script used by HP pwplus--don't use.
30265 :
30266 else
30267 rm -rf conftest.one conftest.two conftest.dir
30268 echo one > conftest.one
30269 echo two > conftest.two
30270 mkdir conftest.dir
30271 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
30272 test -s conftest.one && test -s conftest.two &&
30273 test -s conftest.dir/conftest.one &&
30274 test -s conftest.dir/conftest.two
30275 then
30276 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
30277 break 3
30278 fi
30279 fi
30280 fi
30281 done
30282 done
30283 ;;
30284esac
30285
30286 done
30287IFS=$as_save_IFS
30288
30289rm -rf conftest.one conftest.two conftest.dir
30290
30291fi
30292 if test "${ac_cv_path_install+set}" = set; then
30293 INSTALL=$ac_cv_path_install
30294 else
30295 # As a last resort, use the slow shell script. Don't cache a
30296 # value for INSTALL within a source directory, because that will
30297 # break other packages using the cache if that directory is
30298 # removed, or if the value is a relative name.
30299 INSTALL=$ac_install_sh
30300 fi
30301fi
30302{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
30303$as_echo "$INSTALL" >&6; }
30304
30305# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
30306# It thinks the first close brace ends the variable substitution.
30307test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
30308
30309test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
30310
30311test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
30312
30313{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
30314$as_echo_n "checking whether build environment is sane... " >&6; }
c971b7fa
PA
30315# Reject unsafe characters in $srcdir or the absolute working directory
30316# name. Accept space and tab only in the latter.
30317am_lf='
30318'
30319case `pwd` in
30320 *[\\\"\#\$\&\'\`$am_lf]*)
d0ac1c44 30321 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
c971b7fa
PA
30322esac
30323case $srcdir in
30324 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
d0ac1c44 30325 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
c971b7fa
PA
30326esac
30327
d0ac1c44 30328# Do 'set' in a subshell so we don't clobber the current shell's
c971b7fa
PA
30329# arguments. Must try -L first in case configure is actually a
30330# symlink; some systems play weird games with the mod time of symlinks
30331# (eg FreeBSD returns the mod time of the symlink's containing
30332# directory).
30333if (
d0ac1c44
SM
30334 am_has_slept=no
30335 for am_try in 1 2; do
30336 echo "timestamp, slept: $am_has_slept" > conftest.file
30337 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
30338 if test "$*" = "X"; then
30339 # -L didn't work.
30340 set X `ls -t "$srcdir/configure" conftest.file`
30341 fi
30342 if test "$*" != "X $srcdir/configure conftest.file" \
30343 && test "$*" != "X conftest.file $srcdir/configure"; then
30344
30345 # If neither matched, then we have a broken ls. This can happen
30346 # if, for instance, CONFIG_SHELL is bash and it inherits a
30347 # broken ls alias from the environment. This has actually
30348 # happened. Such a system could not be considered "sane".
30349 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
30350 alias in your environment" "$LINENO" 5
30351 fi
30352 if test "$2" = conftest.file || test $am_try -eq 2; then
30353 break
30354 fi
30355 # Just in case.
30356 sleep 1
30357 am_has_slept=yes
30358 done
c971b7fa
PA
30359 test "$2" = conftest.file
30360 )
30361then
30362 # Ok.
30363 :
30364else
d0ac1c44 30365 as_fn_error $? "newly created file is older than distributed files!
c971b7fa
PA
30366Check your system clock" "$LINENO" 5
30367fi
30368{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30369$as_echo "yes" >&6; }
d0ac1c44
SM
30370# If we didn't sleep, we still need to ensure time stamps of config.status and
30371# generated files are strictly newer.
30372am_sleep_pid=
30373if grep 'slept: no' conftest.file >/dev/null 2>&1; then
30374 ( sleep 1 ) &
30375 am_sleep_pid=$!
30376fi
30377
30378rm -f conftest.file
30379
c971b7fa
PA
30380test "$program_prefix" != NONE &&
30381 program_transform_name="s&^&$program_prefix&;$program_transform_name"
30382# Use a double $ so make ignores it.
30383test "$program_suffix" != NONE &&
30384 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
30385# Double any \ or $.
30386# By default was `s,x,x', remove it if useless.
30387ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
30388program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
30389
c0c3707f
CB
30390# Expand $ac_aux_dir to an absolute path.
30391am_aux_dir=`cd "$ac_aux_dir" && pwd`
30392
c971b7fa
PA
30393if test x"${MISSING+set}" != xset; then
30394 case $am_aux_dir in
30395 *\ * | *\ *)
30396 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
30397 *)
30398 MISSING="\${SHELL} $am_aux_dir/missing" ;;
30399 esac
30400fi
30401# Use eval to expand $SHELL
d0ac1c44
SM
30402if eval "$MISSING --is-lightweight"; then
30403 am_missing_run="$MISSING "
c971b7fa
PA
30404else
30405 am_missing_run=
d0ac1c44
SM
30406 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
30407$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
c971b7fa
PA
30408fi
30409
d0ac1c44 30410if test x"${install_sh+set}" != xset; then
c971b7fa
PA
30411 case $am_aux_dir in
30412 *\ * | *\ *)
30413 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
30414 *)
30415 install_sh="\${SHELL} $am_aux_dir/install-sh"
30416 esac
30417fi
30418
d0ac1c44
SM
30419# Installed binaries are usually stripped using 'strip' when the user
30420# run "make install-strip". However 'strip' might not be the right
c971b7fa 30421# tool to use in cross-compilation environments, therefore Automake
d0ac1c44 30422# will honor the 'STRIP' environment variable to overrule this program.
c971b7fa
PA
30423if test "$cross_compiling" != no; then
30424 if test -n "$ac_tool_prefix"; then
30425 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
30426set dummy ${ac_tool_prefix}strip; ac_word=$2
30427{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30428$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30429if ${ac_cv_prog_STRIP+:} false; then :
c971b7fa
PA
30430 $as_echo_n "(cached) " >&6
30431else
30432 if test -n "$STRIP"; then
30433 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
30434else
30435as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30436for as_dir in $PATH
30437do
30438 IFS=$as_save_IFS
30439 test -z "$as_dir" && as_dir=.
30440 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30441 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30442 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
30443 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30444 break 2
30445 fi
30446done
30447 done
30448IFS=$as_save_IFS
30449
30450fi
30451fi
30452STRIP=$ac_cv_prog_STRIP
30453if test -n "$STRIP"; then
30454 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
30455$as_echo "$STRIP" >&6; }
30456else
30457 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30458$as_echo "no" >&6; }
30459fi
30460
30461
30462fi
30463if test -z "$ac_cv_prog_STRIP"; then
30464 ac_ct_STRIP=$STRIP
30465 # Extract the first word of "strip", so it can be a program name with args.
30466set dummy strip; ac_word=$2
30467{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30468$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30469if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
c971b7fa
PA
30470 $as_echo_n "(cached) " >&6
30471else
30472 if test -n "$ac_ct_STRIP"; then
30473 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
30474else
30475as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30476for as_dir in $PATH
30477do
30478 IFS=$as_save_IFS
30479 test -z "$as_dir" && as_dir=.
30480 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30481 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30482 ac_cv_prog_ac_ct_STRIP="strip"
30483 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30484 break 2
30485 fi
30486done
30487 done
30488IFS=$as_save_IFS
30489
30490fi
30491fi
30492ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
30493if test -n "$ac_ct_STRIP"; then
30494 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
30495$as_echo "$ac_ct_STRIP" >&6; }
30496else
30497 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30498$as_echo "no" >&6; }
30499fi
30500
30501 if test "x$ac_ct_STRIP" = x; then
30502 STRIP=":"
30503 else
30504 case $cross_compiling:$ac_tool_warned in
30505yes:)
30506{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
30507$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
30508ac_tool_warned=yes ;;
30509esac
30510 STRIP=$ac_ct_STRIP
30511 fi
30512else
30513 STRIP="$ac_cv_prog_STRIP"
30514fi
30515
30516fi
30517INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
30518
c971b7fa
PA
30519for ac_prog in gawk mawk nawk awk
30520do
30521 # Extract the first word of "$ac_prog", so it can be a program name with args.
30522set dummy $ac_prog; ac_word=$2
30523{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30524$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30525if ${ac_cv_prog_AWK+:} false; then :
c971b7fa
PA
30526 $as_echo_n "(cached) " >&6
30527else
30528 if test -n "$AWK"; then
30529 ac_cv_prog_AWK="$AWK" # Let the user override the test.
30530else
30531as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
30532for as_dir in $PATH
30533do
30534 IFS=$as_save_IFS
30535 test -z "$as_dir" && as_dir=.
30536 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 30537 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
30538 ac_cv_prog_AWK="$ac_prog"
30539 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
30540 break 2
30541 fi
30542done
30543 done
30544IFS=$as_save_IFS
30545
30546fi
30547fi
30548AWK=$ac_cv_prog_AWK
30549if test -n "$AWK"; then
30550 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
30551$as_echo "$AWK" >&6; }
30552else
30553 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30554$as_echo "no" >&6; }
30555fi
30556
30557
30558 test -n "$AWK" && break
30559done
30560
30561{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
30562$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
30563set x ${MAKE-make}
30564ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
d0ac1c44 30565if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
c971b7fa
PA
30566 $as_echo_n "(cached) " >&6
30567else
30568 cat >conftest.make <<\_ACEOF
30569SHELL = /bin/sh
30570all:
30571 @echo '@@@%%%=$(MAKE)=@@@%%%'
30572_ACEOF
d0ac1c44 30573# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
c971b7fa
PA
30574case `${MAKE-make} -f conftest.make 2>/dev/null` in
30575 *@@@%%%=?*=@@@%%%*)
30576 eval ac_cv_prog_make_${ac_make}_set=yes;;
30577 *)
30578 eval ac_cv_prog_make_${ac_make}_set=no;;
30579esac
30580rm -f conftest.make
30581fi
30582if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
30583 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30584$as_echo "yes" >&6; }
30585 SET_MAKE=
30586else
30587 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30588$as_echo "no" >&6; }
30589 SET_MAKE="MAKE=${MAKE-make}"
30590fi
30591
30592rm -rf .tst 2>/dev/null
30593mkdir .tst 2>/dev/null
30594if test -d .tst; then
30595 am__leading_dot=.
30596else
30597 am__leading_dot=_
30598fi
30599rmdir .tst 2>/dev/null
30600
30601DEPDIR="${am__leading_dot}deps"
30602
30603ac_config_commands="$ac_config_commands depfiles"
30604
30605
30606am_make=${MAKE-make}
30607cat > confinc << 'END'
30608am__doit:
30609 @echo this is the am__doit target
30610.PHONY: am__doit
30611END
30612# If we don't find an include directive, just comment out the code.
30613{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
30614$as_echo_n "checking for style of include used by $am_make... " >&6; }
30615am__include="#"
30616am__quote=
30617_am_result=none
30618# First try GNU make style include.
30619echo "include confinc" > confmf
d0ac1c44 30620# Ignore all kinds of additional output from 'make'.
c971b7fa
PA
30621case `$am_make -s -f confmf 2> /dev/null` in #(
30622*the\ am__doit\ target*)
30623 am__include=include
30624 am__quote=
30625 _am_result=GNU
30626 ;;
30627esac
30628# Now try BSD make style include.
30629if test "$am__include" = "#"; then
30630 echo '.include "confinc"' > confmf
30631 case `$am_make -s -f confmf 2> /dev/null` in #(
30632 *the\ am__doit\ target*)
30633 am__include=.include
30634 am__quote="\""
30635 _am_result=BSD
30636 ;;
30637 esac
30638fi
30639
30640
30641{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
30642$as_echo "$_am_result" >&6; }
30643rm -f confinc confmf
30644
30645# Check whether --enable-dependency-tracking was given.
30646if test "${enable_dependency_tracking+set}" = set; then :
30647 enableval=$enable_dependency_tracking;
30648fi
30649
30650if test "x$enable_dependency_tracking" != xno; then
30651 am_depcomp="$ac_aux_dir/depcomp"
30652 AMDEPBACKSLASH='\'
d0ac1c44 30653 am__nodep='_no'
c971b7fa
PA
30654fi
30655 if test "x$enable_dependency_tracking" != xno; then
30656 AMDEP_TRUE=
30657 AMDEP_FALSE='#'
30658else
30659 AMDEP_TRUE='#'
30660 AMDEP_FALSE=
30661fi
30662
30663
d0ac1c44
SM
30664# Check whether --enable-silent-rules was given.
30665if test "${enable_silent_rules+set}" = set; then :
30666 enableval=$enable_silent_rules;
30667fi
30668
30669case $enable_silent_rules in # (((
30670 yes) AM_DEFAULT_VERBOSITY=0;;
30671 no) AM_DEFAULT_VERBOSITY=1;;
30672 *) AM_DEFAULT_VERBOSITY=1;;
30673esac
30674am_make=${MAKE-make}
30675{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
30676$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
30677if ${am_cv_make_support_nested_variables+:} false; then :
30678 $as_echo_n "(cached) " >&6
30679else
30680 if $as_echo 'TRUE=$(BAR$(V))
30681BAR0=false
30682BAR1=true
30683V=1
30684am__doit:
30685 @$(TRUE)
30686.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
30687 am_cv_make_support_nested_variables=yes
30688else
30689 am_cv_make_support_nested_variables=no
30690fi
30691fi
30692{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
30693$as_echo "$am_cv_make_support_nested_variables" >&6; }
30694if test $am_cv_make_support_nested_variables = yes; then
30695 AM_V='$(V)'
30696 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
30697else
30698 AM_V=$AM_DEFAULT_VERBOSITY
30699 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
30700fi
30701AM_BACKSLASH='\'
30702
c971b7fa
PA
30703if test "`cd $srcdir && pwd`" != "`pwd`"; then
30704 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
30705 # is not polluted with repeated "-I."
30706 am__isrc=' -I$(srcdir)'
30707 # test to see if srcdir already configured
30708 if test -f $srcdir/config.status; then
d0ac1c44 30709 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
c971b7fa
PA
30710 fi
30711fi
30712
30713# test whether we have cygpath
30714if test -z "$CYGPATH_W"; then
30715 if (cygpath --version) >/dev/null 2>/dev/null; then
30716 CYGPATH_W='cygpath -w'
30717 else
30718 CYGPATH_W=echo
30719 fi
30720fi
30721
30722
30723# Define the identity of the package.
d0ac1c44
SM
30724 PACKAGE='libgnu'
30725 VERSION='UNUSED-VERSION'
c971b7fa
PA
30726
30727
30728# Some tools Automake needs.
30729
30730ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
30731
30732
30733AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
30734
30735
30736AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
30737
30738
30739AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
30740
30741
30742MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
30743
d0ac1c44
SM
30744# For better backward compatibility. To be removed once Automake 1.9.x
30745# dies out for good. For more background, see:
30746# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
30747# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
30748mkdir_p='$(MKDIR_P)'
30749
30750# We need awk for the "check" target (and possibly the TAP driver). The
30751# system "awk" is bad on some platforms.
30752# Always define AMTAR for backward compatibility. Yes, it's still used
30753# in the wild :-( We should find a proper way to deprecate it ...
30754AMTAR='$${TAR-tar}'
30755
30756
30757# We'll loop over all known methods to create a tar archive until one works.
30758_am_tools='gnutar pax cpio none'
c971b7fa 30759
d0ac1c44 30760am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
c971b7fa 30761
c971b7fa
PA
30762
30763
30764
30765
30766depcc="$CC" am_compiler_list=
30767
30768{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
30769$as_echo_n "checking dependency style of $depcc... " >&6; }
d0ac1c44 30770if ${am_cv_CC_dependencies_compiler_type+:} false; then :
c971b7fa
PA
30771 $as_echo_n "(cached) " >&6
30772else
30773 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
30774 # We make a subdir and do the tests there. Otherwise we can end up
30775 # making bogus files that we don't know about and never remove. For
30776 # instance it was reported that on HP-UX the gcc test will end up
d0ac1c44
SM
30777 # making a dummy file named 'D' -- because '-MD' means "put the output
30778 # in D".
30779 rm -rf conftest.dir
c971b7fa
PA
30780 mkdir conftest.dir
30781 # Copy depcomp to subdir because otherwise we won't find it if we're
30782 # using a relative directory.
30783 cp "$am_depcomp" conftest.dir
30784 cd conftest.dir
30785 # We will build objects and dependencies in a subdirectory because
30786 # it helps to detect inapplicable dependency modes. For instance
30787 # both Tru64's cc and ICC support -MD to output dependencies as a
30788 # side effect of compilation, but ICC will put the dependencies in
30789 # the current directory while Tru64 will put them in the object
30790 # directory.
30791 mkdir sub
30792
30793 am_cv_CC_dependencies_compiler_type=none
30794 if test "$am_compiler_list" = ""; then
30795 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
30796 fi
30797 am__universal=false
30798 case " $depcc " in #(
30799 *\ -arch\ *\ -arch\ *) am__universal=true ;;
30800 esac
30801
30802 for depmode in $am_compiler_list; do
30803 # Setup a source with many dependencies, because some compilers
30804 # like to wrap large dependency lists on column 80 (with \), and
30805 # we should not choose a depcomp mode which is confused by this.
30806 #
30807 # We need to recreate these files for each test, as the compiler may
30808 # overwrite some of them when testing with obscure command lines.
30809 # This happens at least with the AIX C compiler.
30810 : > sub/conftest.c
30811 for i in 1 2 3 4 5 6; do
30812 echo '#include "conftst'$i'.h"' >> sub/conftest.c
d0ac1c44
SM
30813 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
30814 # Solaris 10 /bin/sh.
30815 echo '/* dummy */' > sub/conftst$i.h
c971b7fa
PA
30816 done
30817 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
30818
d0ac1c44 30819 # We check with '-c' and '-o' for the sake of the "dashmstdout"
c971b7fa 30820 # mode. It turns out that the SunPro C++ compiler does not properly
d0ac1c44
SM
30821 # handle '-M -o', and we need to detect this. Also, some Intel
30822 # versions had trouble with output in subdirs.
c971b7fa
PA
30823 am__obj=sub/conftest.${OBJEXT-o}
30824 am__minus_obj="-o $am__obj"
30825 case $depmode in
30826 gcc)
30827 # This depmode causes a compiler race in universal mode.
30828 test "$am__universal" = false || continue
30829 ;;
30830 nosideeffect)
d0ac1c44
SM
30831 # After this tag, mechanisms are not by side-effect, so they'll
30832 # only be used when explicitly requested.
c971b7fa
PA
30833 if test "x$enable_dependency_tracking" = xyes; then
30834 continue
30835 else
30836 break
30837 fi
30838 ;;
d0ac1c44
SM
30839 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
30840 # This compiler won't grok '-c -o', but also, the minuso test has
c971b7fa
PA
30841 # not run yet. These depmodes are late enough in the game, and
30842 # so weak that their functioning should not be impacted.
30843 am__obj=conftest.${OBJEXT-o}
30844 am__minus_obj=
30845 ;;
30846 none) break ;;
30847 esac
30848 if depmode=$depmode \
30849 source=sub/conftest.c object=$am__obj \
30850 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
30851 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
30852 >/dev/null 2>conftest.err &&
30853 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
30854 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
30855 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
30856 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
30857 # icc doesn't choke on unknown options, it will just issue warnings
30858 # or remarks (even with -Werror). So we grep stderr for any message
30859 # that says an option was ignored or not supported.
30860 # When given -MP, icc 7.0 and 7.1 complain thusly:
30861 # icc: Command line warning: ignoring option '-M'; no argument required
30862 # The diagnosis changed in icc 8.0:
30863 # icc: Command line remark: option '-MP' not supported
30864 if (grep 'ignoring option' conftest.err ||
30865 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
30866 am_cv_CC_dependencies_compiler_type=$depmode
30867 break
30868 fi
30869 fi
30870 done
30871
30872 cd ..
30873 rm -rf conftest.dir
30874else
30875 am_cv_CC_dependencies_compiler_type=none
30876fi
30877
30878fi
30879{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
30880$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
30881CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
30882
30883 if
30884 test "x$enable_dependency_tracking" != xno \
30885 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
30886 am__fastdepCC_TRUE=
30887 am__fastdepCC_FALSE='#'
30888else
30889 am__fastdepCC_TRUE='#'
30890 am__fastdepCC_FALSE=
30891fi
30892
30893
30894
d0ac1c44
SM
30895# POSIX will say in a future version that running "rm -f" with no argument
30896# is OK; and we want to be able to make that assumption in our Makefile
30897# recipes. So use an aggressive probe to check that the usage we want is
30898# actually supported "in the wild" to an acceptable degree.
30899# See automake bug#10828.
30900# To make any issue more visible, cause the running configure to be aborted
30901# by default if the 'rm' program in use doesn't match our expectations; the
30902# user can still override this though.
30903if rm -f && rm -fr && rm -rf; then : OK; else
30904 cat >&2 <<'END'
30905Oops!
30906
30907Your 'rm' program seems unable to run without file operands specified
30908on the command line, even when the '-f' option is present. This is contrary
30909to the behaviour of most rm programs out there, and not conforming with
30910the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
30911
30912Please tell bug-automake@gnu.org about your system, including the value
30913of your $PATH and any error possibly output before this message. This
30914can help us improve future automake versions.
30915
30916END
30917 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
30918 echo 'Configuration will proceed anyway, since you have set the' >&2
30919 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
30920 echo >&2
30921 else
30922 cat >&2 <<'END'
30923Aborting the configuration process, to ensure you take notice of the issue.
30924
30925You can download and install GNU coreutils to get an 'rm' implementation
30926that behaves properly: <http://www.gnu.org/software/coreutils/>.
30927
30928If you want to complete the configuration process using your problematic
30929'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
30930to "yes", and re-run configure.
30931
30932END
30933 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
30934 fi
30935fi
30936
c971b7fa 30937
39be3c7e
SM
30938# Check whether --enable-silent-rules was given.
30939if test "${enable_silent_rules+set}" = set; then :
30940 enableval=$enable_silent_rules;
30941fi
30942
d0ac1c44
SM
30943case $enable_silent_rules in # (((
30944 yes) AM_DEFAULT_VERBOSITY=0;;
30945 no) AM_DEFAULT_VERBOSITY=1;;
30946 *) AM_DEFAULT_VERBOSITY=0;;
39be3c7e 30947esac
d0ac1c44
SM
30948am_make=${MAKE-make}
30949{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
30950$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
30951if ${am_cv_make_support_nested_variables+:} false; then :
30952 $as_echo_n "(cached) " >&6
30953else
30954 if $as_echo 'TRUE=$(BAR$(V))
30955BAR0=false
30956BAR1=true
30957V=1
30958am__doit:
30959 @$(TRUE)
30960.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
30961 am_cv_make_support_nested_variables=yes
30962else
30963 am_cv_make_support_nested_variables=no
30964fi
30965fi
30966{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
30967$as_echo "$am_cv_make_support_nested_variables" >&6; }
30968if test $am_cv_make_support_nested_variables = yes; then
30969 AM_V='$(V)'
30970 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
30971else
30972 AM_V=$AM_DEFAULT_VERBOSITY
30973 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
30974fi
39be3c7e
SM
30975AM_BACKSLASH='\'
30976
30977
c971b7fa
PA
30978# --------------------- #
30979# Checks for programs. #
30980# --------------------- #
30981
30982
30983{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
30984$as_echo_n "checking whether ln -s works... " >&6; }
30985LN_S=$as_ln_s
30986if test "$LN_S" = "ln -s"; then
30987 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30988$as_echo "yes" >&6; }
30989else
30990 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
30991$as_echo "no, using $LN_S" >&6; }
30992fi
30993
30994if test -n "$ac_tool_prefix"; then
30995 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
30996set dummy ${ac_tool_prefix}ranlib; ac_word=$2
30997{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30998$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 30999if ${ac_cv_prog_RANLIB+:} false; then :
c971b7fa
PA
31000 $as_echo_n "(cached) " >&6
31001else
31002 if test -n "$RANLIB"; then
31003 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
31004else
31005as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31006for as_dir in $PATH
31007do
31008 IFS=$as_save_IFS
31009 test -z "$as_dir" && as_dir=.
31010 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31011 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31012 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
31013 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31014 break 2
31015 fi
31016done
31017 done
31018IFS=$as_save_IFS
31019
31020fi
31021fi
31022RANLIB=$ac_cv_prog_RANLIB
31023if test -n "$RANLIB"; then
31024 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
31025$as_echo "$RANLIB" >&6; }
31026else
31027 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31028$as_echo "no" >&6; }
31029fi
31030
31031
31032fi
31033if test -z "$ac_cv_prog_RANLIB"; then
31034 ac_ct_RANLIB=$RANLIB
31035 # Extract the first word of "ranlib", so it can be a program name with args.
31036set dummy ranlib; ac_word=$2
31037{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31038$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31039if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
31040 $as_echo_n "(cached) " >&6
31041else
31042 if test -n "$ac_ct_RANLIB"; then
31043 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
31044else
31045as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31046for as_dir in $PATH
31047do
31048 IFS=$as_save_IFS
31049 test -z "$as_dir" && as_dir=.
31050 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31051 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31052 ac_cv_prog_ac_ct_RANLIB="ranlib"
31053 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31054 break 2
31055 fi
31056done
31057 done
31058IFS=$as_save_IFS
31059
31060fi
31061fi
31062ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
31063if test -n "$ac_ct_RANLIB"; then
31064 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
31065$as_echo "$ac_ct_RANLIB" >&6; }
31066else
31067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31068$as_echo "no" >&6; }
31069fi
31070
31071 if test "x$ac_ct_RANLIB" = x; then
31072 RANLIB=":"
31073 else
31074 case $cross_compiling:$ac_tool_warned in
31075yes:)
31076{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
31077$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
31078ac_tool_warned=yes ;;
31079esac
31080 RANLIB=$ac_ct_RANLIB
31081 fi
31082else
31083 RANLIB="$ac_cv_prog_RANLIB"
31084fi
31085
31086
31087if test -n "$ac_tool_prefix"; then
31088 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
31089set dummy ${ac_tool_prefix}ar; ac_word=$2
31090{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31091$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31092if ${ac_cv_prog_AR+:} false; then :
c971b7fa
PA
31093 $as_echo_n "(cached) " >&6
31094else
31095 if test -n "$AR"; then
31096 ac_cv_prog_AR="$AR" # Let the user override the test.
31097else
31098as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31099for as_dir in $PATH
31100do
31101 IFS=$as_save_IFS
31102 test -z "$as_dir" && as_dir=.
31103 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31104 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31105 ac_cv_prog_AR="${ac_tool_prefix}ar"
31106 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31107 break 2
31108 fi
31109done
31110 done
31111IFS=$as_save_IFS
31112
31113fi
31114fi
31115AR=$ac_cv_prog_AR
31116if test -n "$AR"; then
31117 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
31118$as_echo "$AR" >&6; }
31119else
31120 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31121$as_echo "no" >&6; }
31122fi
31123
31124
31125fi
31126if test -z "$ac_cv_prog_AR"; then
31127 ac_ct_AR=$AR
31128 # Extract the first word of "ar", so it can be a program name with args.
31129set dummy ar; ac_word=$2
31130{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31131$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 31132if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
31133 $as_echo_n "(cached) " >&6
31134else
31135 if test -n "$ac_ct_AR"; then
31136 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
31137else
31138as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31139for as_dir in $PATH
31140do
31141 IFS=$as_save_IFS
31142 test -z "$as_dir" && as_dir=.
31143 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 31144 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
31145 ac_cv_prog_ac_ct_AR="ar"
31146 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
31147 break 2
31148 fi
31149done
31150 done
31151IFS=$as_save_IFS
31152
31153fi
31154fi
31155ac_ct_AR=$ac_cv_prog_ac_ct_AR
31156if test -n "$ac_ct_AR"; then
31157 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
31158$as_echo "$ac_ct_AR" >&6; }
31159else
31160 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31161$as_echo "no" >&6; }
31162fi
31163
31164 if test "x$ac_ct_AR" = x; then
31165 AR=""
31166 else
31167 case $cross_compiling:$ac_tool_warned in
31168yes:)
31169{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
31170$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
31171ac_tool_warned=yes ;;
31172esac
31173 AR=$ac_ct_AR
31174 fi
31175else
31176 AR="$ac_cv_prog_AR"
31177fi
31178
31179
31180# ---------------------- #
31181# Checks for libraries. #
31182# ---------------------- #
31183
361cb219
AB
31184ac_config_files="$ac_config_files Makefile.gnulib.inc"
31185
31186
c971b7fa
PA
31187ac_config_files="$ac_config_files Makefile import/Makefile"
31188
31189ac_config_commands="$ac_config_commands default"
31190
31191cat >confcache <<\_ACEOF
31192# This file is a shell script that caches the results of configure
31193# tests run on this system so they can be shared between configure
31194# scripts and configure runs, see configure's option --config-cache.
31195# It is not useful on other systems. If it contains results you don't
31196# want to keep, you may remove or edit it.
31197#
31198# config.status only pays attention to the cache file if you give it
31199# the --recheck option to rerun configure.
31200#
31201# `ac_cv_env_foo' variables (set or unset) will be overridden when
31202# loading this file, other *unset* `ac_cv_foo' will be assigned the
31203# following values.
31204
31205_ACEOF
31206
31207# The following way of writing the cache mishandles newlines in values,
31208# but we know of no workaround that is simple, portable, and efficient.
31209# So, we kill variables containing newlines.
31210# Ultrix sh set writes to stderr and can't be redirected directly,
31211# and sets the high bit in the cache file unless we assign to the vars.
31212(
31213 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
31214 eval ac_val=\$$ac_var
31215 case $ac_val in #(
31216 *${as_nl}*)
31217 case $ac_var in #(
31218 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
31219$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
31220 esac
31221 case $ac_var in #(
31222 _ | IFS | as_nl) ;; #(
31223 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
31224 *) { eval $ac_var=; unset $ac_var;} ;;
31225 esac ;;
31226 esac
31227 done
31228
31229 (set) 2>&1 |
31230 case $as_nl`(ac_space=' '; set) 2>&1` in #(
31231 *${as_nl}ac_space=\ *)
31232 # `set' does not quote correctly, so add quotes: double-quote
31233 # substitution turns \\\\ into \\, and sed turns \\ into \.
31234 sed -n \
31235 "s/'/'\\\\''/g;
31236 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
31237 ;; #(
31238 *)
31239 # `set' quotes correctly as required by POSIX, so do not add quotes.
31240 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
31241 ;;
31242 esac |
31243 sort
31244) |
31245 sed '
31246 /^ac_cv_env_/b end
31247 t clear
31248 :clear
31249 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
31250 t end
31251 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
31252 :end' >>confcache
31253if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
31254 if test -w "$cache_file"; then
d0ac1c44 31255 if test "x$cache_file" != "x/dev/null"; then
c971b7fa
PA
31256 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
31257$as_echo "$as_me: updating cache $cache_file" >&6;}
d0ac1c44
SM
31258 if test ! -f "$cache_file" || test -h "$cache_file"; then
31259 cat confcache >"$cache_file"
31260 else
31261 case $cache_file in #(
31262 */* | ?:*)
31263 mv -f confcache "$cache_file"$$ &&
31264 mv -f "$cache_file"$$ "$cache_file" ;; #(
31265 *)
31266 mv -f confcache "$cache_file" ;;
31267 esac
31268 fi
31269 fi
c971b7fa
PA
31270 else
31271 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
31272$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
31273 fi
31274fi
31275rm -f confcache
31276
31277test "x$prefix" = xNONE && prefix=$ac_default_prefix
31278# Let make expand exec_prefix.
31279test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
31280
31281DEFS=-DHAVE_CONFIG_H
31282
31283ac_libobjs=
31284ac_ltlibobjs=
31285for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
31286 # 1. Remove the extension, and $U if already installed.
31287 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
31288 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
31289 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
31290 # will be set to the directory where LIBOBJS objects are built.
31291 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
31292 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
31293done
31294LIBOBJS=$ac_libobjs
31295
31296LTLIBOBJS=$ac_ltlibobjs
31297
31298
31299if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
d0ac1c44 31300 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
c971b7fa
PA
31301Usually this means the macro was only invoked conditionally." "$LINENO" 5
31302fi
31303if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
d0ac1c44 31304 as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
c971b7fa
PA
31305Usually this means the macro was only invoked conditionally." "$LINENO" 5
31306fi
8690e634 31307if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
d0ac1c44 31308 as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
8690e634
JK
31309Usually this means the macro was only invoked conditionally." "$LINENO" 5
31310fi
18848e28 31311if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
d0ac1c44 31312 as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
18848e28
GF
31313Usually this means the macro was only invoked conditionally." "$LINENO" 5
31314fi
88b48903 31315if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
d0ac1c44 31316 as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
88b48903
WN
31317Usually this means the macro was only invoked conditionally." "$LINENO" 5
31318fi
8690e634 31319if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
d0ac1c44 31320 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
8690e634
JK
31321Usually this means the macro was only invoked conditionally." "$LINENO" 5
31322fi
c0c3707f
CB
31323if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
31324 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
31325Usually this means the macro was only invoked conditionally." "$LINENO" 5
31326fi
31327if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
31328 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
31329Usually this means the macro was only invoked conditionally." "$LINENO" 5
31330fi
6ec2e0f5 31331if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
d0ac1c44 31332 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
6ec2e0f5
SDJ
31333Usually this means the macro was only invoked conditionally." "$LINENO" 5
31334fi
49e4877c 31335if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 31336 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
31337Usually this means the macro was only invoked conditionally." "$LINENO" 5
31338fi
31339if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 31340 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
31341Usually this means the macro was only invoked conditionally." "$LINENO" 5
31342fi
c971b7fa 31343if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
d0ac1c44 31344 as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
c971b7fa
PA
31345Usually this means the macro was only invoked conditionally." "$LINENO" 5
31346fi
88b48903
WN
31347
31348
5df4cba6
SM
31349if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
31350 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
31351Usually this means the macro was only invoked conditionally." "$LINENO" 5
31352fi
725e2999
JB
31353if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
31354 as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
31355Usually this means the macro was only invoked conditionally." "$LINENO" 5
31356fi
31357if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
31358 as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
31359Usually this means the macro was only invoked conditionally." "$LINENO" 5
31360fi
8690e634 31361if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
d0ac1c44 31362 as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
8690e634
JK
31363Usually this means the macro was only invoked conditionally." "$LINENO" 5
31364fi
c971b7fa 31365if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
d0ac1c44 31366 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
c971b7fa
PA
31367Usually this means the macro was only invoked conditionally." "$LINENO" 5
31368fi
31369
31370 gl_libobjs=
31371 gl_ltlibobjs=
31372 if test -n "$gl_LIBOBJS"; then
31373 # Remove the extension.
31374 sed_drop_objext='s/\.o$//;s/\.obj$//'
31375 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
31376 gl_libobjs="$gl_libobjs $i.$ac_objext"
31377 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
31378 done
31379 fi
31380 gl_LIBOBJS=$gl_libobjs
31381
31382 gl_LTLIBOBJS=$gl_ltlibobjs
31383
31384
31385
31386 gltests_libobjs=
31387 gltests_ltlibobjs=
31388 if test -n "$gltests_LIBOBJS"; then
31389 # Remove the extension.
31390 sed_drop_objext='s/\.o$//;s/\.obj$//'
31391 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
31392 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
31393 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
31394 done
31395 fi
31396 gltests_LIBOBJS=$gltests_libobjs
31397
31398 gltests_LTLIBOBJS=$gltests_ltlibobjs
31399
31400
d0ac1c44
SM
31401{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
31402$as_echo_n "checking that generated files are newer than configure... " >&6; }
31403 if test -n "$am_sleep_pid"; then
31404 # Hide warnings about reused PIDs.
31405 wait $am_sleep_pid 2>/dev/null
31406 fi
31407 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
31408$as_echo "done" >&6; }
c971b7fa 31409if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
d0ac1c44 31410 as_fn_error $? "conditional \"AMDEP\" was never defined.
c971b7fa
PA
31411Usually this means the macro was only invoked conditionally." "$LINENO" 5
31412fi
31413if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
d0ac1c44 31414 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
c971b7fa
PA
31415Usually this means the macro was only invoked conditionally." "$LINENO" 5
31416fi
31417 if test -n "$EXEEXT"; then
31418 am__EXEEXT_TRUE=
31419 am__EXEEXT_FALSE='#'
31420else
31421 am__EXEEXT_TRUE='#'
31422 am__EXEEXT_FALSE=
31423fi
31424
31425
d0ac1c44 31426: "${CONFIG_STATUS=./config.status}"
c971b7fa
PA
31427ac_write_fail=0
31428ac_clean_files_save=$ac_clean_files
31429ac_clean_files="$ac_clean_files $CONFIG_STATUS"
31430{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
31431$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
31432as_write_fail=0
31433cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
31434#! $SHELL
31435# Generated by $as_me.
31436# Run this file to recreate the current configuration.
31437# Compiler output produced by configure, useful for debugging
31438# configure, is in config.log if it exists.
31439
31440debug=false
31441ac_cs_recheck=false
31442ac_cs_silent=false
31443
31444SHELL=\${CONFIG_SHELL-$SHELL}
31445export SHELL
31446_ASEOF
31447cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
31448## -------------------- ##
31449## M4sh Initialization. ##
31450## -------------------- ##
31451
31452# Be more Bourne compatible
31453DUALCASE=1; export DUALCASE # for MKS sh
31454if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
31455 emulate sh
31456 NULLCMD=:
31457 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
31458 # is contrary to our usage. Disable this feature.
31459 alias -g '${1+"$@"}'='"$@"'
31460 setopt NO_GLOB_SUBST
31461else
31462 case `(set -o) 2>/dev/null` in #(
31463 *posix*) :
31464 set -o posix ;; #(
31465 *) :
31466 ;;
31467esac
31468fi
31469
31470
31471as_nl='
31472'
31473export as_nl
31474# Printing a long string crashes Solaris 7 /usr/bin/printf.
31475as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
31476as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
31477as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
31478# Prefer a ksh shell builtin over an external printf program on Solaris,
31479# but without wasting forks for bash or zsh.
31480if test -z "$BASH_VERSION$ZSH_VERSION" \
31481 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
31482 as_echo='print -r --'
31483 as_echo_n='print -rn --'
31484elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
31485 as_echo='printf %s\n'
31486 as_echo_n='printf %s'
31487else
31488 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
31489 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
31490 as_echo_n='/usr/ucb/echo -n'
31491 else
31492 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
31493 as_echo_n_body='eval
31494 arg=$1;
31495 case $arg in #(
31496 *"$as_nl"*)
31497 expr "X$arg" : "X\\(.*\\)$as_nl";
31498 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
31499 esac;
31500 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
31501 '
31502 export as_echo_n_body
31503 as_echo_n='sh -c $as_echo_n_body as_echo'
31504 fi
31505 export as_echo_body
31506 as_echo='sh -c $as_echo_body as_echo'
31507fi
31508
31509# The user is always right.
31510if test "${PATH_SEPARATOR+set}" != set; then
31511 PATH_SEPARATOR=:
31512 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
31513 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
31514 PATH_SEPARATOR=';'
31515 }
31516fi
31517
31518
31519# IFS
31520# We need space, tab and new line, in precisely that order. Quoting is
31521# there to prevent editors from complaining about space-tab.
31522# (If _AS_PATH_WALK were called with IFS unset, it would disable word
31523# splitting by setting IFS to empty value.)
31524IFS=" "" $as_nl"
31525
31526# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 31527as_myself=
c971b7fa
PA
31528case $0 in #((
31529 *[\\/]* ) as_myself=$0 ;;
31530 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31531for as_dir in $PATH
31532do
31533 IFS=$as_save_IFS
31534 test -z "$as_dir" && as_dir=.
31535 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
31536 done
31537IFS=$as_save_IFS
31538
31539 ;;
31540esac
31541# We did not find ourselves, most probably we were run as `sh COMMAND'
31542# in which case we are not to be found in the path.
31543if test "x$as_myself" = x; then
31544 as_myself=$0
31545fi
31546if test ! -f "$as_myself"; then
31547 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
31548 exit 1
31549fi
31550
31551# Unset variables that we do not need and which cause bugs (e.g. in
31552# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
31553# suppresses any "Segmentation fault" message there. '((' could
31554# trigger a bug in pdksh 5.2.14.
31555for as_var in BASH_ENV ENV MAIL MAILPATH
31556do eval test x\${$as_var+set} = xset \
31557 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
31558done
31559PS1='$ '
31560PS2='> '
31561PS4='+ '
31562
31563# NLS nuisances.
31564LC_ALL=C
31565export LC_ALL
31566LANGUAGE=C
31567export LANGUAGE
31568
31569# CDPATH.
31570(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
31571
31572
d0ac1c44
SM
31573# as_fn_error STATUS ERROR [LINENO LOG_FD]
31574# ----------------------------------------
c971b7fa
PA
31575# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
31576# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 31577# script with STATUS, using 1 if that was 0.
c971b7fa
PA
31578as_fn_error ()
31579{
d0ac1c44
SM
31580 as_status=$1; test $as_status -eq 0 && as_status=1
31581 if test "$4"; then
31582 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
31583 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 31584 fi
d0ac1c44 31585 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
31586 as_fn_exit $as_status
31587} # as_fn_error
31588
31589
31590# as_fn_set_status STATUS
31591# -----------------------
31592# Set $? to STATUS, without forking.
31593as_fn_set_status ()
31594{
31595 return $1
31596} # as_fn_set_status
31597
31598# as_fn_exit STATUS
31599# -----------------
31600# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
31601as_fn_exit ()
31602{
31603 set +e
31604 as_fn_set_status $1
31605 exit $1
31606} # as_fn_exit
31607
31608# as_fn_unset VAR
31609# ---------------
31610# Portably unset VAR.
31611as_fn_unset ()
31612{
31613 { eval $1=; unset $1;}
31614}
31615as_unset=as_fn_unset
31616# as_fn_append VAR VALUE
31617# ----------------------
31618# Append the text in VALUE to the end of the definition contained in VAR. Take
31619# advantage of any shell optimizations that allow amortized linear growth over
31620# repeated appends, instead of the typical quadratic growth present in naive
31621# implementations.
31622if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
31623 eval 'as_fn_append ()
31624 {
31625 eval $1+=\$2
31626 }'
31627else
31628 as_fn_append ()
31629 {
31630 eval $1=\$$1\$2
31631 }
31632fi # as_fn_append
31633
31634# as_fn_arith ARG...
31635# ------------------
31636# Perform arithmetic evaluation on the ARGs, and store the result in the
31637# global $as_val. Take advantage of shells that can avoid forks. The arguments
31638# must be portable across $(()) and expr.
31639if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
31640 eval 'as_fn_arith ()
31641 {
31642 as_val=$(( $* ))
31643 }'
31644else
31645 as_fn_arith ()
31646 {
31647 as_val=`expr "$@" || test $? -eq 1`
31648 }
31649fi # as_fn_arith
31650
31651
31652if expr a : '\(a\)' >/dev/null 2>&1 &&
31653 test "X`expr 00001 : '.*\(...\)'`" = X001; then
31654 as_expr=expr
31655else
31656 as_expr=false
31657fi
31658
31659if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
31660 as_basename=basename
31661else
31662 as_basename=false
31663fi
31664
31665if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
31666 as_dirname=dirname
31667else
31668 as_dirname=false
31669fi
31670
31671as_me=`$as_basename -- "$0" ||
31672$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
31673 X"$0" : 'X\(//\)$' \| \
31674 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
31675$as_echo X/"$0" |
31676 sed '/^.*\/\([^/][^/]*\)\/*$/{
31677 s//\1/
31678 q
31679 }
31680 /^X\/\(\/\/\)$/{
31681 s//\1/
31682 q
31683 }
31684 /^X\/\(\/\).*/{
31685 s//\1/
31686 q
31687 }
31688 s/.*/./; q'`
31689
31690# Avoid depending upon Character Ranges.
31691as_cr_letters='abcdefghijklmnopqrstuvwxyz'
31692as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
31693as_cr_Letters=$as_cr_letters$as_cr_LETTERS
31694as_cr_digits='0123456789'
31695as_cr_alnum=$as_cr_Letters$as_cr_digits
31696
31697ECHO_C= ECHO_N= ECHO_T=
31698case `echo -n x` in #(((((
31699-n*)
31700 case `echo 'xy\c'` in
31701 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
31702 xy) ECHO_C='\c';;
31703 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
31704 ECHO_T=' ';;
31705 esac;;
31706*)
31707 ECHO_N='-n';;
31708esac
31709
31710rm -f conf$$ conf$$.exe conf$$.file
31711if test -d conf$$.dir; then
31712 rm -f conf$$.dir/conf$$.file
31713else
31714 rm -f conf$$.dir
31715 mkdir conf$$.dir 2>/dev/null
31716fi
31717if (echo >conf$$.file) 2>/dev/null; then
31718 if ln -s conf$$.file conf$$ 2>/dev/null; then
31719 as_ln_s='ln -s'
31720 # ... but there are two gotchas:
31721 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
31722 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 31723 # In both cases, we have to default to `cp -pR'.
c971b7fa 31724 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 31725 as_ln_s='cp -pR'
c971b7fa
PA
31726 elif ln conf$$.file conf$$ 2>/dev/null; then
31727 as_ln_s=ln
31728 else
d0ac1c44 31729 as_ln_s='cp -pR'
c971b7fa
PA
31730 fi
31731else
d0ac1c44 31732 as_ln_s='cp -pR'
c971b7fa
PA
31733fi
31734rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
31735rmdir conf$$.dir 2>/dev/null
31736
31737
31738# as_fn_mkdir_p
31739# -------------
31740# Create "$as_dir" as a directory, including parents if necessary.
31741as_fn_mkdir_p ()
31742{
31743
31744 case $as_dir in #(
31745 -*) as_dir=./$as_dir;;
31746 esac
31747 test -d "$as_dir" || eval $as_mkdir_p || {
31748 as_dirs=
31749 while :; do
31750 case $as_dir in #(
31751 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
31752 *) as_qdir=$as_dir;;
31753 esac
31754 as_dirs="'$as_qdir' $as_dirs"
31755 as_dir=`$as_dirname -- "$as_dir" ||
31756$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
31757 X"$as_dir" : 'X\(//\)[^/]' \| \
31758 X"$as_dir" : 'X\(//\)$' \| \
31759 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
31760$as_echo X"$as_dir" |
31761 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
31762 s//\1/
31763 q
31764 }
31765 /^X\(\/\/\)[^/].*/{
31766 s//\1/
31767 q
31768 }
31769 /^X\(\/\/\)$/{
31770 s//\1/
31771 q
31772 }
31773 /^X\(\/\).*/{
31774 s//\1/
31775 q
31776 }
31777 s/.*/./; q'`
31778 test -d "$as_dir" && break
31779 done
31780 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 31781 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
31782
31783
31784} # as_fn_mkdir_p
31785if mkdir -p . 2>/dev/null; then
31786 as_mkdir_p='mkdir -p "$as_dir"'
31787else
31788 test -d ./-p && rmdir ./-p
31789 as_mkdir_p=false
31790fi
31791
d0ac1c44
SM
31792
31793# as_fn_executable_p FILE
31794# -----------------------
31795# Test if FILE is an executable regular file.
31796as_fn_executable_p ()
31797{
31798 test -f "$1" && test -x "$1"
31799} # as_fn_executable_p
31800as_test_x='test -x'
31801as_executable_p=as_fn_executable_p
c971b7fa
PA
31802
31803# Sed expression to map a string onto a valid CPP name.
31804as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
31805
31806# Sed expression to map a string onto a valid variable name.
31807as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
31808
31809
31810exec 6>&1
31811## ----------------------------------- ##
31812## Main body of $CONFIG_STATUS script. ##
31813## ----------------------------------- ##
31814_ASEOF
31815test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
31816
31817cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31818# Save the log message, to keep $0 and so on meaningful, and to
31819# report actual input values of CONFIG_FILES etc. instead of their
31820# values after options handling.
31821ac_log="
d0ac1c44
SM
31822This file was extended by libgnu $as_me UNUSED-VERSION, which was
31823generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
31824
31825 CONFIG_FILES = $CONFIG_FILES
31826 CONFIG_HEADERS = $CONFIG_HEADERS
31827 CONFIG_LINKS = $CONFIG_LINKS
31828 CONFIG_COMMANDS = $CONFIG_COMMANDS
31829 $ $0 $@
31830
31831on `(hostname || uname -n) 2>/dev/null | sed 1q`
31832"
31833
31834_ACEOF
31835
31836case $ac_config_files in *"
31837"*) set x $ac_config_files; shift; ac_config_files=$*;;
31838esac
31839
31840case $ac_config_headers in *"
31841"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
31842esac
31843
31844
31845cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31846# Files that config.status was made for.
31847config_files="$ac_config_files"
31848config_headers="$ac_config_headers"
31849config_commands="$ac_config_commands"
31850
31851_ACEOF
31852
31853cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31854ac_cs_usage="\
31855\`$as_me' instantiates files and other configuration actions
31856from templates according to the current configuration. Unless the files
31857and actions are specified as TAGs, all are instantiated by default.
31858
31859Usage: $0 [OPTION]... [TAG]...
31860
31861 -h, --help print this help, then exit
31862 -V, --version print version number and configuration settings, then exit
d0ac1c44 31863 --config print configuration, then exit
c971b7fa
PA
31864 -q, --quiet, --silent
31865 do not print progress messages
31866 -d, --debug don't remove temporary files
31867 --recheck update $as_me by reconfiguring in the same conditions
31868 --file=FILE[:TEMPLATE]
31869 instantiate the configuration file FILE
31870 --header=FILE[:TEMPLATE]
31871 instantiate the configuration header FILE
31872
31873Configuration files:
31874$config_files
31875
31876Configuration headers:
31877$config_headers
31878
31879Configuration commands:
31880$config_commands
31881
31882Report bugs to the package provider."
31883
31884_ACEOF
31885cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 31886ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
c971b7fa 31887ac_cs_version="\\
d0ac1c44
SM
31888libgnu config.status UNUSED-VERSION
31889configured by $0, generated by GNU Autoconf 2.69,
31890 with options \\"\$ac_cs_config\\"
c971b7fa 31891
d0ac1c44 31892Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
31893This config.status script is free software; the Free Software Foundation
31894gives unlimited permission to copy, distribute and modify it."
31895
31896ac_pwd='$ac_pwd'
31897srcdir='$srcdir'
31898INSTALL='$INSTALL'
31899MKDIR_P='$MKDIR_P'
31900AWK='$AWK'
31901test -n "\$AWK" || AWK=awk
31902_ACEOF
31903
31904cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31905# The default lists apply if the user does not specify any file.
31906ac_need_defaults=:
31907while test $# != 0
31908do
31909 case $1 in
d0ac1c44 31910 --*=?*)
c971b7fa
PA
31911 ac_option=`expr "X$1" : 'X\([^=]*\)='`
31912 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
31913 ac_shift=:
31914 ;;
d0ac1c44
SM
31915 --*=)
31916 ac_option=`expr "X$1" : 'X\([^=]*\)='`
31917 ac_optarg=
31918 ac_shift=:
31919 ;;
c971b7fa
PA
31920 *)
31921 ac_option=$1
31922 ac_optarg=$2
31923 ac_shift=shift
31924 ;;
31925 esac
31926
31927 case $ac_option in
31928 # Handling of the options.
31929 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
31930 ac_cs_recheck=: ;;
31931 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
31932 $as_echo "$ac_cs_version"; exit ;;
d0ac1c44
SM
31933 --config | --confi | --conf | --con | --co | --c )
31934 $as_echo "$ac_cs_config"; exit ;;
c971b7fa
PA
31935 --debug | --debu | --deb | --de | --d | -d )
31936 debug=: ;;
31937 --file | --fil | --fi | --f )
31938 $ac_shift
31939 case $ac_optarg in
31940 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
d0ac1c44 31941 '') as_fn_error $? "missing file argument" ;;
c971b7fa
PA
31942 esac
31943 as_fn_append CONFIG_FILES " '$ac_optarg'"
31944 ac_need_defaults=false;;
31945 --header | --heade | --head | --hea )
31946 $ac_shift
31947 case $ac_optarg in
31948 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
31949 esac
31950 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
31951 ac_need_defaults=false;;
31952 --he | --h)
31953 # Conflict between --help and --header
d0ac1c44 31954 as_fn_error $? "ambiguous option: \`$1'
c971b7fa
PA
31955Try \`$0 --help' for more information.";;
31956 --help | --hel | -h )
31957 $as_echo "$ac_cs_usage"; exit ;;
31958 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
31959 | -silent | --silent | --silen | --sile | --sil | --si | --s)
31960 ac_cs_silent=: ;;
31961
31962 # This is an error.
d0ac1c44 31963 -*) as_fn_error $? "unrecognized option: \`$1'
c971b7fa
PA
31964Try \`$0 --help' for more information." ;;
31965
31966 *) as_fn_append ac_config_targets " $1"
31967 ac_need_defaults=false ;;
31968
31969 esac
31970 shift
31971done
31972
31973ac_configure_extra_args=
31974
31975if $ac_cs_silent; then
31976 exec 6>/dev/null
31977 ac_configure_extra_args="$ac_configure_extra_args --silent"
31978fi
31979
31980_ACEOF
31981cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
31982if \$ac_cs_recheck; then
d0ac1c44 31983 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
c971b7fa
PA
31984 shift
31985 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
31986 CONFIG_SHELL='$SHELL'
31987 export CONFIG_SHELL
31988 exec "\$@"
31989fi
31990
31991_ACEOF
31992cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
31993exec 5>>config.log
31994{
31995 echo
31996 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
31997## Running $as_me. ##
31998_ASBOX
31999 $as_echo "$ac_log"
32000} >&5
32001
32002_ACEOF
32003cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32004#
32005# INIT-COMMANDS
32006#
32007AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
32008
32009_ACEOF
32010
32011cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32012
32013# Handling of arguments.
32014for ac_config_target in $ac_config_targets
32015do
32016 case $ac_config_target in
32017 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
32018 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
361cb219 32019 "Makefile.gnulib.inc") CONFIG_FILES="$CONFIG_FILES Makefile.gnulib.inc" ;;
c971b7fa
PA
32020 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
32021 "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;;
32022 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
32023
d0ac1c44 32024 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
c971b7fa
PA
32025 esac
32026done
32027
32028
32029# If the user did not use the arguments to specify the items to instantiate,
32030# then the envvar interface is used. Set only those that are not.
32031# We use the long form for the default assignment because of an extremely
32032# bizarre bug on SunOS 4.1.3.
32033if $ac_need_defaults; then
32034 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
32035 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
32036 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
32037fi
32038
32039# Have a temporary directory for convenience. Make it in the build tree
32040# simply because there is no reason against having it here, and in addition,
32041# creating and moving files from /tmp can sometimes cause problems.
32042# Hook for its removal unless debugging.
32043# Note that there is a small window in which the directory will not be cleaned:
32044# after its creation but before its name has been assigned to `$tmp'.
32045$debug ||
32046{
d0ac1c44 32047 tmp= ac_tmp=
c971b7fa 32048 trap 'exit_status=$?
d0ac1c44
SM
32049 : "${ac_tmp:=$tmp}"
32050 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
c971b7fa
PA
32051' 0
32052 trap 'as_fn_exit 1' 1 2 13 15
32053}
32054# Create a (secure) tmp directory for tmp files.
32055
32056{
32057 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
d0ac1c44 32058 test -d "$tmp"
c971b7fa
PA
32059} ||
32060{
32061 tmp=./conf$$-$RANDOM
32062 (umask 077 && mkdir "$tmp")
d0ac1c44
SM
32063} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
32064ac_tmp=$tmp
c971b7fa
PA
32065
32066# Set up the scripts for CONFIG_FILES section.
32067# No need to generate them if there are no CONFIG_FILES.
32068# This happens for instance with `./config.status config.h'.
32069if test -n "$CONFIG_FILES"; then
32070
32071
32072ac_cr=`echo X | tr X '\015'`
32073# On cygwin, bash can eat \r inside `` if the user requested igncr.
32074# But we know of no other shell where ac_cr would be empty at this
32075# point, so we can use a bashism as a fallback.
32076if test "x$ac_cr" = x; then
32077 eval ac_cr=\$\'\\r\'
32078fi
32079ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
32080if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
d0ac1c44 32081 ac_cs_awk_cr='\\r'
c971b7fa
PA
32082else
32083 ac_cs_awk_cr=$ac_cr
32084fi
32085
d0ac1c44 32086echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
c971b7fa
PA
32087_ACEOF
32088
32089
32090{
32091 echo "cat >conf$$subs.awk <<_ACEOF" &&
32092 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
32093 echo "_ACEOF"
32094} >conf$$subs.sh ||
d0ac1c44
SM
32095 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
32096ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
c971b7fa
PA
32097ac_delim='%!_!# '
32098for ac_last_try in false false false false false :; do
32099 . ./conf$$subs.sh ||
d0ac1c44 32100 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
32101
32102 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
32103 if test $ac_delim_n = $ac_delim_num; then
32104 break
32105 elif $ac_last_try; then
d0ac1c44 32106 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
32107 else
32108 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
32109 fi
32110done
32111rm -f conf$$subs.sh
32112
32113cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 32114cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
c971b7fa
PA
32115_ACEOF
32116sed -n '
32117h
32118s/^/S["/; s/!.*/"]=/
32119p
32120g
32121s/^[^!]*!//
32122:repl
32123t repl
32124s/'"$ac_delim"'$//
32125t delim
32126:nl
32127h
d0ac1c44 32128s/\(.\{148\}\)..*/\1/
c971b7fa
PA
32129t more1
32130s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
32131p
32132n
32133b repl
32134:more1
32135s/["\\]/\\&/g; s/^/"/; s/$/"\\/
32136p
32137g
32138s/.\{148\}//
32139t nl
32140:delim
32141h
d0ac1c44 32142s/\(.\{148\}\)..*/\1/
c971b7fa
PA
32143t more2
32144s/["\\]/\\&/g; s/^/"/; s/$/"/
32145p
32146b
32147:more2
32148s/["\\]/\\&/g; s/^/"/; s/$/"\\/
32149p
32150g
32151s/.\{148\}//
32152t delim
32153' <conf$$subs.awk | sed '
32154/^[^""]/{
32155 N
32156 s/\n//
32157}
32158' >>$CONFIG_STATUS || ac_write_fail=1
32159rm -f conf$$subs.awk
32160cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32161_ACAWK
d0ac1c44 32162cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
c971b7fa
PA
32163 for (key in S) S_is_set[key] = 1
32164 FS = "\a"
32165
32166}
32167{
32168 line = $ 0
32169 nfields = split(line, field, "@")
32170 substed = 0
32171 len = length(field[1])
32172 for (i = 2; i < nfields; i++) {
32173 key = field[i]
32174 keylen = length(key)
32175 if (S_is_set[key]) {
32176 value = S[key]
32177 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
32178 len += length(value) + length(field[++i])
32179 substed = 1
32180 } else
32181 len += 1 + keylen
32182 }
32183
32184 print line
32185}
32186
32187_ACAWK
32188_ACEOF
32189cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32190if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
32191 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
32192else
32193 cat
d0ac1c44
SM
32194fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
32195 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
c971b7fa
PA
32196_ACEOF
32197
d0ac1c44
SM
32198# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
32199# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
c971b7fa
PA
32200# trailing colons and then remove the whole line if VPATH becomes empty
32201# (actually we leave an empty line to preserve line numbers).
32202if test "x$srcdir" = x.; then
d0ac1c44
SM
32203 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
32204h
32205s///
32206s/^/:/
32207s/[ ]*$/:/
32208s/:\$(srcdir):/:/g
32209s/:\${srcdir}:/:/g
32210s/:@srcdir@:/:/g
32211s/^:*//
c971b7fa 32212s/:*$//
d0ac1c44
SM
32213x
32214s/\(=[ ]*\).*/\1/
32215G
32216s/\n//
c971b7fa
PA
32217s/^[^=]*=[ ]*$//
32218}'
32219fi
32220
32221cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32222fi # test -n "$CONFIG_FILES"
32223
32224# Set up the scripts for CONFIG_HEADERS section.
32225# No need to generate them if there are no CONFIG_HEADERS.
32226# This happens for instance with `./config.status Makefile'.
32227if test -n "$CONFIG_HEADERS"; then
d0ac1c44 32228cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
c971b7fa
PA
32229BEGIN {
32230_ACEOF
32231
32232# Transform confdefs.h into an awk script `defines.awk', embedded as
32233# here-document in config.status, that substitutes the proper values into
32234# config.h.in to produce config.h.
32235
32236# Create a delimiter string that does not exist in confdefs.h, to ease
32237# handling of long lines.
32238ac_delim='%!_!# '
32239for ac_last_try in false false :; do
d0ac1c44
SM
32240 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
32241 if test -z "$ac_tt"; then
c971b7fa
PA
32242 break
32243 elif $ac_last_try; then
d0ac1c44 32244 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
c971b7fa
PA
32245 else
32246 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
32247 fi
32248done
32249
32250# For the awk script, D is an array of macro values keyed by name,
32251# likewise P contains macro parameters if any. Preserve backslash
32252# newline sequences.
32253
32254ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
32255sed -n '
32256s/.\{148\}/&'"$ac_delim"'/g
32257t rset
32258:rset
32259s/^[ ]*#[ ]*define[ ][ ]*/ /
32260t def
32261d
32262:def
32263s/\\$//
32264t bsnl
32265s/["\\]/\\&/g
32266s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
32267D["\1"]=" \3"/p
32268s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
32269d
32270:bsnl
32271s/["\\]/\\&/g
32272s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
32273D["\1"]=" \3\\\\\\n"\\/p
32274t cont
32275s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
32276t cont
32277d
32278:cont
32279n
32280s/.\{148\}/&'"$ac_delim"'/g
32281t clear
32282:clear
32283s/\\$//
32284t bsnlc
32285s/["\\]/\\&/g; s/^/"/; s/$/"/p
32286d
32287:bsnlc
32288s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
32289b cont
32290' <confdefs.h | sed '
32291s/'"$ac_delim"'/"\\\
32292"/g' >>$CONFIG_STATUS || ac_write_fail=1
32293
32294cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32295 for (key in D) D_is_set[key] = 1
32296 FS = "\a"
32297}
32298/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
32299 line = \$ 0
32300 split(line, arg, " ")
32301 if (arg[1] == "#") {
32302 defundef = arg[2]
32303 mac1 = arg[3]
32304 } else {
32305 defundef = substr(arg[1], 2)
32306 mac1 = arg[2]
32307 }
32308 split(mac1, mac2, "(") #)
32309 macro = mac2[1]
32310 prefix = substr(line, 1, index(line, defundef) - 1)
32311 if (D_is_set[macro]) {
32312 # Preserve the white space surrounding the "#".
32313 print prefix "define", macro P[macro] D[macro]
32314 next
32315 } else {
32316 # Replace #undef with comments. This is necessary, for example,
32317 # in the case of _POSIX_SOURCE, which is predefined and required
32318 # on some systems where configure will not decide to define it.
32319 if (defundef == "undef") {
32320 print "/*", prefix defundef, macro, "*/"
32321 next
32322 }
32323 }
32324}
32325{ print }
32326_ACAWK
32327_ACEOF
32328cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
d0ac1c44 32329 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
c971b7fa
PA
32330fi # test -n "$CONFIG_HEADERS"
32331
32332
32333eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
32334shift
32335for ac_tag
32336do
32337 case $ac_tag in
32338 :[FHLC]) ac_mode=$ac_tag; continue;;
32339 esac
32340 case $ac_mode$ac_tag in
32341 :[FHL]*:*);;
d0ac1c44 32342 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
c971b7fa
PA
32343 :[FH]-) ac_tag=-:-;;
32344 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
32345 esac
32346 ac_save_IFS=$IFS
32347 IFS=:
32348 set x $ac_tag
32349 IFS=$ac_save_IFS
32350 shift
32351 ac_file=$1
32352 shift
32353
32354 case $ac_mode in
32355 :L) ac_source=$1;;
32356 :[FH])
32357 ac_file_inputs=
32358 for ac_f
32359 do
32360 case $ac_f in
d0ac1c44 32361 -) ac_f="$ac_tmp/stdin";;
c971b7fa
PA
32362 *) # Look for the file first in the build tree, then in the source tree
32363 # (if the path is not absolute). The absolute path cannot be DOS-style,
32364 # because $ac_f cannot contain `:'.
32365 test -f "$ac_f" ||
32366 case $ac_f in
32367 [\\/$]*) false;;
32368 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
32369 esac ||
d0ac1c44 32370 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
c971b7fa
PA
32371 esac
32372 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
32373 as_fn_append ac_file_inputs " '$ac_f'"
32374 done
32375
32376 # Let's still pretend it is `configure' which instantiates (i.e., don't
32377 # use $as_me), people would be surprised to read:
32378 # /* config.h. Generated by config.status. */
32379 configure_input='Generated from '`
32380 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
32381 `' by configure.'
32382 if test x"$ac_file" != x-; then
32383 configure_input="$ac_file. $configure_input"
32384 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
32385$as_echo "$as_me: creating $ac_file" >&6;}
32386 fi
32387 # Neutralize special characters interpreted by sed in replacement strings.
32388 case $configure_input in #(
32389 *\&* | *\|* | *\\* )
32390 ac_sed_conf_input=`$as_echo "$configure_input" |
32391 sed 's/[\\\\&|]/\\\\&/g'`;; #(
32392 *) ac_sed_conf_input=$configure_input;;
32393 esac
32394
32395 case $ac_tag in
d0ac1c44
SM
32396 *:-:* | *:-) cat >"$ac_tmp/stdin" \
32397 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
c971b7fa
PA
32398 esac
32399 ;;
32400 esac
32401
32402 ac_dir=`$as_dirname -- "$ac_file" ||
32403$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32404 X"$ac_file" : 'X\(//\)[^/]' \| \
32405 X"$ac_file" : 'X\(//\)$' \| \
32406 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
32407$as_echo X"$ac_file" |
32408 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32409 s//\1/
32410 q
32411 }
32412 /^X\(\/\/\)[^/].*/{
32413 s//\1/
32414 q
32415 }
32416 /^X\(\/\/\)$/{
32417 s//\1/
32418 q
32419 }
32420 /^X\(\/\).*/{
32421 s//\1/
32422 q
32423 }
32424 s/.*/./; q'`
32425 as_dir="$ac_dir"; as_fn_mkdir_p
32426 ac_builddir=.
32427
32428case "$ac_dir" in
32429.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
32430*)
32431 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
32432 # A ".." for each directory in $ac_dir_suffix.
32433 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
32434 case $ac_top_builddir_sub in
32435 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
32436 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
32437 esac ;;
32438esac
32439ac_abs_top_builddir=$ac_pwd
32440ac_abs_builddir=$ac_pwd$ac_dir_suffix
32441# for backward compatibility:
32442ac_top_builddir=$ac_top_build_prefix
32443
32444case $srcdir in
32445 .) # We are building in place.
32446 ac_srcdir=.
32447 ac_top_srcdir=$ac_top_builddir_sub
32448 ac_abs_top_srcdir=$ac_pwd ;;
32449 [\\/]* | ?:[\\/]* ) # Absolute name.
32450 ac_srcdir=$srcdir$ac_dir_suffix;
32451 ac_top_srcdir=$srcdir
32452 ac_abs_top_srcdir=$srcdir ;;
32453 *) # Relative name.
32454 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
32455 ac_top_srcdir=$ac_top_build_prefix$srcdir
32456 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
32457esac
32458ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
32459
32460
32461 case $ac_mode in
32462 :F)
32463 #
32464 # CONFIG_FILE
32465 #
32466
32467 case $INSTALL in
32468 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
32469 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
32470 esac
32471 ac_MKDIR_P=$MKDIR_P
32472 case $MKDIR_P in
32473 [\\/$]* | ?:[\\/]* ) ;;
32474 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
32475 esac
32476_ACEOF
32477
32478cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32479# If the template does not know about datarootdir, expand it.
32480# FIXME: This hack should be removed a few years after 2.60.
32481ac_datarootdir_hack=; ac_datarootdir_seen=
32482ac_sed_dataroot='
32483/datarootdir/ {
32484 p
32485 q
32486}
32487/@datadir@/p
32488/@docdir@/p
32489/@infodir@/p
32490/@localedir@/p
32491/@mandir@/p'
32492case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
32493*datarootdir*) ac_datarootdir_seen=yes;;
32494*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
32495 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
32496$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
32497_ACEOF
32498cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32499 ac_datarootdir_hack='
32500 s&@datadir@&$datadir&g
32501 s&@docdir@&$docdir&g
32502 s&@infodir@&$infodir&g
32503 s&@localedir@&$localedir&g
32504 s&@mandir@&$mandir&g
32505 s&\\\${datarootdir}&$datarootdir&g' ;;
32506esac
32507_ACEOF
32508
32509# Neutralize VPATH when `$srcdir' = `.'.
32510# Shell code in configure.ac might set extrasub.
32511# FIXME: do we really want to maintain this feature?
32512cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
32513ac_sed_extra="$ac_vpsub
32514$extrasub
32515_ACEOF
32516cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
32517:t
32518/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
32519s|@configure_input@|$ac_sed_conf_input|;t t
32520s&@top_builddir@&$ac_top_builddir_sub&;t t
32521s&@top_build_prefix@&$ac_top_build_prefix&;t t
32522s&@srcdir@&$ac_srcdir&;t t
32523s&@abs_srcdir@&$ac_abs_srcdir&;t t
32524s&@top_srcdir@&$ac_top_srcdir&;t t
32525s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
32526s&@builddir@&$ac_builddir&;t t
32527s&@abs_builddir@&$ac_abs_builddir&;t t
32528s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
32529s&@INSTALL@&$ac_INSTALL&;t t
32530s&@MKDIR_P@&$ac_MKDIR_P&;t t
32531$ac_datarootdir_hack
32532"
d0ac1c44
SM
32533eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
32534 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32535
32536test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
d0ac1c44
SM
32537 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
32538 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
32539 "$ac_tmp/out"`; test -z "$ac_out"; } &&
c971b7fa 32540 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 32541which seems to be undefined. Please make sure it is defined" >&5
c971b7fa 32542$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 32543which seems to be undefined. Please make sure it is defined" >&2;}
c971b7fa 32544
d0ac1c44 32545 rm -f "$ac_tmp/stdin"
c971b7fa 32546 case $ac_file in
d0ac1c44
SM
32547 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
32548 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
c971b7fa 32549 esac \
d0ac1c44 32550 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32551 ;;
32552 :H)
32553 #
32554 # CONFIG_HEADER
32555 #
32556 if test x"$ac_file" != x-; then
32557 {
32558 $as_echo "/* $configure_input */" \
d0ac1c44
SM
32559 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
32560 } >"$ac_tmp/config.h" \
32561 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
32562 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
c971b7fa
PA
32563 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
32564$as_echo "$as_me: $ac_file is unchanged" >&6;}
32565 else
32566 rm -f "$ac_file"
d0ac1c44
SM
32567 mv "$ac_tmp/config.h" "$ac_file" \
32568 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
32569 fi
32570 else
32571 $as_echo "/* $configure_input */" \
d0ac1c44
SM
32572 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
32573 || as_fn_error $? "could not create -" "$LINENO" 5
c971b7fa
PA
32574 fi
32575# Compute "$ac_file"'s index in $config_headers.
32576_am_arg="$ac_file"
32577_am_stamp_count=1
32578for _am_header in $config_headers :; do
32579 case $_am_header in
32580 $_am_arg | $_am_arg:* )
32581 break ;;
32582 * )
32583 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
32584 esac
32585done
32586echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
32587$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32588 X"$_am_arg" : 'X\(//\)[^/]' \| \
32589 X"$_am_arg" : 'X\(//\)$' \| \
32590 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
32591$as_echo X"$_am_arg" |
32592 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32593 s//\1/
32594 q
32595 }
32596 /^X\(\/\/\)[^/].*/{
32597 s//\1/
32598 q
32599 }
32600 /^X\(\/\/\)$/{
32601 s//\1/
32602 q
32603 }
32604 /^X\(\/\).*/{
32605 s//\1/
32606 q
32607 }
32608 s/.*/./; q'`/stamp-h$_am_stamp_count
32609 ;;
32610
32611 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
32612$as_echo "$as_me: executing $ac_file commands" >&6;}
32613 ;;
32614 esac
32615
32616
32617 case $ac_file$ac_mode in
32618 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
d0ac1c44 32619 # Older Autoconf quotes --file arguments for eval, but not when files
c971b7fa
PA
32620 # are listed without --file. Let's play safe and only enable the eval
32621 # if we detect the quoting.
32622 case $CONFIG_FILES in
32623 *\'*) eval set x "$CONFIG_FILES" ;;
32624 *) set x $CONFIG_FILES ;;
32625 esac
32626 shift
32627 for mf
32628 do
32629 # Strip MF so we end up with the name of the file.
32630 mf=`echo "$mf" | sed -e 's/:.*$//'`
32631 # Check whether this is an Automake generated Makefile or not.
d0ac1c44 32632 # We used to match only the files named 'Makefile.in', but
c971b7fa
PA
32633 # some people rename them; so instead we look at the file content.
32634 # Grep'ing the first line is not enough: some people post-process
32635 # each Makefile.in and add a new line on top of each file to say so.
32636 # Grep'ing the whole file is not good either: AIX grep has a line
32637 # limit of 2048, but all sed's we know have understand at least 4000.
32638 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
32639 dirpart=`$as_dirname -- "$mf" ||
32640$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32641 X"$mf" : 'X\(//\)[^/]' \| \
32642 X"$mf" : 'X\(//\)$' \| \
32643 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
32644$as_echo X"$mf" |
32645 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32646 s//\1/
32647 q
32648 }
32649 /^X\(\/\/\)[^/].*/{
32650 s//\1/
32651 q
32652 }
32653 /^X\(\/\/\)$/{
32654 s//\1/
32655 q
32656 }
32657 /^X\(\/\).*/{
32658 s//\1/
32659 q
32660 }
32661 s/.*/./; q'`
32662 else
32663 continue
32664 fi
32665 # Extract the definition of DEPDIR, am__include, and am__quote
d0ac1c44 32666 # from the Makefile without running 'make'.
c971b7fa
PA
32667 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
32668 test -z "$DEPDIR" && continue
32669 am__include=`sed -n 's/^am__include = //p' < "$mf"`
d0ac1c44 32670 test -z "$am__include" && continue
c971b7fa 32671 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
c971b7fa
PA
32672 # Find all dependency output files, they are included files with
32673 # $(DEPDIR) in their names. We invoke sed twice because it is the
32674 # simplest approach to changing $(DEPDIR) to its actual value in the
32675 # expansion.
32676 for file in `sed -n "
32677 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
d0ac1c44 32678 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
c971b7fa
PA
32679 # Make sure the directory exists.
32680 test -f "$dirpart/$file" && continue
32681 fdir=`$as_dirname -- "$file" ||
32682$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
32683 X"$file" : 'X\(//\)[^/]' \| \
32684 X"$file" : 'X\(//\)$' \| \
32685 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
32686$as_echo X"$file" |
32687 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
32688 s//\1/
32689 q
32690 }
32691 /^X\(\/\/\)[^/].*/{
32692 s//\1/
32693 q
32694 }
32695 /^X\(\/\/\)$/{
32696 s//\1/
32697 q
32698 }
32699 /^X\(\/\).*/{
32700 s//\1/
32701 q
32702 }
32703 s/.*/./; q'`
32704 as_dir=$dirpart/$fdir; as_fn_mkdir_p
32705 # echo "creating $dirpart/$file"
32706 echo '# dummy' > "$dirpart/$file"
32707 done
32708 done
32709}
32710 ;;
32711 "default":C)
32712case x$CONFIG_HEADERS in
32713xconfig.h:config.in)
32714echo > stamp-h ;;
32715esac
32716 ;;
32717
32718 esac
32719done # for ac_tag
32720
32721
32722as_fn_exit 0
32723_ACEOF
32724ac_clean_files=$ac_clean_files_save
32725
32726test $ac_write_fail = 0 ||
d0ac1c44 32727 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
32728
32729
32730# configure is writing to config.log, and then calls config.status.
32731# config.status does its own redirection, appending to config.log.
32732# Unfortunately, on DOS this fails, as config.log is still kept open
32733# by configure, so config.status won't be able to write to it; its
32734# output is simply discarded. So we exec the FD to /dev/null,
32735# effectively closing config.log, so it can be properly (re)opened and
32736# appended to by config.status. When coming back to configure, we
32737# need to make the FD available again.
32738if test "$no_create" != yes; then
32739 ac_cs_success=:
32740 ac_config_status_args=
32741 test "$silent" = yes &&
32742 ac_config_status_args="$ac_config_status_args --quiet"
32743 exec 5>/dev/null
32744 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
32745 exec 5>>config.log
32746 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
32747 # would make configure fail if this is the last instruction.
d0ac1c44 32748 $ac_cs_success || as_fn_exit 1
c971b7fa
PA
32749fi
32750if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
32751 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
32752$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
32753fi
32754
32755
32756exit 0
This page took 2.385617 seconds and 4 git commands to generate.